Inspired by this StackOverflow question, “How do I sniff on a port for log messages using python?”, I decided to figure out how to capture and process packets in Python. It turns out to be quite easy once you work out the kinks. Except the kinks were a pain to determine.
In a previous post, I compared the different methods for parsing XML in Qt. After a comment about XQuery’s performance, I added some code to test performance using a simple, but large (304MB) XML file. Times are sorted and normalized to the smallest value.
I often find myself editing files in terminals on remote machines, and I really need to add Tramp to my muscle memory. Tramp is an Emacs package (installed by default?) for editing remote files via ssh. It allows you to open files with urls like this: /ssh:user@host#port:/path/to/file.
Note: I use ssh instead of scp (used in all of the examples) because the webpage says it’s faster and also because it supports the #port piece while scp does not. Also, the user@ and #port pieces are optional. So feel free to use the minimum: /ssh:host:/path/to/file.
Have you ever re-formatted an SD card and noticed the performance degrade? You formatted it FAT32 just like it came from the factory, but it runs slower. Except you didn’t actually format it like the factory. The following is a document I wrote mid-2013 about formatting microSD cards with a single FAT32 partition with a layout that is optimized for speed and lifetime. It also includes details about using this card as a bootloader source for TI OMAP3/4 processors.
Update 1/12/2015: I’ve written a follow-up to this post comparing the performance of the different parsers. I’ve also fixed a few mistakes in the code and text below. I’ve also changed my mind about QXmlSimpleReader now that I’ve found a simple way to use it.
For this past February’s CoderNight meetup, I thought I would write the solution using Qt and take the time to explore qdoc, Qt’s excellent documentation tool. So, of course, I spent all my time figuring out the three native ways to parse XML using Qt and completely ran out of time for qdoc. While researching the XML parsing, I couldn’t find any webpages addressing and comparing the methods all at once. Since then, I’ve discovered that the documentation for Qt 5 has an XBEL bookmarks example for each of the methods and you can compare those examples to get a feel for the differences, but there’s still no Qt XML parsing rosetta stone page. Here’s a shorter, incomplete comparison of the three methods.
I wanted to build the minimum set of adapters necessary to connect an RS-232 USB-to-Serial adapter to any other board with a DB-9 connector. It turns out that you only need two:
My son’s Boogie Board from Brookstone recently stopped working and I suspected that he had given it the stated 6 years of use in 2 years time. Unfortunately, Improv Electronics, the manufacturer, chose to save a few cents and used a soldered battery. I needed to solder something for my work, so I thought fixing his board might provide a dry run of my soldering skills before I ruin a customer’s hardware. Continue reading Replacing the Battery in a Boogie Board→