Friday, August 21, 2009

Amazon Mechanical Turk

Ever wish you could instantly and easily outsource large amount of mundane work that would take you hours to complete? I recently started a website, Campus Dining Hours and came across this need. My website lets you see what's open on your college campus. It will highlight any listing that are open at the time when you visit the website. I have collected hours for over 100 college campuses by writing a script to compile this information from various sources.

However, the problem came when I needed more information about these schools. I had a list of school names and hours, but I needed to collect the school website, zip code, time zone (for highlighting), and abbreviation. (ex. UCLA) This is a very simple task, but it would be a very tedious task for over 100 campuses and I needed to have it done as soon as possible. I heard about Amazon's Mechanical Turk, a while back, but I didn't have anything in mind to put the service to good use until now. Thus, I logged into my Amazon account and signed up as a Requestor for Amazon's Mechanical Turk. It was surprisingly easy to create new HITs, or Human Intelligence Tasks.

The first step was Design, in which you layout the information needed and create a simple form for users to fill out. You add input variables, which will change for each new task. You can also set the amount you will pay for each task. The amount is usually a few pennies depending on the task. If your task takes 30 seconds on average and you pay $0.05 per HIT, that is a wage of $6.00 per hour for the worker.

Then second step is to Publish and uploading your input data. In my case, this was as simple as uploading a CSV text file with the appropriate input fields at the top. Each row in the spreadsheet will create a new HIT with your template variables automatically filled in. Then Publish and that's it! Now the fun part.

My results started coming in immediately! I had gathered all of my results within a matter of hours, and I approved all HITs. You can easily export your result to a CSV text file, which will contain your input columns, then any fields you created in your form template for the user to fill in.

Friday, January 2, 2009

My First Android App

I wrote my first application, a Tetris clone, for my new T-Mobile G1 phone. The phone runs Google's new Android operating system. A few years ago, I wrote a version of Tetris in Java. Android apps are also written in Java, so it didn't require significant change to adapt my game to the phone. Writing applications for Android was surprisingly easy after everything was configured. Google provides a wealth of information for getting started on writing your own Android applications.

Once you have Eclipse configured, you can easily compile and run your applications with the click of a button. When you run your application, you can choose to run it in the Android Emulator or if you have your phone plugged in via USB, you can run it directly on your phone. For the latter option, you do not need a special developer phone, you simply enable USB Debugging on your phone. Very easy!

The Android documentation is similar to the Java API reference and very easy to use. Google has also provided a number of sample programs and source code. Additionally, many Android apps are open source. With so many free apps on the Market already, it will be interesting to see what companies can come up with once apps are for sale on the Market.

Feel free to download my Tetris APK. Roll the track ball up to rotate blocks, then roll left and right to move blocks as they fall.

Friday, August 8, 2008

Facebook Advertising

I recently decided to try out Facebook Ads. Many people typically think of Facebook just as a social networking site and not as an advertising platform. Facebook's Ads Manager is an incredible tool that easily allows you to reach target audiences. I've always enjoyed Facebook ads. (the text+graphic ads, not the skyscraper graphic ads) They blend in well with the site, but still catch your attention. Each Ad has a small image, plus a short blurb of text describing the Ad. The Ads are inviting and relevant enough that I have clicked on them.

Signing up for the service was very simple. I didn't need to enter an email address or create a new username / password. I simply logged into my Facebook account and clicked the link for Advertisers. The first step was to create my advertisement. The user interface was very easy to use. It is consistent with Facebook's look and feel, which is simple yet powerful. Their liberal yet appropriate use of AJAX makes it a very painless process.

In my opinion, the best part about Facebook ads is the ability to target your users very specifically. Facebook's large user base makes it easy to narrow down your target audience. You can select from a wide variety of criteria to filter your ads:
  • Location
  • Sex
  • Age
  • Keywords
  • Education Status
  • College, Major, Degree
Keywords are very powerful. Keywords includes a user's interests, favorite music, movies, job titles, and other information on their Facebook profile. Facebook doesn't need advertising preferences from users, because they already have everything from their profile. Facebook Ads are not very expensive either. I found that the cost-per-click is similar, maybe slightly more, to running the same Ad running on Google Adwords. Since you are bidding on advertisement slots, this will vary greatly depending on how many other advertisers are trying to reach the same audience.

One minor annoyance is Facebook's minimum daily cap of $5 on advertising. This means that you could be charged up to $5 per day while your ad is running and you cannot lower this amount. For small businesses, this could add up to $1,825 per year, which might be a lot to spend on Facebook Ads. Google Adwords and other platforms are very flexible in this respect and give you options to decide how quickly you wish to spend your budget. (immediately vs. evenly) Fortunately, Facebook Ads allows you to narrow down your audience very specifically. You can choose CPC (cost per click) or CPM (cost per 1000 impressions). Compared to other platforms, Facebook doesn't offer many features beyond targeting your audience. Still, I highly recommend trying out Facebook Ads if you currently advertise online. It can result in high conversion rates since you are able to choose exactly who can see your ad.

Update:
The minimum daily cap for Facebook Ads has been changed to $1.00.

Friday, August 1, 2008

Windows Server 2003

Windows Server 2003 is an expensive operating system, about $500 depending on the version. Being a college student, I found that I was able to obtain a free copy of Windows Server 2003 through Microsoft's DreamSpark program. They also offer Visual Studio 2008 and other Microsoft development software to students at no cost.

The operating system is available as an ISO image that I was able to download and burn to a DVD. The default installation works great, and only requires a few customizations. The OS starts up and shuts down surprisingly fast. Overall, I am pleased with the operating system. If you prefer a Windows operating system, then Windows Server 2003 is a great option even as a desktop OS. It runs very stable. It is still a Microsoft OS, but it's not XP or Vista. It is similar to Vista, but without all the problems and a cleaner user interface. It reminds me of Windows 2000 vs. XP. If you are a student, then grab a free copy through the Microsoft DreamSpark program. I am not sure that I purchase the software for my desktop computer, but it shows that Microsoft can actually create a lean, stripped down, stable operating system for servers. I did not run into any issues installing drivers or software on my custom built computer. Some software needs to be run in compatibility mode. To do this, right click on the executable you wish to run and goto Properties. Then under the Compatibility tab, select Windows XP and press OK. You should now be able to run most software that works under Windows XP.

Friday, July 25, 2008

PHP 5 Certification

I recently decided to pursue a PHP 5 Certification. I purchased the Zend PHP 5 Certification Bundle, which includes the study guide (hardcopy and downloadable PDF), 10 online practice exams, and an exam voucher. I just finished reading over the 250 page study guide. It covers a variety of PHP concepts:
  • PHP Basics
  • Functions
  • Arrays
  • Strings and Patterns (including regular expressions)
  • Web Programming
  • Object-oriented Programming
  • Object-oriented Design
  • Database Programming
  • XML and Web Services
  • Security
  • Streams and Network Programming
  • Differences Between PHP 4 and 5
After reading the guide, I took my first practice exam and scored Excellent overall. Scores are displayed as Fail, Pass, or Excellent. The website says that the practice exams are more difficult than the real exam. If you have a good working knowledge of PHP, the exam should not be too difficult. Here are a few key topics that you should be familiar with:
  • PHP Operators (instanceof, ===, @, etc)
  • Parsing XML documents and using SOAP services
  • Regular expressions
  • Commonly used string functions (php.net/strings)
  • Using prepared SQL statements
  • Basic design patterns
  • Classes and object oriented programming
  • Array functions (php.net/ref.array)
  • Standard PHP Library (php.net/book.spl)
    • Know Array interfaces and Autoload

In addition to these, you should know how to write secure PHP code. You can download the Security chapter of the PHP 5 Study Guide for free on http://www.zceguide.com. I recommend purchasing the study guide to help study for the exam. The exam expects that you use PHP often enough to recall basic functions, but it does not expect you to memorize the entire PHP manual. You should know some of the differences between PHP 4 and PHP 5. This includes different class access levels (public, private, protected and final), interfaces, and references. Overall, I feel that the certification is a good way to help determine whether or not an employee has the skills necessary to develop solid PHP applications. You can read more about it on the Zend certification website.

Friday, July 18, 2008

Coding on two computers? Get Synergy

Synergy is an open source program that enables you to use a single mouse and keyboard across multiple computers acting like a virtual KVM. This is very helpful if you have two (or more) computers next to each other. You can copy and paste between the different computers, which is very helpful for coding. One of my favorite features is that Synergy can be run on Windows, Mac, and linux operating systems. I have a computer running linux next to a Windows Server 2003 computer and Synergy makes software development much easier since I am able to use both computers as if they were one.

I can quickly test web applications on multiple web browsers with multiple operating systems. If you use Network Attached Storage or simply configure a network share between the computers, it is similar to running a dual monitor setup. If you are using dual monitors, check out my blog post about coding with dual monitors. You could even setup an audio server to integrate the computers more closely. Pretty much the only thing you cannot do is drag windows from one computer to another.

Synergy labels your different computers as screens. You need to set Screen1 to be left of Screen2 and Screen2 to be right of Screen1. If you do not do both of these, your cursor could be stuck on one monitor. You can set it so that moving your cursor to the upper right corner does not cause it to switch to the other monitor. If you want to, you could even place a screen on top of another screen. Your keyboard types on whichever monitor that your cursor is currently on. You can configure shortcut keys to switch focus or lock your cursor onto a certain screen. (useful if you play video games) Check it out at http://synergy2.sourceforge.net.

Friday, July 11, 2008

WampServer for Web Development

WampServer 2 is an open source package that includes Apache, PHP, and MySQL all in a simple, easy to setup installer for Microsoft Windows. It is ideal for web development on a Windows platform. The term WAMP is an acronym describing a common software configuration running Windows with Apache, PHP, and MySQL. You can get your Apache server up and running with PHP and MySQL within minutes. This can take hours to download, install and configure these applications individually, especially if you do not have experience with them.

WampServer installs a task tray icons that allows you to easily manage your server. You can enable and disable PHP extensions with the click of a button. It provides instant access to update your php.ini configuration file. When you are ready to restart the server, simply use the WampServer menu to restart it. For PHP developers, this saves a great deal of time.

By default, your WampServer is only available from the computer that it is installed on, but you can place your WampServer on the Internet through the WampServer menu. However, I would not recommend using WampServer in a production environment. You should have an IT manager that is responsible for managing your production server with Apache, PHP, and MySQL installations. When running a publicly accessible server, you need to ensure that you have the latest security updates on all software as well as a firewall. Even this does not make your server foolproof. You need to learn to write secure PHP code. I personally recommend running a LAMP configuration for production use. This involves running Linux with Apache, PHP, and MySQL.

WampServer is perfect for developing applications on Windows platforms and greatly reduces the hassle of configuration.