• Activity
  • Votes
  • Comments
  • New
  • All activity
  • Showing only topics with the tag "user created". Back to normal view
    1. Food Escapades & Curry Fridays ! Koli erachi molagu // Chicken Pepper Fry

      I went today to the store to buy some chicken and coconut for this recipe and, man, does it feel unreal to have to wait in line to even get into something like a Maxi! it makes perfect sense, but...

      I went today to the store to buy some chicken and coconut for this recipe and, man, does it feel unreal to have to wait in line to even get into something like a Maxi! it makes perfect sense, but it just feels so unreal still hahahah. Today I have cooked up a little Chicken Pepper Fry, which is, among other things, another very simple dish that could be made in any weeknight, though it isn't as easy as something like last week's chana masala. Ended up tasting a lot like Curry leaves and less like coconut, which I am not complaining about! Curry leaves are awesome. I do think this was missing some sort of punch, though. Felt a bit same-y to a lot of the other recipes I had made previously. But still, very hearty and delish nonetheless :P

      Also, I'm thinking of using other sources for Curry recipes in the future, so be on the look out for that!

      Picture of the Dish: https://imgur.com/a/dlbOIwA
      Recipe: https://imgur.com/a/ENWAnGE

      Question of the day: How has the recent COVID-19 pandemic, if at all, modified the way you eat on a daily basis?

      Have a great day <3
      Tomi, your friendly neighbourhood marshmallow~

      6 votes
    2. Food Escapades & Curry Fridays ! Chana Masala

      I hadn't realized that every single recipe I had made so far has included some sort of meat in it, which, coming from indian cuisine, I didn't really expect at all... Anyhow, this week I decided...

      I hadn't realized that every single recipe I had made so far has included some sort of meat in it, which, coming from indian cuisine, I didn't really expect at all...

      Anyhow, this week I decided on making a Chana Masala! A recipe I've been eyeing out for some time, it doesn't actually come from the curry cookbook I had been using so far ! It came from a Binging With Babish video, which he uploaded not long ago. Honestly, I've always been such a big fan of chickpeas, which makes me wonder why I didn't make this recipe any sooner :P. The recipe is real simple; crushed tomatoes, spices, onion, and chickpeas! A very simple dish to make, it resembles a lot of the other 'weeknight curries' I've made, which might be a big reason why I love it so much ahahhaha. It feels so rewarding to make a really nice dish out of practically entirely canned ingredients, it's incredible really ! In times where it seems like everyone is stockpiling food, it's nice to have something relatively shelf stable and reliable to have in one's pantry, and something like garbanzo beans really are something of a hearty meal that I'd love to enjoy more of :)

      Side note, this is the first time I try making Basmati rice with the starches sifted, which ended up making for some real tasty rice :P definitely recommend, it makes for a better side dish !!!

      Picture of the Dish: https://imgur.com/a/2ZrPQea
      Recipe: https://youtu.be/LfzKfD_WuDM

      Question of the day: What is your favourite Vegan meal?

      Have a great day <3
      Tomi, your friendly neighbourhood marshmallow~

      13 votes
    3. Food Escapades & Curry Fridays ! Weeks 1 - 7 Post

      hello Tildes! (again hahahahah). As I explained on my first post here, I had already started blogging my curry cookings elsewhere before finally deciding to post them here. I was asked by user...

      hello Tildes! (again hahahahah). As I explained on my first post here, I had already started blogging my curry cookings elsewhere before finally deciding to post them here. I was asked by user @cfabbro to post the others on this website, so here I am, making a big post for the first 7 of 9 curries I have made so far ! hope you enjoy :P (sorry for the low quality on some of these pictures hahahah, I try my best !)

      Curry #1: Rendang daging / Beef Rendang

      The first dish I decided to cook up was this dish from Malasya, it was beef rendang. A dish consisting of weird unknown ingredients to me, like galangal, a nice cut of braised beef and a metric fuckton of coconut. Like, it mostly tasted like coconut with a bit of galangal and lemongrass. And I am definitely not complaining. Ive never really tasted anything like it, and it really felt like a great experience to make it. Hadn't had this much fun in a while ahahahah. This definitely left a good mark on me, starting this whole stupid ass idea pretty well.

      Picture of the dish: https://imgur.com/a/4QfLDyS
      Recipe: https://imgur.com/a/Fdbll1E

      //

      Curry #2: Kerala Lamb

      This was a dish consisting of, yet again, a fuckton of coconut. This had also a lot of mustard seeds and whatnot. Ended up tasting interesting too, although it was very similar to the rendang I made the week before. Which is surprising because theyre from two completely different parts of the world (first one is from South East Asia, this one was from India.) A good, well rounded dish that I would've probably enjoyed more if I didn't make it a week after the rendang.

      Also, something that ended up being a mistake was making this with bone in storebought lamb cut into cubes, it ended up being too boney and didn't have enough meat. Kind of a letdown, but that's my own incompetence shining through.

      Picture of the dish: https://imgur.com/a/LnoRoEN
      Recipe: https://imgur.com/a/AxVBkKm

      //

      Curry #3: Murgh makhani / Old Delhi Style Chicken Curry

      For the third week I decided to make a more classic dish, butter chicken! Which had less butter than I thought it did, but that's besides the point. This was the first dish where the meat wasn't entirely braised, which made it have a different texture to the last two ones. We used chicken breast, which might've not been the best idea, it came out a bit dry. This recipe calls for garam masala, which is a pretty classic spice mix used for a lot of different recipes. I can tell ya, it's pretty amazing. The whole recipe was a joy to make, and ended up being the best recipe I had eaten so far honestly. I'd highly recommend doing this !

      Also, shoutout to my homemade naan bread that ended up being p sucky. Will have to keep experimenting until I perfect the recipe.

      Picture of the dish: https://imgur.com/a/QrxP9T0
      Recipe: https://imgur.com/a/6Kcbpc9

      //

      Curry #4: Kozhy kuruma / South Indian Chicken Korma

      A month into this curry business, and also the third time I try to make naan and the only time it has come out well, very happy with the bread ! The recipe calls for mostly a water and spice based "broth", no sort of milk product like the other ones I made. Also called for some cachews which was surprising. It's genuinely surprising how much you can do with water and some spices, I'm genuinely really surprised. By far the easiest recipe I've made so far and honestly well worth it. Can see this as a recipe you could make as a weeknight dish. With the naan bread coming out so well, I think this was my favourite experience making one of these !

      Picture of the dish: https://imgur.com/a/4Hp8Yxk
      Recipe: https://imgur.com/a/2PKt7II

      //

      Curry #5: Jamaican Goat Curry

      So I had been eyeing this recipe for maybe a month or so now, and I'm very happy to finally make it. Funnily enough, I didn't get the opportunity to use goat for this recipe. My dad and I went through the entire city, butcher by butcher, trying to find some god damn goat, but to no avail. That's alright, though, we just used lamb instead. The recipe called for "Caribbean curry powder" which was very vague in in of itself, so we found this real nice spice mix from the spice market near our house that kind of made this dish what it ended up being. I don't think this ended up tasting anything like what it was supposed to taste like, but who's to say that's a bad thing ? I loved this as a curry, even though the experience making it ended up being a bit tedious (going around the city trying to find something you ultimately don't find really gets you a bit cranky hahah) but well worth it after all. I think my mom is starting to get tired of this silly tradition I've cooked up, but I don't really think I'll be stopping anytime soon.

      The curry ended up being very coconut-y like every other coconut milk based recipes I've made so far, but so far I think it's been the best of it's kind. Definitely does not taste like anything from India, which makes sense since, it's, y'know, carribean. This being pretty different but similar to things I've eaten before made it a fun and enjoyable experience in the end. Definitely recommend you make something like this someday, maybe with some real goat instead of lamb.

      Picture of the dish: https://imgur.com/a/2K6Yw5H
      Recipe: https://imgur.com/a/Bh72GGt

      //

      Curry #6: Gang keo goung / Green shrimp curry with fresh dill

      Sixth curry in, this one was surprisingly incredibly simple. It had like three steps to it. Really cost efficient, too. This recipe called for some lime leaves, which give a sort of orange peel flavour to the whole dish. I'm not the biggest fan of this, like I think it's good but it's not something I seek. I do think it worked well with this specific recipe, though. Other than that, the potatoes were really nice and tender inside and the curry paste we used had nice flavours. We also added some peanuts alongside the dill for garnish, which wasn't part of the recipe but it really brought the thing up to a new level. Overall, I am very satisfied with it, but it might still be something that I need to indulge a little bit more in to find its truest colours.

      Picture of the dish: https://imgur.com/a/Vq7Wxlv
      Recipe: https://imgur.com/a/8OpcWRd

      //

      Curry #7: Geng Massaman / Muslim-style curry of duck with potatoes and onions

      Genuinely one of the strangest cooking experienced I've lived through, I learned what people meant by "don't touch your Weiner after cooking with jalapeños" maybe in too much of a hard way... Sheesh... And just, in general,

      What the fuck is this dish?

      It calls for tamarind water, pineapple juice, cumin, lemongrass, sugar !!!!, coconut milk and cream, cinnamon, cloves, garlic, shallots, and so much more. I didn't even cut the lemongrass well so the paste I ended up making was really fiberous and it wasn't that great of a paste but God damn those flavour combos are off the charts ! I've never eaten anything like this before, it tastes like a sweet soup that also managed to be spicy and taste like god damn onions !!! You had to DEEP FRY the god damn duck, potatoes, and even peanuts!!!! DEEP FRIED PEANUTS !!!! that means some idiot like me who picked up this book and decided to make this recipe had possibly deep fried peanuts in God damn peanut oil !!! (Which is honestly pretty hilarious to think of)

      I genuinely don't know what to say other than I had a blast making it. My dick basically caught on fire and we made a huge mess. One of the best cooking experiences I've ever had and the result doesn't even look like the recipe we tried to make !!!!

      The flavours were so complex it just blew my fucking mind, I love this so much. If you're looking to expand your palette and wanna try something real different from any other Western culture I fucking recommend this. Solid solid dish, and would be better if the execution wasn't so disoriented and disorganized.

      Picture of the dish: https://imgur.com/a/GzT7sjF
      Recipe: https://imgur.com/a/UbAAJ8n

      //

      Today's question: what makes you personally enjoy home cooking? What makes it something you desire to do?

      Have a great day <3
      Tomi, your friendly neighbourhood marshmallow~

      6 votes
    4. Food Escapades & Curry Fridays ! Chicken Tikka Masala

      Hello my dear Tildees! Today seemed to be quite a turbulent day for us all as we settle in a lot of different prevention methods for this so called COVID-19 outbreak, which is truly shocking for...

      Hello my dear Tildees! Today seemed to be quite a turbulent day for us all as we settle in a lot of different prevention methods for this so called COVID-19 outbreak, which is truly shocking for me and probably a lot of other people. But alas, the planet's is still spinning, time is still going, and we still have our own personal things to do and to enjoy. I hope that whoever is feeling anxious and discomforted by this entire COVID-19 outbreak can feel relieved by posts such as these and I hope it can make you realize that things are gonna be alright after all :)

      Today we decided to make Chicken Tikka Masala! A curry staple, it is probably THE english curry dish to top them all. I've heard a lot of people say it is best left to the restaurants to make, and that it isn't very suited for the home cook, so I decided to try it out because I have no self control ! The finished result ended up being very good, but with a lot of flaws (probably mostly because of me though hahahaha). It ended up tasting very lemony and, comparatively to something like the butter chicken that I made (which, I know doesn't really have much to do with Tikka Masala but I was expecting them to be very similar), had a bigger emphasis on bringing out the sauce ingredients, like the tomatoes and peppers, over bringing out the spices, which I don't find as interesting. I think this might just be because it's not really an 'Indian' dish, and more of a British dish. I am fine with it, but, honestly, I do prefer me a spicy and aromatic dish compared to one that just tastes of tomato hahahah. I also put wayyyy too much lime in this, so it just tasted very limey....

      I am talking badly of this a lot but I do think it was a real nice meal in the end. I just do believe, comparing it to something like the butter chicken I made a few weeks back, it could've came out a lot more interesting and unique comparatively. Still would recommend giving it a shot if you personally love Tikka Masala, though!

      Picture of the dish: https://imgur.com/a/csvu2uQ
      recipe: https://imgur.com/5pynwkb

      Today's question: What makes you like Indian cuisine? And if you do not personally enjoy it, what makes you dislike it?

      Have a great day <3
      Tomi, your friendly neighbourhood marshmallow~

      8 votes
    5. Food Escapades & Curry Fridays ! Pork chop bhooni // masala pork chops

      Greetings fellow Tildes users! It has been quite a long time since I have found myself on this website. I hope everyone is doing just fine today :). For a while now, I have been getting...

      Greetings fellow Tildes users! It has been quite a long time since I have found myself on this website. I hope everyone is doing just fine today :). For a while now, I have been getting increasingly more interested in food and everything that has to do with the cooking process. I have put it into my hands to try to learn as much as I can about this beautiful art, starting with a special type of dish that really speaks to me: Curries!

      My uncle gave me this odd little book once called "Curry Cuisine: Fragrant Dishes from India, Thailand, Vietnam, and Indonesia" by David A. Thompson and Vivek Singh. (here's a link if you're interested to buy it: https://www.amazon.com/Curry-Fragrant-Thailand-Vietnam-Indonesia-ebook/dp/B07HXVWFCJ) I hadn't really thought of it that much until one day I had a mind blowing night at an Indian restaurant, which, I cannot remember the name of right now :/.

      During that time, as well, I hadn't really been feeling that great mentally and I didn't really know what to do with my spare time without just getting bored all the time. So, combining that exquisite culinary experience plus the fact that I needed new activities to get me out of the boredom I was feeling, I decided to start up cooking for my parents and myself, and what better place to start than the cookbook my uncle gave me as a gift ! So now, every Friday, I make a curry from this little cute green cookbook I own, and it brings me a lot of joy to make it!

      for the two months I have been doing this so far, I have posted little blog posts on various discord servers about the dishes I make, and due to some people enjoying what I write and do on the discord servers and due to some demand, I have decided that I will post those blogs up here in Tildes for you people to enjoy and share! I will also be putting a question at the end, just to not make it too dry in the comment section :P If asked, I will post the previous posts from the 7 first weeks in a separate post, if you would like to read :)

      But enough of that, here's what I made today! (I usually make these on fridays, but I am doing this one day early because I got stuff to do tomorrow hahah. You do with what you've got !) Today I made a pretty simple dish that I ended up fucking up somewhat. The potatoes ended up being a bit overcooked and not crispy at all, which was disappointed. But at least that was just the side dish! Main dish was a very simple "hogao" like sauce on some pork chops. Man, it's impressive what you can do with water, onions, tomatoes and a few spices! It's tasty and very simple, I'd do it just for any day weeknight meal ! Highly recommend this kind of curry for anyone trying to spice up their weeknights, it'll give ya a nice kick :)

      Picture of the dish: https://imgur.com/fAZyj7F
      [EDIT: will put a picture of the recipe from now on due to demand !] recipe: https://imgur.com/GUN52uz

      Today's question: what is your favourite recipe containing pork chops?

      Have a great day <3
      Tomi, your friendly neighbourhood marshmallow~

      9 votes
    6. Self promotion vs. Original content vs. Own content vs. User created vs. ...?

      This question has come up a few times now in the "Unofficial Tildes Chat" Discord server meta/curation channels, but I wanted to open up the discussion to ~tildes at large so we can perhaps...

      This question has come up a few times now in the "Unofficial Tildes Chat" Discord server meta/curation channels, but I wanted to open up the discussion to ~tildes at large so we can perhaps finally get a more definitive judgement on it. So here goes:

      What are people's thoughts on using the above topic tags in cases where a Tildes user posts something that they themselves have created, have hosted on their own site (or another), and/or could potentially profit from (monetarily or otherwise)?

      Should only one of the tags be standardized on, or is there enough of a distinction between some of them for their use to be situational?

      Should such tags be required?

      Can anyone think of any better tags for such situations than the ones listed?

      28 votes
    7. I made my first knife

      A while ago I mentioned I was going to attempt making a knife for the first time. Well, I did. Apologies in advance for there not being many photos of the process - steel is really messy to work...

      A while ago I mentioned I was going to attempt making a knife for the first time. Well, I did.

      Apologies in advance for there not being many photos of the process - steel is really messy to work with so I mostly kept my phone safely out of the way. I'll try to get more pictures next time, although there are plenty of videos and picture tutorials around if people are super interested in the process. I shall endeavour to describe what I did in text, however.

      I started out with a bar of 01 tool steel (wiki) which I cut into a rough knife blank. This I then hit with a ball hammer a load of times to get some texture. Then I used a belt grinder to put a bevel on the edge side, although only enough to thin the knife down to roughly the right shape, not actually sharp. Once that and a few other minor shaping tasks were done, it was time to heat treat it.

      Heat treating changes the structure of the metal to make it harder. Hard steel will hold an edge longer, but it does make it much more difficult to work, hence doing most of the shaping before heat treating. To harden steel you need to heat it to a particular temperature, which depends on the exact alloy being used but 'bright orange' is close enough. Fun fact - when steel gets to it's 'critical' temperature, it stops being magnetic, so that's another way you can test it. The steel is then quenched, this one in oil, which makes it hard.

      Hardened steel is very brittle so it's usually tempered after hardening. For 01 steel that means putting it in an oven at 160-200C for a couple of hours. You lose some hardness but you gain back some toughness and flexibility.

      After tempering, cleaning, polishing, polishing and so much polishing. Steel is so dirty and difficult to work with compared to the silver, gold and copper I'm more used to. But eventually, and after glueing and bolting a sycamore wood handle on, then giving it a final sharpen on my wetstone, I had a knife.

      It is a Japanese-style Nakiri knife. Usually used for cutting vegetables, it's really nice to use. Lightweight and agile, the balance is nice and it's comfortable in my hand. It's not perfect and there are a few things I'd do differently but I can see myself using this on a daily basis. More pictures

      I have already laid out and started shaping my next knife, which will be a slightly more complicated bunka knife

      Any questions, please just ask and I'll do my best to answer.

      20 votes
    8. Book-focused Discord server

      Howdy, I think this might appeal to some of you, sorry if it comes off a bit spammy. I've started a Discord server mostly for discussion of books (Other things too...our rule is if it's text-based...

      Howdy, I think this might appeal to some of you, sorry if it comes off a bit spammy. I've started a Discord server mostly for discussion of books (Other things too...our rule is if it's text-based or if it's printed on a page, it's allowed. We welcome interactive fiction, comics, poetry, theory, visual novels, etc.) that is aiming to keep discussion at least somewhat serious and a respectful atmosphere similar to what Tildes aims for. Eventually we'll do wider recruitment (posters in universities, probably), but for now we're trying to get a decent server culture going with people we can trust to not shit all over everything. If this sounds appealing, we'd love to have you :)

      Paste with rules, should look familiar.

      Permanent link for those who would like to join: https://discord.gg/yr4pA96

      8 votes
    9. I made a (very, very) basic Tildes scraper and CLI browser ruby gem

      Here's the ruby gem page and here's the github. Right now it comes with a command line browser that can browse the front page and group pages with no sorting options, and you can view the contents...

      Here's the ruby gem page and here's the github. Right now it comes with a command line browser that can browse the front page and group pages with no sorting options, and you can view the contents of a topic (link or text) aswell as the comments. The methods defined in lib/tilde-scraper/api.rb can be used to scrape tildes pages into Group, Page, Topic, and Comment objects.

      Right now it's super basic and messy, but I figured if anyone was interested in it it would be the people here.

      9 votes
    10. I finally open sourced something: Pliant, a flexible blog skeleton

      https://gitlab.com/smoores/pliant I’ve been a software developer for about three years, and I’ve always been enticed by and passionate about the open source scene. I have an assortment of projects...

      https://gitlab.com/smoores/pliant

      I’ve been a software developer for about three years, and I’ve always been enticed by and passionate about the open source scene. I have an assortment of projects variously available on GitHub and GitLab, but this is the first time I’ve ever created an open source project intended to be used by others.

      Pliant is a barebones starter kit for anyone wanting to self host their own blog. It came out of my own efforts to start a blog, and it’s what currently powers https://tfhe.shanemoore.me.

      I’d love to hear you’re feedback, or just discuss open source, blogging, web technologies, or whatever else comes up.

      20 votes
    11. A music Discord server borrowing some principles from Tildes

      Hi there, I've started a new public server on Discord for music discussion, recommendations, etc. I've seen a number of these go down in flames or completely lose the appeal for their core...

      Hi there, I've started a new public server on Discord for music discussion, recommendations, etc. I've seen a number of these go down in flames or completely lose the appeal for their core audience, so I've borrowed some principles from Tildes, adapted for the somewhat different but related issues this kind of Discord server typically runs into. I thought this may be of interest to some users here, so you're all welcome as long as you play by our rules!

      If you'd like to see our rules and goals first, check the paste here. They'll be pretty familiar to anyone here, though they are subject to change depending on our needs. This should go without saying, but to be clear, this server is not officially connected to Tildes, nor is it exclusive to Tildes users. There just might be some overlap in ideas :)

      Here's our permanent invite link if you'd like to join: https://discord.gg/kC4sSQq

      14 votes
    12. Having issues setting goals and sticking with them? I’m working on a solution

      I am working on an app called Percent Done that is a combination of goal setting, time tracking and habit tracking. I like setting time-based goals for myself every day, such as “write for an...

      I am working on an app called Percent Done that is a combination of goal setting, time tracking and habit tracking.

      I like setting time-based goals for myself every day, such as “write for an hour” or “work on Percent Done for four hours.”

      I also like Seinfeld’s “don’t break the chain” method. For example, Apple Watch shows you how many days you have completed your exercise circle and tells you that you have been keeping at it for x days.

      Percent Done is a marriage of these two concepts. It allows you to set goals and track the time you spend on them, as well as how many days in a row you have consistently completed them. For example, you can add a goal that says “write for an hour every day,” and Percent Done will notify you every day to write for an hour. You will be able to tap on this goal and Percent Done will start counting back from one hour. You will also be able to see how many days in a row you have written for an hour.

      Here is a demo GIF.

      You can also add one-time goals to Percent Done with or without time tracking, so it is a task management tool as well.

      You can play with the design prototype here: Percent Done design prototype

      I would really love to get your feedback on this. If you are interested in being a beta tester, feel free to reply to this topic or e-mail me at "hi at evrim dot io."

      By the way, this is almost completely a self-promotion post. If it is against the rules, I'd be happy to remove this.

      23 votes
    13. Genetic Algorithms

      Introduction to Genetic Algorithms Genetic algorithms can be used to solve problems that are difficult, or impossible to solve with traditional algorithms. Much like neural networks, they provide...

      Introduction to Genetic Algorithms

      Genetic algorithms can be used to solve problems that are difficult, or impossible to solve with traditional algorithms. Much like neural networks, they provide good-enough solution in short amount of time, but rarely find the best one. While they're not as popular as neural networks nor as widely used, they still have their place, as we can use them to solve complicated problems very fast, without expensive training rigs and with no knowledge of math.

      Genetic algorithms can be used for variety of tasks, for example for determining the best radio antenna shape, aerodynamic shapes of cars and planes, wind mill shapes, or various queing problems. We'll use it to print "Hello, World!".

      How does it work?

      Genetic algorithm works in three steps.

      1. Generate random solutions
      2. Test how good they are
      3. Pick the best ones, breed and mutate them, go to step 2

      It works just like evolution in nature. First, we generate randomised solutions to our problem (in this case: random strings of letters).

      Then, we test each solution and give it points, where better solutions gain more points. In our problem, we would give one point for each correct letter in the string.

      Afterwards, we pick the best solutions and breed it together (just combine the strings). It's not bad idea to mutate (or randomize) the string a bit.

      We collect the offsprings, and repeat the process until we find good enough solution.

      Generate random solutions

      First of all, we need to decide in which form we will encode our solutions. In this case, it will be simply string. If we wanted to build race cars, we would encode each solution (each car) as array of numbers, where first number would be size of the first wheel, the second number would be size of the second wheel, etc. If we wanted to build animals that try to find food, fight and survive, we would choose a decision tree (something like this).

      So let's start and make few solutions, or entities. One hundred should be enough.

      from random import randint
      
      goal = "Hello, World!"
      allowed_characters = list("qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM ,!")
      
      def get_random_entity(n, string_length):
          entities = []
          for _ in range(0, n):
              entity = ""
              for _ in range(0, string_length):
                  entity += allowed_characters[randint(0, len(allowed_characters)-1)]
              entities.append(entity)
          return entities
      
      print(get_random_entity(100, 13))
      

      Test how good they are

      This is called a "fitness function". Fitness function determines how good a solution is, be it a car (travel distance), animal (food gathered), or a string (number of correct letters).

      The most simple function we can use right now will simply count correct letters. If we wanted, we could make something like Levenshtein distance instead.

      def get_fitness(entity):
          points = 0
          for i in range(0, len(entity)):
              if goal[i] == entity[i]:
                  points += 1
          return points
      

      Crossover and mutation

      Now it's time to select the best ones and throw away the less fortunate entities. Let's order entities by their fitness.

      Crossover is a process, when we take two entities (strings) and breed them to create new one. For example, we could just give the offspring one part from one parent and another part from second parent.

      There are many ways how to do this, and I encourage you to try multiple approaches when you will be doing something like this.

      P:  AAAABBB|BCCCC
      P:  DDDDEEE|FGGGG
      
      F1: AAAABBB|FGGGG
      

      Or we can just choose at random which letter will go from which parent, which works the best here. After we have the offsprint (F1), we should mutate it. What if we were unfortunate, and H (which we need for our Hello, World!) was not in any of the 100 entities? So we take the string and for each character of the string, there is a small chance to mutate it - change it at random.

      F1:  ADDDEBEFGCGG
      F1`: ADHDEBEFGCGG
      

      And it's done. Now kill certain part of old population. I don't know which percentage is best, but I usually kill about 90% of old population. The 90% that we killed will be replaced by new offsprings.

      There is just one more thing: which entities do we select for crossover? It isn't bad idea - and it generally works just fine - to just give better entities higher chance to breed.

      def get_offspring(first_parent, second_parent, mutation_chance):
          new_entity = ""
          for i in range(0, len(first_parent)):
              if randint(0, 100) < mutation_chance:
                  new_entity += allowed_characters[randint(0, len(allowed_characters)-1)]
              else:
                  if randint(0, 1) == 0:
                      new_entity += first_parent[i]
                  else:
                      new_entity += second_parent[i]
          return new_entity
      

      When we add everything together, we get this output:

      Generation 1, best score: 2 ::: QxZPjoptHfNgX
      Generation 2, best score: 3 ::: XeNlTOQuAZjuZ
      Generation 3, best score: 4 ::: weolTSQuoZjuK
      Generation 4, best score: 5 ::: weTgnC uobNdJ
      Generation 5, best score: 6 ::: weTvny uobldb
      Generation 6, best score: 6 ::: HellSy mYbZdC
      Generation 7, best score: 7 ::: selOoXBWoAKn!
      Generation 8, best score: 8 ::: HeTloSoWYZlh!
      Generation 9, best score: 8 ::: sellpX WobKd!
      Generation 10, best score: 9 ::: welloq WobSdb
      Generation 11, best score: 9 ::: selloc WoZjd!
      Generation 12, best score: 10 ::: wellxX WoVld!
      Generation 13, best score: 10 ::: welltX World!
      Generation 14, best score: 10 ::: welltX World!
      Generation 15, best score: 10 ::: welltX World!
      Generation 16, best score: 11 ::: zellov Wobld!
      Generation 17, best score: 11 ::: Hellty World!
      Generation 18, best score: 11 ::: welloX World!
      Generation 19, best score: 11 ::: welloX World!
      Generation 20, best score: 11 ::: welloX World!
      Generation 21, best score: 12 ::: welloX World!
      Generation 22, best score: 12 ::: Helloy World!
      Generation 23, best score: 12 ::: Helloy World!
      Generation 24, best score: 12 ::: Helloy World!
      Generation 25, best score: 12 ::: Helloy World!
      Generation 26, best score: 12 ::: Helloy World!
      Generation 27, best score: 12 ::: Helloy World!
      Generation 28, best score: 12 ::: Helloy World!
      Generation 29, best score: 12 ::: Helloy World!
      Generation 30, best score: 12 ::: Helloy World!
      Generation 31, best score: 12 ::: Helloy World!
      Generation 32, best score: 12 ::: Helloy World!
      Generation 33, best score: 12 ::: Helloy World!
      Generation 34, best score: 13 ::: Helloy World!
      Generation 35, best score: 13 ::: Hello, World!
      

      As we can see, we find pretty good solution very fast, but it takes very long to find perfect solution. The complete code is here.

      Maintaining diversity

      When we solve difficult problems, it starts to be increasingly important to maintain diversity. When all your entities are basically the same (which happened in this example), it's difficult to find other solutions than those that are almost the same as the currently best one. There might be a much better solution, but we didn't find it, because all solutions that are different to currently best one are discarded. Solving this is the real challenge of genetic algorithms. One of the ideas is to boost diverse solutions in fitness function. So for every solution, we compute distance to the current best solutions and add bonus points for distance from it.

      20 votes