Archive of: Tips and Tricks

  1. Disallow: /harming/humans. A lesson in Easter Eggs from Last.fm posted July 27, 2010

    Adding Easter eggs to your application is a great way to reward your frequent users with a bit of a surprise out of the blue. Easter eggs allow you to have a little bit of fun with your user base without being too explicit.

    The problem, however, is finding the right balance of fun and professionalism. After all, you still want to hold on to the hard earned respect your users give you for providing them with a high quality software application. Easter eggs that are too extreme, blatant, or political can end up having the opposite effect and create a negative experience for your users.

    Here’s a great example of an Easter egg that Last.fm placed in their robots.txt file.

    User-Agent: *
    Disallow: /music?
    Disallow: /widgets/radio?
    Disallow: /show_ads.php
    
    Disallow: /affiliate/
    Disallow: /affiliate_redirect.php
    Disallow: /affiliate_sendto.php
    Disallow: /affiliatelink.php
    Disallow: /campaignlink.php
    Disallow: /delivery.php
    
    Disallow: /music/+noredirect/
    
    Disallow: /harming/humans
    Disallow: /ignoring/human/orders
    Disallow: /harm/to/self
    
    Allow: /
    

    The last lines are a reference to the Three Laws of Robotics created by Isaac Asimov.

    This is a very subtle and perfectly placed Easter egg that will likely resonate with the types of users that will go digging around in a site’s… Read the rest

  2. Setting an MP3 as Your Alarm on the HTC EVO posted June 11, 2010

    I had a little bit of trouble with this today and thought I’d share.

    If you plan on using the built-in alarm on the HTC EVO (Android 2.1) and want to wake up to the soft melodies of one of your favorite songs instead of the blasting simulated alarm sounds the EVO provides, follow these simple steps.

    1. Plug your EVO into your computer and select “use as drive”.
    2. Create a folder called “alarms” in the root of your SD card.
    3. Place your desired .mp3 file in the folder (I renamed mine to have the word “alarm” in the file name.)
    4. Disconnect your EVO.
    5. Reboot your phone.

    Now, when you go to set your alarm tone, your mp3 file should be there. This method is better than rooting your Android phone, changing the file format of your music file, and placing the file in the phone’s limited on-board storage.

    By the way, the full write-up on the EVO is coming soon, I just wanted to play around with it for a little while before I gave my thoughts. Check back for more updates.

  3. Installing Git on Windows with msysgit posted June 6, 2010

    I wrote an article a while back showing you how to get started with Tortoise Git and and Cygwin on Windows.

    It seems that people are starting to favor msysgit now since it is much more lightweight than the Cygwin route and Github recommends it.

    The installation process for msysgit is extremely straightforward and an older tutorial is already available on Github. However, I figured that it would be a good idea to have an updated installation tutorial available to all the new gitters out there.

    These are the installation options I used to install Git-1.7.0.2-preview20100309.exe on Windows.


    Note: You can enable the options to show a Git GUI or Bash shell if you want that option to be available every time you right-click on something in Windows Explorer. I just didn’t want that much space taken up on my right-click menu.

    And, that’s it! Now you have Git installed on your Windows machine and can create your first Git repository or install Tortoise Git. Happy version controlling.

  4. Need More Time to Get Stuff Done? Try Sprinting. posted June 1, 2010

    Let’s face it, we’re all busy people. We fill our lives with stuff to do – some important, and some not-so-important – and always feel like we should be doing more.

    Unfortunately for programmers, this problem is compounded by the fact that we need to stay on top of an ever expanding and changing field. So, how do we make the time to work on personal projects, study for a certification exam, go back to school, or contribute to open source while still being able to maintain a sense of stability and balance in our lives?

    One potential solution is to break up some (or all) of your tasks into digestible chunks and work each chunk as a “sprint”. A sprint is where you focus intensely on a single task until it is complete and then move onto the next one. Sound familiar? It should, what I just described is a simple implementation of an agile software development method called Scrum.


    Note: You aren’t technically required to stick to the 2-4 week sprint length, if you have a couple of hours every other weekend available to try this out, just do that. However, I would notRead the rest

  5. Iterating Through a Dictionary in C# posted May 23, 2010

    A Dictionary allows you to store items in a collection using a key/value paring. By storing your data this way, you get all of the functionality of a standard .NET Collection with the added benefits of Hashing.

    I’m going to start off by showing you how to get data into a Dictionary. Then, I’ll move on to how to access specific data entries. And, finally, I’ll demonstrate two methods of iterating through the Dictionary. This should give you enough information to get started with Dictionaries if you’ve never seen them before, and hopefully, teach you something new if you are already familiar with them.

    Inserting Into a Dictionary

    First, let’s get some data into our Dictionary by adding some of the hard workers of Dunder Mifflin.

    Dictionary<int, Person> employees = new Dictionary<int, Person>();
    employees.Add(1000, new Person("Jim Halpert"));
    employees.Add(1001, new Person("Pam Halpert"));
    employees.Add(1002, new Person("Andy Bernard"));
    employees.Add(1003, new Person("Dwight Schrute"));
    employees.Add(1004, new Person("Michael Scott"));
    

    Retrieving Data From a Dictionary

    Now that we have our employees in memory, we can access them in near constant time (O(1)) by using their ID.

    Person p = employees[1003];  //Select Dwight
    

    Iterating Through a DictionaryRead the rest

.NET Algorithmic Art ASP ASP .NET ASP .NET MVC audio Bill Gates C# code review Computational Art CouchDB CSS Database DateTime debug DevDays eclipse ethics FileSystem Git Improvement iPhone Java JQuery Knopflerfish Layouts mail Microsoft Oracle OSGi Processing Python Ruby SMTP SOA Software Piracy Source Control SQL StackOverflow tools TortoiseGit training Web Standards Windows XHTML