Following is how you can check if a string is an Enum constant.This is often needed if you get User input as a string and want to call a method that requires an enum.I post this here as I don’t want to search the web for it, as there you often get a stackoverflow answer which is not as performant as the code below. Now I can just grab it from my own blog.
Read MoreI am not too much a fan of what we call “artificial intelligence” today, as it is in most cases nothing else than very sophisticated pattern recognition. However, sometimes there are some interesting uses for it.Today I tried to get to learn a little bit of Middle English or Shakespearean English, just because it sounds so archaic and kind of fun. I asked GPT to give me sentences that I can type back to it, while also giving me a translation of each sentence and definitions for each new Shakespearean word we encounter. It worked pretty well.At the end I asked it to make me a full list of all the sentences, translations and definition. Here the output (Behold! Thy I hath not granted the guarantee that the GPT response art correct!). List of Sentences: List of Shakespearean words and their definitions with translations:
Read More