Using simulated annealing you can “almost” solve hard problems like the traveling salesman problem quite fast. Some sample code/data at my githubrepository. Also a graphic representation here and here. Both are using driving distances, the USA dataset was generated from Google Maps API, and is not symmetric, that is the distance between A and B is not always the same as between B and A, funny detail that uncover a bug (by design) of the original code.
At my current location my (business) cable provider does not like you fully using your bandwidth, so they throttle your downloads after the first 20 or 30 megabytes, at peak hours they throttle to less than a 10% of your real bandwidth, quite unacceptable. So when I needed to download a multi gigabyte file from a CDN, I decided to do some ‘bashing’ …
COOKIES=''# Here your cookies to authenticate or whatever
if!kill$CURLPID;thenbreak;fi# Not running, already ended!
this was the second version, the first, just killed the curl process after 10s, but this one is better, as sometimes they forget to throttle you. Also I specify an IP in the URL as it makes things faster; well implemented CDNs should cache the file and keep it hot in at least the IP serving you, if you jump from one IP to another, you are a bad net-citizen 😀
The ETA for the download is now below 1 hour, instead of 4. Really love UNIX!
I have just compiled an static version of glib-2.38.2 and fluidsynth-1.1.6 in order to easily add support for MIDI files to VLC-2.1.1 under OSX. If you want it you can get the plugin here. You will also need a SoundFont in .sf2 format, as this or this. For installation uncompress the .xz and copy it to VLC.app/Contents/MacOS/plugins/ put the .sf2 file somewhere and add a reference to it under Preferences(All)/InputCodecs/Audio Codecs/FluidSynth
If FluidSynth does not appear under AudioCodecs try to reset the VLC Plugin Cache with VLC.app/Contents/MacOS/VLC --reset-plugins-cache.
Although I usually backup (with TitaniumBackup) my progress in the games I occasionally play in my rooted Nexus 4, lately I was quite lazy about it, so when the latest upgrade to Angry Birds StarWars crashed and I lost all the data it was almost two months of game progress. That was the whole Hoth system… I was not going to repeat the 40 levels, so I would have to fix it myself. Using adb I enter the /data/data/com.rovio.angrybirdsstarwars.ads.iap/files folder, where the file highscores.lua is stored. I remembered that in the first version of the game the file was just a plain text file with your scores in each level you have played, but it seems that Rovio does not like people improving scores so easily, so they changed it to make things more difficult.
I decided to debug the game in order to check what was exactly that file. I installed the Android NDK and learn how to use the gdb remote debugger. Disassembling the binary showed that that they were using AES with a secret key. More apktool, ndk-gdb and lot of learning and I got it!
some python coding, and I was again just after Hoth. It took me about 6 hours to learn enough to fix it, quite less than the two months it had taken me to finish the Hoth system.
I would never use this kind of hacking to skip a difficult level, but replaying a whole system … no way. At the end, lot of learning and satisfaction for being able to fix it.
take a look at python/genFolderIcon that generates folder icons from .app or .icns and to python/getLyrics.py that retrieves lyrics from several services and updates iTunes with it. Also under DSDT/ you can find self made DSDTs for installing OSX in a Thinkpad W520 and a Dell Precision M4400. Under algo/ there are several classic algorithms and data structures in C and mastermind contains an old implementation of a mastermind player (both command line and network server).