I adore it. →Link
A great lecture. “He did, however, mention that he experienced a near-deathbed conversion: he switched and bought a Macintosh computer.” →Link | →Link to YouTube Video

When it comes to UNIX shell-scripting I need all the help I can get.  It’s hard trying to do something new because getting to the right info requires reading many manual pages.  Here are commands I learned to find the latest version of a file that has a timestamp in its filename.  Suppose the files are

myFile.2008-05-01.12.45.01

myFile.2008-05-01.12.46.02

myFile.2008-05-01.12.47.03

and they’re in a directory with many other files, and you want to find the myFile with latest time, then issue this command in the directory of myFile:

ls -l | awk '/myFile/ {print $NF}' | tail -n 1
 

Ok, so what does this do?

“ls -l” prints the files in the current directory, one file per line, in ascending sorted order.  This output is passed to awk, which evaluates each line, searching for the pattern myFile, and for each line with myFile, it separates the words by whitespace, and prints the last field, which is the filename.  The list of such filenames is then passed to tail -n 1, which simply prints the last file in the list.  The result should be what we want.  Of course, if there are other files such as myFileABC, then this command won’t work.  We’ll need a more specific regular expression pattern in the awk command.

Can anyone do it simpler?  Please share.  Thanks.

In a UNIX shell terminal, a prompt indicates the shell is ready for a command. An example:

$

PS1 is the environment variable that determines what the prompt is.  Change it to change the prompt.

For example: PS1=${PWD}> ‘ will set the prompt to display “current_directory> “.  Pay attention to the single quotes.  Using double quotes may have a different effect.

To keep your new prompt each time you log in, set PS1 in your .profile file in your home directory.

Play around.  Different shells require different symbols.  Here are some more examples.

In bash, I use: PS1=’\[\e]0;\w\a\]\n\[\e[32m\]\u@\h\[\e[0m\]\n\$ ‘

In ksh, I use: PS1=’${HOSTNAME?}:${PWD?}’`echo “\n> “‘

Tell me what you are using.

“Ben Fry analyzes the data from an intelligence test administered to all incoming NFL players and displays the results by position.” [Via Kottke.org] →Link
Creating art pieces with simple algorithm and minimum amount of code.[Link]
The irony is, 5 years later, Vista managed to be a worse product than XP. It seems something is wrong with both MS and Windows that even Bill couldn’t fix it. Architecture, perhaps? [Link]

Jonathan Schwartz, the CEO of Sun, has posted an insightful article on the why and how behind ZFS. The link is here.

b2cf816df4ec5dfa6da3ef9ba89bed49 A little blue screen for everyone

The blue screen is back, brought you by Adobe!
Ok not exactly by Adobe. It’s done by this guy.

Here’s how it works.
When you enter fullscreen mode in Flash 9 there’s a little message telling you that you can exit fullscreen by pressing escape. What this guy discovered was that it’s not difficult to obscure that message and make it appear as though the machine has crashed(Windows crash).
Don’t worry about future variations(read:future pranks) though, because when Flash goes fullscreen, keyboard input is disabled.
Now if only someone is smart enough to come up with a fake OS flash done this way..

Quake 3: Arena

 float InvSqrt(float x){

    float xhalf=0.5f*x;

    int i=*(int*)&x;    

    i=0×5f3759df - (i>>1);    

    x=*(float *)&i;

    x=x*(1.5f-xhalf*x*x);    

    return x;
}

Analysis coming soon.

A little bit Google searching got me the usage of this Inverse Square function in Quake 3. Mind you it was written prior 2000.

Read more

48265978c187f49852dc5cee337a4386 My Free Software Runs Your Company

This is the creator of MySQL, Michael Widenius. He’s not boasting at all.
Thanks for your creation bro XD

[Photo Via Jonathan Schwartz]

b5c92e6e1510e1e06bd9eb158f0cf0fe Observation of Forbes 400

Top 20:
#1 William Gates III Net Worth $59.0 billion Harvard University, Drop Out
#3 Sheldon Adelson Net Worth $28.0 billion City College of New York, Drop Out
#4 Lawrence Ellison Net Worth $26.0 billion University of Illinois, Drop Out
#7 Kirk Kerkorian Net Worth $18.0 billion High School, Diploma
#8 Michael Dell Net Worth $17.2 billion University of Texas Austin, Drop Out
#11 Paul Allen Net Worth $16.8 billion Washington State University, Drop Out
#19 Jack Taylor & family Net Worth $14.0 billion Washington University, Drop Out
There are more but it gets kind of meaningless.
Among Top 11, 6 are in IT industry. 4 of those 6 are drop-outs.

Oh did I mention Steve Jobs?
Steve Jobs Net Worth $5.7 billion Reed College, Drop Out
Update: Mark Elliot Zuckerberg Net Worth $1.5 billion, Harvard University, Drop Out