Showing posts with label geek. Show all posts
Showing posts with label geek. Show all posts

2008-04-11

One Billion

A few years ago Dave Brouse and I stumbled upon OneBillionMazes.com. It's a site that has, well, one billion mazes. I learned two things that day:
  1. That there is an absolutely foolproof way to navigate out of any maze. Apparently, Dave had learned it from Sean Connery.
  2. That I truly didn't grasp the magnitude of one billion.
I wrote the following as an exercise for Sherry's class. From what she tells me, most of the kids really enjoyed it.

Let's print all of the mazes found on onebillionmazes.com! Why not? It's only a billion.

Before you start printing, please compute the following:

A) How long will it take to print them?
B) How much money will I spend on paper?
C) How much money will I spend on ink?
D) How much would the paper weigh?
E) How much room (volume) will I need to store my printouts?

Here is the information you need to compute your answers:

Paper is purchased in packs of 500 sheets, called reams.
  • A ream of paper measures 8.5 x 11 inches and is 2 inches thick.
  • A ream of paper weighs 5lb (2.25kg).
  • A ream of paper costs $5.
  • An ink cartridge costs $50
  • The printer can print 10 pages per minute.
  • The ink cartridge in the printer can print 800 pages before it needs to be replaced.
  • Oh, and one more thing. Each maze requires two sheets of paper. One for the maze, and the other of the answer key.

A) 138,888 days, 21 hours, 20 minutes. If you started printing now, you wouldn't finish until the year 2388.

You will have dead for over 300 years.

B) $20,000,000.00 ($20 million)

C) $125,000,000.00 ($125 million)

D) 20,000,000lb (20 million pounds) which is 10,000 tons.

That is equivalent to 758 adult elephants, 5000 cars, or 22 Boeing 747 airplanes.

E) 18,036,265.4 cubic feet, which doesn't mean very much. So let's express it differently.

If the reams of paper were stacked vertically, the column would be 666,666.6 feet high, which is 126 miles. Earth's atmosphere is 29 miles high.

If you laid column paper on its side, it would reach from New York, NY to Ocean City, NJ.

If the reams of paper were stacked in a big cube, it would be 262 feet high, which is as tall as a 26 story building. If we filled every room of our house from floor to ceiling with reams of paper, we would need 600 more houses.

2008-02-20

Boomer Net

Our nation is bracing itself as the baby boomer generation dodders into retirement. Industry analysts have been calculating the stress this generation will inflict on our health care system and eventually our cemeteries. But I don't think we're considering the real problem. What about the stress on the interweb?



My mother recently sent an email to my son and me. I noticed that she had the wrong email address for my son.



















me:“Has Grammy ever sent you an email?”
son:“What? What do you mean?”
me:“I mean, since you've had your email address, has she ever sent you an email?”
son:“Dad, I've had my email address for 2 years. I emailed her as soon as I got it. So she could put it in her address book.”
me:“Right. And since that time, has she ever sent you an email?”
son:“Dad, that's crazy. Wait. Oh my god.”
me:“Say it...”
son:“You know, I've never gotten an email from her.”
me:“For 2 years.”
son:“Why?”
me:“She had the wrong email address in her address book.”
son:“2 years? Didn't she get a delivery error or something?”
me:“I'm sure she did.”
son:“But she never knew what it was or did anything about it?”
me:“Right.”
son:“WOW!”





Our boomers also suffer from hearing loss. Tragically, they're unable to hear phrases like:



"DO NOT SEND ME EMAIL FORWARDS AND OR JOKE EMAILS!"




Go ahead and try it. Scream it, if you like. They still won't hear (listen to) you.
Even worse, they won't ever understand simple email etiquette. For example, if you must forward an email to someone, please have the courtesy to trim the chaff, maybe even personalize the message. I had the pleasure of receiving this email from my father-in-law:

with a staggering amount of chaff.



How many terabytes of bandwidth is consumed by boomer email traffic alone? How much disk space is wasted on the same WMV file depicting a monkey falling off of a branch after smelling his own finger? I'm treated to this gem (and many others) about once a year.

2008-01-07

Password Madness

I'm usually OK dealing with stupid people. Laughing at their misfortune seems to help. But, I find it really annoying when they make my life difficult.



Like any self-respecting paranoid geek, I proudly employ secure passwords whenever possible. My passwords have:

  • 10 or more characters.

  • letters (uppercase and lowercase), numbers, AND "special" characters.

  • no words or personal information.


Oh, and I use different passwords for each of my accounts.


Recently, I tried to change my passwords for my bank, electric company, and prescription drug provider. They each had their own restrictions.






I like (a phrase, which here means, "I don't like") that they further define "special" characters. No '~', '@', '=', or ':'?


My prescription drug provider assumes their users know what "special" characters are. Oh, and they can't allow their clients to use those crazy spaces.







My electric company explicitly defines the allowable characters, but in my opinion, it is too restrictive.







They also have a nice undocumented restriction (yeah! my favorite). They don't allow passwords greater than 10 characters. They don't tell the user that until they try. I'm sure that doesn't annoy anyone.



As a software developer, I can't think of a reason to restrict a user's password. Maybe the developers were concerned about SQL Injection, which is noble, but why should the user suffer? Why restrict the password maximum length? Is disk space really that precious? Make the database column unrealistically large and forget about it.

Having to lump the developers at SourceForge.net into this short-bus-web-developer category really cuts deep. I feel like I've lost my geek innocence.







It's worse than the time I realized that Hackers wasn't a documentary.

2007-11-05

World Wide Asshole

Over a year ago I published an article about the sweet demise of my childhood bully. I know you probably think I'm sick in the head, and I am. But luckily, I have someone to blame.

Writing that article was a cathartic experience for me, and to this day, rereading it lifts my spirits.

I noticed that the visitor count on my blog was steadily rising. I thought this was kind of odd. Sites usually become more popular because they produce compelling content at regular and frequent intervals. Then I realized that the majority of my hits were coming from Google Image Search. People who searched for an image of an "asshole" were rewarded with David Fleming's high school yearbook photo. Awesome.

Warning: Unless you're a Goatse fan, you may want to edit your Google search preferences and the set SafeSearch Filtering to Moderate before you perform this search.


Over the past 6 months I've been watching Mr. Fleming's Google Asshole Index rise. When I first started checking (Yes, I was checking regularly. Shut up.), he appeared on about third page. I got more and more excited whenever his Asshole Index afforded him a higher result position. It was kind of like watching the ball drop on New Year's Eve, or refreshing the Olsen Twins legal age countdown page.





When he finally broke into the top ten, I just couldn't contain myself. I had to let someone know. It feels good knowing that people all over the world associate "asshole" with "David Fleming".

2007-10-21

I Heart Amazon

I hate Walmart; not because I'm against a free market economy, but because I despise being in that store. So, since I can't bring myself to buy items at inflated grocery store prices, I'm forced to patronize Walmart about once a month.

Amazon to the rescue!

I've started using Amazon's Subscribe & Save. It's a grocery store with a limited selection. Their shelves are stocked with nonperishable bulk items at cheap1 prices and the shipping is free. This isn't anything to get excited about.

The "Subscribe" part is what I'm excited about. There are some things I can never seem to remember to buy. When I notice that I'm getting low on razors, I'm never in situation where I can write it down. So when I decided to buy a 12 pack of razors from Amazon, I had to specify a "Delivery Schedule". I'm thinkin' I'll need another 12 pack in 3 months. We'll see. If I've miscalculated the delivery schedule, I can change it later. Also, if I'm running low, I can tell Amazon to send the next shipment right away. Or, if I'm overstocked, I can tell them to skip the next shipment.

Subscribe & Save helps me cut down on mind numbing minutiae of everyday life.

me (head):"Do I have to stop by Walmart on the way home from work today? No I don't!"



1Always calculate the unit price, not all items are great buys.

2007-06-10

Digital Video Sucks Ass

An open letter to the digital video/codec industry:
Dear Assclowns:
May you all burn in eternal hellfire.

Sincerely,

JC Mann

I borrowed a digital video camera so that I could record my son's talent show act. It was a cheap, $100, no-name device, but it was better than nothing at all. I recorded the act without any problems. I brought the camera home and plugged it into my computer using the "specially designed" USB cable (Yes, you special-cable-connector-designin'-assclowns are next).

I opened the .mov file to view my masterpiece. QuickTime started playing the video immediately...sans video. While I listened to the audio, QuickTime presented me with a window containing a completely white canvas. Thanks QT. Good work. Onto other players. MPlayer? Same thing. I tried VLC, and it worked...but not without spewing tons of warning messages about the codec! Grinning like an idiot, I watched my son's act in all its splendor, rendered in grainy low-resolution video accompanied by tinny mono audio. What an age we live in.



It's hard to imagine what goes on at these big technology companies that produce our wonderful consumer electronics.

tech-lead:“OK people, how are we gonna store the video for our new camcorder? We need ideas.”
new guy:“We could use MPEG. It's used in tons of places: DVDs, HD transmission, HD-DVDs, and Blue Ray. It's kind of become the de facto standard, so the chip sets for encoding and decoding have become a commodity.”
 
awkward glances
 
tech-lead:“OK, we need ideas people.”
engineer 1:“I've just finished developing my own codec.”
tech-lead:“Fantastic. License?”
engineer 1:“Oh, it's all our intellectual property.”
engineer 2:“How well does it compress?”
engineer 1:“Sometimes a little better than MPEG. I pretty much took the MPEG algorithm and tweaked it.”
tech-lead:“Software compatibility?”
engineer 1:“I've written a plug-in for Windows Media Player.”
tech-lead:“So, it will only work with Windows?”
engineer 1:“Well, if they're running Vista with the latest OS patches.”
tech-lead:“Wait, what about other OS's?”
engineer 2:“What other OS's?!”
 
laughter
 
engineer 1:“I guess it could be reverse engineered, but by the time it is, we'll be using a different codec.”
tech-lead:“Right. Of course. It's always worked for us in the past.”
engineer 2:“Is the plug-in secure?”
engineer 1:“Well, not really. It could allow a hacker to execute arbitrary code.”
tech-lead:“Whoa-whoa. That sounds bad.”
engineer 1:“I'm thinkin', when was the last time a hacker was able compromise a plug-in for Windows Media Player?”
tech-lead:“Good point.”

2007-05-16

Conservation of Knowledge

Our oldest son must make a documentary film for a school project. The title of his film? "How Cars Work." No surprise there. Shooting hasn't started yet, but he wrote a draft of the script, which he gave to me to proofread.

son:“I don't need you to fix any spelling or grammar. I just need to know if it's right on a technical level.”
me (head):“That's code for -- 'Dad, you're a functional illiterate, but you're the only person in the family who knows more about cars than I do.'”


The script was well written and nicely organized. He covered the major components in a logical succession, starting with the engine and ending with the brakes. That's when I got to this part:

"The brakes are responsible for converting the kinetic energy of the car into heat energy, so they need to be well ventilated."


Wow! He actually listened when I taught him about conservation of energy. Cool.

My chest swelled with geek-pride.

2007-03-30

Lego Photography



A few people have asked me how I do the lighting for the photographs of my kids' Lego models.

I found this how-to article on the interweb. It's pretty simple and cheap.

If you don't want to use a tripod, you'll have to flood the scene with a crap-load of light. For my setup, I use two halogen shop lights, totaling 1kw. Needless to say, the working environment gets pretty hot. It's a shame that 90% of that 1kw is converted into heat.

It's not a perfect solution, but I'm happy with the results. I still have to tweak the colors a bit, and the size of the model is limited by the size of the bucket.

Here is the setup:

2007-03-04

Hudson

Hudson

Back in days of yore (circa 2002, I think), Mr. Gettle and I created a Development Portal. It was our home-grown continuous integration server. We wrote it because we needed a common place to create binary distribution of our software.

We just started using Hudson at Versatile. I'm really impressed. It's a snap to install and I had it building our project in no time.

Here are the features I like:

Painless Install
- Just drop the hudson.war file in a servlet container, go to the Admin Page and start configuring your projects.

Great UI - Intuitive design, inline help, pretty graphs, AJAX stuff. Sold!

Email Notifications - Hudson notifies the developers of broken builds and when a build is fixed. It also sends special emails to the suspected build-breakers. The suspects are simply the developers who have committed code since the last successful build.

Multiple Projects - Hudson manages as many projects as you want. You can even set up project dependencies. With this, projects that depend on a core project are automatically rebuilt if the core project is successfully built.

Multi-Threaded Builds - You can specify how many build processes can be run concurrently, allowing you to throttle how hard the build server is pushed.

Distributed Builds
- What an amazing feature. If you have a weak or overworked build server, you can specify slaves boxes to handle some or all of the load.

SCM Integration
- Hudson can watch the source code repository and kick off a build when changes have been made. You can also create a CVS branch/tag right from Hudson. Sometimes creating a branch can take some time, in that case, Hudson will email when it's finished. And finally, you can view all of the source via the Hudson interface just like ViewCVS.

All that said, the Hudson website has this gem listed in the Benefits section:
No more "full rebuild" before a commit:

With Hudson, I stopped doing a rebuild before I commit. Nowadays I just commit, and let Hudson check if a build fails or not for me. Meanwhile, I move on to work on other things. If a build fails, Hudson can tell me so within a few minutes, so breaking a build for that short period of time is not really a problem. Thanks to this, I can spend my time more productively.

-- said the developer nobody wants on their team.

2007-02-14

Unit Testing: still rewarding

I'm not going into all of the obvious virtues of unit testing. If you're a developer and you don't know them, you should probably find a new career.

I didn't like unit testing. I didn't like spending my time writing a test when there was plenty of useful code to be written. Working at Capital Blue Cross for a year changed all of that. My partner, Andy H., insisted that I write a unit test for every part of the system. My work wasn't considered done until the corresponding unit test was written. What a taskmaster. Consequently, I didn't feel productive at all.

Near the end of the project, it was time for us to start running the application through its end-to-end testing. After a few runtime setup environment problems and false starts, the application ran without a problem. It was one of those "Did it just run without a problem?" moments of disbelief. Not only did it run without crashing, it produced the output we were expecting. Hopefully Andy will back me up with a comment so my readers know that I'm not making this up.

OK, so unit testing produces applications with less bugs. Duh. If you didn't know that, or worse, you don't believe it, please stop reading now.

Now for the benefits that I wasn't expecting.

Writing testable code means writing readable and organized code. For example, I wrote an object responsible for building an email using contextual data and a template and sending it. I blew through the implementation pretty quickly. In no time, I had a 150 line method that did it all. OK, time to test. Congratulations jackass, you just wrote a lump of untestable code. I was forced to break the huge-ass method into smaller, more testable, methods. When I was done, I had a class that was easier to read. Even better, I had a class that was tested.

No more Winnebago classes. We've all done it. "Oooh, I know, I'll add this neat feature. No one needs it right now, but someone might need it in the future." When writing code with unit testing in mind, you tend to skip those neat-o features when you also have to write a test for them. The result is lean code that does only what it has to do.

Writing unit tests forces you to think about the design from a different perspective. You may write a nicely organized class that is easy to test, only to realize a design flaw while writing the unit test. After writing a unit test with 70 test methods, you may think the class would make more sense if it were broken into two classes.

Even though I've had mostly positive experiences incorporating unit testing into my development cycle, I still feel unproductive while I'm writing a unit test. Hopefully this feeling will change. I guess I feel unproductive because the benefits are delayed. I take great pleasure in watching 16 unit tests fail because a developer (probably me) made a "simple change" to a core class.

2007-01-24

A Million Dollar Idea

Amazon Web ServicesAmazon has it right. In addition to providing one of the best department stores on the interweb, they have been quietly providing incredible web services. Elastic Computing Cloud, Mechanical Turk, Simple Queue, and S3 are few of my favorites.

All of these services share the same basic theme:
"We can do this server hardware stuff much better than you. So why don't you focus on the software, and we'll do the rest."

How much? Pretty damn cheap. For example, here is their pricing for S3:

  • Pay only for what you use. There is no minimum fee, and no start-up cost.

  • $0.15 per GB-Month of storage used.

  • $0.20 per GB of data transferred.


So what can you do with it? That's up to the developer. There are several free and open source applications that provide slick interfaces to S3. I'm using JungleDisk. It's an active project with binaries for Windows, Linux, and Mac OSX. You give JungleDisk your S3 account information, and it gives you a file system that you can mount as a drive. The virtual file system JungleDisk provides is only available to your local machine, which is a little restricting, but there are ways around that.

Now that no one is still reading, here's my million dollar idea:

S3 + JungleDisk + Linux + Samba + Hacked Router = the perfect network storage/backup appliance.

  1. Install Linux on a router. Linksys seem to play nice with Linux.

  2. Install JungleDisk on the router.

  3. Point the JungleDisk instance to your S3 account.

  4. Install Samba on the router and use it to share the JungleDisk mount point.

  5. Enjoy your worry-free network storage appliance.


So why spend several hundred dollars on a networked storage appliance with limited capacity, when you can have the Infinite Storability Drive from Sparrowlegs Systems Inc.

2007-01-14

Challenge Pro Mode Matches On

The development of my favorite Quake 3 mod is alive and kicking. I'm amazed by the longevity of the game. I know it's dated but I love it. As I play into the night, (OK -- 11PM), I must be one of 30 people who hasn't moved on.

A few weeks ago, while aimlessly surfing the interweb1 instead of writing a post for my blog, I decided to check out the Challenge Pro Mode site. Holy sweet Jesus! People are still actively developing the mod! The version I was running was 8 revisions behind. Wow, that's embarrassing. They have an RSS feed now, so I won't miss any future releases.

Here are my impressions so far...

Pros



  • Greatly improved GUI, giving easy access to most of the settings. Wanna hear through walls, turn off rocket smoke, or add cool effects to the Railgun? No problem. It's all adjustable from the GUI. No more editing configuration files.

  • Better looking fonts. Sounds stupid, I know, but they look so much better than the old ones.

  • New in-game announcement voice option, providing a sexy female voice alternative to the default I-also-do-narration-for-movie-trailers guy.


Cons



  • Lower ammo counts for weapon pickup. You know, when you frag someone and get to pick up ammo from the weapon they dropped? For the Rocket Launcher, it used to be a 10 round/rocket reward, now it's 5. Doesn't sound like much but you'll notice.

  • Slightly less running speed. I realized that I wasn't able to make all of my usual trick jumps. Surely, it can't be me.

  • More segmentation faults. The CPMA bots (level 6 and up) appear to be broken again. My version of the game crashes from a segmentation fault whenever I attempt to use them.


In related news, I got a new mouse for Christmas. When it comes to tracking accuracy and speed, this one is better than my old mouse. The buttons could be a little better. There are five buttons in the wheel: scroll up, scroll down, click, tilt-left, and tilt-right. For normal computer use, these buttons are really handy, but in the heat of battle, I still have trouble. The tilt buttons are really sensitive, and the mouse wheel click requires too much force.

1 Deppen, I've added this word to my spell checker dictionary. So, no, I'm not going to stop using it. I'm a pioneer.

2006-12-08

Geekcon 2006

You may remember that, back in February, my youngest son was awarded the Grand Champion prize for his Science Fair project. It was a proud moment for us.

One of the perks of being Grand Champion is an all expense paid invitation to the PSTA Annual Convention in Hershey, Pennsylvania. My son and I enjoyed the two night say at the Hershey Lodge, free food, and of course an abundance of chocolate. In return, my son had to present his project to convention goers for two hours each day. A small price to pay.

My son was amazed by the exhibit hall. It housed over a hundred companies demonstrating their latest and greatest gadgets science teachers could employ to enrich the educational experience. Ensuring that no child gets left behind. My son stared at me in amazement as the exhibitors gave him all kinds of free stuff. The novelty of being the youngest person there got him more attention than the other convention attendees.

One exhibitor gave him four large (four inches long) millipedes. Luckily, they weren't the poisonous kind.

Another exhibitor asked him to hang out at their booth because he was drawing a large crowd. I guess 4 foot tall kid with a 6 foot long Boa Constrictor wrapped around his neck is interesting to most people.

But the give away that takes the cake occurred on the last day. One of the guys involved with PSTA asked my son what he was interested in. "Anything about animals!" He took my son to an exhibitor who gave him microscope. We were shocked.

As soon as we got home my son and I started experimenting with the microscope. My son was transfixed as he gazed at various things though 400x magnification. Human hair, dog hair, paper, mold, human saliva, toilet water, aquarium water. The aquarium water yielded the coolest images. He was giddy when he got to see a Euchlanis munching on microscopic plants.

2006-11-13

LED Fun

I'm still the favorite parent. This past rainy Sunday I made "Throwies" with the kids. A Throwie is an LED light (is that redundant?) powered by two hearing aid batteries and held together with some electrical tape.

Of course, I had do a mini science lesson about electricity. They seemed to grasp the difference betwixt wiring batteries in parallel and in series. Good times.
The assembly was extremely tedious. I was so frustrated (read: screaming) that the kids felt the need to "give me some space." "You don't need us here watching you...just call us when you're finished," my daughter said, trying to put on a happy face and pretend she wasn't scared of me. After 20 minutes of intense concentration and several f-bombs, I was finished.

My oldest son was very pleased with the LED he chose (clear LED's seem to shine the brightest). So happy, in fact, that he promptly stuck it up his nose. His semi-cross-eyed gaze was a nice, unexpected addition.

Here's younger son desperately trying to spin his Throwie fast enough to create a full circle in the photo. 'C' -- nice job. Better luck next time.

And my daughter, obviously very unhappy with her LED color choice, did nothing special for her photo. Happy happy happy. Joy joy joy.

2006-11-06

Shopvac Afterburner

I like using a charcoal grill. The food tastes better, plus it's a great excuse to play with fire.

I use a charcoal chimney starter. Thanks to Lurker for introducing this device to me. I think Sherry wants to thank you too...but she has trouble being nice to people.

"This environmentally safe chimney starter lights a charcoal grill quickly and easily without lighter fluid. Food tastes better and the charcoal lighter fluid odor doesn’t permeate your picnic--or the environment."


It's pretty simple to use. Fill the top part with charcoal and the bottom part with a sheet of newspaper. Light the newspaper and wait 20 minutes. 20 minutes. That simply doesn't cut it for the have-it-right-now generation.

Here's a method I use for lighting my charcoal in 2 minutes. 2 gloriously fun and surprisingly educational minutes.

Warning: This is pretty dangerous. Before you start, make sure your kids and pets are indoors (My oldest son was with me only because I needed someone to take pictures, and Sherry was too busy watching football...err...screaming at the TV.) Choose an area that is free of dry grass and/or leaves. Wear a hat (I wore a cotton baseball hat) and eye protection (normal glasses for me).


Light the newspaper just like before, but after the newspaper is finished burning, pick up the chimney and carry it to an open area...free of combustible items.

Turn your shopvac to 'blow.'

Hold your lit chimney as far away as possible. Tilt the top slightly away from your head.

bottom.jpgSlowly bring the blowing end of the shopvac tube to the bottom of your chimney. It's important to do it slowly because a large amount of loose ash blows out initially. The first time I did this, I realized that my hair might ignite. It was quite a precarious situation. I was holding a chimney of hot coals in one hand, a shopvac hose in the other and little pieces of hot ash where landing on my head. This is what the bottom of the chimney looks like.



fullpower.jpgAt full throttle, the charcoal begins to super-heat. It puts out a staggering amount of energy. It only takes 90-120 seconds of full after-burner to light all of the coals.

You'll see the sides of your chimney start to glow red. That's a good indication that it's time to stop. ...Or...you can keep going and see how hot it can really get. Eventually, if you aren't wearing gloves, which I wasn't, the heat will become unbearable.



alldone.jpgTurn off the shopvac and let the flames die down. At this point you'll be kicking yourself for using up all your arm strength on the prior step. You really can't move around that much during this step, and dumping the coals in to the grill is out of the question. Dig deep and find the strength to hold the chimney for a few more seconds and enjoy the two foot flames.



grill.jpgFinally, dump your hot glowing coals into your grill. These coals run a little hotter than coals lit using the normal method for lighting, so you'll need to adjust your cooking time. Sherry, remember the last time I did this and the hamburgers caught on fire? God that funny. Good times...good times.

2006-10-23

New Cell Phone

lg_vx8300.jpgSo my employer finally came through with a cell phone. A shiny new LG VX8300.

I can see myself getting a lot of use out of the integrated digital camera feature. In lieu of anyone buying me a real digital camera.

The phone has lots of other interesting features, including bluetooth. Unfortunately most of these features are neutered by Verizon Wireless. Thanks. I'm sure your technically retarded business decisions are making you boat loads of cash.

When a mobile phone has bluetooth it should mean that it becomes less of an information island. Verizon doesn't see it that way. They want you to use bluetooth to attach A-Hole-like accessories like the Jabra BT350, which Versatile was kind enough to provide for me. Now I have another device in my arsenal with which to annoy my wife. Whatdoya say babe? Pretty annoying? Babe? Wanna drive to Hogwarts?

If I want the cool photos I've been snapping, I'll have to email them to myself. Really? That doesn't seem right. Why can't I transfer them to my laptop via bluetooth. Verizon says 'no'.

I keep my contacts in my Yahoo address book. It would be nice if I could transfer them to my phone via bluetooth. Verizon says 'no'.

Luckily there are ways around these problems. With an open source tool called BitPim, I'm able to do all kinds of things with my phone. I'm pretty sure I haven't voided any warranties. Now I can transfer pictures, music, and contacts betwixt my phone and laptop. Cool.

2006-10-16

Mathlete Game

Deviousbard sent me this wonderful game. It combines two of my favorite things -- computer games and prime numbers. Both of these are very popular with the women.

Sherry, don't worry, you don't have to have an interweb connection to play! You can save the page locally so you can play sans interweb. Life is good.

On a side note, the domain name for the PrimeShooter game is a little troubling: 1729.com. 1729 is definitely not prime. Maybe I should contact the owner. That's just embarrassing.

2006-10-10

Ubuntu

UbuntuAfter I got my company laptop, I was happy to overwrite the default Windows installation with Linux.

For two days I struggled with the Gentoo install. Not having the Gettle to do it all for me, I quickly (OK, 2 days) realized that this task was unrealistic for my skill-set.

So, I downloaded the Ubuntu ISO and gave it a try. Wow. I had a working Linux installation in 30 minutes. It took another 15 minutes to get the the direct rendering working. Most of that time was spent reading documentation. The laptop has a dual core processor, but it didn't look like the OS knew about it. So, 10 minutes later (again, most of that time was spent reading documentation) I had a SMP-enabled kernel. Cool.

The default Ubuntu installing uses Gnome for it's window manager. I like fluxbox. So I installed that. Unfortunately, fluxbox doesn't play nice with GDM and/or Ubuntu. It runs fine, but when I logout and try to return to the GDM login screen, the screen goes all crazy-silly. I guess I'll use Gnome for now. There is a fluxbox-ubuntu distro, but I found out about it too late.

After the installation was complete, I was alarmed to find that there was no root account. Oh no, did I forget something? Did I not pay attention during the install? Alas, this is how the default Ubuntu install works. Sigh. The root account can be enabled, but they prefer you use sudo. So far, I've been happy with using sudo.

I wasn't surprised to find that the install didn't pickup my wireless chip-set. I looked at the wireless installation notes. "Download blah1.2422314.323.patch. Apply the kernel patch. Recompile the kernel. Download huh3124.234.23.deb module." It seemed kind of complicated, so I avoided the issue for a few days. On a whim, I decided to try a different method. Gnome has a nice network configuration GUI application. I started that up and enabled the wireless network and that was it. I now have a wireless network connection.

The software updates are easy. Ubuntu checks once a day for any patches. If it finds something, it notifies you by displaying an icon in the upper right-hand corner. Clicking on the icon activates the software updates download/install.

As you can tell, I'm pretty happy with Ubuntu. So happy that I proposed to my kids that we (OK, I) install it on a computer for them to use. My daughter and youngest son were both concerned with not being about to use Word or PowerPoint. God damn you Microsoft. Damn you all to hell.

2006-10-06

Google Code Search

codesearch_logo.gifI'm currently wiping down my computer.

I just found out about Google Code Search. As you can probably guess (OK, maybe not Tommy or Sherry), it's a search engine specifically tuned to find open source code. Cool enough.

But the thing that made me cream all over the keyboard was Google's decision to use regular expressions for their search string syntax. Good god. Does this mean that regular expressions are going to hit the mainstream? I hope so.

Imagine (Tommy and Sherry, you're exempt from this activity) how much more useful Google would be with regular expression capability.

Update 2006.10.09: All technology can be used for evil.

2006-09-25

Hibernate's New Clothes

Ever since it's inception, Hibernate has been touted as the savior of the database centric application. Its Object-Relational mapping defined externally to the application code was going to eliminate thousands of lines of code for doing Create, Read, Update, and Delete (CRUD) database activities. Every press article I've ever read has nothing but good things to say about Hibernate. If you as a developer are not using Hibernate, there must be something wrong with you.

There's a fairy tale written by Hans Christian Anderson entitled The Emperor's New Clothes. In a nutshell, the story is about two smooth talking tailors who convince the Emperor that the invisible clothes they have made for him are the most exquisite in all of the kingdom. The tailors added that anyone who couldn't see how remarkable the clothes were was obviously a fool. Not wanting to be thought a fool the Emperor "dons" the clothing, and strolls through town completely naked. All of the townsfolk, not wanting to be thought fools either, praise the craftsmanship of the clothing. Only a single boy in the kingdom has the courage to say that the Emperor is not wearing any clothes.

Well, I just have this to say, "Hibernate, put some clothes on!"

I had another run-in with Hibernate the other day. I was working with a very simply database model.

ERD Diagram

I was using Hibernate to do the normal CRUD operations. Until I tried to do something fancy.

I wanted to insert a new Item and a new ItemType at the same time. I know what you're thinking, "That's Crazy!". Hibernate thought I was crazy too. It complained of a foreign key constraint violation. I spent two days trying to solve this problem, thinking the whole time how much easier it would be to use JDBC.

I solicited SweetTea’s help. He suggested that I set the cascade attribute on the many-to-one relationship to "none". That didn’t fix the problem. He also suggested that I re-fetch the new ItemType after I inserted it. That didn’t fix the problem either. Sorry, SweetTea. Your two years of Hibernate experience aren’t enough for this problem.

So, I checked online, and I found lots of tutorials/reviews written by enamored Hibernate fan-boys. Saying things like:
"Hibernate is simply the greatest object-relational mapping tool available for Java. I wrote an order application in just a few lines of code. I can’t imagine how hard it would have been to use straight JDBC."


Really? I can. It’s not that hard. I’m sure I can do a crazy two table insert in less than two days.

Thankfully, DeviousBard saved the day. Whoosh! After he was finished laughing at me for having to work with Hibernate, he dug in and started tweaking the Hibernate configuration files. Between us, DeviousBard and I have about 20 years of Java experience, but we must be complete idiots. We were pretty much changing settings randomly, and getting unexpected results.

  • Lazy initialization Errors

  • Batch Update Exceptions

  • Class Cast Exceptions

  • OMG Hibernate Sucks Exceptions



A few hours later, DeviousBard noticed something that appeared to be completely unrelated. A few lines above my troubled code, I was fetching an object by ID from one of the tables that I was attempting to insert into. The object was not found, and Hibernate simply returned null. Not a problem. Right? Wrong! This was the problem. Our best guess is that because the fetch was done within the same transactional context as the insert, Hibernate attempted to perform some sort of CRUD activity on the null object. By simply removing the seemingly unrelated code, my code suddenly started working. Shoot me.

I’m usually interested in knowing why and how things work. Usually when I start using a new API, I dig into the source, and have a look around. I have no interest in Hibernate internals. It’s like trying to figure out why a turd stinks.

I think I’m gonna write an Eclipse plugin called "WakeUp". Its sole purpose is to convert a Hibernate configuration file and the associated Java code back into POJO's that use JDBC. Then maybe, when everyone else in the Java world is willing to admit that Hibernate has no clothes, I can become a millionaire by selling the product that brings them back to reality.