Friday, January 9, 2015

CS Degree to Army Officer

The mental image you have in your mind of a Computer Science major and an Army Officer are probably very different. I've done both, and you're probably right. A Computer Science degree relates more than you would think.

The one class that was the least tangible was Software Engineering. This class proved to be the one that related to my time as an officer the most. Project development fundamentals were applied every day. The term "layers of complexity" is commonly brought up when developing software and sorting through abstraction. It is a core structure to the hierarchical organization of the Army.
  • Colonel - Ensures that their 2100 personnel are fully trained over a two year period
  • Lieutenant Colonel -  Ensures that their 700 personnel are trained over a one year period
  • Major - Ensures that all the training areas and equipment is on hand to conduct training
  • Captain - Ensures their 120 personnel are trained over the 90 day training period
  • Lieutenant - Ensures their 30 personnel are trained over a two week training period
  • Sergeant - Ensures their personnel are present for that day's training

Field Manual 1-02 even establishes how to graphically represent these various levels and the actions they can perform with symbols, the military's own version of UML.

Working in Operations Development and abiding by extensive manuals was a bit daunting. Doing things the sensible way and doing things the doctrine way were often very different. Efficient personnel knew this, but doctrine wins out.

Executing an Operations Order is rarely difficult. Writing one that is easy to understand is not difficult. Writing one that specifies all the details can be incredibly difficult. Re-using old portions of well written op-orders was an encourages practice or even mandatory. While writing op-orders I had to realize that I could take nothing for granted. I had to cast units to fit the form of other units, had to use temporary names, and even conditionals. The ideas of code re-use and other software engineering principles applied regularly.

Promotion focused people tended to use fear driven development. I had plenty of examples how to not manage projects, but still a few that were thankfully on the other end of the spectrum.

A Computer Science degree involves a lot of data science. The skill most noticeable to my coworkers and most appreciated by my superiors was my ability to organize information and develop systems to process information. Building a spreadsheet to monitor 273 personnel through 13 different gates that could be filled out with check boxes and would note any outliers and give a rollup of the progress of the 6-sub units? Took a few hours. Automatically generating a schedule to put 21 squads though 19 different stations over a 3 day period and color coded? Have to use a recent version of Excel, but it was doable.

In the process of distributing information I did educate my units on the terms border cases, special cases, and layers of abstraction. They are hugely important to handling various data, but rarely discussed outside Software Engineering. I cracked a smile every time I heard those terms used after I introduced them.


Using software in the military was generally teeth grinding. Software was not developed to be easy to use or learn, but instead to fill a list of requirements. The software ended up suffering from feature creep. Finding my own HR related details on AKO required a dozen or more steps and logins to other sites that were supposed to be integrated. AFATDS required manuals thicker than any language or compiler that I've ever came across. Although working with software that could put 100 lbs of explosives 30 miles away that was precise enough to account for variations in gravity was pretty cool.

Wednesday, December 31, 2014

It has been a long six years.

Six years ago was a long time ago.


I've been outside of Computer Science and coding for six years. As someone looking from outside there has been a lot of changes in that time. To someone on the inside these changes seem small and iterative, but some truly impressive gains have been made.

Ever more languages directly implement concurrency and parallelism (Go & Swift), but now OoO seems to be the future.


Stack Overflow went from an announcement to 560 million page views a month. Before SO, searches for help with code would take me to sketchy forums or to some professor's website that was straight text and read like the ingredients on a cereal box. My SO profile is some sort of artifact. I wonder if someday it will be worth anything like low ICQ numbers were, hmm.


Github. Woah, a social network centered around a bunch of traditionally non-social people. I need to get a few projects from this blog on there. Really awesome use of the social network idea though.

Debian had three stable releases, PHP and Perl have not had a major revision, Google shut down countless services, Wikipedia went from 14 GB to 50 GB and we're all still using X.org to view web pages through ever more powerful browsers.

I've started using an actual IDE and won't go back to a simple text editor. I do some things that aren't completely Ada related and I'm okay with that, although I will still write Ada, but save_with_another_file_extension.c I just do it for the libraries. Dijkstra's ideas apply regardless of file extension.

I think the idea that functional programming is the future has finally subsided. Seriously, it had 40 years, if it were going to happen it would have happened by now. The JVM no longer has a new language to run every other day either.

Have I become more knowledgeable or has /r/Programming declined? Some of its thunder is now shared with Hacker News but the two of them together seem to have less interesting content than /r/Programming did six years ago.

Me? Well, I wore a uniform for a while, learned how to put 100 lbs of explosives 20 miles away, spent a year in a far away land, lifted some heavy things, and now back to assembling Legos through my keyboard.

Friday, April 11, 2014

More of the same!




Very funny. Probably something to do with cygwin.

Monday, October 27, 2008

Ada library listing

The Ada library contains a lot of interesting libraries, but it is very hard to comprehend names like "a-szfzha.ads" and "a-ztinio.ads" (those two files correspond to Ada.Strings.Wide_Wide_Fixed.Wide_Wide_Hash and Ada.Wide_Wide_Text_IO.Integer_IO).

The following script will make any directory with .ads files much easier to understand. The output is HTML with one column of file names next to a column of the corresponding package name. Redirect it with "> GNAT_Library.html" for output as a file, or you can even redirect it to a browser. I imagine it would be possible to leverage AdaBrowse in this, but that is a project for a later date. Save this to a file, make it executable, and try it out.


Thanks to caracal of #ada @ freenode for completing the HTML and finishing off the parts for generic packages.

I've left the line for Debian's GNAT because that is what I use. This will work on any directory with .ads files in it.

Sunday, June 8, 2008

Speak Ada! Speak!

Text to speech was a valuable tool in a recent class. It made for great debugging information when no visual interaction was possible, and was a helpful feature in the final application. The text to speech system used there was easy to program dedicated hardware. I may be a hardware junkie, but I'm pretty sure I can get by with a software solution.

After a bit of searching around I found Festival. Festival is available as a package for Linux and seems to be pretty mature. I installed festival and read through a tutorial on it. Some reading needed to be done to understand the parameters in GNAT.OS_Lib. After a bit of examining the code it made sense.

First needed to make a script to translate the way Ada's spawning passes parameters into the way Festival takes input.
(festival_helper.sh)

Simple shell script that needs to be saved and be made executable. "./festival_helper.sh "your text goes here"" will call festival.

The Ada part was a bit kludgy with how the parameters were passed, but nothing too bad.
(festival_demo.adb)


I'd like to think that is pretty straightforward...

I doubt this is the most efficient way. Some magic with bash scripts could easily be more efficient. Instead of re-spawning Festival with every call another possible approach might be to use Festival's --server and send over the network. I've dabbled with interfacing directly with the Festival C++ API, but my understanding of C++ compiler messages is limited. I had to do some shoehorning to get a gcc on this system, so that might be a problem as well.

It works, its simple, I'm happy.

Saturday, January 12, 2008

Avoiding rendezvous to delay starting of tasks

A common problem I encounter is that something needs to be done before task can start running. I've always solved that by using a Start entry on tasks and calling that entry when it is safe for them to start. Calling entries works fine but I'd like to think the following is a bit neater:
(declare_task_test.adb)

Instead of delaying when the tasks start, delay when the tasks are declared.

Friday, January 11, 2008

Full XML Parser for Wikis

You may want a primer on parsing XML with Ada. That is an... okay... example, but better than many Ada packages have on the web. The following is a more complete, but more complicated example. In XML/Ada you supply an object to the parser that provides the rules for how to parse the document. It is a pretty easy to work with and extend. This code was some of the earliest I started writing in this whole adventure. I waited to finalize it until now so I could completely figure out how the client code would work with it.

This is the client to the XML/Ada library and makes use of the parser object posted below: (test_wiki_parser.adb)

This uses the Input_Sources.Large_File posted earlier. This entire program boils down to:
  • Tell parser what to do
  • Open file
  • Parse file
  • Close file

(wiki_reader.ads)

(wiki_reader.adb)

I tried passing the two processes (Document_Process & Collection_Process) at the declaration of Wiki_Parser, but evidently Ada does not like access types being passed there (and a compiler bug). I could possibly wrap them in a record and pass them through that also. I think this way is not the preferred way, but it works.

Yay closures.

This combo fully parses the new 14 GB version of Wikipedia in 25 minutes. This is not the exact version that will be used in the final product. The Full_Document type will be declared elsewhere. Other than that all the code above will be included.