"; */ ?>


07
Apr 07

GOOGLE’s new baby “1-800-GOOG-411″

powered by
google labs logo
can’t find a girlfriend? its easy – just call 1-800-GOOG-GIRL
looking for your keys? its easy – just call 1-800-GOOG-KEYS
want another life? its never been easier – just call 1-800-GOOG-NEXT
;)

Welcome to Google Voice Local Search

Google Voice Local Search is Google’s experimental service to make local-business search accessible over the phone.

To try this service, just dial 1-800-GOOG-411 (1-800-466-4411) from any phone.

Using this service, you can:

  • search for a local business by name or category.
    You can say “Giovanni’s Pizzeria” or just “pizza”.
  • get connected to the business, free of charge.
  • get the details by SMS if you’re using a mobile phone.
    Just say “text message”.

And it’s free. Google doesn’t charge you a thing for the call or for connecting you to the business. Regular phone charges may apply, based on your telephone service provider.

Note: Google Voice Local Search is still in its experimental stage. It may not be available at all times and may not work for all users. We’re fine-tuning the service to get better at recognizing your requests. It’s currently only available in English, in the US, for US business listings.

When you are asked for city and state, you can:

  • say the city and state like “beverly hills california”.
  • say the zip, e.g. “nine-oh-two-one-oh”.
  • type the zip code using the key pad, e.g. “9-0-2-1-0”.

When you are asked for a business name or category, you can:

  • say a business name, like “Giovanni’s pizzeria”.
  • say a category name, like “hardware stores”.
  • say “go back” to change city and state.

When browsing through results, you can:

  • say the listing number (e.g. “number two”) or press the corresponding key (e.g. “2”) to choose a listing or navigate between results.
  • say “text message” or press “9” to receive a text message, when you are calling from a mobile phone.
  • say “details” to get more information about the current listing.
  • say “start over” or press “*” to start from the main menu.
  • say “go back” to change business or category.

07
Apr 07

Happy birthday IBM System/360!

Exactly 43 years ago, on April 7, 1964 the entire concept of computers has changed, when Big Blue announced its baby – IBM System/360 (S/360).

According to wiki The design is considered by many to be one of the most successful computers in history, influencing computer design for years to come. (The 360 and its successors are unquestionably the most profitable line of computer systems in history).

image is taken from ibm
ibm os360

Today, S/360 would seem like a total archaism – with several CPUs, it performed less than a MIPS or a 1,000,000 Instructions (operations) Per Second, having only 24KB of RAM (the cheapest model).

But the real “secret weapon” of S/360 was not at all its speed, but its ability to multitask, where many tasks could run concurrently. This was a huge step forward which doubled, or in some cases, tripled the overall system performance. Instead of sequential time distribution among users who stayed in line to get a machine’s time portion, S/360 could serve them simultaneously. Today we would say that S/360 was a server, and users were clients (terminals).

Another important innovation to computer industry that came with S/360 was a clear separation of hardware and operating system (OS/360). First time in computer history Operating System was introduced as a separate and independent component. Today mainframes use VMs (virtual machines) which are used to run many operating systems simultaneously on a single box. It’s worth to mention that Linux (zLinux what it is called on mainframes) is one of such OSs. More on zLinux here.

System/360 was an extremely risky project for IBM. Company invested $5 billion dollars (which made this project the most expensive computer/system project in history), and hired 60,000 people. However, this risk was justified in 5 years, when IBM’s revenue doubled.

According to IBM, today mainframes hold 65% of all the data accumulated by humanity in computer based format. Which is an interesting fact. Another amusing fact is that IBM zSeries (modern mainframes) sales grew 10.3 percent in 2006. ;)


06
Apr 07

Amazing Virtual Piano and Drumkit – Let’s Jam!

Thought for a while about creating a virtual band? Well, then you’ll need these virtual instruments :)

Once in a while my friends need to get something from these huge stores stuffed with electronics. So they drag me along to help them review whatever it is they are after. Since most of the time I buy that kind of stuff online, I quickly get bored walking down those isles, and stop at the one with all these cool pianos (keyboards). There I spent most of my time practicing, while my friends are looking for stuff.

Recently I was googling for something and found Colin’s blog, which had a cool link to this amazing virtual piano with several different modes: organ, saxophone, drums, flute, guitar, strings, bass, etc.

 

online virtual piano

Then I went further and found this great virtual drumkit which probably requires a real mouse, but gives a very realistic feeling:

online virtual drumkit

There are many more cool virtual instruments out there, so feel free to expand this list by adding more links.

Let’s get to jamming people!


05
Apr 07

Music Video Clip of the day: Queen “Bohemian Rhapsody”

Bohemian Rhapsody” is a song written by Freddie Mercury, originally recorded by the band Queen for their 1975 album A Night at the Opera. The song is in the style of a rock opera, and has a very unusual musical structure for a piece of popular music. Its six different sections have no chorus but both a cappella and heavy metal arrangements. Despite this, it was released as a single and became a huge commercial success, marking a decisive point in Queen’s career and setting them on the way to become one of the world’s most popular bands. The single was accompanied by what is generally cited as a groundbreaking “promotional video”, which helped establish the visual language of the modern music video. The song was included in all of Queen’s subsequent live concert performances and still enjoys great popularity all over the world.


04
Apr 07

SED to parse and modify XML element nodes

In one of my previous articles I showed how AWK can be used to get a very useful statistic from server log. Today I want to introduce my other friend – SED, which will help us to modify values of element nodes within an XML file.

Here is a little info on SED from wikipedia:

sed (which stands for Stream EDitor) is a simple and powerful computer program used to apply various textual transformations to a sequential stream of text data. It reads input files line by line, applying the operation which has been specified via the command line (or the sed script), and then finally outputs the line. It was originally developed from 1973 to 1974 as a Unix utility by Lee E. McMahon of Bell Labs, but today sed is now available for Unix (BSD, Mac OS X), Linux, and Win32, as well as many other platforms.

Ok, let’s see what is given. By complete accident we have an access to an XML request (file) from Yanik’s bank (ING), that performs a transfer of $1,000,000.00 dollars to his account today in exactly one hour. Here is what the request looks like (goodnews.xml):

<?xml version="1.0" encoding="ISO-8859-1"?>
<goodnews>
 
      <to>Yanik</to>
      <from>ING Bank</from>
      <date>04/01/2007</date>
      <amount>$1,000,000.00</amount>
      <account>0024549Y48K3-843</account>
      <message>We are pleased to inform you that the above amount was transferred to your bank account</message>
 
</goodnews>

Now, what if we could just made a slight change to this request, and become a receiver of that million dollars – would not that be cool!? Well, I am not asking Yanik here, for an obvious reason… The answer is – yes, it’d be cool and SED can help us archive our goal. Here is how.

Below, I wrote a small shell script that will be using SED. The script will take three parameters from a command line:

    “xml filename”, “element name” and “new value”

Then it will extract the value from the “element name”, and substitute it with a “new value” – that’s it – that is how simple it is. Does it smell like a million dollars already? :)

Here is the code (relement.sh):

# Check that exactly 3 values were passed in
if [ $# -ne 3 ]; then
echo 1>&2 “This script replaces xml element’s value with the one provided as a command parameter \n\n\tUsage: $0 <xml filename> <element name> <new value>exit 127
fi
 
echo "DEBUG: Starting... [Ok]\n"
echo "DEBUG: searching $1 for tagname <$2> and replacing its value with '$3'"
 
# Creating a temporary file for sed to write the changes to
temp_file="repl.temp"
 
# Elegance is the key -> adding an empty last line for Mr. “sed” to pick up
echo ” ” >> $1
 
# Extracting the value from the <$2> element
el_value=`grep<$2>.*<.$2>$1 | sed -e “s/^.*<$2/<$2/| cut -f2 -d”>| cut -f1 -d”<`
 
echo "DEBUG: Found the current value for the element <$2> - '$el_value'"
 
# Replacing elemen’s value with $3
sed -e “s/<$2>$el_value<\/$2>/<$2>$3<\/$2>/g” $1 > $temp_file
 
# Writing our changes back to the original file ($1)
chmod 666 $1
mv $temp_file $1

Let’s run it now and get that million dollars, that we are after:

[me at server]~: ./relement.sh goodnews.xml account my-secure-account
DEBUG: Starting... [Ok]
 
DEBUG: searching goodnews.xml for tagname <account> and replacing its value with 'my-secure-account'
DEBUG: Found the current value for the element <account> - '0024549Y48K3-843'
DEBUG: <account>0024549Y48K3-843</account> was successfully changed to <account>my-secure-account</account>
 
DEBUG: Exiting... [Ok]
 
[me at server]~: cat goodnews.xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<goodnews>
 
      <to>Yanik</to>
      <from>ING Bank</from>
      <date>04/01/2007</date>
      <amount>$1,000,000.00</amount>
      <account>my-secure-account</account>
      <message>We are pleased to inform you that the above amount was transferred to your bank account</message>
 
</goodnews>

Now we are getting all the money and not Yanik (well it is MY-secure-account, so technically I get it :) ).

Here is the nitty-gritty details of how that financial operation was possible…

Of course, the heart of this script is this line:

el_value=`grep "<$2>.*<.$2>" $1 | sed -e "s/^.*<$2/<$2/" | cut -f2 -d">"| cut -f1 -d"<"`

And here is what happens here:

    1. We grep “<element>whatever</element>” from the file ($1)

    2. Then we apply sed to search to ignore everything from the beginning of the line to the “<element”

    3. And finally we cut the value of this element which is located in between greater and less signs “>value<“

Easy, right?

Now let us look at this line:

sed -e "s/<$2>$el_value<\/$2>/<$2>$3<\/$2>/g" $1 > $temp_file

which uses sed’ (or vi’s) ‘s/search/replace/g” pattern to do the job – to replace all the “<element>oldvalue</element>” to “<element>newvalue</element>”. After that it saves it in a temp file, before replacing the original file.

The line

echo " " >> $1

makes sure that the source file has an empty last line, so sed can identify the “end of file” correctly

There is also one thing to mention – if you export Microsoft (e.g. M$ Word) document to XML, in order to change anything (properties) there, add these lines:

sed -e "s/<w:t>$el_value</<w:t>$3</g" $1 > $temp_file
chmod 666 $1
mv $temp_file $1

it will change all the corresponding elements to the property you need to change.

Now we are completely empowered! Quit your job – learn SED, and earn millions! No.. rather – billions!

Feel free to ask questions or leave comments.