Someone came into the Dream.In.Code forums the other day asking about batch renaming of files using Python. I thought I would work out the example for everyone to see and create something that they could add to their own personal libraries of code. Python makes this pretty easy to do using "os" and "os.path" but one tricky part I found was dealing with the method isdir() and similar functions which ...
Once in awhile you may want to check if a file has changed its contents in some way. Perhaps you are monitoring a log file or checking to see if an exe has had a virus mess with it. One way you could do this is by hooking up a FileSystemWatcher object and monitor the file. This might be a good approach for more elaborate programs where you also want ...
When talking about any kind of server-side language, like PHP or ASP, you will often find the term "database" not too far behind. It is the preferred choice for storing data on the web after all. Another option is to use a text file. The problem with text files is that they are not typically secure, can be easily read, and don't offer any of the features like referential integrity ...
Damn! What the hell happened to that application I was running? One minute I am viewing the pictures of my trip to the playboy mansion and another minute I am having to shut down the app. It is seriously not cool! Now only if there was a way I can record some of my applications activity for windows to see later. Perhaps describing why my application decided to take a ...
I got the idea for a file chunking program the other day while I was reading a Ruby article. I thought to myself, why not build a similar utility in C++? The idea of chunking a file (that is, taking a file and breaking it into smaller files) can be a useful utility when dealing with some rather big files. Perhaps if you mix it with some file compression before ...
Here we go again! Another exciting blog entry talking about programming theory. This episode comes by way of a question that appeared on the board today. Someone was looking to pick out colors from an image, convert them to a hex value and write them to a CSV file (comma separated file) for Excel. I put this in the Deep Underground Misc category because frankly I don't know much about ...