Friday, November 01, 2013

New Home

I've been actively developing a new blogging engine titled Dinghy, designed to work with Google App Engine. I'm using it to host my new Blog, Stories for Outcasts, which is also included on the "feeds worth following" widget here.

This blog will remain up, as it still generates plenty of traffic, particularly from some oddball search topics such as Roman numerals and mainframe arcana, and I will add major announcements here occasionally, but "Medicine for the Sky" will be largely inactive.

Oh, speaking of major announcements, about 7 weeks ago, my daughter Emrys was born, bringing the total in our brood to 4 girls!

Sunday, August 25, 2013

Translucent text on a Bootstrap 3 cover image

I'm close to debuting a lightweight blogging engine using Go, App Engine, and Bootstrap 3, and I wanted to share a quick solution I found to what seems to be a common problem: putting text on top of a cover image without contrast problems, and without having to explicitly line up a translucent background color with the parent div's corners.

In this case, I'm using a simple Bootstrap 3 jumbotron with a background image declared with the css "background-image: url()" syntax. The jumbotron div has a child H1 element with a sample blog name ("Stories for Outcasts", which I thought was pretty funny, but [probably] won't be the final blog name I choose).

The background image is of my Tom Baker Dr. Who action figure peering at some API or other I was toying with on my laptop. It's mainly a dark image, so I chose white for the superimposed text. Here's the HTML stub:

<!DOCTYPE html>
<html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
 <meta charset="utf-8">
 <link href="Blog_files/bootstrap.min.css" rel="stylesheet">

 <style type="text/css">
  #cover {
   background-size: 100% auto;
   background-image: url(static/cover.jpg);
   margin-top: -20px;
  }

  #cover h1 {
   color: #fff;
  }
 </style>
</head>
<body>
 <div class="container col-md-8">
  <div id="cover" class="jumbotron">
   <h1 class="text-center">Stories for Outcasts</h1>
  </div>
 </div>
</body></html>

...and what the result looks like:

Friday, July 19, 2013

Minimum wage isn't a living wage

I stopped making minimum wage in 1991, when I was 20 years old. I was working for Donatos pizza at $4.25 per hour as "inside help", a position typically reserved for part-time highschool workers. My car was donated to me by my grandmother, as I couldn't afford a car payment, and she wanted to help me out. I shared an apartment with a friend from a previous job, Steve, and the two of us scraped by, kept our $435/month rent more or less paid on time, ate a lot of pizza at work to curb the grocery bill, and played a lot of Zelda in lieu of entertainment requiring cash.

I look back on that time fondly, but I was close to poverty, and wouldn't have been able to manage without the free car, living in a time where filling a car's gas tank cost just $10, and having a co-conspirator to share expenses with. If I'd have gotten sick, it would have been very problematic for both of us; I had no health insurance at all, and I couldn't afford to miss any work. If my car had broken down, I would have been running back to family for help to get back on my feet.

I was lucky, though, in that the pizza store noticed my quickly improving skills and work ethic, and offered me a position in management. A couple months after that, I leveraged the extra cash that position brought into my own apartment, (Steve ended up moving back to his hometown of Youngstown, settling affairs after his ex-wife died, and trying to build a good life for his son - that story deserves a better treatment, and provided Steve doesn't object, I'd like to tell it from my point of view some day) where I slowly accumulated furniture, a stereo, a set of books I'd been meaning to get to some day, and a modest cash reserve for car repairs, doctor bills and whatnot. The management job came with a 45 hour work week (minimum), a week of vacation, insurance, and a small monthly bonus if the store hit it's "numbers". Most of that is laughable by the standards of a software developer, but at the time I felt like I was living it large.

Tuesday, May 28, 2013

First impressions of WordPress

For reasons that may become significant, I began my first install of WordPress yesterday evening. My install was under CygWin, and most of the challenge was getting WP's dependencies met, PHP being the most frustrating. Eventually I found apt-cyg and cygwinports.org, both from Victor Miti's excellent primer Installing and Configuring Apache, PHP & MySQL on Cygwin, which had most of what I needed.

After getting Apache2, MySQL, and PHP working, the WP install itself was a breeze, and the content management features seemed straightforward and mature out of the box. On day 2, I've stumbled onto the WordPress Console plugin, and the P2 theme, both being fairly snazzy:


I can see from this brief exposure, and from an interview with a VideoPress developer, why they have such a thriving community. Good stuff all around, folks... whether or not you end up hiring me.

Tuesday, May 14, 2013

Ignoring the tyranny of official widgets

...and a small explanation of why that's important to me.

In 2009 I became immersed in the world of check image files, often referred to as "Check 21" files, in reference to the Check Clearing for the 21st Century Act, which gives a scanned image of a check legal credibility as a financial instrument. In our modern world of online bill pay, web 2.0, and pizza boys with credit card scanners that plug into their mobile phones, paying utility bills by mailing a check is slowly becoming anachronistic... or so you might think.

In reality, over 300,000 physical checks per month get mailed to our Canton remittance center, many from businesses with multi-thousand dollar electric bills - businesses large enough to employ an IT department to do ACH transactions, wire payments, what have you. But the physical checks keep being printed and mailed, for much the same reason that companies that have ever used a mainframe continue to use them despite the cool kids shouting "dinosaur!" or "RESTful!" or "node.js!!" at them: It's well understood and works reliably.

Tuesday, April 30, 2013

Base Eighteen on a Chinese Abacus

For the sake of simplicity, my use here of number words (ten, hundred) instead of digits (10, 100) will refer to decimal values. "Ten" =

I've been interested in arithmetic on the abacus for a while now, although I'm still quite the amateur. Last year I wrote a (not yet officially adopted) plugin to the Khan Academy Exercises engine to allow practice exercises on a 4x1 soroban, which helped me improve my speed and accuracy with basic addition, and I've acquired these two real-world abaci:

The top abacus is a cheap Chinese 5x2 Suanpan I bought in Chicago's Chinatown a few years back when my wife and I vacationed there, and the bottom abacus is a better quality Japanese 4x1 Soroban that Liberty ordered for me as a Christmas present last year (along with a book on the Haskell programming language I've been wanting - best wife ever!). "Suanpan" and "Soroban" are language variants on the same word, which roughly translates to English as "counting tray", and neither name implies a specific number of beads.

Monday, April 08, 2013

Stripping a UTF-8 byte order mark with Go

Recently I've been watching some videos on the Go programming language, and I was impressed enough to go install it and start tinkering. Right out of the gate, I ran into trouble getting the code on tour.golang.org's first page working locally. The code is simply:

Google's goal in this case seems to be illustrating to seasoned coders on their first visit that the language has UTF-8 support built-in. Notepad on Windows 7 does display CJK characters correctly out of the box, without needing to play around with language options in the control panel. It also lets you save files in a few unicode-friendly formats, one of which is UTF-8. Unfortunately, Notepad always writes a byte-order mark (BOM) at the beginning of files saved in UTF-8 format, and this can't be disabled:

The UTF-8 standard is ambiguous about whether the BOM should be accepted in all cases, but regardless of how you read the standard, the Go compiler does not support them, and throws this error when I attempt to compile the same program:

Saturday, March 23, 2013

Screen-scraping a .NET site with App Engine/Java

My impetus for developing this was the desire to populate a hidden page on my blog with live data from a pair of funds, namely an ebay merchant account used as a rollover fund for donations, and a 529 account from an Ohio provider.

There is an excellent API for ebay merchant accounts that I was able to integrate quickly with App Engine. The blog page performs a poor man's AJAX call to an appspot.com servlet, which in turn queries the ebay API for a current balance, and in the end the dollar amount is returned to the blogspot XMLHttpRequest, where a simple DOM .innerHTML replace populates the browser window with the balance. Here's a quick rundown of the code:

Blogger hooks

Rollover account balance: <span id="pcfBalance">??</span><br />
<script>
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
  if(xmlhttp.readyState == 4){
    document.getElementById('pcfBalance').innerHTML = xmlhttp.responseText;
  }
};
xmlhttp.open("GET","http://[my application].appspot.com/pcfbal",true);
xmlhttp.send(null);
</script>

App Engine servlet

Wednesday, March 13, 2013

Why Sheffer's Stroke is NAND instead of NOR

As a young boy, diving into mathematics was a great release for me. I often manipulated numbers in my head, independently discovered cross-multiplication, and found the gradeschool introduction to logic fascinating. Logic, of course, one needs to understand intuitively in order to be an effective coder.

Famous science personalities were my heroes. From Newton himself playing with equations of planetary motion in his giant Principia tome, to Godel showing with marvelous simplicity that all mathematical investigation will be (hopelessly?) incomplete, to Hoffstadter's work on artificial intelligence (and from whom I first heard the word "meme"), to Feynman picking locks at Los Alamos for kicks and investigating what he found interesting with little regard to its future practical value.

These were the giants to be revered, the Atlases holding the world on their shoulders. If only we could all be like them, forgoing our petty disagreements, cults of personality, and clanishness... or so I thought. Later when I realized that the science and maths world contained all of these things, it was quite disillusioning. Yes, even the greats stepped on each other's work, stole each other's credit, and disagreed on basic notation and phraseology of important concepts, particularly as a new field was being developed.

"Sheffer's Stroke" is an example of this kind of thing. Denoted by "|" (or "pipe" as we techies call it), in modern notation it refers to the logical NAND function. a|b is true in all cases where a and b are not both true. However, Henry Sheffer explicitly refers to his proposed function as "neither-nor", false in all cases where a and b are not both false. In his 1913 paper "A set of five independent postulates for Boolean algebras, with application to logical constants", he has this to say:

Thursday, February 28, 2013

HTML5 logic circuit builder using NAND gates

This blog entry won't serve as an introduction to Boolean Algebra or logic gates, but rather just to illustrate an HTML5 widget I wrote that lets you manipulate NAND gates. In fact, before you begin, you should understand what these tables mean:

NOR = f(a,b)    NAND = f(a,b)
a b  f           a b  f      
0 0  1           0 0  1      
0 1  0           0 1  1      
1 0  0           1 0  1      
1 1  0           1 1  0      

If that makes no sense, start with this Wikipedia article on logic gates.

In the early 20th century, the maths world went wild trying to expand on George Boole's work on logic. Ernst Schröder, Edward Huntington, and Alfred Whitehead each developed conflicting notation systems and postulate sets, each with published works that were pretty arcane. For instance:

Tuesday, February 05, 2013

Tax tables from 1998 to 2013 at a glance

The form below is the result of combing through PDF files from irs.gov to get an accurate picture of how federal payroll withholding tables changed through the years. I later tacked on tax tables to compare with the payroll tables to see how they lined up (which they do pretty well... with a couple exceptions that I'll get to). I've populated data from the years 1998 to 2013, and added a simple HTML5 interface for charting the results.

Choose a salary from the slider (if you don't see a slider control, the charts won't work with your browser - the HTML5 "range" input type currently only works in Webkit browsers and Opera), and then click married or single, to see the chart for that salary.

The code makes some basic assumptions for the sake of simplicity. First, the salary is taxable income, after other deductions such as 401k, social security, etc. Second, the tax line adjusts the salary down by the standard deduction (twice that for the "married" category, assuming "married filing jointly" is the filing status), where the withholding line does not. This appears to be the intent of the descrepencies between withholding and tax tables, that is, separating what your employer knows about you from what the government does. Your employer doesn't know about your mortgage interest, whether you'll file joint or separately, whether the child tax credit applies to you, how much you spent for college tuition, or any of the hundreds of other deductions or credits you'll talk to Uncle Sam about. They know what you contribute to 401k, how many dependants you intend to claim, and that's about it.

Tuesday, January 15, 2013

¿Hola?


So Scout and I stopped into the grocery store to buy a couple extra things for her lunch. We got to the checkout area, and decided to use a real lane instead of self-serve, since cashiers are much nicer to me when I have Scout in tow. (When I'm alone, it's self-serve only, unless the guy who looks like he just got out of prison is on duty at my local Kroger, he's alright.)

"Do you have your Kroger card?"

"No, but here, let me type in the number." I grabbed the giant rubber stylus, and poked at the "Alt ID" button, heard the reassuring click... and then nothing. So I poked at it a couple more times, and noticed that the button on the opposite side was occasionally gaining focus, and the language kept switching back and forth between Spanish and English.

"Oh, looks like your touch-screen is misaligned..." she mashed some buttons on the register, "...or something, you should probably shut this lane down until that gets re..."

"Try it now," she interrupted. Poke, poke, poke... Hello, Hola, Hello. Same thing.

Friday, January 04, 2013

Manhandling Gentran for fun and profit

About 10am on Wednesday, an instant message window pops up on my workstation, from my buddy and coworker Jim. "Hey, you see all those Gentran errors?"

"Ah crap," I thought, "there goes my day."

I work as a software developer, but in a specialized role: my group writes software to support a production electronic commerce and energy trading system, fitting it with new regulatory requirements, feeds to new vendors, retrofitting logging and administrataion solutions, and our current nightmare, making our code compatible with new vendor frameworks, and migrating it en masse. (Vendor lock-in, in my opinion, is the biggest scam played out on American businesses, and 9 years of bellyaching about that in my job has netted me very few victories.)

In short, I write code, but for the purpose of keeping an enterprise integration system running. In my group, we rotate who is assigned for "production support", where you try to work on your coding tasks as you can, but when there are any hiccups in the system, you're suddenly in a system admin role instead, complete with (justifiably) panicked business users worrying about the status of their million dollar wire transfer, or avoiding regulatory fines for processing data late, etc.