Moldz

Members
  • Content count

    11
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Moldz

  • Rank
    I broke 10 posts and all I got was this lousy title!

Contact Methods

  • ICQ
    0
  1. Don't sweat it dude, who cares what a bunch of kids think? I am more curious about the traffic they drove to your site. How much was it? Anything interesting about the traffic patterns? The digg people love to compare themselves to Slashdot, just wondering how they did.
  2. Linux has OpenLDAP for directory services.
  3. Hmm, when I clicked on "View New Posts" there was usually a link to "Mark all forums as read". Where did it go? EDIT: nevermind, I found it
  4. I've used postfix on a low volume email server and was pleased with the results. From the site: QMail seems to be another popular choice.
  5. No problem, I'll get use from it too since I'm trying to catch up on the old eps. I figured my mail got lost in a spam filter since the tracks weren't updated.
  6. I was listening to some of the recent binrev radio shows and it seems like a lot of people keep asking you to include the track number in the MP3 titles. Man, there would be nothing more tedious than to go through 80+ files and manually change the titles. I think that adding them is a good idea, that's why I've posted a python program that will do it for you. Put it in the same directory as all the binrev MP3's and run the script. It will make a list of all the binrev MP3 files in the directory, extract the track name from the file name, then add the track to both the ID3 version 1 and 2 title tags. The script will output a list of successful and unsuccessful tries. BTW - working with version 1 tags were easy, but version 2 was a pain in the ass! Enjoy: import os import struct def listMP3(directory): """Return a list of the MP3 files in the directory.""" return [f for f in os.listdir(directory) if f.lower().endswith('.mp3')] def setTitle_v1(filename, title): """Set the title for ID3v1 tag. Only the first 30 characters are used. Throws exception if there is an error.""" mp3file = open(filename, 'rb+', 0) try: # check for a valid ID3v1 tag mp3file.seek(-128, 2) if mp3file.read(3)!='TAG': raise IOError, 'File does not have an ID3v1 tag.' # cut and/or pad the title title = title[:30] title += '\0' * (30-len(title)) mp3file.seek(-125,2) mp3file.write(title[:30]) finally: mp3file.close() def setTitle_v2(filename, title): """Set the title for ID3v2 tag. Throws exception if there is an error.""" mp3file = open(filename, 'rb+', 0) try: tag = mp3file.read(10) if tag[:3]!='ID3': raise IOError, 'File does not have an ID3v2 tag.' # need to do bit magic to get the size # since it only uses 28 of 32 avail bits (encoded,) = struct.unpack('>I', tag[-4:]) bit7_1 = 0x7F size = 0 | (encoded & bit7_1) size = size | ((encoded>>8 & bit7_1)<<7) size = size | ((encoded>>16 & bit7_1)<<14) size = size | ((encoded>>24 & bit7_1)<<21) mp3file.seek(0) tag = mp3file.read(size+10) index = tag.find('TIT2') if index == -1: raise IOError, 'File does not have a valid ID3v2 title.' (fsize,fflag,ftext) = struct.unpack('>Ibb', tag[index+4:index+10]) if ftext==1: title = unicode(title) title = str(ftext)+title mp3file.seek(index+4) mp3file.write(struct.pack('>I',len(title)+1)) mp3file.seek(index+10) mp3file.write(title) finally: mp3file.close() # Add the track number to all binrev mp3's. if __name__ == "__main__": files = [f for f in listMP3('.') if f.startswith('binrev')] errorlist = [] for filename in files: try: title = "Binary Revolution Radio # " + filename[7:9] setTitle_v1(filename, title) setTitle_v2(filename, title) print "%s --> '%s'" % (filename, title) except: errorlist.append(filename) if errorlist: print "\nI couldn't do these files: " print '\n'.join(errorlist) try: input("Press <enter> to end.") except: pass
  7. Try How to Think Like a Computer Scientist. I've never read it through myself, but I heard it teaches you programming concepts, not just language features. It's a free, online book so you don't have to shell out any dough, plus the book is written in a way that lets you choose from a few different programming languages. I recommend python, but that's up to you.