Posts

Storage performance

I've been thinking about storage a lot lately, since I have to buy some pretty soon. Did you know that there is a factor-of-40 difference in speed among common storage devices? At the very slow end of the scale is any USB 2.0 device. These all top out at about 50 MB/s, the limiting factor being the speed of the USB 2.0 interface. If you have any USB 2.0 storage that you actually use, please upgrade now. Then we have FireWire devices at about 80 MB/s. Remember when FireWire used to be fast? Those days are gone. Next up is a surprise: any NAS device. If you're using 100 megabit Ethernet then NAS is totally hopeless, but even with gigabit Ethernet you're limited by the Ethernet cable to about 100 MB/s. It doesn't matter how hot the NAS device itself is. You might think that NAS is great for storing photos and music and such (how many times have you heard "just install some drives in a Linux box and make a cheap NAS") but the performance is pretty poo

OMG you put Java code in the view!!

One of the unique joys of developing anything with Java Server Pages is encountering the Scriptlet Police. Scriptlets, as you probably know, are little bits of Java code embedded into the JSP. I think of JSPs as being servlets turned inside out. In a servlet, everything is Java by default, but you can throw in some HTML in the form of strings. In a JSP, on the other hand, everything is HTML by default, but you can throw in some Java in the form of scriptlets, like this: <ul> <% for (Foo foo: listOfFoos) { %> <li><%= foo.getName() %></li> <% } %> </ul> But God forbid you do this and then admit it on a mail group or message board. Any hint that you're actually putting Java code in your JSP will attract a lecture from the Scriptlet Police, for example: Question: "I am a complete JSP beginner. I am trying to use a java.util.List in a JSP page. What do I need to do to use classes other than ones in java.lang?" Hel

Scala and Kotlin

I've been spending the last three years writing code in Scala. In general I've been pretty happy with the language. It's much more compact than Java, and its higher-level features, such as closures (which have been around forever but which were popularized, I think, by Ruby), enable me to discard several of the Java tools and frameworks that I've had to drag around. Scala also comes with a very powerful collection library that I use on just about every line of code. Lately I've been following Kotlin, which looks very promising. I'm old enough to realize that this may just be a case of the grass looking greener on the other side of the fence. Every programming language has its flaws, and Scala is no exception. There's always the sense that maybe the next language will be The One. The One that does everything perfectly. The One that incorporates all that is good about Java and Scala and C# and C and C++ ( well okay, maybe not C++ ), introduces exciti

No-NoSQL

Anyone who's been around for a little while knows that the idea of storing data outside of a relational database is hardly new. Unix, for example, stores essentially all of its data in flat files, often with keys. Have you looked at your /etc/passwd file lately? It's just a little database, and it certainly doesn't use SQL. So I'm confused as to why the idea of a non-relational database is being treated by so many people as a novel idea. It's as if a generation of developers wrote a few web systems using the LAMP stack, noticed that MySQL wasn't ideal for everything, and concluded that the whole relational model was at fault and needed to be replaced. Is this increased attention simply due to the fact the this collection of non-relational data stores now has a name? I think that we've all worked with a relational database that is big and slow. In my case, that would describe maybe half the databases that I've encountered. But those databases aren&

An Ode to My Macs

About 18 months ago, Sara and I bought new Macs. I know it was about 18 months ago because I just finished paying for them. Apple and Barclaycard were offering 0% financing for 18 months on purchases over some amount. An amount we could have reached with just one Mac, but since we were both feeling limited by our computers for various reasons, we decided to get two. These two Macs are, without a doubt, the nicest and most useful computers I've ever bought. I suppose some of that is due to their being the newest, but there have been plenty of computers that I've bought new but that have merely been okay. That includes most of the Windows PCs that I've bought over the years. The problem with all the Windows PCs that I've ever owned is that they've all been beige boxes. Sometimes they haven't been strictly beige, but they've all had a certain plasticky, generic feel to them. They've all come with generic keyboards, generic mice, generic power cords.

Best Album Closers

I'm not a musician, but if I was one, I think that I'd want each album to stand on its own as a complete work instead of just being a random bag of singles. I'd want people to know the album ("Sgt. Pepper") and not a few songs from it ("the album with A Day in the Life on it"). I'd want to be recognized for having excelled at the difficult task of putting together an hour or more of music that people want to hear. Not to mention that being known for making great albums makes it more likely that those albums will remain available instead of disappearing as the singles are rolled up into "Greatest Hits of the 21st Century" collections. By the way, this idea of an artist either being known for complete works or for singles is hardly new. Bach is known for complete works. Other composers are forgotten but for an entry in the encyclopedia and one or two pieces in the local symphony's "An Evening of Baroque" program (the classi

How to make a YouTube video that no one will want to watch

Let's say you want to make a YouTube video that no one will want to watch. How could you do that? First, make sure that your video has lots of loud, obnoxious music, especially if your video depicts something that normally has nothing to do with music. People might like your video of your dog and cat playing on the floor together, so why not ruin it by replacing the sound with Ted Nugent? For extra points, dial the gain up until it distorts. It's important to choose the right music, too. You don't want something with a quiet intro. Ideally you want to lure people into clicking on your video, then hammer them with decibels so that they jump out of their seats and scramble for the volume control. As a side benefit, you'll help the economic recovery by exposing people who are browsing YouTube at the office when they should be working. You also want to go for the worst quality possible. Find lots of videos that are already low-quality, then re-encode them at an even