Back in Service…

By , September 10, 2015 12:26 pm

For those frequently this blog, thank you for your visits!  This has been out of service for the time I was out of country and returning to working nights for the past year has made it hard to find the time to post updates.  But there are a few projects that I have on the burner so keep watching for updates as we move forward…

Tuba Decorated!

By , December 19, 2014 1:22 am


Tuba Christmas…

By , December 11, 2014 9:30 pm


Snow on the ground, cold in the air, music all around.  It’s Christmas time and with the season brings Tuba Christmas again.  After a decade of rest for my lungs, it’s been nice getting the rusty brass behemoth to sound good.

Sample music from practice: 

For those unfamiliar with the event, here are some good videos:

Time For Action

By , November 4, 2014 1:17 am

After a long period, it’s time to return to posting to this blog!

Current Projects:

  1. CakePHP
  2. XFDL Automation Redux
  3. Pentesting

Arduino Game

By , February 26, 2013 4:20 pm

At times, I have fun creating devices.  The similarity to programming amazes me and the ability to be able interact with the physical world is a lot of fun.  I took my standard game, a tank that moves side to side and shoots objects from the sky (think Space Invaders).  Here’s the shopping list.

  1. Microcontroller – Arduino Uno
  2. Display – Nokia 5110 LCD
  3. Sensor – ADXL334 Triple Axis Acelerometer
  4. Tactile Switch and misc wiring/resistors.

So for a relatively small amount of shopping, you have the ability to make an interactive game.  The wiring basically merges basic wiring for the tactile switch, standard input for triple axis acelerometer, and

Enough talk, here’s a picture:

Here’s a video of it:

And here’s the code I wrote:

#include <Adafruit_GFX.h>
#include <Adafruit_PCD8544.h>
// Display
Adafruit_PCD8544 display = Adafruit_PCD8544(7, 6, 5, 4, 3);
// Setup
int pressed = false;
int times = 0;
int led = 13;
int but = 12;
int val = 0;
int count = 0;
// Tank size and direction
int tx = 0;
int ty = 0;
int tw = 10;
int th = 4;
int td = 0;
// Bullet
bool bAlive = false;
int bx = 0;
int by = 0;
int bw = 3;
int bh = 3;
// Accelerometer
const int powerpin = 18;
const int groundpin = 14;
const int xpin = A3;
int xMoveInit = 0;
void setup()
  pinMode(led, OUTPUT);
  pinMode(but, INPUT);
  pinMode(groundpin, OUTPUT);
  pinMode(powerpin, OUTPUT);
  digitalWrite(groundpin, LOW); 
  digitalWrite(powerpin, HIGH);
  tx = (display.width()/2)-(tw/2);
  ty = display.height()-10-th;
  xMoveInit = analogRead(xpin);
void loop()
  // clear
  // x,y,h,w,color
  // movement
  if(isPressed() == true)
    if(bAlive == false)
      bAlive = true;
      bx = tx+(tw/2);
      by = ty+bh;
  // draw
  // show
  // wait
void drawTank()
  tx += td;
  if(tx+tw+1 >= display.width())
    tx = display.width()-tw-1;
  if(tx <= 0)
    tx = 1;
void drawBullet()
  if(by+bh <= 0)
    bAlive = false;
  by -= 2;
void drawGround()
  int lx = 0;
  int ly = display.height()-10;
  int lw = display.width();
  int lh = 10;
  display.fillRect(lx,ly,lw,lh, BLACK);
void doMove()
  int xMoveTemp = analogRead(xpin);
  int diff = xMoveInit-xMoveTemp;
  // DEBUG
  Serial.print("Diff: ");
  if(diff >= 20)
    if(diff >= 40)
      td = -2;
    td = -1;
  if(diff <= -20)
    if(diff <= -40)
      td = 2;
    td = 1;
  td = 0;
bool isPressed()
  val = digitalRead(but);
  if(val == LOW and pressed == false) {
    return false;
  return true;

PyGTK 3, great and embarassing…

By , January 10, 2013 3:30 pm

So, working to get away from WX as my main GUI source and using GTK as I’ve been an Ubnutu, then Mint user with Gnome for years. Building windows in Glade3 was not too bad and the rapid prototyping with Python makes it a great tool. Sadly, the documentation for PyGTK 3 does not exist. There are differences yet the examples that are found are all for PyGTK 2. Don’t believe me? Try finding information on drawing to a window. Most notable difference is the use of Cairo instead of GDK but it just starts there. Anyhow, just venting on what should be a great set up which is made difficult by the lack of documentation.

Animated Cowsay

By , October 29, 2012 8:09 pm

Haven’t done much programming lately so I got an idea to make the cow from the cowsay program move.  After seeing some of the animations, I thought it’d be fun to add a bit of story.  Enjoy!


I’m back!

By , October 14, 2012 1:45 am

Okay, I realize that I have not posted anything new to this blog in about 6 months.  For those of you who are not new to this blog, I apologize.  It’s been a very busy year.  I have picked up a command position for a large company and this has taken most of my time.  And, it’s been a busy year for my civilian job as a corrections officer.  Between those things, this blog has been pushed behind.  But, there are many projects I’m working on so I wanted to post a message saying:

  • I’m alive.
  • I’ll be posting to this blog more frequently.
  • Be prepared for new projects to be showing on these pages soon.

Thank you for your time and pateince!


XFDL in MS Access…

By , June 9, 2012 11:47 pm

Just wanted to pass a link for the updated XFDL in MS Access Project.  Included in the zip are:

AccessXFDL – This folder has a working example of opening an XFDL form in access.  Does not work for all forms yet but will produce a form for most XFDLs.

libxfdl – This is the DLL made for an extension to VBA to take a part XFDL files and return a string of the data.

Here’s the link:


Who Knew…

By , May 14, 2012 2:11 am

Just a fun fact.  Apparently, from The Beatle’s White Album, the song Martha My Dear is inspired Paul McCartney’s Old English Sheepdog. named Martha.  As a sheepdog owner, these dogs are one of my favorite breeds so figured this is a fact worth passing on.  Enjoy the picture as well:

Fun With Photoshop…

By , April 10, 2012 3:27 am

Was a slow night at work so figured I’d have fun with photoshop.  Good thing they hide the identity of these Soldiers!


Don’t be too harsh, this was a quick mish-mash.

Installing OpenCV

By , March 25, 2012 8:02 pm

So tinkering with OpenCV the past day has been fun.  This past summer, a co-worker and I made an application to crop images and resize them automatically to speed up booking at the jail we work at.

The first problem was face detection.  To create a method, we first invert the image.  Then run a line from left to right until the background color changes.  Do the same thing from right to left and then find the center.  Do that several times through the picture would lead us to a good center location for the face.

The second problem was that we did all this with Windows API/GDI.  These methods were very low level and difficult to run simple methods on.

For some reason, we never found OpenCV until reading a slashdot article last night.  This library is awesome for face detection and other visual work.  I use a Linux box at home and the work computers use Windows, so I like that code can be compiled with only changes to the compiler going between each computer.


The install in linux was very easy.  Ubuntu has great documentation for installing anything with apt.  Since I’m using Mint 12 (gotta get away from Gnome 3!), I was able to follow this guide.

For Windows, it was a bit more tricky.  I read guides walking me through CMake and such.  Fortunately, I found that OpenCV 2.0’s installer does not need to be compiled, just extracted.  Using this guide I was able to get it work.  To simplify things, I’ve put two zips on my server for anyone to use.

  1. has the installer for OpenCV 2.0, CMake guide for those using Visual C++, and a sample codeblocks project.
  2. includes the extracted source and a sample codeblocks project.

Let me know if you have any issues.  Remember, for the codeblocks project to compile, you’ll have to sent compiler search directory to [src]/include/opencv and the linker search directory to [src]/lib


FTP is Getting Mean…

By , January 17, 2012 6:52 pm

Just noticed this when timing out on FTP.  Guess FTP gets mean when you ignore it.

FTP Getting Mean...

FTP Getting Mean...

XFDL with PHP 2…

By , January 6, 2012 7:49 am

Recent progress with doing XFDL forms in PHP.  I put some time into this project recently figuring that this web based viewer would be the most applicable.  Think if AKO’s MyForms, a setup where you can pass forms from one user to the next to get it filled out and signed; if that program never needed to leave the web?  With doing XFDL forms in PHP, that is possible!  My code is a mess right now so I will put up the PHP, Javascript for the page on a later post.

For now, go to the old version to see what the forms should be like and go to the new version to see progress on the viewer.

My Nomination

By , December 23, 2011 7:25 am

My nomination for Time’s “Person of the Year.”  The though when I made this image was that the Seal Team 6 Member that shot Osama Bin Laden would be so secreted that he’d have name redacted and even his silhouette would be hiding his eyes.  Enjoy the picture and Merry Christmas!

Time's Person of the Year

My nomination for the person of the year.

wxWidgets and ODBC…

By , November 4, 2011 5:25 pm

Since wxWidgets > 2.8 has dropped wxODBC, I decided to learn how to use sql.h on my own.  I made a simple program to retrieve and print data in C for the command line and everything worked well.  Unfortunately, when I placed this code in my wxWidgets GUI program, it failed.  This was due to wx being unicode, so I had a whole world of learning on how to make sql.h talk with wx.  I’ve outlined the steps to make this work:

With ODBC, sql.h can work with unicode, the functions are the same, but different variables are sent.  WX defines as Unicode (as it’s usually compiled) and ODBC will map the function to the unicode variant.  For example, in a C++ program with #define UNICODE 1, such as WX, SQLDriverConnect will map to SQLDriverConnectW, the unicode variant.  The other option is SQLDriverConnectA which will allow ANSI variables.  Most of the functions you’ll need have an ‘A Variant’, which is what I’ll refer to the functions ending in A.

To Send Data:

  1. Cast your variable as a SQLWCHAR pointer.
  2. Set a string to that pointer, type cast the string too.
  3. Use the functions of ODBC that end with an A.
  4. Send that function a variable type cast as (SQLCHAR*).
SQLWCHAR *connStr;
connStr = (SQLWCHAR*)"DSN=testDB;";
SQLDriverConnectA(dbc, NULL, (SQLCHAR*)connStr, SQL_NTS,
    (SQLCHAR*)outstr, sizeof(outstr), &outstrlen,

To Return Data:

  1. Do the same steps.
SQLWCHAR colName[256];
SQLDescribeColA(hstmt, i+1, (SQLCHAR*)colName, 255, &colNameLen,
      &dataType, &colSize, &numDecimalDigits, &allowsNullValues);

Convert SQLWCHAR to wxString:

  1. Use wxString’s PrintF() function and interpret the variable with a capital S.
SQLWCHAR colName[256];
wxString test;
test.PrintF(_("Column Name: %S"),colName);

Convert wxString to SQLWCHAR:

  1. Declare your buffer variable as SQLCHAR array.
  2. Cycle through each char in wxString and assign to your SQLCHAR array.
  3. Add a null value on the end (so SQL_NTS knows to stop!)
  4. Typecast the variable as a pointer in send.
wxString send = wxT("SELECT * FROM master");
SQLCHAR sqlTest[1024];
unsigned int j;
for(j=0;j<send.Len();j++) {
sqlTest[j] = send[j];
sqlTest[send.Len()] = _T('\0');

SQLPrepareA(hstmt, (SQLCHAR*)sqlTest, SQL_NTS);

Watch Out! Here comes a dart!!

By , October 13, 2011 12:58 am

It’s like if php and java met on a lonely night, dart would be the result.

Google Dart, a new language developed to be the ‘new javascript’ is soon to be available from Google.  Check out the webpage that’s set up to show you the language and give a nice tutorial.  It has an interpreter on the page so you can tinker and get a feel for it.  It seems to me, after playing with the language a bit, it’s like if php and java met on a lonely night, dart would be the result.  An advantage of this language, is unlike HTML5, you will not have to wait for a browser to be made to understand this language.  It can be cross-compiled to javascript on the server side until browsers catch up!  Unfortunately, this is not something I’ve been able to apply to a live server, yet.


By , September 19, 2011 3:34 am

Lately, I have started working on the OpenXFDL project again, concentrating efforts in making a C++ application with WX Widgets that can compile for Windows, Mac, and Linux.  Getting frustrated with libxml2 and wanting to learn more of xpath queries, I decided to make a XFDL reader in PHP.  This can be applied easily as browser/e-mail plugins to view XFDL forms without the need of an external viewer.  I’ve been bad about posting but I’ll work to add more to this blog soon.  For now, here is a sight to try it out with.  Unlike previous stuff, you can do a straight XFDL form instead of converting to XML first.  Try it out!


By , March 26, 2011 12:06 am

I know its been awhile since I’ve posted on here.  About a month ago, I got a new job where I’m working overnights so its been tough getting programming as a hobby in and especially writing as it while I adjust to the new work shift.  Some projects I’ve been working on:

1. I’ve gotten real heavy into using microprocessors.  Recently, I’ve gone to programming on the Arduino to using the ATMega in its own circuit (programmed while on the Arduino board for testing and then once ready to complete, finishing it on its own circuit.)

2. As usual, working on an XFDL for Linux project.  The GUI in WXWidgets is coming along, working out using libxml2 to parse the file, which is taking awhile but its beginning to flow.  Keep checking back for updates as they happen.

3. Finally got a Mac OSX running with xCode in Virtual Box.  I’m going to get back into Objective C and iPhone apps as I get it working more smoothly.

Thank you for checking in, I’ll be posting more regularly from here on out.

Fixing libcoolkey…

By , January 24, 2011 1:49 pm

With my new CAC card, I found that was not working with Firefox correctly.  The new, 144k CAC cards do not play well with the old version of libcoolkey.  I did find that the ‘experimental’ release of libcoolkey will fix this problem, here is the fix:

amd64 (64bit)

sudo su
apt-get purge coolkey libckyapplet1 libckyapplet1-dev
dpkg -i libckyapplet1_1.1.0-7_amd64.deb libckyapplet1-dev_1.1.0-7_amd64.deb coolkey_1.1.0-7_amd64.deb

i386 (32bit)

sudo su
apt-get purge coolkey libckyapplet1 libckyapplet1-dev
dpkg -i libckyapplet1_1.0-7_i386.deb libckyapplet1-dev_1.1.0-7_i386.deb coolkey_1.1.0-7_i386.deb

A side note, if you are registered with, then there is a fix in the project ‘Community CAC’ that includes libcackey which offers a fix for this as well.

Netflix on Linux.

By , January 24, 2011 1:32 pm

Netflix is a great resource for watching videos, particularly the ‘Watch Now’ feature for instant streaming.  Unfortunately, for Linux users, Netflix uses a Microsoft PlayReady, Silverlight plugin for this feature.  This is to protect the content from piracy (arrgh, pirates!!) so they have no problems with copyright.  Too bad for Linux, as this feature is not available in any way, shape, or form.  There is no way to develop a fix for to use this in Linux either, as PlayReady is proprietary.  If this angers you as much as it should any Linux user, that the only work around is to use Windows, then please visit and sign this petition.

#! Statler – b43 driver fix.

By , January 15, 2011 12:45 pm

This week I switched to #! (Crunchbang) because my Ubuntu was getting slow.  I love the speed and was very happy with the wifi because it had the b43 driver working by default.  Except, I could not get on my network after the most recent upgrade, but I found a work-around after a day of reading forums.  Surprisingly, it’s not too complicated!  You just need to create a conf file for b43 to use PIO and it will not through a DMA error anymore… my hardware is: Broadcom Corporation BCM4312 802.11b/g LP-PHY [14e4:4315] (rev 01).  This is the only line you should need.

sudo echo "options b43 pio=0 qos=0" > /etc/modprobe.d/b43.conf

Reference: This article from Ubuntu Forums.

Disappointment with IE.

By , January 10, 2011 10:48 am

A pivotal question in development is whether to use new technology or not. HTML5 and CSS can make great pages but Internet Explorer, being a huge portion of the browsers used, does not handle these except in the most recent versions. A quick google search led me to this page which had a great script to work with this problem. The work around is to create new elements to match HTML5. The detailed analysis is located in the link above.

<!--[if IE]-->
	<script type="text/javascript">
			var html5elmeents = "address|article|aside|audio|canvas|command|datalist|
			for(var i = 0; i < html5elmeents.length; i++){

EDIT: Got the page looking like I want it in IE, Firefox and Chrome/Safari but found the above script was not needed.  I surrounded my HTML5 elements (<header>, <footer>, and <nav>) with <div> tags that include the desired HTML5 element.  This makes for an easy move to HTML5 when it’s more broadly implemented. Example:

<div class="footer">
	<!-- Include the same class name only if you want CSS styling specific to the footer -->
	<footer class="footer">This is my footer text.</footer>
.footer {
	position: absolute;
	background-color: black;

Hallmark Postcard Hoax — Disappointing.

By , December 16, 2010 11:38 am

Today I received a warning e-mail about an e-mail virus.  Immediately I responded to the sender to let me know if they get an e-mail with this attachment because it would be a nice ‘exhibit’ for my ‘virus zoo.’  To explain, I have a computer lab I’ve set up to run and test viruses (correct plural form of virus).  For anyone with interest as to why, it is the best way to understand vx problems and make resolutions.  Additionally, I just find it fun to reverse a virus and do my portion of good Samaritan duty and send any resolutions to the internet so that the virus can be fixed and therefore mitigate the ability of that virus to be destructive.

On the second read, I realized that this was ‘too good to be true’ from the perspective of a virus junkie.  Here is the e-mail with the signs of a hoax highlighted:

You  should be alert during the next few days. Do not  open any message
with an attachment  entitled  ‘POSTCARD FROM  HALLMARK,’regardless of who sent
it  to you.
It  is a virus which opens A POSTCARD  IMAGE, which ‘burns’ the
whole hard  disc C of your  computer.

This  virus will be received  from someone who has your  e-mail address in
his/her  contact list. This is  the reason why you need to send  this e-mail
to all  your contacts. It is better to  receive this  message 25 times than
to receive the  virus and  open it.

If  you receive a mail called’  POSTCARD,’ even though  sent to you by a
friend, do not  open it!
Shut down  your computer immediately. This is  the
worst virus  announced by  CNN.

It  has been classified by  Microsoft as the most  destructive virus ever.
This  virus was discovered  by McAfee yesterday, and there is  no repair yet
for this kind of virus.
This virus  simply destroys  the Zero Sector of
the Hard Disc
,  where the vital  information is  kept.

Here’s a breakdown of that e-mail.  Keep in mind this e-mail was supposedly forwarded from a group that has some decent computer knowledge (enjoy the Christmas color theme!):

  1. which ‘burns’ the whole hard  disc C of your  computer….This virus  simply destroys  the Zero Sector of
    the Hard Disc…

    • Compare these two statements.  Does this virus burn the whole hard disk or the zero sector?
    • Assuming ‘zero sector’ means the Master Boot Record (MBR), that is a small sector of your whole hard drive.
    • Have to ask yourself why just the C: drive and not the whole drive?
  2. Shut down  your computer immediately.
    • This is simply bad advice.
    • If it was a real virus, just don’t open the file and delete the e-mail.
    • On some e-mail clients, e-mail images are automatically opened which means it’s too late anyhow.
  3. This is  the worst virus  announced by  CNN…It  has been classified by  Microsoft as the most  destructive virus ever.
    • I’ll give you the ‘Blog Reader of the Day’ award if anyone can find this virus listed with these phrases from either company!
    • ‘Work Virus’ and ‘Most Destructive Virus Ever‘ seem more than extreme.
    • Frankly, there are worse viruses in the computer world that do worse than erase data on one machine.
  4. The use of ‘psuedo-technological terms’ is  a bad sign.  Refer to the first point about the ‘zero sector’ vs. hard drive issue.

So, after thinking about all of this, I did a google search for ‘hallmark postcard virus’ and without even reading articles realized that this was virus was too good to be true.  Here’s a list of the top results:

  3. Hoax-Slayer
  4. Ezine @rticles
  5. Sophos

To be fair, a couple of those came from a search for ‘zero sector’ which resulted in finding this previously used e-mail (Does this sound familiar?):

You should be alert during the next days: Do not open any message with an attached filed called “Invitation” regardless of who sent it. It is a virus that opens an Olympic Torch which “burns” the whole hard disc C of your computer. This virus will be received from someone who has your e-mail address in his/her contact list, that is why you should send this e-mail to all your contacts. It is better to receive this message 25 times than to receive the virus and open it.

If you receive a mail called “invitation”, though sent by a friend, do not open it and shut down your computer immediately.

This is the worst virus announced by CNN, it has been classified by Microsoft as the most destructive virus ever. This virus was discovered by McAfee yesterday, and there is no repair yet for this kind of virus. This virus simply destroys the Zero Sector of the Hard Disc, where the vital information is kept. SEND THIS E-MAIL TO EVERYONE YOU KNOW, COPY THIS E-MAIL AND SEND IT TO YOUR FRIENDS AND REMEMBER: IF YOU SEND IT TO THEM, YOU WILL BENEFIT ALL OF US

Now, I think it’s pretty well established that this e-mail is a hoax.  The point of this post is just to make the reader aware of the e-mail itself.  Regardless, it is important to remember to update your anti-virus software and use all due caution when opening e-mail attachments.  Several viruses do exist and reproduce in this manner and it is important to realize these consequences are real.

I’m Back…

By , December 13, 2010 9:38 am

Sorry for anyone who watches this site.  After the last server upgrade, this site went offline and I was not able to focus my attention on it until I’d returned from my Army school.  Now that I’m back though, I have several projects getting ready to go, here’s a list of what to expect over the next couple months:

  1. Return to the garmin wardriver project.
  2. A python based minesweeper (ncurses).
  3. XFDL projects (primarily MS Access integration).

That’s just a short list of what is on my mind.  It’s great to be back on-line!

Twitter Programming Thoughts on Twitter RSS RSS

Persephone Theme by Themocracy