Friday, March 26, 2010

Happy Birthday, Akira Kurosawa

Being away from home for eleven days is hard, especially when your wife and dog don't come with you. I had a two-day offsite scheduled by my employer, and a technology conference (for which I had to give a presentation and run an after-hours session.)

Fortunately I had a wonderful weekend chock full of fun, and I managed to see several friends (you know who you are, friends!) but, and I hope people don't mind me saying so, the best damn part of this whole trip was the Akira Kurosawa film festival at the Stanford Theater in Palo Alto.

The last time I managed to attend a Kurosawa film festival was at the Aero Theater in Santa Monica back in 2008, and it was superb. At the time I saw the great films Ran, The Bad Sleep Well, Dersu Uzala, and Dreams, all of which I recommend unreservedly. But I have yet to find such film festivals in New Jersey, and I missed that part of California. Upon discovering this festival, I set up my viewing calendar. Fortunately, they repeated the same two movies per night over several nights, which meant I was never under pressure to go to the theater every night.

The first night I saw the two films Throne of Blood and The Bad Sleep Well. Throne of Blood was a fun visual experience, a solid recreation of Macbeth, but left something to be desired. What was missing was a hook that forced us to hang on to the story. It was clear this was missing because The Bad Sleep Well was clearly that kind of movie.

The second night had Kagemusha and Sanjuro. I missed Sanjuro because it was starting so very late, but Kagemusha was sublime. I've commented on this at work which spawned a rather lengthy discussion comparing it to Ran, which is entirely appropriate.

Tonight I saw The Lower Depths and The Idiot. Be prepared for those movies, though, because they're both very heavy. The Lower Depths is an ensemble film full of well-cast characters. It's a fairly depressing story about very poor, out of luck losers, all with their own special problems, fortunately punctuated by two fun, drunken song-and-dance scenes. The Idiot, an adaptation of the Dostoyevsky novel, had the sadness of The Lower Depths, only 50% longer, minus any respite that may come from drunken song-and-dance. Seriously, the story is split in to two parts:

Part 1: Love and Suffering.
Part 2: Love and Loathing.

Nonetheless, it was wonderfully shot, and, except for some horrible editing in the beginning poorly made up by adding long blocks of text, it was a compelling film. That I may never see again.

What a great, great way to spend my free time.

The Lower Depths




The Organ Player from Intermission


The Idiot



Friday, March 19, 2010

Learn about how Google uses Eclipse

Hey EclipseCon attendees,

If you're interested in how Googlers use Eclipse to develop some of the products you use, come to our talk on Tuesday, 4:15PM:
Eclipse in the Enterprise: Lessons from Google 
Providing Eclipse tools to thousands of engineers at Google is a satisfying job, but it's not always easy. In the last two years supporting Eclipse at Google has gone from casual support by enthusiasts in their spare time to a dedicated team mandated to make engineers' lives better. We will talk about the plug-ins we've written and processes we've established to provide features, enterprise deployment and support, and even share some of the pitfalls discovered along the way. 
And then, come to the Eclipse In The Enterprise BoF on Tuesday at 7:15PM for an opportunity to discuss how Eclipse is used at your organization!
Hey, you! Yes, you -- don't you work for that big company? Are you supporting hundreds, maybe thousands of your Eclipse-using colleagues? Are upgrades and environmental consistency your problem, too? Are you constantly struggling with fitting your company's build system to the IDE and Eclipse builders? Is your source code base so large that you're continually fooling Eclipse into thinking it's smaller?

Then come meet your peeps at the "Eclipse in the Enterprise" BoF. Let's share war stories and ideas. Impress everyone with your clever solutions and work-arounds! We're all facing the same issues, so come, let's talk.

Sunday, March 14, 2010

The Fourth Annual Computer Competition (Part 4 of 4)

(Introduction and Part 1, Part 2, Part 3, Part 4)

The fourth question, Question #5.

Question #5: Senior Division

Compact Disks (CD's) offer the latest advantages in digital sound. Each disk is capable of prividing almost 75 minutes of music. You are currently creating a catalog of your disks (on your computer, naturally) that will list the total time (in hours:minutes:seconds) fro each CD. Unfortunately, while most disk labels list the time for each selection, many do not list the total time for the complete album (although must CD players display this information when you first insert the disk prior to playing it.)

Write a program that (a) asks for the number of selections on the disk (b) asks for the time of each selection in the exact format [minutes:seconds] -- including the colon and (c) outputs the total time of the CD in the format [HH:MM:SS] (Hours:Minutes:Seconds). NOTE: 00:63:29 would be wrong. 01:03:29 would be correct,etc,

IMPORTANT INFORMATION: You may assume that no selection is over 59 minutes and 59 seconds long [59:59] and that the judge will input the data with no spaces between the numbers and the colon. However, the judge may or may not input the minute information with a leading zero. For example, your program should be able to handle 2 minutes and 12 seconds input by the judge either in the form 2:12 or 02:12. Finally your output must be in the format HH:MM:SS or it will not be judged correct. That is, there must be two digits for each position (hours, minutes and seconds) and the output must not have any spaces between the digits and the colons. Some example include (see the SAMPLE RUNS for others):

Correct:Incorrect:Correct:Incorrect:
00:07:3300:7:3302:13:1202 : 13 : 12

SAMPLE RUNS
RUN

HOW MANY SELECTIONS ON THE DISK? 5

TIME FOR SELECTION # 1 (MINUTES:SECONDS)? 29:45
TIME FOR SELECTION # 2 (MINUTES:SECONDS)? 13:32
TIME FOR SELECTION # 3 (MINUTES:SECONDS)? 9:12
TIME FOR SELECTION # 4 (MINUTES:SECONDS)? 02:12
TIME FOR SELECTION # 5 (MINUTES:SECONDS)? 12:52

TOTAL TIME OF DISK = 01:07:33

RUN

HOW MANY SELECTIONS ON THE DISK? 3

TIME FOR SELECTION # 1 (MINUTES:SECONDS)? 4:59
TIME FOR SELECTION # 2 (MINUTES:SECONDS)? 26:26
TIME FOR SELECTION # 3 (MINUTES:SECONDS)? 01:09

TOTAL TIME OF DISK = 00:32:34




The Fourth Annual Computer Competition (Part 3 of 4)

(Introduction and Part 1, Part 2, Part 3, Part 4)
The third question, Question #4.

Question #4: Senior Division

The integers 12, 21, 13 and 31 have the following characteristic:
12 times 12 = 144 and 21 times 21 = 441
13 times 13 = 169 and 31 times 31 = 961
Write a program that identifies all 3-digit integers (if any) between 100 and 400 for which this same kind of relationship holds. (That is, a 3-digit number whose square and the square of its "reverse" are mirror images.)

Important notes:

The number and its "reverse" must:
(a) both be true 3-digit numbers
(b) not be identical.
Examples: the following integers (among others) do not qualify:
100 (because its reverse integer is 1)
120 (because its reverse integer is 21)
121 (because its reverse integer is identical)

SAMPLE RUN
NOTE:

When your program is RUN by the judge it should list all the integers between 100 and 400 that qualify or state that no integers qualify, if that is the case.

The Fourth Annual Computer Competition (Part 2 of 4)

(Introduction and Part 1, Part 2, Part 3, Part 4)

Question #3: Senior Division

Write a program that accepts a sentence for input and outputs the sentence with the letters in each word arranged in alphabetical order, and the words in order of length. Words must still be separated by spaces. If two rearranged words are of equal length they are to be placed in alphabetical order of the output "sentence".

NOTE: The judge will input only upper-case letters and will terminate the sentence with a period. This will be the only punctuation in the sentence and must remain at the end of the output sentence.

SAMPLE RUNS

RUN
WHAT IS YOUR SENTENCE? THIS IS A SENTENCE FOR YOU TO EXAMINE.
A IS OT FOR OUY HIST AEEIMNX CEEENNST.

RUN

WHAT IS YOUR SENTENCE? WE ARE NOT ALL HERE NOW.
EW AER ALL NOT NOW EEHR.


The Fourth Annual Computer Competition (Part 1 of 4)

(Introduction and Part 1, Part 2, Part 3, Part 4)

Introduction

During my junior and senior years at high school I participated in a county-wide computer programming competition.

The day before the first competition, my junior year, the president of the computer club challenged me to a quick on-paper coding competition to see who should go. I beat him handily, and he was kind enough to give me the spot. Charles was a brilliant guy who I'm sure did just fine without the competition on his resume.

Both years, the competition went like so: every student was allocated an observer-judge. The judge was responsible for resetting the programming environment, clearing code and data, watching the student during the test, and then, when the student was done, would test the program with a predetermined data set. Correct exact results meant the student earned one point. Any incorrect result meant zero points.

The junior year I tied for third place with four other kids, resulting in a sudden-death run-off. (I remember getting at least one question incorrect. Did I get two wrong? My ego is struggling with the possibility.) I'm positive that had I not paused to test my program during the run-off I would have taken third-place, and the TRS-80 would have been mine. Alas.

The senior year's competition was the day after my prom, and I chose not to attend the prom in order to get a good night's rest. (This is a lie; I didn't attend the prom for plenty of reasons, most of which was I didn't fit in. My girlfriend and I had dinner at Gasho of Japan instead.) I don't remember doing well enough to win or place.

Tonight, while going through some old boxes in the basement, I came across one of the competition packets. There's no year on the packet, so I can't tell for which competition it was. There are four questions, labeled two through five, meaning that one of the questions is missing.

I'll publish the four questions, each as its own blog post. I won't include sample answers, because mine were built and destroyed quicker than sand sculptures. Plus they were written in BASIC, and I love you, but not that much.

The first question, Question #2.

Question #2 Senior Division

Write a program that will ask for six 3-digit numbers (without signs) to be input one at a time. ANY 3-digit number is valid. (Examples: 123, 049, 899, etc...). If anything else is input (letters, etc.) the program MUST output the EXACT error message "PLEASE INPUT THREE DIGITS ONLY", and then request the number again. After SIX 3-digit numbers are properly input the program is to tally the digits according to their position and output a table listing how many times a particular number appears at each position (hundreds, tens and units place.) See the SAMPLE RUN for clarification.

NOTES:
1. Try to make your output table easy to read, but do not worry about all numbers lining up perfectly since various computers differ slightly in formatting. [The judge will be looking for accuracy of output, not formatting of output.]
2. To make your task a bit easier you may assume that the judges will NOT attempt to input any commas or quotation marks. Any other input, however (letters, numbers, +/-, etc.) is "fair game", so make sure to test your program thoroughly.

SAMPLE RUN
RUN
3-DIGIT NUMBER 1? 364
3-DIGIT NUMBER 2? XYZ
PLEASE INPUT THREE DIGITS ONLY
3-DIGIT NUMBER 2? 446
3-DIGIT NUMBER 3? 780
3-DIGIT NUMBER 4? 8994
PLEASE INPUT THREE DIGITS ONLY
3-DIGIT NUMBER 4? 507
3-DIGIT NUMBER 5? 5B7
PLEASE INPUT THREE DIGITS ONLY
3-DIGIT NUMBER 5? 060
3-DIGIT NUMBER 6? 492


TALLY   HUND    TEN     UNIT
-----   ----    ---     ----
ZERO     1       1       2
ONE      0       0       0
TWO      0       0       1
THREE    1       0       0
FOUR     2       1       1
FIVE     1       0       0
SIX      0       2       1
SEVEN    1       0       1
EIGHT    0       1       0
NINE     0       1       0