News





Table 12;

We've all encountered database tables that look like this:

  ID    Data
  ----- --------------------------------------------
  00001 TRUE, FALSE, FILE_NOT_FOUND
  00002 MALE|FEMALE|TRANS|EUNUCH|OTHER|M|Q|female|Female|male|Male|$
  00003 <?xml version="1.0" encoding="UTF-8"?><item id="1234"><name "Widget"/>...</item>
  00004 1234|Fred,Lena,Dana||||||||||||1.3DEp42|

Oh the joy of figuring out what each field of each row represents. The fun of deciphering the code that writes and reads/parses each row of data. In a moment, you will fondly look back on that experience as the Good-Old-Days.

People waving the Canadian Flag

The task of administering elections in the Great White North is handled by the appropriately-named agency Elections Canada. As part of their mandate, they provide the results of past elections in granular detail, both as nicely formatted web pages and as downloadable raw files. The latter are meant to be used by researchers for studying how turnout varies across provinces, ages, races, etc., as well as arguing about the merits of proportional representation versus single transferable votes; and so forth.

One of the more comprehensive data files is descriptively known as Table-Twelve, and it contains a record for every candidate who ran in the election. Each record contains how many votes they got, the riding (electoral district) in which they competed, their affiliated party, home town, occupation, and hundreds of other details about the candidate. This file has been published for every election since the 38th general in 2004. Vicki was charged with creating a new parser for this data.

Table-Twelve is a CSV file in the same way that managers describe their new agile process as <details of waterfall here>. While parsing a CSV file in general is no big deal, writing a function to parse this data was far harder than she expected. For one thing, the column titles change from year to year. One might think Who cares, as long as the data is in the same sequence. One would be wrong. As an example, depending upon the year, the identifier for the electoral district might be in a column named "Electoral District Name", "Electoral District" or "District", and might contain a string representing the district name, or a numeric district identifier, either of which may or may not be enclosed in single or double quotes. Just to make it interesting, some of the quoted strings have commas, and some of the numbers are commafied as well.

Further inspection revealed that the columns are not only inconsistently named, but named so as to be completely misleading. There's a column labeled "Majority". If you're thinking that it contains a boolean to indicate whether the candidate got a majority, or 50%+1 of the number of cast votes (i.e.: "How many votes do you need for a majority?"), you'd be mistaken. Nor is it even a slight misuse (where it should have been "Plurality"). Instead, it's the delta between the winning candidate and the second-place candidate in that riding. They also helpfully give you the quotient of this delta to the total cast votes as the "Majority Percentage".

Canada has a parliamentary system; it's also important to know how many candidates of each party won, so the party designation is obviously going to be easy to access, right? Or maybe you'd like to sort by surname? Well, it turns out that the party is appended to the field containing the candidate's name, delimited with a single space (and possibly an asterisk if they were incumbent). But the candidate's name and the party are already each a variable number of words (some have middle names or two surnames) delimited by single spaces. The party name, however, must be given in both English and French, separated by a forward slash. Of course, some parties already have a slash in their name! Oh, and if the candidate didn't run as a member of a party, they might be listed as "Independent" or as "No affiliation"; both are used in any given file.

Above and beyond the call of making something difficult to parse, the files are full of French accented text, so the encoding changes from file to file, here ISO-8859, there UTF-8, over there a BOM or two.

Don't get me wrong, I've written parsers for this sort of garbage by creating a bunch of routines to do trivial parsing and using them for larger logical parsers, and so on until you can parse all of the fields in an entire row, and all the special cases that spew forth. But the files they were supposed to parse were consistent from one day to the next.

Vicki is considering pulling out all of her hair, braiding it together and using it to hang the person who designed Table-Twelve.

[Advertisement] High availability, Load-balanced or Basic – design your own Universal Package Manager, allow the enterprise to scale as you grow. Download and see for yourself!


CodeSOD: The Nuclear Option;

About a decade ago, Gerald worked at a European nuclear plant. There was a “minor” issue where a controller connected to a high-voltage power supply would start missing out on status messages. “Minor”, because it didn’t really pose a risk to life and limb- but still, any malfunction with a controller attached to a high-voltage power supply in a nuclear power plant needs to be addressed.

So Gerald went off and got the code. It was on a file share, in a file called final.zip. Or, wait, was it in the file called real-final.zip? Or installed.zip? Or, finalnew.zip?

It took a few tries, but eventually he picked out the correct one. To his surprise, in addition to the .c and .h files he expected to see, there was also a mysterious .xls. And that’s where things went bad.

Pause for a moment to consider a problem: you receive a byte containing an set of flags to represent an error code. So, you need to check each individual bit to understand what the exact error is. At this point, you’re probably reaching for a bitshift operator, because that’s the easiest way to do it.

I want you to imagine, for a moment, however, that you don’t really know C, or bitwise operations, or even what a bit is. Instead, you know two things: that there are 255 possible error codes, and how to use Excel. With those gaps in knowledge, you might perhaps, just manually write an Excel spreadsheet with every possible option, using Excel's range-drag operation to fill in the columns with easily predictable values. You might do this for 254 rows of data. Which, as a note, the range of possible values is 255, so guess what was causing the error?

if (variable==   0       ) {     a=      0       ; b=    0       ; c=    0       ; d=    0       ;e=      0       ;f=     0       ;g=     0       ;h=     0       ;}
if (variable==   1       ) {     a=      1       ; b=    0       ; c=    0       ; d=    0       ;e=      0       ;f=     0       ;g=     0       ;h=     0       ;}
if (variable==   2       ) {     a=      0       ; b=    1       ; c=    0       ; d=    0       ;e=      0       ;f=     0       ;g=     0       ;h=     0       ;}
if (variable==   3       ) {     a=      1       ; b=    1       ; c=    0       ; d=    0       ;e=      0       ;f=     0       ;g=     0       ;h=     0       ;}
if (variable==   4       ) {     a=      0       ; b=    0       ; c=    1       ; d=    0       ;e=      0       ;f=     0       ;g=     0       ;h=     0       ;}
if (variable==   5       ) {     a=      1       ; b=    0       ; c=    1       ; d=    0       ;e=      0       ;f=     0       ;g=     0       ;h=     0       ;}
if (variable==   6       ) {     a=      0       ; b=    1       ; c=    1       ; d=    0       ;e=      0       ;f=     0       ;g=     0       ;h=     0       ;}
if (variable==   7       ) {     a=      1       ; b=    1       ; c=    1       ; d=    0       ;e=      0       ;f=     0       ;g=     0       ;h=     0       ;}
if (variable==   8       ) {     a=      0       ; b=    0       ; c=    0       ; d=    1       ;e=      0       ;f=     0       ;g=     0       ;h=     0       ;}
if (variable==   9       ) {     a=      1       ; b=    0       ; c=    0       ; d=    1       ;e=      0       ;f=     0       ;g=     0       ;h=     0       ;}
if (variable==   10      ) {     a=      0       ; b=    1       ; c=    0       ; d=    1       ;e=      0       ;f=     0       ;g=     0       ;h=     0       ;}
if (variable==   11      ) {     a=      1       ; b=    1       ; c=    0       ; d=    1       ;e=      0       ;f=     0       ;g=     0       ;h=     0       ;}
if (variable==   12      ) {     a=      0       ; b=    0       ; c=    1       ; d=    1       ;e=      0       ;f=     0       ;g=     0       ;h=     0       ;}
if (variable==   13      ) {     a=      1       ; b=    0       ; c=    1       ; d=    1       ;e=      0       ;f=     0       ;g=     0       ;h=     0       ;}
if (variable==   14      ) {     a=      0       ; b=    1       ; c=    1       ; d=    1       ;e=      0       ;f=     0       ;g=     0       ;h=     0       ;}
if (variable==   15      ) {     a=      1       ; b=    1       ; c=    1       ; d=    1       ;e=      0       ;f=     0       ;g=     0       ;h=     0       ;}
if (variable==   16      ) {     a=      0       ; b=    0       ; c=    0       ; d=    0       ;e=      1       ;f=     0       ;g=     0       ;h=     0       ;}
if (variable==   17      ) {     a=      1       ; b=    0       ; c=    0       ; d=    0       ;e=      1       ;f=     0       ;g=     0       ;h=     0       ;}
if (variable==   18      ) {     a=      0       ; b=    1       ; c=    0       ; d=    0       ;e=      1       ;f=     0       ;g=     0       ;h=     0       ;}
if (variable==   19      ) {     a=      1       ; b=    1       ; c=    0       ; d=    0       ;e=      1       ;f=     0       ;g=     0       ;h=     0       ;}
if (variable==   20      ) {     a=      0       ; b=    0       ; c=    1       ; d=    0       ;e=      1       ;f=     0       ;g=     0       ;h=     0       ;}
if (variable==   21      ) {     a=      1       ; b=    0       ; c=    1       ; d=    0       ;e=      1       ;f=     0       ;g=     0       ;h=     0       ;}
if (variable==   22      ) {     a=      0       ; b=    1       ; c=    1       ; d=    0       ;e=      1       ;f=     0       ;g=     0       ;h=     0       ;}
if (variable==   23      ) {     a=      1       ; b=    1       ; c=    1       ; d=    0       ;e=      1       ;f=     0       ;g=     0       ;h=     0       ;}
if (variable==   24      ) {     a=      0       ; b=    0       ; c=    0       ; d=    1       ;e=      1       ;f=     0       ;g=     0       ;h=     0       ;}
if (variable==   25      ) {     a=      1       ; b=    0       ; c=    0       ; d=    1       ;e=      1       ;f=     0       ;g=     0       ;h=     0       ;}
if (variable==   26      ) {     a=      0       ; b=    1       ; c=    0       ; d=    1       ;e=      1       ;f=     0       ;g=     0       ;h=     0       ;}
if (variable==   27      ) {     a=      1       ; b=    1       ; c=    0       ; d=    1       ;e=      1       ;f=     0       ;g=     0       ;h=     0       ;}
if (variable==   28      ) {     a=      0       ; b=    0       ; c=    1       ; d=    1       ;e=      1       ;f=     0       ;g=     0       ;h=     0       ;}
if (variable==   29      ) {     a=      1       ; b=    0       ; c=    1       ; d=    1       ;e=      1       ;f=     0       ;g=     0       ;h=     0       ;}
if (variable==   30      ) {     a=      0       ; b=    1       ; c=    1       ; d=    1       ;e=      1       ;f=     0       ;g=     0       ;h=     0       ;}
if (variable==   31      ) {     a=      1       ; b=    1       ; c=    1       ; d=    1       ;e=      1       ;f=     0       ;g=     0       ;h=     0       ;}
if (variable==   32      ) {     a=      0       ; b=    0       ; c=    0       ; d=    0       ;e=      0       ;f=     1       ;g=     0       ;h=     0       ;}
if (variable==   33      ) {     a=      1       ; b=    0       ; c=    0       ; d=    0       ;e=      0       ;f=     1       ;g=     0       ;h=     0       ;}
if (variable==   34      ) {     a=      0       ; b=    1       ; c=    0       ; d=    0       ;e=      0       ;f=     1       ;g=     0       ;h=     0       ;}
if (variable==   35      ) {     a=      1       ; b=    1       ; c=    0       ; d=    0       ;e=      0       ;f=     1       ;g=     0       ;h=     0       ;}
if (variable==   36      ) {     a=      0       ; b=    0       ; c=    1       ; d=    0       ;e=      0       ;f=     1       ;g=     0       ;h=     0       ;}
if (variable==   37      ) {     a=      1       ; b=    0       ; c=    1       ; d=    0       ;e=      0       ;f=     1       ;g=     0       ;h=     0       ;}
if (variable==   38      ) {     a=      0       ; b=    1       ; c=    1       ; d=    0       ;e=      0       ;f=     1       ;g=     0       ;h=     0       ;}
if (variable==   39      ) {     a=      1       ; b=    1       ; c=    1       ; d=    0       ;e=      0       ;f=     1       ;g=     0       ;h=     0       ;}
if (variable==   40      ) {     a=      0       ; b=    0       ; c=    0       ; d=    1       ;e=      0       ;f=     1       ;g=     0       ;h=     0       ;}
if (variable==   41      ) {     a=      1       ; b=    0       ; c=    0       ; d=    1       ;e=      0       ;f=     1       ;g=     0       ;h=     0       ;}
if (variable==   42      ) {     a=      0       ; b=    1       ; c=    0       ; d=    1       ;e=      0       ;f=     1       ;g=     0       ;h=     0       ;}
if (variable==   43      ) {     a=      1       ; b=    1       ; c=    0       ; d=    1       ;e=      0       ;f=     1       ;g=     0       ;h=     0       ;}
if (variable==   44      ) {     a=      0       ; b=    0       ; c=    1       ; d=    1       ;e=      0       ;f=     1       ;g=     0       ;h=     0       ;}
if (variable==   45      ) {     a=      1       ; b=    0       ; c=    1       ; d=    1       ;e=      0       ;f=     1       ;g=     0       ;h=     0       ;}
if (variable==   46      ) {     a=      0       ; b=    1       ; c=    1       ; d=    1       ;e=      0       ;f=     1       ;g=     0       ;h=     0       ;}
if (variable==   47      ) {     a=      1       ; b=    1       ; c=    1       ; d=    1       ;e=      0       ;f=     1       ;g=     0       ;h=     0       ;}
if (variable==   48      ) {     a=      0       ; b=    0       ; c=    0       ; d=    0       ;e=      1       ;f=     1       ;g=     0       ;h=     0       ;}
if (variable==   49      ) {     a=      1       ; b=    0       ; c=    0       ; d=    0       ;e=      1       ;f=     1       ;g=     0       ;h=     0       ;}
if (variable==   50      ) {     a=      0       ; b=    1       ; c=    0       ; d=    0       ;e=      1       ;f=     1       ;g=     0       ;h=     0       ;}
if (variable==   51      ) {     a=      1       ; b=    1       ; c=    0       ; d=    0       ;e=      1       ;f=     1       ;g=     0       ;h=     0       ;}
if (variable==   52      ) {     a=      0       ; b=    0       ; c=    1       ; d=    0       ;e=      1       ;f=     1       ;g=     0       ;h=     0       ;}
if (variable==   53      ) {     a=      1       ; b=    0       ; c=    1       ; d=    0       ;e=      1       ;f=     1       ;g=     0       ;h=     0       ;}
if (variable==   54      ) {     a=      0       ; b=    1       ; c=    1       ; d=    0       ;e=      1       ;f=     1       ;g=     0       ;h=     0       ;}
if (variable==   55      ) {     a=      1       ; b=    1       ; c=    1       ; d=    0       ;e=      1       ;f=     1       ;g=     0       ;h=     0       ;}
if (variable==   56      ) {     a=      0       ; b=    0       ; c=    0       ; d=    1       ;e=      1       ;f=     1       ;g=     0       ;h=     0       ;}
if (variable==   57      ) {     a=      1       ; b=    0       ; c=    0       ; d=    1       ;e=      1       ;f=     1       ;g=     0       ;h=     0       ;}
if (variable==   58      ) {     a=      0       ; b=    1       ; c=    0       ; d=    1       ;e=      1       ;f=     1       ;g=     0       ;h=     0       ;}
if (variable==   59      ) {     a=      1       ; b=    1       ; c=    0       ; d=    1       ;e=      1       ;f=     1       ;g=     0       ;h=     0       ;}
if (variable==   60      ) {     a=      0       ; b=    0       ; c=    1       ; d=    1       ;e=      1       ;f=     1       ;g=     0       ;h=     0       ;}
if (variable==   61      ) {     a=      1       ; b=    0       ; c=    1       ; d=    1       ;e=      1       ;f=     1       ;g=     0       ;h=     0       ;}
if (variable==   62      ) {     a=      0       ; b=    1       ; c=    1       ; d=    1       ;e=      1       ;f=     1       ;g=     0       ;h=     0       ;}
if (variable==   63      ) {     a=      1       ; b=    1       ; c=    1       ; d=    1       ;e=      1       ;f=     1       ;g=     0       ;h=     0       ;}
if (variable==   64      ) {     a=      0       ; b=    0       ; c=    0       ; d=    0       ;e=      0       ;f=     0       ;g=     1       ;h=     0       ;}
if (variable==   65      ) {     a=      1       ; b=    0       ; c=    0       ; d=    0       ;e=      0       ;f=     0       ;g=     1       ;h=     0       ;}
if (variable==   66      ) {     a=      0       ; b=    1       ; c=    0       ; d=    0       ;e=      0       ;f=     0       ;g=     1       ;h=     0       ;}
if (variable==   67      ) {     a=      1       ; b=    1       ; c=    0       ; d=    0       ;e=      0       ;f=     0       ;g=     1       ;h=     0       ;}
if (variable==   68      ) {     a=      0       ; b=    0       ; c=    1       ; d=    0       ;e=      0       ;f=     0       ;g=     1       ;h=     0       ;}
if (variable==   69      ) {     a=      1       ; b=    0       ; c=    1       ; d=    0       ;e=      0       ;f=     0       ;g=     1       ;h=     0       ;}
if (variable==   70      ) {     a=      0       ; b=    1       ; c=    1       ; d=    0       ;e=      0       ;f=     0       ;g=     1       ;h=     0       ;}
if (variable==   71      ) {     a=      1       ; b=    1       ; c=    1       ; d=    0       ;e=      0       ;f=     0       ;g=     1       ;h=     0       ;}
if (variable==   72      ) {     a=      0       ; b=    0       ; c=    0       ; d=    1       ;e=      0       ;f=     0       ;g=     1       ;h=     0       ;}
if (variable==   73      ) {     a=      1       ; b=    0       ; c=    0       ; d=    1       ;e=      0       ;f=     0       ;g=     1       ;h=     0       ;}
if (variable==   74      ) {     a=      0       ; b=    1       ; c=    0       ; d=    1       ;e=      0       ;f=     0       ;g=     1       ;h=     0       ;}
if (variable==   75      ) {     a=      1       ; b=    1       ; c=    0       ; d=    1       ;e=      0       ;f=     0       ;g=     1       ;h=     0       ;}
if (variable==   76      ) {     a=      0       ; b=    0       ; c=    1       ; d=    1       ;e=      0       ;f=     0       ;g=     1       ;h=     0       ;}
if (variable==   77      ) {     a=      1       ; b=    0       ; c=    1       ; d=    1       ;e=      0       ;f=     0       ;g=     1       ;h=     0       ;}
if (variable==   78      ) {     a=      0       ; b=    1       ; c=    1       ; d=    1       ;e=      0       ;f=     0       ;g=     1       ;h=     0       ;}
if (variable==   79      ) {     a=      1       ; b=    1       ; c=    1       ; d=    1       ;e=      0       ;f=     0       ;g=     1       ;h=     0       ;}
if (variable==   80      ) {     a=      0       ; b=    0       ; c=    0       ; d=    0       ;e=      1       ;f=     0       ;g=     1       ;h=     0       ;}
if (variable==   81      ) {     a=      1       ; b=    0       ; c=    0       ; d=    0       ;e=      1       ;f=     0       ;g=     1       ;h=     0       ;}
if (variable==   82      ) {     a=      0       ; b=    1       ; c=    0       ; d=    0       ;e=      1       ;f=     0       ;g=     1       ;h=     0       ;}
if (variable==   83      ) {     a=      1       ; b=    1       ; c=    0       ; d=    0       ;e=      1       ;f=     0       ;g=     1       ;h=     0       ;}
if (variable==   84      ) {     a=      0       ; b=    0       ; c=    1       ; d=    0       ;e=      1       ;f=     0       ;g=     1       ;h=     0       ;}
if (variable==   85      ) {     a=      1       ; b=    0       ; c=    1       ; d=    0       ;e=      1       ;f=     0       ;g=     1       ;h=     0       ;}
if (variable==   86      ) {     a=      0       ; b=    1       ; c=    1       ; d=    0       ;e=      1       ;f=     0       ;g=     1       ;h=     0       ;}
if (variable==   87      ) {     a=      1       ; b=    1       ; c=    1       ; d=    0       ;e=      1       ;f=     0       ;g=     1       ;h=     0       ;}
if (variable==   88      ) {     a=      0       ; b=    0       ; c=    0       ; d=    1       ;e=      1       ;f=     0       ;g=     1       ;h=     0       ;}
if (variable==   89      ) {     a=      1       ; b=    0       ; c=    0       ; d=    1       ;e=      1       ;f=     0       ;g=     1       ;h=     0       ;}
if (variable==   90      ) {     a=      0       ; b=    1       ; c=    0       ; d=    1       ;e=      1       ;f=     0       ;g=     1       ;h=     0       ;}
if (variable==   91      ) {     a=      1       ; b=    1       ; c=    0       ; d=    1       ;e=      1       ;f=     0       ;g=     1       ;h=     0       ;}
if (variable==   92      ) {     a=      0       ; b=    0       ; c=    1       ; d=    1       ;e=      1       ;f=     0       ;g=     1       ;h=     0       ;}
if (variable==   93      ) {     a=      1       ; b=    0       ; c=    1       ; d=    1       ;e=      1       ;f=     0       ;g=     1       ;h=     0       ;}
if (variable==   94      ) {     a=      0       ; b=    1       ; c=    1       ; d=    1       ;e=      1       ;f=     0       ;g=     1       ;h=     0       ;}
if (variable==   95      ) {     a=      1       ; b=    1       ; c=    1       ; d=    1       ;e=      1       ;f=     0       ;g=     1       ;h=     0       ;}
if (variable==   96      ) {     a=      0       ; b=    0       ; c=    0       ; d=    0       ;e=      0       ;f=     1       ;g=     1       ;h=     0       ;}
if (variable==   97      ) {     a=      1       ; b=    0       ; c=    0       ; d=    0       ;e=      0       ;f=     1       ;g=     1       ;h=     0       ;}
if (variable==   98      ) {     a=      0       ; b=    1       ; c=    0       ; d=    0       ;e=      0       ;f=     1       ;g=     1       ;h=     0       ;}
if (variable==   99      ) {     a=      1       ; b=    1       ; c=    0       ; d=    0       ;e=      0       ;f=     1       ;g=     1       ;h=     0       ;}
if (variable==   100     ) {     a=      0       ; b=    0       ; c=    1       ; d=    0       ;e=      0       ;f=     1       ;g=     1       ;h=     0       ;}
if (variable==   101     ) {     a=      1       ; b=    0       ; c=    1       ; d=    0       ;e=      0       ;f=     1       ;g=     1       ;h=     0       ;}
if (variable==   102     ) {     a=      0       ; b=    1       ; c=    1       ; d=    0       ;e=      0       ;f=     1       ;g=     1       ;h=     0       ;}
if (variable==   103     ) {     a=      1       ; b=    1       ; c=    1       ; d=    0       ;e=      0       ;f=     1       ;g=     1       ;h=     0       ;}
if (variable==   104     ) {     a=      0       ; b=    0       ; c=    0       ; d=    1       ;e=      0       ;f=     1       ;g=     1       ;h=     0       ;}
if (variable==   105     ) {     a=      1       ; b=    0       ; c=    0       ; d=    1       ;e=      0       ;f=     1       ;g=     1       ;h=     0       ;}
if (variable==   106     ) {     a=      0       ; b=    1       ; c=    0       ; d=    1       ;e=      0       ;f=     1       ;g=     1       ;h=     0       ;}
if (variable==   107     ) {     a=      1       ; b=    1       ; c=    0       ; d=    1       ;e=      0       ;f=     1       ;g=     1       ;h=     0       ;}
if (variable==   108     ) {     a=      0       ; b=    0       ; c=    1       ; d=    1       ;e=      0       ;f=     1       ;g=     1       ;h=     0       ;}
if (variable==   109     ) {     a=      1       ; b=    0       ; c=    1       ; d=    1       ;e=      0       ;f=     1       ;g=     1       ;h=     0       ;}
if (variable==   110     ) {     a=      0       ; b=    1       ; c=    1       ; d=    1       ;e=      0       ;f=     1       ;g=     1       ;h=     0       ;}
if (variable==   111     ) {     a=      1       ; b=    1       ; c=    1       ; d=    1       ;e=      0       ;f=     1       ;g=     1       ;h=     0       ;}
if (variable==   112     ) {     a=      0       ; b=    0       ; c=    0       ; d=    0       ;e=      1       ;f=     1       ;g=     1       ;h=     0       ;}
if (variable==   113     ) {     a=      1       ; b=    0       ; c=    0       ; d=    0       ;e=      1       ;f=     1       ;g=     1       ;h=     0       ;}
if (variable==   114     ) {     a=      0       ; b=    1       ; c=    0       ; d=    0       ;e=      1       ;f=     1       ;g=     1       ;h=     0       ;}
if (variable==   115     ) {     a=      1       ; b=    1       ; c=    0       ; d=    0       ;e=      1       ;f=     1       ;g=     1       ;h=     0       ;}
if (variable==   116     ) {     a=      0       ; b=    0       ; c=    1       ; d=    0       ;e=      1       ;f=     1       ;g=     1       ;h=     0       ;}
if (variable==   117     ) {     a=      1       ; b=    0       ; c=    1       ; d=    0       ;e=      1       ;f=     1       ;g=     1       ;h=     0       ;}
if (variable==   118     ) {     a=      0       ; b=    1       ; c=    1       ; d=    0       ;e=      1       ;f=     1       ;g=     1       ;h=     0       ;}
if (variable==   119     ) {     a=      1       ; b=    1       ; c=    1       ; d=    0       ;e=      1       ;f=     1       ;g=     1       ;h=     0       ;}
if (variable==   120     ) {     a=      0       ; b=    0       ; c=    0       ; d=    1       ;e=      1       ;f=     1       ;g=     1       ;h=     0       ;}
if (variable==   121     ) {     a=      1       ; b=    0       ; c=    0       ; d=    1       ;e=      1       ;f=     1       ;g=     1       ;h=     0       ;}
if (variable==   122     ) {     a=      0       ; b=    1       ; c=    0       ; d=    1       ;e=      1       ;f=     1       ;g=     1       ;h=     0       ;}
if (variable==   123     ) {     a=      1       ; b=    1       ; c=    0       ; d=    1       ;e=      1       ;f=     1       ;g=     1       ;h=     0       ;}
if (variable==   124     ) {     a=      0       ; b=    0       ; c=    1       ; d=    1       ;e=      1       ;f=     1       ;g=     1       ;h=     0       ;}
if (variable==   125     ) {     a=      1       ; b=    0       ; c=    1       ; d=    1       ;e=      1       ;f=     1       ;g=     1       ;h=     0       ;}
if (variable==   126     ) {     a=      0       ; b=    1       ; c=    1       ; d=    1       ;e=      1       ;f=     1       ;g=     1       ;h=     0       ;}
if (variable==   127     ) {     a=      1       ; b=    1       ; c=    1       ; d=    1       ;e=      1       ;f=     1       ;g=     1       ;h=     0       ;}
if (variable==   128     ) {     a=      0       ; b=    0       ; c=    0       ; d=    0       ;e=      0       ;f=     0       ;g=     0       ;h=     1       ;}
if (variable==   129     ) {     a=      1       ; b=    0       ; c=    0       ; d=    0       ;e=      0       ;f=     0       ;g=     0       ;h=     1       ;}
if (variable==   130     ) {     a=      0       ; b=    1       ; c=    0       ; d=    0       ;e=      0       ;f=     0       ;g=     0       ;h=     1       ;}
if (variable==   131     ) {     a=      1       ; b=    1       ; c=    0       ; d=    0       ;e=      0       ;f=     0       ;g=     0       ;h=     1       ;}
if (variable==   132     ) {     a=      0       ; b=    0       ; c=    1       ; d=    0       ;e=      0       ;f=     0       ;g=     0       ;h=     1       ;}
if (variable==   133     ) {     a=      1       ; b=    0       ; c=    1       ; d=    0       ;e=      0       ;f=     0       ;g=     0       ;h=     1       ;}
if (variable==   134     ) {     a=      0       ; b=    1       ; c=    1       ; d=    0       ;e=      0       ;f=     0       ;g=     0       ;h=     1       ;}
if (variable==   135     ) {     a=      1       ; b=    1       ; c=    1       ; d=    0       ;e=      0       ;f=     0       ;g=     0       ;h=     1       ;}
if (variable==   136     ) {     a=      0       ; b=    0       ; c=    0       ; d=    1       ;e=      0       ;f=     0       ;g=     0       ;h=     1       ;}
if (variable==   137     ) {     a=      1       ; b=    0       ; c=    0       ; d=    1       ;e=      0       ;f=     0       ;g=     0       ;h=     1       ;}
if (variable==   138     ) {     a=      0       ; b=    1       ; c=    0       ; d=    1       ;e=      0       ;f=     0       ;g=     0       ;h=     1       ;}
if (variable==   139     ) {     a=      1       ; b=    1       ; c=    0       ; d=    1       ;e=      0       ;f=     0       ;g=     0       ;h=     1       ;}
if (variable==   140     ) {     a=      0       ; b=    0       ; c=    1       ; d=    1       ;e=      0       ;f=     0       ;g=     0       ;h=     1       ;}
if (variable==   141     ) {     a=      1       ; b=    0       ; c=    1       ; d=    1       ;e=      0       ;f=     0       ;g=     0       ;h=     1       ;}
if (variable==   142     ) {     a=      0       ; b=    1       ; c=    1       ; d=    1       ;e=      0       ;f=     0       ;g=     0       ;h=     1       ;}
if (variable==   143     ) {     a=      1       ; b=    1       ; c=    1       ; d=    1       ;e=      0       ;f=     0       ;g=     0       ;h=     1       ;}
if (variable==   144     ) {     a=      0       ; b=    0       ; c=    0       ; d=    0       ;e=      1       ;f=     0       ;g=     0       ;h=     1       ;}
if (variable==   145     ) {     a=      1       ; b=    0       ; c=    0       ; d=    0       ;e=      1       ;f=     0       ;g=     0       ;h=     1       ;}
if (variable==   146     ) {     a=      0       ; b=    1       ; c=    0       ; d=    0       ;e=      1       ;f=     0       ;g=     0       ;h=     1       ;}
if (variable==   147     ) {     a=      1       ; b=    1       ; c=    0       ; d=    0       ;e=      1       ;f=     0       ;g=     0       ;h=     1       ;}
if (variable==   148     ) {     a=      0       ; b=    0       ; c=    1       ; d=    0       ;e=      1       ;f=     0       ;g=     0       ;h=     1       ;}
if (variable==   149     ) {     a=      1       ; b=    0       ; c=    1       ; d=    0       ;e=      1       ;f=     0       ;g=     0       ;h=     1       ;}
if (variable==   150     ) {     a=      0       ; b=    1       ; c=    1       ; d=    0       ;e=      1       ;f=     0       ;g=     0       ;h=     1       ;}
if (variable==   151     ) {     a=      1       ; b=    1       ; c=    1       ; d=    0       ;e=      1       ;f=     0       ;g=     0       ;h=     1       ;}
if (variable==   152     ) {     a=      0       ; b=    0       ; c=    0       ; d=    1       ;e=      1       ;f=     0       ;g=     0       ;h=     1       ;}
if (variable==   153     ) {     a=      1       ; b=    0       ; c=    0       ; d=    1       ;e=      1       ;f=     0       ;g=     0       ;h=     1       ;}
if (variable==   154     ) {     a=      0       ; b=    1       ; c=    0       ; d=    1       ;e=      1       ;f=     0       ;g=     0       ;h=     1       ;}
if (variable==   155     ) {     a=      1       ; b=    1       ; c=    0       ; d=    1       ;e=      1       ;f=     0       ;g=     0       ;h=     1       ;}
if (variable==   156     ) {     a=      0       ; b=    0       ; c=    1       ; d=    1       ;e=      1       ;f=     0       ;g=     0       ;h=     1       ;}
if (variable==   157     ) {     a=      1       ; b=    0       ; c=    1       ; d=    1       ;e=      1       ;f=     0       ;g=     0       ;h=     1       ;}
if (variable==   158     ) {     a=      0       ; b=    1       ; c=    1       ; d=    1       ;e=      1       ;f=     0       ;g=     0       ;h=     1       ;}
if (variable==   159     ) {     a=      1       ; b=    1       ; c=    1       ; d=    1       ;e=      1       ;f=     0       ;g=     0       ;h=     1       ;}
if (variable==   160     ) {     a=      0       ; b=    0       ; c=    0       ; d=    0       ;e=      0       ;f=     1       ;g=     0       ;h=     1       ;}
if (variable==   161     ) {     a=      1       ; b=    0       ; c=    0       ; d=    0       ;e=      0       ;f=     1       ;g=     0       ;h=     1       ;}
if (variable==   162     ) {     a=      0       ; b=    1       ; c=    0       ; d=    0       ;e=      0       ;f=     1       ;g=     0       ;h=     1       ;}
if (variable==   163     ) {     a=      1       ; b=    1       ; c=    0       ; d=    0       ;e=      0       ;f=     1       ;g=     0       ;h=     1       ;}
if (variable==   164     ) {     a=      0       ; b=    0       ; c=    1       ; d=    0       ;e=      0       ;f=     1       ;g=     0       ;h=     1       ;}
if (variable==   165     ) {     a=      1       ; b=    0       ; c=    1       ; d=    0       ;e=      0       ;f=     1       ;g=     0       ;h=     1       ;}
if (variable==   166     ) {     a=      0       ; b=    1       ; c=    1       ; d=    0       ;e=      0       ;f=     1       ;g=     0       ;h=     1       ;}
if (variable==   167     ) {     a=      1       ; b=    1       ; c=    1       ; d=    0       ;e=      0       ;f=     1       ;g=     0       ;h=     1       ;}
if (variable==   168     ) {     a=      0       ; b=    0       ; c=    0       ; d=    1       ;e=      0       ;f=     1       ;g=     0       ;h=     1       ;}
if (variable==   169     ) {     a=      1       ; b=    0       ; c=    0       ; d=    1       ;e=      0       ;f=     1       ;g=     0       ;h=     1       ;}
if (variable==   170     ) {     a=      0       ; b=    1       ; c=    0       ; d=    1       ;e=      0       ;f=     1       ;g=     0       ;h=     1       ;}
if (variable==   171     ) {     a=      1       ; b=    1       ; c=    0       ; d=    1       ;e=      0       ;f=     1       ;g=     0       ;h=     1       ;}
if (variable==   172     ) {     a=      0       ; b=    0       ; c=    1       ; d=    1       ;e=      0       ;f=     1       ;g=     0       ;h=     1       ;}
if (variable==   173     ) {     a=      1       ; b=    0       ; c=    1       ; d=    1       ;e=      0       ;f=     1       ;g=     0       ;h=     1       ;}
if (variable==   174     ) {     a=      0       ; b=    1       ; c=    1       ; d=    1       ;e=      0       ;f=     1       ;g=     0       ;h=     1       ;}
if (variable==   175     ) {     a=      1       ; b=    1       ; c=    1       ; d=    1       ;e=      0       ;f=     1       ;g=     0       ;h=     1       ;}
if (variable==   176     ) {     a=      0       ; b=    0       ; c=    0       ; d=    0       ;e=      1       ;f=     1       ;g=     0       ;h=     1       ;}
if (variable==   177     ) {     a=      1       ; b=    0       ; c=    0       ; d=    0       ;e=      1       ;f=     1       ;g=     0       ;h=     1       ;}
if (variable==   178     ) {     a=      0       ; b=    1       ; c=    0       ; d=    0       ;e=      1       ;f=     1       ;g=     0       ;h=     1       ;}
if (variable==   179     ) {     a=      1       ; b=    1       ; c=    0       ; d=    0       ;e=      1       ;f=     1       ;g=     0       ;h=     1       ;}
if (variable==   180     ) {     a=      0       ; b=    0       ; c=    1       ; d=    0       ;e=      1       ;f=     1       ;g=     0       ;h=     1       ;}
if (variable==   181     ) {     a=      1       ; b=    0       ; c=    1       ; d=    0       ;e=      1       ;f=     1       ;g=     0       ;h=     1       ;}
if (variable==   182     ) {     a=      0       ; b=    1       ; c=    1       ; d=    0       ;e=      1       ;f=     1       ;g=     0       ;h=     1       ;}
if (variable==   183     ) {     a=      1       ; b=    1       ; c=    1       ; d=    0       ;e=      1       ;f=     1       ;g=     0       ;h=     1       ;}
if (variable==   184     ) {     a=      0       ; b=    0       ; c=    0       ; d=    1       ;e=      1       ;f=     1       ;g=     0       ;h=     1       ;}
if (variable==   185     ) {     a=      1       ; b=    0       ; c=    0       ; d=    1       ;e=      1       ;f=     1       ;g=     0       ;h=     1       ;}
if (variable==   186     ) {     a=      0       ; b=    1       ; c=    0       ; d=    1       ;e=      1       ;f=     1       ;g=     0       ;h=     1       ;}
if (variable==   187     ) {     a=      1       ; b=    1       ; c=    0       ; d=    1       ;e=      1       ;f=     1       ;g=     0       ;h=     1       ;}
if (variable==   188     ) {     a=      0       ; b=    0       ; c=    1       ; d=    1       ;e=      1       ;f=     1       ;g=     0       ;h=     1       ;}
if (variable==   189     ) {     a=      1       ; b=    0       ; c=    1       ; d=    1       ;e=      1       ;f=     1       ;g=     0       ;h=     1       ;}
if (variable==   190     ) {     a=      0       ; b=    1       ; c=    1       ; d=    1       ;e=      1       ;f=     1       ;g=     0       ;h=     1       ;}
if (variable==   191     ) {     a=      1       ; b=    1       ; c=    1       ; d=    1       ;e=      1       ;f=     1       ;g=     0       ;h=     1       ;}
if (variable==   192     ) {     a=      0       ; b=    0       ; c=    0       ; d=    0       ;e=      0       ;f=     0       ;g=     1       ;h=     1       ;}
if (variable==   193     ) {     a=      1       ; b=    0       ; c=    0       ; d=    0       ;e=      0       ;f=     0       ;g=     1       ;h=     1       ;}
if (variable==   194     ) {     a=      0       ; b=    1       ; c=    0       ; d=    0       ;e=      0       ;f=     0       ;g=     1       ;h=     1       ;}
if (variable==   195     ) {     a=      1       ; b=    1       ; c=    0       ; d=    0       ;e=      0       ;f=     0       ;g=     1       ;h=     1       ;}
if (variable==   196     ) {     a=      0       ; b=    0       ; c=    1       ; d=    0       ;e=      0       ;f=     0       ;g=     1       ;h=     1       ;}
if (variable==   197     ) {     a=      1       ; b=    0       ; c=    1       ; d=    0       ;e=      0       ;f=     0       ;g=     1       ;h=     1       ;}
if (variable==   198     ) {     a=      0       ; b=    1       ; c=    1       ; d=    0       ;e=      0       ;f=     0       ;g=     1       ;h=     1       ;}
if (variable==   199     ) {     a=      1       ; b=    1       ; c=    1       ; d=    0       ;e=      0       ;f=     0       ;g=     1       ;h=     1       ;}
if (variable==   200     ) {     a=      0       ; b=    0       ; c=    0       ; d=    1       ;e=      0       ;f=     0       ;g=     1       ;h=     1       ;}
if (variable==   201     ) {     a=      1       ; b=    0       ; c=    0       ; d=    1       ;e=      0       ;f=     0       ;g=     1       ;h=     1       ;}
if (variable==   202     ) {     a=      0       ; b=    1       ; c=    0       ; d=    1       ;e=      0       ;f=     0       ;g=     1       ;h=     1       ;}
if (variable==   203     ) {     a=      1       ; b=    1       ; c=    0       ; d=    1       ;e=      0       ;f=     0       ;g=     1       ;h=     1       ;}
if (variable==   204     ) {     a=      0       ; b=    0       ; c=    1       ; d=    1       ;e=      0       ;f=     0       ;g=     1       ;h=     1       ;}
if (variable==   205     ) {     a=      1       ; b=    0       ; c=    1       ; d=    1       ;e=      0       ;f=     0       ;g=     1       ;h=     1       ;}
if (variable==   206     ) {     a=      0       ; b=    1       ; c=    1       ; d=    1       ;e=      0       ;f=     0       ;g=     1       ;h=     1       ;}
if (variable==   207     ) {     a=      1       ; b=    1       ; c=    1       ; d=    1       ;e=      0       ;f=     0       ;g=     1       ;h=     1       ;}
if (variable==   208     ) {     a=      0       ; b=    0       ; c=    0       ; d=    0       ;e=      1       ;f=     0       ;g=     1       ;h=     1       ;}
if (variable==   209     ) {     a=      1       ; b=    0       ; c=    0       ; d=    0       ;e=      1       ;f=     0       ;g=     1       ;h=     1       ;}
if (variable==   210     ) {     a=      0       ; b=    1       ; c=    0       ; d=    0       ;e=      1       ;f=     0       ;g=     1       ;h=     1       ;}
if (variable==   211     ) {     a=      1       ; b=    1       ; c=    0       ; d=    0       ;e=      1       ;f=     0       ;g=     1       ;h=     1       ;}
if (variable==   212     ) {     a=      0       ; b=    0       ; c=    1       ; d=    0       ;e=      1       ;f=     0       ;g=     1       ;h=     1       ;}
if (variable==   213     ) {     a=      1       ; b=    0       ; c=    1       ; d=    0       ;e=      1       ;f=     0       ;g=     1       ;h=     1       ;}
if (variable==   214     ) {     a=      0       ; b=    1       ; c=    1       ; d=    0       ;e=      1       ;f=     0       ;g=     1       ;h=     1       ;}
if (variable==   215     ) {     a=      1       ; b=    1       ; c=    1       ; d=    0       ;e=      1       ;f=     0       ;g=     1       ;h=     1       ;}
if (variable==   216     ) {     a=      0       ; b=    0       ; c=    0       ; d=    1       ;e=      1       ;f=     0       ;g=     1       ;h=     1       ;}
if (variable==   217     ) {     a=      1       ; b=    0       ; c=    0       ; d=    1       ;e=      1       ;f=     0       ;g=     1       ;h=     1       ;}
if (variable==   218     ) {     a=      0       ; b=    1       ; c=    0       ; d=    1       ;e=      1       ;f=     0       ;g=     1       ;h=     1       ;}
if (variable==   219     ) {     a=      1       ; b=    1       ; c=    0       ; d=    1       ;e=      1       ;f=     0       ;g=     1       ;h=     1       ;}
if (variable==   220     ) {     a=      0       ; b=    0       ; c=    1       ; d=    1       ;e=      1       ;f=     0       ;g=     1       ;h=     1       ;}
if (variable==   221     ) {     a=      1       ; b=    0       ; c=    1       ; d=    1       ;e=      1       ;f=     0       ;g=     1       ;h=     1       ;}
if (variable==   222     ) {     a=      0       ; b=    1       ; c=    1       ; d=    1       ;e=      1       ;f=     0       ;g=     1       ;h=     1       ;}
if (variable==   223     ) {     a=      1       ; b=    1       ; c=    1       ; d=    1       ;e=      1       ;f=     0       ;g=     1       ;h=     1       ;}
if (variable==   224     ) {     a=      0       ; b=    0       ; c=    0       ; d=    0       ;e=      0       ;f=     1       ;g=     1       ;h=     1       ;}
if (variable==   225     ) {     a=      1       ; b=    0       ; c=    0       ; d=    0       ;e=      0       ;f=     1       ;g=     1       ;h=     1       ;}
if (variable==   226     ) {     a=      0       ; b=    1       ; c=    0       ; d=    0       ;e=      0       ;f=     1       ;g=     1       ;h=     1       ;}
if (variable==   227     ) {     a=      1       ; b=    1       ; c=    0       ; d=    0       ;e=      0       ;f=     1       ;g=     1       ;h=     1       ;}
if (variable==   228     ) {     a=      0       ; b=    0       ; c=    1       ; d=    0       ;e=      0       ;f=     1       ;g=     1       ;h=     1       ;}
if (variable==   229     ) {     a=      1       ; b=    0       ; c=    1       ; d=    0       ;e=      0       ;f=     1       ;g=     1       ;h=     1       ;}
if (variable==   230     ) {     a=      0       ; b=    1       ; c=    1       ; d=    0       ;e=      0       ;f=     1       ;g=     1       ;h=     1       ;}
if (variable==   231     ) {     a=      1       ; b=    1       ; c=    1       ; d=    0       ;e=      0       ;f=     1       ;g=     1       ;h=     1       ;}
if (variable==   232     ) {     a=      0       ; b=    0       ; c=    0       ; d=    1       ;e=      0       ;f=     1       ;g=     1       ;h=     1       ;}
if (variable==   233     ) {     a=      1       ; b=    0       ; c=    0       ; d=    1       ;e=      0       ;f=     1       ;g=     1       ;h=     1       ;}
if (variable==   234     ) {     a=      0       ; b=    1       ; c=    0       ; d=    1       ;e=      0       ;f=     1       ;g=     1       ;h=     1       ;}
if (variable==   235     ) {     a=      1       ; b=    1       ; c=    0       ; d=    1       ;e=      0       ;f=     1       ;g=     1       ;h=     1       ;}
if (variable==   236     ) {     a=      0       ; b=    0       ; c=    1       ; d=    1       ;e=      0       ;f=     1       ;g=     1       ;h=     1       ;}
if (variable==   237     ) {     a=      1       ; b=    0       ; c=    1       ; d=    1       ;e=      0       ;f=     1       ;g=     1       ;h=     1       ;}
if (variable==   238     ) {     a=      0       ; b=    1       ; c=    1       ; d=    1       ;e=      0       ;f=     1       ;g=     1       ;h=     1       ;}
if (variable==   239     ) {     a=      1       ; b=    1       ; c=    1       ; d=    1       ;e=      0       ;f=     1       ;g=     1       ;h=     1       ;}
if (variable==   240     ) {     a=      0       ; b=    0       ; c=    0       ; d=    0       ;e=      1       ;f=     1       ;g=     1       ;h=     1       ;}
if (variable==   241     ) {     a=      1       ; b=    0       ; c=    0       ; d=    0       ;e=      1       ;f=     1       ;g=     1       ;h=     1       ;}
if (variable==   242     ) {     a=      0       ; b=    1       ; c=    0       ; d=    0       ;e=      1       ;f=     1       ;g=     1       ;h=     1       ;}
if (variable==   243     ) {     a=      1       ; b=    1       ; c=    0       ; d=    0       ;e=      1       ;f=     1       ;g=     1       ;h=     1       ;}
if (variable==   244     ) {     a=      0       ; b=    0       ; c=    1       ; d=    0       ;e=      1       ;f=     1       ;g=     1       ;h=     1       ;}
if (variable==   245     ) {     a=      1       ; b=    0       ; c=    1       ; d=    0       ;e=      1       ;f=     1       ;g=     1       ;h=     1       ;}
if (variable==   246     ) {     a=      0       ; b=    1       ; c=    1       ; d=    0       ;e=      1       ;f=     1       ;g=     1       ;h=     1       ;}
if (variable==   247     ) {     a=      1       ; b=    1       ; c=    1       ; d=    0       ;e=      1       ;f=     1       ;g=     1       ;h=     1       ;}
if (variable==   248     ) {     a=      0       ; b=    0       ; c=    0       ; d=    1       ;e=      1       ;f=     1       ;g=     1       ;h=     1       ;}
if (variable==   249     ) {     a=      1       ; b=    0       ; c=    0       ; d=    1       ;e=      1       ;f=     1       ;g=     1       ;h=     1       ;}
if (variable==   250     ) {     a=      0       ; b=    1       ; c=    0       ; d=    1       ;e=      1       ;f=     1       ;g=     1       ;h=     1       ;}
if (variable==   251     ) {     a=      1       ; b=    1       ; c=    0       ; d=    1       ;e=      1       ;f=     1       ;g=     1       ;h=     1       ;}
if (variable==   252     ) {     a=      0       ; b=    0       ; c=    1       ; d=    1       ;e=      1       ;f=     1       ;g=     1       ;h=     1       ;}
if (variable==   253     ) {     a=      1       ; b=    0       ; c=    1       ; d=    1       ;e=      1       ;f=     1       ;g=     1       ;h=     1       ;}
if (variable==   254     ) {     a=      0       ; b=    1       ; c=    1       ; d=    1       ;e=      1       ;f=     1       ;g=     1       ;h=     1       ;}
[Advertisement] Infrastructure as Code built from the start with first-class Windows functionality and an intuitive, visual user interface. Download Otter today!


The Logs Don't Lie;

She'd resisted the call for years. As a senior developer, Makoto knew how the story ended: one day, she'd be drafted into the ranks of the manager, forswearing her true love webdev. When her boss was sacked unexpectedly, mere weeks after the most senior dev quit, she looked around and realized she was holding the short straw. She was the most senior. This is her story.

As she settled into her new responsibilities, Makoto started coming in earlier and earlier in the hopes of getting some development work done. As such, she started to get accustomed to the rhythm of the morning shift, before most devs had rolled out of bed, but after the night shift ops guys had gone home.

Bad sign number 1: the CEO wandering past, looking a bit lost and vaguely concerned.

"Can I help you?" Makoto asked, putting down her breakfast pastry.

Bad sign number 2 was his reply: "Does the Internet look down to you?"

Makoto quickly pulled up her favorite Internet test site, /r/aww, to verify that she still had connectivity. "Seems all right to me."

"Well, I can't get online."

Webdev-Makoto would've shrugged and thought, Not my circus. Manager-Makoto forced a grin onto her face and said, "I'll get my guys on that."

"Thanks, you're a real champ." Satisfied, the CEO wandered back to whatever it was he did all day, leaving Makoto to explain a problem she wasn't experiencing to guys way more qualified to work on this than she was.

Hoping to explain the discrepancy, she unplugged her laptop. This time, the adorable kittens failed to load.

"Success!" she told the empty office. "This is officially some weird wi-fi problem."

She drafted up a notice to that effect, sent it to the office mailing list, and assigned her teammate Sven to find and fix the problem. By 9:00 AM, all was well, and her team had sent out an update to that effect.

Now well into her daily routine, Makoto put the incident behind her. After all, it was resolved, wasn't it?

4:00 PM rolled around, and Makoto was somehow the recipient for an angry email from Greg in Sales. Is the internet still out? I need to close out my sales!!! Why hasn't your team fixed this yet! We could lose $300,000 if I can't close out my sales by 5PM!!!!!

Makoto rolled her eyes at the unnecessary number of exclamation points and checked the sales pipeline. Sure enough, there was nothing preventing her from accessing Greg's queue and verifying that all $100 worth of sales were present and accounted for.

Makoto cracked her knuckles and crafted the most polite response she could muster: As per my update at 9am, the Internet is back online and you should be able to perform any and all job duties at this time.

The reply came 2 minutes later: I cannot close my opportunities!!!

Makoto forwarded the email chain to Sven before rolling over to his desk. "Greg's being a drama llama again. Can you pull the firewall logs and prove he's got Internet?"

"'Course."

10 minutes and 4 raised eyebrows later, Sven replied to the ticket, copying Greg's boss and attaching a screenshot of the logs. As Makoto stated, we are online at this time. Is it possible your computer received a virus from browsing PornHub since 9:30 this morning?

Greg spent the next day in meetings with HR, and the next week on unpaid leave to think about what he'd done. To this day, he cannot look Sven or Makoto in the eye as they pass each other in the hallway. Makoto suspects he won't suffer long—only as long as it takes him to find another job. Maybe one with IT people who don't know what search keywords he uses.

[Advertisement] Scale your release pipelines, creating secure, reliable, reusable deployments with one click. Download and learn more today!


CodeSOD: This or That;

Processing financial transactions is not the kind of software you want to make mistakes in. If something is supposed to happen, it is definitely supposed to happen. Not partially happen. Not maybe happen.

Thus, a company like Charles R’s uses a vendor-supplied accounting package. That vendor has a professional services team, so when the behavior needs to be customized, Charles’s company outsources that development to the vendor.

Of course, years later, that code needs to get audited, and it’s about then that you find out that the vendor outsourced their “professional services” to the lowest bidder, creating a less-than-professional service result.

If you want to make sure than when the country code is equal to "HND", you want to be really sure.

if(transaction.country == config.country_code.HND || transaction.country == config.country_code.HND)
    parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ",");
else
    parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ".");
[Advertisement] Application Release Automation for DevOps – integrating with best of breed development tools. Free for teams with up to 5 users. Download and learn more today!


Error'd: No Thanks Necessary;

"I guess we're not allowed to thank the postal carriers?!" Brian writes.

 

"So, does the CPU time mean that Microsoft has been listening to every noise I have made since before I was born?" writes Shaun F.

 

"No problem. I will not attempt to re-use your error message without permission," wrote Alex K.

 

Mark B. writes, "Ah, if only we could have this in real life."

 

"Good work Google! Another perfect translation into German," Kolja wrote.

 

"I was searching for an Atmel MCU, so I naturally opened Atmel's Product Finder. I kind of wish that I didn't," writes Michael B.,

 

[Advertisement] Release! is a light card game about software and the people who make it. Play with 2-5 people, or up to 10 with two copies - only $9.95 shipped!


Finding the Lowest Value;

Max’s team moved into a new office, which brought with it the low-walled, “bee-hive” style cubicle partitions. Their project manager cheerfully explained that the new space “would optimize collaboration”, which in practice meant that every random conversation between any two developers turned into a work-stopping distraction for everyone else.

That, of course, wasn’t the only change their project manager instituted. The company had been around for a bit, and their original application architecture was a Java-based web application. At some point, someone added a little JavaScript to the front end. Then a bit more. This eventually segregated the team into two clear roles: back-end Java developers, and front-end JavaScript developers.

An open pit copper mine

“Silos,” the project manager explained, “are against the ethos of collaboration. We’re all going to be full stack developers now.” Thus everyone’s job description and responsibilities changed overnight.

Add an overly ambitious release schedule and some unclear requirements, and the end result is a lot of underqualified developers rushing to hit targets with tools that they don’t fully understand, in an environment that isn’t conducive to concentration in the first place.

Max was doing his best to tune out the background noise, when Mariella stopped into Dalton’s cube. Dalton, sitting straight across from Max, was the resident “front-end expert”, or at least, he had been before everyone was now a full-stack developer. Mariella was a long-time backend JEE developer who hadn’t done much of the web portion of their application at all, and was doing her best to adapt to the new world.

“Dalton, what’s the easiest way to get the minimum value of an array of numbers in JavaScript?” Mariella asked.

Max did his best to ignore the conversation. He was right in the middle of a particularly tricky ORM-related bug, and was trying to figure out why one fetch operation was generating just awful SQL.

“Hrmmmm…” Dalton said, tapping at his desk and adding to the distraction while he thought. “That’s a tough one. Oh! You should use a filter!”

“A filter, what would I filter on?”

Max combed through the JPA annotations that controlled their data access, cursing the “magic” that generated SQL queries, but as he started to piece it together, Dalton and Mariella continued their “instructional” session.

“In the filter callback, you’d just check to see if each value is the lowest one, and if it is, return true, otherwise return false.” Dalton knocked out a little drum solo on his desk, to celebrate his cleverness.

“But… I wouldn’t know which value is the lowest one, yet,” Mariella said.

“Oh, yeah… I see what you mean. Yeah, this is a tricky one.”

Max traced through the code. Okay, so the @JoinColumn is CUST_ID, so why is it generating a LIKE comparison instead of an equals? Wait, I think I’ve-

“Ah ha!” Dalton said, chucking Max’s train of thought off the rails and through an HO-scale village. “You just sort the array and take the first value!” *Thumpa thumpa tadatada* went Dalton’s little desk drum solo.

“I guess that makes sense,” Mariella said.

At this point, Max couldn’t stay out of the conversation. “No! Don’t do that. Use reduce. Sorting’s an n(lg n) operation.”

“Hunh?” Dalton said. His fingers nervously hovered over his desk, ready to play his next drum solo once he had a vague clue what Max was talking about. “In logs in? We’re not doing logging…”

Max tried again, in simple English. “Sorting is slow. The computer does a lot of extra work to sort all the elements.”

“No it won’t,” Dalton said. “It’ll just take the first element.”

“Ahem.” Max turned to discover the project manager looming over his cube. “We want to encourage collaboration,” the PM said, sternly, “but right now, Max, you’re being disruptive. Please be quiet and let the people around you work.”

And that was how Dalton’s Minimum Finding Algorithm got implemented, and released as part of their production code base.

[Advertisement] Manage IT infrastructure as code across all environments with Puppet. Puppet Enterprise now offers more control and insight, with role-based access control, activity logging and all-new Puppet Apps. Start your free trial today!


CodeSOD: A Pre-Packaged Date;

Microsoft’s SQL Server Integration Services is an ETL tool that attempts to mix visual programming (for designing data flows) with the reality that at some point, you’re just going to need to write some code. Your typical SSIS package starts as a straightforward process that quickly turns into a sprawling mix of spaghetti-fied .NET code, T-SQL stored procedures, and developer tears.

TJ L. inherited an SSIS package. This particular package contained a step where a C# sub-module needed to pass a date (but not a date-time) to the database. Now, this could be done easily by using C#’s date-handling objects, or even in the database by simply using the DATE type, instead of the DATETIME type.

Instead, TJ’s predecessor took this route instead:

CREATE PROC [dbo].[SetAsOfDate]
        @Date datetime = NULL
AS
SELECT @Date = CASE WHEN YEAR(@DATE) < 1950 THEN GETDATE()
                                        WHEN @Date IS NULL THEN GETDATE()
                                        ELSE @Date
                                END;

SELECT CAST(FLOOR(CAST(@Date AS FLOAT)) AS DATETIME) AS CurrentDate

The good about this code is that it checks its input parameters. That’s defensive programming. The ugly is the less-than 1950 check, which I can only assume is a relic of some Y2K bugfixes. The bad is the `CAST(FLOOR(CAST(@Date AS FLOAT)) as DATETIME).

[Advertisement] Otter, ProGet, BuildMaster – robust, powerful, scalable, and reliable additions to your existing DevOps toolchain.