Tuesday, September 13, 2005

Danny Elfman was in Oingo Boingo

Category: Music Trivia
Details:
Danny Elfman, film director Tim Burton's favourite composer, was a member of "Oingo Boingo" (also known at different times as "The Mystic Knights of Oingo Boingo" and "Boingo") The band was best known for the song "Wierd Science", which was written for the John Hughes film of the same name.

Where I learned it:
While passing through the living room where Eddie McGuire, host of Australia's version of "Who wants to be a millionaire", revealed this factoid after having asked a question about the famous composer.

References:

Saturday, May 21, 2005

provenance

Category: Vocabulary
Details:
n.
  1. Place of origin; derivation.
  2. Proof of authenticity or of past ownership. Used of art works and antiques.

Where I learned it:
Used by two different people on two completely different mailing lists on the same day. I just had to look it up.

References:

Thursday, May 12, 2005

NURBS

Category: Computer Generated Imaging
Details:
NURBS is an abbreviation of 'Non-Uniform Rational B-Spline'. It is a technique used for generating curves in computer graphics.

Where I learned it:
When trying out the Alias Maya PLE in preparation for some classes.

References:

Tuesday, May 10, 2005

Scoring off a goal kick

Category: Sporting rules
Details:
Since goal kicks are considered a 'direct free kick', the goal kicker can score directly from one end to the other.

Where I learned it:
During a game between students from my school and another school, the other school scored in such a manner and were awarded the goal. At the time, we thought this was a mistake, however my reading of the rule today proved us wrong.

References:

Monday, May 09, 2005

Sheep have four stomachs

Category: Biology
Details:
Like cows, sheep have four chambers to their stomach, each helping in the digestive process.

Where I learned it:
It somehow came up in a discussion over dinner at "Kaldi's", Ethiopia's answer to Starbucks.

References:

Friday, May 06, 2005

Raising Cain

Category: Vocabulary
Details:
To raise Cain:
  1. To become angry; to reprimand someone angrily.
  2. To behave in a boisterous manner; to create a commotion.
[After Cain, a Biblical character, the first son of Adam
and Eve, who killed his brother Abel out of jealousy.]

Where I learned it:
A.Word.A.Day email.

References:

Wednesday, May 04, 2005

Repetition and groups in Regular Expressions

Category: Programming technique
Details:
Regular Expressions are a powerful way to match parts of a section of text. Matching a section of text in a group with a repetition operator match expressions as expected, will only remember the last matched value.

An example in Java:
Matcher m = Pattern.matches("([a-z])+", "abc");
if (m.matches())
    for (int i = 1; i < m.groupCount(); i++)
        System.out.println("Found: " + m.group(i));
When executed, the above will produce the following:
Found: c
Not exactly what I had in mind. When you retrieve group 1 after evaluation, you will get "a". Even though the pattern matches successfully, the "a" match is overwritten by "b", which is overwritten by "c".

To get the desired result, use the following instead (changes in red, and note the subtraction of the '+' after the group):
Matcher m = Pattern.matches("\G([a-z])", "abc");
while (m.find())
    for (int i = 1; i < m.groupCount(); i++)
        System.out.println("Found: " + m.group(i));
This should now produce the following:
Found: a
Found: b
Found: c
Where I learned it:
While attempting to extract parts of a date expression in a project I'm working on.

References: