Programming
Programming


Like any standard-issue computer nerd, I have been programming since about first grade. My first language was AppleSoft BASIC. Unfortunately, this was the only language I knew (besides English) until 12th grade, when I first learned how to use PC's, and started playing around with DOS batch scripting, and QBASIC. I was also introduced to NOVELL networking during this time. Special thanks to Mr. Lore for letting me have supervisor privs on my high school's classroom server and giving me access to all of the NOVELL documentation. I learned a ton of stuff by troubleshooting and fixing problems on that network.

Eventually, I learned C++, and I now use it quite often to create programs on unix, Win32, and DOS platforms.

I recently discovered the benefits of unix shell scripting, and have written a bunch of scripts to help me manage my unix accounts here at pitt. I have also tweaked my .fvwmrc like mad to suit my needs. Here are some sample screen shots: (screen 1, screen 2, screen3.) Here are my .fvwmrc and .fvwmfmgr files.

Here is a list of programs that I have written, with links to source code, and compiled executables where possible:

C, C++

autox.cpp (source code), autox (sun4x_55 executable), autox (sun4m_412 exe) - Handy program that determines whether you have logged onto a Sun, in which case it automatically starts X11. It also waits 1 second before starting X to wait for the user to hit the spacebar, in which case the program goes to a command prompt. This script should be called from your .bash_profile. NOTE: This will only work on Pitt's system, although a re-write for your system should not be very hard.

mini_q.cpp (source code), mini_q (sun4x_55 executable), mini_q (sun4m_412 exe) - This one doesn't play my Mr. Sparkle commercial mp3 when it starts up, but plays Nelson's "Ha ha!" every 15 minutes. I have to file output from the printers every 15 minutes where I work, so this program helps me stay on schedule.

ascii.cpp (source code), ascii (sun4x_55 executable), ascii (sun4m_412 exe) - This program was written to help me determine the multiple ascii codes sent by various non-character keystrokes so that I could detect them in programs. Pretty simple, but very useful.

randomplan.cpp (source code), textbuffer.h (source code) randomplan (sun4x_55 executable), randomplan (sun4m_412 exe) - This one randomizes my .plan and .signature files. When you run it, it chooses a random file from a directory in your home directory called "PLANS", and concatenates it to your .plan file. Uses my textbuffer.h class library, which has some nifty features. I hope to eventually get around to writing a version with command line interpretation to allow it to be more versatile.

Bash Scripts

printping - This script was written to determine the reason for the trouble we were having with our printers disconnecting from the network. Turns out that pinging them every couple seconds actually seems to prevent them from disconnecting during periods of low printing activity. This one will work for most of the printers at Pitt, just give it a queue name as an argument. More info on this script, and the others below which I use at work can be found at http://www.pitt.edu/~mrbungle

checkpaper - This script displays the status of the paper in the printers at Benedum Lab.

paperalert - This one uses my checkpaper script and greps for Empty paper bins and beeps three times while displaying the printer and bin that needs refilled.

pagecounts - This one gets the pagecounts of Benedum's printers for when I have to record them at closing time.

kil - This script allows the user to kill all processes of a certain name. Example: "kil netscape" will kill all processes named "netscape". Even distinguishes between the two versions of ps (sunOS4 and solaris2.5.1) to prevent errors.

find_pix - This script was designed for the Suns, and will only work if you are in X11. Typing find_pix in an xterm will start recursively searching for jpg's and gif's in the current directory and open them with the xv image viewer. Click inside the displayed picture to close it and display the next one. If you are bored, cd to one of the main /usr directories and issue the command. Who knows what you'll find?

compile - Script to compile cpp files and automatically dump them into ~/bin. Very nice. No more typing g++ command line options over and over.

findcore - Finds and removes "core" files, which are infamously huge and can cause quota problems. You might want to put this in your .bash_profile so that you delete all core files automaticaly when you log in. Or you can put it in your .bash_logout and delete them after you log out... it's all you.

num - Give this script a filename as input and watch concatenate it to stdout with line numbers. This comes in handy for programming when you get an error like "Invalid Statement on line 316".

netscript - This one fires up the correct version of Netscape for the Suns. The two versions are 4.x as opposed to the old buggy version that Pitt supports. Must be in X11 for this one to work. You may want to bind it to a button or menu in your .fvwmrc file. Thanks to nocode and jm0220 for sacrificing space on their accounts for the executables.

Here is a link to my first Java applet which has three sliders for red, green, and blue. Play with the sliders to get the color you want...