Feed on
Posts
Comments

Archive for the 'snippet' Category

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 »

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 »

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 »