jjohn's Journal http://use.perl.org/~jjohn/journal/ jjohn's use Perl Journal en-us use Perl; is Copyright 1998-2006, Chris Nandor. Stories, comments, journals, and other submissions posted on use Perl; are Copyright their respective owners. 2012-01-25T01:59:45+00:00 pudge pudge@perl.org Technology hourly 1 1970-01-01T00:00+00:00 jjohn's Journal http://use.perl.org/images/topics/useperl.gif http://use.perl.org/~jjohn/journal/ All good things... http://use.perl.org/~jjohn/journal/26152?from=rss <p>My Fellow use.perlers,</p><p>When, in the course of human events, it becomes necessary for one programmer to dissolve the blogginating bonds which have connected him with others, and to assume among the powers the Web, the separate (but not quite) equal station to which the laws of CGI and of CGI's God (St. Berners Lee) entitle him, a decent respect to the opinions of mankind requires that he should declare the causes which impel him to the separation.</p><p>We hold these truths to be self-evident, that not all blogs are created equal, that some are endowed by their Creator with certain unalienable features, such as posting pictures and controlling background colors.</p><p>We, therefore (meaning me), appealing to the Supreme Judge of public opinion for the rectitude of our (mine, actually) intentions, do, in the name, and by the authority of the good readers of my blog, solemnly publish and declare, that this blog is, and of right ought to be <a href="http://taskboy.com/">a free and independent site</a>.</p><p>And may God have mercy on my poor soul.</p><p>That is all.</p> jjohn 2005-08-06T23:34:02+00:00 journal those aren't friends http://use.perl.org/~jjohn/journal/26071?from=rss From <a href="http://chrisjuergensen.com.hosting.domaindirect.com/modes_3.htm">Chris Juergensen's site</a> on the Lydian mode:<blockquote><div><p>&laquo;Just like the previous two modes, to figure out on the spot what major scale you need to be playing. Let's say you are jammin with your friends Bob and Pete and the chart they give you says you have to play a solo over a <b>G maj7#11 vamp</b>. You need to figure out what major scale you need to be playing so you just remember your lydian scale mode rule which is: lydian mode = major scale up a perfect 5th. Remember how this works? If G is on the third fret, D is a perfect fifth from that note. All you have to do is play a D major scale over the Gmaj7#11 chord and you'll be groovin' away with the lydian mode.&raquo;</p></div></blockquote><p>Friends don't let friends vamp on Gmaj7#11 chords. Only junkies messed up on Chic Corea or the Mahavishnu Orchestra would have such abnormal and unclean thoughts.</p><p> <b>UPDATE:</b> What's sad is that I googled for both of these names and still got them wrong. Sigh...</p> jjohn 2005-08-03T20:41:40+00:00 journal Firefly -- good! http://use.perl.org/~jjohn/journal/25967?from=rss Saw the premier of the TV series tonight. It's amazing what gets cancelled and what doesn't. That Mr. Whedon can sure craft a pith sentence. jjohn 2005-07-30T00:57:09+00:00 journal a metaphor for our times http://use.perl.org/~jjohn/journal/25752?from=rss <p>Dogs can be territorial, but <a href="http://www.compfused.com/directlink/838/">this is absurd</a>. Doesn't he know that a dog divided cannot stand?</p> jjohn 2005-07-17T18:14:20+00:00 journal Alton Brown isn't afraid of Scientologists http://use.perl.org/~jjohn/journal/25731?from=rss <p> <a href="http://www.altonbrown.com/pages/rants.html">Go get 'em</a>, Alton! </p><p>Since it's not a proper blog with persistent links, here's the body:</p><blockquote><div><p>&laquo;Dear Tom Cruise,</p><p>Your lack of belief in the existence of clinical depression tells me one thing: you didn&#8217;t spend $10. to see War Of The Worlds. If vitamins can possibly help me out of this spiraling funk, please let me know which ones. Dinos? Pebbles? Freds? </p><p>Please, I&#8217;m crying out for help.&raquo;</p></div> </blockquote> jjohn 2005-07-15T22:05:36+00:00 journal what I did last weekend with Plumerai http://use.perl.org/~jjohn/journal/25646?from=rss <p>Finally, I have a solution to my blogging needs: <a href="http://www.noopy.org/wordpress/?p=275">get nate to do it</a>. For reasons I'm sure I don't understand, I go by the alias Loud Joe in that journal. Is it something I'm wearing? </p><p>Anyway, it's always fun to help out with audio engineering. I've been doing a lot with music that I haven't posted. I'd like to emit an EP one of these days. I've got two tracks in reasonable condition for this effort, one track that I'm on the fence about and one rocker of a track that's nearly there. More on this project as details emerge. </p><p> <b>Update</b>: Ah, here's what I did the <a href="http://www.noopy.org/wordpress/?p=273">weekend before last</a>. It involves a lengthy trip to Home Depot, several hundred pounds of building materials and manly power tools. This should help complete those occasional gaps in the obsessively detailed notes that my stalkers keep. </p><p>That is all.</p> jjohn 2005-07-12T02:07:08+00:00 journal For torgoX? http://use.perl.org/~jjohn/journal/25439?from=rss <a href="http://jerkcity.com/jerkcity2434.html">Jerkcity levels its buffulo-style journalistic shotgun at postscript syntax.</a> jjohn 2005-06-30T13:31:42+00:00 journal Sauron found http://use.perl.org/~jjohn/journal/25367?from=rss <a href="http://news.nationalgeographic.com/news/2005/06/0624_050624_Hubblepic.html">Hubble snaps "Eye in the Sky."</a> What's worse, <em>he's looking right at us</em>! jjohn 2005-06-26T13:25:32+00:00 journal Perl shrugs http://use.perl.org/~jjohn/journal/25348?from=rss <p>news.com.com is <a href="http://news.com.com/Report+Tech+jobs+rise+on+East+Coast/2100-1007_3-5759605.html?tag=cd.top">reporting</a>:</p><blockquote><div><p>&laquo;When it comes to programming skills,<nobr> <wbr></nobr>.NET is hot but Perl is not, according to the report.<nobr> <wbr></nobr>.NET requests rose 52 percent, HTML postings climbed 38 percent and XML demand increased 37 percent, Dice said, but the demand for tech professionals with Perl experience has declined 12 percent since the beginning of the year.&raquo;</p></div> </blockquote><p>Ouch! HTML and XML are in more demand than Perl. That can't be good. On the other hand, I wouldn't say Perl is exactly dead either. It's still part of the very popular LAMP paradigm and is a wonderful language for business logic code (where PHP isn't). What I think this article suggests is that there are a lot of corporate infrastructure gigs popping up (hence the<nobr> <wbr></nobr>.NET spike) and not so much start-up activity. Start-ups, being sensitive to cost, will likely gravitate towards open source tools. I predict that the more the business climate favors start-ups, the more open source jobs will become available. </p><p>Of course, what Dice doesn't show are those start-ups that aren't advertising, but may be making a great deal of hay with Perl and other OSS tools. This might be called the "dark job market", after the fashion of unused internet capacity ("dark net") or the hypothetical mass in the universe that we can't directly detect ("dark matter"). </p><p>I've had somewhat what morbid thoughts about the state of Perl for some time now. I don't think Perl is addressing business needs as directly as it did in 1995, which isn't surprising considering how different things are today. I feel that we're in some crazy retread of the late eighties, but instead of the sluggishness of PC hardware development, we're in a malaise of software stagnation. I'm unclear to exactly what the bottleneck is, but it is likely to be removed soon. No one can really know if Perl will be able to compete for a niche when the flood comes. </p><p>I don't have much hope for Perl's competitors either. Python and Ruby have no significant advantage over Perl (which isn't to say they have no advantage). PHP is a great domain-specific solution; java is far more bed-ridden than Perl;<nobr> <wbr></nobr>.NET is today's snakeoil. Maybe, as <a href="http://www.pbs.org/cringely/pulpit/pulpit20050623.html">Cringley suggests</a>, Flash will swoop-in, transformed into the all-singing, all-dancing solution to all our computer needs. But, I sort of doubt Flash has all that much longer to live. </p><p>I guess what I'm saying is that I'm ready for the <a href="http://www.culturevulture.net/Movies/400Blows.htm">New Wave</a> to <a href="http://www.devobook.com/">begin</a>.</p> jjohn 2005-06-24T20:15:20+00:00 journal iPod Shuffle: music without labels, man http://use.perl.org/~jjohn/journal/25314?from=rss <p>Several weeks ago, I bought a 512MB iPod shuffle. Without question, this is the most excite consumer electronic device I've come across since I saw my first walkman in the 80s (I don't include the PC as a consumer electronic device). There is almost nothing I don't like about this beast. It's got a long battery life (~10 hours); it's very light and tiny; it's got a respectable storage capacity (about 140 songs at the bitrate I encode MP3s at) and nearly NO MOVING PARTS! It's simply awesome. So taken with it was I, that I bought one for my brother's 45 birthday and now he's a fan. </p><p>Some have wrung their hands at the lack of a display on the shuffle or the limit size of the storage. These complaints are fundamentally misguided. The shuffle is not meant to be the sole repository of your MP3 collection (a linux box with a RAID system is<nobr> <wbr></nobr>:-). Those using iPods for this purpose are, I think, foolish. The shuffle is fills the niche that the cassette walkman did, listening to random tunes on the go. </p><p>The problem with the iPod is that it is too much of a computer and not enough of an appliance. Let's start with the hard drive. I don't like 'em. There, I said it. Hard drives are complicated little beasts that spin platters and will, someday, have a head crash. Notebook hard drives are to be especially despised. Low RPMs combined with a strangled I/O bus produces an utterly retro computing experience for laptop users. And notebook hard drives are at the heart of the iPod. Do iPods need terrific I/O throughput? No. And what's more, I don't want to be thinking of I/O at all when I want some tunes on the go. I want to be a computer Barbie. I just want it to work. Always. The first time. For this, the shuffle delivers. </p><p>Before I dig too deep a hole, I should mention that I think the iPod is a pretty cool computer hack. But I think it's a terrible appliance. It can do too much.</p><p>So, the shuffle: fun at any speed. Get one.</p><p>For my next Apple purchase, I'm looking at getting a Mac mini with 512MB of RAM. I need it for Safari (*cough* browser compatibility *cough*), so I don't need a lot of horsepower. Should be interesting.</p> jjohn 2005-06-22T14:43:19+00:00 journal The couch http://use.perl.org/~jjohn/journal/25258?from=rss <p>Internet polls are vital to our democracy, even if <a href="http://www.thisislondon.co.uk/haveyoursay/polls/?itemId=19355457">this one</a> isn't about politics and it's from a British organization. Still, I complement the pollsters on both their content and accomodating polling options. </p><p>Ms. Jolie's desire for that man who can fulfill her sadomastistic fetishes will, I predict, ultimately be sated by an Alabama trucker named Skeeter. Or perhaps, Chuckles Manson.</p> jjohn 2005-06-18T00:40:53+00:00 journal Adventures in static linking http://use.perl.org/~jjohn/journal/25016?from=rss What's wrong with this screen dump?<blockquote><div><p> <tt>[jjohn@localhost hello]$ gcc -Wall -static hello.c<br>[jjohn@localhost hello]$ file a.out<br>a.out: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.2.5, statically linked, not stripped<br>[jjohn@localhost hello]$ ls -l<br>total 424<br>-rwxrwxr-x&nbsp; &nbsp; 1 jjohn&nbsp; &nbsp; jjohn&nbsp; &nbsp; &nbsp; 424535 Jun&nbsp; 1 17:50 a.out<br>-rw-rw-r--&nbsp; &nbsp; 1 jjohn&nbsp; &nbsp; jjohn&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 90 Jun&nbsp; 1 17:50 hello.c<br>[jjohn@localhost hello]$<nobr> <wbr></nobr>./a.out<br>Hello</tt></p></div> </blockquote><p>Good gravy, that's one fine statically compiled binary that's more than 4000 times the size of the source code. It doesn't just print "Hello", it prints the <em>hell of out it</em>!</p> jjohn 2005-06-02T19:20:46+00:00 journal Attack of the bad comic costumes http://use.perl.org/~jjohn/journal/24896?from=rss <p>Whoopie Goldberg: Mexican Samurai: <a href="http://www.somethingawful.com/articles.php?a=2916&amp;p=9">with pic</a> </p><p>I wish I had thought of that line...</p> jjohn 2005-05-27T02:29:30+00:00 journal A definition of free software I can live with http://use.perl.org/~jjohn/journal/24833?from=rss Oddly enough, <a href="http://www.asciiartfarts.com/20050506.html">it's in ASCII</a>. jjohn 2005-05-23T10:37:39+00:00 journal Sith delivers http://use.perl.org/~jjohn/journal/24780?from=rss <p>I just returned from an afternoon showing of <i>Revenge of the Sith</i> and I while I can't rave about it, I can't rightly complain. Lucas finally nailed a prequel and I couldn't be happier. The dark path to Vader is plausible and well articulated. Ian McDiarmid is a utter delight to watch, as is Ian McGregor. Even Christian Hayden isn't replusive. Go figure!</p><p>If only Lucas had taken as much care with the setup of the first two films as he obviously took with this one, the world would have been a much more entertained place. No spoilers, but it does appear that Lucas preps the story to dovetail nicely with Episode IV (including that pesky android problem). Without question, this was film had Jar Jar's best performance. And yes, I think it would take about 20 years to build a Death Star. I live in city that's been <a href="http://www.bigdig.com/">building a couple of highways</a> for just about that time, so I'm used to big budget government projects that drag on for years.</p><p>George Lucas, I salute you!</p> jjohn 2005-05-19T22:52:26+00:00 journal automating openssh/openssl installation http://use.perl.org/~jjohn/journal/24759?from=rss <p> <b>Warning</b>: technical content ahoy!</p><p>Here's a handy shell hack I use to update openssh/openssl on various machine under my care. Further hacks could be made to determine the latest version numbers of the ssl/ssh to fetch. Become one with the primative shell hacking vestiges in your modern Perl brain, oh Perlescent Brethren!</p><blockquote><div><p> <tt>&nbsp; #!/bin/sh<br> <br>&nbsp; build=/tmp<br>&nbsp; dest=/opt<br>&nbsp; lynx=/usr/bin/lynx<br>&nbsp; wget=/usr/bin/wget<br> <br>&nbsp; ssl_url="http://www.openssl.org/source/openssl-0.9.7g.tar.gz"<br>&nbsp; ssh_url="ftp://ftp.tux.org/bsd/openbsd/OpenSSH/portable/openssh-4.0p1.tar.gz"<br><nobr>&nbsp;<wbr></nobr> ssl_version=`basename $ssl_url ".tar.gz"`<br>&nbsp; ssh_version=`basename $ssh_url ".tar.gz"`<br>&nbsp; ssl_dir="$build/$ssl_version"<br>&nbsp; ssh_dir="$build/$ssh_version"<br> <br>&nbsp; cd $build;<br> <br>&nbsp; echo "Finding $ssl_version and $ssh_version...";<br>&nbsp; if [ -e $wget ];<br>&nbsp; then<br>&nbsp; &nbsp; for url in $ssl_url $ssh_url;<br>&nbsp; &nbsp; do<br>&nbsp; &nbsp; &nbsp; file=`basename $url`<br>&nbsp; &nbsp; &nbsp; if [ -e $file ]<nobr> <wbr></nobr>;<br>&nbsp; &nbsp; &nbsp; then<br>&nbsp; &nbsp; &nbsp; &nbsp; echo "Using existing $file";<br>&nbsp; &nbsp; &nbsp; else<br>&nbsp; &nbsp; &nbsp; &nbsp; echo `$wget $url`<br>&nbsp; &nbsp; &nbsp; fi<br>&nbsp; &nbsp; done;<br> <br>&nbsp; else<br>&nbsp; &nbsp; if [ -e $lynx ];<br>&nbsp; &nbsp; then<br> <br>&nbsp; &nbsp; &nbsp; for url in $ssl_url $ssh_url;<br>&nbsp; &nbsp; &nbsp; do<br>&nbsp; &nbsp; &nbsp; &nbsp; file=`basename $url`<br>&nbsp; &nbsp; &nbsp; &nbsp; if [ -e $file ]<nobr> <wbr></nobr>;<br>&nbsp; &nbsp; &nbsp; &nbsp; then<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo "Using existing $file";<br>&nbsp; &nbsp; &nbsp; &nbsp; else<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo `$lynx -source $url &gt; $file`<br>&nbsp; &nbsp; &nbsp; &nbsp; fi<br>&nbsp; &nbsp; &nbsp; done;<br> <br>&nbsp; &nbsp; else<br>&nbsp; &nbsp; &nbsp; echo "Oops.&nbsp; No URL fetchers!";<br>&nbsp; &nbsp; exit 1;<br>&nbsp; &nbsp; fi<br>&nbsp; fi<br> <br>&nbsp; # unpacking<br>&nbsp; echo "Unpacking archives";<br>&nbsp; tar xzvf `basename $ssl_url`;<br>&nbsp; tar xzvf `basename $ssh_url`;<br> <br>&nbsp; echo "Cleaning";<br>&nbsp; cd $ssl_dir &amp;&amp; make clean;<br>&nbsp; cd $ssh_dir &amp;&amp; make clean;<br> <br>&nbsp; echo "Building SSL";<br>&nbsp; # build ssl first; sshd depends on it<br>&nbsp; cd $ssl_dir &amp;&amp;<nobr> <wbr></nobr>./config --prefix=$dest &amp;&amp; make install<br> <br>&nbsp; echo "Building SSH";<br>&nbsp; cd $ssh_dir &amp;&amp;<nobr> <wbr></nobr>./configure --prefix=$dest --with-ssl=$dest \<br>&nbsp; &nbsp; &nbsp;--with-sysconfig=/usr/local/etc &amp;&amp; make install<br> <br>&nbsp; # adjust ?<br>&nbsp; if [ -e "/etc/rc.d/init.d/sshd" ];<br>&nbsp; then<br>&nbsp; &nbsp; echo "You may need to adjust your sshd"<br>&nbsp; fi</tt></p></div> </blockquote> jjohn 2005-05-18T19:42:39+00:00 journal smooth and smarthy, it's The Onion radio news http://use.perl.org/~jjohn/journal/24744?from=rss <a href="http://www.theonion.com/radionews/index.php">Brilliant!</a> jjohn 2005-05-17T21:03:25+00:00 journal Tatam Spewtum http://use.perl.org/~jjohn/journal/24596?from=rss <p>I have weird dreams. </p><p>Last night, I was asked by Brad Pitt and Angelina Jolie to comment on their new baby whom they had named "Tatam Spewtum." I said that the name was perfectly abhorrant and that they had sentenced their newborn to years of torment. They didn't seem to understand how the majesty of the name escaped me. I suggested that "spewtum" was not only an ugly word, but that it carried sexual connotations. Angelina seemed confused and angry. So I then illustrated my point with a sampling of childhood taunts that pivoted on synonyms for ejaculation. Both parents stared blankly back at me, seeming to get neither the taunts nor the connection to their new daughter's name. Mr. Pitt said "Well, plenty of people have suggestive names. What about Ben Dover and Phil McCrackin?" When I said that those names were merely jokes and that the odds of gay couple have those names were the same as a manish-sized white rabbit with a pocket watch hopping out of his ass fretting about being late, Brad looked dejected. Just as I started to get angry and sputtering at exceeding density of the celebrity couple's gray matter, I woke up. </p><p>Like I said, I have weird dreams.</p> jjohn 2005-05-09T13:42:33+00:00 journal an unintelligent discussion of Intelligent Design http://use.perl.org/~jjohn/journal/24492?from=rss <p>When catching wind of an article about pseudoscience, my eyes perk up for <a href="http://pseudocertainty.com/">obvious reasons</a>. In this case, ye olde slashdot is running <a href="http://science.slashdot.org/article.pl?sid=05/05/02/1059247">a story</a> from <a href="http://www.kuro5hin.org/story/2005/4/27/03541/2520">kuro5hun</a> about the argument for <a href="http://www.actionbioscience.org/evolution/nhmag.html">Intelligent Design</a>, the idea that terristrial organisms (and indeed the entire comso) evince too much complexity for them to have arisen through chance alone. Therefore, some guiding intelligence must of been at work pushing life into increasingly complex forms. Fans of Clarke's <em>2001</em> will note the Monolith-like qualities of this argument. While God is specifically not mentioned in the Intelligent Design hypothesis (<a href="http://dictionary.reference.com/search?q=theory">theory</a> is an inappropriate word here), He is clearly implied by the proponents of this view. Intelligent Design is an attempt by some Christians with a science background to take advantage of some unanswered questions in the scientific dogma of Natural Selection-driven Evolution.</p><p>Obviously, today is a slow news day.</p><p>To understand what the hoo-haw is about, one need only dig out your high school English books and look for Lawrence and Lee's gripping courtroom drama <em>Inherit the Wind</em>. In it, a teacher is prosecuted for explaining evolution to hicks, I mean, the children of salt-of-the-earth Americans. Of course, you'll remember that not so long ago, some states banned the teaching of evolution in public schools (and <a href="http://www.infidels.org/activist/state/evolution.shtml">are doing so again</a>). At stake is the validity of science and its methods versus the comfort and security of faith. Or more pointedly, it is yet another front in the war of modernists versus fundamentalists (which can be incautiously reduced to those who embrace change and those who fear it).</p><p>Intelligent Design, which sometimes ropes in Physics via the second law of Thermodynamics, isn't really attempt to pursuade scientists to reject Evolution. ID isn't a scientific theory; it predicts nothing, nor does it offer testable evidence. Rather, ID makes rhetorical appeals to the deficiency in the fossil record and the still-unobserved genesis of a new species from an existing one to wedge in a specious argument against Evolution. Note that the argument, while wearing the vestments of Science, isn't scientific at all. It offers no conditions under which it can be proven wrong. This is preciously the characteristics of religious dogma or garden-variety piffle.</p><p>So if ID isn't aimed at Scientists, for whom is this argument intended? The only group that jumps to mind are defensive, educated Christians who know enough biology to be uncomfortable with strict-constructionist religion and yet insistent on believing that faith anyway. This irony always strikes me the same way <a href="http://www.jewsforjesus.org/">Jews for Jesus</a> does. ID is a notional life vest for these individuals who are trapped in the rough waters between science and faith. ID is neither a product of devoted faith (if you know there's a God, you simply don't need ID in the first place), nor good science (see preceeding paragraphs). ID is a small, fevered argument of badly sutured science that attempts to scare its adherents away from looking into the swirling chaos that is the reality science proffers us.</p><p>So to those proponents of Intelligent Design, I implore you to pick a side: faith or science. By choosing faith, you abdicate your voice in scientific debates and inquiry for the certainty of Knowing the Truth and basking in unctuous Righeousnes. By choosing science, you must adopt its methods and put your hypothesis up for independent verification. Let me close with a little sumthin-sumthin from the Bible:</p><blockquote><div><p>So because thou art lukewarm, and neither hot nor cold,<br> I will spew thee out of my mouth. </p><p>--Revelation 3:16</p></div> </blockquote> jjohn 2005-05-02T17:50:15+00:00 journal why are the letters blurry? http://use.perl.org/~jjohn/journal/24433?from=rss <p>In a continuing effort to remind me of my own mortality, nature has begun to screw with my eyesight. Staring at a computer screen or reading for long periods of time has become a positive irritation. Because I'm cheap and in denial, I picked up a pair of $10 reading glasses at the local pharmacy. While ill-fitting and ugly, these glasses do seem to help somewhat. So at some point, I'm just going to have to suck it up and get fitted for a pair of Real Glasses ().</p><p>Damn you, <a href="http://www.talkorigins.org/faqs/thermo/probability.html">second law of thermodynamics</a>!</p> jjohn 2005-04-28T19:52:06+00:00 journal Would I might rouse the lincoln in you all http://use.perl.org/~jjohn/journal/24363?from=rss <blockquote><div><p>&laquo;It is our mission to preserve the legacy of Abraham and Mary Lincoln, to honor their words and works, and walk in their footsteps. More than 300 Lincoln books have been distributed to our members. Twenty-four Lincolns have received awards for their noteworthy Lincoln work, and seven Lincolns have written books about the 16th President.;&raquo;</p></div> </blockquote><p>--<a href="http://www.lincolnpresenters.org/">The Association of Lincoln Presenters</a>: rousing the Lincoln in all of us since 1990 (take THAT viagra!). </p><p>Incidently in the future United North America, money will be counted in "lincolns" rather than "dollars." Go Yankees!</p> jjohn 2005-04-25T16:12:14+00:00 journal I want M.C. Peepants http://use.perl.org/~jjohn/journal/24344?from=rss I mean, <a href="http://www.adultswim.com/misc/downloads/audio/athf/iwantcandy.mp3">I want candy</a>. jjohn 2005-04-24T04:52:38+00:00 journal XMLHttpRequest and cross-scripting hyjinx http://use.perl.org/~jjohn/journal/24262?from=rss <p>This is a quick note to myself, but perhaps others tortured with javascript will appreciate it. It is possible to make HTTP requests in javascript (with modern browsers). This takes the form of the <a href="http://developer.apple.com/internet/webcontent/xmlhttpreq.html">XMLHttpRequest object</a>. How you get to that object is somewhat <a href="http://jibbering.com/2002/4/httprequest.html">system-dependent</a>. </p><p>Once you have that object, your Mozilla browser may restrict you in the URLs you can fetch. In particular, you can only open() URLs from the same host that you fetched the page making the request. So a page on geocities.yahoo.com isn't going to open "http://google.com" but instead emit an exception that will be reported in the js console. </p><p>Code hounds will enjoy this mess that reports the content of a page as a JS alert. The getURL() function expects to be passed in a URL (weird) and uses that crazy JS compiler directive voodoo that make IE happy.</p><blockquote><div><p> <tt>function getURL(u) {<br>&nbsp;<nobr> <wbr></nobr>// from http://jibbering.com/2002/4/httprequest.html<br>&nbsp; var xmlhttp=false;<br>&nbsp;<nobr> <wbr></nobr>/*@cc_on @*/<br>&nbsp;<nobr> <wbr></nobr>/*@if (@_jscript_version &gt;= 5)<br>&nbsp;<nobr> <wbr></nobr>// JScript gives us Conditional compilation, we can cope with old IE versions.<br>&nbsp;<nobr> <wbr></nobr>// and security blocked creation of the objects.<br>&nbsp; try {<br>&nbsp; &nbsp; xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");<br>&nbsp; } catch (e) {<br>&nbsp; &nbsp; &nbsp;try {<br>&nbsp; &nbsp; &nbsp; &nbsp;xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");<br>&nbsp; &nbsp; &nbsp;} catch (e) {<br>&nbsp; &nbsp; &nbsp; &nbsp;xmlhttp = false;<br>&nbsp; &nbsp; &nbsp;}<br>&nbsp; }<br>&nbsp; @end @*/<br> <br>&nbsp; if (!xmlhttp &amp;&amp; typeof XMLHttpRequest!='undefined') {<br>&nbsp; &nbsp; xmlhttp = new XMLHttpRequest();<br>&nbsp; }<br> <br>&nbsp; alert("Opening " + u);<br>&nbsp; try {<br>&nbsp; &nbsp; &nbsp;xmlhttp.open("GET", u, true);<br>&nbsp; } catch (e) {<br>&nbsp; &nbsp; &nbsp;alert("Oops " + e);<br>&nbsp; &nbsp; &nbsp;return false;<br>&nbsp; }<br>&nbsp;<nobr> <wbr></nobr>// prepare the call back (weird to do this after open)<br>&nbsp; xmlhttp.onreadystatechange=function() {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<nobr> <wbr></nobr>// page load done<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (xmlhttp.readyState==4) {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; alert("Got: " + xmlhttp.responseText);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br> xmlhttp.send(null)<br> <br>}</tt></p></div> </blockquote> jjohn 2005-04-18T18:32:38+00:00 journal 24 miles http://use.perl.org/~jjohn/journal/24213?from=rss Biked 24 miles today from Boston to Waltham (and back) along Trapelo Rd., which apparently is Italian for "too many f*cking hills." Also found out that the town of Belmont, through which I passed, was not just a pretty French word, but also descriptive of the terrain. Well, the <em>mont</em> was applicable anyway... jjohn 2005-04-15T22:40:29+00:00 journal it took a tough man to make a tender chicken... http://use.perl.org/~jjohn/journal/24080?from=rss Among the other celebrities passing away this fortnight is American icon <a href="http://hosted.ap.org/dynamic/stories/O/OBIT_PERDUE?SITE=CADIU&amp;SECTION=HOME">Frank Perdue</a>. Although his son attempts to maintain "the face" of the corporation, somehow his father seem to humanize the company in a way that few can these days. Perhaps it helped the Frank Perdue's mug had not a passing resemblence to a chicken? <p>Perhaps it will become trendy to wear t-shirts with Frank Perdue's outsized head on it. That would be counterculturific!</p> jjohn 2005-04-08T20:37:02+00:00 journal Sin City http://use.perl.org/~jjohn/journal/24014?from=rss Good Lord, what a movie. I feel like Frank Miller really tuned me up. It only hurts when I laugh. jjohn 2005-04-04T22:52:11+00:00 journal just because Jesus did it, doesn't mean you can http://use.perl.org/~jjohn/journal/23805?from=rss <p>Here comes that screamin' sound again! <a href="http://www.elacson.com/images/collections/panata/index.html">Crusification</a> ain't no fiction in the Philippines. One gets that feeling that allusion and metaphor may be lost on folks such as these.</p> jjohn 2005-03-23T13:30:17+00:00 journal Blame Turkey http://use.perl.org/~jjohn/journal/23768?from=rss <blockquote><div><p>&laquo;The US Defence Secretary, Donald Rumsfeld, has blamed the inability to gain permission to invade Iraq through Turkey for the power of the insurgency that the US now faces. </p><p>Mr Rumsfeld said in television appearances marking the second anniversary of the invasion that Iraqi military and intelligence forces in the north of the country melted away to form the insurgency that is now battling US and Iraqi troops. </p><p>At least 1520 members of the US military have died since the beginning of the Iraq war, according to an Associated Press count. &raquo;</p></div> </blockquote><p>--<a href="http://www.smh.com.au/news/After-Saddam/US-blames-Turkey-for-Iraq-chaos/2005/03/21/1111253960989.html?oneclick=true">US blames Turkey for Iraq chaos</a> </p><p>Ok everybody! In the key of E, let's all sing it together:</p><blockquote><div><p> <tt>Blame Turkey, man!<br>Blame Turkey, man!<br>With their shaky parliament<br>and their queer imprisonment<br> <br>Blame Turkey, man!<br>Blame Turkey, man!<br>'Cause Ataturk was drunk.<br>the Republic almost sunk.<br> <br>Blame Turkey, man!<br>Blame Turkey, man!<br>their coffee tastes too strong<br>and elections take too long<br> <br>Blame Turkey, man!<br>Shame on Turkey, man!<br> <br>In line they must fall<br>or the EU just might stall<br>and listen to the Kurds<br>who say the Turks are turds<br> <br>We must blame them and cause a fuss<br>before someone thinks of blame us!</tt></p></div> </blockquote> jjohn 2005-03-21T14:25:55+00:00 journal broiled yeti penis http://use.perl.org/~jjohn/journal/23729?from=rss Oh wait, I mean <a href="http://www.lileks.com/institute/gallery/bananas/2.html">festive banana desert</a>. jjohn 2005-03-19T01:07:26+00:00 journal Our main weapon is surprise... http://use.perl.org/~jjohn/journal/23668?from=rss <blockquote><div><p>&laquo;The archbishop told Il Giornale: "The book is everywhere. There is a very real risk that many people who read it will believe that the fables it contains are true."&raquo;</p></div> </blockquote><p>--<a href="http://news.bbc.co.uk/2/hi/entertainment/4350625.stm">Church fights Da Vinci Code novel</a> </p><p>For a minute there, I though he was talking about the Bible! Of course, he was talking about something <a href="http://use.perl.org/~jjohn/journal/22600">much worse</a>.</p> jjohn 2005-03-16T00:45:27+00:00 journal