Author Archives: ColinM

It's alive…

I’m so thrilled that my computer finally works again (after 36+ hours) that I decided to stay up an extra couple minutes to write about it. After all the hassle described in my last post, plus at least 2 hrs of figuring out why more packages wouldn’t update today, as of 1:30 am everything was finally done! My computer is back online and running (so far) happily.

In other news:
I’m working on a code module for the Fountain to enable it to send email messages. That should be pretty useful, once done, for getting status information like “sidewalk water overflowed, come fix it,” or “the mister DID work last night, go check it out,” or “pump 2’s vacuum sensor says there’s a problem. get ahold of tim, stat.” etc. without having to physically be at the engineering campus or in the tunnel. Plus, in working on this I am gaining a much better understanding of how PiCPro’s networking code is supposed to be put together, and why our previous code worked so precariously. Hopefully once this simpler module is complete, I can take a look at the whole server’s code and update that to work the way it’s supposed to.

Kernel/Gentoo blues

Long-winded, frustrated technical post alert. Sorry, but sometimes I need to rant about geek things. (At least this one’s not trite, ey Katie?)

I forgot just how much of a PITA it is to update my kernel. I run Gentoo linux on my desktop at the moment, and decided recently, on Jon’s urging, that it would probably be a good idea to get it back up to date. Sounded easy, especially when he suggested just nice’ing “emerge -u world” in the background, so I decided to start doing that this afternoon. Well, unfortunately there’s a bit more to it than that. Seeing as I have 342 packages to upgrade (all to be recompiled from source, since Gentoo is a source-based distro), I get interrupted about every 20 packages with some problem to sort out the portage can’t handle automatically. First it was mysql. Can’t autoupgrade from 4.0.24 to 4.1.14. So, following a handy wiki, I had to first upgrade to 4.0.25, then backup and delete all my settings, then remove 4.0.25 completely, then install 4.1.14, then replace all my settings. Took like 20 minutes of manual intervention. Not a huge deal. Rolling further along. This package wants me to delete some directory, so the thing dies, then that package has an illegal /usr dynamic library link (???), so unmerge it manually, then I get to hal (Hardware Abstraction Layer). Turns out hal needs a kernel upgrade. Shit.

So I emerge gentoo-sources to get 2.6.14. No big deal. Copy over my old .config, update the new settings as needed, give it a quick once-over to make sure everything is still ok. Looks good. Compile that, mount my suse boot partition (since that’s where my bootloader actually is), copy the System.map and vmlinuz files over there, update grub/menu.lst, then reboot. Big mistake. I forgot in the heat of the moment that my motherboard has a network chip that’s not supported by the standard kernel sources. (There’s a driver in development at version 0.9, but the author says it’s still buggy…) Plus, NVIDIA’s custom kernel module dies every time you recompile, so I get uncermoniously dumped at a console full of module loading errors. Great. Cue 45 minutes of rebooting into SuSE, downloading the updated, nasty kernel module from SysKonnect, rebooting into the console of errors, patching my kernel tree, make modules && make modules_install, modprobe sk98lin, oops that didn’t work because the retarded non-functional default sk98lin tried to load already and died… reboot, readd /etc/init.d/net.eth0 to my startup scripts, reboot, finally on the net, now download & install updated nvidia drivers, reboot.

X finally comes up and lo-and-behold my entire GUI environment is dead. Seems portage thought it’d be a great idea to emerge parts of gnome 2.12 before hal (the package that caused this whole mess), so now I can’t reload gnome until everything is done updating. At the current moment, it’s compiling #6 of 243 remaining packages. Splendid.

If you actually read that this far, I hope you’re sleeping happier than I, and less fitfully than my poor computer.

World FInals

Well, as of yesterday it’s official: Amphisbaena, the ACM International Collegiate Programming Contest team that I am a part of, will be representing UW-Madison at the 2006 ACM-ICPC World Finals! (See proof of our accepted status) That means a trip to San Antonio, TX, as well as some rather intense study of algorithms & programming strategy coming up next semester. The contest will be April 9-13 at the Hilton Palacio del Rio, and is sponsored by IBM and hosted by Baylor University. I expect the contest will be extremely tough, but on the upshot, it gives us a second chance to beat South Dakota School of Mines & Technology, which, if you recall from my earlier post, is my dad’s alma mater, and furthermore beat us at the regional competition.

Awesome!

Cool stuff: Prince Rupert's Drops

Prince Rupert’s Drops

Just saw these on hackaday.com. Very cool little things. You can read up on Prince Rupert’s Drops at Wikipedia, but the basic idea is this: Drop molten glass into a cold bucket of water. A tadpole-shaped piece of glass is formed in a way that produces a huge amount of tension within the glass. On the big tadpole end, you can hit it with a hammer, and unlike ordinary glass it won’t break. (Due to the high tension and the egg-like shape distributing the force.) However, if you even scratch the tiny tadpole tail, the entire thing explodes into tiny little shards, almost instantly. (The exploding front propagates down the tail toward the head at ~4200 mph = Mach 5.5)

Even if you didn’t read the above paragraph and/or didn’t care, check out this video of Prince Rupert’s Drops exploding from museumofglass.org. It’s awesome.

Ohhh…..

It’s not every day I screw up as badly as I did last night. That problem I was working on? Definitely didn’t read the statement closely enough. My 10 equations would have been great, except that at least 3 were based on a component of the circuit that I was supposed to remove, per the problem. That kind of thing makes me feel really stupid, especially given how much sleep I lost over it…

On a better note, here’s a humorous quote from my ECE 230 prof. just now, as he introduced reactive power (aka imaginary power):
“With all the government regulation of power recently, more and more economists are getting involved in power systems. The problem is, economists don’t understand why they should have to pay for “imaginary” power. If we call it reactive power, they don’t know what it is, so they’re willing to pay something for it. Economists aren’t real good with complex numbers…”

P.S. This is the 4th time I’ve edited this message to try to get it formatted decently. Lessons learned:

  • Blogger.com sucks at HTML. Use real tags, less <span>ing just to make things bold.
  • Don’t use mail2web.com to send a post to Blogger via email. It adds advertising.
  • Don’t try to do anything on a PocketPC. Are you listening Microsoft? Internet Explorer 4.01 should have died years ago. It should not ship with Windows Mobile 2003 Second Edition.

That’s all.

It's 3 AM and I must be lonely…or frustrated

Sometimes engineering is very frustrating. Like when it’s 3 AM, and you’ve been working on trying to solve a set of 10 equations with 10 unknowns for the past 3 hours without making anything more productive than a lot of kindling. Problem is, I’m not even sure if the 10 equations are right and noncolinear (or whatever the word is for equations that will actually help)… they’re just the only ones I’ve been able to generate.

Must. Sleep. Now….

Thanksgiving Break

I’ve survived my internet-less Thanksgiving break! (With a brief interruption when I found an unsecured wifi network at a restaraunt in Yankton, SD)

The break was nice; I did very little that was productive, but got to spend some time with my Grandma (see pic below) and my dad’s sister & her husband. Though we forgot to hang up Grandma’s 40-years-of-service clock from Avon, we did get her a Christmas present of a new computer.


[Grandma Betty and Colin, Austin-Straubel Airport, Summer ’05]

That story is worth a brief diversion. We went to the Best Buy in Sioux City, IA, where my dad and I picked out a desktop (Compaq Presario SR1610NX [hopefully the link works… bestbuy.com is ugly…]) and a monitor (MAG LT716s), both of which had some Black Friday sales or rebates or some such. Got a pretty good price on it; I want to say the whole system came to like $500 including 17″ LCD. Way more computer than my Grandma will need, seeing as she just wanted it to play solitaire, freecell, etc. (Your standard Windows freebies). The amazing part of this, though, was not the price (which we probably could have gotten lower had we shopped around a bit, but Dad wanted the BestBuy Reward Zone points), but rather the customer service we got at Best Buy. I was, in a word, shocked. We shopped a bit on our own to pick the items we wanted out, but when we grabbed a sales guy, he grabbed the requested items down from the storage for us, loaded them on a cart, asked if we needed anything else and then wished us a nice day. That was it. He didn’t push a single accessory, performance service plan, GeekSquad installation, not even antivirus software. It was insane. If you’ve ever stepped foot in a Best Buy, you’ll understand why I was so amazed. I’ve got $20 that says that guy gets fired.

Anyway, continuing with the weekend, we viewed a fair number of films since my mother had some foot surgery and wasn’t up to walking about yet. I did marginal amounts of homework, but generally just lazed about, ate food, slept, etc. It was a good time. Car trip was a bit lengthy (9+ hours each way for me, even more for the rest of the family to get back to Green Bay), but I got plenty of sleep in.

Outcomes of the weekend:

  1. I have actually been awake in nearly all of my classes so far this week. I don’t think I’ve gotten 10 minutes of sleep total yet in class, which has to be a record for the year.
  2. I hurt. Don’t take a week off of lifting without good reason.
  3. I have a Christmas list prepared, so for everyone who would like to buy me things, just ask! Some highlights are an upgraded laptop (see previous post), some flamenco and celtic CDs, and America: The Calendar.

A final thought:

People need to learn how to drive. I’ll save all of my frustrations for a future post, but let me just summarize one major pet-peeve. What you may call “on ramps” to the highway are also known as “acceleration lanes.” In these lanes, you should accelerate. It is dangerous and stupid to try merging into 80 mph traffic at 55 mph, even in South Dakota. Period. End of discussion. Oh, and for God’s sake look behind you while you’re backing up, especially in parking lots. Don’t ever get close to running over my mother on crutches again. Ever.

New Laptop

I got a new laptop today, courtesy of Lauren and Jeni, so that I can fit in with everybody else at the Enlight meetings! I may be considering an upgrade around Christmas time, but meanwhile, I am no longer the only geek without wifi.

Photos!
Closed Powerbook
My new Powerbook, secured to my desk

Open Powerbook
Running IM and Firefox.
[Click to enlarge]


Colin hard at work composing this blog entry. [Click to enlarge]

Lesson of the day
Möbius Strips.

Think of a band of paper wrapped in a circle. But if you run your finger along one edge, it will go around twice, once on each “side” before coming back to the place you started from. It’s a 3-dimensional shape with only one side, and only one edge. Check out MathWorld’s 3d Möbius strip, or look at this graphic I ripped off from MathWorld:

If you carefully follow the path of the gears around the circle, you’ll see that all the gears, despite appearing to be in two interlocked circles, are actually connected together in a single line.

Make your own Möbius Strip! Take a strip of paper. (Like cut a half inch off the side of a piece of looseleaf.) Hold the ends close together as if you were going to make a bracelet. Now, before connecting them, twist one end 180 degrees. Now tape the two pieces together. Voila! Möbius strip! For something really amazing, take a scissors. Cut down the middle of the paper (don’t cut the ring open, that’s bad, just cut down the middle), all the way around the circle. See what happens when you’re done. Bet you didn’t see that coming!

Side note: anyone who has read The Wheel of Time by Robert Jordan (an excellent book series, might I interject) may be familiar with this shape as the shape of Egwene’s ter’angreal for entering Tel’aran’rhiod.

Sendoff
Well, another week has gone by, and now I am two weekends worth of blogging behind. Alas. I promise I will catch up. In a rapid recap: Two weekends ago I spent 4 hours in the fountain with Tim mapping out all the electrical systems of the north end (pictures to come… really.). Then Saturday was the Lauren and Jeni (though she denies any part in it) -sponsored secret contest among Enlight (is among the right word? I doubt it…). I tied for second place, netting me a prize which I thoroughly enjoyed for the lone day it survived on my desk. (Thanks!) Following said contest (pictures possibly to follow, if I ever get around to asking for them) I suffered through a wet, rainy loss to Iowa at Barry Alvarez’s last home football game. Sorry it couldn’t have turned out better Barry, but thanks for everything else! My Camp Randall record while in attendance is about 1-15 (definitely only 1 loss, approx 15 wins). Sunday = homework. Then this past weekend involved more time at the fountain vacuuming leaves and fiddling with lighting relays (which are working now, check out our newly-brightened fountain on the FountainCam!), some racquetball against Jared, and then a viewing of Harry Potter and the Goblet of Fire with Enlight (and somebody please remind me that I still owe Jeni money). Saturday I slept in and took some much-needed time off of all things academic, and then Sunday I wrote a 7-page essay for American Indian Studies 172 (which class you should not enroll in).

I think that’s about all I’ve got… I would give you a more detailed account of the past couple weekends, but unfortunately I still need to do an ECE 230 assignment tonight, and I’m leaving tomorrow for about 5 days in South Dakota with no internet access (::screams of terror::).

Happy Thanksgiving everyone!

-ccMcc

The Unmaintainable Code Bible

Huge thanks to Lee Vandenbusch for pointing out this website to me. For your coding pleasure, How to Write Unmaintainable Code.

Some pertinent snippets:

Look Busy
use define statements to make made up functions that simply comment out their arguments, e.g.:

#define fastcopy(x,y,z) /*xyz*/
...
fastcopy(array1, array2, size); /* does nothing */

Use Static Arrays
If a module in a library needs an array to hold an image, just define a static array. Nobody will ever have an image bigger than 512 x 512, so a fixed-size array is OK. For best precision, make it an array of doubles. Bonus effect for hiding a 2 Meg static array which causes the program to exceed the memory of the client’s machine and thrash like crazy even if they never use your routine.

Foolish Consistency Is the Hobgoblin of Little Minds
When you need a character constant, use many different formats ' ', 32, 0x20, 040. Make liberal use of the fact that 10 and 010 are not the same number in C or Java.

C’s Eccentric View Of Arrays
C compilers transform myArray[i] into *(myArray + i), which is equivalent to *(i + myArray) which is equivalent to i[myArray]. Experts know to put this to good use. To really disguise things, generate the index with a function:

int myfunc(int q, int p) { return p%q; }
...
myfunc(6291, 8)[Array];

Unfortunately, these techniques can only be used in native C classes, not Java.

The whole (very lengthy) website is full of similar such advice. Perhaps your views may differ, especially depending on whether you’re a programmer or not, but I found the page hilarious.

Reunion

It’s been a long time since AOL and I had have had any dealings together. Those were the days… AOL was so much cooler in 7th grade on my 33.6k modem.

AOL decided to drop in for a visit today:

I took the opportunity at this little reunion to renew our relationship:

The 7 to 8 page paper I have yet to write today seems a bit less annoying now.

P.S. I promise I’ll get around to blogging about what happened last weekend, I hear at least one of you is dying of suspense… I’ll have to give up on my multimedia-rich idea, I never got around to even asking for the pictures I was thinking of.