3.03.2009

Transparency and the Internet

One of the many things that the President Obama's American Recovery and Reinvestment Act does is establish a web site called recovery.gov. The idea is that Americans can go online and see where every dollar from the Act is being spent. I think this is definitely a step in the right direction, but it falls substantially short of where governmental transparency should be.

Lack of transparency is one of the reasons we are in this economic mess in the first place. Not just in government but in major corporations that award themselves huge bonuses instead of pulling their companies out of bankruptcy. I'm not a proponent of completely unregulated capitalism but if you are bad at managing your company it should go bankrupt. You think that the economy would collapse otherwise? Look around... The economy is already crashing even after we bailed them out because they did not use the money effectively. I don't know why we thought they would be better at it this time around. One of the problems with this view is that we cannot bail out every company that is in trouble, especially in these hard economic times. You will inevitably end up choosing between those that deserve to keep their jobs and those that will see their companies fail along with all of its employees.

Money is only one aspect of transparency that the internet can help us with. With how rich many web sites are these days they provide one of the best ways to categorize information intuitively. Maybe one day this will help us not only understand where all of our money goes but also provide a quick and effective way of understanding the current social, political, and economic issues our government currently faces. Right now there is a thick fog that separates the ordinary US citizen and understanding how most legislation impacts them. Sure, some of this is due to a large amount of the population that just does not care, but I'm willing to bet that some of them don't care because that fog exists in the first place.

2.26.2009

Speed of Communication


This post is motivated by one of the most recent features that has been added to Facebook; the ability to comment on a majority of the different news feed items. Somebody posts an interesting video to one of their friends wall and all of a sudden there is a round table discussion involving 20 different people about its content.

However; this post is not about Facebook but about the concept of increasing the speed of communication. I'm not going to pretend like I can cover the history of how communication has increased over the years or whether or not it has been beneficial or detrimental to society but I think it is important to try and understand how new and different forms of communication affect the way we interact with each other.

Imagine what it was like before we were able to communicate across oceans instantly. When the first Americans declared indepnedence and started the revolutionary war they did not just call King George on the phone and say 'screw you we are out.' They had to send a boat all the way across the north atlantic ocean to give him the finger. Entire naval wars would be fought even after peace was made just because they would have no way of communicating with each other.

I think this is important because there has to be something beneficial about increasing the speed of communication. We can better communicate about how to cure diseases, come to resolutions during disputes, and most importantly are less susceptible to misinformation campains by any organization be it motivated by money or ideology.

However, I would be a very biased blogger if I did not consider the negative affects that access to distance communication has on our interpersonal communication and relations. It's not something that I have easily accepted. I grew up as the first generation to actively communicate over instant messanger. Facebook was in beta my freshman year and only avaliable to a small section of colleges - Kansas State , my alma mater, was one of the first 50. Naturally I was quick to become one of its members and watched it grow to become the 6th most visited website in the world.

I think people have a very good point when they argue that certain technologies have distanced us physically, but have they distanced us socially? What about people that are normally very shy in public situations and find the internet as a vital tool in their ability to communicate with others that are similar to them. Who are we to say that they should conform to our form of communication or social norms?

It reminds me of the rise of the blogging movement in China where citizens would bounce their IP's off of Canadian servers just to post to the rest of the world and other Chinese citizens about thier lives inside of China. I feel like this unprecedented speed of communication can definetly be used to liberate people and give other a voice that would not otherwise have one; but there is clearly something invaluable to meeting another individual face to face and shacking thier hand.

At the end of the day just because we add another form of communication does not meant that it necessarily trades off with how we currently communicate; just that it adds another avenue for us to reach people we would not have touched otherwise.

2.11.2009

Attaching keyboard events to alternative browser objects

It took me way too long to find out why I could not listen to keyboard events for DOM objects other than the window, form objects, or links. All you have to do is give the div or any other DOM element a tabindex. Below is an example using the prototype framework.

  1. var myDiv = new Element('div' { 'tabindex': '0' })

  2. myDiv.observe('keypress', function(e) {

  3.   var code;

  4.   if (!e) var e = window.event;

  5.   if (e.keyCode) code = e.keyCode;

  6.   else if (e.which) code = e.which;

  7.   alert(String.fromCharCode(code));

  8. });

The emerging internet 'Grid'

One of the newer battles between internet companies has been the standardization of login information. Even to create this post I logged in with my gmail account information I set up five years ago. Now, just as I am able to access any Google service with the same user name and password internet companies such as Facebook, Google, and Microsoft are allowing third party websites to enable thier users to log in with that same information.

This provides these third party websites not only with an easy way for users to create an account, but in some cases access to information that has been previously stored on the website you used your account information from. The upside of this is that you could go to a brand new website you have never been to, say Pandora, and log in with your Facebook account. Then Pandora could check what music you like and suggest stations for you to listen to. The downside, as with most website that make life more convenient is increased access to your personal information.



I think this has a larger overtone for what this post is really about - saving our lives on the internet. In the description above where is your information really stored? Us computer scientists call this the 'cloud'. It's not really on a single computer or server but spread around the internet so it is never lost and can be accessed whenever needed.

Eventually all of our information will be connected in the same way. The music we download, Facebook information, myspace pages, blogs, email, twitter, etc. So the final question is who will benefit from this emerging grid? My hypothesis, as predictable as it may be, is Google. For anyone that has a Gmail account the rate at which your allowed storage increases is a little ridiculous. By expanding their server power as much as possible it seems as if Google is buying stock directly from the internet. The more we use it, the more information we need to store on their servers.

However, I believe that access to that information will remain free provided you are subjected to the occasional creepily targeted ad on the side of your screen. Let's just make sure we spread the information around a little bit so one company doesn't end up owning the internet.

That might be a little bit of an embellishment...I don't really think that Google is going to take over the world but a day after I originally posted this article Gmail went down for about an hour. I makes you think about cloud computer and how we should probably still keep local copies of our files. This is why I think that in the near future there will be companies that make a lot of money providing synchronization services. Similar to the SVN programs we use when writing software. For those of you who are unfamiliar to SVN server they are a way for multiple programmers to work on the same program and upload it to a website. When they upload it the SVN server checks to see if you changed anything that would affect what somebody else changed and lets you know about it. Google provides this service with Gmail where you can have it download all of your mail so you can read it even when you are offline. And when your computer connects with the internet again it will send any mail you have recently written and delete anything off of Google's servers that you deleted off of your personal computer. This ensures that if something goes wrong we can still have access to the files we need but could still take advantage of the 'cloud'.

2.08.2009

Saving Javascript Objects to an SQL Database

Why create intermediate files when you can just store everything in a database? With the ability to store information on local databases like SQ lite and SQL servers being given away like candy from every web hosting service why not use their convenience and security for your websites.

I am going to post some code I wrote to directly save javascript objects to an SQLite database using Google gears. It's an example of writing a single method to save any type of object and I think changes the way we think about saving objects. Correct me if I am wrong, but this seems to be the least amount of code from any programming language for saving objects to an SQL database.

  1. function addSQLite(obj, table) {

  2. query = "INSERT INTO " + table + " VALUES (";

  3. z = 0;

  4. for(x in obj) {

  5. switch (typeof(obj[x])) {


  6. case 'string':

  7. if(z>0) query += ",";

  8. query += "'" + obj[x] + "'"

  9. break;


  10. case 'number':

  11. if(z>0) query += ",";

  12. query += obj[x];

  13. break;

  14. }

  15. z++;

  16. }

  17. query += ")"

  18. db.execute(query);

  19. }



This basically just puts a string together based on any objects properties. All you would have to do it make sure there is a table in the database with the same properties and you have yourself an incredibly versitale SQL function.