Monday, February 25, 2008

Star Wars by a Three-Year-Old

If you've had kids, particularly if your first is a daughter, then this will seem very familiar.

Explanation of Star Wars by a Three-Year-Old.

Monday, February 11, 2008

Impressive Warehouse Fire

I could see this fire as soon as I left our house this morning, over 40 miles away. Wow!

(Oh, click on the link under the picture that says Photos, that takes you to a photo album).

Wednesday, February 06, 2008

Primary Delegates Map

Here's a nice interactive map a the Washington Post of primary delegates and who has won them so far.

Here are some more.

  • Time (but it's out of date at the moment)
  • Newsweek (Caution, though they display delegate counts up top, their bar-chart seems to be counting votes and not delegates. ???)
  • NY Times (also not up to date yet)

Tuesday, February 05, 2008

Bazaar

Okay, a guy I work with, Jon, told me about Bazaar (bzr), which is a version control system. I've been trying it out for several weeks, using at work regularly, and just playing with it at home. I've really come to like it a lot except for one shortcoming noted below.

The web site does a good job of listing the features but here are the ones that I like.

  • Commands are similar to CVS.
  • You don't need a central repository.
  • It's completely written in Python and supports plug-ins.
  • It's very easy to use.
My first version control system was RCS and then around early in this century I migrated to CVS, which was descended from RCS. This will be my third. (Well, not technically. I have used and do use others).

One big paradigm shift involves how version numbers are assigned. In CVS, each file has it's own series of version numbers. For example file1 might be at version 1.4 and file2 might be at 1.20. The only idea of a global version is achieved with tags.

With bzr, even if you only commit changes from file2, if that's version 25, then version 25 represents the state of all files in the project at that point. This has a few implications.
  1. If you list the log of changes for, e.g., file2, you might see it was updated in versions 25, 23, 22, 10, and 7.
  2. You can list the global log of changes which shows comments and which files were changed for ever version number.
  3. It's trivially easy to commit changes since you don't have to list files, but can just do a commit which catches everything. This is more convenient than I ever imagined.
This idea of a global version number rather than a local version number for each file is the way most version control systems work so this represents a paradigm shift for me (hey, a change in thinking!) but I've quickly come to like it.

Bazaar has one shortcoming that is very annoying—it doesn't support RCS keywords. In RCS, you can place text like $Revision$, $Author$, and $Date$ in your file and they will be updated with the current values. I've depended on this over the years and miss it a lot when it's missing. I think files should have their identifying information when printed without having to refer to the on-line version control system.

It's pretty easy to write a little program that edits in this information, say just before committing changes, and indeed I've already written most of it. It could even be made a plugin for Bazaar so I may do that.

In the end, Bazaar is highly recommended for keeping versions of any important files (not just program code).

Wednesday, January 30, 2008

Reversing Memory Loss?

This is a fascinating article from The Independent about doctors electrically stimulating a 50-year-old man's brain caused old memories to flood back in vivid detail.

The accidental breakthrough came during an experiment originally intended to suppress the obese man's appetite, using the increasingly successful technique of deep-brain stimulation. Electrodes were pushed into the man's brain and stimulated with an electric current. Instead of losing appetite, the patient instead had an intense experience of déjà vu. He recalled, in intricate detail, a scene from 30 years earlier. More tests showed his ability to learn was dramatically improved when the current was switched on and his brain stimulated.

Also,

Professor Lozano said: "This is the first time that anyone has had electrodes implanted in the brain which have been shown to improve memory. We are driving the activity of the brain by increasing its sensitivity – turning up the volume of the memory circuits. Any event that involves the memory circuits is more likely to be stored and retained."
What they don't say in the article is that, as the electrical current was increased, the man forgot the alphabet and asked the scientists, “Can you tell me what kind of cow I am?” At higher currents he simply began yelling “Turn it off! Turn it off!”

Hoary Pogonotrophy

I'm engaged in hoary pogonotrophy.

Monday, January 21, 2008

What Have You Changed Your Mind About? Why?

This is a fascinating question that was discussed in these articles.

Those sites are in increasing order of origin, I believe.

The gist I got is that asking a person this question leads to interesting and important insight at least about the “scientific” aspects of their background. Note that this means scientific in a general sense of thinking and learning, more so than as, say, a professional scientist.

Now I just need to answer the question myself. I'm not sure I have an answer yet. I'll see what I can come up with and report back here.

Two Shared Items Pages from Google Reader

Arg. Okay, I'm now reading, and thus posting, from two different Google Reader accounts. This means I now have two Shared Items pages. Both links are to the right: Shared Google Reader and More Shared Reader. It may be worth looking at both of them.

Maybe someday I'll reorganize my Google life to allow reading and posting from one of them. I might be close to that now.

Friday, January 18, 2008

Build a Computer from the Ground Up

This looks like a really neat book! It teaches you how a computer works while building one (using emulators) starting with logic gates and ending with software. Recommendations are high.

The Elements of Computing Systems: Building a Modern Computer from First Principles
by Noam Nisan and Shimon Schocken, The MIT Press, 2005.

At Amazon.

Monday, January 14, 2008

Tuesday, January 08, 2008

Laser HDTV

Laser TVs are something we've imagined and anticipated for some time. Now, here's an HDTV version. Maybe there were standard laser TVs in the past that I've just missed.

If this is what I think it is, a TV raster image created with scanned lasers, then I think it has important implications for applications. I was going to suggest what some of those implications were but the more I thought about it just now, the more I realized maybe it's not as straightforward as I thought. More thinking required. 8-/

Monday, January 07, 2008

Human Tetris!

From the It Doesn't Take Much to Entertain Me department: Human Tetris on Youtube.

Friday, January 04, 2008

Thursday, January 03, 2008

Python Videos by Jeff Rush

I've only watched this first video, but I found it to be an outstanding first look and code walk through of a simple Python script. It's from a series of videos by Jeff Rush which seem to be quite well done. Check it out and note how powerful a simple Python program can be. The presentation is very well done.

He does use a couple of advanced features:
  • Compiled regular expressions
  • A list comprehension
I'm curious to know if you found they made the example more difficult to follow, or if they were easy to understand.

Monday, December 31, 2007

Posting from New Account

I'm testing posting from another Google account.

Your U.N.C.L.E. on DVD!!!!!


Outstanding news!! Time Life now has the first season of The Man from U.N.C.L.E. (1964--65) on DVD!

The first season includes the Project Strigas Affair, which featured guest stars William Shatner and Leonard Nimoy!

Friday, December 14, 2007

SimpleDB

Noted in Michael's Google Chat status: SimpleDB.

Very interesting.

Tuesday, December 04, 2007

Spam Trap

Fascinating! From Slashdot, an article on a new type of spam detection in
Abaca's new filtering techology that bases detection on a computed reputation of recipients rather than email content or the sender.

Monday, December 03, 2007

Python Differences

Okay, here's a list of things that are different in Python that one may as well get used to. I think that most of these weren't immediately obvious to me, rather, I had to pick up on them after a bit of time.

Everything is by reference

All variable assignments are by reference, i.e., they copy the address and never copy the values. If a and b are arrays, a = b, does not copy the array as in Perl. Now a is a reference to the same array as b. Of course for scalar values, this does copy the value so to state things more precisely (i.e., correctly): Every variable is a scalar which is a simple scalar value or a reference to anything more complex than a scalar.

When you do want to make copies of something like an array, you need to import copy and use that module.

Learn the way of the %

Gone are the days of simple print statements and simple comma separated lists in print statements. Python brings us back to the days of printf for everything.

The format is something like '%, %s!' % ('Hello', 'World') or 'The answer is: %d' % x. Okay, granted no printf-like function is required, but % is an infix operator. (That in itself is an interesting departure for a language that uses functions and methods for a lot of operations). I didn't realize this at first, but simply plan to use this feature all the time! That means any time you deal with building strings. However, you can use the + to concatenate strings.

This is a side-effect of Python not having an indicator on variables such as $var in Perl. You can't simply say print "Hello $place!" in Python, because there's no $ to say that place is a variable, so you have to say print 'Hello %s!' % place. If you try print 'Hello ', place, '!' it won't be quite what you expect because Python adds an annoying space for every comma in a print statement.

Does this meet Python's goal of being “clean?” Hmm...

The main point here is that I had to make the shift from thinking % was a way to do things to realizing it is the way.

Quoting

The first thing you realize is that, because there are no variables like $var, there's no real difference between single and double quotes. The typical reason for using one is that you want to have literal instances of the other inside. For example, "Now here's a string." or 'Add the word "please" to your request.'

Then, later you realize that symbols like \n really are interpreted in both types of quotes and, in fact, you have to use the raw indication by prepending a letter r, r'print this \n literally.', to not interpret special symbols.

Everything has to be initialized

I can't complain about this one, but there's no automatic initialization of anything. The Pyton dict is the equivalent of a Perl hash. In Python, you can't access an element of a dict unless it's been initialized, even if to the value None (which is Python's equivalent to NULL or undef). This means that, in what should be a relatively simple loop, you always have to test for existence and add a clause to initialize if necessary.

Similarly, you can't use a simple variable before initialzing it.

The end result is that Python always forces you to be rather serious about programming and doesn't allow the same ability to dash of a useful expression the way Perl does. It's a philosophical difference that I can't argue about either way, however I do miss the latter sometimes. Well, okay, one doesn't really miss the latter, one simply switches back to Perl.

Saturday, December 01, 2007

Colleges Outsourcing Email to Gmail, MS

This Slashdot article on college oursourcing to Gmail and MS Live hits the topic spot on and covers it well. It's a highly-recommended read!

I have a couple of comments.

Worrying about privacy in the realm of email is nuts. People just don't get what email is. It's probably already crossed the Internet in the clear! For real ways to address these issues see my discussion of alternative email ideas.

Too late! I've already forgotten the second comment.