Programming

Error Running Coverage on Ubuntu

Trying to install pytest and coverage on my ubuntu development server, and ran into an issue when running coverage:

ModuleNotFoundError: No module named '_sqlite3'

To resolve, install python with enable extensions:

PYTHON_CONFIGURE_OPTS="--enable-loadable-sqlite-extensions" pyenv install 3.9.2

Enjoy!

Read More
The Sublime Regex

The Sublime Regex

Sublime Text is a really wonderful text editor. It’s flexible and extensible enough to cover just about any need, but still simple and clean to use. This post is not a long discussion about either text editors or regular expressions, but a simple post about a problem I needed to tackle and the simple solution.

I pulled a bunch of data from our issue tracking software, and I needed to create a simple list of all the issues resolved and the person assigned the issue. Simple. I grabbed the text I needed from the csv file created, then used a simple find/replace in Sublime Text to put the text in the format I ultimately wanted.

Read More
Sublime Pelican Plugin

Sublime Pelican Plugin

Wow. If you, like me, are a Sublime convert, and a Pelican blogger, then this wonderful plugin is a must.

The plugin adds several Pelican commands to the command palette creating shortcuts for article creation and adding tags.

alter-text

The best, and for me, the most useful part is the tag insert feature. It pulls all the tags from the site content and makes an easy to search and use list.

Read More
Maciej Cegłowski Discusses

Maciej Cegłowski Discusses

Check out Maciej Cegłowski’s great talk from XOXO 2013. He is the creator behind Pinboard. it’s a fun and inspiring talk.

Enjoy!

Read More
Looking At a Python Pelican

Looking At a Python Pelican

I really like the static version of the site. It’s so much easier to support and configure. I can tweak to my hearts content. Jekyll is a wonderful platform, and Octopress is a great framework on Jekyll. However, ruby isn’t my strength. I’ve fiddled with ruby in the past, but I don’t love it. It is a great language, just not for me.

If I’m perfectly honest, I love perl. Perl was an early first love, and is still a terrific language, but the static site generators in perl are limited. I did take a look at Blosxom, but there isn’t a large number of active users. I did find one site with current posts built using Blosxom, so it’s still out there.

Read More

Common MySQL Queries

I ran across this terrific resource, Common MySQL Queries.

Tons of great examples…for example:

Given a birthdate in @dob, here are two simple formulae for age in years:

Date_format( From_Days( To_Days(Curdate()) - To_Days(@dob) ), '%Y' ) + 0
Year(Curdate()) - Year(@dob) - ( Right(Curdate(),5) < Right(@dob,5) )

and here is one for age in years to two decimal places, ignoring day of month:

Round((((Year(now()) - Year(@dob)))*12 + (((Month(now()) - Month(@dob)))))/12, 2)

Enjoy!

Read More
Basic Troubleshooting Techniques

Basic Troubleshooting Techniques

Troubleshooting is tracking down pesky bugs, rooting them from the code and squashing them. Having some basic troubleshooting skills can greatly enhance your bug fighting. The goal of troubleshooting is to quickly identify the root cause of the problem, however, don’t confuse troubleshooting with problem solving. Problem solving is answering the question, “Can this be done?” or “How can we do this?” Troubleshooting on the other hand is answering the question, “Why isn’t this working?

Read More

RSS Feed in Zend Framework

Going to get a little geeky here. But I wanted to share a simple, and effective way to create a simple rss feed of content in the Zend Framework.

The new ClubReading site is separated into two parts, the blog, and the books. The books site is now using Disqus for the comments, and so far Disqus is working out great, but that’s a topic for another day. The blog is a wordpress blog. What I wanted to do was display a couple or three of the recently added books from the books site on the sidebar of the ClubReading Blog. My thought was to create a simple rss feed of the most recent books, and use the standard wordpress rss widget to display the feed content in the sidebar. But - how to create the rss feed? Turns out it was pretty simple thanks to a great article by Alex Netkachov called “Syndicate content with Zend Framework Zend_Feed classes”.

Read More