Tuesday, April 10, 2007

Too sexy

In response to this post.

From the post:
"That’s a pity really, because even though [Paul Graham] says eventually Microsoft may encounter problems (who would have thunk?), [he] effectively concedes that Microsoft is going to make a lot more money in future. And some people are going to get rich competing with, and taking a chunk out of Microsoft’s revenues - although apparently not Graham’s start-ups because it’s unfashionable to even try."

Microsoft's flagship product is the Windows OS, but supposedly they don't profit from its sales [Edit: this is incorrect, it's actually Windows and Office that keep MS from major losses]. They keep developing new versions of Windows in order to maintain their share of the market - those customers will then pay exorbitant prices for other products (e.g., MS Office) which sustain the company.

The problem is that the OS market has been commoditized and Microsoft Windows is an inferior product. Sun open sourcing Solaris is an indicator of OS commoditization and is Windows OS objectively better than other OSes? Assuming Microsoft continues down the path of producing OSes that barely meet status quo, it's only a matter of time before they lose their grip on the desktop market. Of course, maybe they'll surprise us all and build an awesome Minix-based OS.

If MS loses the desktop wars, they will end up where they started, writing third-party applications for Apple. And there's always web application development.

It's not only that web applications are sexy, it's that the OS wars require a large amount of resources (people and/or money) to win. How many Windows users choose Wordperfect over Word? How many Apple users choose Powerpoint over Keynote? It seems pretty futile for a third-party developer, especially a startup, to attempt to beat first-party applications.

Sunday, October 01, 2006

Closure on closures

In a previous post, closures were discussed without much being said. That was over a year ago, since then I've come across a few posts that clarify.

Here's a description of the concept by comparison to objects:
Objects are data with methods attached, closures are functions with data attached.

(Sorry, I couldn't find the source for this quote, so this is a paraphrase from memory.)

An explanation of where the term closure comes from by Max Hailpern, co-author of Concrete Abstractions - and why they didn't use it in their book:
The reason [it wasn't included] is that "closure" only makes sense in a particular historical context, where procedures had previously been left "open", that is with free variables not associated with any particular binding. This was the case in various pre-Scheme Lisps, and lead to what was known as the "funarg problem," short for "functional argument", though it also was manifested when procedures were used in other first-class ways than as arguments, for example, as return values, where it was confusingly called the "upward funarg problem" (by contrast to the "downward funarg problem," where the arg was genuinely an arg). The "funarg problem" is what logicians had been calling "capture of free variables," which occurs in the lambda calculus if you do plain substitution, without renaming, in place of proper beta-reduction.

So anyhow, an evolutionary milestone in the development of the Lisp family of languages was the realizations that procedures should be "closed", that is, converted into a form where all the variables are bound rather than free. (The way this is normally done, as others have written in this thread, is by associating the procedure text, which still has free variables, with a binding environment that provides the bindings.)

Because this was such a big deal in terms of the languages' evolution, Lisp hackers took to using the word "closure" rather than just "procedure" to emphasize that they were talking about this great new lexically scoped kind of procedure.

As with so many words, it stuck, and people continued using it long after the distinction it was making ceased to be relevant. (When was the last time you saw a procedure that hadn't been closed?)

(Link to source.)

For a mathematical perspective see Ted Dziuba's post on closures as a recurrence relation.

Thursday, March 30, 2006

Return of the White Spots

Having purchased my first Mac two years ago, I was enticed by processor speed improvements to become a member of Apple's public beta program by purchasing one of the first MacBook Pros.

There have been various posts about MacBook Pro noise problems. My machine has exhibited this problem, but I've worked around it by fiddling with the lid. Annoying and occasionally headache inducing, but at least I can pretend all is well if I play loud music.

Or so I thought... My last Mac, a Powerbook (Al), was unlucky enough to be afflicted with the notorious white spots. This morning I noticed a little spot on my screen - "no big deal, just some dirt or something," I thought. Nope, it is a little tiny white spot. It's located on the right hand side, about 0.75 inches from the end and a little under halfway up the screen.

Oh Apple, why do you raise our expectations only to disappoint?

Sunday, November 27, 2005

Decision tree building and graphing in Python

Spent part of yesterday throwing together an implementation of the ID3 algorithm for building decision trees. It uses pydot for creating graphs, so the trees can be outputted in dot format (ascii, for display in Graphviz) or as an image.

The id3 module can be downloaded here. The implementation isn't bullet-proof, but should work fine with good data sets.

Example usage and output:

>>> from id3 import *
>>> dtree = DecisionTree('recycling_bin',
... [{'dept':'EE', 'size':'large', 'recycling_bin':'no'},
... {'dept':'CS', 'size':'medium', 'recycling_bin':'yes'},
... {'dept':'EE', 'size':'small', 'recycling_bin':'yes'},
... {'dept':'CS', 'size':'large', 'recycling_bin':'no'},
... {'dept':'EE', 'size':'small', 'recycling_bin':'yes'},
... {'dept':'CS', 'size':'medium', 'recycling_bin':'yes'}])
>>> dtree.graph.to_string()
'digraph G {\n"no";\n"yes";\n"yes";\n"size";\n"size" -> "no" [label=large];\n"size" -> "yes" [label=small];\n"size" -> "yes" [label=medium];\n}\n'

Tuesday, October 18, 2005

Semantic analysis with Python

I came across Reverend ("a general purpose Bayesian classifier") today after reading Peter Bengtsson's post about it. Haven't tried it yet, but it looks great.

Still looking for a good PLSA, or even LSA implementation, preferrably with Python support.

Anyone know of one?

Tuesday, October 04, 2005

"Java, my hero"

I now understand why so many developers on MS Windows cling to Java so tightly, it's their saviour from the hellish experience that is Microsoft Visual C++.

Developing cross-platform applications on a Mac or a Linux machine is not that difficult. Getting those same applications to build on a MS Windows platform is not that difficult. The problem is, what if someone needs to do development work of cross-platform software in the MSVC++ environment? It is possible, but the amount of work required is immense. The quasi-solution of switching to a different compiler/IDE is an option now, but what about 5+ years ago?

Java to the rescue! Well, sorta, application development in Java has many of its own gotchas and "write once, run anywhere" is malarky; but, for developers using MS Windows, Java development frees them from MSVC++ and (this is just a bonus) lets them build applications that are multi-platform. To sweeten the deal, Java has development tools and build processes that are standard on all major platforms. With more marketing than necessary, Sun was able to transform the animosity towards MSVC++ and MFC into migration to Java and AWT/Swing.

As Qt and GCC on Windows gain visibility, I wonder if we'll see some Java application developers downgrading (or is that upgrading?).

Sunday, September 04, 2005

Copyright laws and fair business transactions

Yesterday I bought a few CDs from Best Buy, but once I arrived home I realized that I was missing something. One of the CDs I purchased (or should I say decorative jewel case) was missing its, er, CD. The CD in question was No Doubt's Rocksteady, the jewel case was completely wrapped and the little sticky thing on top of the case was intact, but the case was empty.

I returned to Best Buy to get the CD I paid for and discover that they don't have any other copies. "OK," I thought, "not a big deal. Just give me my money back and I'll run down to Borders and get my CD there." I was expecting the Best Buy associate would have a problem with my proposed solution and I was right. At first they weren't sure what to do, but ended up offering me store credit. According to the Best Buy employee, the store is unable to provide me with a refund because it's a violation of copyright law. IANAL, but I have a good feeling that's probably not true. Hesitantly, I accepted their offer, only because I was already running late to a friend's house.

I can understand the reasoning behind a no refunds policy, but I still think it's unfair to an unlucky customer. All I did was give them money for a CD, and they didn't fulfill their side of the deal. I'm not in the loan business; I bought a CD, not a gift card.

No CD? OK, then give me my money back.
Guess I'll just have to start opening any merchandise I purchase before leaving the store...