Programming

When can I use HTML5?

html5 canvas support
Click on image to go to the guide

Ready to move your site to HTML5? Better check this browsers com­pat­i­bil­ity guide out before you call the shot.

Cooking an MVC framework for data visualization: Views part 1

In this sec­ond tuto­r­ial on MVC we will learn how to cre­ate a sim­ple bar chart view. We will also cover a new con­cept called com­pos­ite view. It is an impor­tant con­cept in the MVC world that allows a view to con­tain other views. It will let you build com­plex views out of small inter­change­able pieces. When your appli­ca­tion grows, it is cru­cial to write code that is reusable, so your appli­ca­tion remains main­tain­able. Breaking views into small reusable chunks of code is one way to do that. Below is the result of what we are going to build in this tutorial.

The chart shows monthly unem­ploy­ment rate since 2005 from the U.S. Bureau of Labor Statistics.

Continue read­ing »

Cooking an MVC framework for data visualization: Hello World!

For the last few years MVC frame­works have become a hot topic in the devel­oper com­mu­nity. Many peo­ple love them and for a good rea­son. They make writ­ing code much eas­ier and more fun to do. The pro­grams writ­ten in MVC are more scal­able and eas­ier to main­tain. One of the biggest ben­e­fits is that if you learn one, you can prob­a­bly learn oth­ers pretty quickly.

A few words about my background

I am a web devel­oper and designer who spe­cial­izes in data visu­al­iza­tion. I have been using a few MVC frame­works such as Django, ASP.NET MVC and more recently iPhone SDK for my work and I can tell you, they are very sim­i­lar. Since I am still learn­ing these con­cepts myself, please let me know if I don’t make sense or I am com­pletely wrong. I promise I won’t feel bad about it :) .

Preparation

In this series of tuto­ri­als I will intro­duce you to the MVC world. You will learn how to make your code cleaner and your appli­ca­tions more mod­u­lar. Along the way you will learn a few use­ful design pat­terns, one of which is MVC, and how to apply them to your work. Although the main focus is on build­ing a data visu­al­iza­tion frame­work, many tech­niques are applic­a­ble to any kind of work.

These tuto­ri­als assume that you have gen­eral knowl­edge of object ori­ented pro­gram­ming and under­stand AS3 syn­tax. If you are not famil­iar with these, please go here and here.

Continue read­ing »

Iphone SDK 4.0 license agreement bans ported Flash apps

We are all excited about the new iPhone OS. Every time Apple releases some­thing new, it does mir­a­cles or at least we are let to believe so. With fea­tures like mul­ti­task­ing, folder sup­port, a new ad plat­form and the list goes on and on, how can we not be excited. But then still no flash sup­port. Besides that, Apple has gone an extra step by pre­vent­ing any­thing flash related from work­ing on its platform.

Adobe announced a few months ago that they will allow you to com­pile Flash appli­ca­tions for the Iphone. Being a Flash enthu­si­ast I was incred­i­bly hope­ful. Then yes­ter­day the bad news came. You can’t use any­thing but Apple pro­pri­etary plat­form to build apps for the Iphone. I under­stand that they want to have full con­trol over the apps to make sure that each app per­forms well and is best for the users, but I feel like liv­ing in “1984” all over again.

I find it ironic that this is what Apple used to stand for.

Dirty Heating Oil in New York City

new york oil
Click on image to view the map

This is a map I cre­ated recently for the Environmental Defense Fund. It shows build­ings in New York City that burn dirty oil. The map con­tains infor­ma­tion about 9000 build­ings that burn either type 4 or type 6 oil. Both types are bad for the environment.

My biggest chal­lenge with this map was the sheer amount of data it has to load, parse and plot. Fortunately, AS3 is fast. It is a plea­sure to see the parser churns through thou­sands of lines almost instantly. Another fac­tor that made my life much eas­ier was the map frame­work I used. I want to thank the peo­ple at stamen.com and the devel­op­ers of mod­est map for cre­at­ing an amaz­ing frame­work. With just a few tweaks I man­aged to plot thou­sands of points on a map.

It seems like the story got a lot of atten­tion. It was men­tioned by The New York Times and Daily News.

To view the map, please click here

Stimulus tracker


Click on image to view the map

We learned and uti­lized many new tech­nolo­gies in this project. Unlike the Adversity index map where we didn’t have proper server-side tool to han­dle big data set and we had to use hacks, this project uses a brand new server-side tool to do the heavy lifting.

We built the server-side code using Django frame­work. This is the first time we are using this frame­work and it is awe­some. It makes my life as a web devel­oper much eas­ier, espe­cially when I was com­pletely new to it.

For this project, we built a frame­work in AS3 that allows flash to com­mu­ni­cate with the server and to make requests in real time. The frame­work makes it easy to parse responses from the server and deliver them to dif­fer­ent parts of the appli­ca­tion. With that, we are able to sup­port deep link­ing, back but­ton and breadcrumb.

Last but not least impor­tant is the new map engine I built recently. There are two parts to this. The first part is the script I wrote that runs through any ESRI shape file and parses it to native AS3 code. The sec­ond part is the engine that takes the code and ren­ders it on the screen. With this engine, we can cre­ate pretty much any kind of maps quickly and efficiently.

View the tracker

Book Review: Programming Collective Intelligence: Building Smart Web 2.0 Applications by Toby Segaran

Collective Intelligenge book

If you have not read this book yet, then you need to order it now. I was skep­ti­cal about the book because I thought it tries to cover too many top­ics, thus not going in depth about any of them. I was wrong.

Far from being a bor­ing the­o­ret­i­cal book on web devel­op­ment, this book con­tains a vast amount of use­ful infor­ma­tion with easy-to-understand exam­ples. The book cov­ers the algo­rithms behind search rank­ings, online match­mak­ing, prod­uct rec­om­men­da­tions and social book­mark­ing. The author walks you through the the­ory behind each algo­rithm and pro­vides exam­ples of how you can write one your­self. You don’t have to be an expe­ri­enced pro­gram­mer to under­stand this book.

Continue read­ing »

Page 2 of 512345