Archive for the ‘Software’ Category

We’re Not Ready Yet For Chrome OS

Posted by Avrithor On November - 19 - 2009

sdres_0001_app-menu_01

Today, Google finally announced Chrome OS and showed it off a bit. It’s just as it was rumored to be and just as it sounds: the Chrome web browser basically is the OS. You turn on the computer and you get the browser, that’s it. All you can use are webapps. The idea is that most people spend 95% of their computing time using webapps and surfing anyway, so why not focus on that experience and streamline it. In the process, it aims to nix a lot of the issues that users have with their computers—a Chrome OS device will have a lot less going on under the hood than a traditional PC, so it’ll boot up faster and be immune to malware (since you can’t install ANYTHING on it, benign or malicious). Trouble is, the world isn’t quite ready to go webapps-only just yet. Even Google admitted during the press conference that they expect people who buy a Chrome OS netbook to keep their standard desktop or laptop system around for the things they can’t do on the web yet (or don’t want to). But honestly, I don’t think I would even install Chrome OS on my netbook. Looking at my boxen, this is a quick list of everything that would prevent me from switching from Windows to Chrome:

  • Most critically, a Chrome OS box obviously won’t be able to be joined to a Windows domain. Whether I log on to my desktop or my netbook, I need to have access to my documents, and if I change a file on one it needs to be synced so that I’ll see the change on the other. Obviously logging onto the domain with a roaming profile accomplishes this; for Chrome, there would have to be a file-syncing service like Dropbox that works under Chrome without installing anything.
  • Desktop apps that just aren’t replaceable yet. A few examples:
    • Photoshop. Granted, I only use this on my desktop because it would be unusable on a netbook anyway. Still, Photoshop is a beast of a program and it would be impossible for Adobe to create a web version with anywhere near the same functionality. (There is a “Photoshop” webapp but it’s nothing like the actual Photoshop CS4 software.) Javascript performance is going to have to get faster by an enormous factor before you could ever think of implementing many of PS’s features in the browser. Not to mention the colossal size of the high-DPI, hundreds-of-layers PSDs that professionals work with. I think this will forever remain an app for beefier Mac & Windows PCs.
    • Skype. A good videocalling webapp that meets or beats Skype’s ease-of-use and functionality probably could be done, but nobody’s done it yet. Google did just buy a VoIP company recently so maybe they’re working on it.
    • Microsoft Office. It’s still the de facto standard, and neither Google Docs nor Microsoft’s online Office suite can touch it yet. This one will go down fairly quickly though. Google is claiming outright that Docs will catch up next year (which, not coincidentally I think, is also when they expect to release Chrome OS).
    • KeePass (or insert your favorite password manager here). There are password manager webapps, but to be honest, I still don’t trust this data to the cloud. I have more than just passwords for websites in my KeePass database.
    • Games. Goes without saying, but they won’t ever run on Chrome OS and there’s no intention for Chrome OS to be used for gaming. This is also a primary reason why I’ll never switch to Mac or Linux. As long as I’m a gamer, I’ll be at least dual-booting Windows on at least one of my machines. (And if you think I want to go through the hassle of rebooting just to launch a game, you’re crazy.)

If Chrome OS is successful, it’ll be successful in pushing webapps forward to fill in a lot of these gaps and provide the features and tools that are missing so far. If that happens, and I would love to see it because this is actually the area I’m looking to get into with my degree, I can certainly see myself running Chrome OS on a netbook in the future. But we’re not there yet.

Project Euler, #1-10

Posted by Avrithor On July - 1 - 2009

Since I discovered it yesterday, I’ve been hooked on Project Euler, working furiously on solving as many problems as possible. It’s a site that poses hundreds of math problems designed to be solved by writing computer programs, and tracks which ones you’ve solved. Naturally, I’m using JavaScript, and I’ve solved the first ten problems so far. Now, given my inexperience, the solutions I arrived at are going to be flawed—mostly in terms of efficiency—but obviously they work.

I made a file for the project, euler.html, where I’ll write my solutions for each problem. Of course there will be some functions shared among different problems, which is part of the reason for doing it in a single script. I’ll put a button on the page for each problem that’ll run its solution and spit out the answer. Although it doesn’t really matter here, I’ll also stick to best-practices and avoid polluting the global namespace by encapsulating my script’s functionality in a self-executing function. Common, private variables and functions will be defined, and then a hash will be returned with a member for each problem. This exposes them to the rest of the page (so the aforementioned buttons can call them), but they’ll have access to the private stuff thanks to closure.

var Euler = (function() {
  // private stuff here

  return {
    P1: function() {
      // algorithm for problem 1
    },
    // etc...
  };
})();

On to the first 10 problems. Note: If you want to solve them yourself, “spoilers” follow after the jump! Please don’t cheat.
Read the rest of this entry »

Weekend Links

Posted by Avrithor On June - 19 - 2009

JavaScript Custom Event Handling

Posted by Avrithor On June - 4 - 2009

Update, 7/1/2009: Switched code sections from manual coloring to an automatic syntax formatting plugin.

NOTE (6/20/2009): I didn’t intend to close comments on this post. The setting is on “enabled” and I’ve tried disabling and re-enabling them to no avail. Some glitch either with the WordPress 2.8 update or installing the new theme has screwed it up. If you have something to say about this post, drop me a line. My Gmail username is the same as everywhere else.

I haven’t been posting much lately; I have, however, been thinking about my future in some area of computer science, software development, and/or web development. And I’ve been tinkering more with JavaScript since my last post. One thing I’ve discovered how to do is baking event handling into your custom objects. This isn’t really innovative—all the major frameworks out there include it—but I had fun figuring it out on my own. Here’s the solution I arrived at.

I decided that the best way to store and fire event listeners was in an associative array, where the keys are the event names and the values are associative arrays linking IDs to functions. So, for example, a set of registered event listeners for an object representing a door might look like this:

Door.Event
   "Open"   => "a"  => function
   "Close"  => "b1" => function
               "c"  => function
   "Lock"   => (empty)
   "Unlock" => "b2" => function
               "d"  => function

The IDs here are just quick meaningless samples; the idea is that they come from and uniquely identify the object that registered their respective event listeners. They will be used by their originating object to unregister its own event listeners and not any other object’s event listeners if need be, since you may have multiple objects registering listeners for the same event, possibly even the same function registered as a listener by multiple objects. As an example of this, consider a card game. If there are two cards on the board that say, “Whenever a player discards a card, that player takes 5 damage,” you will have two instances of the triggered function (dealing 5 damage to the player) registered on an array of global events for “Discard”, and when that event is fired, both will go off and the function will be executed twice. Yet, if one of those cards is destroyed, it should remove its own specific instance of event listener registration—perhaps the other has had a spell cast on it modifying its effect, so it could matter which one gets deregistered.

Using this system, implementing event listener registration is simple.

Read the rest of this entry »

JavaScript Looping Speed

Posted by Avrithor On April - 16 - 2009

Update, 7/1/2009: Switched code blocks from manual coloring to an automatic syntax highlighter plugin.

Looking for JavaScript optimization tweaks, I encountered a claim that a decrementing do-while loop is faster than an incrementing for loop. I decided to do a quick-and-dirty test to see if there’s any clearly discernible difference. I wrote two scripts, each of which does the exact same thing: create 100,000 DIVs and append them to the body of the page. First we have the standard for version, then the do-while format that the site claimed was superior.

Version 1:

for (var i = 0, d; i < 100000; i++) {
  d = document.createElement("div");
  d.innerHTML = "DIV #" + i + "";
  document.body.appendChild(d);
}

Version 2:

var j = 0;
do {
  var i = 100000 - j,
      d = document.createElement("div");
  d.innerHTML = "DIV #" + i + "";
  document.body.appendChild(d);
} while (--j);

Note that the do-while has an extra line to set a variable i that will increment just as i does in the for loop, thus we get the same result of DIVs numbered 0-99,999. But what if the direction doesn’t matter? What if going backwards and numbering the DIVs from high to low is acceptable, or even what we actually want? The do-while proponent cited in support of his claim that computers are simply faster at counting down than they are at counting up. Whether that’s true or not, I don’t know. But it seemed worthwhile to include two more variants in my testing:

Version 3:

for (var i = 99999, d; i >= 0; i--) {
  d = document.createElement("div");
  d.innerHTML = "DIV #" + i + "";
  document.body.appendChild(d);
}

Version 4:

var j = 99999;
do {
  var d = document.createElement("div");
  d.innerHTML = "DIV #" + j + "";
  document.body.appendChild(d);
} while (j--);

I tested each version 10 times. Each test ran in a fresh instance of Firefox v3.0.6 with no other open tabs. Here are the results:

There seems to be no significant difference here between different looping techniques. In light of this, I’d call it a matter of clarity/readability and somewhat personal preference. If you have to increment, obviously the for loop is clearer to read. For decrementing, either seems fine, though I like the do-while.

Busted By Last.fm? Tough.

Posted by Avrithor On February - 20 - 2009

UPDATE: Well, it looks like this never actually happened—Last.fm’s people are calling bullshit, claiming that TechCrunch made the whole thing up, and, in accordance with their privacy policy, do not give out personally identifiable information to third parties under any circumstance. Heartening to hear, my point still stands though. In principle I laud Last.fm’s stance on privacy, but if they were to breach it in the specific situation described below, I wouldn’t care to hear the illegal downloaders crying about it.

So there’s a new U2 album coming out. I personally couldn’t care less, but a lot of people are still into this band and are anticipating its March 3 street date. As is par for the course these days, the album has been leaked onto BitTorrent and downloaded many, many times. Naturally, the RIAA is sticking with its usual response of attacking its customers. Tired of simply hiring third parties to troll BitTorrent looking for offenders, the RIAA had a novel idea: ask Last.fm who among their members has been listening to the new tracks. Last.fm said sure, here’s the list.

And people are upset about this.

There seems to be some kind of confusion here, so allow me to clarify. Last.fm is a social networking site. The entire point and purpose is to get new music recommendations by sharing your listening habits with the universe. It’s not hard to disable the scrobbler. Hell, even if you forgot and realized later that you shouldn’t have scrobbled the tracks, you can permanently delete any track from your listening history with just a couple of clicks.

You can piss and moan about personally identifiable information which is normally hidden being handed over. You can decry the RIAA even seeking such information in the first place for a failed, destructive strategy of suing their customers. Both are valid points on their own. But when the only possible way for the new U2 album to be on your profile is if:

  1. you obtained it illegally; and
  2. you allowed it to be scrobbled,

all your arguments are completely undermined.

If you illegally downloaded No Line On The Horizon and scrobbled it to Last.fm, you deserved to get caught. Sorry.

If I Have To Type My Name One More Time…

Posted by Avrithor On February - 9 - 2009

Quick, answer this: How many times have you typed your name into a form on a webpage? Dozens? Hundreds? How about your e-mail address? Home address?

The madness is gradually—very, very gradually—waning as more and more sites implement OpenID and/or Facebook Connect for their login systems. But a universal authentication system doesn’t go far enough. I’m not just tired of having 1,000 different sets of credentials for 1,000 different sites; I’m tired of having 1,000 different sets of information on 1,000 different sites. We need an extension of OpenID that acts as a total information repository. You should enter your personal data once, and store it securely on the OpenID server. When you log in to a website with your OpenID, it would request whatever personal data it thinks it needs, and the OpenID server would prompt you to allow or deny access to any individual piece of information, on a one-time or recurring basis. The key here is that you have total control over how your information is collected and used. Nothing leaves the OpenID information vault without you expressly authorizing it, and just like OAuth implementations, you’d be able to see all sites you’ve given any level of permission to and modify or revoke that permission at any time.

Some people would worry about a server devoted purely to storing personal data; what if it’s breached? Yet, I’d point out that this is much better than having that data scattered across the whole Internet, on many different sites with widely varying levels of security. Hell, this very minute, someone could be hacking into a site I don’t even remember I ever signed up for, harvesting my e-mail address to feed to a spam botnet.

Ultimately, I would say that the solution should be an open standard, complementary to OpenID. Screw Facebook Connect and their “walled garden”. Ahem.

Let’s All Chill Now About Windows 7 Editions

Posted by Avrithor On February - 3 - 2009

There seems to be much yelling and wringing of hands over the announced editions of Windows 7 today. “There’s SIX versions! Horrifying! Consumers’ brains will melt!” At first glance, it does look ridiculous:

  • Windows 7 Starter
  • Windows 7 Home Basic
  • Windows 7 Home Premium
  • Windows 7 Professional
  • Windows 7 Enterprise
  • Windows 7 Ultimate

Thing is, not one person looking at buying Windows 7 will be making their choice from six options. The truly relevant list is the answer to “What will Joe Consumer see on the shelf at Best Buy if he’s thinking about upgrading?”

  • Windows 7 Home Premium
  • Windows 7 Professional

Just like XP, in other words. The Home/Professional split worked out more or less alright in that case, although if you ask me, they chose a pretty stupid set of features to excise from XP Home. In this case, Win7 Pro will add filesystem encryption, the ability to join a Windows domain, network-based backup, the ability to RDC to the box, group policy capabilities, and so on. Not a bad feature set for a geek/poweruser, especially if you’ve got a home server.

And what about all the other editions? Starter and Home Basic are “for emerging markets” and won’t be sold in the U.S. Enterprise is self-explanatory. So far, the only information I can find on Ultimate vs. Professional is that it adds BitLocker driver encryption. Whoopee. It’ll also apparently have a small footprint, probably not even available on brick-and-mortar retailers’ shelves, since Microsoft is well aware that pretty much the whole Windows-using community except for a sliver of PC enthusiasts laughed in their face at the sky-high price for Vista Ultimate.

As a gamer and a web geek who uses Photoshop CS4 64-bit on a regular basis, I’m essentially locked in to Windows, for better or for worse. Truth is, Win7 looks like the upgrade Vista ought to have been. I’m digging the new taskbar, the peek feature, and other improvements—video demonstrations are all over the web by now if you haven’t installed the beta and seen for yourself. For actually pushing the OS forward with fresh ideas, and putting more effort into fixing the features that Vista introduced and botched, this is a release that deserves to be supported. (In contrast, when Vista came out, the only reason to upgrade that mattered to me was the promise of games that would take advantage of my new DirectX 10 hardware—and then the games never materialized with a noticeable difference between DX9 and DX10 graphics.) I just cringe a little at the prospect of buying Windows again so soon. Gizmodo has a great point here: let me send you proof of my Vista Certificate of Authenticity/product key, and send me back a coupon or mail-in rebate on Windows 7. It’d garner huge respect from customers who are really down on Microsoft and Windows after the last few years’ debacle.

Streaming Film Rentals: Ready After All

Posted by Avrithor On January - 28 - 2009

This entry originally appeared on January 27, 2009 (before I installed WordPress).

Netflix, in announcing their latest financial results, revealed that their subscribers who use Instant Play to stream movies via the internet rent fewer DVDs than those who never stream. This is a bit of a surprise to some who thought that physical media would be king for a long time to come. I admit I’ve been highly skeptical of the rate at which streaming feature-length films would be adopted over discs—broadband access in the U.S., even in our most wired cities, is just not fast enough to allow streaming at anything better than DVD quality (if that). But what I’ve come to realize as I myself have shifted towards using Instant Play more and going through fewer discs, is that the question is not whether the quality can match DVD or Blu-ray. The question is, “does it meet a minimum standard of acceptability?” For the average viewer, the answer, I suspect, is “yes.” Of course I love watching a great film on Blu-ray, in crystal-clear quality. That’s going to be the optimal way of experiencing it until the next format comes around¹, and for the films I truly adore I will seek out that experience. Yet, for most films, and especially for films I haven’t seen, Instant Play’s slightly sub-DVD quality meets my minimum standard of acceptability to introduce myself to these films. I didn’t think it would. I scoffed when they introduced the feature. It was foolish of me. I can say, with certainty, that the only thing keeping Instant Play (and its competitors) from being the total death of rental discs is the limited catalog. If they expand it to all the films in their library, I’ll empty my queue and be in film heaven.

¹ Yes, I do expect (in spite of increasing broadband speed and penetration coupled with adoption of streaming services) that there will be at least one physical successor to Blu-ray. At some point there will be a disc or memory card with the capacity and bandwidth for uncompressed 4K video, and there’ll be at least a niche market for it among film and home theater enthusiasts.

About Me

I'm a computer science student at the University of Minnesota and enthusiast for the arts, gaming, and technology.

Quotable

"Madame, my kingdom is a small one,
but I am king there."


—Frederic Chopin, asked why he wrote many nocturnes, but never a symphony or opera