BPM Counter Plugin for Exaile 0.3.2

October 3rd, 2011

I’ve been starting to use my desktop machine at home a lot lately, so I’ve been looking for a cross-platform audio player that I can use that doesn’t annoy me. After a long search (and discarding most of the linux audio players: amarok, banshee, etc as too annoying or not the right features or whatever) I finally stumbled across Exaile, which not only doesn’t annoy me greatly, but it’s written in python so its way easy to modify and figure out what it does :)

I’ve been doing a bit of swing dancing lately (in particular Lindy Hop), so I’ve been gathering music together to listen to, and I need BPM for the music… one thing Exaile did not already have was a BPM counter, so I wrote a manual beat counter for it. You can write plugins for Exaile, though the documentation is rather sparse. I must say though, using the GLADE widget editor thing has to be the most annoying GUI design tool ever…


Download it at my usual software site.

PS: In case anyone asks, I’m not interested in writing an automated beat counter… this works well enough for me :)

Winpdb Remote Debugger for Python ported to RobotPy on vxWorks

January 11th, 2011

I’m really excited about the idea of using python on our FIRST Robotics Team’s Robot this year, and one of the first things that got really annoying was the lack of debugging capability, since vxWorks doesn’t really have a console (I mean it does, but in the way that FRC has it setup, its not really a console in the traditional sense of the word). So I searched around and found Winpdb, a pretty neat remote debugger for python. So after playing with it for a bit, I’ve got it working on RobotPy and it seems to do the trick so far. :)

I’ll be creating some other tools as needed, so watch for more python in the future!

Download: http://www.virtualroadside.com/FRC/

cRio Netconsole implemented in Python

November 12th, 2010

The FIRST Robotics Competition uses the NI-cRio platform for the controller for the robots in the competition. There is a bit of functionality called ‘NetConsole’ which sends the stdout from vxWorks out to a waiting client (refer to the WPI FIRST website for instructions to enable this). It turns out that the protocol used to implement the NetConsole for the cRio is incredibly simple… it just sends the raw output data as a bunch of UDP packets out to the broadcast address on port 6666 (which I suppose is slightly amusing). Here’s a dirt-simple python script that catches the output (TODO: need to send it input… haven’t gotten around to looking at that yet).

#!/usr/bin/env python

import socket
import select

UDP_PORT=6666

sock = socket.socket( socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP )

sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
sock.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
sock.bind( ('',UDP_PORT) )
sock.setblocking(0)

while True:
    result = select.select( [sock], [], [] )
    msg = result[0][0].recv( 8196 )
    print msg

A partition recovery story

May 23rd, 2010

So my dad tends to have a lot of really dumb computer problems that are either caused by him or some random virus/malware that he somehow manages to get on his system. And of course, I get to be ‘Mr. Helpdesk’ and help him fix them (sometimes), even though I’m 900 miles always from him.

His latest dumb computer trick involved some weird bug where he created a partition while Windows was running, formatted it, *moved* (not copied, but *moved*) a bunch of data to it, and then managed to get a blue screen without rebooting the system. For whatever reason, Windows decided that it didn’t want to write the partition or boot sectors for the hard drive correctly, and so he temporarily lost his data. In the past when I’ve had these kinds of problems with partition layouts, I’ve done things like manually recreating the MBR (a very long time ago) or using something like linux’s fdisk to set the parameters manually. However, the ‘easy’ tricks didn’t work for his problem this time, but I found this marvelous software that seems to do the trick:

http://www.cgsecurity.org/wiki/TestDisk

So hopefully it’s useful for you too!

Obsidian Theme for Visual Studio 2008

March 24th, 2010

I’ve become a fan of the obsidian theme for notepad++ (even though I know it comes from other locations as well), because I feel like the theme is a lot easier on my eyes. So I’ve had to start using Visual Studio a bit more lately, and I adjusted the fonts/colors to match the notepad++ obsidian theme (with some variation, of course). I’ve exported the settings, and you can use them as you wish. I haven’t fully explored the settings yet, but this seems to do it for much of the stuff I run into. If you have adjustments for this that makes it better, let me know!

Download here

WebDMA 0.2 Released

January 23rd, 2010

WebDMA 0.2 is now available for download at the WebDMA project site. Using C++ operator overloading, WebDMA provides proxy objects that your application can use as normal variables which can be manipulated or displayed by your application via a configurable jQuery/javascript powered AJAX-enabled Web 2.0 interface hosted by an lightweight embedded web server. Its really neat, and really useful for tuning/debugging our FRC robot. Of course, it works on Windows/Linux too.

This is a better packaged version of WebDMA, with a few feature improvements. Of particular interest to FRC teams, I have released an installer that installs the object files for WebDMA on your robot, and copies the header files to the needed locations for Wind River. There is also a sample program installed for Wind River as well that allows you to control two motors on your robot with the web interface as a demo. All you need to do to use WebDMA on your robot is install the install package to your development computer, and then run the install program to copy the necessary object files to your robot.

While this is very easy and painfree for beginners to install and use, of course I must give you this disclaimer since a program installed by the installer writes directly to the robot to install the object file:

WARNING: The provided installer will WRITE DIRECTLY TO YOUR ROBOT and modify files on it via FTP.

While I have tested this and this works just fine for our team on our cRio with no ill effects, I cannot be held responsible for your robot. This installer is not sanctioned or associated with National Instruments, Wind River, or FIRST Robotics. In particular, this may void your warranty, render your cRio useless, and COST YOUR TEAM A LOT OF MONEY.

If you are a student: DO NOT DOWNLOAD AND INSTALL THIS ON YOUR ROBOT WITHOUT ASKING THE ADULT LEADER OF YOUR TEAM.

But seriously, it works just fine for me though. And if you have problems, let me know. :)

Boost.Asio Tech Talk Slides

November 24th, 2009

I gave a presentation at work about Boost.Asio, and it came out reasonably well, so I figured I would post the slides here. Its a brief introduction to Asio and what one might use it for. Also has some basic concepts and patterns one might use while programming with Asio. Aimed for a technical audience, but nothing too detailed though.

Boost.Asio Tech Talk Slides (PDF)

Free disk/sector editor from Microsoft

October 11th, 2009

This is just a random note that I’ve actually known for quite awhile, but I figured I would post it online somewhere where others could find it. Apparently Microsoft made a disk editor thing called ‘Disk Probe’, which came in the NT Resource Kit. I had found it available to download standalone a really long time ago, but it doesn’t appear to be available anymore. However, you can find it in the Windows XP Service Pack 2 Support Tools available from Microsoft’s download website.

Its a bit weird (at least, the NT version was), but its pretty useful if you ever find yourself playing with raw disks and you need to access them from inside windows in a pinch.

Ubuntu Karmic: definitely a good upgrade

October 6th, 2009

Ubuntu just released the Beta for Karmic a few days ago, so I figured that I would give it a whirl on my desktop now that I’ve switched to using Linux on my desktop fulltime. So far, I’m very happy about this upgrade, hopefully they don’t screw it up before release. :p

My first impression so far as been that its a vast improvement — and I’ve got rather old hardware, so I think thats a really positive thing. Maybe its just firefox, but it seems like to me that everything works a lot better and is more responsive. The file browser in GNOME too — it used to lag quite a bit while browsing through my drive — now it seems to work exactly as I might expect. I know they’ve been touting a really quick boot time, and it feels a little bit faster, but I’m not quite sure about that. I haven’t bothered timing it or anything though.

There were two annoying things about the upgrade. First, X didn’t work at first and just kept blinking in a loop — but that was totally my fault, since I’m using the latest NVidia drivers, and forgot to reinstall before I rebooted. However, a quick boot into a command prompt and reinstalling the drivers got it all working again. The second thing that is a bit weird is they must have changed the font or the way its anti-aliased now, since everything looks a bit more.. blurry. Or something, I can’t quite put my finger on it. I’m starting to get used to it, but its too bad the fonts aren’t a bit crisper.

FWIW: Keep in mind that I’m using rather old hardware on my desktop, but XP always worked well on it! I’m using an Athlon 3000+ with a triple-monitor setup on two NVidia 6600 cards (one PCI, one AGP). 2GB RAM, and some various SATA and IDE disks.

XSMELL: C++ XML creation library

September 30th, 2009

I’m taking a workshop at work taught by David Abrahams, and he briefly mentioned this thing called XSMELL, which apparently allows you to write XML-like things in pure C++ code. From the README:

Congratulations! You have in your hands the MOST BRILLIANTEST C++ XML CREATION
LIBRARY EVER CREATED.

...

And you no longer have to worry about generating malformed XML! After spending
hours fighting obscure C++ compiler errors, you’ll be 100% certain that your
XML is correct.

Definitely amusing. :)