Wednesday, December 26, 2007

X61s laptop power 2

After uninstalling all the 'crap' that comes installed with this laptop, I noticed that the power used by this laptop would go up. I was regularly drawing 12-13 watts. So I used the recovery partition to get the laptop back where it was at.

5+ hours later, the laptop was again drawing 8.7 watts if it was idle. Now I'm slowly seeing what I can uninstall and still keep a low power draw.

Sorry to my friends at Symantec, but your products are always the first to go. Norton starts many different programs, and slows system startup to a crawl. The cure is almost worse than the disease.

As for Linux, the 2.6.24 kernel is a lot better than the 2.6.22 kernel. But my custom kernel doesn't have all the features that the default Ubuntu kernel does. I'll need to try an 8.04 alpha 2 install and see if that helps the power usage. I'd really like to see Linux power usage to be at least comparable to Windows.

Saturday, December 15, 2007

X61s laptop power

I've had to run Vista on my laptop while working with Codewarrior to do embedded systems work. Unfortunately, I've found my experience seems to match this post. Linux uses way more power than Windows on this laptop.

Thursday, December 13, 2007

Testing out the sensors

Last night I dropped by my friends and www.chembal.com. We managed to do the following:
  • Program the Freescale development board (started with a blinking LED)
  • Created a program to adjust a lightbar based on the amount of light hitting the board.
  • Adjusted the board to the program work with a gyro. So as you rotate the gyro, it can tell how fast you are doing it.
  • Adjusted the program to work with the inertia sensor. So as you change direction, the board can tell
  • Adjusted the program to work with a sonar, so it can measure distance.
I'm worried about how sensitive the gyro will be to a helicopter's vibrations. The sonar seems a bit flaky. Both will probably require some programming to dampen things out. The gyro might be able to be mounted with some shock absorbers.

Tuesday, December 11, 2007

Toys for Christmas

Oh, Santa has already been by my office. A fancy "soldering station", a power supply, gps on a chip, gyro on a chip, sonar, embedded systems development board, and other fun toys. Hopefully tomorrow I can begin to learn how to use them.

I also managed to get replacement parts for my Esky Lama V4. With new landing skids and an upgraded inner shaft for the rotors, it is flying much better now. I just need to wait for all the students to leave so I can fly it around the Carver atrium.

Wednesday, December 5, 2007

ACM Account Verification

As part of Simpson's search for a new computer science candidate, my job is to find possible candidates via the ACM's resume database. (ACM has apparently partnered with "Jobtarget" to do their job website.)

So before I can do search resume's, I need to verify my account:

From the Jobtarget website:



Validation is required to view the resumes on the site. This process takes only a few minutes: simply fax a copy of your business card, or company letterhead, or a business license, or a trade name certificate, or other documentation that verifies you represent an organization. Please send that fax to 860.447.4562. Include your name, phone number, and email in case we need to contact you.


What does this prove, exactly? Anyone could make up their own business card or letterhead. It would also be easy to forge a legitimate company's information.

It is bad enough that any company would consider this 'verification', but this is the ACM! They have published hundreds, if not thousands of papers on security. This is just sad, even if the website is developed through a partnership, and not by the ACM.

Tuesday, December 4, 2007

Creating a UAV

I've wanted to create a computer-controlled helicopter for about 25 years. Now, finally, is the time to start on the project. Embedded computers are cheap, rc helicopters are cheap. Plus, a lot of other people have been successful at creating UAVs for academics, hobby, or business.

I'm really enjoying my Esky Lama V4, and I think it will be a good platform to try this idea out.

So I went over to my friend who runs the chembal website, and he showed me what I needed to get started. Here's the list:

Development kit: ($85)
http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=DEMO9S08AW60E&tab=Buy_Parametric_Tab&nodeId=01624684491437&pspll=1&fromSearch=false

Logic analyzer: ($79)
http://www.parallax.com/Store/Accessories/Tools/tabid/162/CategoryID/37/List/0/Level/a/ProductID/47/Default.aspx?SortField=ProductName%2cProductName

Gyroscope: ($74)
http://www.robotshop.ca/home/products/robot-parts/sensors/rotation-sensors/sensors-gyroscopes/sfe-adxrs300-gyroscope.html

The next two are from the same vendor:
Ultrasonic distance sensor: ($25)
http://www.sparkfun.com/commerce/product_info.php?products_id=639

GPS: ($72)
http://www.sparkfun.com/commerce/product_info.php?products_id=575

Wires: ($17 & $12)
http://www.jameco.com/webapp/wcs/stores/servlet/ProductDisplay?langId=-1&storeId=10001&catalogId=10001&productId=19290
http://www.jameco.com/webapp/wcs/stores/servlet/ProductDisplay?langId=-1&storeId=10001&catalogId=10001&productId=20080

Breadboard ($32)
http://www.allelectronics.com/cgi-bin/item/PB-3260/105/BREADBOARD,_3260_CONTACT_.html

One of these soldering stations, but not both!
http://www.sparkfun.com/commerce/product_info.php?products_id=609
-or-
http://www.hmcelectronics.com/cgi-bin/scripts/product/1980-0436

Powersupply ($188)
http://circuitspecialists.com/prod.itml/icOid/3506

Some of the equipment is ordered. Since it comes from different vendors, the division chair got tired of registering and ordering from so many different sites. So the rest will be on its way later.

Simpson is a Hiring Computer Science Tenure Track Position

Simpson College is hiring a tenure-track faculty position in computer science. Go ahead and apply!

Monday, December 3, 2007

Simpson College Commercial

Simpson College now has their own commercial.

Taking the furminator too far

In an earlier post, I said how impressed I was with the Furminator. Well, I took it a bit too far. Now one of our cats has a bald patch!

I will use extreme caution the next time I pull out the Furminator.

Java Cheat Sheet

This is a Java Cheat Sheet I created for my students. The source for the sheet is available here as a LaTeX document. I created this by using a latex cheat sheet I found on the web as a template.

Saturday, November 17, 2007

Saturday, Nov 17

Today we went to Nymeyer's at Tanglewood to get my daughter some larger riding gloves. This was my first time at the store. The person working at the store asked where my daughter rode. When I said Greenwood Acres, he knew the name of the owner, and the type of gloves we needed. I was impressed. We got some really nice gloves.

Next we went by Petco to get a replacement aquarium light. I’m running a 48" florescent over my saltwater tank. The light is not made to go over the open water, and yesterday it quit working. I expected it would eventually. But what I didn’t expect was that the external ballast was burning hot and smelled bad. I have learned it isn’t safe to install aquarium lights incorrectly.

A replacement light was more than I expected at Petco, so if I figure I’ll try to upgrade to a nicer light by buying somewhere else. Right now I’m trying to get one off Ebay.

We also picked up a FURminator from Petco. The video at the store showed a ridiculous amount of hair being brushed off cats and dogs. I thought that had to be faked, there was no way a comb could be that effective. We got one anyway, and I tried it. Well, we DID get that much hair off. When the hair came off it was electro-statically charged, so it stuck to everything. The cat, me, chairs, walls, whatever. Perhaps a little water mist would help cut that down.

We got the Christmas lights up on the house, as the weather was really good today.

Monday I'm supposed to take delivery of a new Esky Lama V4 rc helicopter. This is my birthday present from my family. I had a hard time finding one. The cheapest stores are actually overseas, and it isn't easy to tell they are not in the U.S. until it comes time to get a shipping quote. The first U.S. place I tried was out of stock. I am trying a dealer on Ebay. According to the tracking code it arrived in Des Moines Friday, but won't get delivered until Monday.

Thursday, November 8, 2007

New gadgets

Today I upgraded my DirecTV receiver to an H20 model, along with a dish upgrade. This was supposed to give me 70+ HDTV channels, but I only had the ones I got with my old receiver. After a short time with customer service, I was up and running. Kudos to their customer service on this call.

I also ordered an RC helicopter from hobby-lobby. I got the following e-mail:

You have been sent 0 package(s) via the tracking number(s) is/are . If the number of packages is zero 0 then the item(s) is/are on back order and will be shipped when it is available.

"If the number is zero, it is on backorder?" Come on, can't you go through the effort of an 'if' statement and just tell me it is on back order? It is also rather confusing to read, "tracking number(s) is/are ." Ugh, must have been a very lazy programmer.

Friday, November 2, 2007

Building your own balloon

Because I had someone recently ask me about balloon building, I thought I'd point out the best place for discussion is the balloon-makers mailing list:
Balloon-makers@taleos.com
http://lists.taleos.com/cgi-bin/mailman/listinfo/balloon-makers
...now if I could just get my sewing maching working.

Wednesday, October 31, 2007

Eclipse and network drives

Ok, I've found that Eclipse works fine if the workspace files are stored locally. But if the workspace is on a network volume, I get long pauses where Eclipse freezes up while I type. This is frustrating to myself and the students.

A simple editor that didn't need the disk while you were typing would not have this issue. I wonder how BlueJ and NetBeans work with network volumes.

Monday, October 29, 2007

I'm not such an Eclipse fan anymore...

Eclipse is driving me nuts. I have yet to get a semester where I've been happy with Simpson's development setup in our lab:
  • Fall 2006 - The computers had very little memory, making development in Eclipse near-impossible.
  • Spring 2007 - An eclipse bug caused the compiler to default to 1.4 compatibility. This required every project using 1.5 functionality to need the default options changed. Not fun with a group of first-time programmers.
  • Fall 2007 - When Eclipse needs to do any kind of intelli-sense type of thing, I can get long pauses of up to 20 seconds. It really breaks the 'flow' of development. The machines have a couple gig of ram, I don't know what Eclipse thinks it needs to chew on for that long.
  • Spring 2008 - Maybe I should teach my class vi instead?

Thursday, October 18, 2007

Live from Moscow

Moscow, Idaho that is. I'm presenting some of my research at the University of Idaho. I love coming out here. Moscow has a very nice coffee shop called One World Cafe. I can work on my research presentation while listening to live music. In fact, most of the people in here right now are working on their laptops.



Fall in Idaho is very pretty. The rolling hills and rural nature of this area made the drive here a lot of fun.


Creating presentations with Beamer


This is my first presentation using “Beamer”. Beamer is a package available for LaTeX that makes nice PDF-based presentations. My graphs are in postscript format and they do not display well in PowerPoint at all. They look great in LaTeX, and of course the equations I have look really good.


Continuing this no-Microsoft run, my laptop is running Ubuntu 7.10 beta. So far it is working well. In fact, my desktop running Ubuntu 7.06 won't compile the presentation, so running beta actually allowed me to avoid a bug.

Don't pull that wireless card!


On another Idaho trip I gave a presentation where my Windows laptop slowed down so much that it took about 10 seconds to change slides. I had to hit the next button before I actually needed the slide changed. My problem was that I pulled the wireless card out before the presentation. I did this so my presentation would not be interrupted by network-based messages like “windows needs to be updated”. That backfired. Not properly dismounting the card caused the driver to chew up CPU time looking for the card.

PowerPoint makes you stupid.

A long time ago, a study was released that the press picked up with a catchy line that PowerPoint makes you stupid. I posted about that in my blog, and the blog was rated #1 in Google when people searched on that term. I never used to use PowerPoint in class, so it was fun to get a minor bit of fame that way.

Later, I was interviewing for my job at Simpson. We were expected to give a presentation as part of the interview. I presented my research using PowerPoint, even though I didn't use it for teaching classes. I learned the hard way that people think you are very strange if you present a research paper at a conference and don't use any slides.

So I'm just about to give my PowerPoint presentation, and I see one of the instructors on the hiring committee has a sign in his office that says “Thank you for not using PowerPoint”, and another with a red circle-cross over PowerPoint. Oh the irony.

Where did that blog go anyway?

That blog went away after a minor fiasco where someone at work discovered it. Blogs and corporations don't mix. The only thing I could safely blog about was hot air ballooning, and I didn't do enough of that to carry a blog.

The offending article that caused me to drop the blog was on the importance of being able to effectively communicate and influence people. I should have taken my own advice. I spent the next two years after that post leading a project that delivered 1.6 million lines of code which handled 2+ million page views per day. A wonderful and very successful experience.

Another person on my team did nothing but study Dale Carnegie for two years. I don't know what else he did during that time. When we applied for the same job, my list of successes couldn't match his ability to “win friends and influence people”. Specifically, the hiring manager. I hate to say it, but I have to respect that.

Thursday, September 13, 2007

Alerts vs. Time of Day

A long time ago I worked at a company called DTN. We had several systems that worked 24/7 processing news, weather, and market feeds. One of my early jobs was to create a system to alert us when something went wrong.

All our data-gathering systems could send text messages to a pager via an API I created. And the central paging system itself would poll data-gathering systems to confirm they were up. Anyone could write plug-in modules for the paging system and expand it. You could telnet into the paging system to administrate it. Today, people use programs like Nagios, but back then we didn't have all those cool open-source tools.

In the spirit of eating your own dog food, I first tried this paging system I created myself. Everytime something went wrong with the system, I got a text page on what the error was. Then I could log into the system and control the alerts. That system was cool.

Soon after, I got paged 100 times in just a few minutes. So the paging program got updated to have the additional ability to limit pages to 1 per 15 minutes. It was 'cool' again.

Later, the system woke me up multiple nights in a row for errors that were minor, and corrected themselves. After another round of development, the paging system learned that between 10 pm and 7 am, something had to be really, really, wrong before it would page.

(One day, all our data feeds stopped. It turns the satellite that they used failed. So did our pages go off? No. The satellite those data feeds used was also used by our paging system.)

This was an evolution in knowing how to send alerts 'smart' depending on type of alert, time of day, and quantity. I wish many other devices would go through it. My cell phone will beep merrily at 3 am letting me know it has a low battery. Come on, do you really think I care at that time of night? Worse yet is the smoke alarm that tells me it has a low battery in the middle of the night. Many of our smoke detectors require a ladder to access. Just what I want to be doing.

So the moral of the story: If you are working on a system that makes causes an audible alert to be made, allow for different 'priorites' to be made depending on the hour of the day. It will improve the quality of life of your customers.

Wednesday, September 12, 2007

Creating your own operating system

I located a good tutorial on creating your own operating system. I first tried it under Linux with no success. It does work under Windows with DJGPP.

Under Linux I'm having issues with compiling 32-bit under a 64-bit OS, and the symbols between C and assembly don't match up. I should be able have a C function called main and then call it with _main from assembly. But the extra underscore isn't getting added on.

I figure creating my own OS should be easier under Linux, not harder.

Saturday, August 11, 2007

New Sewing Machine

I built my last balloon nine years ago using a borrowed Adler sewing machine. I've wanted a sewing machine myself, but have found it difficult to find one on the used market at a decent price. I've seen a few on the coast, but they are hard to ship.

Today my search was over. I picked up a Singer 112W116. It is an industrial-grade sewing machine that can sew two rows of lock-stitch at the same time, 3,000 stitches per minute. I'm not sure how old the machine is, but I'd guess us is older than I am.


I need to see if I can get it to working soon. When I built the balloon I was pretty good at setting the timing on a sewing machine and having it run smooth. But I've forgotten those skills and will have to learn again.

Friday, August 3, 2007

A balloon skims the top of a pond:

A couple balloons near where I landed:
I'm on approach for landing. I just brushed the tops of the trees to help slow down:

Wednesday, July 25, 2007

Why programming is so darned useful

I've heard from many students that programming is too much work. No! Programming is for lazy people.

I'm teaching CIS 300 Project Management. I want to take the end of chapter questions from the class textbook and use them for on-line quizzes.

I use software called Moodle for managing the class. The user interface for entering quiz questions into Moodle was designed by trolls, making the tedious process of retyping the questions even more tedious.

I was happy to discover today that the whole book is available via PDF on the included CD. I converted the PDF to plain text. Then ran it through a Perl script to reformat it for Moodle. Then I uploaded the questions to Moodle.

In less time than it would take to enter the questions for one chapter, I had a program to do it automatically.

Tuesday, July 24, 2007

Aardvark Joel on Software Video

A while back I ordered a video called Aardvark'd. It was supposed to be better than The Apprentice, and actually show the management process. According to Joel, anyway. I thought this would be good to show during my project management or software development class.

When I first got the video, I got bored in the first 5 minutes, and thought I'd watch it later. Well, a couple years later, it is now later. It is still boring. And frustrating. I don't want a tour of the intern's appartment. I certainly don't want to spend so much time watching the kids try to figure if they could jump out the window of their building to a nearby building.

I'm a half hour into the film, and now they are trying to plan a party. They aren't social enough apparently. I haven't seen them do any work yet. I think my time might be better spent finding a different video, and give this up as a waste of money and time. Shame, most of Joel's stuff is really good.

Sunday, July 15, 2007

Harry Potter OOTP movie review

Having seen Harry Potter and the Order of the Phoenix twice now, here's a review:

Both my wife and I disliked the film on the first showing, and liked it the second time we saw it. The book was the same for me, I've enjoyed it more after I read it the first time.

OOTP is a movie that is less than the sum of its parts. So much is right with that movie, and it yet it still seems to fall flat.

Bad:

The score. The soundtrack was terrible. For a long movie, it should have helped drive it. Instead it was completely absent in slow parts. When there was music, it often had no discernible beat. There were some good parts, and I noticed my daughter pick up her attention when the music did. But when there was music it seemed to fly around aimlessly and did nothing for the tempo of the movie. Had there been good driving music (like Bear McCreary does for BSG), this would have been one of the best movies in my opinion. With no music, it reminds me of a terrible movie watched during weekday afternoon on TV when I was home sick. You were too bored to turn it off, yet it made you feel worse.

Camera angles with Dudley: I didn't like shooting straight on with Dudley and Harry. Looked awful.

Mrs Figg. Harry gets attacked by dementors, and Mrs Figg acts like a bag lady collecting cans. A complete lack of drama kills this part.

Luna's makeup at the end scene when she found her shoes. Rather than look like she was bruised, it looked like she had a couple holes in her head.

I missed the Quibbler storyline where Harry gets his version published.

The lighting was too dark and the colors too muted. The movie should have been figuratively dark, not literally dark.

The editing was choppy.

I disliked Hermione looking out the window at the lightning after Sirius's head was in the fireplace. That scene was lame. Dialog was ok, but not the setup.

The shelves with spheres were too high to be believable. It was too CGI for me.

Good:

The acting was great.

The special effects, particularly the end fight were also wonderful.

Snape was awesome. I particularly like that the occlumency lessons appeared to hard, and that several were required. Movie 3 in the series failed to show how difficult the Patronous charm was to produce, and this movie succeeded with occlumency.

Luna Lovegood was perfect. Brilliant casting with her.

Harry's relationship with Sirius was built well.

The scene of Voldemort possessing Harry was well done. It would have been so easy to screw that up.

Condensing an 800 page book into a 138 minute movie was well-done script-wise. Hard to see that on the first showing because so much was lost that I liked. But I think the story was done well.

Umbridge's office was perfect with the cats.

Friday, July 13, 2007

Best Practices

Cramblitt: What do you think about the reliance on best practices?

Lister: I get chills when I hear that phrase. From my point of view there are some pretty good practices, but no best practices because that implies generic software development.

...from an Interview with Tom Lister.

Monday, July 2, 2007

SOA - No silver bullet

Service Oriented Architecture is in! It's hip and cool! It's better than objected-oriented programming! Better than exclamation marks in blogs!

But if you use SOA, understand the pitfalls.

I learned parallel computing the "academic" way. We had a task to speed up. We created mathematical proofs. We ran experiments. We backed our theories with the results. Then the results were reviewed by professors and peers.

We knew that distributed computing was going to be the next big thing. And it was! But it was taught to the masses in magazines and internet articles. Developers got all the coolness of SOA without seeing the hard parts, or having to work through the theory.

So here is my list of three major things I’ve seen people get bitten by. I came up with this list during my last project. That project handled 2.5 million page views per day, many of which were processed by using SOA. One page required 43 service calls. SOA was our lifeblood and our curse.

Top Three SOA Pitfalls

Distributed Computing is Slower: Conventional wisdom claims the opposite, lots of computers processing instead of one. So while we know it can be faster, the question is why did our app get slower?

Let’s answer that question with another question: How long does it take to make a function call on your local computer? Don’t know? Then run a quick experiment and come back. I’ll wait.

Ok, you’re back. I got about 20 nanoseconds with Java. What did you get?

What about making a distributed call? To do that I have to:

  • Convert data to XML
  • Pipe it over the wire
  • Parse XML
  • Process
  • Convert response to XML
  • Pipe it pack over the wire
  • Parse XML into the data I want.


Just one network hop usually changes us from measuring time in nanoseconds to measuring time in milliseconds. Quick, go run your own experiment. (Making a network call localhost doesn’t count!)

I got 20 milliseconds. That makes a local call 1,000,000 times faster than a network call. What did you get? I’ll bet it was a lot slower than your local call!

But wait! That’s not slow enough for some people. What if we add another layer of middleware or a message queue? Heck, at my last job we added both. Architects love layers. The best architects are educated at Hogwarts. They draw diagrams and wave their hands at meetings. Then management gets a glazed look on their eyes and magically starts writing checks. Why didn’t I go to that school? (*)

Before SOA was big, I worked at a small company that built a user-customized portal called Agdayta. It showed futures quotes, news tickers, and other investment-type things. We pulled data using all sorts of services. By keeping in mind the expense of these calls, we managed to produce custom portal pages in less than 10 ms. Using Pentium II computers. And full session fail-over. Before any of this was built into Java.

Later I worked at a big company. We had 5 machine clusters, each machine with 8 processor cores. Even though we made less complicated pages, the pages took 50 times longer to render. Why? There were too many services and calls and leaky abstractions.

Distributed computing CAN be faster if the advantage of distribution makes up for the overhead. But you have to do the math and understand the theory.

Distributed computing is less reliable: Wait, isn’t it more reliable?

This is where some background in safety engineering can be good. I recommend learning to draw fault trees. Again, a skill often learned in graduate school. But you can pick it up in no time.

Distributed computing can increase reliability if you know how to assemble the systems correctly. Otherwise you end up with a system with lots of parts; any of them can bring the system down. If a system fails once per year, and you have two systems, expect a failure twice per year. Plus some extra down time for the equipment that hooks them together.

What about fail-over? One server goes down and the other picks up the slack? Great, unless the database dies. Or the service you are calling. Or the network line. Or you deploy the same bug to both servers. Common-mode faults can bring down your backup system just as easily as your primary. Draw your systems with fault-tree diagrams.

Versioning is hard: Often, quite the opposite is sold. For example, a selling point for SOA is that you can make an update in one place, and all systems calling that service will be updated. Perfectly logical.

But wait, you wouldn’t deploy that change to a production system without testing it, would you? So if you update a service, you have to test that update with each and every system that calls it. If a dozen programs use your service, you have to pay a dozen different teams to test your SOA update. And hope that none of them has more important things to do, forcing your update to get put on hold.

It gets worse! Applications using your service, are updating as well. So you can’t test their updated code with your updated code unless you deploy your code at the same time. You must ask them to go through a test with their current production code. This usually means putting their new code on hold.

At the large bank I last worked with, we have quarterly releases. This helped with issues on versioning between front-end applications and services because everyone released at once. There was a big disadvantage through. If an important service did not make a quarterly release date, no one made the quarterly release date. If a service was deployed and did not work, everyone rolled back (or you limped along with a broken system). And with small critical bugs, you still had to test against old code-bases.

Conclusion: I don't dislike SOA. In fact, I think it is a wonderful and critical tool in a developer's arsenal. But there is some kind of perverse thrill that developers get in making remote procedure calls. Some developers create remote calls without proving it will help improve speed and reliability. Some don't know how to prove it. Some go nuts and use it everywhere. And as for manageability, if anyone knows a solution, let me know.

(*) I liked our architects. They were smart. And if I was one, I would have loved making presentations with boxes and arrows.

Thursday, June 28, 2007

Ballooning

A little over a week ago I got my bi-ennial flight review in. We managed to land at the balloon field and also take the kids for tether rides. Throwing gloves from the balloon at people was a popular activity.

Soon after we went to Balloons in June. Unfortunately, it was weathered out and we didn't fly. But since there was a pool, my family was still happy.

Iowa Helicopter

This is a camera phone photo of one of Iowa Helicopter's Robinson R44's. The photo is somewhat ruined by the camera case blocking out the sides. I took a short ride during one of Iowa Helicopter's open houses. I used to know the one of the owners back in my storm chasing days. After I started on my Ph.D., I had to put that hobby on hold.

Sunday, June 10, 2007

Pinicon Park

This Sunday was spent with my family at Pinicon Ridge Park. My brother had his fire truck, which was well received by all the kids. Later the afternoon was finished up with paddle-boating.

Tuesday, June 5, 2007

First balloon flight of 2007


Balloon photo


I finally got the balloon up in the air today! Great flight. It was very slow and unpredictable with the high-pressure system overhead. Tomorrow winds could get to 40 mph.

I landed in a grass strip between the corn. The photo above is my crew moving me over to a front yard that was near.

Sunday, May 20, 2007

Havoc Helicopter

I've been having a lot of fun with the Air Hogs Havoc Helicopter lately. It is an IR remote controlled helicopter. I'm impressed with how well the IR works with it. The helicopter is relatively easy to control as well. You don't have to 'balance' it like a true helicopter. For less than $30 it is not a bad deal. It can be flown in a living room, and it truly fun in a larger enclosed space like a building atrium or gym.

Don't forget to add weight to the front to get it to fly forward rather than just hover.

Saturday, May 5, 2007

Rocket Engines

If I could pick another job I'd be interested in, it would be building rocket engines. This is a NASA release of a test-firing of a methane engine. The fire coming out of the engine makes a very nice pattern. The link to the video is worth watching.

Thursday, April 19, 2007

awk - The right tool for the right job

While doing some research, I recently needed to know how long it took for a simulated network packet to go from one spot to another. My data looked like this:

1.333103,down,140,3,140,2340025502,0,0,36,sent-9.2.11
1.333103,down,140,2,140,2340025502,0,0,36,ok
1.333103,down,140,1,140,2340025502,0,0,36,ok

I had to find the difference in time (first number) from when a packet was sent and subtract it from when it was received. I have to track this for each node address which is the long number in the data above. I could not mix it with any other node's data.

Thankfully there is "awk". With awk, I can solve this problem in two lines of code:

/9\.2\.11/ {s[$5]=$1;}
/received/ {print $1-s[$5]}
The first line of code matches any text line that has "9.2.11" in it, which is key that a packet has been transmitted. That code will store in an array the time the packet was sent.

The cool thing with awk is I don't have to declare my array, and my array parameters can be a string that has whatever I want in it. So I put in field five as the index, and assign that array location to the value in field one. (I know, technically that means it isn't an array, whatever.)

The second line matches any line with "received" in it and subtracts the sent time from the current time, printing the result.

This is so simple I can quickly create such an awk script for any ad-hoc reporting I need. In fact I can specify the entire program as a command-line parameter. This functionality would be painful to create in Java or C#.

If you are a programmer, you owe it to yourself to learn text processing tools like grep, sed, awk, and the F-22 of text processing, Perl. For ad-hoc work or even production work with text manipulation

...and yes, you can get these tools on Windows.