JSON an XML Alternative

I recently came a cross a blog talking about JSON, a straight forward alternative to XML. I’ve always disliked XML, and so has pretty much everyone I’ve ever known who’s had to muck with it. It’s not terrible, just clunky, and seems so much less efficient than the one-off csv type files most of the unixy folks I associate use. JSON tries to combine the two, but has easy-to-read, simple, lightweight, and yet is standard and portable. How cool is that?

From www.json.org’s description:

Extensible Markup Language (XML) is a text format derived from Standard Generalized Markup Language (SGML). Compared to SGML, XML is simple. HyperText Markup Language (HTML), by comparison, is even simpler. Even so, a good reference book on HTML is an inch thick. This is because the formatting and structuring of documents is a complicated business.

Most of the excitement around XML is around a new role as an interchangeable data serialization format. XML provides two enormous advantages as a data representation language:

  1. It is text-based.
  2. It is position-independent.

These together encouraged a higher level of application-independence than other data-interchange formats. The fact that XML was already a W3C standard meant that there wasn’t much left to fight about (or so it seemed).

Unfortunately, XML is not well suited to data-interchange, much as a wrench is not well-suited to driving nails. It carries a lot of baggage, and it doesn’t match the data model of most programming languages. When most programmers saw XML for the first time, they were shocked at how ugly and inefficient it was. It turns out that that first reaction was the correct one. There is another text notation that has all of the advantages of XML, but is much better suited to data-interchange. That notation is JavaScript Object Notation (JSON).

The most informed opinions on XML (see for example xmlsuck.org) suggest that XML has big problems as a data-interchange format, but the disadvantages are compensated for by the benefits of interoperability and openness.

JSON promises the same benefits of interoperability and openness, but without the disadvantages.

Let’s compare XML and JSON on the attributes that the XML community considers important.

Here’s a neat example of some jason formatted data:

{
     "firstName": "John",
     "lastName": "Smith",
     "address": {
         "streetAddress": "21 2nd Street",
         "city": "New York",
         "state": "NY",
         "postalCode": 10021
     },
     "phoneNumbers": [
         "212 555-1234",
         "646 555-4567"
     ]
 }
Posted in Uncategorized | 1 Comment

brgr: nyc restaurant review

I landed at JFK at about four. By the time I got to my hotel on 29th St. in Manhattan, it was five thirtyish. After flopping on the bed and taking a shower to wash the travel off, I needed a bite to eat. There’s a decent deli on the corner that sells pizza by the slice, but they were closing up by the time I got there. I remembered seeing a burger place a few blocks away the last time I was here, and it had looked decent, so I headed off in the general direction hoping it was where I remembered.

I got to ‘brgr’ a few minutes later and walked in. The restaurant itself was nice, big (by NY standards) and was clean. The menu was simple enough – burgers, a list of some cheeses and various condiments. I opted for a standard hamburger with pickles and onions. They make the burgers to order, so it took a little bit for my food to arrive, and it was a decent burger, if not quite as spectacular as, say an astro burger, but certainly not terrible although at almost ten dollars for a burger with a small soda, it didn’t quite live up to the price, or the expectations.

The thing that got me though, was the attitude of the help. Anthony, who’s name was on my receipt, was so far from giving a shit it comical. The guy could have been a fricken buddhist monk who had achieved nirvana. It wasn’t even rudeness, not even by New York standards… it was just complete apathy. The same thing was true from the guy who delivered my ‘brgr’ – he didn’t quite “toss” it in front of me, as much as just let gravity do it’s thing. Every now and again I’ll be forced, due to the rigors of travel, to eat at a McDonalds or a Burger King… their employees generally care more, although, admittedly usually look more frightning.

Apparently it’s got some fans but there are also greenolivemedia.blogspot.comsome mixed reviews on citysearch… I guess overall, I’d say if you happen to be walking by and are hungry, it’s probably worth stopping in, but definitely not worth crossing town. My one regret is I noticed after I ordered that they had egg as a condiment, and bacon and and an over easy egg are two great toppings for a burger.

Posted in Food and Restaurants, restaurant, review | Tagged , , | Leave a comment

Kai Doh Maru

I just finished watching Kai Do Maru. Kai Do Maru is an animated film by the same animatiscreen cap from kai do maruon group as directed the more well known Ghost in the Shell, and once pointed out, it’s hard not to see distinct similarities in the artwork. The color pallet is unique among anime that I’ve seen: it has a washed out feel with almost no use of blacks, or bright colors. It feels muted, something which lends a dreamlike quality and helps mute some of the more violents scenes, except where the limited use of bright, vibrant red intentionally brings it out. I think the dreamlike ambiance of the film made it more difficult to follow though, as did the emotionless voice acting. This, I think, is intentional, tying into the overall tone of the film.

kai do maru screen captureOverall, I think Kai Do Maru is good, but not great. I did like that it’s an unapoligetically grownup film, and the artwork is certainly interesting, and debatably beautiful. At 45 minutes, it feels right, any more and it might be too much, any less and it would be unsatisfying. Watch it via netfix’s watch now feature and you won’t be disssapointed, but don’t plan an evening around it.

If you’re interested in reading more, there’s a much more full-fledged review here.

Posted in movies, review | Tagged , , | Leave a comment

Why OpenID is awesome and Destined to Fail

So I just installed the wordpress openid plugin – it’s a fantastic idea and works well. I don’t want to have to make people sign up on my site and everyone already has an openid — one of the listed participants is AOL and everyone has an AIM screen-name.

If you’re unfamiliar with OpenID, and since it’s not widely used, you probably are, it’s a distributed authentication system. The idea is you have a trusted authority and that authority can vouch for you. Just like you don’t need to setup an account at every single liquor store, you just show them your license. The added benefit here is, instead of one single dmv, there can be many, just in case the local dmv goes out of business. So, if you’ve got an account on a yahoo service, flickr, messenger, mail, etc, you can use yahoo to authenticate; if you use some other prevalant service, you can use them instead… it’s great, and prevents lock-in to a single companies services.

The thing that sucks, and this is so damn stupid – the convention for a “username” is loginserver.domain/username — ala kerberos. The problem is they used a “/” instead of a “@” and  didn’t tie it into dns. It’s a great idea, but there need to be a couple small tweaks and it would catch one:

  • integrate DNS
  • allow people to use email addresses instead of urls.

I should be able to put in username@aol.com, and my log in program should then do a “host -t oid aol.com”, find the openid server and then do the authentication with that. Instead you’re required to know that aol.com uses openid.aol.com as it’s openid server and to use a url.

I know this seems like small stupid stuff, but it is, and it’s why openid won’t catch on. It’s really too bad, because having an open, scalable, distributed login system not in the hands of any single corporate entity is really important.

::sigh::

-Nick

Posted in openid, tech | Tagged , , , | 1 Comment

Next Week Will be Crazy

Next week I’m doing a custom netapp class for Morgan Stanley, a large investment firm. This would be fun, but we’ve packed a course that takes a week into two days, and it’s in NYC. New York is a city I have a love-hate relationship with. I find NYC cool, but exhausting. It’s not the walking that gets me, it’s the jetlag, and the rudeness. It’s also that people are so much more abrupt than… well, everywhere else. My tolerance for rudeness is a lot less these days. I am now aware that people are nice to strangers most places in the world. The thing that’s going to make next week tough though is, on Wednesday, I’m picking up, packing up after class and then flying to North Carolina. North Carolina is actually growing on me. I met some nice people there, and it’s really wide open and green, but it’s hotter than zeus’ ballsack.

On the upside, good bbq, pizza *and* bagels all in one week!

Posted in Uncategorized | Tagged , , | 1 Comment

Drums!!

So after a number of years of wanting to buy and electronic drum kit and putting it off because it was too expensive, and it was tough to justify (since I don’t really know how to play them very…

Posted in Uncategorized | Leave a comment

Fuck yeah

Just chased down some dumb-ass sixteen year old that stole some retarded kid’s bike. I rule! w00t! PS: no, I was not a dick, I just made him go back and apologize and didn’t call the cops….

Posted in Uncategorized | Leave a comment

The Greatest Voicemail Ever

I arrived in LA last night at 9:38pm. This was three minutes later than my GPS estimated I would. What a piece of crap. It was a long drive. Very long. 1100 miles or so, actually. There is a piece of road in the south of Oregon where you’ve got a 7% vertical grade downhill, windy road signs, and I’m not making this up – LED signs that measure your speed and inform you that unless you drop your speed significantly, you will almost certainly flip over and fall to your doom. I drove this particular stretch of highway at roughly 3am on Monday in a torrential downpour with near zero visibility. In a porsche, it would have been awesome, in a U-Haul, not so much. Having a U-Haul, however, did get me one of the <a href=”http://nicholasbernstein.com/shotgun.amr”>best voicemail messages I’ve ever had</a>. It’s in a weird format, but you should be able to open it with quicktime.

Posted in Uncategorized | Leave a comment