07.31.07

New Laptop: Vista

Posted in SAnToS at 3:21 pm by Todd

On the new laptop that I just purchased, I had Microsoft Windows Vista Business installed. I had never seen it and have heard all the buzz and figured I should give it a try. My first impressions are not positive (well, at least they aren’t positive for Microsoft). I very much dislike Vista and don’t ever want to use it again. Here are some of my least favorite things:
  • Takes a long time to boot – specifically the time from off to login prompt (timed it at 6 minutes). Granted, the boot screen is the pretty blue Microsoft screen, but this is way too long for booting.
  • Takes a long time to login – specifically the time from pressing ctl-alt-del to prompting for my password (timed at 1 minute). This is actually much worse than the boot time because I simply cannot understand it. Why should it take this long?
  • There are no visual cues on the login screen. Specifically, when I press ctl-alt-del, there is no indication that anything is happening. Not a good design in my opinion, they should at least change the mouse animation to make it look like it received my command and is attempting to do something.
  • Too many options for shutdown. The first time I tried to shut down the notebook it actually took me a couple of minutes to figure it out.
  • The machine is very sluggish when I attempt to do anything. This is a brand-new notebook with 4G of RAM and a top-of-the-line processor (Intel Core 2 Duo 2.33Ghz) and it should scream doing every task.
  • Disk Defrag takes way too long. I ended up downloading a util from SysInternals (which is part of Microsoft now) that defrags much, much faster. Maybe the right hand should talk to the left hand and use the SysInternals defrag as the default instead of the current defrag. Or maybe not, speed is over-rated.
My favorite things are:
  • Searchable “Program Files” or “Start Menu”. Simply select the start menu and start typing and the menu is filtered. This will make keyboard enthusiasts (like me) pretty happy.
  • The ability to modify partitions in Windows using a nice GUI. Although I can’t say I have had any luck at all with this little feature.
  • The new UI look-n-feel is very nice … but I feel like I am trading a nice look for performance. Not something I choose very often (I prefer speed and functionality over looks for the most part).

So overall, I am very disappointed in Vista on my new laptop. So more than likely, I will continue to use GNU/Linux (some distribution like Gentoo or Ubuntu is the likely candidate) and only boot into Vista when necessary (testing, creating M$ Office documents, etc.). And I might even try using VMWare again so I won’t have to reboot. I will update when I decide what I will do (both in terms of Linux install and Windows solution).

07.13.07

Update on the Clinical Trial

Posted in Family, KSU at 8:38 pm by Todd

I blogged earlier about a clinical Trial that Kari is starting and wanted to provide a quick set of updates.
  1. She is getting a really good response from all the posters she put up and the ads that she put into the Manhattan Mercury.
  2. Dr. Carder, of Stone House Animal Hospital, has been a great guy and very helpful in getting this trial started (I will probably provide more details about his generosity later).
  3. She currently has two dozen dogs started and is in contact with a couple of dozen that are in the process of qualification for the study.
  4. K-State recently posted a news release about thunderstorm phobia and mentions the clinical trial.
  5. The Topeka Capital Journal published an article based upon the information in the news release.
  6. 49ABC News in Topeka, KMAN radio in Manhattan, and the K-State Collegian have seen the news release and contacted her about getting more information.

With all that good news it looks like the clinical trial is starting off really well. But she is still looking for more people to participate. So if you, or anyone you know, has a dog that might be afraid of thunderstorms please call her at 532-1089 or email her.

thunderstormPhobiaClinicalTrialPoster

07.11.07

Building a Parser for nesC in Cadena

Posted in Programming, SAnToS at 6:56 pm by Todd

While working on Cadena I came across a project that required the parsing of source files and transforming them into Cadena models. Specifically, parsing nesC source files and turning the information into Cadena models. After getting the assignment of this feature (assigned by myself), I decided to do some research into what types of tools I could use to accomplish this task. The first option would be to find an existing parser that we could use (was built in such a way that the API would work with our code as well as have a compatible/acceptable license). The second option would be to build the parser from scratch. The third option would be to use one of many available parser generators to build our own parser. The fourth option would be to not parse the files and just generate random information instead (ok, this isn’t really an option that my boss or our users would accept).

The first option was to find an existing parser that we could use. This was complicated by two factors. First, it had to have a license that is compatible with our project. Some examples that would have worked include BSD, MIT, EPL, and CPL. I, and the undergraduate students that worked for me, looked at several options including the TinyOS Eclipse Plugin, the TinyOS Plugin for Eclipse, and TinyDT. After looking at them all, we decided that none of them would work for our purposes.

Since we couldn’t leverage other people’s work, the second option was build a simple parser from scratch. I only gave this idea about an hour to work through my thick skull before I gave up on it. It seemed like this would be a good short-term solution if we only wanted to prototype with nesC and TinyOS. But if we wanted to support all of nesC and evolve as it changes, we would need a full-featured parser that could be maintained and extended in an orderly fashion.

With the first two options out of the way I decided to pursue the third option, building a parser using a parser generator was the path to follow. It turns out there are many of these so my first task was making a list of those that I wanted to evaluate. The first on the list was SableCC because I had experience with this (when I worked for Loudfire). The next on the list was ANTLR because Robby and Andrew King (two members of the SAnToS lab) had used it with Bogor (and for class). After that, I just started using Google to search for other options. I picked only those that had respectable websites and came up with the following options:

With that list in mind, I started reading about them, looking at other opinions on the net, and if I was still satisifed with it, I would download it and give it a quick test. I ended up testing ANTLR, SableCC, JavaCC, and Grammatica. In terms of ease-of-use, Grammatica was by far my favorite. It only took me about 10 minutes to have my first working grammar with it. And in about 1 hour I was able to handle some nesC files.

I ended up using ANTLR because 1) it well supported and widely used so others will be able to re-use my work and continue to maintain it when I leave the SAnToS Lab and 2) it worked well in defining the nesC grammar. But I wish I could have used Grammatica.

After completing the task of getting the parser working, I also setup some JUnit tests as well as wrapping the parser into an Eclipse plugin. I am hoping that I can release it under an open source license eventually so that others can pick it apart and tell me how bad the grammar and code are.

I am hoping to follow-up this post with more detail on Grammatica, SableCC, and ANTLR along with the final version of the grammar and how I wrapped it into an Eclipse plugin.

07.10.07

New Laptop: HP Compaq nc8430

Posted in SAnToS at 8:09 am by Todd

I just recieved my new laptop, an HP Compaq nc8430, and I am very, very happy about that. I am starting the process of getting switched over to it so it will probably take me 2-3 weeks to actually start using it fully (at which time I will retire my current laptop, the trusty Dell Inspiron 8600).

Dell Inspiron 8600

My first impressions are that the nc8430 is a sturdy, well-built laptop but I can’t say that I like Microsoft Vista which came installed. Not only is it different than my normal working environment, Gentoo Linux and GNOME, but it seems very sluggish. I am also having a hard-time getting it partitioned so that I can install Linux. HP seems to partition the drive in this way:
1) Vista partition (C:) takes up the first part of the drive (103G partition with 66G free)
2) OS_Tools partition (E:) takes up 1.5G of the drive (with about 256M free)
3) Recovery partition (F:) takes up 6G of the drive (with 768M free)
The trouble with this is that the linux partition will now be sandwiched by NTFS partitions. This just feels like trouble.

HP Compaq nc8430

Even more, the installation of Vista and Office takes up more than 37G of space. This is annoying (put mildly, I was to the point of almost cursing when I found this) and troubling. This would leave me little more than 40G for Linux. And while this is plenty for a vanilla install of Linux, it is definitely not enough for my normal work space that includes music, downloads, source code for many, many projects, and other odds-n-ends.

So, my first task with Vista is finding a way to trim it down. More to come!

07.05.07

New Mouse: Logitech MX610

Posted in About Me, Programming at 9:27 am by Todd

For the last couple of years I have been using a decent mouse but have always kind of despised it. It is a Microsoft InteliMouse Explorer 3.0 that was purchased from Dell when I got my first laptop from the SAnToS Lab. Since then, I have kept the same mouse but upgraded my laptop.

Microsoft Intellimouse Explorer

I recently decided it was about time to upgrade my laptop and I am going to try out an HP Compaq laptop. When I ordered it, I also purchased a new mouse — the Logitech MX610.

Logitech MX610

To get it working in Linux (I am currently using Gentoo) I used these resources. This got me to the point of a working mouse that made the left and right buttons work properly, the volume + and – and mute work properly, and the scroll wheel work properly. This is great, but I really would like to get the other buttons working (the email and im buttons as well as the forward and back buttons). This will be my first great adventure when the new laptop gets in. Until then, I doubt I will take the time to tackle this task.

So yeah for me, I got a new mouse. But too bad all the features don’t work just yet. But someday, I will find a way.

07.03.07

Congrats to Dr. Dwyer, KSU, and UNL

Posted in KSU, SAnToS at 10:24 am by Todd

I recently read an article in Communications of the ACM titled “Automatic and versatile publications ranking for research institutions and scholars” by Jie Ren and Richard N. Taylor and was pleasantly surprised by their results. In case you don’t have access to the article, the authors created a way to evaluate research institutions based upon data instead of on perception (e.g., US News and World Reports rankings). And it turns out that the Computing and Information Sciences department at K-State is one of the best Software Engineering programs in the country (#19). What’s more, Dr. Dwyer ranks #29 amoung faculty. And if they use the same method of collection in the future, the Computer Science and Engineering department at UNL will soon be tops in Software Engineering since they have 3 faculty in the top 50 (#2 Gregg Rothermel, #29 Matt Dwyer, and #50 Sebastian Elbaum). I guess that is what happens when you “steal” (or lure) the faculty from other institutions (Dr. Dwyer was at K-State and Dr. Rothermel was at Oregon State).

This makes be blush a little to think that Dr. Dwyer was my major professor. Makes me wonder what he saw in me to take the time and effort to mentor me through my Master of Science in Computer Science degree. What’s more, why he would hire me as a full-time Research Assosciate once I graduated. I can only think of two options: 1) he felt sorry for me and 2) I fooled him into thinking that I could do good work.

Anyway, a huge congrats to KSU, UNL, and especially Dr. Dwyer. Definitely recognition well deserved.

07.02.07

Fun with the GIMP

Posted in Programming at 2:35 pm by Todd

A few weeks ago I spent some time doing some web development for my wife. While doing so I got tired of manually resizing images and tried to find a way to automate it. What I found was amazing, entertaining, and enlightening.

To start off with I will remind my readers that I use Linux so using Adobe’s products is a no-go. So I have been using the GIMP for several years to do simple things but never really got to know it. It turns out that it is quite an amazing piece of software that was designed to be pluggable, scriptable, and highly automatable.

So my task was turning pictures into a photo gallery that can be displayed on the web using a flash-based application. What I needed to do was resize the images into 4 different sizes: 1) thumbnail – 64×48, 2) small – 160×120, 3) normal – 533×400, 4) large – 1024×768. While doing so, I also wanted to keep a consistent naming scheme so that the file would start with a prefix that matched the type of image it was. For example, the thumbnails would have a prefix thumb, the large images would have a prefix of large, and so on.

I did a little reading and a little google-searching and found this page. It is basically a shell-script and GIMP script-fu that creates thumbnails for images. Thanks Mark Willson for writing and posting this. But it isn’t exactly what I needed so I started to modify it. First, I changed the naming scheme for the resulting re-sized images. This required a change to the shell-script (done this before) and a change to the script-fu. Next, I wanted to do more than 2 different sizes so I added some parameters to the script and the script-fu. Last, I wanted to make sure they are top-quality images so I tweaked the settings a little bit in hopes of making them higher-quality. What I ended up with is below.

I also had to spend some time figuring out how to “install” the script-fu. Turns out that you simply need to create the file (I named it with a .scm postfix to match the others, not sure if this is necessary) and place it into the correct location (in Gentoo it appears to be /usr/share/gimp/2.0/scripts). No need to run an install script, run a make file, modify source, or make changes to the registry. Just drop the file into the correct location and go.

Once I completed my fun task I got to use the script and re-size many, many images. Without this, it would have taken me several weekends of work to get to where I was at after 4 hours of hacking at it. So that was my fun with the GIMP.

So here is the shell script that I used:
#!/bin/bash # SYNOPSIS # thumbs.sh [prefix] # # DESCRIPTION # Script to produce 'thumbnails' and images for use with expose # # _thumb_<prefix>.jpg = thumbnail (currently set to 64x48) # _small_<prefix>.jpg = small image (currently set to 160x120) # _norm_<prefix>.jpg = normal image (currently set to 533x400) # _large_<prefix>.jpg = large image (currently set to 1024x768) # _orig_<prefix>.jpg = original sized image - just moved to the new name # # If prefix is specified, only jpeg files with that prefix will be # processed. # # MODIFICATION HISTORY # Mnemonic Rel Date Who # PRJPG 1.0 01Feb04 mpw # thumbs 1.1 18Jun07 tcw # Written. # if [ "$1" = "" ]; then prefix="" else prefix=$1 fi # Remove any existing processed jpgs rm -f _{thumb,small,large,norm,orig}_${prefix}*.jpg # Process files via the Gimp for x in ${prefix}*.jpg do echo "..processing $x" nice -n 19 gimp --batch-interpreter plug_in_script_fu_eval -c -d -i -b\ "(script-fu-image-process \"$x\" 64 48 160 120 533 400 1024 768)"\ "(gimp-quit 0)" cp $x _orig_$x done

And here is the GIMP script-fu that I used.
;;;; Image Process Gimp script ;;;; ;;;; To run this from the command prompt: ;;;; gimp -c -d -i -b '(script-fu-image-process "file.jpg" tw th sw sh nw nh lw lh)' \ ;;;; '(gimp-quit 0)' ;; (define (script-fu-image-process filename t-width t-height s-width s-height n-width n-height l-width l-height) (let* ((img 0) (drw 0) (fileparts (strbreakup filename "."))) ;; car needed here because gimp functions return values as lists (set! img (car (file-jpeg-load 1 filename filename))) ;; set image resolution to 72dpi (gimp-image-set-resolution img 72 72) ;; create large image (gimp-image-scale img l-width l-height) ;; also flatten image to reduce byte storage even further (set! drw (car (gimp-image-flatten img))) ;; create large image (file-jpeg-save 1 img drw (string-append "_large_" (car fileparts) ".jpg") (string-append "_large_" (car fileparts) ".jpg") 1 0 0 0 "Copyright Todd and Kari Wallentine, 2007" 0 1 0 1) ;; create normal image (gimp-image-scale img n-width n-height) (file-jpeg-save 1 img drw (string-append "_norm_" (car fileparts) ".jpg") (string-append "_norm_" (car fileparts) ".jpg") 1 0 0 0 "Copyright Todd and Kari Wallentine, 2007" 0 1 0 1) ;; create the small image (gimp-image-scale img s-width s-height) (file-jpeg-save 1 img drw (string-append "_small_" (car fileparts) ".jpg") (string-append "_small_" (car fileparts) ".jpg") 1 0 0 0 "Copyright Todd and Kari Wallentine, 2007" 0 1 0 1) ;; create thumbnail image (gimp-image-scale img t-width t-height) (file-jpeg-save 1 img drw (string-append "_thumb_" (car fileparts) ".jpg") (string-append "_thumb_" (car fileparts) ".jpg") 1 0 0 0 "Copyright Todd and Kari Wallentine, 2007" 0 1 0 1))) (script-fu-register "script-fu-image-process" "<Toolbox>/Xtns/Script-Fu/Utils/Image Process..." "Process Image" "Mark Willson, Todd Wallentine" "Mark Willson, Todd Wallentine" "Dec 2003, Jun 2007" "" SF-VALUE "Image Name" " " SF-VALUE "Thumbnail Width" "64" SF-VALUE "Thumbnail Height" "48" SF-VALUE "Small Width" "160" SF-VALUE "Small Height" "120" SF-VALUE "Normal Width" "533" SF-VALUE "Normal Height" "400" SF-VALUE "Large Width" "1024" SF-VALUE "Large Height" "768")

I hope others can benefit from this.