Wednesday, October 14, 2009

Twitter



Atlast I have joined twitter. I have the habit of reading Singer Chinmayi's blog(though she has many other faces, I would like to refer her so!), once in a while. She had a side widget saying, "Follow me on twitter"!

My friend Surya had been saying that Twitter was an innovative concept and was different from the normal websites, couple of months back. I used to wonder about his statement. I have read in newspapers that Twitter was a social networking site. Already we have n number of social networking sites (I favour Orkut). Then whats so special about Twitter. Surya always speaks so high of mozilla, linux, open source etc., and thrashes windows. I have always believed that except for a few most of the people confuse between open source and freeware. It is strictly my view(not to be generalized). To be honest, I didn't bother about the Twitter mainly because Surya spoke so high of it! Thought it must be one of those open source projects which he admires just because it is open source :-P. But it was not to be so!

Anyway, today I was pretty free, with no other job except to relax, which I usually do after the exams!

I followed the link to Twitter from Chinmayi's blog, just like the poor Alice following the white rabbit. I found that there were few messages that Chinmayi had typed in Twitter! They appeared to me like quick sms's that she had typed (Later, I found that those messages are called as tweets). I registered into twitter.

To know more about Twitter, I wikied about it. It's become my regular practice to search as "searchterm wiki" instead of "searchterm" in google.

Twitter is a free social networking and micro-blogging service that enables its users to send and read messages known as tweets. Tweets are text-based posts of up to 140 characters displayed on the author's profile page and delivered to the author's subscribers who are known as followers. Senders can restrict delivery to those in their circle of friends or, by default, allow open access. Users can send and receive tweets via the Twitter website, Short Message Service (SMS) or external applications. While the service, itself, costs nothing to use, accessing it through SMS may incur phone service provider fees.

The 140 character limit on message length was initially set for compatibility with SMS messaging, and has brought to the web the kind of shorthand notation and slang commonly used in SMS messages. The 140 character limit has also spurred the usage of URL shortening services such as tinyurl, bit.ly and tr.im, and content hosting services, such as Twitpic and NotePub to accommodate multimedia content and text longer than 140 characters.

So I have to agree with Surya that Twitter is a different social networking site! But, when I was skimming about Twitter in wikipeida, I found this statement, "The Twitter Web interface uses the Ruby on Rails framework". Ruby in Rails is a open source technology, to which Surya is closely associated to! Afterall my conclusion about Surya proves to be right!

Tuesday, October 13, 2009

My last lab



Today, I had my semester practical examination in Internet Programming lab, which turned out to be quite special in many ways. I must admit, I didn't invest much time in preparing for it; only about 30 minutes earlier in the morning, from 6:15 to 6:45. The lab required us to create a chat program, the only one that needed some prior preparation. However, my mind was still lingering on the excitement of watching Champions League T20 games and playing International Cricket Captain the previous day, where I was delighted to see another team from IPL making it to the next round. With my thoughts on cricket and fun, I wasn't exactly in the mood to study.

Eventually, I did manage to get myself to study, but I ended up playing International Cricket Captain until 8:00 AM. Consequently, I left home quite late, at 8:15 AM, but thanks to my trusty Getz and the uncrowded road, I reached college by 8:25 AM. The exam was scheduled to start at 8:30 AM, and although I didn't even bother to study the other programs, I felt oddly confident about this exam—similar to how I had felt during my OOPS lab exam.

As I entered the lab, I had to pick my lucky draw from a stack of sheets, signed in on the attendance sheet, and glanced at the questions. One question required creating a simple HTML page, while the other involved displaying the date and time as the mouse moved. Initially, I thought it would be a piece of cake, and I took my seat with optimism. However, the second question had a slight twist—it demanded the date and time to move along with the cursor of the mouse. It was then that my brain conjured up a solution involving the use of "document.getElementId('component').style.left = '100px'," but I had forgotten this detail, which I later recalled after some time. I eventually managed to add a div and set the innerHTML so that a span inside the div moved accordingly. It took some trial and error, but I eventually got it to work.

By 10:15 AM, I had completed both programs. This lab was the second most challenging one I've encountered, with the first being data structures during my third semester. I still remember the pleasure of doing something different from the usual routine while grouping a set of numbers based on the number of digits repeating in the numbers. As luck would have it, I had only prepared the chat program for this exam, and it turned out that I didn't even get that one. It seems this kind of luck follows me since a couple of semesters back, I had painstakingly learned 8086 Microprocessor programs, even simplifying some given by my Ma'am to the class, but during the exam, I ended up with the simpler 8085 programs.

Today's lab marked the end of my B.E. degree labs, and I can't help but feel a tinge of sadness knowing that I won't be experiencing labs again. Nevertheless, this last lab exam will be etched in my memory, mainly due to that tricky mouse question that challenged me to think creatively.

Sunday, October 11, 2009



You can switch users without going through the Welcome screen: From Task Manager, go to the Users tab, right-click a user, and select Connect.

---------------------------------------------------------------

Hold down the shift key in the shutdown dialog to change "Stand By" to "Hibernate". Or just press H to hibernate instantly. You can even use the Power Control Panel to configure your power button to hibernate.

---------------------------------------------------------------

To disable the password when resuming from standby or hibernation, open the Power Control Panel and uncheck "Prompt for password after returning from standby" on the Advanced tab.

---------------------------------------------------------------

You can rename multiple files all at once: Select a group of files, right-click the first file, and select "Rename". Type in a name for the first file, and the rest will follow.

---------------------------------------------------------------

Hold down the shift key when switching to thumbnail view to hide the file names. Do it again to bring them back.

---------------------------------------------------------------

When dragging a file in Explorer, you can control the operation that will be performed when you release the mouse button:
Hold the Control Key to force a Copy.
Hold the Shift key to force a Move.
Hold the Alt key to force a Create Shortcut.

---------------------------------------------------------------

If you create a file called Folder.jpg, that image will be used as the thumbnail for the folder. What's more, that image will also be used as the album art in Windows Media Player for all media files in that folder.

---------------------------------------------------------------

From the View Menu, select "Choose Details" to select which file properties should be shown in the Explorer window. To sort by a file property, check its name in the "Choose Details" in order to make that property available in the "Arrange Icons by" menu.

---------------------------------------------------------------

To display the volume control icon in the taskbar, go to the Sounds and Audio Devices Control Panel and select "Place volume icon in the taskbar".

---------------------------------------------------------------

Hold down the shift key when deleting a file to delete it immediately instead of placing it in the Recycle Bin. Files deleted in this way cannot be restored.

---------------------------------------------------------------

If you hold down the shift key while clicking "No" in a Confirm File Operation dialog, the response will be interpreted as "No to All".

---------------------------------------------------------------

To save a document with an extension other than the one a program wants to use, enclose the entire name in quotation makes. For example, if you run Notepad and save a file under the name:
Dr.Z
it will actually be saved under the name Dr.Z.txt
But if you type:
"Dr.Z"
then the document will be saved under the name:
Dr.Z
(Note that a document so-named cannot be opened via double-clicking since the extension is no longer ".txt").

---------------------------------------------------------------

Put a shortcut to your favorite editor in your Send To folder and it will appear in your "Send To" menu. You can then right-click any file and send it to your editor.
Ctrl+Shift+Escape will launch Task Manager.

---------------------------------------------------------------

To arrange two windows side-by-side, switch to the first window, then hold the Control key while right-clicking the taskbar button of the second window. Select "Tile Vertically".

---------------------------------------------------------------

To close several windows at once, hold down the Control key while clicking on the taskbar buttons of each window. Once you have selected all the windows you want to close, right-click the last button you selected and pick "Close Group".

---------------------------------------------------------------

You can turn a folder into a desktop toolbar by dragging the icon of the desired folder to the edge of the screen. You can then turn it into a floating toolbar by dragging it from the edge of the screen into the middle of the screen. (It helps if you minimize all application windows first.)

---------------------------------------------------------------

You can turn a folder into a taskbar toolbar. First, unlock your taskbar. Next drag the icon of the desired folder to the space between the taskbar buttons and the clock. (Wait for the no-entry cursor to change to an arrow. It's a very tiny space; you will have to hunt for it.) You can rearrange and resize the taskbar toolbar you just created. You can even turn the taskbar toolbar into a menu by resizing it until only its name is visible.

---------------------------------------------------------------

In the Address Bar, type a domain name like "microsoft" an hit Ctrl+Enter. Internet Explorer autmatically inserts the "http://www." and the ".com" for you.

---------------------------------------------------------------

To remove an AutoComplete entry from a Web form, highlight the item in the AutoComplete dropdown and press the Delete key. To remove all Web form AutoComplete entries, go to the Internet Explorer Tools menu, select Internet Options, Content, AutoComplete, then press the "Clear Forms" button.

---------------------------------------------------------------

To organize your Favorites in Explorer instead of using the Organize Favorites dialog, hold the shift key while selecting "Organize Favorites" from the Favorites menu of an Explorer window.

---------------------------------------------------------------

You can organize your Favorites by dragging the items around your Favorites menu. Alternatively, you can open the Favorites pane and hold the Alt key while pressing the up and down arrows to change the order of your Favorites.

---------------------------------------------------------------

To run Internet Explorer fullscreen, press F11. Press it again to return to normal mode.

---------------------------------------------------------------

To add or remove columns from the Details mode, select Choose Details from the View m menu, or just right-click the column header bar.

---------------------------------------------------------------

In Internet Explorer, hold the Shift key while turning the mouse wheel to go forwards or backwards.
In Internet Explorer, hold the Shift key while clicking on a link to open the Web page in a new window.
In Internet Explorer, type Ctrl+D to add the current page to your Favorites. This and many more keyboard shortcuts can be found by going to Internet Explorer, clicking the Help menu, then selecting Contents and Index. From the table of contents, open Accessibility and click "Using Internet Explorer keyboard shortcuts".

---------------------------------------------------------------

Saturday, October 10, 2009

After two years I had changed my mobile model.
From nokia 6300 I had moved to its successor 6303.
Some interesting facts about nokia, to mark this occassion!


Mine is the one in the left!

1) The ringtone "Nokia tune" is actually based on a 19th century guitar work named "Gran Vals" by Spanish musician Francisco Tárrega. The Nokia Tunewas originally named "Grande Valse" on Nokia phones but was changed to "Nokia Tune" around 1998 when it became so well known that people referred to it as the "Nokia Tune."

2) The world's first commercial GSM call was made in 1991 in Helsinki over a Nokia-supplied network, by Prime Minister of Finland Harri Holkeri, using a Nokia phone.

3) Nokia is currently the world's largest digital camera manufacturer, as the sales of its camera-equipped mobile phones have exceeded those of any conventional camera manufacturer.

4) The "Special" tone available to users of Nokia phones when receiving SMS (text messages) is actually Morse code for "SMS". Similarly, the "Ascending" SMS tone is Morse code for "Connecting People," Nokia's slogan. The "Standard" SMS tone is Morse code for "M" (Message).

5) The Nokia corporate font (typeface) is the AgfaMonotype Nokia Sans font, originally designed by Eric Spiekermann. Its mobile phone User's Guides Nokia mostly used the Agfa Rotis Sans font.

6) In Asia, the digit 4 never appears in any Nokia handset model number, because 4 is considered unlucky in many parts of Southeast/East Asia.

7) Nokia was listed as the 20th most admirable company worldwide in Fortune's list of 2006 (1st in network communications, 4th non-US company).

8. Unlike other modern day handsets, Nokia phones do not automatically start the call timer when the call is connected, but start it when the call is initiated. (Except for Series 60 based handsets like the Nokia 6600)

9) Nokia is sometimes called aikon (Nokia backwards) by non-Nokia mobile phone users and by mobile software developers, because "aikon" is used in various SDK software packages, including Nokia's own Symbian S60 SDK.

10) The name of the town of Nokia originated from the river which flowed through the town. The river itself, Nokianvirta, was named after the old Finnish word originally meaning sable, later pine marten. A species of this small, black-furred predatory animal was once found in the region, but it is now extinct.

An interesting java program that caught my attention is the one that follows!

import java.awt.BorderLayout;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JScrollPane;

public class ScrollSample {
public static void main(String args[]) {
String title = "JScrollPane Sample";
JFrame frame = new JFrame(title);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Icon icon = new ImageIcon("dhoni.jpg");
JLabel label1 = new JLabel(icon);
JScrollPane scrollPane = new JScrollPane();
scrollPane.setViewportView(
label1);
frame.getContentPane().add(scrollPane, BorderLayout.CENTER);
frame.setSize(300, 200);
frame.setVisible(true);
}
}

Following is a program that was given to my juniors in the C-Debugging finals. It was quite surprising that no one solved it, in an efficient manner!

Only Vivek and Sathish from third year did some justice to the program!

#include<stdio.h>
void main()
{
int x;
char c,h;
clrscr();
printf("\n Enter a character:");
scanf("%c", &c);
printf(" The first character entered was:%c",c);
printf("\n Enter another character:");
scanf("%c",&h);
printf("\n The second character entered was:%c",h);
getch();
}

Solution:

#include<stdio.h>
void main()
{
int x;
char c,h;
clrscr();
printf("\n Enter a character:");
scanf("%c", &c);
fflush(stdin);
printf(" The first character entered was:%c",c);
printf("\n Enter another character:");
scanf("%c",&h);
printf("\n The second character entered was:%c",h);
getch();
}

Explanation:

stdin, gets the character and the enter as another character and it is set to h.
So h is not input at all!

fflush is an interesting function which flushes the unwanted content from the stream!

In java too we face this problem, I will get back to that in my tutorial!

Saturday, October 3, 2009

Hope you meditated enough.

It's been quite some time since my last post.

I had been really busy organizing the Intra Virtuoso events for my college juniors. Anyway getting back to the post, we shall continue from where we left...

No preprocessor directives in Java

Which means that, Java uses something else to makeup!

It uses a technique which we would be calling as...

Importing of Classes

Consider the following code in C

# include <stdio.h>
void main()
{
printf("Hi");
}

It actually has only four lines of code.

But at compile time it shows that there are 312 lines of code!

The remaining 308 lines of code is from the stdio.h header file. Its added into the program.

In C, its just the standard library functions from the header files.
Java has a different hierarchy for programming!

Java Library------->Packages------->Classes & Interfaces------->Methods

So, if a programmer wants to use a class then only that class imported.

Difference between #include and import

#include directive makes the compiler to go to the c/c++ standard library and then copy from the header files into the program.

import statement makes the JVM go to the java standard library, execute the code there and then substitute the result in the program.

Here no code is copied and hence there is no waste of memory or the process time.

Eg:

import java.lang.system;
import java.lang.string;

Note:

java.lang.*;

is automatically imported to all java programs!

So the code import java.lang.*;
is never needed!

Now the comparison between C and Java is over!
We shall try to get along with Java basics from now on.

Try to recollect the Hello world program in Java.
I would try to get back to you with my next post.

Monday, September 21, 2009

A nice Story



Once upon a time there was a shepherd looking after his sheep on the side of a deserted road. Suddenly a brand new Porsche screeches to a halt.

The driver, a man dressed in an Armani suit, Cerutti shoes, Ray-Ban sunglasses, TAG-Heuer wrist-watch, and a Pierre Cardin tie, gets out and asks the Shepherd: If I can tell you how many sheep you have, will you give me one of them?"

The shepherd looks at the young man, and then looks at the large flock of
grazing sheep and replies: "Okay."

The young man parks the car, connects his laptop to the mobile-fax, enters a NASA Webster, scans the ground using his GPS, opens a database and 60 Excel tables filled with logarithms and pivot tables, then prints out a 150 page report on his high-tech mini-printer.

He turns to the shepherd and says, "You have exactly 1,586 sheep here."

The shepherd cheers,"that's correct, you can have your sheep."

The young man makes his pick and puts it in the back of his Porsche.

The shepherd looks at him and asks: "If I guess your profession, will you return my animal to me?"

The young man answers, "Yes, why not".

The shepherd says, "You are an IT consultant ".

"How did you know?" asks the young man.

"Very simple," answers the shepherd. "First, you came here without being called. Second, you charged me a fee to tell me something I already knew, and third, you don't understand anything about my business...
Now can I have my DOG back?"

I got this story as a forwarded mail, few days back. It was like damaging myself because I aspire to become an IT consultant! Anyway, its how the customer always thinks of us! So it was pretty cool to read. Hope you like it too!

Sunday, September 13, 2009

1. Coca-Cola was originally green.

2. The most common name in the world is Mohammed.

3.The name of all the continents end with the same letter that they start with.

4. The strongest muscle in the body is the tongue.

5. There are two credit cards for every person in the United States.

6. TYPEWRITER is the longest word that can be made using the letters only on one row of the keyboard.

7. Women blink nearly twice as much as men!

8. You can't kill yourself by holding your breath.

9. It is impossible to lick your elbow.

10. People say "Bless you" when you sneeze because when you sneeze,your heart stops for a millisecond.

11. It is physically impossible for pigs to look up into the sky.

12. The "sixth sick sheik's sixth sheep's sick" is said to be the toughest tongue twister in the English language.

13. If you sneeze too hard, you can fracture a rib. If you try to suppress a sneeze, you can rupture a blood vessel in your head or neck and die.

14. Each king in a deck of playing cards represents great king from history.
Spades - King David
Clubs - Alexander the Great,
Hearts - Charlemagne
Diamonds - Julius Caesar.

15. 111,111,111 x 111,111,111 = 12,345,678,987,654,321

16. If a statue of a person in the park on a horse has both front legs in the air, the person died in battle.

If the horse has one front leg in the air,the person died as a result of wounds received in battle.

If the horse has a all four legs on the ground, the person died of natural causes.

17. What do bullet proof vests, fire escapes, windshield wipers and laser printers all have in common?

Ans. - All invented by women.

18. Question - This is the only food that doesn't spoil. What is this?
Ans. - Honey

19. A crocodile cannot stick its tongue out.

20. A snail can sleep for three years.

21.. All polar bears are left handed.

22. American Airlines saved $40,000 in 1987 by eliminating one olive from each salad served in first-class.

23. Butterflies taste with their feet.

24. Elephants are the only animals that can't jump.

25. In the last 4000 years, no new animals have been domesticated.

26. On average, people fear spiders more than they do death.

27. Shakespeare invented the word 'assassination' and 'bump'.

28. Stewardesses is the longest word typed with only the left hand.

29. The ant always falls over on its right side when intoxicated..

30. The electric chair was invented by a dentist.

31. The human heart creates enough pressure when it pumps out to the body to squirt blood 30 feet.

32. Rats multiply so quickly that in 18 months, two rats could have over million descendants.

33. Wearing headphones for just an hour will increase the bacteria in your ear by 700 times.

34. The cigarette lighter was invented before the match.

35. Most lipstick contains fish scales.

36. Like fingerprints, everyone's tongue print is different