I’ve been consolidating my music collection and found that there were lots of duplicate files.
Most of the dupes were named something like “Happy Birthday 1.mp3″ and “Happy Birthday.mp3″ would exist in the same directory. I’m not sure which program added these dupes, but removing 2500 or so of em by hand would not be [...]
Read Full Post »
So I’ve spent a little more time thinking about this and have decided this utility would be better as a server utility that sits out in the cloud and monitors for my computer activity. If it doesn’t see activity for some set period it notifies twitter to re-enable SMS messages.
This takes care of any issues [...]
Read Full Post »
I’ve been moving a bunch of my brothers music out of iTunes for him so he can use it with portable players besides iPod. Unfortunately he encoded a lot of his cd’s in .m4a format. I found a decent utility for converting to mp3 (and other formats) http://www.bonkenc.org/
Unfortunately when you point Bonk at a directory [...]
Read Full Post »
Posted in Code, python, snippet on Apr 4th, 2007 No Comments »
Here’s a nice little function I’ve written to report the number of duplicates in a python list.
from sets import Set
#
def countDuplicatesInList(dupedList):
uniqueSet = Set(item for item in dupedList)
return [(item, dupedList.count(item)) for item in uniqueSet]
#
lst = [’I1′,’I2′,’I1′,’I3′,’I4′,’I4′,’I7′,’I7′,’I7′,’I7′,’I7′]
print countDuplicatesInList(lst)
The Set datatype is an unordered set that doesn’t allow duplicates, so the first [...]
Read Full Post »
Posted in Code, python on Feb 14th, 2007 4 Comments »
So I had a little time on my hands and thought it might be fun to get to the bottom of this Infinite Monkeys and Shakespeare dillema.
Here’s some python code that tries to randomly write the line “Alas, poor Yorick, I knew him, Horatio.” To make it easier I’ve ignored punctuation and case but still, [...]
Read Full Post »
After my recent wedding Jody and I were getting lots of invitations to view Kodak Easy Share photo galleries.
Unfortunately there is no ability to download quality copies of the images you are looking at.
Fortunately however I know me some intarweb. So without further ado I am happy to introduce RipAndZipKodakGallery.
Basically this a command anyone can [...]
Read Full Post »
Posted in Code, python on Sep 25th, 2006 1 Comment »
Saw this easy way to reverse a string in python today, over at Answer My Searches
Here’s how to do it:
exampleString = ‘Hey there fancy pants’
reversedString = exampleString[::-1]
print reversedString
>> stnap ycnaf ereht yeH
This works because a String is a sequence type in python and you can apply all the ’slicing’ syntax you want to it. So [...]
Read Full Post »