Hmm…

Most of computer geeks love Star Wars. At least those that I have seen on the web (Slashdot, etc). Now I am really getting interested if my starting to use pack() and unpack() in Perl yesterday has anything to do with me watching three episodes of Star Wars in like two days…

I should keep an eye on this trend.

Next stage of Perl mastery – pack()/unpack()

I have seen many ways to measure someone’s Perl skills. Most of these ways are based on usage of certain Perl concepts. Today I have stepped on the next level according to some skill measurements. I have used the unpack function very naturally, and without much hussle. Here is the snippet:

#!/usr/bin/perl -w
use strict;
my ($year, $month, $date, $hour, $min, $sec) = unpack("a4a2a2a2a2a2", 20040102200534);
print "$date/$month/$year $hour:$min:$sec";

I could have done it before surely, but today it came to me naturally – without any thinking or manual reference. I will have to expand and polish this skill now. pack and unpack are very powerful functions and can simplify life a lot. It’s time I start using them.

lj2mail

With this script I will terrorize my friends from today onwards. What it does is get all the recent posts from some LiveJournal blog and email them as separate messages to a list of recepients. Subject of the blog entry is used as a subject of the email. Body of the message contains of text and the permalink.

In order to use, first configure few simple variables at the beginning of the script, providing LJ credentials, list of recepients, address to use in the From: field and a file to keep the timestamp of the last syncronization.

Changes: in this version I have fixed encoding fo the body and subject. Body can now be recoded with Text::Iconv module to any encoding from the default UTF-8. Subjects are additionally fixed to be base64-encoded.

lj2mail.pl

Continue reading lj2mail

The story of the Apple logo

For the last couple of days Olga and I are cultivating all sorts of ideas about Apple’s logo. Why is it an apple and why is it a bitten apple. I finally got bored with thinking about it all the time and decided to Google it up. It turned out that were weren’t that far from the truth and there does indeed seem to be a connection with Adam, Eve, and the Garden of Edem.

The paragraph from The Apple Musium article says:

The first Apple logo was designed by Ron Wayne, co-founder of Apple Computer. It was rather a picture than a logo. It showed Sir Isaac Newton sitting beneath the famous Apple tree thinking about gravity.
It was only used for the Apple I. Steve Jobs felt that it was too intellectual and it was almost impossible to put on computers as one could only recognize the details of the drawing when it was large enough.
Therefore, in 1977 Jobs asked the art designer Rob Janoff to design the new Apple logo. The new logo had a simple shape of an Apple, bitten into, with the colors of the rainbow in the wrong order. The bite symbolized knowlegde (in the bible the apple was the fruit of the tree of knowledge) and the bite could also be pronounced “byte”, a reference to computer technology.
When Jean Louis Gassée was asked about his thoughts to the Apple logo he answered: “One of the deep mysteries to me is our logo, the symbol of lust and knowledge, bitten into, all crossed with the colors of the rainbow in the wrong order. You couldn’t dream of a more appropriate logo: lust, knowledge, hope, and anarchy.”
In 1997, Steve Jobs decided to drop the multi-colored Apple logo and replace it by a solid-colored logo. The first Apple computers to feature the new logo were the new PowerBook G3s in 1998 (although they still featured both types of logos).

There is also an interesting discussion here, which, among other things, provides the link to the first version of Apple’s logo.