no sars, please

March 31, 2003 under Life

Don’t wanna get the SARS.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)
comments: 0 »

pickin' on php

March 20, 2003 under Computers, Programming

To quote Dennis Miller, “I don’t want to get off on a rant here…”

But I have to. Earlier in the week, Barry asked me for help with project he’s undertaken at work. I don’t know the entire scoop, but in my summation it’s a web-based scheduling app. He’s using XML to store the scheduling data and PHP to manipulate it. He asked me to help him exploit some of expat‘s XML-parsing abilities with PHP. Now this week for me has been hectic to say the least. I had never used expat before and I wasn’t about to learn about it during this crazy week. Since Barry was hung up on a search-and-replace feature, I figured I’ll use what I already know. Eventually, Dreamcatcher Interactive themselves said they’d pay me to develop this script. Paid? About damn time. I be poor. Anywho, my complaint is with PHP and most web languages in general; sepcifically the likes of PHP and JavaScript. In this case, PHP is in my crosshairs. Most solid modern programming languages contain at least one function or method that can be used to find substrings within a string. Perl has index(), Visual Basic has InStr() and Java has indexOf(). C++ prvides you with choices o’ plenty. If you go the MFC route, the CString class has the Find() function. If you take the STL path instead, you have the like-named find() function as well. What do all of these have in common? If the substring is not contained in the string, they return -1 (except for STL’s find(), which returns the unsigned integer string::npos). Now with PHP, I planned to use a function called strpos(), which should return the index within a string that a substring is found. So if the substring begins at the beginning of string, that would be in position 0. But strpos() returns false if the substring isn’t found, which is also 0. Hmmm. Why? Bad desgin, IMHO. stristr() took care of that.

I am addicted. I must listen to Idlewild’s‘s “The Remote Part” and The New Folk Implosion album. It’s like I’m back in highschool when I had to listen to any given album.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)
comments: 0 »

code and politics don't mix

March 18, 2003 under Computers, Politics, Programming

Winds of change. Times, they are a changin’. Yada yada. Did a good DoD wipe of the ol’ hard drives recently and switched things up a bit. Normally, I keep shortcuts of my most often used apps on the desktop and in the quick launch area I keep IE, OE, Windows Explorer and “Show Desktop”. I’ve done this since Windows 95. Out with the old and in with the nucleus. Takin’ a cue from old skool MacOS, here are my new desktops; home and work.

Here’s something that came up at work. If you need to save off a shitload of attachments from emails in a given folder of Microsoft Outlook (not Outlook Express), you can use this Visual Basic macro that I wrote (and thoroughly commented) in under 10 minutes:

Option Explicit
 
' Contants
Public Const LOCAL_FOLDER As String = "C:\My Attachments\"
 
' Purpose: Save off attachments in an Outlook/Exchange folder
'          to an already-existing local folder.
Sub save_attachments_locally()
   Dim objOutlook, objNameSpace, objMailItem, objAttachment, _
          objFolder As Object
   Dim nI, nJ As Integer
   Dim strLocalFolder As String
 
   ' init Outlook objects
   Set objOutlook = Application
   Set objNameSpace = objOutlook.GetNamespace("MAPI")
   Set objFolder = objOutlook.ActiveExplorer.CurrentFolder
 
   ' loop through all of the objects in the selected folder
   For nI = 1 To objFolder.Items.Count
      ' grab the current item in the loop
      Set objMailItem = objFolder.Items.Item(nI)
      ' loop through all of the attachments of the current item
      For nJ = 1 To objMailItem.Attachments.Count
         ' grab each mail attachment
         Set objAttachment = objMailItem.Attachments
         ' save each mail attachment to the local folder
         objAttachment.Item(nJ).SaveAsFile _
            LOCAL_FOLDER & objAttachment.Item(nJ).DisplayName
      Next nJ
   Next nI
 
   ' all done ;)
   MsgBox "Files have been saved locally in: " & LOCAL_FOLDER
End Sub

I’d add more to it, like the ability to choose the destination folder, remove the saved attachments from their repsective email, etc… but I didn’t have time. Hey, it’s open source. You can add to it! 😀

So it looks like there’ll be a war. Like I’ve told Pat before, I don’t offer opinions on this. I’m just a guy that makes a living developing software and web sites. I’ve never ran a country before. I’ve never had a job in world politics, or any level of politics for that matter. War or peace? I dunno. My opinion on this won’t hold much water. To paraphrase the late Phil Hartman (who tought us that charming Canadian men should not wed psychotic American women) as his character in the Frozen Caveman Lawyer skits from SNL

“I’m just a simple software developer. Your world politics and foreign policies frighten and confuse me.”

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)
comments: 0 »

my dad always said i'd end up on baffin island

March 13, 2003 under Life

I’m the go-to man. I solve all I can. Lesser people have ran, but not me. I’m the answer man.

So there’s a change a comin’. The weather is supposed to warm up. This means that the snow will melt, the days will be inundated with more sunlight and temperatures can only get warmer. Anybody know if there are good software dev gigs up on Baffin Island?

Something’s heating up that I can enjoy, though. The NHL‘s trading deadline has come and gone. A few teams improved somewhat, but at this moment (and it could change) I’m thinking that Van City is the team to ph34r. Just a hunch.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)
comments: 0 »

gasasaurus reprise

March 3, 2003 under Life

So March has rolled around and not much new to report. You can find me toiling away in the calm before the storm. OpenGL, Steve McConnell, Lou Barlow, Web work and dealing the code quest barrage that is Barry.

I’m glad ya’ll enjoyed The Wrath of Gasasaurus. For those that couldn’t view it, join the rest of us and get yourself the latest version of the Flash player. For those who could view it, I hope the nightmares have stopped. Should there be a sequal, know that it will be even more frightening. It would be perfect if the running time was around the 38 minute mark so that The Cure‘s The Top would synch up perfectly for some bone-chilling madness. 38 minutes would make it a big download though.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)
comments: 0 »