Why premature optimization is a bad idea.
Premature optimization absolutely ruins productivity. Especially when you are working with an open source stack. The best thing you can do when developing a project is to finish an iteration and release it, and get users because if its a good idea, chances are some is developing it, or thinking about it.
Optimizing before having any users is dumb and often a waste of time. Chances are if your idea is worth a damn, it will take off, attract some funding and wizard developers who will assist with refactoring your code anyway.
It is also dumb because these micro optimizations are not going to resolve the bottlenecking issues you will run into when your server is under duress. Using single quotes instead of double quotes for echo statements are not going to resolve those poorly written queries that hit your misconfigured MySQL server, nor will it help alleviate the MySQL server crashing because of your lack of indexing.
These micro optimizations often make it more difficult for others to comprehend your code, will make refactoring take longer, and are almost always just a waste of time.
One great example of this optimization wasting time was a project at my previous job. A coworker wrote an API framework from scratch for a mobile site. I was pushing for an API built with views (desktop site is Drupal) but evidently the performance was not what people wanted (caching could have been leveraged…but was not). Instead, three weeks later, the API framework was built out, and I made the mistake of looking at it. Drupal was bootstrapped fully, then raw MySQL queries were written using PHP’s PDO class (Drupal’s database abstraction layer uses PDO…). Because of premature optimization, weeks were wasted and a project is much more complex than it needs to be, which means maintenance will take longer.
So much time is wasted when optimization occurs before it is needed. Especially when you consider that no optimization is needed in the vast majority of situations. When optimization is needed, refactor as needed, swap languages as needed(Twitter from Ruby to Java) or develop new applications to ease developer workload (Facebook engineers writing Hip Hop for PHP).
Just my thoughts.
I’ve become a huge nginx fanboy
Installed and configured nginx/php-fpm on my ec2 instance to replace apache and I can’t believe the difference. Even just caching the static files of a couple of sites (css, js, images), I have seen almost 15-20% increases in performance during benchmarking across the board.
All while increasing performance, it had decreased the overhead as well. The Nginx footprint is unbelievably small compared to apache (~20% under load).
Granted, I was not running Varnish with apache and I had not tuned apache, but this is in comparison to nginx defaults well. A complete writeup will be coming later, im too tired to do so tonight.
Game of Thrones valentine cards
Because I love you all (as friends) and I love Game of Thrones, I combined them both into some sweet valentine’s day cards for you to give to your sweetheart or favorite prostitute. Enjoy! Click for big version or get the bigger printable version…
RELATED: I’ve got two prints with these characters for sale at inprnt.com - House Stark and just about everyone.
Dropbox auto image/video uploads
So I found out today that Dropbox was doing some beta testing for automatic image/video uploading and the incentive for testing out this new Dropbox functionality is to treat users to up to 5 GB of free Dropbox space. 500 MB is rewarded for your first image/video upload and then every 500 MB of video/images you upload after that will grant you 500 MB of free space, and this additional limit doesn’t stop until you receive an additional 4.5 GB.
The easiest way I found to upload images/video, if you don’t have 5 GB of video/images just lying around, you can create a few monster video files (especially if you can record in full HD, heehee) and then upload these videos.
Some caveats about this issue, especially on Windows machines, is to make sure you are running Autoplay on the portable drive your phone/camera appears as when connected via USB. You can manually run Autoplay by right-clicking the drive of your choice, and selected the Autoplay option, and then selecting the Dropbox option.
Another issue that might occur is associated filetypes. I know for sure that Dropbox supports avi/mp4 files, so if your file saves video as m4v, you are in luck. Just rename the m4v files with an mp4 extension (same type of file) and then try to auto-upload to Dropbox. Voila!
WAMP Issue Creating new alias
So I was running into an issue when trying to create a new alias on WAMP through the menu located on the taskbar icon. Every time I tried to create a new alias for a project in a different directory than the “www” directory, it failed. Instead, I went into my WAMP folder (mine is c:/wamp) and opened the alias directory. I then added another .conf file containing all of the relevant information such as path to directory, url alias i wanted to use, etc. Then I restarted the Apache service and my new alias worked. Yay!
the falling-into-lifeboats epidemic.
- Josh: It seems to be that falling into lifeboats is an epidemic http://www.anorak.co.uk/308827/news/costa-concordia-francesco-schettino-dimitri-christidis-and-silvia-coronia-fell-into-a-lifeboat.html/
- Ryne: lol
- Ryne: i fell in lifeboats like you once
- Ryne: then i took an arrow to the knee
- Josh: Bahhahahaahhahahaha
- Josh: I just snorted laughing in the middle of class, I hope your happy
God. I am getting so fed up with Google. This is this morning’s comparison. I experience this at least once a day now for a variety of things.
I may not be done with Google yet, but I can see the day I will be on the horizon, and I am looking forward to it.
What to do once you install CM7 your Kindle Fire
One of my friends recently rooted his Kindle Fire and flashed CM7. Being new to the amazing world of Android, he was unsure of what to do next. One of the best things of the vast world of open-source technology is that anyone can put their ideas into action, and there are few better places to see this than on an Android tablet.
Being an avid gamer, one of the first things I did was install various classic console gaming emulators on my Kindle Fire. Snesoid, Gameboid, and FPse for android are my emulators of choice on an Android tablet.
The Kindle Fire is also an amazing media consumption device, so I am a big fan of installing Netflix and/or Hulu+ app from the Android Market. I am personally working on a personal media server/HTPC (will post about this in-depth when I am finished), so I am a big fan of both Plex for Android and Plex 9 Remote.
I find a tablet of this size perfect for checking email, keeping up with Twitter and Facebook, and general browsing as well. I prefer Gmail for email browsing, because both my personal and work email addresses use Gmail/Google Apps. I use TweetDeck for browsing Twitter/Facebook on my Kindle Fire, because I am a sucker for Twitter lists.
There are also many amazing games optimized for the HD tablet screens in the Android market.
Some of my favorites that are currently on the Android Market are:
built a cm9 rom from source…
Let me just say Google is as pain in the ass. Disconnected for times while using their repo tool to check out the necessary files for an android rom. Took eight hours total.
I’ve been making modifications here and there but have not been brave enough to flash it on my kindle fire. If there is any interest, I will post a writeup on how to build a cm9 rom from source later.
Playing the original Baldur’s Gate and Icewind Dale on my Kindle Fire
After stumbling upon the amazing work the gemrb crew has done (http://www.gemrb.org/wiki/doku.php?id=start), I have been wanting to play a couple of classic AD&D RPG’s that were the first games I played on the computer; the Baldur’s Gate and Icewind Dale series.
For a little bit of background, these games were released in the late 90s/early 2000s, and were built on an engine called Infinity, which was written by a couple of doctors who wanted to start a video game development company (Bioware). The gemrb project successfully ported this engine to a OS-agnostic platform that will run on iOS, Android, Windows, Mac, and Linux systems.
You can download the gemrb engine here -http://www.gemrb.org/wiki/doku.php?id=installation and once installed, you only need to copy an installed directory of one of the supported games (Baldur’s Gate, Baldur’s Gate II, Icewind Dale, Icewind Dale II, Planescape Torment) into the application-data directory for the gemrb engine, and then you can play the game on your system of choice. The touch support is outstanding, and I prefer using touch to even keyboard and mouse.
I’m running a Windows 7 machine, so it is a little bit of work to install Icewind Dale and Baldur’s Gate on my laptop. After all, these games were built for Windows 98, which was forever ago. Here are the steps I had to take to get these games on my rooted Kindle Fire:
- Download Windows XP mode and Windows Virtual PC (http://www.microsoft.com/windows/virtual-pc/download.aspx)
- Once these are installed, run in Windows XP mode and insert your install discs.
- Work through the installer (Baldur’s Gate was in 6 cd’s, lol) and then return to Windows 7 mode when you are finished.
- Connect your Android device (Kindle Fire in my case) and mount as a USB drive.
- Copy all of the files in your game directory (for me it was in Program Files/Black Isle/Icewind Dale) and transfer them to your gemrb directory (mine was /mnt/sdcard/app-data/net.sourceforge.gemrb)
- Run the gemrb app on your device and hooray! You’re playing a classic PC RPG on your android device!



