Keyboard Layout Project: Update


As I discussed in my last blog post, I was in the process of making additions to my keyboard layout project to allow for various additional functionalities. The main addition I made was the construction of a web app that allows for users to enter in their own strings and calculate layouts from there. There are natural pitfalls for this, of course, primarily the lack of scalability and resources available to run the app. I had to manually include a stop after fifteen seconds to limit the server load. This is still a rather long run time for a web app, but I feel that's a fine sacrifice to make for additional performance within the app itself.

I also had to make a few small tweaks within the program to improve the run time. In particular, one major error comes up when extremely long strings are entered; the program's runtime increases dramatically as the length of the string gets longer. To counteract this, I added an alternate method of calculating the "fitness function" for the various layouts for strings longer than seventy characters. Instead of looking at each specific pair of letters within the string, I instead fragment each of the long strings into all their pairs, and choose the top 100 pairs that most frequently show up within the text. This usually allows the program to get through many more generations than what would have been possible in the original program, and consequentially increases the functionality. I have a feeling that this will be the end of this project, at least for a while. Ultimately, I do feel that it was a useful project to go through, although it may not have resulted in an overly useful final program. However, it still provided me with experience with Flask programming with web apps, genetic algorithms, and general workings in Python. As for now, I will move onto other miscellaneous programming and machine learning projects (once spring quarter ends). Hopefully I'll be able to apply the knowledge that I gained here in the future!