TODO: Make code prettier

Sat, Jan 7, 2012 - 5:38pm -- Isaac Sukin

I'm writing a game in JavaScript for fun (I'm almost done, it'll be out within a few days). I've written dozens of games in traditional desktop languages, and I've written a lot of JavaScript designed to make user interfaces prettier, and I've even written some useful JS tools -- but this is the first time I've written a full application in JS complete with complex hierarchical entities. That is to say that I've never had to care much about the fact that JS more or less supports OO architectures before. I could have made this an opportunity to learn about OOP in JS, but I didn't. Instead I wrote the game basically without using (custom) objects at all, resulting in some redundancy and confusion. I did this because it was fast and easy and I already knew how to do it. The code's a mess, but so what? It works. It's good enough. I had fun, and I'm about to ship.

But I have this little note at the top of main.js:

Releasing ViralSpread: A Contagion Simulation Program

Thu, Nov 17, 2011 - 8:21pm -- Isaac Sukin

ViralSpread is a FOSS program that simulates a competitive contagion scenario. You can adjust the simulation's parameters and it will report various statistics about the simulation including graphs and exportable data. You can download the program (including the source code and screenshots) or check out the source code on github.

You can also read about the development process.

Labeling Subgraphs

Mon, Nov 14, 2011 - 3:53am -- Isaac Sukin

On Friday I went to a series of talks for the kickoff of the Marketing and Social Systems Engineering (MKSE) department at UPenn, chaired by one of my professors. There were four speakers -- I missed the second -- and the talks ranged from monetizing people's browsing behavior on the internet to proving that humans exist.

I've been building an open-source suite of social networking software as a hobby since 2007 so the underlying topic of network science has interested me for a long time. I have mainly focused on building user engagement. Towards that end I've thought a lot lately about the right way to represent relationships on a social networking website given varied successes and failures of Facebook's Friend Lists and new Smart Lists as well as Google+'s Circles. My expertise is in Drupal and the choices there all require tediously, manually building your network. I'm convinced that the best approach for usability is to automatically identify people's friend groups. In general it's a good principle not to make users do anything that is not directly related to accomplishing their task of participating on your site, and manually maintaining friend lists is awkward anyway.

Java Validated FileChooser

Fri, Nov 4, 2011 - 7:55am -- Isaac Sukin

I happened to be working on a Java project recently where I needed to let the user save files through the GUI. The Swing toolkit has a nice JFileChooser class that lets you show a file save dialog so that the user can choose the directory and name of the file to save. However, not all filenames are valid, and Java doesn't validate them for you by default. If you try to save a file with an invalid name, Java will throw an error, and this is often considered the only way to know if the filename is valid. That's bad practice though since you should never rely on an exception being thrown as a condition of your program running correctly; by definition, exceptions are unreliable and sometimes unpredictable. Additionally if your file saves successfully then you have to immediately delete it (because you were only saving it to test the filename) and that's messy. So I wrote a ValidatedFileChooser class that checks various criteria to make sure that filenames are valid before attempting to save the file, and alerts the user if one of the criteria fails. The class is below, and I'm releasing it to the public domain.

Pages

Subscribe to Isaac Sukin RSS