Ramblings of Narc

When the issue isn't confused enough.

Archive for December, 2008

A Small Treatise on Satellite Internet

Leo Notenboom of Ask Leo! has written a thoroughly useful article about wireless Internet connectivity. In the comments section, a reader pointed out the omission of satellite Internet from the list. The comment read thusly:

Great subject! Informative answers! But don’t forget about Satellite internet. The prices are comming down. I live in the country and have only dial-up. I’ve checked some different options and I found I can get broadband high speed for about $15 a week and not have to buy anything.

This was my reply, and I considered it so good (and long-winded, but that’s another story) that it was worth reposting on this blog (with some cleanup and additional formatting):

Satellite Internet is, indeed, another wireless connection type, and it’s a somewhat older one than most of the ones discussed in this article, thus we could say the technology is “proven”. However, its low adoption rate is not solely because of its price.

Satellite connections suffer from some limitations which can be hard to live with, depending on exactly how you’re using your Internet connection:

  • firstly, and most importantly, satellite connections suffer from high latency. This is a function of basic physics — the satellites are far enough away from any point on the surface of Earth that it takes a non-trivial amount of time for data in the form of electro-magnetic impulses to reach them, reach the other point, and return. My current Internet connection gives me latencies on the order of 150 milliseconds, on average, from Romania (Eastern Europe) to the United States. By comparison, for satellite access you could be looking at latencies as high as 1 or 2 seconds (thousands of milliseconds!) for a round trip to a server that might be just a couple of miles away. And that’s on top of the pre-existing round trip from the other end of the satellite connection to the server you’re trying to reach.
  • secondly, weather: as documented on Wikipedia, “[satellite] communications [are] affected by moisture and rain in the path of signal”; meaning, effectively, that a rainy day in the summer might leave you with a crippled, if not completely non-functional Internet connection. Add to that the likelihood of snow build-up on the satellite receiver dish, and thus the requirement of continuous maintenance, and it makes for a somewhat unreasonable connectivity solution.
  • the third, least important but still potentially crippling disadvantage is that most satellite Internet providers tend to offer one-directional access only. That is, download-only (from the Internet to your computer). But all communication on the Internet, by virtue of the design of the TCP/IP protocol, is bi-directional: all packets sent must be acknowledged, and don’t get me started on the three-way handshake. What this all means is that you might still have to keep your dial-up connection and use it for the opposite direction, which will effectively slow down your communications to the rate at which your dial-up connection is capable of routing the acknowledging packets, which, although obviously smaller than the primary communication ones, are still a limiting factor.

There is also the further limitation of line of sight, specifically the communication-dampening effects of vegetation, meaning more continuous maintenance to ensure a tree (or, in a city environment, a building!) doesn’t come between your receiver dish and the satellite it’s trying to reach.

But the trifecta of latency, weather, and unidirectionality provides strong incentives to stay away from satellite connections except as a last resort. I’m also suspicious of your final statement of “not [having] to buy anything”, since contacting a satellite absolutely requires the existence of a satellite dish, but perhaps you already have that for TV.

If you’re curious, the uni-directionality limitation results from the fact that satellite communications are generally optimized for TV-like systems, wherein there is a single sender and many recipients. By contrast, an Internet connection by design is point-to-point, there being a sender-recipient pair for each such connection. This effectively results in satellites being a very poor method of transmission, having a very limited number of channels, which accounts for the relatively high cost of connection. Simply put, a satellite with, say, 1,000 channels could broadcast 1,000 TV programmes to potentially millions of viewers (who are all receiving the exact same data), or it could provide Internet access to exactly 1,000 people. Some magic is probably possible by splitting the channels into smaller ones, but the result of that will necessarily be a lowering of speed, and you may end up with a bandwidth the same as a dial-up connection but with a much higher latency.


I didn’t mean for such a long treatise of satellite connections, but I feel I’ve done a reasonable job of describing the pitfalls there. I’d like to restate that it could still be a potential option, just not one that is likely to be reasonably priced — either in upfront or hidden costs.

Bioshock™ (spoiler-less) Mini-Review

I don’t normally do reviews, and I’m going to try to keep this short and spoiler-less.

My first complaint about Bioshock would be the evil graphics quality defaults. As far as I can tell, either the hardware detection is done wrong, or there is no hardware detection. Bioshock started up for the first time in its incredibly beautiful-looking, yet highly rendering-painful “High” detail mode. Now, I admit, the first few scenes of the game look really fucking good at that detail level, but a 5 fps average is not something I want to play through on. So after a minute or so, I lowered the quality down to “Medium”, and eventually “Low”. It still looks very good even at those quality settings, and my crappy video card can handle the “Low” settings without complaint now. In any case, the game is so good it’s inspired me to get a better video card (or pair of video cards!) just to see it in its full glory. I have to say, I’ve never felt like that would’ve been worth it until Bioshock came along.

Now, setting aside the graphics complaint, which is my own damn fault for not buying the latest and greatest in video hardware (though I doubt anyone would condemn for that), we arrive at the first and possibly only real complaint I have about it: the lack of motivation when starting up. Without spoiling anything, I can’t explain just how that lack of motivation shows up, but I can say it’s a good thing the first several minutes of the game are linear, because otherwise I wouldn’t have realized what to do. Even this way, I couldn’t help but feel like I was just wandering around for no reason at all at first. Maybe that was intentional, but to me it just felt weird. The least that could’ve been done would’ve been to set a goal like “survive” or similar, to make it feel more like I was trying to accomplish something.

On the bright side, after that, everything starts winding together beautifully, and the story truly is a beautiful one (if that can be said of a dystopian story). You end up feeling like the driving element of salvation, a messiah of consequence, and a freedom fighter. Which is very good, in my book, and I hereby congratulate the Bioshock team for bringing their story to life so successfully.

Overall, I can see why the game has such good reviews, and it was definitely worth the money I paid for it.

One Is The Most Important Number

I’m sure any half-decent software developer has had this drilled into their minds many times over, but perhaps it’s worth repeating (otherwise, feel free to skip this post): don’t repeat yourself!

Now, I’m probably a statistical outlier in that most of my programming education (and computer education in general) has been of an informal nature: I taught myself. So when trying to get points across to others I tend to refer to my experiences for examples of what can go wrong. So here’s how I ended up learning the “don’t repeat yourself” rule:

Way back in 2005, I was trying to figure out how I could standardize my PHP applications’ layouts on disk. I’d started in early 2004 with a single firm idea: that includes went into a separate subdirectory, from whence they could be referenced by any script the application was comprised of. From there, I got the idea of doing the same for images, stylesheets, and so on. By early 2005, I’d set up a simple template system I still use today, consisting simply of text files with placeholders for variable data. For example, this would be a valid template text:

Hello, {{UserName}}, and welcome to {{ProgName}}! Where do you want to foo today?

The bits between curly brackets are the variables, and they can get filled in with basically any text you want. For instance, set “UserName” to “Narc”, and “ProgName” to “CMBlog”, and you get:

Hello, Narc, and welcome to CMBlog! Where do you want to foo today?

Simple, clean, and surprisingly fast, at least in my use case.

I liked this so much that I decided to use it in all my personal projects. And that’s where I started running into trouble.

You see, what I ended up doing was copying the code from one project to the next, but then I’d find a bug in it and have to update all the copies. Can you say, oops? But wait, it got worse: I had some ideas for improvements, extra features that would be handy, like automagically including other templates into the current one by using a special version of the curly brackets placeholder. But whenever I thought of it, I either added the improvement only to one version of the code (whichever the latest project I’d been working on had been), or I didn’t add it at all because of this duplication tax.

Now, clearly, the tax is not that high, after all, I only needed to copy some files from one place to the next. Maybe I’m just too lazy for my own good (though there is some belief that laziness is a good feature for programmers, but that’s a topic for another post), but clearly the multiple copy model wasn’t working for me.

So I decided, instead of making these multiple copies, I would keep all the interesting, reusable bits of code in one place, and just include them as needed. But I also knew that reading in all those bits of code would be a performance hit if they weren’t needed, so they had to be split up into segments of functionality. Like the template system I just described above, or a set of functions that make database interactions less painful.

What I ended up creating was a very interesting (to me) system of includes driven by a bunch of configuration variables. You could set a variable (a key of a well-defined and standardized array) and the bits of code you’d need would be included, and you could use the functions you needed without including any of the dozens of other functions (the current count is 176, if you’re curious), and thus without wasting CPU time waiting for unnecessary resources to load from disk. That system is now called NeoFW and I still love it very much. It lets me make changes in one place, and have them show up instantly in all the places it’s used.

Let me restate that, in case I haven’t bashed you over the head with it enough: I make one change in one place, and it shows up everywhere!

On top of that, this code provides an interface for user-handling functions, meaning I can have a user log in only one time in one application, and have him logged into all of them at the same time. This is a wonderful change from the previous implementation where I had to be careful to use the same session variables across all applications, and the same session storage method, and heck, the same code, for that matter. Which is why it was perfect for this system.

Generalizing from this example, we find that it’s a very good idea not to duplicate code when you can help it. Don’t repeat yourself. When you repeat yourself, one of two things (or a combination thereof) is bound to happen: either you’ll end up with synchronization issues (some versions of your code work differently than others), or you won’t want to make any more changes to your code because it’s so much of a hassle to keep track of where else that same code exists.

If I’d started with a Linux server, I’d probably have ended up using a lot of symlinks, and then I wouldn’t have made NeoFW, which would be a shame, because I’ve learned many useful things while putting it together. But I couldn’t have failed to learn this lesson: that the best number of repetitions of your code is one. Not two, not four, but one. And, of course, five is right out, as Monty Python taught us.


This is the second of hopefully many “personal experience” posts, where I detail the things I’ve learned and how I came to learn them. The previous post was Recognizing Failures, about not biting off more than you can chew. The next is Blogging For The Perennial Lurker, a slightly meta expression of my experience as a habitual information consumer, as applied to the inherently productive medium of blogging.

Recognizing Failures

(or, just how much can you chew?)

Way back in late 2005 (a lifetime ago, as far as I’m concerned), a friend of mine came for a visit one day. He was coming to me on behalf of a (non-mutual) friend who needed a programmer because he had an application in mind. He tried to explain the application to me, and on the face of it, I didn’t think it was a particularly difficult one. I still don’t, actually, but that’s a purely academic distinction at this point.

So because I didn’t think it was going to be that difficult, I went ahead and told him to have his friend contact me; he did, and he did, and we met, and I got to sketch out a reasonable idea for the program both in my mind, and hopefully in the client’s mind as well.

And then things got bad.

I strongly suspect I was right, that the project was not particularly difficult. I also suspect that, just as I couldn’t finish (or even start) it then, I would be completely unable to finish it now. It’s just beyond my capabilities.

The first hint of this “too big to chew” property of the project was when I tried to start writing some kind of database abstraction for it and kept coming up with flaws in that abstraction. I had gotten a number of details on what the final application would have to deal with, and even though I had decided (together with the client) that the initial version would be limited to some much simpler-to-model data, it became more and more clear that this initial iteration would have to be thrown away almost entirely after its implementation.

And here’s where I went wrong: I could have created the initial, very limited application. It would’ve had to have been (at least partially) thrown away after its launch, and the next iteration would probably have been more complex, but it would have been something tangible, more than just a concept in our heads, but something that could be interacted with, could be tested, could be considered for the recycle bin or for the improvements treadmill. Instead, I froze. Almost literally. I couldn’t write the code. I couldn’t make it happen. All I could think of was how complicated an architecture would be required, and how it was so completely beyond me because man, I’ve never written something like this before and I’m so fucked; I told this man I’d deliver something and now I can’t deliver, I can’t do it, and I’d rather die than see this man again and dash his hopes after I made it sound so good…

Now, if that sounds like I’m maybe hiding the fact that I couldn’t bear the shame of not being able to write something, and I’m lying to myself (hello, armchair psychologists out there on the Interwebs!), the fact is I’m not. Yes, I was ashamed, but not that I couldn’t do it — I was ashamed that I’d ended up lying to my client about being able to do it. And, to be honest, I don’t think I even ever said I would be able to do it, but I’d made it sound so good, like it was just a few steps away from being real… which, of course, it never had been — except in my head. Before I’d really thought about it, that is.

So, the lesson I took from this was: don’t promise you can do something you’ve never done before, and don’t make it sound like you can. Because if you end up biting off more than you can chew, you’ll make a liar out of yourself, and your client will not only not want to hire you again, but they will also tell their friends that you’re unreliable, that you make promises you can’t deliver on, and that will fuck you more than anything. Obviously, this is just after-the-fact reasoning, the real reason for me was that it made me feel like shit — but it also happens to be true, and my feeling made me look at that, analyze it, and see it for myself. And now I can share it with you, anonymous reader.


This is the first of hopefully many “personal experience” posts, where I will detail the things I’ve learned — some good, some not so good. Merry Xmas, Internet.

The next post in the series is One Is The Most Important Number, and refers to the age-old programming concept: “Don’t repeat yourself”.

Long time, no post?

That’s normal, really. It’s true, I don’t tend to post much usually, especially when things are going well.

And boy, are things going well. With the sole exception that I’m lonely (and, honestly, it would be a surprise if I weren’t), everything else is perfectly fine. I very much enjoy my job, I can afford to make my friends and family happy, and I feel good about myself. That makes me happy.