Great Django Debugging Tips from Simon Willison
http://simonwillison.net/2008/May/22/debugging/
Includes:
- Making the most of the error page
- Logging to the development server console
- Using the debugger (pdb)
- Handling errors in production
http://simonwillison.net/2008/May/22/debugging/
Includes:
Okay, so most anti-piracy methods are rediculous and annoying. There are plenty of arguments and stances to take on DRM in music and software, but let’s leave that for another conversation. Despite rather the very existence of such a thing might make youi grind your teeth, let’s step aside from our own opinions for a minute and answer this question:
For instance:
… The City, also featured a novel anti-copying technique. The program disks could be copied though the standard methods and the copy would appear to work. However not long after the player began the game, their character would become weaker and weaker and then die from an apparent disease. The Dungeon, if loaded with a pirated copy, featured two “FBI agents” as encounters during the beginning of the game, who attacked with “the long arm of the law”. The two agents were overly powerful and unbeatable, so as to kill the character before being able to play the game.
Link.
Doh!
At this point, whatever the DRM or anti-piracy method, to come up with something like that is pretty crafty – and funny. So what’s yours?
I recently inherited a PHP application that stores uploaded PDF and JPG files in a MySQL database. Unfortunately, it is way beyond scope (and original architecture) to change this fact. Given that, there are some memory limit problems when the initial file is quite large as it’s contents are read to a variable which is evetually placed into the MySQL INSERT query.
Is there a method of updating/inserting to a MySQL field with binary/data directly from disk, or of somehow not reading in the file contents through PHP?
Also, my first thought was to buffer the file in with PHP and use CONCAT, where PHP only has a portion of the data at any given time – but that would require many DB queries (one for each buffered portion of the file), not to mention the very idea just sounds wrong.
Am I thinking about this the wrong way?
There is a way, and it’s documented in the MySQL Manual, tho’ it took me a bit of searching to find it. The problem, in my case, is that it comes with this caveat:
To use this function, the file must be located on the server host, you must specify the full pathname to the file, and you must have the
FILEprivilege.
Which makes sense, but will probably prevent me from being able to use this method.
Thanks to Cytael – I was checking out his site and saw a link to NoiseTrade, of which I hadn’t heard.
It’s a “Fair Trade” music site, co-founded by Derek Webb, of whom you may have heard or seen. Get legally free music from tons of artists, or “pay what you want”.
Check out the About page for more deets.