Friday, October 8, 2010

WSJ: Apple Readies Verizon iPhone

The Wall Street Journal reports that Verizon may offer an iPhone to customers as soon as 2011 Q1. Would that not be awesome? But wait, we have been hearing this same song be sung ALL SUMMER. It might seems as if it will really happen this time, however. Back in June, MSNBC released a similar article claiming the same date.

What does this mean for Apple? Most analyst suspect that Apple feels like they are losing ground in wireless communication to Android-based phones. The WSJ article shows that over the past nine months, there are roughly only 2.5 millions more iPhones than Android-based phones. This number has been reduced significantly since Jan 2010 where the difference was nearly 10 million. Moving to Verizon, the wireless provider with the most subscribers, is a wise decision on Apple's part.

What does this mean for consumers and developers? For Verizon consumers, this means they will gain an option in the category of smartphones. I do not, however, expect to see a dramatic rise in sales of iPhones vs. Android-based phones. The reason being is the lack of specific hardware and ease of development of Android apps. The uptight nature of Apple and the iPhone AppStore makes developing applications and getting them published costly and slow. The openness of the Droid Market and the number of user-friendly development tools makes Android a clear winner.

Wall Street Journal Article

Tuesday, September 14, 2010

Android No Longer the Runt of the Litter

Don't say I didn't warn you. I have been telling developers that Android is the new iPhone iOS. This article explains why. And why shouldn't it be? It is based on a well-loved, easy-to-use programming language, Java. I, having developed some iPhone apps (obviously with Objective-C), am not sure why any sane programmer would want to write in it. I enjoy writing software using ANSI C but not when I am making software for an end-user. Then Apple takes a perfectly well-executed language (ANSI C) and makes a disorganized mess of it. Wow, anyway...Android is up and coming. If you have not explored the idea of developing for Android-based phones, now is the time.


Read more

  Reuters: Google's Android to be world No. 2 in 2010: report

Tuesday, August 31, 2010

HTML5 - Know it!

If you have not yet taken a look at what HTML5 is and how it is an improvement over the current version, you are about to miss the boat. Here is some additional browser functionality ushered in with HTML5 compliance: 
  • Local storage using Javascript (big deal!)
  • New semantic tags, like <section> and <header>
  • Built-in geolocation functionality
  • Drawing canvas
  • Enhanced form features
To learn more, pick up a copy of the book (below) or take a second to read through some of the following sites:
Available on Amazon!

Monday, August 30, 2010

I Have Access to AppInventor!

I am excited to report that I have (after quite a few weeks) been granted access to AppInventor. As far as I understand, access to AppInventor is restricted to educators at this time. I imagine, however, that it will not be long before Google opens it up to all who are interested very soon. For those of you who cannot play with it, I will take you through some of the abilities it offers!


There are two parts to developing with AppInventor: the web-based layout editor and a locally run code editor. As I stated in my recent post, you do not actually have to know how to write software (using Java) to make applications. This is the neatest part of this product. All of the "programming" is handled using a drag-and-drop editor! No Java experience required.

Screenshot of the web-based layout editor (http://appinventor.googlelabs.com)

Screenshot of the locally-run drag-and-drop code editor
The AppInventor software is projected-based. Probably the coolest part of this entire setup is that if you have an actual device, say a Motorola Droid X, and set it up correctly, you can actually see the changes you make in the layout editor and code editor take effect in near real-time! If you do not have a physical device, there is still a way for you to test out your project. Just follow the directions on how to install the SDK and the emulator. Happy mobile software development!

Read the official blog post for AppInventor's release.

.htaccess Trick to Redirect All Traffic

A neat article from a local Columbus developer on how to "take down" your site for updates using .htaccess.

Read the Article

Monday, July 26, 2010

3 Awesome APIs Everyone Should Know

These days, application programming interfaces (APIs) are ubiquitous. Without them, Web 2.0 would not be what it is. Developers would not have any means to hook into other web services and create useful mashups. The overall integration of content on the internet would be next to nothing. You would not be able to post a link to Facebook about a YouTube video (from YouTube) or update your status on Twitter from your iPhone. We rely on APIs heavily for much of what we do on the internet. Here is a brief overview of some neat APIs every developer should be aware of:

1. Facebook API 

If you have not heard anything about Facebook's different APIs, you must have been living in a hole for the past few years. Facebook has become the de facto social integration tool. With over 500 million active users, Facebook has become an unstoppable force of content generation and user interaction. I have even heard some people say that Facebook is becoming the internet. The company has strategically infiltrated every corner of the internet with "Like" buttons and "Login with Facebook" buttons. This is not an API that any developer can continue to ignore. Seriously. It is "do or die".



2. GoWalla API 

GoWalla.com's API is a location-based web service. It provides developers with a way to convert between latitude/longitude coordinates and nearby establishments. GoWalla really hit big once it was debuted at the SXSW conference in 2008. You give GoWalla a latitude, a longitude and a radius (in miles) and it returns a feast of nearby establishments in JSON. The reason why I like this API so much more than GoWalla's main competitor, foursquare.com, is the type of data GoWalla gives access to and the fact they use a REST approach.




3. Google Maps API

You can integrate a map of anywhere into anything now thanks to Google Maps. Yes, there are mapping APIs available (Bing and MapQuest). There are drawbacks and benefits to each. I have the most experience with Google Maps due to a project I worked on recently. The project required a robust map and the supplying service to allow many thousands of hits a day without incurring a cost (initially, at least). Bing's terms of service stated that the number of requests per day were closely monitored and highly restricted. MapQuest's API (see Documentation) was not flexible or stable enough to handle the complicated requests we were making from our service.

Google Maps API came out a strong contender and never disappointed. Google offers some extremely useful functionality and the service was very reliable.

Monday, July 12, 2010

Now Anyone Can Make Android Apps

A new tool from Google, named App Inventor for Android, promises to make developing applications for Google's Android platform easier than ever. App Inventor provides the user with a graphical approach to constructing apps.



Traditional development normally entails the Eclipse IDE, the Android SDK, and a lot of Java code. With App Inventor, you do not have to worry about any of this; you do not even need to be a developer. Most of the time, when an organization abstracts away all of the complexities of the product, it also inherently reduces its functionality. This is not the case with App Inventor as it still gives the user access to the device's GPS, phone features and camera.

App Inventor is built off of MIT's Java Open Blocks, a framework for visually representing Java code. This is the bit of the software that allows non-programmers to use it. Currently, this tool is only available to educators. If you qualify, I highly recommend checking it out and letting me know what you think!

Saturday, July 3, 2010

Whoa! Now that is a Road Trip!

If you know me, then you know that I love driving. My friend recently came across one hell of a road trip. Be sure to take a look at the map slightly zoomed in. It has about a billion turns and some nightmare-ish chicanes and hairpins.


View Larger Map

So if you happen to be looking for an awesome road to drive and are in the neighborhood of central Romania, let me know how it is! This TopGear video is probably as close to driving on this road as I will get. Alas.

Friday, July 2, 2010

The Town That Was

I recently came across this sad video on Hulu. "The Town That Was" is a story about a small town in Pennsylvania whose coal mine caught fire in 1962 and continues to burn to this day. The mine fire drove out thousands of residents and caused the permanent closure of part of a state route. Despite many attempts by the government to save this quaint little town, it is all but abandoned save the very few who stayed.

Learn more about Centralia, PA

Friday, June 25, 2010

PHP Session Issues

I recently had a ridiculous problem with a user authentication script on a site I was making. Upon first loading the page, a user would have to execute the login script twice for the account to be authenticated. It literally puzzled me for weeks.

Eventually, I had determined that there was something about the PHP session variables that was not being set. I had no other problems elsewhere I employed PHP sessions; just the login script. Further investigation revealed that the real issue was with the cookie the PHP session creates.


Important Note: When session_start() is called, a cookie is created and the session id is stored in it. For more on PHP sessions, check out this article from php.net. 


Here is how it breaks down:

  1. The user points their browser to http://url.com/index.php
  2. The user attempts to log into the site.
  3. The authentication script calls session_start() and logs the user in, setting a state variable $is_logged_in to true.
  4. When the script ends, it redirects the user to a page using header('Location: http://www.url.com/somepage.php').
  5. The $is_logged_in = true in the PHP session does not carry over from the authentication script.
Why?

The PHP session data cannot be accessed by somepage.php because when the authentication script called session_start(), a cookie (learn more about PHP and cookies) was created and assigned to the "http://url.com". When the redirect completes, the current domain is now "http://www.url.com". It is a simple mistake, but devastatingly annoying.

Solution 1: Using a PHP Configuration File

There are a number of ways to remedy this issue. I chose a preventative approach which requires an .htaccess file. 

If you have access to (check with your hosting provider if you are unsure) your PHP Configuration File, php.ini, you can add a directive that forces PHP to always issue cookies to the top-level domain and all subdomains. Add the following line to your php.ini file: 

session.cookie_domain = .url.com 

For more information, read this. Please note the period before the "url.com". It is important. Also, note the lack of single or double quotation marks.

Solution 2: Inline Directive

Instead of having to modify your php.ini file, you can set the cookie domain inline with a particular script using the ini_set() function (see PHP manual). Add the following line to your PHP script: ini_set('session.cookie_domain', '.url.com'); Take note again of the period before "url.com".

Solution 3: .htaccess RewriteRule

This is the method I chose because it is an inherently proactive approach. It requires an .htaccess file and the following code:

Options +FollowSymlinks
RewriteEngine on

RewriteCond %{HTTP_HOST} ^url.com [NC]
RewriteRule ^(.*)$ http://www.url.com/$1 [L,R=301]

The first line tells Apache to honor symbolic file links. If you have a file symbolically linked to another file and get a HTTP 403: Forbidden when trying to access it, it may be because your .htaccess file lacks this line. The second line tells Apache to enable URL rewriting (see Apache manual). This is the first step to fixing the matter at hand. The third line is a rewrite condition (see Apache manual). If the condition is met, it executes the following rewrite command on the fourth line. The RewriteCond condition verifies that the base domain is exactly url.com. If the condition is met, line four takes the URI and appends it to the string "http://www.url.com/", forcing the www subdomain. 

Problem solved.

Thursday, June 17, 2010

Physics can be fun!

If there ever was a person who cared about Physics more than life itself, it would be Julius Sumner Miller (1909-1987). Take a look at his Wikipedia biography. These YouTube videos are proof that even the most complex physics concepts can be made attainable. Professor Miller produced quite a number of episodes for this show, most of which can be found on YouTube.


I idolize this individual for a few reasons. His way of speaking is something of a lost art. His word choices are enchanting and, much of the time, downright hilarious. When he explains how the ping pong ball defies gravity in the glass funnel when turned upside down due to a low-pressure field, it almost seems as if he is revealing the secret behind how he made the elephant disappear.

YouTube Videos
Probably the funniest and strangest episode
Inertia
Energy and Momentum
Bernoulli Principle

Sunday, June 13, 2010

Creating Vanity URLs with .htaccess

I had to do this for a project website I was working on recently. We knew we wanted the user's profile to be accesible by entering the www.url.com/username. This was, more or less, created automatically when the user created a profile. I brainstormed dozens of ideas, all of which were either not secure or overly complicated. Finally, the answer came to me: .htaccess and regular expressions.

Our server is Linux-based and runs Apache for the web server. Because we use Apache, we can use .htaccess...and it is a beautiful thing.

An .htaccess file is used for a number of reasons:

1. To redirect a user to File B when they try to access File A
2. Restrict/allow access to particular directories or files (with a little help from .htpasswd)
3. To beautify long, cryptic URLs

The way in which .htaccess accomplishes #3 is via mod_rewrite. Here us some more information regarding this Apache module. To enable mod_rewrite, add the following two lines to .htaccess file:


Options +FollowSymlinks
RewriteEngine on

For the sake of example, let us say that the PHP file that handles displaying a users profile is named profile.php. Furthermore, a username may be comprised of numbers, letters (upper and lower case), periods, hyphens and underscores. Adding the following rule:

RewriteRule ^([A-Za-z0-9\._\-]+)+[^\.php]$ profile.php?&uri=$0 [NC]

 to the .htaccess file will rewrite http://www.url.com/username to http://www.url.com/profile.php?uri=username. An important note about the rewrite is that http://www.url.com/username is what is still displayed in the browser's address bar. Thus, a vanity URL!

An explanation of the regular expression used in the rule is beyond the scope of this post. Read more about using regular expressions with mod_rewrite.

    Have fun and learn something new

    During my time at Miami, I came into contact with my fair share of interesting individuals. There was one person which stands out in my memory. He was the professor for my "Intro to Engineering" course my freshman year. Quite an eccentric teacher, my professor had this odd passion for teaching. He lived to see the proverbial light bulb switch on. At the bottom of every document, he always added the following disclaimer:

    "HAVE FUN AND LEARN SOMETHING NEW"

    At the time, everyone in the class thought this was the most ridiculous mantra to add to a homework assignment, myself included. Years later, I reflect back on this phrase and realize that it has become my mantra. Every day, I search for new knowledge; from what temperature 4130 Chromoly must be heated to achieve annealing to understanding how to calculate reflectivity of clouds based on water vapor density. My interests are as strange as they are wide. 

    This blog will serve as a window into some of my explorations. There is so much to know and understand...we best get started!