Definitely pleased with this plugin. Very easy to use, and the format for specifying masks is easy as well.
1
$("#CellPhone").mask("(999) 999-9999");
That’s how easy it is to set up a mask.
I do have one problem with it though. It’s basically a one to one mapping for characters (you can specify optional sections on the end) but it doesn’t allow something more regex based. For instance: at least one but up to three letters, followed by 6 numbers (a135923 and ab473922). I will probably try to extend it if I ever run across this situation though.
Give it a look if you need to restrict input on textboxes.
This is just a quick Python script that I put together to help sort through my music collection. I have a pretty large one, around 24,000 tracks, and I’m trying to consolidate all of them into a more standardized bitrate of 192kbps. Since they’re all over the map, I figured I would put them into correct bitrate, over, and under folders, so that the ones that are correct can be tagged with MusicBrainz Picard, and the rest can be down converted or reacquired in order to get that consistency.
Requirements:
Python 2.5.2 or greater (older versions may work, but you should have at least this)
importos, sys, shutil from mutagen.easyid3import EasyID3 from mutagen.mp3import MP3
dir = raw_input("Enter the directory to work in: ")
move192 = raw_input("Where should 192kbps files go?: ")
moveOver = raw_input("Where should files over 192kbps go?: ")
moveUnder = raw_input("Where should files under 192kbps go?: ")
ifnotos.path.isdir(dir): print"Start directory must be valid directory" sys.exit()
ifnotos.path.isdir(move192): print"192kbps path is not a directory" sys.exit()
ifnotos.path.isdir(moveOver): print"Over 192kbps path is not a directory" sys.exit()
ifnotos.path.isdir(moveUnder): print"Under 192kbps path is not a directory" sys.exit()
def cleanPath(value):
value = value.encode("ascii", "replace")
deletechars = '\/:*?"<>|' for c in deletechars:
value = value.replace(c,'') return value;
def deleteError(function, path, excinfo): print"ERROR: Could not delete " + path
again = raw_input("Try again? (Enter 'y' for yes, otherwise press Enter): ") if(again == "y"): shutil.rmtree(path, False, deleteError)
For the project that I’m working on at my company, one of the pages required developing a table that was vertically oriented (first cell in each row is a header, each data item takes a column). It also had to be editable in place, which means that using a traditional table would be extremely difficult and hackish.
I settled on using unordered lists and some jQuery to give the appearance of a table, and it seems to have worked out splendidly.
jQuery magic to make it more table-y. This code basically extends the inner section (id = “scroller”) to the maximum width of the table columns (based on how many there are). It then stretches the container to fit within the whole parent container that the scroll bar will go all the way across. Finally, it loops through each column, and then uses a custom selector to find any cell heights that are above the minimum amount, and then updates all of the heights for those rows
Edit: I made a change to how the heights are calculated. I realized that a taller height in a later row wouldn’t have it’s original height recognized. I replaced it with a dictionary based approach, where each row index stores the maximum height it encounters before applying the final row heights