Thursday, October 23, 2008

My Adventures with Ink

I don't know how I've gone this long without attempting to program applications specifically for Tablet PC's before. It was a strange string of events that resulted in my new obsession.

Last Wednesday I went to WIPTE where I presented my poster on STUG and attended several informational sessions. As a result I missed collecting the DyKnow in class problem for the calculus classes. As a result I was given the files on a standard jump drive. This was nothing too crazy and may not seem related to programming, but everything comes together very quickly.

My job in the calculus class can be divided into two main tasks. First, I provide technical support during class to help the students quickly resolve their problems. The other part of my job is managing the in class problem. This job goes even farther than just collecting and managing in that I am designing a system to make easier for future semesters. Next semester when I'm not there they will likely not have a student willing to write a computer program to solve technical problems as they arise.

The accident that started my new obsession was an unintended right click. I simply right clicked one of these DyKnow files and realized that Al Zip could unzip it. I've looked into parsing DyKnow's file format earlier and ran into, what I assumed was, compression. This confirmed my assumption. After unzipping the file it was revealed that DyKnow simply uses XML to store all of the information. A fairly standard approach for storing files that contain digital ink.

As a result I was able to read the file in using a simple C# program and read in the information that I care about. So far I have not done anything too complicated. One of the biggest problem I was having with DyKnow was not having any ability to export the user names of the students whose panels were collected for the in class problem. I spent almost 20 minutes manually transcribing these names. Now I have a simple program that can extract the tames and I can copy and paste them from my simple GUI.

Here is just a short C# code sample that I use to actually open the DyKnow file:

//Open the file
FileStream input = new FileStream(dyKnowFileName, FileMode.Open, FileAccess.Read, FileShare.Read);
//Uncompress the file
GZipStream gzip = new GZipStream(input, CompressionMode.Decompress, true);
//Read the uncompressed file as XML
XmlTextReader textReader = new XmlTextReader(gzip);


This simply opens the file as a stream, uncompresses the stream, then reads the stream as XML. However, this is only the first half of the story.

I ended up having to do some very simple reverse engineering to understand how DyKnow's file format works. I won't post any of that information in this post, but if I post some more code I will explain the tags that I had to use. After I got past the standard compression it was trivial to understand the data that is being stored.

The part that now has me busy is understanding the ink data that is stored as part of the file. I have learned that ink strokes are stored as base64 strings. This appears to be standard for Microsoft inking applications and I simply need to pass it to the correct methods to display it. I have found some example code but I haven't made much progress yet. It seems that ink applications are still slightly complicated to make.

Wednesday, October 22, 2008

Programming with Ink

I've only recently started programming applications that have a GUI. I've spent most of my time working on the web. However, I have had a recent obsession with programing with Ink on Tablet PC's. It is only logical, I'm already a Tablet PC nut.

At first I found it difficult to get started. I am running Vista Ultimate with Visual Studio 2008 so I expected it to work without any problems. Well, apparently I should have read the fine print when I stumbled across some Digital Ink Sample Programs on Microsoft's website. I have been able to compile these are make some small modifications to them to start to learn about the ink support. Baby steps... compiling examples is a good start.

I have also run across Stefan Wick's Weblog - Development with Silverlight, WPF and Tablet PC. There are a number of very useful code samples posted on his blog that I will definitely be playing with soon. This also raised my interested in programming for the Ink on a Tablet with Silverlight.

While I haven't made much progress making any programs of my own, I have learned that I will be needing to study up on XAML. I realized it was used in making the interface for many Windows applications, but I didn't realize how extensively it was used when dealing with Ink. Basically, you can have an inking application with only XAML code and no actual C# written.

I'm not sure what direction I'm going to take with this new obsession, but the rate at which I've been making progress is exciting. However, I should probably get back to the homework I've been ignoring.

Sunday, September 14, 2008

And the Wind Blows

I'm trapped. Literally!

Well, not exactly. I can cut through the guys apartment below me to get outside, but the tree in front of my apartment just fell over, bocking the front door!

I managed to get outside, which I wouldn't recommend to anyone, to move my car. Here are a few of the pictures that I managed to get with my iPhone. If I was crazy I might go outside with my good camera and take a few high resolution ones just for fun. However, I think I'll wait until the wind dies down some before risking bodily harm.



This is the tree that fell, it isn't huge but it takes up the entire front yard.


This is the path up to the front door. It isn't passable.



This is what it looks like from my front door. You might be able to climb your way out, but it wouldn't be fun.


Right now I've managed to not lose power or internet. :D My car hasn't taken any damage besides the debris that is hitting it. However, in the neighborhood around my apartment there are several, very large, trees that are down and power and traffic signals are down too. There are also a few close call with several trees that almost fell on top of some cars.

I really didn't expect this today.

Saturday, September 13, 2008

Looking at Google Chrome

Most technology news group quickly publish their review of anything new after it has only been out for a few days. While this is logical to drive large volumes of traffic, it doesn't always give the product a fair chance. I've been using Google Chrome as my primary browser on my laptop for a while now and it isn't that bad. How could I resist already having Firefox 3, IE 8 Beta, Opera, and Safari on my computer.

First off, I will bring up the fact that Steve Gibbson wasn't a fan of Chrome as he outlined on Security Now 161. However, most of the things he brought up were not major concerns of mine. While the handling of third party cookies is a concern, Firefox and IE are about the same. Additionally, black/white listing of pages for scripting is an annoyance but I've never done that. Also, the memory footprint of Chrome is different but as Google outline it is a trade-off for security and stability. Steve also pointed out that the Omni-Bar is a real time keystroke logger. While this is a security risk, it also is a tool that I've found useful.

The Good:

Google is the king of simple interfaces. However, Chrome, for its simplicity, offers a wide range of features. While many will point out the fact that nothing here is innovative, it is still a solid feature set. Chrome has that creepy, it know what you want to do feeling that Google has worked so hard to master. The interface is very simple. Simple to the point where you refuse to believe they have packed all of these features into a browser.

The primary way I have been using Chrome is the Gmail application that I created in Chrome. Basically, an application simulates a desktop application. It further removes the browser, basically making the web page full screen. Also, clicking a link that points out of the application will open in a new window leaving your application untouched. If I continue to use Chrome it will most likely be that I will services like Gmail in the browser.

Speed is a big concern when it comes to web 2.0 application. Chrome really does feel a little zippier. This may be because I rarely drop below 8 tabs and will sometimes go as high as 15 tabs in a single window. While Firefox in the past has started to choke, often because it was using a half a gig of ram, Chrome has stayed solid. I have only had one tab crash and it didn't interfere my other tabs at all. It was a simple process to kill the bad process. IE has already moved to this model and I suspect Firefox will need to do something to react to this trend in the market. While it does sacrifice some speed and uses slightly more memory, the trade-off of security and reliability will likely win.

Other than what I outlined above, Chrome is just a simple browser that works. It is good because it feel light weight. Unlike when I use IE, I don't feel like I have a lot of mass that takes forever to get moving quickly. Firefox gives this same feeling, and it might just be that Chrome is shiny and new, but it still appeals to the Geek in me.

It is also important to point out the Chrome hasn't had any problems to my knowledge rendering web pages that I visit. Everything looks good enough to browser. This is likely because of the Webkit that sits under everything.

The Bad:

There isn't that much to say in this category that isn't already obvious. The most glaring problem when moving to Chrome is that it doesn't have all of the amazing add-ons that Firefox has become famous for. However, I have found I don't miss most of them. While there are a few that I feel like I want back, they aren't deal breakers. Also, Chrome has said they will eventually bring plug-in support but warned that these plug-ins will punch holes in the sandboxes that Chrome worked so hard to create.

I'm not going to focus much on the negatives, as Steve Gibbson spent over an hour on that subject. However, the future looks promising for Chrome.

What is Google's Plan?

This is the part that I like to talk about: What was Google's goal in releasing Chrome? The only real place they took browser market share from was Firefox and a large fraction of that has already abandoned Chrome. First off, I think Google is attempting to push the market forward. Since their focus is on web applications, having a cutting edge open source browser will only push the market forward. Even if their innovations are quickly adopted by other browsers, the final goal of improving consumer experiences was accomplished.

While there was an interesting point of contention between Firefox and Google now that they are competing on some level, I don't view them as direct competitors. Chrome will not gain large market share just as Gmail hasn't gained large market share. Its penetration will only be wide spread in geek circles if at all. However, Firefox has begun to cross over into mainstream and that battle was hard fought.

So, what is the point of Chrome? I don't think it is mean to compete with the browser market. That lofty goal is too low for Google. Honestly, I think Chrome is designed to go after the operating system market. While this may seem like a stretch, it bring Google's plan to its logical conclusion. A very fast web browser could function as the core component in a web based operating system. With the additional highly integrated support of Google Gears and the increasing number of Google web applications that support Gears, it becomes that Chrome isn't like other web browsers.

While Gears is available in other browsers, as it should be, it doesn't benefit from very tight integration. It is possible, that in the future that you could install web pages as applications that bridge the gap between being online and being offline.

The obvious flaw in my theory is that there is a huge jump between making a browser and making an operating system. However, looking at how Google constructed Chrome lends some hints. Chrome wasn't built from the ground up, it cherry picked code from other project and copied the best features from other browsers. There would be nothing preventing Google from shopping around various open source projects such as Linux finding the code that they need. At the same time, they could fill in the gaps with their own code.

While it is just a theory, I'd keep a close eye on the direction of Chrome to notice if it starts to become more robust. Chrome is already centered around multiple processes and has a built in process manager. Add a kernel, memory management, and a file system and your off an running.

Wednesday, September 10, 2008

Spore will be my downfall

I have so much work to do and Spore has been calling my name. Over the weekend I had a ton of time to play it and made it to the Space phase, but not very far into it.



I've been having fun playing but it ends up the Cassie has a little more time than me to play. However, she is just to the civilization phase.

You can check out my Spore Profile and my Spore Achievements if you are interested.

The game is awesome but I've been having some trouble with it crashing. Specifically, crashing when I save my game. Obviously this has made me fairly upset when I've lost a fair amount of progress. As a result I've been saving fairly often. I just wish the game had an auto save feature that could be enabled. I understand why it doesn't come with it turned on, but I would definitely enable that just so I wouldn't lose progress. I'd rather it keep progress that I didn't want than lose progress that I spent hours making. Just my thought.




My first main species is called Bar and is from the planet Foo. I wasn't that creative. I used buildings and vehicles from Sporepedia for the civilization phase. It was really nice to have a wide variety of choices that looked very nice for me to choose form.

The next thing I want to do is use some of the Sporecasts people have made to make my on themed plant. I'm also looking forward to becoming more powerful as a space faring species.

Powered By Blogger