📜 ⬆️ ⬇️

How I got a code medal


In 2005, my National Guard unit was sent to Iraq as part of Operation Liberation of Iraq. My army specialty was 92A, which means a specialist in logistics and reserves. My tasks were to order spare parts for mechanics, pick them up, return old ones, deal with hazardous materials, send and receive vehicles and service licenses. And much more. In general, at that time, the entire system spun on ULLS-G (Unit Level Logistics System - Ground, detachment level logistics system - ground), which was then replaced by SAMS-E (Standard Army Maintenance System - Enhanced, extended standard army service system) which, as it happens, used Oracle as a backend. Compared to SAMS-E, the ULLS-G system looked like a dinosaur. I used it a lot in the 4 years I spent in the service. And it was awful. ULLS-G worked on MS-DOS (yep), and most of the computers I used worked on MS-DOS (it was 2000). When we arrived at the location, most computers were already running under WinXP / 2K, so you could run ULLS-G in MS-DOS compatibility mode.

So, ULLS-G was terribly uncomfortable. She did not support the mouse. All communication took place through the keyboard. By the end of the service, I was typing blindly - I remembered all the combinations. One of the most unpleasant features of the program was that it did not support batch operations. If you had to print the licenses of all the soldiers of the unit, you had to print them separately. It was necessary to enter the license number, a window appeared with information about the soldier, after which it was possible to print the license. There were about 150 soldiers in our unit, and in order to print all the licenses I had to print them for each soldier separately. If it was necessary to add information about the qualifications of the soldiers, this also had to be done separately. Usually this is not so annoying, since not so many people pass qualifications at a time. But it so happened that initially the database did not contain data on the qualifications of the soldiers. Therefore, I had to fill in a qualification for each of them and then print his license. For 150 soldiers, it took almost an hour. And, as is customary in the army, it was worse. Before we relocated, we underwent training with different means of transportation, and after each training I had to enter the received qualifications and reprint licenses.

Needless to say, it was annoying. And they also told me that upon arrival at the place of deployment, we would have to go through even more different training sessions with the means of transportation, which meant that I would have to enter all the qualifications again and retype all the licenses. As a programmer, I am constantly looking for ways to simplify my work. I didn’t want to sit down to enter these qualifications and print licenses. I was too lazy for this, and in general it was ineffective. So I decided to do the process automation. At first I tried to understand the ULLS-G file format. It turned out not entirely, mainly due to lack of time (military training and all that). But suddenly, by luck, I came across a page on which someone posted an ODBC driver for ULLS-G. As a result, I could make SQL queries to data from ULLS-G. And I started writing perl scripts for working with data. When we arrived in Iraq, I had a working script that created licenses in the form of text files for all the soldiers. He worked for a couple of seconds. Now the longest part of the process was listing the licenses. But I haven't finished yet. I still didn’t smile adding manual skills. Therefore, I made another script that automatically added data on qualifications to the database. He even had a configuration file where it was possible to specify which qualifications to prescribe to whom.

When we reunited with our unit, I again printed out all the licenses. I still remember how surprised my sergeant was when I returned after 20 minutes with a pile of warm licenses. “Didn’t it take longer for you to do this?” He asked. I started talking about scripts, but he interrupted me after the words Perl, SQL and ODBC, and took the licenses. And it’s good that he didn’t ask further - strictly speaking, I didn’t have permission for these actions. Only licensed specialists could mess with installing ULLS-G.
')
After that, I learned that we have to send daily reports to the Center. They contained a description of the state of our vehicles and any other information. Practically all other departments filled out these reports manually in Excel, then they printed and sent to the Center. As a result, mistakes could creep into them. Every morning I spent half an hour to correct the report and update the information, before printing and sending it to the Center. I remember how a couple of times they screamed at me because there was incorrect information. And it was beginning to annoy me. There should have been a better way to do this. And he was.

Excel could work with ODBC connections registered in Windows, and for me it was already configured when working with Perl scripts with ULLS-G. I used this and wrote a macro for Excel, which placed the data in the fields. The script prescribed all the information on vehicles, as well as a lot of things that other units did not contribute a report, for example, the mileage of vehicles and so on.

In terms of programming, this was not such an achievement. I just found a way to select data from the ULLS-G database. But the command was very impressed, especially the squad leader and sergeant. After 2-3 months of our stay on the spot, we received a new battalion commander. He was very interested in my achievements. After the demonstration, he asked, "Do you know that you should not do this?" I was frightened at first, but he smiled and told me that he did not mind, because it seemed that I knew what I was doing, and the result increased the efficiency of the unit and the accuracy of the reports.

A few more months left before our return from Iraq. My scripts and macros worked with almost no problems. At the end of the service ceremony was held. The commander and the first sergeant arrived to distribute the awards. And I was surprised that I was called because I didn’t expect anything like that (I used to sit on the base; I thought I was doing my job well, but I didn’t think it was worthy of an award. ). After the presentation of the medal "For Distinction", the commander and the first sergeant congratulated me and thanked me. At first, I decided that it was just a thank-you for “good work”, and then I got acquainted with the documents and saw that the squad commander nominated me for rewarding because of my perl scripts and macros for excel. I was pleasantly surprised. Of course, I did not work for the award, but it was nice to know that your work is beneficial.

Source: https://habr.com/ru/post/246885/


All Articles