Retro: Nice rig, man

Sometimes my own idiocy amazes me. A week or so ago, I took the boys to Rick’s Bakery (best sausage rolls and donuts on the planet, but bad website – horribly broken in Chrome). As we were leaving and getting into the wife’s Armada, I heard the guy next to me, who was also getting into his car, say:

“Nice rig, man”

My back was turned when he spoke, so I turned around and said:

“Thanks, it’s my wife’s”

It was then I realized he was not talking to me, but to the burly, ZZ Top bearded biker on a Harley parked on the other side of him. They both looked at me like I was an idiot, which apparently I am. Best part: our eight year old son saw it all go down and fully realized what had happened. Not that he doesn’t already think I’m an idiot, right?

Poetry from a four year old

The other day while driving down the road and admiring the wildflowers that are blooming all over The Woodlands, Harri came up with this little nugget:

Roses are red, bluebonnets are blue, and your feet stink too.

My Google Voice invite arrived!

Last night I got my Google Voice invite that I’ve been ever so patiently waiting for, and man is it slick. Setup took about 10 minutes total, and my first test of their transcriber went like so:

Which was transcribed to:

Hey moron. Let’s see how good Google Voice. Transport sincere garbage that you’re leaving on their share voicemail. Later.

Hmmm…hopefully Google’s transcribers will improve over time, eh? After all, that’s the reason they are doing this, right?

Fishing with the boys

Will's first largemouth bass

Will's first largemouth bass

This is what it’s all about folks, the picture pretty much tells it all. I took the boys fishing today for the first time in a while, and they slayed ‘em. They each caught at least ten bluegills and four small box turtles. Will caught his first largemouth bass, and a nice one at that, about a pound, 11 inches or so.

A great trip indeed.

Wanna see me naked?

Last Thursday night. In San Diego. After the Padres game. On the corner of 4th and Market. A buddy from work (who shall remain nameless) and I are heading back to our hotels from Rock Bottom Brewery (excellent beer), and we are approached by a girl that can’t be more than 20 years old:

Girl:
Hey guys, wanna see me naked?
Me:
What the &$#@?
Buddy:
Right here?
Girl:
No, you’ll have to come back to the room.
Buddy:
Aw hell no, forget it then.

HILARIOUS. I laughed for 15 minutes.

San Diego, here I come!

I’m heading out in a few hours to San Diego for the ESRI User Conference. I’m really looking forward to the conference, tons of GIS stuff, seeing some old buddies, enjoying the weather (damn, it’s hot in Houston this summer), and last but not least, getting some In-N-Out.

Ripping recorded video from a Cox DVR on OS X

Sometimes some of the most entertaining TV you’ll see can come from your local news – especially if you live in Arkansas it seems. And so was the case last Tuesday night. But more about that later. First let’s talk about getting the recorded program off of the DVR so we share it with the world, as was my mission this morning weekend. After much Googling and forum reading, this is what I found out. We have a Motorola DCT6412 III that we rent from the Cox cartel. After alot of reading on the forums at http://www.avsforums.com (especially this thread), it looked like I was out of luck on getting the recorded news clip off of the DVR and onto my Mac. Then I found this thread which laid out the plan that eventually worked. I’m putting everything I gleaned from the AVS Forums here so maybe someone else can use it and so I can remember just how I did it in the first place. Here’s what you need:

  1. The Apple FireWire SDK for OSX (version 26 as of this writing), a quick and easy install – FREE.
  2. VLC Viewer to view the stream and transcode it to another more usable format (such as MPEG-4) if you want – FREE.
  3. A FireWire 400 cable to connect your Mac to the DVR – NOT FREE, but I had one lying around.

And here are some other things you may need:

  1. HandBrake (which you should have anyway, regardless of  your platform – it’s great for ripping movies from DVD to mpeg-4 – FREE.
  2. IMovie HD – I had to use this to ultimately clip out just the part of the newscast that I wanted – comes with your Mac.

First, connect the FireWire cable to your Mac (I had both the Mac and DVR powered up, others talked about powering then down first). Fire up AVCVideoCap.app in the FireWire SDK at /Developer/FireWireSDK26/Applications and get it set and ready to record, but don’t start the recording yet. From your DVR, bring up the previously recorded program, and if you can, rewind to a minute or so before where you want to transfer, then pause the DVR. Now plug the FireWire cable into your DVR, and the program should start back up on your TV. Now start recording in AVCVideoCap, which will apparently “pause” the playback on your TV. Hit the play button on your DVR remote, which will “unpause” the playback on the DVR and output both video and audio to the .m2t filestream in AVCVideoCap. Note that when you hit play, it will not unpause what you see, just what gets output, so your TV is essentially unwatchable while transferring the video.

AVCVideoCap captures the video from the DVR to a .m2t filestream, which is basically MPEG-2. Out of the box QuickTime and IMovie don’t like m2t streams, but VLC Player does. VLC will play the m2t and you can export to mp4 (MPEG-4), which pretty much any video player will like. However, I had lots of problems in VLC just trying to go directly from the m2t stream to a mp4 – the video and audio were all jacked up when I tried that direct export in VLC. I read somewhere to try HandBrake, but it also did not like my m2t stream. After many attempts at different exports, this worked in VLC:

  • Video codec: H.264 / Bitrate: 2048
  • Audio codec:  MPEG Audio / Bitrate 192
  • Encapsulation format: MPEG TS (.ts)

This gave me a .ts stream which HandBrake would now open and convert to a mp4, which I imported into IMovie HD and clipped out just the news story I wanted. I exported from IMovie at Full Quality to mp4, and got a fairly good quality mp4 that I could then upload to YouTube or put on my Ipod. Now, this raises the question, especially with my wife, of “Is all that work, really worth it?” Maybe not. But it got to the point where I knew this could be done and just had to figure it out. Plus I have this little gem now:

Yes, there are still 365 days in a year.

Uploading photos to Shutterfly via Python

I finally got done sorting my 2008 photos this morning so I can start putting Christmas gifts together with them and needed to upload about 280 pictures to Shutterfly, where I have been getting prints since about 1999. Of course I could do this with their uploader, but that would be quite lame now, wouldn’t it, considering I could use Python to do it. Using the code below, the IPTCInfo module and Jeremy Slater’s very cool shutterfly module he wrote for the GNOME Conduit Project , I can iterate through my entire 2008 photo directory, look for my photos tagged for upload, and upload them to a specific album on Shutterfly. Sweet!

  1. from IPTC import IPTCInfo
  2. import sys, os, shutterfly
  3.  
  4. class ShutterflyUploadr:
  5.  
  6. def __init__(self):
  7. pass
  8.  
  9. def grab_new_images( self ):
  10. """ Recurses thru directories and looks for images to upload. I only want to upload my '5-star' images, so we scan the IPTC tags for 'r5', my way of tagging my pics I really like (usually get prints of r5s) """
  11. images = []
  12. for dirpath, dirnames, filenames in os.walk('/users/chad/pictures/2008'):
  13. for f in filenames :
  14. # Grab IPTC keywords
  15. info = IPTCInfo(os.path.join(dirpath, f))
  16. # Is it a 5-star photo?
  17. if 'r5' in info.keywords:
  18. ext = f.lower().split(".")[-1]
  19. if ( ext == "jpg" ):
  20. images.append( os.path.normpath( dirpath + "/" + f ) )
  21. images.sort()
  22. return images
  23.  
  24. def upload( self ):
  25. """ Upload images to Shutterfly """
  26. user = 'your_user_name'
  27. pwd = 'your_password'
  28. sfly = shutterfly.Shutterfly(user,pwd)
  29. # Get an existing album
  30. album = sfly.getAlbums()['Album_Name']
  31. image_list = self.grab_new_images()
  32. for image in image_list:
  33. album.uploadPhoto(image, 'image/jpeg', os.path.basename(image))
  34.  
  35. if __name__ == '__main__':
  36.  
  37. sfu = ShutterflyUploadr()
  38. sfu.upload()

Python and GIS – Beyond ModelBuilder and PythonWin

This is a presentation I gave last February at the ESRI Petroleum User Group conference in Houston, TX. I just discovered SlideShare the other day.

pyArkansas 2008 a huge success

I’m way behind on posting this, but here goes.

The first annual pyArkansas Python conference was held by pyar^2, the Python Artists of Arkansas , on October 4th on the campus of the University of Central Arkansas in Conway. We were very graciously hosted by the Department of Computer Science in their very fine facilities. To our surprise, 57 people attended. Honestly, when Greg Lindstrom and myself starting planning this conference earlier this year, I think we would’ve been shocked to have 25 attend. Our registration numbers actually went above 70 folks, but the weather turned bad that morning, so that might have held some people away. We had a nice mix of beginner and experienced Pythonistas. People came from Branson, MO, Dallas, TX, and all over the state of Arkansas.

In the morning, we had classes including introductory Python (taught by Dr. Chen of UCA ), intermediate Python (taught of Jeff Rush ), and Python for systems administration (taught by Noah Gift ). These classes were very well received. The afternoon consisted of talks on pyGame, text/file processing, One Laptop Per Child (OLPC), Python eggs, the Python standard library, and Python with Eclipse. Elegant Stitches was on hand selling their great assortment of officially-licensed Python shirts and gear (thanks again for the shirt, Janet!). I highly recommend the Python logo long-sleeved easy-care oxford – go order one today.

We had great sponsorship for this event. Major monetary sponsors included the Conway Area Chamber of Commerce , Southwestern Energy Company , Novasys Health , and the Python Software Foundation . Wingware graciously provided THREE 3-OS Wingware IDE Professional seats for us to give as prizes – many thanks for those. O’Reilly publishing gave us a box of about 15 books to give away. Python Magazine and ESRI’s ArcUser both pitched in free issues of magazines for our swag bags.

We have received some pretty good press on the event as well. Overall, I’d have to say that for a first stab and for having 50 people, we pulled it off quite nicely. We are already planning next year’s conference, which will surely be bigger and better than this one was.