Articles in the programming category

  1. Using Pelican's article.summary

    Posted on in Programming

    I'm using Jinja2 templates with my new Pelican-based articles. If you have Django experience, you'll feel right at home using Jinja2 templates. I decided early on that I wanted to create my own theme from scratch and keep it as basic as possible. (In fact, 'basic' is the name …

  2. Agreeing to the Xcode/iOS license...

    Posted on in Programming

    Sometimes this pops up when you least expect it:

    Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo.
    

    This morning, I went to refresh one of my git repo's for work, and make spit that out. What the heck happened last night? Anyway, the …

  3. MySQL Multiple-Column Indexes: Order Matters

    Posted on in Programming

    Powered By MySQLThis will just be a short reminder. If you're planning to create multiple-column indexes in MySQL, remember that the order of the columns matters. As the MySQL documentation points out, any "leftmost prefix of the index can be used." This means that the index can be used for any number …

  4. [Python] Convert String Date to Date Object

    Posted on in Programming

    Occasionally, you may run across a date in a format that can't be easily loaded into a Python date object. For example, I recently had a situation where a file I was parsing was full of dates in this format: 7/7/2008.

    The obvious thing to do here is …

  5. Empty Strings in Python Are False

    Posted on in Programming

    Recently I was working on some old code. One of my model methods was originally written such that if one parameter was set to the Python None type, a particular set of actions would occur. For some reason, I checked for None like this:

    if parameter is None:
        do something …
  6. The Beauty of Python File-like Objects

    Posted on in Programming

    As I mentioned the other day, I'm building a RADIUS client in Python for sending disconnect messages to Cisco routers.

    One hang-up with the pyrad package is that it requires a dictionary file in order to map RADIUS attribute names to codes and types. In the case of my client …

Slaptijack's Koding Kraken