Apple woes

Mac Mini (2010)

I just bought a Mac Mini. I brought it home and connected it to my beloved 23″ Apple Cinema Display monitor. I then tried viewing an HD movie that I bought on iTunes. I got this message:

This movie cannot be played because a display that is not authorized to play protected movies is connected. Try disconnecting any displays that are not HDCP authorized.

It turns out that Apple has implemented a security protocol that restricts the type of device upon when commercial video can be displayed. My monitor is six or seven years old, so it doesn’t support this protocol, so I’m out of luck. The alternative is to buy a brand new monitor, which I have no desire to do.

Worse yet, the message implies that even if I did buy a new monitor, I’d have to stop using the old one entirely. The video won’t display as long as there are any non-HDCP devices attached, so I couldn’t even use my old monitor in a dual monitor configuration.

This is bullshit. Especially considering I can play iTunes content on the same monitor just fine using Windows.

Luckily for me, I didn’t buy the Mini to watch HD movies on my computer, but on my TV via HDMI, which works perfectly. But still, I find it frustrating that I actually lost iTunes support by buying a Mac.

So, if you’re planning to use an existing monitor with a Mac Mini, you’ve been warned.

Other than that, the Mini is a sweet little machine. It’s incredibly quiet, and works great hooked up to an HD TV. Plus you can control iTunes with the Remote iPhone app.

2.7 million dots

  1. Find raw data for 2.7 million cities.
  2. Import it into MySql.
  3. Generate Pov-ray data to render each city as a tiny red sphere on a large black sphere.

LEGO past and LEGO present

LEGO

I can’t remember when I first saw a LEGO brick.  There was a LEGO set at my grandmother’s house, and as far as I knew, it had always been there. It provided countless hours of entertainment. I built things, and then destroyed them, and then did it again. The disassembly was usually aided by a crash into a wall or a tumble down a set of stairs.

Then, when I was eleven, I got an Expert Builder LEGO set for Christmas (a line that later became the Technic line.) And that was an epiphany. It was the 858-1: Auto Engines set, and, despite the fact that it had square pistons, it was both educational and fun. That prompted me to spend my carefully saved allowance on another set, the 8848-1: Power Truck. I loved these two sets. So much so that my dad sat me down and told me that he and my mother were worried about me, and that from then on I could only build one car a day.

When I left for college, I gave my LEGO sets to my youngest brother, imagining him having as much fun with them as I did. He didn’t, apparently. They’d been thrown away or given to Salvation Army the next time I inquired about them. I wish I still had them.

I guess I’m still a kid at heart, because I’ve bought a number of sets for myself throughout the years, including the fantastic 8448: Super Car set, which includes a working transmission and fully independent suspension, and the 8458: Silver Champion set. And so it’s a bit poetic that I’d wind up living in Denmark, where LEGO was invented.

In September, after the wedding, we went to Legoland, which is only about an hour from where we were staying. We had a really nice day, and I bought a new set (8285: Tow Truck), figuring it would be fun to put it together with my brothers and my nephew. I was right – we had fun – but I noticed that the pieces didn’t seem the same. They felt lighter, sharper, and they just seemed brittle.

For many years now, LEGO has been having a hard time. It’s gone from being a hugely successful international company — a symbol of education and innovation, to being another struggling toy company, trying to catch the attention of kids that are awash in video games and the Internet. To these kids, a LEGO Technic set must seem pretty boring.

As a result, LEGO has had to cut back on the engineering-heavy, specialized lines like Technic, and focus more on film franchise, fantasty sets like their Star Wars line. They have also out-sourced the building of the pieces, and apparently, sacrificed quality along the way.

We broke a few pieces when we assembled the first plan. I’d never seen that happen before – pieces breaking just because of assembly. But I figured it was my brothers or nephew getting impatient and forcing the pieces. But later, on my own, I put together the set’s secondary plan, and when I took it apart I had a total of seven broken pieces.

To be fair, they were all the same part. Perhaps it is an isolated flaw. But, after a lifetime of playing with LEGO, it’s really disappointing to see broken pieces. When I think back to all of the abuse I subjected LEGO pieces to as a kid, it’s quite clear that… well, they don’t build then like the used to.

Nevertheless, my nephew’s apparent interest in LEGO encouraged me, so I gave him one of my sets. I hope he gets a fraction of the fun that I got. After all, he’s twelve, and that’s right about the age I was when I was the most focused on LEGO.

VAIO: A Love Letter

During my Christmas trip to the US, I bought a new Sony VAIO. This is my second VAIO. The first was a fantastic little z505 that I used for almost ten years. It was a 386 with 256mb of RAM, so it way very much showing its age, but it was a fine machine to keep by the couch for e-mail and surfing.

The two machines are comparable in terms of size and design, but that’s about where the similarities end. This one runs Vista with a performance index of 4.7. It has a 3.2GHz dual core CPU, 3GB of RAM, and 320GB of HD space. It feels just as fast as the two killer desktops in my life. I can compress video and don’t even hear the cooling fan speed up. It has a real-world battery life of four or five hours, whereas the old one could do an hour even when it was brand-new, and for most of it’s life the battery life was literally about twenty seconds. Plus this one was half the price of the old one. Can’t argue with that.

The old VAIO was by far the most stable PC I’ve ever owned. Even after ten years it was more reliable and predicable than any desktop I’ve ever used. It’s too soon to say if this one will be just as stable, but so far so good.

I don’t know if I’ll still be using this one ten years from now, but I’m certainly going to try.

Google gets it

It’s becoming more and more clear that Google understands the importance of innovation and optimization much better than other companies, and much better than Microsoft in particular.

Innovation is a term that is overused, but it does not and should not be used to mean clobbering a truly innovative idea with a copy of it using sheer marketing muscle. Google is innovating in a lot of areas, to say nothing about their core business, web searches.

Optimization is something that sounds silly if you put in on a feature list, but the cumulative effect of a snappy application vs. one that slogs along must not be underestimated. Microsoft won the browser war with Netscape by producing a faster browser, but in other areas thay don’t seem to have learned that lesson.

Innovation and optimization are apparently very high priorities for Google. So much so that their web sites don’t feel the same as other web sites. Sometimes their pages load up so fast that they seem to be cached locally.

Same with Picassa, the fantastic image management system that Google acquired. (If you don’t know it, you absolutely must change that — it’s free so there’s nothing to lose.) Picassa’s interface makes is both innovative and startlingly snappy. You start pushing images around and trying things just for the pleasure of using the application. That’s something Microsoft simply doesn’t inspire.

Google is also generating a lot of good will by giving development tools away. I’ve long felt that Microsoft would be wise to give Visual Studio away — they only stand to profit by making it easy for developers to make Microsoft platforms more attractive. But instead they gouge developers for the opportunity to develop for their platforms. (You’ll pay $2,500 for Visual Studio Professional with MSDN Premium, and over $10,000 for Team System Suite.)

Google Charts is a developer tool that is both innovative and fast. It’s innovative because it’s not implemented as a class library or even a web service. It’s implemented as a HTTP server. You just pass the chart data as an HTTP request, and Google returns a chart in image form. It’s free, it’s innovative, and it’s fast. So fast that it often leaves the impression that Google somehow knew what chart you were going to request and had one waiting for you. 

Here is my first usage of Google Charts.

As nifty as it is to send chart data as HTTP arguments, it’s cumbersome in practice, but that’s ok because someone (A guy named Lewis Vance in this case) wrote a nice set of C# classes to do that. You can get his library at Google Code, where Google shares such contributions. Another smart move.

And by the way, if you’ve been in a cave and haven’t tried Google Chrome, do so now. It’s… that’s right — innovative and optimized.

I’m not saying that Google is perfect, but they are a refreshing example of how it is possible to do great business without antagonizing customers and developers. I really like .NET and C#, and, and I worked at Microsoft for five years (plus two years before that as a contractor), so I’m not exactly anti-Microsoft. But Google is making them look very bad, and much of it is their fault.

Hosting woes and glories

So I moved from the doomed UplinkEarth to ReliableSite.net, which is cheap and impressive. And then, almost immediately, they had the biggest set of downtimes in their history (that’s what they say, but others tend to verify that). We’re talking days here. My sites were down for 48 hours, then they came up for maybe 8 hours, and then went down for another 24.

And it seems like hosting companies have some sort of customer relation retardation, because they didn’t post anything, or sent out e-mail (to domains they don’t host) saying, “Hey, wow, things are really screwed up here — we’re working as hard as we can.” That would, as many customers pointed out, make a big difference. Instead you’re just left with a dead site, wondering if they is happening just to your site or to everyones.

At any rate, that was a month ago and they seem fine since then.

But in the meanwhile I acquired two Danish domains (.dk). On that my wife-to-be has for her family, and one as the Danish counterpart to my regular sites. So now I have rezio.com, rezio.net, and rezio.dk.

But Danish domains can only be hosted on approved servers. This is a good example of socialist thinking. Instead of allowing anyone, anywhere, with any kind of intention, rent space with a Danish domain, the hosting outfits have to get approval. Right or wrong, I can’t host my Danish domains with ReliableSite.

So I found a reasonable Danish hosting service (or “web hotel” as they call it.) And so far I’m quite pleased. The first thing I did was set up something that points to my main site. I used the ASP.NET AdRotator control to randomly display some of my pictures, and clicking always takes you to rezio.net.

That was fine, but for reasons that I don’t understand my gallery stopped working after ReliableSite had their blackout. So the next thing I did was set up a sub-domain for the gallery. That’s at gallery.rezio.dk.

So for now I guess I’ll just keep both hosts. It’s more than I need, but they’re both cheap — both less than $100 a year. It’s worth it to have a comparison anyway.

“I made it happen when nobody said I could”

Michael Yablonowitz is the CEO of UplinkEarth, the company that, until recently, I happily used to host this site. Until about six months ago, when service and up-time took a dive. But, in his own words, “I took ingenuity and penny-pinching to a new level.” It shouldn’t surprise anyone then, that support was out-sourced to people that don’t know the system, and eventually the customer base is sold.

Two weeks ago, Mr. Yablonowitz started sending customers e-mail talking about “platform upgrades” and “new features”. What he was really talking about is selling the customers to another company. The “upgrade” was shoddy migration to a new data center with an entirely different (and from what I could tell, quite inferior) platform. They didn’t even bother to copy e-mail messages over.

This company has given me a lot of trouble over the last five months, and I’m not the only one that’s unhappy. And that’s not to mention the happy employees he bragged about. They’re unemployed now. But after all, firing everyone is the ultimate act of penny-pinching.

Resharper

I’ve been using Jetbrains Resharper for seven months now, and continue to find fantastic shortcuts. I can’t imagine going back to programming without it. It doesn’t just make things easier, it dramatically increases the likelihood that you’ll tackle important changes to your code base. Press ALT-INSERT and a window pops up that let’s you add constructors, properties, or overrides, each of which gets inserted with the proper signature and access level. That saves a lot of time. Better yet, you can write code that calls methods that don’t exist and Resharper will put an icon next to the call. Click in it and it offers to implement the method for you — in the right class, in the right module, and (to the best of it’s abilities) with the right arguments.

It also lets you jump through the code intuitively. If you’re looking at a function call, and you wonder, what does that function look like? Press CTRL-B and up comes that function. If you then wonder which other functions, if any, call the function you’re looking at, press ALT-F7 and a window pops up with every usage in the project.

There’s a complete list of Resharper shortcuts here.

The virus

I think computer viruses should count as life. I think it says something about human nature that the only form of life we have created so far is purely destructive. We’ve created life in our own image.
  - Stephen Hawking

Just for fun, some Javascript

I’ve learned a lot about web programming since taking this job. I knew C# already, but ASP.NET, XML, AJAX, and all that was new. I didn’t know any Javascript either, nor did I understand what an important role it plays on the web. But that changed this week, when I was given the assignment to use Javascript to make the header cells in a column change color in order to improve the user interface of a large table.

Once I got that working, I threw this sample together.

The most important thing I learned is that ASP.NET often auto-generates element IDs, which means that refering to elements by the ID used in the code will fail. The solution is to use the ClientID property of the element to obtain the “real” ID that will be produced in the HTML.

Attaching the script is a two-part process. First, the script to be associated with each table cell is attached using the Attributes property.

for (int r = 1; r < table.Rows.Count; r++)
{
    string rowID = table.Rows[r].Cells[0].ClientID;
    for (int c = 1; c < table.Rows[r].Cells.Count; c++)
    {
        string colID = table.Rows[0].Cells[c].ClientID;
        TableCell cell = table.Rows[r].Cells[c];
        string colScript = string.Format(”handleOver(this,’{0}’,'{1}’);return true;”, colID, rowID);
        string rowScript = string.Format(”handleOut(this,’{0}’,'{1}’);return true;”, colID, rowID);
        cell.Attributes.Add(”onmouseover”, colScript);
        cell.Attributes.Add(”onmouseout”, rowScript);
    }
}

The onmouseover and onmouseout Javascript events are mapped to script that calls Javascript functions called handleOver and handleOut. These functions both take a reference to the cell itself (this), and the client ID of both the column and row header cells.

The handleOver and handOut functions are pretty simple. They just use the IDs to change the header cell background color, and then change the cell background. 

var origColor;

function handleOver(elem, col, row)
{
    var c = document.getElementById(col);
    origColor = c.bgColor;
    c.bgColor = “#aaaaaa”;
    var r = document.getElementById(row);
    r.bgColor = “#aaaaaa”;
    elem.bgColor = “#aaaaaa”;
}
function handleOut(elem, col, row)
{
    var c = document.getElementById(col);
    c.bgColor = origColor;
    var r = document.getElementById(row);
    r.bgColor = origColor;
    elem.bgColor = origColor;
}