2017-07-13 09:02 am
Entry tags:

Library review: Cowboy, Sumo Rest

The other end of the Erlang experiment is the libraries I was working with. My application was built on the Sumo Rest stack, built on top of the Erlang Cowboy HTTP server.

I found this finicky and prone to vague runtime errors. That's not important, though. The overall style of the system was pretty reasonable, and is probably a good way to write REST services in general.

Read more... )

The layout implications of this are useful and generic: one source file per type, where each type file defines its storage, serialization, and documentation; and one source file per route, where each route file has its own URL path, complete machine-processable documentation and metadata, and understands the standard failure cases. You just need the right high-level REST library in your language of choice to support this.
2017-07-13 08:27 am
Entry tags:

Programming language review: Erlang

What do you get if you combine Haskell's basic functional style, Lisp's type system and object representation, a unique concurrency system, and a very good runtime?

Read more... )

In short, Erlang looks like a good language, a little dated, but I'd rather have good static checking and a robust library stack than an excellent runtime with okay libraries, especially if I can avoid peeking "under the hood".
2017-04-15 07:15 am

DW

The same username I have in the rest of the world, except for here, and my gmail, and my Flickr.

I've managed to find the half-dozen people who have said they're relocating in the current exodus, but not the people who thought the air was starting to smell funny when the new overlords turned out to be Russian years ago.

DW will probably get about as much use as LJ has been, which is to say, very occasional long-form blogging for a social audience that's not really suited to one of the newer trendier social networks.  But I'm there.
2016-08-18 09:30 am
Entry tags:

Mr. Reindeer wants to feel superior

https://github.com/hiddenlotus/inferior-spim - An emacs inferior mode for spim

(Also, apparently spim is still around and in use, to the point where people are writing new Emacs modes for it?)
2016-03-28 11:41 am
Entry tags:

Cameras and transit

The past decade in Boston transit has seen a massive increase in the number of CCTV cameras deployed around the MBTA system.  Several are seen in most rapid transit stations, newer buses have several apiece (and a video monitor showing you what's being recorded), and the monitoring stations are consciously placed in places like the South Station subway concourse where the general public can see them.  "Sure, Big Brother is watching you," the T says, "but it's for your own safety."

This rubs me the wrong way.

Meanwhile, across the pond, I also read the reports of the British Rail Accident Investigation Branch.  These are fascinating from an engineering point of view because they try to explain and analyse, in plain English, what actually happened and could be improved: maybe a lorry backed into a bridge pushing the 150-year-old brickwork on to the tracks, which a train hit 10 minutes later, but why didn't 999 contact the signaler to have them stop the train, and why was the damaged train allowed to continue at 100 mph after the accident cleanup?

The RAIB reports are also good for including pictures of relevant parts of an incident: here's a picture of the pin assembly on an intermodal flat car, here's what it would look like if it was hanging off the edge of the train, here's the picture of the train platform said pin assembly hit at 60 mph.  Depending on the incident, many of the pictures come from CCTV imagery, including pictures from remotely manually controlled level crossings and station platforms.

This use of CCTV imagery I'm very okay with; but it does actually depend on having cameras in a lot of places so that you can collect together a photographic history of the train.  "We're watching our infrastructure and our trains to make an already safe system safer" seems like a positive message; much better than "we're watching you".
2015-11-19 11:14 am
Entry tags:

What happens if wages change fundamentally?

Let's say, hypothetically, that Bernie Sanders wins the election, and even more hypothetically, pushes through national single-payer health insurance and a corresponding IRC change that employer-provided health insurance is no longer a deduction.  This of course causes massive upheaval in the health insurance industry; but what effect does it have on a typical employer?

(You can ask a similar thought question about the proposal of just giving a handout to every person in the country that should be able to provide basic food and shelter, and simultaneously reducing minimum wage to zero.)

Read more... )
2015-10-01 09:42 am
Entry tags:

Useless observations on Fitchburg line (Porter Square) resignaling

(0) They removed the signal behind the Market Basket, and changed the area between Sherman St. and Alewife Brook Parkway to no longer be a signaled junction, which affects what the signal at Porter can show.

(1) Old signals showed red, unless the track was running in this direction.  New signals show a normal block signal aspect unless the track is running in the opposite direction.  (Or else, new control system makes it harder to set default "trains run on the right" routes and forget about it; but I'm pretty sure I've seen the old signals show red in both directions before.)

(2) The new signals take quite a while to reset to red when a train passes, like 10 seconds or so.  (It is possible that the train needs to completely pass the signal, but I don't think it actually works that way from watching two trains go by, and it would be odd for a new installation at this location anyways.)

This in combination means that the new default is yellow-over-red (approach) on both tracks; red-over-red (stop), probably on the left-hand track, means a train is coming from North Station; yellow-over-green (approach medium), probably on the right-hand track, means a train is going to North Station; and green-over-red (or -over-green, clear), for wonderfully geeky reasons, means a train has a route set all the way into a platform at North Station.  The outbound signals only show red/yellow/green; I have not yet observed whether these (or other new installations, like on the Lowell line) show flashing-yellow (advance approach) (rumor from the Internet is that they don't).
2015-10-01 09:04 am
Entry tags:

Modular model railroad benchwork

I've been thinking about starting the model railroad thing over again (having given away the previous half-finished layout in the renovation move).  One of the things I want to do differently this time around is build it in modules that I can take apart and put away somewhere, or rearrange to really take over the basement, or whatever else, and that I can start with a string of "I nailed track to plywood" modules so I can just run trains.

It turns out the subject line Googles reasonably, and comes up with at least three companies willing to sell things very much along these lines, at what seems to me to be an insane price.  Doing this requires a little bit of engineering design, some extremely basic woodworking skill, and a trip to your choice of wood store; or I can order a predesigned, precut, some-assembly-required kit for about $300 for a 2'x4' module (which may not scale the way I want).  This matches the last time I looked at electronics, which seemed to be similarly ridiculously marked up and wrongly featured for things I could build with some microcontrollers and motor drivers, though the electronics at least requires some technical knowledge.  I just don't understand this market and pricing, apparently.
2015-09-11 09:57 pm
Entry tags:

Second impressions of Go

Go is the new trendy programming language. In style it's kind of a backwards C, with an interesting amount of object-oriented features baked in. You can definitely get things done in Go, especially if you're not trying to interface to legacy systems.

As a modern language, though, the things it's missing seem odd. C++ has had parameterized template types as long as I've known it, and Java added them in eventually, but not Go, it's complicated. This means that basic functional-language primitives that are addictingly useful are essentially impossible to write. Remember 6.001? )

Most things in Go work by returning pairs of an actual result and a flag or error object. This does lead to making it more obvious to try to do some error handling, and it is "better" than both exception-based languages (where it's easy to ignore errors until they crash your program) or C's magic return value (where an int is an int, unless it's -1). But it also leads to more boilerplate. In which we briefly introduce monads )

There's one other oddity I've run into: When is nil not nil? )

Even so, the things that people find attractive about Go are still attractive. It's a compiled language, that isn't 30+ years old or owned by Oracle, that compiles reasonably obviously but can't obviously crash from pointer arithmetic errors. It's garbage-collected, which you may object to, but it beats the pants off of explicit memory management. The language includes maps and queues as base types, and if you secretly did like C memory management, you can relive the past with concrete arrays underneath slice views. I admit to having done almost nothing with goroutines, but the promise of the runtime having a select loop and thread management and synchronized channels in the core is much better than anything I've used that doesn't involve a big C library.
2015-07-25 02:24 pm
Entry tags:

Balanced budgets and demagoguery

My father and I self-identify on opposite ends of the political spectrum.  This doesn't preclude reasonable political conversations: "here's how the recent T review was a debacle"; "you clearly aren't a Sanders supporter and Trump is a nut job, so which of the 732 Republican candidates do you support?"  It seems like we agree on the fundamentals of how government should work, just not what the priorities should be.  Fundamentally I feel like mainstream politics comes down on one of three positions as far as finances go:

  1. I think government services are important and they need to be paid for, so I'll concede paying higher taxes for them, even if they serve others.

  2. I think low taxes are important, even if they come at the cost of government services, some of which may benefit me.

  3. If we cut taxes, the magic growth fairies will make there still be revenue so that government services can still happen.

Read more... )
2015-07-06 07:12 pm

Musing on museums

Last month's Asia trip included a couple of museums: the Shanghai railway museum, the Mint Museum of Toys in Singapore, and the Singapore World War II museum Reflections at Bukit Chandu.  This leaves me with a much better sense of what I appreciate in museums: they should be able to tell me some consistent story that I can appreciate and put in context.

Read more... )
2015-07-03 05:58 am
Entry tags:

Getting around in China

As noted elsewhere, I've just gotten back from a week in Shanghai and a week in Singapore.  Both of these trips were very urban; the Zhujiajiao expedition involved a guide and a driver and two and a half hours (with traffic, both ways) in a car but otherwise we were on our own two feet and the rails.

The Shanghai subway )

The fast train to Suzhou )

I do want to note just how much this intercity train system is kicking the ass of anything in the United States, though.  "One stop per 100 km" roughly matches what long-distance trains like the Lake Shore Limited do; if they run 175 mph between stations instead of 80 mph then that can literally halve the time to Chicago.  Even the "fast" trains like the Acela Express have very short sections of actually being "fast", between Boston and New York the section south of New Haven is also 80 mph with sections like downtown Bridgeport being 25 mph.  I think something like this is the vision of the big California construction project but it takes both money and willpower to do it.  China is willing to do it; here we just can't commit.
2015-05-05 07:05 am
Entry tags:

Tax policy

Google News decided I needed to read this diatribe pushing Republican tax policies.  They all seem like terrible social policy to me.  I'd think the basic rules should be:

  • Taxes cover the cost of running government

  • People who can afford to pay more should

  • The tax code should be comprehensible by mere mortals

Read more... )
2015-02-10 09:21 am
Entry tags:

Government, privatization, the T

Hello from home, since I can't go to work because the T isn't running, in turn because the T says that if a third train gets stranded they'll have trouble evacuating people in the dark. My Facebook feed is largely blaming this on a combination of excessive weather and old equipment (a third of the Red Line fleet is 45 years old, with an expected lifetime of 30). Meanwhile, our Republican governor, apparently parroting the Republican line that everything can be fixed with budget cuts, is proposing to cut $14 million from the T's budget. Now, $14 million isn't actually useful capital spending in this context, oddly enough — the newest Blue Line train cars cost $2 million apiece — but if the T needs more spending, how does cutting its budget help? Perhaps more interestingly, our governor was elected in part based on his business credentials, could private business run the T better?

Read more... )
2014-10-11 05:50 am
Entry tags:

Number-crunching bridge, and the Gold Rush

The ACBL's latest Web page redesign includes a page that gives your rank (inverse matchpoints) and percentile in a wide range of masterpoint categories, for instance where you are relative to all players that got any gold points this year. If you just copy-and-paste that page into a spreadsheet and do some basic math, you can find out the size of each category, which makes some interesting statements.

probably not interesting except to active bridge players )
2014-09-07 10:10 pm
Entry tags:

Hannah Duston

Hannah Duston

In G.A.R. Park in central Haverhill is a statue of Hannah Duston. According to the story inscribed at the base of the statue, in the spring of 1697, she was captured by natives, but after two weeks managed to escape, slay every single last one of her captors, and return back to the European settlement. Applying modern values, this is a horrible story to start with, but building a statue celebrating the killing of "the savages" seems even worse.

Would you advocate removing the statue?

Read more... )

The Wikipedia article on Hannah Duston has more; of possible significance as well, this is reportedly the first woman honored in the United States with a statue.

2013-05-24 09:03 am

Star Trek: Into Darkness

I was not overwhelmed by Star Trek: Into Darkness. I'm a doctor, not a film critic )
2010-10-24 01:51 pm
Entry tags:

40B

There's a ballot question this year to repeal sections 20 through 23 of chapter 40B of the Massachusetts General Laws. The existing law sets up a system where a developer can make a request directly to a town's Zoning Board of Appeals to get a single master permit for building limited-income housing.

What the law actually says )

40B FUD )

Question 2 FUD )

Is 40B effective? )

Is 40B abused? )

Personal revised opinion )
2010-08-01 03:05 pm
Entry tags:

Revolution

Last night a group of us played Revolution, a newish Francis Tresham game about the Eighty Years' War )
2010-05-02 09:26 pm
Entry tags:

Beyond the Minuteman

Managed to squeeze in two days of biking this weekend with the Quad group, 54.94 miles yesterday (route map) and an additional 43.61 today (route map). Today's looks almost exactly like one of the "Beyond the Minuteman" route cards: go out on the Minuteman, wander around in Concord for a bit, and take the most direct route back to the Minuteman.

Yesterday's ride started slow for me but picked up, and seemed to turn into a reasonable hill-climbing day. Today's ride started at a reasonable speed but then slowed down a lot when I was heading home. I didn't feel too wiped out at the end of it, just slow. I'll take that as a weekend result.