SuperComputing 2010

I managed to talk the K-State CIS department into sending a team, including myself, to SuperComputing 2010 to compete in the student programming contest. As a team of 5 members we had a combined total years of experience with super computers of about a year. To our surprise we placed third. So looks like we are going to try going for gold next year in Seattle, WA at SuperComputing 2011.

If you are interested in the questions you can find them here.

in_addr to string(char*)

The other day I needed to turn a IPv4 address to a string in C. I figured some others would find it useful:

 
char* hexToCharIP(struct in_addr addrIP)
{
  char* ip;
  unsigned int intIP;
  memcpy(&intIP, &addrIP,sizeof(unsigned int));
  int a = (intIP >> 24) & 0xFF;
  int b = (intIP >> 16) & 0xFF;
  int c = (intIP >> <img src='http://www.coryhardman.com/wp-includes/images/smilies/icon_cool.gif' alt='8)' class='wp-smiley' /> & 0xFF;
  int d = intIP & 0xFF;
  if((ip = (char*)malloc(16*sizeof(char))) == NULL)
  {
    return NULL;
  }
  sprintf(ip, "%d.%d.%d.%d", d,c,b,a);
  return ip;
}
 

Android 2.2.1 Released(the unofficial change log)

Early last week, I received a notice on my Nexus One that Android 2.2.1 was available for download. I was surprised but excited none the less. So I quickly searched the web looking for any and all information about what was new. It turns out that a number of people had posted that the new version of Android was available but no one had any kind of change log.

Well now that I have had the update install on my Nexus One for a week I think I may have found the extent of the new features:

WiFi finally works correctly. A number of Nexus One users have had a hard time getting their phone to auto connect to known WiFi networks. I believe it had something to do with it would stop after one failed attempt to connect at the fringe of the network. Well now this is fixed, in fact my battery life nearly cut in half the day after the update. I had my WiFi sleep options set to "never turn off." Before the update, this was not actually an issue due to the fact my WiFi was never actually connected. However after the update my phone is almost always connect to the campus WiFi as would be expected. So I turned back the sleep options to turn off when my screen was off and my battery life went back to normal.

Different color status lights. I was told, when I purchased the Nexus One, that the track ball would glow different colors depending on the type of notification you have. I was sad to see that not to be the case when I got the phone. With Android 2.2.1 my track ball now sometimes glows green instead of the white. Email, text message, and missed calls all seem to glow white. While things from Google voice, like texts or missed calls, make it glow green. I can't seem to find any options on how to switch this or try to get it to glow any other color. It seems silly to make a device that can glow either green or white, perhaps it does more but the feature to set it has not been fully integrated in the phone. Hopefully the next update will complete this feature.

I am sure there are a number of other updates, most likely security updates. I hope that in the future Google makes it a point to release some sort of official change log so that people are not just guessing. Let me know if you have found anything else new with Android 2.2.1.

Internet Explorer 9 Beta Released

For those that do not know Microsoft's Internet Explorer 9 beta has been released. You can find the download at http://www.beautyoftheweb.com/. I will let everyone know my opinion once I have it installed and I have tired it for a while.

Syncing Music to Nexus One in Ubuntu 10.04

Ubuntu 10.04 has really improved over previous versions of Ubuntu in the syncing to devices support. In particular support for syncing music to IPhones and ITouches. They have also added support to Rhythmbox to reconize when a Nexus One has been connected to the machine (this may also work on other Android devices, I've just not tested others).

When you plug your phone into your Ubuntu 10.04 box, on your Nexus One an alert will appear asking you if you'd like to enable USB storage. Once you have enabled this, the Ubuntu system will see the phone has a USB mass storage device. Now you should be able to download all of your pictures and in Rhythmbox the phone appear on the device list. You can just drag and drop your music like you would for a playlist.

Since Ubuntu is treating the phone as a mass storage device, Rhytmbox does not know by default where to upload the music. So it defaults to the root of the SD card. If you would like to not fill the root up with all of your music you can opt to put all of your music into a music folder. To do this, you need to upload one song to the Nexus One, then open up the device in a file manager. Create a new directory called "music" and move the one song you uploaded to that folder. Now Rhythmbox will be smart enough to know to upload to the "music" folder and all the media applications on the Nexus One will auto detect the music in the "music" folder.

If you are looking for a good music player I have become a big fan of DoubleTwist. Plus if you are on Windows or a Mac you can use the DoubleTwist desktop client to manage music on the phone.

Google Wave – Waves Goodbye

Sadly it seems Google Wave days are limited. Google is pulling the plug on their Wave service sometime after the end of this year. I was surprised to hear that Wave was not doing too well, I have used it nearly every day since I got private beta access to the service. There has never been a tool created on the web that could allow true real time collaboration and also auto documents the collaboration. Video conferencing can not hold a stick to Wave, video does not provide any useful record of the conversation or a way to pick it back up immediately from where you left off.

There are probably several reasons why Wave failed, however I believe the biggest is that Wave never hit its tipping point. The saddest moment with Wave is right after you first launch it, when you realize none of your friends are their. Wave is nearly completely useless without others to use it with. I got lucky because I work closely with several people across the United States, we saw Wave as the perfect tool to help us work together. I can imagine a lot of users are not so lucky and just couldn't find a use for Wave in their personal life. To combat this, Google should have integrated Wave directly into GMail. A user should have not been able to tell the difference between a Wave and an Email, except that in a Wave the other user could see you typing your message.

Wave really could replace about 80% of my emails, mainly the ones that are for debugging or brain storming. Their will always be emails that a Wave could not replace, like receipt from Amazon purchases.  Wave would revolutionize digital conversations within businesses. In order for that to happen however, Google would need to make a push for other services to be able to host their own Waves, like the current state of Email. Where I can send an email to anyone, even people outside of Google. Wave should have been explained as Email v2, and Google should have pushed it that way.

I'll be sad to see Wave disappear, hopefully Google has a good plan to bring the benefits of Wave back.

P != NP

Dr. Vinay Deolalikar of HP Labs has written a paper proving that P != NP. This has been at the center of theoretical computer science for almost as long as computers have been envisioned. This is good news for cryptography but bad news for optimization of some useful problems, like traveling sales man.

The paper has not been peer reviewed, so the jury is still out on whether he is correct.

Microsoft’s 2019 – Where are the developers?

A little known fact is that Microsoft invests heavily into developing technologies for the future. Every now and then these researchers look to the future and into how to turn what is being developed as pure research into reality. Nearly a year ago Microsoft released this video of how productivity will be in year 2019 (ten years after the video was released). I just recently saw the video for the first time, if you have not seen it you should check it out here:

After I watched the video I was left with a few thoughts, which I'm sure was the true purpose of the video. The over arching theme in the video was that productivity will shift from application based to task based. By this I mean instead of thinking I need to open up Word to work on some research paper, I will instead have a research task that has a word document associated with it along with all of my research references and my collected data. At first glance it isn't that big of a change, users already associate related files/material together by creating folders or some naming scheme. You need to look a bit deeper, instead of the user associating files together with some type of organization, the computer will automatically discover context and associate the correct material together. It is a very cool idea and one that I am sure will come true some day. The question I think is how do developers get involved?

Since the world is not slowing at producing computer scientist, they will need jobs in year 2019 just like they need them now. So if we assume that a lot of these things come true, especially the task based productivity, what do these computer scientist do? Well clearly, a lot of the computer scientist will help develop the software that is capable of detecting the correct context and making sure this stuff stays secure. These are the developers that work for companies like Microsoft and other top software companies. What about the rest of the developers? Like the ones that do open source, developers for hire, or work for a small software company. What will they provide to an end user?

Cloud services are featured all over the place in this video. Data is everywhere you are. How does an open source developer be part of this type of world? I think it will be a lot like it is today. Protocols will be open enough to allow anyone to interface with the cloud. In order to make this possible, these protocols we will need to move from today's free services that are paid for by ads to paid for services. This will happen due to privacy concerns and cloud services will have trouble placing ads so the user will be interested in them. Interfaces to the cloud will be what open source developers are creating. Microsoft and other propitiatory software will still exist along side open source software, like it is today.

Well these other developers could not write custom applications anymore. This is because applications no longer exists. So they must provide a task environment. Now the question becomes, what does it mean to provide a task environment? This is a difficult question because we have never seen one yet. I would expect a task will resemble a rule set, where developers tell the host system in which context input should be handled by the developer's task. Then host system will provide the windowing environment and placement of the data in the user interface.

What are your thoughts?

Usable Security

There has been a big push over the last few years to develop what has been coined as "usable security". Things like drawing patterns on Android devices instead of typing in a 4 digit pin or identifying particular things in an image instead of typing a password have been developed. The biggest problem with these usable security mechanisms is that they often take longer to use than the alternatives.

Imagine if you had to take your mouse and click at 10 particular spots in an image every time you wanted to unlock your screen at work. Doing this would take several more seconds at every sign on and would add up quickly. Often for systems that are used often keying in a password is still the fastest method.

Well Microsoft has developed a new solution. Instead of having password requirements that are visible to the user, like minimum length, they want to let users use anything as a password. Even simple passwords like "love" would be accepted. However there is a catch, only a small number of users will be allowed to use a particular password.

Complex password requirements were introduced to combat spraying and braying attacks. A spray and bray attack is when an attacker tries to use one particular password on a large number of accounts. This way bypassing lock out procedures. This solution by Microsoft will fix this by only allowing a small number of accounts to be compromised and thus reduce the benefits of the spray and pray attack while keeping passwords simple and easy to remember.

Code Reviews, the Lost Art

Nearly every software development shop worth its salt has some form of what is known as a code review and nearly every developer dislikes them. Most matured developers tend to like the idea of code reviews but given the choice, on there next commit they would likely opt to not send their code for code review. The reason why is simple, code reviews can delay the forward progress of the software and they take time. When you have other developers needing access to the library you just wrote it is hard to say we need to take a few hours to a week of our time to look over my code. I think we should be able to make code reviews better and into something everyone wants to do.

After a code review I often finding myself wondering was what was found worth my time and the reviewers time? Most of the code reviews that I have been apart of have had minor suggestions or more commonly code standards compliance problems. When you rummage through several hundred or a few thousand lines of code during a code review and all that is found is that you have a few extra blank lines or should change the name of a variable, it does seem like a bit of a wast.

I'm not saying that we should not care about those extra lines or any code standard for that matter. I'm a big fan of code standards, I think they help in the readability of code. I'm saying that there is a cost to code reviews, we have to weigh those costs against the rewards. When a reviewer only finds a few compliance issues, things that could be fixed by anyone that is reading through the code, it was not worth the time the reviewer spent reviewing.

So how do we make code reviews worth everyone's time? Simple, we change the intent of a code review back to what the actual intent was. Code reviews are put into place to find bugs. Bugs that would show up to an end user or other developers that are trying to use the code.

You may say, “well Cory that is what every code reviewer is doing, they are looking for bugs.” However that is not true, sure they are looking for obvious bugs like unassigned variables being referenced, but they are not looking for deep bugs. One of the most common bugs comes from input validation, and yet it is a bug that is often over looked in code reviews. This is because it is often difficult to tell exactly where input to a function is coming from and how much it should be trusted. Detecting multi-level bugs requires a reviewer to see how the multiple levels interact and the path of the code in correct and error states. This kind of review takes a lot of time and drastically increases the complexity of a code review. The sharp increase is due to the fact that we are moving a code review from a mostly passive practice to a very active process.

Obviously code reviews could not detect all bugs and there will be times when a code review will not find any bugs. From this active process of a code review you get a new found level of confidence. Bug counts will be decrease and actual development should increase. This confidence is how a code review pay for themselves.