djberg96's Journal djberg96'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:03+00:00 pudge Technology hourly 1 1970-01-01T00:00+00:00 djberg96's Journal Goodbye Perl World I've decided to move my journal over <a href="">here</a>. <p>I've also got one one at (look for djberg96). I haven't decided which one I like best. </p><p> So long, and thanks for all the fish.</p> djberg96 2004-12-29T00:47:29+00:00 journal Path name survey "A path name is-a String". <p> True or false? </p><p> I say "true", but I seem to be in the minority. Most folks seem not to be able to conceptually separate the *name* from the physical node on the disk.</p> djberg96 2004-12-13T16:04:29+00:00 journal Environmental Rant I hate our politicians. You can read an article like <a href=",1413,36~11676~2589712,00.html">this</a>, and many more like it, and it makes you want to run right out and blow up a dirty coal burning power plant. <p> The problem I have with our politicians, especially the Republicans, is they're always claiming there's not enough proof, or that we're in a natural warming cycle. BULLSHIT. In addition to numerous studies, there are the things we can SEE WITH OUR OWN EYES, as in the article above. </p><p> The problem with this "let's wait until there's more proof" mentality is this - by the time there's absolute proof, it will be too late. It means we're already fucked. </p><p> HOW ABOUT SOME FUCKING PREVENTATIVE MEASURES YOU ASSHOLES? STOP CATERING TO COAL AND BIG OIL. </p><p> Let's also keep in the mind, my non-US friends, that while we're the worst offenders overall, we're not the only offenders. Russia is not far behind and China is working its way up. </p><p> Just sign the frickin Kyoto Protocol and deal with it.</p> djberg96 2004-12-10T23:38:54+00:00 journal $CPPFLAGS for Win32 My hardcore dive into the Win32 API has revealed <a href="">something interesting</a>. It turns out that certain functions are only available based on the value of the certain macros. So, on my XP Pro box for example, the AttachConsole() function is not available unless _WIN32_WINNT is set to 0x0501 or greater first (either in the Makefile or within the source). <p> This is a pain now for extension writers on Win32, and will become crucial later, when 64 bit Windows becomes more popular. We *could* all just write a simple WIN32::API script within our Makefiles to get the major and minor version of Windows and set the value accordingly. The *better* option would be to have MakeMaker automatically set this value for me so I don't have to. </p><p> I haven't checked for certain, but I don't *think* Perl's ExtUtils::MakeMaker does this (nor does Ruby's mkmf). Time to submit a patch.<nobr> <wbr></nobr>:)</p> djberg96 2004-12-10T20:58:42+00:00 journal Dynamic Java What's <a href="">this</a>? Larry and Guido standing next to each calmly? Inconceivable! <p> Hmm...Matz wasn't there, though. Travel may have been problematic.</p> djberg96 2004-12-09T19:03:03+00:00 journal Protect your jewels The family jewels, that is, men. Be careful where you <a href="">put that laptop</a>! djberg96 2004-12-09T13:47:25+00:00 journal Google Groups The new interface sucks. Please give me back the old interface! djberg96 2004-12-07T15:47:35+00:00 journal SIGINT on Windows I've been working on some C code to send a Ctrl-C to a Windows console process. Consider the following code snippet:<blockquote><div><p> <tt>$SIG{INT} = sub{ die "Caught signal\n" };<br> <br>print "PID: $$\n";<br> <br>while(1){<br>&nbsp; &nbsp;print "Looping\n";<br>&nbsp; &nbsp;sleep(5);<br>}</tt></p></div> </blockquote><p>If you run this in a terminal, and hit Ctrl-C, the sig handler will (eventually) pick it up and terminate. But, if you were to run that and then, in a separate program, try to do "kill(2,$pid) or die $!" it won't work. It's going to return "invalid parameter". What's going on? </p><p> The problem is in the way the GenerateConsoleCtrlEvent() works. In short, you can't kill a remote console process like that. So, I've been researching the hell out of this trying to figure out how it can be done. I'm pretty sure it CAN be done, but it's been rough going so far. </p><p> My research leads me to believe that this can be accomplished with something along the lines of this abbreviated code:</p><blockquote><div><p> <tt>GetModuleHandle("Kernel32.dll")<br>OpenProcess(pid)<br>VirtualAllocEx()<br>WriteProce<nobr>s<wbr></nobr> sMemory()<br>CreateRemoteThread()<br>WaitForSingleObject()</tt></p></div> </blockquote><p>But, so far all I've been able to do is kill the process, while causing an Application Error in perl.exe itself. So, I'm doing something wrong but I don't know what. I've posted my problem on one of the windows newsgroups. We'll see what happens. </p><p> PS - I have no idea why there's a space showing up in "WriteProcessMemory" above. It's not that way in my text. </p><p> <b>update</b>: I have been told that the latter approach still won't work. It *might* be possible with AttachConsole(), but that would XP or later only. We shall see.</p> djberg96 2004-12-05T02:09:00+00:00 journal More reasons baseball is dead Yet <a href="">more evidence</a> baseball is dead. What a joke. MLB is a fucking disgrace, and so are its players. <p> <b>Update:</b> It looks like John McCain is <a href="">getting involved</a>. Man, if only McCain would have won the 2000 primary. Him and Feingold are my two favorite senators.</p> djberg96 2004-12-02T23:34:53+00:00 journal Boo! Yet another programming language for you - <a href="">Boo</a>. <p> This one has some nice ideas. I especially like the idea of optional static typing, a good way to get (potential) compiler optimization and shut up both sides of the "static vs dynamic" war forever. There are some ideas borrowed from Ruby, Lisp and Smalltalk it looks like. I also like the fact that he uses a leading underscore (as opposed to Ruby's '@') for instance attributes. It's the little things that count.<nobr> <wbr></nobr>:) </p><p> Some things I'm not sure what to make of yet, such as an actual "duck" type, or syntactic macros. </p><p> The biggest problem I have with it is the syntax (including SSW). It's the bastard child of Python and C#, and looks downright ugly in some places, especially the syntactic attributes. Then there's the whole CLI tie-in...</p> djberg96 2004-11-30T20:36:06+00:00 journal Gmail borked Are gmail accounts still working? I can't log into mine. It lets me reset my password....but still won't let me in. <p> Lame.</p> djberg96 2004-11-29T13:45:08+00:00 journal Le Guin They didn't have <i>The Lathe of Heaven</i> at the bookstore, so I picked up <i>The Left Hand of Darkness</i> instead. <p> So far, so good.<nobr> <wbr></nobr>:)</p> djberg96 2004-11-28T13:00:39+00:00 journal Set::String hijacked It seems that "Tels" has hijacked Set::String for the moment. Nope, I never gave it up. I tried emailing the guy, but he won't accept emails without jumping through some gpg hoops. I'm not going to jump through his hoops (especially since I don't have it on my windows box). <p> Instead I've applied for registration of Set::String, Set::Array, and Set::Hash. I also attempted to re-upload Set::String 0.03, but I'm not sure if it worked. </p><p> Goddammit.</p> djberg96 2004-11-27T19:07:42+00:00 journal People who are not funny <ul> <li>Jerry Seinfeld</li></ul><p> Average standup comedian before he got his own show. The real stars of the television show were the characters Kramer, George and several of the side characters, especially Newman. Seinfeld himself (and Elaine) are not all that funny. I also suspect that Larry David was the real creative genius behind this show. </p><ul> <li>David Letterman</li></ul><p> I tried. I really tried to get into Letterman. I remember watching him almost every night for about six months while I was in grad school. I learned that he is not only not funny, he is also an egomaniac in love with the sound of his own voice. It is often clear that he is not the least bit interested in what his guests have to say. I got the strong impression that his popularity originally stemmed from being some sort of anti-Carson, the underdog. It became "cool" to like Letterman. </p><ul> <li>Kevin James</li></ul><p> Another mediocre standup comedian who managed to get his own show. Only, the show is only about half as funny as Seinfeld. </p><ul> <li>Andy Kaufmann</li></ul><p> Was never funny. Proof that people will watch whatever you throw in front of them. Yes, I understood what he was trying to do. No, it wasn't funny, or even all that clever.</p> djberg96 2004-11-26T14:38:47+00:00 journal The Lathe of Heaven What if your dreams became reality? <p> I saw the original version of this movie when I was a little kid. I was very intrigued by it, but I haven't seen it in ages. I was at the video store yesterday and I noticed that there was a remake from 2002, with James Caan and Lisa Bonet. So, I rented it.<nobr> <wbr></nobr>:) </p><p> I thought this version was interesting, but not quite as gripping as the original version. Whether or not that is due only to age difference, I'm not sure. </p><p> Anyway, I think I need to buy the book.<nobr> <wbr></nobr>:)</p> djberg96 2004-11-24T16:23:59+00:00 journal No Heat The furnace died last night - the blower won't kick in or something. There might be a thermostat issue as well. Good thing I had an extra blanket. <p> In addition, the gas fireplace is currently unusable. It seems the builders put batteries in. You're not supposed to do that unless you absolutely need to (i.e. your power goes out in the dead of winter and you need a way to start the igniter in your fireplace). The result is that one of the batteries exploded (well, leaked) and now there's some battery acid that needs to be cleaned up. Since they didn't tell me that they had put batteries in, it's going to be them that cleans the damn thing up. </p><p> I also have a security interview today (on behalf of someone else). Hope she dresses warmly. </p><p><nobr> <wbr></nobr>/me uses the oven as a furnace for the day. </p><p> <b>Update: </b>The igniter went bad. Fixed.</p> djberg96 2004-11-23T15:31:23+00:00 journal Language Oriented Programming Could <a href="">this</a> be the next programming paradigm? <p><nobr> <wbr></nobr>/me needs to read this over a couple times</p> djberg96 2004-11-22T19:37:24+00:00 journal Loin Movers We've had "Story Tellers" and "Adrenaline Pumpers". How about songs that put you in the mood? Or, songs that you listen too while you're already IN the mood?<nobr> <wbr></nobr>;) <ul> <li>Trip Like I Do - Crystal Method</li> <li>Burn - Sister Machine Gun (Mortal Combat)</li> <li>Closer - Nine Inch Nails</li> <li>Into the Void - Nine Inch Nails</li> <li>Justify My Love - Madonna</li> <li>The Orgy - Basil Poledouris (Conan the Barbarian)</li> <li>Play With Me - Thompson Twins (Cool World)</li> <li>Industry and Seduction - Tom Bailey (Cool World)</li> <li>Principles of Lust - Enigma</li> </ul><p> And your favorites? I'm guessing there must be some Marvin Gaye and Barry White fans out there.<nobr> <wbr></nobr>:) </p><p><nobr> <wbr></nobr>/me cues the Barry White music</p> djberg96 2004-11-19T17:01:42+00:00 journal Win32 and case sensitivity Who says the Windows filesystem isn't case sensitive? Courtesy of the FILE_FLAG_POSIX_SEMANTICS flag:<blockquote><div><p> <tt>C:\&gt;dir pos*<br> Volume in drive C has no label.<br> Volume Serial Number is 5C18-0618<br> <br> Directory of C:\<br> <br>11/18/2004&nbsp; 09:44p&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;8 Posix1.txt<br>11/18/2004&nbsp; 09:31p&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0 posix1.txt<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;2 File(s)&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 8 bytes<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0 Dir(s)&nbsp; 87,451,049,984 bytes free</tt></p></div> </blockquote><p>I'm not sure what's happening behind the scenes, because if I open 'posix1.txt', it has the same data as 'Posix1.txt', even though the dir command shows it as having 0 bytes. Hard link? </p><p> Kooky.</p> djberg96 2004-11-19T04:47:05+00:00 journal Trek Fans and Cheeseheads From Roger Nygard's Slashdot interview:<blockquote><div><p>I'll wager that the average IQ of the guy wearing cheese on his head and screaming obscenities at a referee and the average Star Trek fan leave no comparison. It would be like shooting fish in a barrel.</p></div></blockquote><p> Oh, yeah? Well, what if I'm a Trek fan AND I happen to wear a cheesehead? Huh? HUH? </p><p><nobr> <wbr></nobr>/me puts some tinfoil on his cheesehead</p> djberg96 2004-11-18T20:23:53+00:00 journal Adrenaline Pumpers While intelligent music is great, sometimes I just want to listen to something that gets the blood flowing in the morning. Here are some (of many) that do it for me: <ul> <li>Shoot to Thrill - AC/DC</li> <li>Kickstart Your Heart - Motley Crue</li> <li>Back in the Saddle - Aerosmith</li> <li>Fight for Your Right to Party - Beastie Boys</li> <li>Lit Up - Buckcherry</li> </ul><p> Got any favorites?</p> djberg96 2004-11-18T14:52:58+00:00 journal Storytellers I find that I tend to really songs that tell some sort of story, usually from a first person point of view. For example, Kate Bush's <i>Experiment IV</i> tells the story of the construction of a sound based weapon that goes awry. One of my favorite Genesis tunes is <i>Home by the Sea</i>, the story of a thief who breaks into a house, only to discover too late that it's haunted and that he will now be a permanent member. Genesis tends to have many 'storyteller' style songs. From the Rolling Stones we get <i>Sympathy for the Devil</i>. <p> Are there any good ones out there I'm missing?</p> djberg96 2004-11-16T17:16:35+00:00 journal The kstat konundrum I recently discovered, I think, that kstat on my Solaris 9 box is broken. Specifically, it appears that the data returned from 'kstat -m cpu_stat' is wrong. I posted a <a href=";lr=&amp;c2coff=1&amp;;rnum=3&amp;prev=/groups%3Fhl%3Den%26lr%3D%26c2coff%3D1%26q%3Dkstat%2Bberger%26btnG%3DSearch%26meta%3Dgroup%253Dcomp.unix.solaris">specific example</a> comparing the kstat command line results with the results of using kstat.h directly. Since the snarky folks on comp.unix.solaris will usually jump all over anyone who incorrectly yells "bug!", I found the complete lack of any response to be disquieting. <p> I double checked sunsolve to make sure there weren't any patches I missed but I didn't see anything. I would take a look at the source, but it isn't available afaict. The Solaris::Kstat module you'll find on CPAN is for 2.7 and earlier. I once sent an email to Alan for the source but never heard back. </p><p> I'd also love to know how he was able to build his source using the mntinfo_kstat struct, since the header file in which it's defined, nfs/nfs_clnt.h, appears to be busted.</p> djberg96 2004-11-15T17:02:19+00:00 journal Incredible I saw <i>The Incredibles</i> this weekend. Awesome flick. Thumbs way up. <p> Note to parents - this movie is rated PG, not G. It gets a little violent near the end.</p> djberg96 2004-11-15T04:52:15+00:00 journal SMC Stuff I was getting behind on patches for my Solaris box again, so I decided to download Sun's latest and greatest patch manager. It runs its own little webserver, and provides a nice little web interface for a list of patches that your system needs, importance level, description, etc. <p> It was pretty cool until it mysteriously stopped working after I installed one of the patches. It allows me to login but then gives me authentication errors. </p><p> Well, fuck it. I went back to ye ol' trusty command line interface. A simple "smpatch update" works wonders. Well, ok, I had to download some and then install them from my local drive in single user mode, but even that wasn't too painful. </p><p> &gt;smpatch analyze </p><p> No patches required. </p><p> Beautius.</p> djberg96 2004-11-12T19:21:05+00:00 journal A Moron Shall Come to Pass This one is for all the Bush haters out there.<nobr> <wbr></nobr>:)<blockquote><div><p>When a candidate for public office faces the voters he does not face men of sense; he faces a mob of men whose chief distinguishing mark is that they are quite incapable of weighing ideas, or even of comprehending any save the most elemental---men whose whole thinking is done in terms of emotion, and whose dominant emotion is dread of what they cannot understand. So confronted, the candidate must either bark with the pack, or count himself lost. His one aim is to disarm suspicion, to arouse confidence in his orthodoxy, to avoid challenge. If he is a man of convictions, of enthusiasm, or self-respect, it is cruelly hard... </p><p> The larger the mob, the harder the test. In small areas, before small electorates, a first rate man occasionally fights his way through, carrying even a mob with him by the force of his personality. But when the field is nationwide, and the fight must be waged chiefly at second or third hand, and the force of personality cannot so readily make itself felt, then all the odds are on the man who is, intrinsically the most devious and mediocre -- the man who can most adeptly disperse the notion that his mind is a virtual vacuum. The Presidency tends, year by year, to go to such men. As democracy is perfected, the office represents, more and more closely, the inner soul of the people. We move toward a lofty ideal. On some great and glorious day the plain folks of the land will reach their hearts desire at last, and the White House will be adorned by a downright moron.</p></div> </blockquote><p> --H.L. Mencken, The Baltimore Evening Sun, July 26, 1920</p> djberg96 2004-11-11T22:43:28+00:00 journal C coding style change In the past, including the very recent past, I have always used brackets for my C "if-else" conditions, even if there was only a single line within the if clause.<blockquote><div><p> <tt>if(some_condition){<br>&nbsp; &nbsp;printf("Whatever\n");<br>}</tt></p></div> </blockquote><p>I guess it was just a combination of paranoia, preference, and anticipation of adding additional code within the if condition that led me to code this way. </p><p> I've had a change of heart. This morning. At 10:12 am to be precise. Suddenly, it just started to annoy the crap out of me. I realize I have to pay a little extra attention to detail by omitting the brackets, but I suddenly like the 'no-bracket' style better.</p><blockquote><div><p> <tt>if(some_condition)<br>&nbsp; &nbsp;printf("Whatever\n");</tt></p></div> </blockquote><p><nobr> <wbr></nobr>/me shrugs</p> djberg96 2004-11-11T17:17:06+00:00 journal Dependency Injection and Web Frameworks Here's a <a href=""> nice writeup</a> from Jamis Buck using dependency injection (<a href="">Needle</a>) and a web framework (<a href="">Rails</a>). djberg96 2004-11-10T19:15:35+00:00 journal Friday Trivia #44 It's Friday Trivia Time! A bit late in the evening, which may be a bit unfair to our European friends, but hey, it's Friday. Perhaps some are up late. <p> For 50 Trivia Points, who coined the term "virtual reality". Hint - he was at this year's OOPSLA. No Google. </p><p> For an additional 200 Trivia Points, what is the name of his band? It's only 25 Trivia Points if you use Google. </p><p> Good luck! </p><p> PS - I just read the person's demo, and now I feel like an insignificant little bug. Good grief. </p><p> <b>Update: </b>dws got the first question and barbie got the second question. 50 Trivia Points for dws, and 25 for barbie! </p><p> The answers were "Jaron Lanier" and "Chromatophoria".</p> djberg96 2004-11-06T01:28:43+00:00 journal Today's Rant No, today's rant is not about Solaris, Java, Iraq or the Presidential election. Today's rant is about the gym. <p> Specifically, old men at the gym. I'm sick and tired of these 60+ men walking around naked in the locker room. For fuck's sake, you are old and fat. You are not hot. Not even close. Do you really think you're impressing the other guys in the locker room? You're gross. Ick. </p><p> You have no chance with that twenty-something you've been creepily staring at. And don't think you're fooling anybody by sitting in the jacuzi all damned day (which accomplishes nothing, by the way). We know you're only there to stare at the women. </p><p> And that speedo (and yes, I have seen guys wearing them) is just wrong dude. Give it up. </p><p> Other amusing tidbits - sorority girls who wear their letters on their ass, people who talk on cellphones while 'working out' and, of course, the posers.</p> djberg96 2004-11-04T14:57:20+00:00 journal