15th August 2011
Sometimes there is a need to be sure that no identifier is processed twice – for example, when parsing a file into a database, with file potentially containing duplicate records. An obvious solution is to properly wrap the DB insertion code into try…except block, and process duplicate primary ID exceptions. Another, sometimes more desired solution is to maintain a set/list of processed IDs internally, and check against that list prior to attempting the insertion of anything. So is it a set or a list?
There are already quite a few internet resources discussing “python set vs list”, but probably the simplest while elegant way to test that is below.
Read the rest of this entry »
Posted in Notepad, Programming, Python | 1 Comment »
14th August 2011
Posted in Links, Notepad, Software | No Comments »
13th August 2011
Inspired by video encoding with handbrake.
HandBrake is a very high-quality piece of software – next time you need recoding something into H.264/MPEG-4 (using MKV or MP4 containers) – try HandBrake. It easily saturated all my CPU cores – which I failed to achieve with ffmpeg, which even with threads=8 was only saturating 2 cores.
Attached to this post are 2 profiles for recoding movies for Nokia E71. The “_best” profile has exhaustive motion detection, otherwise is identical to the base profile.
Posted in Links, Misc, Movies, Notepad | No Comments »