Parsing With Parsimonious

Date Tags python

Recently I have been playing around with a parsing library for Python called Parsimonious. So far, I have been very impressed with it. Examples can be a bit hard to find; the following is a simple CSV parser:

from parsimonious.grammar import Grammar
from parsimonious.nodes import NodeVisitor

class EntryParser(NodeVisitor):
    def __init__(self, grammar, text):
        self.entry = {}
        ast = Grammar(grammar).parse(text)
    def visit_name(self, n, vc):
        self.entry['name'] = n …
more ...

Hidden Fossil Features

Date Tags fossil

The Fossil version control software has a few cool features that are somewhat hidden:

  • RSS Timeline - Add .rss after a projects timeline URL to get an RSS feed; example.
  • Link To Line Number - Add ?ln= to an artifacts URL to link directly to a given line number; example.
more ...

Furnace Debugging

A few days ago, the blower motor on my Carrier Weathermaker 9200 furnace stopped working. Luckily, this model of furnace provides quite a bit of debugging information printed on the inside of the door. It was very straightforward to test the blower motor and confirm that it was not the source of the problem. After a bit of poking around with a multimeter, the only remaining possibility was the blower motor relay.

Resoldered Relay Trace on Control PCB

This furnace is …

more ...

Vim For Health

Date Tags vim

Today I was watching a video on using Vim as a Python IDE when a comment about the health benefits of Vim caught my attention. Oddly enough, one of the reasons I decided to learn Vim was because of hand pain. After switching to Vim full-time, I have experienced less pain and could not imagine going back.

One additional step I took was to remap the left Ctrl key to Caps Lock. This has made …

more ...

Qt 4.8.4 And MinGW Quick Start

Date Tags qt

The following are instructions for installing Qt and compiling a demo application using the MinGW toolchain:

  1. Download the Qt 4.8.4 libraries installer here.
  2. Run the installer. If a warning message about the version of the w32api.h file appears ignore it and continue the installation (my install is version 3.17 and appears to work fine).
  3. By default, the installer does not add the Qt toolchain to the PATH. Instead, it provides a …
more ...

Vim Zoom Hack

Date Tags vim

When writing large documents with a text editor, it is sometimes useful to zoom out and get a high-level view of the file (I believe Sublime Text has a feature called minimap that does this). This functionality can be added to gVim with a simple vimrc addition (to my knowledge, this will not work with regular Vim).

Add the zoom out command with the following: noremap <Leader>zo :set guifont=courier_new:h4<CR>

Add the …

more ...


Date Tags python

While browsing YouTube recently, I stumbled upon a video about a great third-party Python module called Docopt. It greatly simplifies writing command line utilities; instead of writing custom logic using the standard library optparse or argparse modules, you simply write the usage docs for the utility and Docopt handles the parsing. Check out the documentation; there are some great examples that really showcase the power of this module.

more ...


Date Tags python

Recently, I had a need for a very lightweight static website generator. The idea was to have AsciiDoc and Pandoc handle the markup to HTML conversions while the generator would simply apply the HTML content to a Jinja2 template. The result was PopPage, a simple command-line driven website generator. It plays nicely with native Windows batch scripting and I plan on providing a few examples in the GitHub repo shortly.

more ...

Hi, I am Jeff Rimko!
A computer engineer and software developer in the greater Pittsburgh, Pennsylvania area.