Runcible Blog

disjointed

  • I wouldn't go so far as to call my room a fire trap. After all, the fire won't be trapped -- I will be.
  • Sometimes I don't think. The other day I had sand in my shoes, so what did I do? I dumped the sand on the floor under my desk. Now there's sand all over the place.
  • One bad thing about wearing shorts is that I have to find matching socks. It's harder than you think.
  • It's funny how something trivial like a haircut can affect someone's approachability. I know that whenever I have normal length hair, strangers make eye contact and ask me for directions or the time of day. If I cut my hair, fewer people approach me. Now that I have a pseudo-mohawk, the effect is even greater. The first day at work, some people seemed afraid -- as if I were packing heat. Look out! Others tried not to acknowledge my existence.

    I suppose if there's any point to anything that I do, maybe it's challenging stereotypes. Most people take their body modifications and hair styles to the extreme: they have an image to fill (badass biker, the goth look, punk/hardcore/whatever you call em, etc.). And perhaps they change their personalities to accommodate their physical appearance.

    Personally, I think a sort of nuanced approach is much more interesting. I mean, I don't like punk music at all, I'm definitely not an alpha-male, and I'm about as "straight-edge" as possible (though I'd never ever call myself that). Yet I'm not shy about piercings or tattoos (I'm thinking about getting my next one soon).

    It almost seems that my appearance and my character contradict each other. Or maybe they don't. Maybe that's the point. Subconsciously, I want to make it very difficult for anyone to know me by my appearance. It's like my own personal daily prank on the world. The other day at the recording studio, when the engineer asked if I wanted a drink, Scott said I was a whisky drinker (he knows I don't drink), to which the engineer replied, "Yeah, I figured." I laughed to myself. "I fooled you!"

    Life is more rewarding when you have to spend some time to get to know someone. My guess is that if anyone bothered to look past my scary visage they might be surprised that I'm not exactly one-dimensional. Then they'd be in on my prank. heh.

    Either that or they'd think I'm crazy. What the hell do I care?!

Anyway, now it's late. Here's a quote that I find particularly meaningful. It's the 10th phase/gate of the "10 Ox Herding Pictures" -- metaphors for the phases in Zen training. This quote resonates so much with me that it'll be part of my next tattoo -- a permanent reminder of how to live:

Barefoot and naked of breast, I mingle with the people of the world.
My clothes are ragged and dust-laden, and I am ever blissful.
I use no magic to extend my life;
Now, before me, the dead trees become alive.


Another Reason Why Java Sucks

I found another seemingly trivial task that Java forces the programmer to jump through hoops to accomplish: copying an object. You can't get more basic than that, or so I thought.

Let's say there's a Subscriber class which is a very large bean that holds everything there is to know about a subscriber. In the servlet I was modifying, I wanted to load a Subscriber from the database, make a copy of that subscriber, and change one field, the publication that the subscriber subscribes to. I had to keep the original subscriber, too.

I knew that Object has a clone() method because of my supremely bloated IDE which pops up a list of methods for everything. I figured it would be a simple (for Java anyway) matter of saying:

// get the publication
String pubType = request.getParameter("pubType");
// Static method to load the requested Subscriber.
Subscriber oldSub = Subscriber.loadSubscriber(params go here);
// copy the old one to a new Subscriber (notice the annoying casting involved)
Subscriber newSub = (Subscriber) oldSub.clone();
// set new subscriber's publication.
newSub.setPublication(pubType);

But that's only part of it. The Subscriber class also needs to implement the Cloneable interface and apparently, override the clone() method like so:

public class Subscriber implements Cloneable {
    // a lot of bean code...
    public Object clone() {
        Object obj = null;
        try {
            obj = super.clone();
        } catch (CloneNotSupportedException ex) {
        }
        return obj;
    }
}

(that's another thing about our code; we never do anything with caught exceptions. What's the point of having exceptions if you never even print out the result?)

All I wanted to do was copy an object! Java is so anal about protecting the programmer from himself that the verbosity and required hoop-jumping get in the way most of the time. Why can't there be an easy way to copy an object, and if you need finer control, then use the more complicated method?

Well, Python comes to the rescue again! Here's how you might do it in Python.

import copy

pubType = "Stinky Times"
# You probably wouldn't do something like a JavaBean
# in Python.  Nor would the bean know how to "load itself".
# For the sake of the example, assume that
# Subscriber's constructor takes the required arguments
# to load itself.
oldSub = Subscriber(params go here)

newSub = copy.copy(oldSub)

newSub.setPublication(pubType)

The "Python Way" assumes that you want to do something simple most of the time, so the language is very easy to do most things. Of course, if you want to do fancy things like control how your object is copied or make a "deep copy", you can do that too (override __copy__() in your class and use copy.deepcopy(), respectively).

But the point is that Python doesn't force you to do it the hard way for simple things. In that sense, it's more "scalable" than Java. You can use the basic features for small tasks and gradually use more and more of the language for more complicated projects. You don't have to know about everything all at once.

My boss was defensive when I remarked that the Java way was convoluted and unnecessary. He said, "You have to do it that way because it's the Object-Oriented Paradigm." and trailed off into some lame excuse. The problem isn't object-orientedness -- it's that Java sucks.


not gruntled

I've been wondering lately: If you aren't disgruntled, does that automatically make you gruntled?

Well, it turns out that someone content with their situation is not gruntled. Dictionary.com knows of no such word. In fact, the dis in disgruntled means "completely", and "gruntled" means "grumbling". Go figure. So, one wouldn't want to be disgruntled or "gruntled".

Ya can't win either way!


Useful Software

I've written a potentially useful (but mostly useless) weak, one-way encryption program for generating pseudo-random, easily memorable passwords. It's meant to be used for creating an initial, somewhat secure but easy to remember password which the user should change as soon as possible.

For me, at least, it's hard to think of a good password when creating new accounts. Maybe someone else will find it useful.

Try out Lousy Encryption version 0.1 now or download the package


Frickin Ticks!!!

While scratching my head earlier, I plucked a tick from my scalp! It must've been attached to me since yesterday, when I walked around an interesting field in the Methuen backwaters. I thought I had searched myself thoroughly yesterday, but somehow this little bugger managed to burrow under my radar and probably enjoy a day's meal.

Ticks are unbelievably gross. My mother said, "What if you get lime disease?!" as if I had gone out and tried to attract ticks. You don't have to try with these varmints -- they wait around all day with their arms waving around, waiting to grab any eligible animal that passes. (If only girls were more tick-like! Actually, isn't that what happens when you get married? The parasitic woman burrows under your skin, lays eggs, and drinks your hard-earned blood? Ba-Dooom! Chssss!) But seriously, folks...

So, to help prevent any future tick encounters, I shaved off most of my ignorance grass. It was time for a change anyway. Unfortunately, my hair is very inflexible. I've only really had three different hairdos in my whole life: the Bowl (when I was very young and stupid), Baldy (which comes and goes with the changing seasons), and Almost Corporate (longer, parted, but with unwieldy sideburns).

Actually, there are probably "official" names for my stupid haircuts, but what do I know? I cut my own damn hair, and it shows. I haven't been to Supercuts (the pinnacle of precision grooming) in eons, and I'm proud of it! Sure, I'll never win a beauty contest, but at least I'm $12 richer than those slaves to Supercuts! Yeah!