Saturday, August 31, 2013

Attacking chess

Here's how the game should be played!

White is Nicky Korba, still developing as a 16 year old.

Black is Siddharth Banik, only 13 years old.

Gotta love the last 5 moves of the game!

Friday, August 30, 2013

Understanding Computation: a very short review

One of the books on my Summer Reading List for 2013 was Tom Stuart's Understanding Computation

As computer books go, Stuart's book is rather unusual.

Many computer books are tediously practical: Learn XXX in 21 Days; Advanced Programming With The YYY Platform; ZZZ Technology In Depth.

Snore.

Some computer books are insightful and educational, but hard to approach: filled with dense academic prose, written to be used as textbooks in a classroom setting, short on motivation and examples. In my day, for example, we learned from The Design and Analysis of Computer Algorithms, which is as great a computer textbook as was ever written, but is certainly not the sort of book you approach lightly.

Stuart's book fits into neither category. In a relatively short, lively, friendly-yet-rigorous 300 pages, Stuart manages to educate the reader on a surpisingly broad range of core theoretical concepts:

  • By page 20, we're discussing the concepts of syntax and semantics and learning about how to use Small-Step Operational Semantics to describe the behavior of a programming language implementation for an abstract machine.
  • By page 50, we've moved on to Denotational Semantics, and we're learning to implement a language parser
  • By page 60, we're studying Deterministic Finite Automata, and by page 70 we're comparing them to Nondeterministic Finite Automata
  • By page 100, we've learned to build machines that recognize Regular Expressions, and we're introducing the concept of the Pushdown Stack into our abstract machine.

Understanding Computation continues at the same pace throughout the book, covering

  • Nondeterministic Pushdown Automata
  • Parsing, Lexical Analysis, and Syntactic Analysis
  • Turing Machines
  • Lambda Calculus
  • Partial Recursive Functions
  • Tag Systems
  • Self-referential statements
  • Programs that can refer to themselves
  • Decidability
  • The Halting Problem
  • Incompleteness and Uncomputability

Whew! All this, in a friendly, clear, lively, 300 page book!

The sections on the Lambda Calculus were particularly rewarding for me, as this is an area that I somehow never picked up in my studies, and although I've tried from time to time to comprehend it, this was the first time I really felt like I got a true understanding of what was going on, and why it has the power that it does.

This is not to say that Understanding Computation is easy. You have to be willing to read Stuart's writing carefully, and you have to stop and think about what he's saying.

But all the way through, Understanding Computation is fun to read, not heavy or dull. For example, here's Stuart talking about the practice of programming:

Programmers tend to be practical, pragmatic creatures. We often learn a new programming language by reading documentation, following tutorials, studying existing programs, and tinkering with simple programs of our own, without giving much thought to what those programs mean. Sometimes the learning process feels a lot like trial and error: we try to understand a piece of a language by looking at examples and documentation, then we try to write something in it, then everything blows up and we have to go back and try again until we manage to assemble something that mostly works. As computers and the systems they support become increasingly complex, it's tempting to think of programs as opaque incantations that represent only themselves and work only by chance.

But computer programming isn't really about programs, it's about ideas. A program is a frozen representation of an idea, a snapshot of a structure that once existed in a programmer's imagination. Programs are only worth writing because they have meaning. So what connects code to its meaning, and how can we be more concrete about the meaning of a program than saying "it just does whatever it does"? In this chapter, we're going to look at a few techniques for nailing down the meaning of computer programs and see how to bring those dead snapshots to life.

"Everything blows up and we have to go back and try again": how perfect of a description is that?!

Some programmers are just programmers: for them, programming is a job, and they are doing it to make a living. To be an industrial programmer, you don't necessarily need to Think Deep Thoughts. You acquire a certain level of competence with the widely-used technologies of the moment; you join a team; you take on certain projects; you crank out code.

There's absolutely nothing wrong with being an industrial programmer, but this book is not really for that person.

There's another sort of programmer who isn't just interested in what, but also in why, and how. Some programmers don't approach programming just as a mechanical process, but are more introspective. They think about alternatives; they wonder whether one approach is somehow better than another; they look for ways to refine and elevate practice to art. This is the person who wants to be able to explain (to themselves and to others) not just that their program works, but why it works. This is the sort of programmer that frets about abstractions, that looks for common concepts and opportunities to reuse and extend solutions that were built earlier, that speculates not just about the solution to the problem at hand, but about the solution to the problem not yet encountered.

Stuart's book will appeal to that person, to that programmer who's neither just a practical engineer nor an abstract theoretician, but is rather somewhere in between, a little bit of both, and looking always for the opportunity to combine the two approaches and demonstrate that the whole is greater than the sum of its parts.

Does that describe you? Well, if so, give Understanding Computation a try; you might well enjoy it!

Thursday, August 29, 2013

Stuff I'm reading, end-of-August edition

Already planning that Labor Day barbeque? Surely you'll need something to read, or at least some paper to provide the kindling when you stack up the briquets in your chimney starter...

  • It's finally here! 24 years after the Loma Prieta earthquake: 2013 Closure Fact Sheet
    This Labor Day weekend, the Bay Bridge will be closed to take the original East Span out of service and to open the new East Span to traffic. Work will be done at the Oakland Touchdown and the Yerba Buena Island Transition Structure to connect the new bridge to the existing Toll Plaza and Yerba Buena Island, respectively. Crews will also perform essential construction activities, including paving, striping and erecting barrier rail. Throughout the closure, maintenance will work on the West Span, replacing lighting fixtures, cleaning and painting the cable, and repairing finger joints.
    Meanwhile, Bay Bridge Celebration
    Due to the late notice regarding the opening, the planned public celebration has been postponed to a future date.
    Although, of course, it wasn't actually due to "late notice regarding the opening" at all.

  • Predator drone now part of battle against Rim Fire near Yosemite
    While unmanned aircraft have mapped past fires, use of the Predator will be the longest sustained mission by a drone in California to broadcast information to firefighters in real time.

    The plane, the size of a small Cessna, will remain over the burn zone for up to 22 hours at a time, allowing fire commanders to monitor fire activity, determine the fire's direction of movement, the extent of containment and confirm new fires ignited by lightning or flying embers.

    The drone is being flown by the 163rd Wing of the California National Guard at March Air Reserve Base in Riverside and is operating from Victorville Airport, both in Southern California. It generally flew over unpopulated areas on its 300-mile flight to the Rim Fire. Outside the fire area, it will be escorted by a manned aircraft.

    Officials were careful to point out the images are being used only to aid in the effort to contain the fire.

  • Nasdaq Blames a Surge of Data for Trading Halt
    the company highlighted more than 20 attempts by Arca, one of the exchanges run by NYSE Euronext to connect and then disconnect to the system that provides prices for recent trades in Nasdaq stocks. Those were accompanied by what Nasdaq described as a stream of quotes for inaccurate symbols from Arca, which Nasdaq’s system was forced to reject.
    As is often the case, Nanex has some much more interesting information about the incident: Nanex ~ 22-Aug-2013 ~ Quote Burst Loops
    A Theory

    ARCA's connection to the SIP breaks, so it retries, connects for a short period of time, which then breaks, another connection, which breaks, over and over in quick succession. Each connection reducing the total number of available connections (temporarily - for a few minutes), so that eventually any new connection fails. If Nasdaq is monitoring the health of the SIP via polling TCP, it won't be able to connect either (all connections are exhausted) and will think the SIP is down. But they probably see the SIP is still sending quotes from the outbound side (which, by the way, uses UDP/multicast). The engineers get the back-up SIP ready, but the back-up SIP doesn't know where the production SIP (the one not accepting connections) left off, because they can't connect to it either. The back-up SIP starts making requests to each of the 12 or so exchanges for the last 50 or so minutes of quotes (probably from the last known feed positions recorded before connections were exhausted).

    The back-up SIP request 50 minutes from EDGE, and transmits those, then requests and transmits 50 minutes from BATS, and so on. Sound familiar? It should, because that is exactly the pattern we see in the data.

  • Why don't DBMS's support ASSERTION
    So, why isn't ASSERTION supported by the vast majority of relational database packages? Is it soley a performance issue or is there something intrinsically hard about it?
  • Falsehoods Programmers Believe About Names
    So, as a public service, I’m going to list assumptions your systems probably make about names. All of these assumptions are wrong. Try to make less of them next time you write a system which touches names.
  • The Business of Protection
    You should know this about offensive line coaches: they are large, demanding men with Falstaffian appetites, jutting jaws, and no governors on their speech engines. They eat titanic portions. They cram their lips full of dip in film study like they are loading a mortar. They drink bottled water like parched camels, and in their leisure time would consider a suitcase of beer to be a personal carry-on item for them, and them alone. They are terrifyingly disciplined in the moment, and nap like large breed dogs when allowed.
  • The money is in the Bitcoin protocol
    Hopefully it is clear from the features of the Bitcoin protocol and system that crypto-currency is just one use case. Just as the BitTorrent protocol can be used in multiple ways for peer-to-peer data transfer, so can the Bitcoin protocol open up new and different possibilities.
  • How Moral Revolutions Happen (They Had A Nightmare)
    It’s hard to be egalitarian and admit that an inegalitarian impulse makes the moral world go round, in practice, always. (It’s easier for egalitarians to want equality, after all. They get to wear it as a badge of achievement. My believies!) Whatever equality we get is going to have to arise out of a process that seems to run contrary to that. That seems true.
  • You won't find this in your phone: A 4GHz 12-core Power8 for badass boxes
    Judging from the Power8, it looks like IBM is content to keep in the same clock speed range as the Power7+ chips - around 4GHz, give or take a little. It'll also move PCI-Express 3 controllers into the chip package to keep those hungry little Power8 cores fed; these controllers will offer a coherent memory protocol to external accelerators as well as a new cache hierarchy that goes all the way out to the L4 cache.

    As expected, IBM is also goosing the number of processor threads per core with Power8, doubling it up to eight per core. IBM has been vague about how many cores it might squeeze onto a die with the 22-nanometer shrink, and it could have probably done as many as sixteen cores if it had not added so much eDRAM L3 cache memory with the Power7+ and then boosted it even further with the Power8.

    On the workloads that Big Blue is targeting with its Power Systems iron, having more cache and cores running at near peak utilisation is more important than having lots of cores on a die. Just as is the case for mainframes, at the prices that IBM has to charge for Power Systems servers, the chip has to be architected to run at close to full-tilt-boogie in a sustained manner.

The Perforce Distributed Service

My latest article is up on the Perforce corporate blog: The Distributed Perforce Service

Answering "yes" to any of these questions means you would realize benefits from a Distributed Perforce installation. And if you answered "yes" to multiple questions, the benefits could be substantial!

Check it out; let me know what you think!

Wednesday, August 28, 2013

Messi and Neymar

Great article in Slate about this season's pairing of Lionel Messi of Argentina, the greatest footballer I've ever seen play, and up-and-coming Brazilian superstar Neymar da Silva Santos, the most exiting new footballer of the last several years: Messi and Neymar: Will the world’s greatest player and Barcelona’s new prodigy play well together?.

Messi is adored not only for his brilliance and his results, but also for his dedication and focus:

Messi plays the kind of football that only other masters can fully appreciate. It's not simply that he's technically brilliant, with bullish strength packed into a compact frame and instant, insectlike reactions. Perfection in possession is just the beginning. Messi is also the best player in the world during the 98 percent of the game when he doesn't have the ball.

That doesn't mean he runs a lot. His central role at Barcelona allows him to stay close to the box, so he rarely has to dart more than 20 meters at a time. While others chase, Messi lurks, saving his energy for the decisive moments.

No such moment ever catches him off guard. He's in a sustained flow state that nothing can disturb (except, perhaps, a teammate hesitating a little too long over a pass). In that trance he thinks too fast for his opponents to keep up. He doesn't respond to provocation, and he doesn't play to the crowd.

And, of course, the very best thing about Messi, as Slate points out: Leo Messi Never Dives.

Neymar, meanwhile, is the best football player in Brazil, which is of course the best country at football in the world.

At 21, Neymar has already scored 161 goals for Santos, Brazil, and now Barcelona. It's a phenomenal number: twice as many as Romario had scored at the same age, and three times as many as the 21-year-old Cristiano Ronaldo.

Neymar, the prodigy, is also ahead of where Messi was at 21. He has played with successful teams, winning his state championship, his continental championship, and most recently the Confederations Cup with Brazil. He was named best individual player at that tournament, adding to a hoard of individual awards: top scorer in Brazil, Brazilian player of the year, twice South American player of the year, FIFA's Puskás Award for the best goal scored anywhere in the world in 2011, a finalist for that same award in 2012.

I've only been lucky enough to watch Neymar play a handful of times, most recently in the 2013 Confederations Cup, the warm-up tournament for next year's World Cup.

In the games I've seen, Neymar's play has been astonishing. Not only is he markedly faster than the other players on the field (no simple matter in a sport populated by the fastest runners on the earth), but his balance, agility, and power while on the ball are remarkable. Just watch as he leaves the best professional footballers on the planet lying on the ground, contorted and collapsed in disarray from trying to stop him.

Stop, start, weave, bob, SLAM!

What will it be like to have these two on the field together? Will they be able to play together? Or, as Slate wonders, will they clash and fail to mesh?

I know I'll be watching and waiting to see!

Monday, August 26, 2013

Feed the feedly

I see that Feedly is now starting to (gently?) beg for money from its users.

There is a relatively polite request on my feedly screen asking for $45/year to become a "Feedly Pro" user.

Well, I can't say I'm surprised.

Sunday, August 25, 2013

Fallen Enchantress: Legendary Heroes: A very short review

I just lost an entire weekend to Fallen Enchantress: Legendary Heroes.

If you've played games like Civilization V, Heroes of Might and Magic, Command and Conquer, Warcraft, Strategic Conquest, etc., then you know what sort of game Fallen Enchantress: Legendary Heroes is.

And, if you have played any of those games, and liked them, you're going to love this game.

Firstly, it's beautiful, and lots of fun just to look at.

Secondly, it's hard, which you know is very important for this sort of game. The computer plays very well, and the game does not make it easy on you.

Admittedly, I'm just getting started, and just learning the game, but even on the easy "beginner's" level, I probably lost a dozen games this weekend.

I'll have more to say about the game, I'm sure, after I've lost a few dozen more games, and a few hundred more hours, to it.

But now, back to fighting that Darkling War Rider army that's on my city-front...