While converting a bunch of werkzeug code to Python 3.1, I ran into an issue with one of the bytes objects that was previously a string. The line of code in question was originally this: If value is something, and the first and last characters are a quote character, then… However, as it turns out, [...]
Archive for December, 2009
Python 3 bytes indexing returns integers!
Posted in Engineering, Technique, tagged bytes, Python, python 3 on December 31, 2009 | Leave a Comment »
Example Automated MySQL Backup Script
Posted in Linux, System Administration, Technique, tagged backup, Backup Script, MySQL, System Administration on December 26, 2009 | Leave a Comment »
Rather than use –all-databases, which will prevent you from being able to selectively restore any single database, consider the following: Ideally, you should have a daily backup, with some history. It should be bulletproof (–force), it should be logged (>> …log), it should be compressed (| gzip), it should keep separate copies of each database, [...]
How to Author a *simple* jQuery plugin
Posted in Engineering, Technique, Uncategorized, tagged JavaScript, jQuery, jQuery Plugin on December 21, 2009 | Leave a Comment »
I use jQuery as the JavaScript library for most projects. It’s terribly convenient for selecting elements and processing them. However, jQuery is not JavaScript, and there is a lot of things it cannot do. Rather than writing a separate set of functionality outside of jQuery, why not simply extend it on an application-per-application basis? It [...]
jQuery mouseout vs. mouseleave
Posted in Engineering, Technique, tagged Events, JavaScript, jQuery on December 18, 2009 | Leave a Comment »
Hello! jQuery has a mouseout and a mouseleave event. The main difference is in how they handle child elements. Mouseout fires when the pointer moves into or out from child element, while mouseleave doesn’t. This was causing a slight problem of having some menu’s close when the mouse encountered a link or other child element [...]
Python has keyword only parameters!
Posted in Engineering, Technique, tagged keyword arguments, programming, Python on December 8, 2009 | Leave a Comment »
Maybe I should have known this about Python by now, but… Little did I know (was wishing for it today), but there IS a way to specify that arguments MUST be keyword only. In this case, everything after the * is required to be keyword only. This means that you can safely amend the function [...]