jc blog - tales of a modern-day nomadic hunter-gatherer

Follow jcomeau_ictx on Twitter This is the weblog of Intrepid Wanderer. You never know what you might find here; graphic descriptions of bodily functions, computer programming secrets, proselytizing for the antichrist, miscellaneous ranting and kvetching, valuable information on living off the land... if you don't share my rather weird interests you may want to try slashdot instead.

You can consider my Del.icio.us links an extension to my blog, as are my LifeTango goals and my other to-do items. My to-buy list is also public, but only for sharing any useful ideas that might be there; I'm not requesting charity, neither do I offer it.

You can find me easily in google searches, as jcomeau, jcomeau_ictx, or jcomeauictx. There are lots of other jcomeaus, but AFAIK I'm the only jcomeau_ictx out there so far.

If you want to comment on anything you see here, try the new Facebook comments, reachable by clicking the "[comment]" link at the end of each post. If for some reason that isn't working, go ahead and email me, jc.unternet.net. You know what to do with the first dot. Make the 'subject' line something reasonably intelligent-looking or it goes plunk! into the spambasket unread.

This RSS feed may or may not work. Haven't fiddled with it in forever. RSS Feed


Yesterday the power was out since about midnight -- had to go into SD to try finishing my current trabajito. Not quite successful, but not bad. On the way back, stopped at my favorite tacos 'n beer place, Taco Bell, in TJ (as mentioned previously, this has nothing to do with the chain in the U.S.). Some interesting-looking dude about my age was punching in some interesting Spanish-language rock'n'roll into the jukebox. Balding, all in black including long leather jacket. Probably an intellectual anarchist like myself, but lacking the language skills I just lifted a bottle to him and left it at that.

There was a group of youngsters there too, and one of them, a cute teenage girl, was also punching in some decent music. But all I could think of was how much I miss my lady. So when my last song, Comfortably Numb, was finishing up, I left my last 4 ounces or so of Pacifico in the bottle and left for Rosarito. Just now reenabled my webcam, which never came up on reboot. As a matter of fact, a whole lot of things don't work right on reboot since moving stuff to the new hard drive; something's wrong in the automount at bootup. One of these days... [comment]


I should have known. All this time my app was behaving strangely, and it turns out Java, my beloved Java, was corrupting the data. I'm sure I've seen this before, but since I never stick to the same language for very long I forget all the strange shit they do until it bites me in the ass again.

I finally solved it, once I realized what was going on, by using a DataInputStream and reading it in directly as ints. That meant that I had to change the python routine that created it to write it out in network order rather than Intel order, but that of course is trivial. Bah. Humbug. Feh. Trust Java only with text. It is not reliable with byte data, unless you mean it reliably fucks it up. Like Microsoft, or the U.S. government, it thinks it knows better what you want than you do. [comment]


Just checked my web logs, and someone had been hitting my webcam a lot, so decided just for kicks to trace it back... it went through California to Chicago, to New York, to London, Paris... and ended up in Hungary! Cool. So I tried the IP in links and got an audio retailer's website: D-audio webaruhaz: elektronikai es szamitastechnikai cikkek, akatreszek. Whatever the fuck that means.

Still hacking away at the Blackberry app. I've been getting some help from RIM, but got a little disappointed today when my contact there punted and told me the maximum .cod file size was 128kbytes. Yeah, right, that was true at one point but no more. But anyway, I think it's safe to say the 3MB filesize of my application is at least part of the problem. I'm going to bring it down to under 1MB with compression, and see if that'll fly. I'd sure like to finish this job and move onto something else. [comment]


I found some code on the web (gumuz'), but you know me, I had to code my own:

"""testing stuff for huffman compression, based on gumuz' and others

this is public domain!"""

import sys, types

def huffwalk(*args): """we're using lists of lists... offset [-1] will either be:

a list of length 3, which is a number and two branches, or a list of length 2, just a number and letter, or just a number, which means a list or a letter is at offset -2""" try: code, branch, codes = args except: return huffwalk('', huffmantree('test'), ()) if len(branch) == 0: return codes elif type(branch[-1]) == types.IntType: if type(branch[-2]) == types.StringType: return codes + tuple(branch) + (code,) else: # walk the left and right branches recursively return huffwalk(code + '0', branch[-2], codes) + \ huffwalk(code + '1', branch[-3], codes) else: # we should only get here on the first iteration if at all if len(code) > 0: raise Exception, 'lost! %s' % repr((branch, code, codes)) return huffwalk('', branch[-1], codes)

def huffmantree(*args): if args[0] == 'test': # example at http://www.maths.abdn.ac.uk/~igc/tch/mx4002/notes/node59.html nodes = [['i', 6], ['a', 3], ['b', 3], ['d', 2], ['m', 4], ['e', 5], ['o', 3], ['c', 1], ['f', 1], ['g', 2], ['s', 4], ['t', 3], ['l', 2], ['r', 2], ['n', 5], ['p', 1], ['u', 2], [' ', 11]] else: nodes = wordfrequencies(args) while len(nodes) > 1: combined = [nodes.pop(0), nodes.pop(0)] # get the 2 lowest-weight nodes combined.append(combined[0][-1] + combined[1][-1]) # add the weights #DebugPrint('combined lowest nodes: ', combined) nodes.append(combined) # plop new node into the existing list nodes.sort(lambda a, b: cmp(a[-1], b[-1])) # re-sort for lowest weights return nodes

if __name__ == "__main__": sys.stderr.write('running huffman test\n') print repr(huffwalk('test')) else: sys.stderr.write('loaded huffman module\n')

There may be ways to simplify it even further, but this is good enough for now. Note that my result is not the same as on the referenced webpage; Huffman trees are not unique; as far as I know there's no rule that says the highest weight must go to the same side of the node. It was just easier to code it that way.

I haven't tried it on any real data yet, I may find this to be totally broken. What the hell, I'll figure it out eventually. [comment]


Sorry no updates, I'm visiting with my old friends Lempel, Ziv, Welch, and Huffman trying to solve a large problem with a small program... hopefully will get back on the blogtrail soon... [comment]


As you may know, I'm a big fan of one-liners. Scripts, that is, not jokes. Tired of having to type your password every time you log into that rarely-used machine, but don't want to go through the hassle of editing the authorized keys on the remote host? Make a script, call it 'addpublickey' or some such:

cat ~/.ssh/id_dsa.pub | ssh $1 "cat >> .ssh/authorized_keys"

OK, so that's two lines. But if you use ash or bash, you can dispense with the shebang line. So there.

You might want to check for a valid string in "$1". And don't forget the double-quotes around the remote cat statement... or it won't be remotely what you wanted to do. [comment]


One of the many criticisms of tribalism and hunter-gatherers by globalists is their apparent lack of technological progress. These critics say that, had not agriculture taken over the world, we would not have computers, robots, and the like. I was thinking this over during the transition state this morning, and have come to the conclusion that the critics may be more wrong that right.

According to my very little knowledge on the subject, most of it second- and third-hand through authors like Daniel Quinn and Ray Audette, most members of tribal societies "stayed home". Even the nomadic tribe members stuck with the group and did not socialize with other tribes (unless you call war "socializing"). But there were some exceptions.

There were, and still are, certain tribal elites who traveled the globe. They became shamans, teachers, and/or storytellers, and like technical gurus of our society, they enjoyed great status within their tribe, right up there with the great hunters, warriors, and chieftans (I'm really embellishing here, if anyone can correct me please do so). But unlike the hunters and warriors, the shamans were also welcome among other tribes; they could, and did, study with other shamans and swap secrets amongst each other. The technology they developed includes both telepathy and teleportation, if author Doug Boyd can be believed. (Note: the Amazon link shows a book with a "reading level" of "ages 9-12". Also, the editorial reviews are for a book about fighter jets, though the reader-contributed reviews are for the correct Rolling Thunder book. I wonder if it was deliberately marginalized to keep people from reading it.)

So yes, they didn't develop computers or robots. I grant you that. They bypassed all these polluting technologies and achieved far greater progress. And so shall I.



Busy day so far. Woke up early and went into S.Y. to fax RIM the code signing application. First fax place I found open was about half a mile up the road. How much? "$3.00." No thanks.

Went another few blocks. How much? "Sorry, the fax machine is broken." OK.

Another block, here's a cellphone store that doesn't offer fax services. On a whim, went in and asked how much to send a one-page fax. The guy asked the boss lady, she said "50 cents." My kind of price! There's a lesson there, which is taking me waaaayyyy to long to learn. Don't let yourself be limited by all the artificial limits in place for transactions between individuals. If two people can agree on terms, anything can take place. It's so simple.

Which reminds me. The border guard droid's brain was exploding over the fact that I lived in Rosarito and my driver license was still my (perfectly valid) Florida one. He made all kinds of strange noises and filled out this little reddish slip for me to take to another droid. He was saying that as an American I should be glad they were taking such precautions, but I cut him off and said no, I wasn't. The other droid punched in my license data, stood there like an idiot punching keys for several minutes, making faces like he was reading a rap sheet 20 pages long, and then handed me my license and sent me on my way. A block later I realized what I should have said to the first droid. Hey, Cipher! The Matrix isn't real. All these imaginary lines and limitations. They don't exist. I realize everybody has to make a living, but you don't have to believe this shit.

Anyway, on my way back I stopped at F Street and bought a couple of sex toys. I'm going to find a way to connect the, ahem, female device with the male device over an internet connection and make my first million that way. I'm sure it's been done already but nobody is really marketing it yet. I asked the guy at the store, first if they had such internet-enabled toys, and he said no. Then I asked if anybody else was asking for such things, and he said no, only interactive DVDs. But I know there's a market for teledildonics; it's just not sufficiently "out there" yet where people can appreciate the possibilities. ritx aut end fak samwan. [comment]


So, Java developers, have you checked out Blackberry's free IDE? If you have an app that's amenable to having a browser as the UI, code the engine as an extension of com.rim.samples.device.httpfilterdemo.precanned.Protocol, and register your app using code like httpfilterdemo.PackageManager. Anything that looks like a real URL ought to work, like "this.is-a.test". Then create a related project to launch the browser with your app, using, basically, one line of code:

import net.rim.blackberry.api.browser.Browser;
public class MyApp {
 public static void main(String[] args) {

Add a 28x28 PNG icon, build, and ship. I hope. I've only tested it on the (really cool) built-in simulator; it remains to be seen how it works on the real beast. Blackberry is selling a lot of those little boogers, so it might be wise to hop on the bandwagon. Word to the wise: add RAM to your development box, the IDE is a monster. But a nice monster. [comment]


Got a good scare yesterday. Spilled coffee onto my laptop, and it was dead, dead, dead... for about 6 hours. Kept it off and in front of the space heater, and tried it every couple of hours. Finally it came back to life! Damned good thing because I had finally gotten that job I've been talking about, a Blackberry application using Java. All for now! Gotta code... [comment]


I've been having this recurring dream, and only this morning did I wake up in time to remember any of it. There are things within the matrix (simulacra) we live in that don't add up, and in my dream, one of those things is filenames. Whatever that means. I didn't regain consciousness soon enough to get down an accurate example, but it's something like this: filename.atx is in the system, but it's not known to us as that; we know it as filesomething.txt. No, that's not it. Damn. I didn't remember enough of the context to make any sense out of it. My gut feeling is that there are bugs in the system that would let us see its inner workings if we had a better grasp of what to look for; only the showy stuff catches our attention, but all the context is there, in hidden "files" as it were, and if we could just dissipate enough of the smoke and break enough of the mirrors we could see through it all. The name "Mike Ahern" came up in the dream, too. IIRC I knew a guy by that name in High School band. Or not.

On this same line of thinking, and I'm using the term very loosely here, is the video that was circulating the net some week or two ago. The one where the school kids were passing around a basketball, and you were supposed to count the number of passes. Which I did. Then you are asked about the gorilla. What gorilla? I didn't see any goddamned gorilla. Then you were prompted to watch the video again, this time just for enjoyment, not to count anything. Sure enough, there's a guy in a gorilla suit walking through the basketball players, slowly and deliberately, turning his head back and forth and waving. It is so obvious when you're just looking, and so unfuckingbelievably invisible when you're focused on counting the number of passes. It had to be the same video, because it's large and it took so long to download; the second time it was already on my hard drive so there was no lag. A real eye-opener.

Anybody with more insights into the first paragraph, especially if you've had similar dreams and/or can explain better what I'm trying to say, please email. [comment]


Whoa. Still sick from yesterday. Power went out for at least 3 blocks here, and couldn't use the internet, so I went out for some liquid refreshment. Got into conversation with 3 English blokes, Jason, Michael, and Mick, all cops on vacation. I had already had my max and then they started buying me beers. I didn't realize what I was doing until. Boom. It hit me. I staggered into the restroom and blew my cookies into the sink. Over and over, till all that was coming up was bile. I rinsed it down as best I could and then Jason tries to get a cab for me. The goddamned cabbie says "five dollars" and even though Jason was willing to pay I wouldn't let him; that's a ripoff, it should only be 20 pesos. So I walked home. Froze my ass. Finally got into the big bed, covered myself with all the blankets I could find, and survived the night. Slept a good part of today, too. Still a mild headache, and couldn't eat anything until now, when I went and got a large bowl of birria. I think I can hold it down. Hope so. [comment]

view blog for 2024-07
view blog for 2024-06
view blog for 2024-05
view blog for 2024-04
view blog for 2024-03
view blog for 2024-02
view blog for 2023-10
view blog for 2023-09
view blog for 2023-08
view blog for 2023-07
view blog for 2023-06
view blog for 2023-05
view blog for 2023-03
view blog for 2023-02
view blog for 2023-01
view blog for 2022-12
view blog for 2022-11
view blog for 2022-10
view blog for 2022-09
view blog for 2022-08
view blog for 2022-07
view blog for 2022-06
view blog for 2022-05
view blog for 2022-04
view blog for 2022-03
view blog for 2022-02
view blog for 2022-01
view blog for 2021-12
view blog for 2021-11
view blog for 2021-10
view blog for 2021-08
view blog for 2021-07
view blog for 2021-06
view blog for 2021-05
view blog for 2021-04
view blog for 2021-03
view blog for 2021-02
view blog for 2021-01
view blog for 2020-12
view blog for 2020-11
view blog for 2020-10
view blog for 2020-09
view blog for 2020-08
view blog for 2020-07
view blog for 2020-06
view blog for 2020-05
view blog for 2020-04
view blog for 2020-03
view blog for 2020-02
view blog for 2020-01
view blog for 2019-12
view blog for 2019-11
view blog for 2019-10
view blog for 2019-09
view blog for 2019-08
view blog for 2019-07
view blog for 2019-06
view blog for 2019-05
view blog for 2019-04
view blog for 2019-03
view blog for 2019-02
view blog for 2019-01
view blog for 2018-12
view blog for 2018-11
view blog for 2018-10
view blog for 2018-09
view blog for 2018-08
view blog for 2018-07
view blog for 2018-06
view blog for 2018-05
view blog for 2018-04
view blog for 2018-03
view blog for 2018-02
view blog for 2018-01
view blog for 2017-12
view blog for 2017-11
view blog for 2017-10
view blog for 2017-09
view blog for 2017-08
view blog for 2017-07
view blog for 2017-06
view blog for 2017-05
view blog for 2017-04
view blog for 2017-03
view blog for 2017-02
view blog for 2017-01
view blog for 2016-12
view blog for 2016-11
view blog for 2016-10
view blog for 2016-09
view blog for 2016-08
view blog for 2016-07
view blog for 2016-06
view blog for 2016-05
view blog for 2016-04
view blog for 2016-03
view blog for 2016-02
view blog for 2016-01
view blog for 2015-12
view blog for 2015-11
view blog for 2015-10
view blog for 2015-09
view blog for 2015-08
view blog for 2015-07
view blog for 2015-06
view blog for 2015-05
view blog for 2015-04
view blog for 2015-03
view blog for 2015-02
view blog for 2015-01
view blog for 2014-12
view blog for 2014-11
view blog for 2014-10
view blog for 2014-09
view blog for 2014-08
view blog for 2014-07
view blog for 2014-06
view blog for 2014-05
view blog for 2014-04
view blog for 2014-03
view blog for 2014-02
view blog for 2014-01
view blog for 2013-12
view blog for 2013-11
view blog for 2013-10
view blog for 2013-09
view blog for 2013-08
view blog for 2013-07
view blog for 2013-06
view blog for 2013-05
view blog for 2013-04
view blog for 2013-03
view blog for 2013-02
view blog for 2013-01
view blog for 2012-12
view blog for 2012-11
view blog for 2012-10
view blog for 2012-09
view blog for 2012-08
view blog for 2012-07
view blog for 2012-06
view blog for 2012-05
view blog for 2012-04
view blog for 2012-03
view blog for 2012-02
view blog for 2012-01
view blog for 2011-12
view blog for 2011-11
view blog for 2011-10
view blog for 2011-09
view blog for 2011-08
view blog for 2011-07
view blog for 2011-06
view blog for 2011-05
view blog for 2011-04
view blog for 2011-03
view blog for 2011-02
view blog for 2011-01
view blog for 2010-12
view blog for 2010-11
view blog for 2010-10
view blog for 2010-09
view blog for 2010-08
view blog for 2010-07
view blog for 2010-06
view blog for 2010-05
view blog for 2010-04
view blog for 2010-03
view blog for 2010-02
view blog for 2010-01
view blog for 2009-12
view blog for 2009-11
view blog for 2009-10
view blog for 2009-09
view blog for 2009-08
view blog for 2009-07
view blog for 2009-06
view blog for 2009-05
view blog for 2009-04
view blog for 2009-03
view blog for 2009-02
view blog for 2009-01
view blog for 2008-12
view blog for 2008-11
view blog for 2008-10
view blog for 2008-09
view blog for 2008-08
view blog for 2008-07
view blog for 2008-06
view blog for 2008-05
view blog for 2008-04
view blog for 2008-03
view blog for 2008-02
view blog for 2008-01
view blog for 2007-12
view blog for 2007-11
view blog for 2007-10
view blog for 2007-09
view blog for 2007-08
view blog for 2007-07
view blog for 2007-06
view blog for 2007-05
view blog for 2007-04
view blog for 2007-03
view blog for 2007-02
view blog for 2007-01
view blog for 2006-12
view blog for 2006-11
view blog for 2006-10
view blog for 2006-09
view blog for 2006-08
view blog for 2006-07
view blog for 2006-06
view blog for 2006-05
view blog for 2006-04
view blog for 2006-03
view blog for 2006-02
view blog for 2006-01
view blog for 2005-12
view blog for 2005-11
view blog for 2005-10
view blog for 2005-09
view blog for 2005-08
view blog for 2005-07
view blog for 2005-06
view blog for 2005-05
view blog for 2005-04
view blog for 2005-03
view blog for 2005-02
view blog for 2005-01
view blog for 2004-11
view blog for 2004-10
view blog for 2004-09
view blog for 2004-08
view blog for 2004-07
view blog for 2004-06
view blog for 2004-05
view blog for 2004-04
view blog for 2004-03
view blog for 2004-02
view blog for 2004-01
view blog for 2003-12

Valid HTML 4.01 Transitional

Valid CSS!