Archive for the ‘Technology’ category

Add Journalists to the List of Things Unreliable

May 15, 2008

Apparently a reference was made to an iPhone-like tablet as the sort of device that could benefit from Intel’s new CPUs, and ZDNet took this as a claim that such a thing existed. Read about it at http://www.appleinsider.com/articles/08/05/15/intel_apple_tablet_comment_simply_untrue.html.

Computers can’t even do math!?

May 15, 2008

Since the whole world by now should be aware of the general failure of artificial intelligence, it shouldn’t be very controversial to say that I’ve (mostly) always realized that computers can’t do many things that are very easy for people to do. Forget anything like thinking: the most basic identification of black shapes on a page as alphanumeric characters sometimes fails, and facial recognition seems to be a long way from being anywhere close to reliable.

But reading David Flanagan’s fabulous book “The Ruby Programming Language”, I discovered that computers can’t be trusted to do simple math either. Here’s the direct quote, followed by my simplified explanation.

Binary Floating-Point and Rounding Errors

Most computer hardware and most computer languages (including Ruby) approximate real numbers using a floating-point representation like Ruby’s Float class. For hardware efficiency, most floating-point representations are binary representations, which can exactly represent fractions like 1/2, 1/4, and 1/1024. Unfortunately, the fractions we use most commonly (especially when performing financial calculations) are 1/10, 1/100, 1/1000, and so on. Binary floating-point representations cannot exactly represent numbers as simple as 0.1.

Float objects have plenty of precision and can approximate 0.1 very well, but the fact that this number cannot be represented exactly leads to problems. Consider the following simple Ruby expression:

0.4 - 0.3 == 0.1 # Evaluates to false in most implementations

Because of rounding error, the difference between the approximations of 0.4 and 0.3 is not quite the same as the approximation of 0.1. This problem is not specific to Ruby: C, Java, JavaScript, and all languages that use IEEE-754 floating-point numbers suffer from it as well.

One solution to this problem is to use a decimal representation of real numbers rather than a binary representation. The BigDecimal class from Ruby’s standard library is one such representation. Arithmetic on BigDecimal objects is many times slower than arithmetic on Float values. It is fast enough for typical financial calculations, but not for scientific number crunching. Section 9.3.3 includes a short example of the use of the BigDecimal library.

So, in other words, if you ask what 0.4 – 0.3 is, you get the correct answer. But if you ask if 0.4 – 0.3 is equal to 0.1, you’re told that it’s not the same. And please remember: although Ruby is used in the example, this is not a bug in Ruby, but a generally accepted way for programming languages to work, which has been adopted by the international standards body IEEE.

Add to this the fact that different programming languages disagree what the remainder is when you divide a negative number by a postive number, and you’ll learn that you have to be very careful what you let computers do for you. They could even mess up the one thing that seems perfectly suited to them: basic math.

An alternative to Ruby on the iPhone

March 7, 2008

…from someone who says they’ve tried to do that:Programming Nu.

Here’s the description of the alternative, called “Nu”:

Nu is an interpreted object-oriented language. Its syntax comes from Lisp, but Nu is semantically closer to Ruby than Lisp. Nu is written in Objective-C and is designed to take full advantange of the Objective-C runtime and the many mature class libraries written in Objective-C. Nu code can fully interoperate with code written in Objective-C; messages can be sent to and from objects with no concern for whether those messages are implemented in Objective-C or Nu.

Nu currently requires Mac OS X version 10.5 or greater and runs on PowerPC and Intel systems. A Linux port is in progress; contact me directly or visit my blog for more details.

This is all from the guy that commented on Jason Fried’s prediction about the iPhone (where others raised the question of using Ruby for development):

Regarding Ruby and Objective-C:

I spent a lot of time looking at the combination of Ruby and Objective-C. Starting at the beginning of 2005, I built the RubyCocoa Resources site and later wrote my own bridge from scratch, RubyObjC. Eventually I decided that ultimately, the best way to put a scripting layer on Objective-C was to write one that was specifically designed for the job. Last year I did that, and this afternoon I got it working on the iPhone.)

If I understand this correctly, he’s more-or-less built a modified Ruby specifically designed for building apps on the iPhone. I’m not sure what challenges the new language overcomes where Ruby fails, perhaps in mapping to Objective-C concepts? Or why he chose to use a Lisp-like syntax: it would be much easier for Ruby programmers to adopt if it were both semantically and syntactically like Ruby.

A quick poke around his web site, however, renders answers to these questions.

The Future of the iPhone, according to Jason Fried

March 7, 2008

No discussion of developing with Ruby on the iPhone would be complete without mentioning Jason Fried’s take on the future of development on the iPhone:

What we saw today was the spark. The explosion will continue for twenty years. We will all feel the warmth…. just like there were a lot of players in the portable music space, there were no clear leaders. Until Apple came to town.¶ The same thing is happening today in the mobile space. Palm, Windows Mobile, Blackberry, Symbian. They’ve been players, but no one has broken out big. No one has managed to grab both the business and consumer markets like Windows did on the desktop. Until Apple came to town. At least that’s my prediction.

RubyCocoa on iPhone

March 7, 2008

I’m currently downloading (‘as we speak’–it’s 2.1 GIG) the iPhone SDK, after recently playing around with developing toy apps last night in RubyCocoa.

The idea is irresistable (if not slightly implausible) that it just might be possible to build iPhone apps with RubyCocoa. A quick Google search suggests that others are asking the same question, but no one seems to have an answer. But something on Apple’s site suggests that this might be possible:

The applications you create with Ruby and Python are packaged exactly like native Mac OS X applications. Your end-users will not be able to tell the difference. What’s more, Apple is committed to binary compatibility between releases of Mac OS X. This means you will no longer need to embed the runtime and language interpreter in your application.

So they’re saying that (for non-iPhone RubyCocoa development, at least) you don’t *need* to embed the (RubyCocoa) runtime and language interpreter in your application. This implies that it is possible to embed the runtime for RubyCocoa, and if it’s possible to do on a Mac, why not on an iPhone?

Does anyone know any reason that this would or would not be possible?

I coulda’ said “I told you so”…

March 6, 2008

I’ve been thinking for the last few weeks about the lack of Flash on the iPhone. More specifically, I’ve been thinking about the complaints about the lack of Flash on the iPhone. And I’ve been noticing how a single page with a loose Flash cannon can bring my 2.x GIGAhertz DUAL-CORE cpu computer to a grinding slow-down, and wondering if I really want Flash on my iPhone. I’ve been meaning to post that this is, in my opinion, the reason Apple (i.e. Steve Jobs) won’t give Flash the green light. Purely because Flash would destroy the iPhone experience, sucking down every available resource and still not performing acceptably. (And, oh, by the way, 99% of the Flash out there is freakin’ ads!)

Well, I didn’t post about it (until now) but my suspicions were more than confirmed by a recent posting on AppleInsider. Too bad. I could have shown off my brilliance if I’d posted this before them…

the irrationality of slamming tools that make hard things easy

February 20, 2008

Daniel at troubleseeker.com has an interesting post about a talk by photographer Ron deVries, who slams Photoshop as being a “toy”. Daniel (though he respects Ron as a photographer) goes on to explain why this sort of thinking is just nutso.

Here’s my take on it:

When people perceive their livelihood to be threatened, they tend to act in irrational (or rational but dishonest) ways. I would guess that the combination of two things led Ron deVries to say these things:

  1. he’s seen a lot of really cheezy work done in Photoshop, and
  2. he sees people able to gain the skill in hours or days to do digitally what took him weeks or years to learn to do optically and chemically. And they can perform these feats in seconds, while it still takes him minutes or hours.

The first item (if my speculation is correct) is what he uses to justify putting down Photoshop, and the second is what motivates him to put it down. His skills are not nearly so valuable if some upstart can catch up to him

I would agree that film has a quality to it (I can’t put my finger on it) that I’ve never seen in (my own) digital pictures. And I certainly prefer using my Olympus OM-1 (which forces me to do everything manually) to any digital camera I’ve used. It feels nicer, and I’m almost always happy with the results, although I can’t quantify how or why it is better, or even be certain that it is1.

This irrationality is not limited to Photoshop-bashing, however. I’ve seen contracting gigs for web development that said they wouldn’t take anyone who used Dreamweaver, as if everyone who uses Dreamweaver is a slave to the wysiwyg mode and can’t code HTML for themselves. Actually, Dreamweaver can be used as a pretty nice text editor with features particularly suited to web development. I personally use TextMate and Dreamweaver in tandem, and use the wysiwyg mode mainly to navigate to other parts of my code (especially with legacy table-based layouts, which can be a real pain otherwise). But if someone is able to get the right results with wysiwyg mode (that might not be possible in this case–I’m not sure, but for sake of argument let’s pretend it is) then who cares? It’s the results that matter, and any tool can be used in a multitude of ways. Just because a tool *is* used by uninspired hacks doesn’t make all of its users into uninspired hacks. And just because a tool lends itself to cheezy results doesn’t mean that a user with vision and taste can’t make that tool deliver something worthwhile. Judging a piece of work by the tool used is prejudice, pure and simple. We must let the results speak for themselves.

  1. The one exception is that I’d like to have auto-focus on my OM-1. I’d like to have the camera focus, and then let me adjust it if it I want before taking the picture.

catchy names beat descriptive names

February 19, 2008

Okay, so maybe I’m generalizing too much, or maybe this shows that catchy names (like amazon.com) beat descriptive names (like buy.com). The case in point is the demise of HD-DVD, and the success of Blu-ray. “HD-DVD” tells you exactly what it is: a high-definition DVD. “Blu-ray” tells you nothing, except perhaps hinting ever so slightly at its optical nature.

In case you hadn’t heard the news, studios, manufacturers, big-box stores, and even NetFlix are dropping HD-DVD in favor of Blu-ray. It seems unlikely that the trend will reverse itself, so everyone (except Microsoft) is calling it a day for HD-DVD.

Some names are both catchy and descriptive, like Ruby on Rails. “Ruby on Rails” is ruby placed onto metaphorical rails, in other words, tracks which speed development. Imagine a train off its tracks, and how slow it is, and now compare it to a train on the tracks. This is the sort of image evoked by the name “Ruby on Rails”.

But things with purely descriptive names, especially when descriptive in an obscure way, might consider filing a name change. Take Merb, short for Mongrel + erb. It’s awesome little framework, but I fear it’s not going to get the attention it deserve with that name.

Microsoft’s not dying anytime *soon*… but maybe eventually

January 31, 2008

The “VAR Guy” points out some interesting facts about how much money Microsoft makes, and points out that they are not going to be killed by open source companies anytime soon.

I’m actually surprised at how close behind them IBM is. I wouldn’t have guessed that the two were almost neck-and-neck. So it is a little more realistic to hope that through its use of open source technologies, IBM will surpass Microsoft.

Already Microsoft has really very little to offer. With great effort, the world is breaking free of the Windows strangle-hold. Office is gradually becoming less and less necessary for more and more people. Eventually, it is realistic to hope, more and more governments and corporations will give it up. (I’ve already decided to break out of the Office upgrade cycle, because Apple’s iWork suite is SO much nicer, and for those time when I need Office, I’ve got the older version. If I used Linux more often, it would depend on the viability of OpenOffice, which seems to be doing very well in its progress.) So they are making money on essentially legacy software, with bells and whistles added (and an occasionally useful feature) to continue to sell the same thing over.

Meanwhile Linux is catching up to Windows on the desktop, and has long since surpassed it on the server as far as capabilities. OS X is light years ahead of Windows everywhere, and if you’re running OS X you can always run Windows occasionally under virtualization. And there’s no reason to buy a new version of Windows, just run the old one you’ve had for a decade. Not much has changed.

So the only reason they’re making so much money is that so much of the (western) world hasn’t woken up to the fact that they DON’T NEED MICROSOFT. MICROSOFT OFFERS THEM VERY LITTLE. (I say “western” world, because all my friends from India and former Soviet countries tell me that NO ONE uses legitimately licensed copies of Windows or much of anything in those countries. I believe I’ve heard the same about China.)

As open source gets a bigger grip in countries where the cost of Windows could feed a family for a month or a year, they may not lose money, but they’ll lose the network effect, and this will only continue to erode their monopoly. So while no open source fish is going to swallow the Microsoft shark any time soon, a school of them might grow and keep reducing the shark’s food source until it eventually starves.

If Microsoft ever does anything useful to serve its customers, instead of to serve itself at their expense, they could turn this trend around. They have a lot of money, and the public is largely gullible enough to trust them again, so there’s a good chance they can reverse this trend. As I’m not one of the trusting ones, I personally hope they die a painful death and all their investors lose everything. Harsh? Not any more than hoping a criminal is thrown in jail or a murderer gets the electric chair. Is that cruel? No, it will be good for them. When punishment is deserved, it can bring about a change of heart. I only want what is in their best interests—it just happens to be in the world’s best interests too.

To “The Joy of Tech”: I am not amused.

December 29, 2007

The Joy of Tech sees fit to use pop-under advertisements, which is blatantly antagonistic to users. Advertisements can be tolerated—I would use ads too if I ran a site as busy as theirs—but pop-up and pop-under ads are malicious:

  • they actively disregard the user’s desires–the user did nothing to request such an ad
  • they (often) deliberately work around the user’s attempts to block such ads

This is analogous to breaking and entering into my house. If Jehovah’s Witnesses come and knock on my door, and I don’t feel up to explaining to them why and how their beliefs fly in the face of logic and contradict historical facts, they’re at least not going to break down my door to talk to me. They respect my intentions, and eventually give up knocking and go somewhere else. The thief who breaks into my house, on the other hand, is acting in the wrong

  • not because of the fact that he enters my house,
  • not because he enters without my knowledge
  • not because of the techniques he uses to open the door
    but solely because he enters against my wishes.

Let me give a few examples to illustrate that these statements are true. Lots of people enter my house, so entering my house is obviously not, in and of itself, a problem. If I were selling my house I might leave a lockbox on the door for any realtors who want to show the house to potential buyers. I wouldn’t always know who was showing the house at any time, but that would be okay. And lastly, I might accidentally lock myself out of my house and break into it using the same techniques a thief might use. If a policeman drove by and saw me, I might wave “hello” to him and explain that I live in that house, and pull out my driver’s license to prove it.

So all of this demonstrates one thing: it is the wishes of the owner that determines what is okay and what is not. Violating my wishes by entering my home is punishable by law. Violating my wishes by pushing advertisements that I didn’t request down to me ought to be punishable by law, but for the time being we need to do something ourselves about it. Telling the thief that he has to leave is not enough, we want to throw him in jail. That is we want some consequences that are worse than simply foiling his attempt to break in. In the case of the web site, we want something worse than just what pop-up blockers can provide. Otherwise what incentive could they possibly have to stop?

Instead of simply blocking pop-up and pop-under advertisements, we should think about blocking all sites that use them. Treat them as spammers, since that is essentially what they are.

The first step is to make it easy for any individual to block all such sites. A central list that anyone can download and make use of would be a start. Use this list as a simple hosts file which sends all requests to such sites as joyoftech.com (and their kind) to dev/null, as it were (probably actually to some unused IP address like 192.168.222.222).

There are many ad-blocking lists (distributed as Firefox extensions, for instance) that could be used as examples. An extension could be created for Firefox users to automatically download and use the list, but Safari and Opera users could still use the list as a hosts file.

The next step would be to ad support for blocking this form of malware (that is, blocking the site, not just the pop-ups) to products that block other forms of malware. They could, upon visiting joyoftech.com (etc.) say “You are requesting a site that is known to push pop-up advertisements to users. They actively try to circumvent pop-up blockers, so it is possible that they might get around our latest blocking techniques. Do you want to continue? Yes or no.” This will in the very least hold the offending sites accountable. (Oftentimes you never know where that Netflix ad came from. By the time you find it, you’ve long since left joyoftech.com, and they get away with it.)

The other thing to do is to stop doing business with the companies that place the ads. I’ve dropped my Netflix membership, and there’s a good chance I’ll never go back. iTunes is making them less valuable, and I think we’ve already seen everything they have that’s worth watching anyway. So new stuff can be gotten digitally, and they can go the way of Blockbuster.