Friday, December 14, 2012

Mathematics and Programming...

Is knowledge of mathematics necessary – or even useful – for a programmer?  That's a long-standing debate, with bazillions of threads on usenet groups and blogs.  Evan Miller has some interesting ramblings on the topic.

Speaking strictly for myself, there have been only a few occasions when I needed any mathematics more advanced than simple algebra to do the programming work that I've done.  However...some of the most interesting and fun things I've done did involve some more advanced math.  The ones that come right to mind include: network traffic analysis and management (probability, statistics, sampling theory), teletype FSK modems (Fourier transforms and information theory), bond valuation (Monte Carlo statistical modeling), classic optic design, software servos (control optimization), astronomical and geographic calculations (can you spell spherical trigonometry?), algorithmic trading (big data analysis, pattern matching), and cryptography (really big numbers, modulo math, and trap functions).  For all of these programming jobs, I really could not have done the job without having learned some new mathematics.  Because I had only a high school education, all of these areas of math were new to me when I first encountered the need.  And for whatever reason, in each case I thought the need to learn these was a lot of fun.  Still, the programming that I've done that required this math forms only a small fraction of the total body of programming work I've done. 

I don't know where that puts me in this debate :-)

First Measurement of c...

In physics, c is the speed of light.  That's a very fast speed indeed, roughly 310,000 km/s (or 186,000 miles/s).  How and when was it first measured?

This is a piece of science history I'm very familiar with, but you may not be.  It's very clever how it was done – in 1676!  Dutch astronomer Ole Rømer made the measurements and Dutch mathemetician and astronomer Christaan Huygens did the arithmetic.  They came up with a value of 218,000 km/s (or 131,000 miles/s) – not bad at all considering the state of scientific measurement almost 500 years ago!

Earthquake Captured!

Early this morning (2:36:02 Pacific time, 10:36:02 UTC) there was a fairly large earthquake (6.3 magnitude) off the coast of northern Mexico.  The epicenter was 305 km (about 183 miles) SW of our home.  At that distance, of course we never felt a thing.  But...the USGS requested data from the seismograph they installed in our home, and the graph at right shows what it “saw”.

This is the first seismogram I've ever actually tried to read.  I found several articles about reading them; this was the most useful.  If I'm understanding this correctly, I'm seeing the P-waves reaching us at about 10:36:46 UTC, or 44 seconds after the quake actually occurred.  That works out to a speed of 305/44, or 6.93 km/s – fast for a P-wave.  Then I'm seeing the S-waves reaching us at about 10:37:17 UTC, or 75 seconds after the quake actually occurred.  That works out to a speed of 4.07 km/s – again fast for an S-wave.  From what I've been reading, these seismograms are very challenging to extract good information from – both the amplitude and the timing of them are highly dependent on the geologic structures and material types between the earthquake and the seismometer.  I think I'll leave that to the experts :-)

But I do think it's kind of cool to be able to see the earthquake on an instrument in my house!


Entitlement Reform...

Via reader, colleague, and friend Doug S.  This is gonna give my mom some ideas.  She'll have one big problem, though: how to get her list down to just four...


Rain!

In the last 24 hours, we've had 1.2 inches of rain.  Winter is here!  The graph at right shows UTC time, which is currently 8 hours later than our local time.  Most of the rain happened between 8 am and 2 pm local time yesterday.

And the forecast is for more rain, through Sunday.  Woo hoo!

The narcissus are in bloom in our yard – they seem to think it's springtime...

Thursday, December 13, 2012

The Impact of Regulation...

Over at The Spirit of Enterprise there's a great post that points to this article about the impact of regulation on jobs.  The post makes this point:
In the realm of government schools, we can hire teachers to teach children effectively in the classroom, or we can hire more administrative staff to make sure that the school complies with ever greater regulation. Both would put wages in the economy that would then be spent on food, but only the first has the delightful knock-on effect of teaching others how to create more wealth. The spent wages of the administrators add little or no value until they land in the hands of somebody else who will create wealth with them.

In the private sector, we can hire an engineer to design a new medical device, or an internal auditor to support our "internal controls" assessment required under Sarbanes-Oxley. We can add a programmer to improve our service to our customers and perhaps lower their own compliance costs, or an accountant to track the tax attributes of every product we sell.

You get the point.
Yup, I get it.  Damned few politicians – on either side of the aisle – have any clue at all, though.  Or they just don't care, as the regulation devolves to their immediate political benefit, and that's their only consideration.

When Even a Liberal Can See It Isn't Working...

...then maybe we can all agree that welfare still needs reforming.

What am I thinking?  The progressives will never see reality...

Means Testing for Social Security and Medicare?

Some time ago I read about one of the methods being considered to reform entitlements (specifically, Social Security and Medicare): “means testing”.  That's fancy economist-lingo for this: don't give Social Security or Medicare benefits to people who have enough money to pay for their own retirement (and their own medical care while retired).

I suspect most people would have a reaction something like this: “Well, that sounds fair, so long as they don't mean me!”  My own reaction was a little different: over the years of my employment (I'm 60, and about to retire) I have had hundreds of thousands of dollars forcibly removed from my paycheck to pay Social Security and Medicare taxes.  I was told by many sources, not least of which was the IRS, that those dollars would help fund my own retirement.  It's likely that if means testing for Social Security and Medicare is enacted, our assets in retirement would exceed the means testing threshold – so I would get none of these benefits at all, nor would my wife.

I have a lot of trouble with the word “fair”.  I'm not really sure what it means, in this context or in many others.  It's a very subjective term.  I have a much more objective complaint: in effect, the U.S. government made a contract with me.  They said that if I paid these two taxes, as I have, then I would be entitled to Social Security and Medicare benefits in my dotage.  These discussions about taking those benefits away sound to me like pseudo-sophisticated arguments for straight-up theft – the bureaucrats would like to take the benefits that I paid for and give them to someone else who didn't pay for them.  Highway robbery.  Classic redistribution of wealth.  Fair?  Who gives a shit?  They're proposing to rob me!

And that's on top of the higher taxes they're about to impose on me...

Peggy Noonan and Mickey Kaus have other thoughts...

Wednesday, December 12, 2012

Curiosity: Update...

Curiosity delivered several interesting things today.  First, there's the self-portrait at right (full resolution, more info), produced as a composite of many images acquired by the MHLI camera.  Mission controllers use imagery like this to document and assess the state of the rover – at least that's the official excuse.  It's also just plain awesome.  Once again, I'm astonished by the advance Curiosity represents over its “ancestor” rovers.

At left is a map of Curiosity's travels since its dramatic landing just over two months ago (full resolution).  Not so long ago we were lucky if we knew for sure that a Martian lander actually landed, and we had a vague idea what quadrant it had landed in.  Now we know the rovers' positions to within a few centimeters – much more accurately, in fact, than I know my own location on Earth.  Awesome stuff!

Finally, there's a new stereo view (an anaglyph, full resolution) that's amongst the best yet to emerge from Curiosity's travels.  The dark spot near the center foreground is the location of some digging that Curiosity did.  If you've got a pair of red/blue glasses, slap 'em on and treat yourself to a 3D view of the surface of Mars.  It's something straight out of the science fiction of my youth:



36.79%

Suppose you have an opening for a secretary (does anyone actually have secretaries any more?).  Further suppose that 100 people have applied for the job.  You're the only one who can interview them, but you have conflicting goals: you would like to choose the very best candidate for the job, but you would like to interview as few of the candidates as possible.  What's your best strategy?

It turns out to be the following:
  1. Interview 37 (36.79% of 100), rating them as objectively as possible and giving each candidate a score.
  2. Remember the score of the candidate who ranked highest.
  3. Keep interviewing candidates, but hire the first one you find who ranks higher than the previous highest candidate.
By following that strategy, there's a 36.79% probability that you will select the very best candidate of the entire lot.

Go read Nick Berry (at DataGenetics) as he proves it...

Music From Garbage...

Just watch.  You'll like the world a little better...

Tuesday, December 11, 2012

Ada Lovelace and Note G...

Christian Hansen has the last of his series on Babbage's Analytical Engine posted.  I've enjoyed his series; I'm sorry to see the end of it.  In this post, he nicely explains Lovelace's proposed program for computing the Bernoulli series – and he debug's her program (which, alas, was never able to be actually run on Babbage's Analytical Engine, because it was never actually completed)...

What Career Paths Do Majors in “X” Take?

Here's a nicely done interactive infographic that lets you explore this interesting question.  You can also explore the inverse: what majors end up in a given career?

What it shows for computer science majors is fascinating, and a bit of a surprise for me: they end up in all sorts of careers, with far less than a majority ending up in technology.  On the other hand, it shows that people in technology careers may have majored in just about anything (or, like me, nothing at all!), with jibes with my own experience quite well...

If Google Was Around in the '60s...

...what might it have looked like?  Here's a very cool interactive animation that old fogeys like me and the young 'uns will both enjoy – though most likely for very different reasons...


Awesome...

xkcd is awesome this morning:


A Little Fact Checking...

This article caught my eye this morning.  It claims that there's a new market for point-to-point microwave links based on the fact that they're significantly faster than fiber optic connections.  By faster they mean latency (how long a message takes to get from sender to receiver), not bandwidth (how fast the content of a message takes to transmit).  The customer in this market is the high frequency trading world (aka “algorithmic trading”).

The need for low latency amongst high frequency traders makes perfect sense.  Once an electronic order arrives at an exchange, the actual trade can happen in less than a millisecond.  But does a microwave link actually have a significantly lower latency than a fiber optic link?

The article cites two factors that make microwave links faster:
  1. The speed of light in air is about 300,000 km/sec, but in fiber is about 200,000 km/sec.
  2. The route of microwave links tends to be more direct than fiber routes, which usually follow the right-of-way alongside railroads or highways.
The first reason is simple physics.  The second is true, but less certain.  There are also a couple of factors left out of this equation: both microwave links and fiber optic links require signal repeaters along long routes, but microwave links require them at smaller intervals – and each signal repeater introduces a small delay.

So let's do some math on the big market cited by the article: connections for traders in Chicago who are trading on a New York exchange.  The direct distance between Chicago and New York is about 1,150 kilometers.  Here's our math for each approach.

Fiber optic:
  distance = 1,150 x 1.3 (routing length factor) = 1,495 km
  latency = 1,495 / 200,000 = 7.45 ms
  repeaters = 2 (every 500 km) @ 0.2 ms = 0.4 ms
  total latency = 7.85 ms

Microwave
  distance = 1,150 x 1.05 (routing length factor) = 1,207 km
  latency = 1,207 / 300,000 = 4.03 ms
  repeaters = 4 (every 250 km) @ 0.2 ms = 0.6 ms
  total latency = 4.63 ms

Microwave beats fiber by 3.22 ms, one way - over three times the trading latency.  Yup, that's significant.

But there's one way to make this much, much lower latency, which the article doesn't mention at all – and it's the most common way by far: locate the high frequency trading servers physically nearby the exchange servers.  The electronic exchanges all offer (very expensive!) rack space in or near their datacenters for exactly this purpose...

Monday, December 10, 2012

Farmer Style...

Awesome!

Sunday, December 9, 2012

How to Spot a Bureaucrat Who Needs to be Fired...

I'll give you two answers:
  1. (only slightly facetious): Any bureaucrat you spot.
  2. (more seriously): Any bureaucrat who thinks that borrowing $2.5 million under terms that required over $35 million is a “good deal”.  And that's not even the worst example!  Oh, and the examples are from California, of course.  And it's so bad that even NPR is reporting it!  I originally heard this on the radio (I listen so my readers don't have to), and almost drove off the road in shock...
Bureaucrats and your money:

    Rope
    Tree
    Bureaucrat
    Some assembly required

Awesome!

Today's Dilbert strip made me laugh out loud:


Love the twin snorks :)

Management often makes themselves easy to lampoon, but still ... Scott Adams somehow always manages to get engineering's perspective across in a way that anyone (in or out of engineering) can understand...

Java Geek...

Just over five years ago, I started working at ServiceNow.  Now I'm in the process of transitioning out, as I'm retiring.  That's “retiring” in the sense of not being formally employed – I certainly won't stop designing and building stuff.

Before I went to work at ServiceNow, I had been using a commercial Java IDE called IDEA, from JetBrains (that's their logo at right).  I loved it in the way that any craftsman loves a fine tool.  But the standard at ServiceNow is the open source Eclipse IDE, which is awesome in its own different way.  I found Eclipse to be just fine as an IDE, but I didn't get the same pleasure from using it that I did with IDEA.

So yesterday I bought IDEA and started using it again, for the first time in five years.  That's enough time that my “muscle memory” had completely forgotten it, and I'm relearning it from scratch.  But I can tell you already that it has gotten better in the past five years – much better.  It has also kept up with all the latest dohickeys and whatnots, so (for example) it now directly supports git and GitHub and Maven and so on.  The code inspection and intention features made me smile as I worked – IDEA seems to always know what I'm about to do, and gives me a simple way to avoid having to type it.  It's awesome!  And it's very good to have my fine tool back again...