The Platypus

April 14, 2010

This afternoon, on #bash on Freenode:

[19:08:56]  < DrMax > well, yes, with the trailing -print, it works as expected
[19:09:20] * nDuff mutters about people who don't follow his examples exactly, and then complain when they don't work. :P
[19:09:37]  < DrMax > lol yes, sorry, my bad
[19:09:58]  < DrMax > won't do it again, promise
[19:11:55]  < DrMax > find is the platypus of the *nix ecosystems. It has a beak, claws, venom. It swims, lay eggs, is ugly, but somehow manages to survive
[19:12:13]  < DrMax > I hate this command
[19:12:39]  < DrMax > nDuff : nevertheless, the help is greatly appreciated
[19:13:48] < nDuff > eh; find is like *nix in general -- a little picky about who its friends are. Once you get to know it though, it's the kind of friend that helps you move bodies.
[19:14:16]  < DrMax > hmm interesting, but I don't have to move bodies very often
[19:14:21]  < DrMax > I'd rather have regular friends

We’re discussing find, the command I hate the most in all *nix-like commands. Needless to say, the guys and gals on #bash are always extremely helpful and got me on my way.


Soft-Ignore: Filter buggers in XChat

March 24, 2009

If you, like me, hang out once in a while on IRC to chat with fellow programmers (or with fellow practitioner of your favorite hobby), you may find that some individuals are just not worth your full attention. One easy, and rather definitive way to deal with the problem is to use the /ignore command that allows your IRC client to filter incoming messages from those people, and you just never see them again… quite literally.

However, just /ignoring someone is rude, and may prevent you from keeping a eye on them. You know, the “keep your friends close, your enemies closer” kind of thing.

A long time ago, with a friend, I wrote a mIRC script that shaded the “ignored” people’s text so that it was hard to read (like dark gray on blue), but the text was still available. To view the text, you could either squint or select the text. This week, I present a python version of that script, for XChat, based on the work of Albert W. Hopkins, a.k.a. Marduk, released under the GPL.

Read the rest of this entry »


Your Automatisms Betray You

March 11, 2009

Yesterday someone dropped on the IRC channel where my fellow programmers, computer enthusiasts, and I hang out to get help to find a bug. He uses one of the paste sites (like pastebin.ca, pastebin.com, or rafb.net), pastes his piece of offending code, and so we get a look at the code. Of course, I go over the short program, notice a mistake in the scanf but it took me a full two minutes to notice the loop:

for (c=0; c++; c<n )
 {
   ...
 }

That kind of bug always takes a while to find because we don’t read what’s actually written, but what we think is written, unless we pay the utmost attention to the code—what we should be doing anyway, but do not always. Usually, you zero in on that kind of bug rapidly, as you guide your search from the bug’s symptoms which leads you to defect’s approximate location. If you’re like me—write a little, test a lot—you find those bugs right away most of the times. However, even if you zero in rapidly, you still get a coarse-grained location: module, class, function.

Read the rest of this entry »


Follow

Get every new post delivered to your Inbox.

Join 74 other followers