Slaptijack Title

Archive for the ‘Programming’ Category

Working Around EVE-KILL + Cloudflare Block

I've got some code that generates loss reports for EVE Online. It uses the EVE-KILL API and Python's urllib2 library. Near the end of October 2015, I noticed that my calls to the API were returning a 403: Forbidden error from the server. I didn't realize it at the time, but EVE-KILL uses Cloudfla...

Read More →

Categories: Programming

UnicodeDecodeError: 'ascii' codec can't decode byte

Although I was getting this output in relation to one of my Jinja2 templates, it really isn't a Jinja2 problem. UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 69: ordinal not in range(128) The bit of code here should be doing nothing more than printing a float: '{:,.2f}'.for...

Read More →

Categories: Programming

Python: Empty String?

I've mentioned before that empty strings in Python are false. This leads to a common if not string paradigm. Unfortunately, this can be problematic. Check out this snippet: That pretty much worked out just as we imagined. The empty string returned False and our code did what it was supposed to....

Read More →

Categories: Programming

Pelican: Don't Let Me Publish Without Committing

Although I use Git all day long, I actually prefer to use Mercurial for my personal stuff. When I started working on this project to maintain slaptijack.com with Pelican rather than continuing to use Wordpress, one of the things that really interested me was the ability to keep Markdown files in ...

Read More →

Categories: Programming

Pelican: Insert Article Summaries into WordPress

This is was my next project. Update: For now I've solved this problem by using FeedWordPress to pull the Atom feed for the Pelican-specific portion of the website. Use this as a starting point for the XML-RPC bit. It should first try to pull the article before committing a new one. Otherwise we'...

Read More →

Categories: Programming