File rearranging script.

C++, Tech, Work, Code | Friday August 11 2006 12:58 pm | Comments (2)

The huge downfall of scripting languages (for me) is that they require every computer they are run on to have the interpreter installed or I have to jump through a hundred loops to get the script to compile as an executable. For that reason (and because I have two weeks of downtime now) I am porting as many of my scripts as I can over to C/C++. I just spent the last 4 hours (I know, I’m lame) hacking together the most frequently used script. *drum role please* Here it is.

GEMS File Rearranging Script.

What it does: In all simplicity it just moves and renames files. We have to produce audio for the blind people who vote on the touch screen voting equipment. It’s easiest for us to label it like so:

R10.wav — the race audio w/10 being the race ID number.
R10_10.wav – the first candidate w/10 being the candidate ID number.
R10_20.wav – the second candidate w/20 being the candidate ID number.

This allows us to keep everything in order and burn audio CD’s to ship to our customers so they can proof the audio for pronunciation and whatnot. All in all having everything ordered like that just makes our life 100x easier. The script which was initially 15 lines of PHP simply rearranged all the audio so GEMS (the proprietary software used to program the machines for the election) could import the audio. It goes a little something like this:

R10.wav – stays the same.
R10_10.wav – this gets changed to 10.wav and gets placed in the newly created folder 10. The folder represents the race id number and the filename within it represents the candidate ID.
R10_20.wav – this gets changed to 20.wav and gets placed in folder “10”. And so on.

Here is the source code.
Here is the binary compiled by Bloodshed Dev-C++.

I’m far from a C coder so don’t be too much of an asshole if you see how bad my code is. Some constructive criticism would be nice though. I know I completely slaughtered the source but it’s cool to have an interperter independant executable. If you are good at C/C++ I would realy enjoy seeing how your source code for this would work.

One script down.. A whole shitload to go.

Backyard Boxing - Fight 1 & 2

Health, Beer, Fun | Thursday August 10 2006 10:52 am | Comments (2)

Stubby was talking a lot of shit last saturday (as he occasionaly does when he gets drunk) so I ordered a set of huge (16oz) boxing gloves so we could beat the crap out of each other in a relatively safe manner. The gloves were delivered yesterday so after drinking half a case of beer we went out and fought. I didn’t realize how much we seriously suck at fighting. Practice Practice Practice.

After Stubby & I got done releasing some tension Zippy stepped up to the plate and beat the crap out of me. Damn it’s fun.

SUCCESS! Now let’s think Generals!

Work, Vote | Wednesday August 9 2006 12:04 pm | Comments (1)

The Primary Elections here in Missouri went great! No County utilizing Diebold equipment had any serious problems. Now we can archive yesterday away as the first day Missouri employed handicap accessible voting equipment in every precinct in every County State wide. It went well.

Now it’s time to buckle down and start working to make sure everything is ready for the November General Elections. It should be interesting.

W00000000T!

Missouri 2006 Primaries

Work, Vote | Monday August 7 2006 7:21 am | Comments (0)

Everyone that lives in Missouri needs to get off their asses and go vote tomorrow! I’ll be out there at the polls making sure we have good working hardware that was setup properly to assist us in voting. Zippy will be out there at another county. If you are going to vote Tuesday then you might ask to use the new touch screen DRE. The Touch Screen DRE keeps a voter verified paper audit trail so there is no reason to be paranoid about it.

Now it is time for me to go visit a few counties and get them setup for other support teams. w00t.

GO VOTE AUGUST 8TH 2006!

Missouri Primaries. I Voted.

Jose Cuervo

Beer | Saturday August 5 2006 4:47 pm | Comments (1)
Jose Cuervo
Hangover juice.
« Previous PageNext Page »