My team and I recently encountered an issue where several, but not all, of our date fields were being displayed one day off from what was stored in the database. The cause wasn’t immediately obvious and led us down the rabbit hole of dealing with Daylight Savings.
I was recently troubled with a web application crashing on older iOS devices without an obvious cause. We were loading a page with several tiles of content, and it would either crash as the page loaded or if you happen to scroll down the page too quickly.
If you have a set of log messages that you always want sent to both stdout and a log file, you can easily set up a python logger to do exactly that:
Despite the prevalence of graphical interfaces and the growing demand for stunning visualizations, sometimes the simplicity of a command line client is all you need. Fortunately with Python’s argparse, you can quickly pull one together with short/long name aliasing, spiffy help text, and other familiar command line features. However, the docs can be a lengthy read, so here’s a quick rundown.
Several months ago I was introduced to Ryan Bates’s ruby-warrior project, and I had a blast playing through it. If you haven’t seen it before, it’s a “game designed to teach the Ruby language and artificial intelligence in a fun, interactive way.” You progress through the game by writing Ruby code which determines your warrior’s behavior. If there’s an enemy monster nearby, will you attack it? Will you walk around it? Will you stand there and let it pummel you to death?
I’ve noticed over the past few months that my Reddit consumption has continued to grow, shrinking the time I spend on side projects and other activities. So, I’ve finally decided to cut Reddit out completely.
Scenario: You want to package your Python project for others to retrieve via
pip install your_project
Recently, I’ve been working on converting Ryan Bates’s ruby-warrior into python. Most of the conversion into Python is pretty straightforward, but occasionally there’s a piece of code that takes a moment to work out.