Friday, December 11, 2009

Text states in gvim

If you're using Vim 7+, you can use g- and g+ to go between text states. For a more advanced usage see the :help earlier and :help later.


Some more info on this :
Using g+ and g- is very different than using u and ^r.

Try following:
* Create new file
* (in normal mode) Type iOne - Esc
* Type oTwo - Esc
* Type oThree - Esc
* Type oFour - Esc
* Type oFive - Esc
* Type 2u
* Type oSix - Esc
* Type oSeven - Esc

Now you have an undo tree with 2 branches. Typing u only goes up the last branch. Using g- goes up by time - branch doesn't matter here.

Have a look in :help usr_32.txt for good explanation of using the undo tree.

I got this tip from someone. Thanks to whomever contributed the tip!

The Power of Ctrl+R in gvim


The Control-R mechanism is very useful:-
:h i_CTRL-R

Usually used for inserting the contents of a register 0-9a-z
but can also insert the following special registers etc

'"' the unnamed register, containing the text of the last delete or
yank
'%' the current file name
'#' the alternate file name
'*' the clipboard contents (X11: primary selection)
'+' the clipboard contents
'/' the last search pattern
':' the last command-line
'.' the last inserted text
'-' the last small (less than a line) delete
=5*5 insert 25 into text (mini-calculator)

what can be done in free time?

I had some free time and I was thinking what can I do if I have such a free time everyday!!

Let me explain little bit more:
I finish up with my regular activities and was thinking on what can I do next? Naturally there are thousands of things and then why to do all these. But it happens, its very difficult to have interest in all things which needs to do..


By thinking, I was in a deep root thinking on what is the idea that I am not doing and I can start off right now. Suddenly second thought came, what will happen if someone take away all my current activities from me? Upon this question, I was just blind.

Why blind ? Because, this is not happened for the first time. It is happening again and again. After little peace in mind, I start playing chess, inet games, cricket, walk, outing etc etc... Later I set my mind that next time I will definitely start xyz.. but at the end, next term never comes..

I did it again and I get the same result again. Can I break this ?

Have you guys felt any such situation ever?


Wednesday, November 11, 2009

gvim : search history window

One of original great improvements of VIM over Classic Vi was the ability to reuse/edit/correct commands laboriously typed in, you had only simple line edit commands available to do this, normally perfectly sufficient of course. However you also open a command line window to gain full vim command line editing commands:-

Note these are normal-mode commands!
q:
Creates a small window of your most recent commands

q/
Creates a small window of your most recent searches

hitting "return" will execute whatever line you are editing

to close/leave the command window without executing the current line use :quit

Tuesday, November 3, 2009

Being Different – On the left hand side

Copying from my friends blog : Excellent (http://infomerits.blogspot.com/2009/11/being-different-on-left-hand-side.html)


Nac ouy daer siht ecnetnes? Fi os, ylbaborp uoy era eno fo esoht wef elpoep ohw nac daer eserver osla.

The above sentence is for those people who have the ability to read the words in the reverse direction. It has been found that people who are left handers, can read it first time or faster than others.

Yes. This is about the left handed people in the world. People who used to be the called the ‘bad ones’ historically; this is for them. And you may have guessed that, this is also from one of those people. I am left handed person.

When I was a little boy, I remember that I used to write with left hand and with the same hand I used to eat. I used to do my most of the things using my left hand only. But watching me doing so, my elders in the family asked me to change my hand. According to them, I was using wrong hand to do the things. I can also say I was almost forced to change my hand and as a result, I started writing using ‘right’ hand. Initially I used to write with right hand first and when I am tired of writing with that hand; I change my hand and then start writing with the left hand. Eventually I became ambidextrous. Now I can do things with my both hands. And I don’t know whether it is good or bad.

Here I am putting some of the information which I got from various places. The information is mostly about the left handed people and their history. The information is collected from various sources and need not to mention that one can’t use it as a base of their study. But as far I know I it is from reliable sources. Here I will put all data in bullet form so that you can read points easily or skip some parts.

  • There are various studies have done on number of left handed people, and it was found that approximately 10 to 12 percent of the adult population is left-handed in the world.
  • Studies indicate that left-handedness is more common in males than females
  • In ancient time almost all the civilization, left is taken as the "bad" side. And hence left handed people are also taken as the bad side of the society. And that could be the reason why we found very few old people who are writing with left hand and now as the society has become more open more people with left hand are visible.
  • In his book Right-Hand, Left-Hand, Chris McManus of University College London argues that left-handed people as a group have historically produced an above-average quota of high achievers. He says that left-handers' brains are structured differently in a way that widens their range of abilities, and the genes that determine left-handedness also govern development of the language centers of the brain.
  • In 2006, researchers at Lafayette College and Johns Hopkins University in a study found that left-handed men are 15 percent richer than right-handed men for those who attended college, and 26 percent richer if they graduated. The wage difference is still unexplainable and does not appear to apply to women.

One more theory divides left- and right-handed thinkers into two camps: visual simultaneous vs. linear sequential. According to this theory, right-handed people are thought to process information using a "linear sequential" method in which one thread must complete its processing before the next thread can be started. Left-handed persons are thought to process information using a "visual simultaneous" method in which several threads can be processed simultaneously. Another way to view this is such: Suppose there were one thousand pieces of popcorn and one of them was colored pink. The right-handed person — using the linear sequential processing style — would look at the popcorn one at a time until they encountered the pink one. The left-handed person would spread out the pieces of popcorn and visually look at all of them to find the one that was pink. A side effect of these differing styles of processing is that right handed persons need to complete one task before they can start the next. Left-handed people, by contrast, are capable and comfortable switching between tasks. This seems to suggest that left-handed people have an excellent ability to multi-task, and anecdotal evidence suggests that there are more creative stems due to this ability to multi-task.

Some of the causes of left-handedness according to various sources:

  • In 2007, researchers discovered LRRTM1, the first gene linked to increased odds of being left-handed. The researchers also claim that possessing this gene slightly raises the risk of psychotic mental illnesses such as schizophrenia.
  • Testosterone: Exposure to higher rates of testosterone before birth can lead to a left-handed child. This is the Geschwind theory, named after the neurologist who proposed it, Norman Geschwind. It suggests that variations in levels of testosterone during pregnancy shape the development of the fetal brain. Testosterone suppresses the growth of the left cerebral hemisphere and so more neurons migrate to the right hemisphere. The highly developed right hemisphere is now better suited to function as the center of language and handedness. The fetus is more likely to become left-handed, since the right hemisphere controls the left half of the body. The theory goes on to tie the exposure to higher levels of testosterone and the resultant right-hemisphere dominance to auto-immune disorders, learning disorders, dyslexia, and stuttering, as well as increased spatial ability.
  • Ultrasound theory: Ultrasound scans may affect the brain of unborn children, causing higher rates of left-handedness in mothers who have ultrasound scans compared to those who do not.

Tools and Left Handers

  • As most of the people on this planet are right handed, hence most of the tools are made for them only. So for a left handed person, it is become very difficult to use tool design for wrong hand. You can take example like, scissors, handles, Japanese knives, tools or even our own computer mouse.
  • Many of the left handed people have poor handwriting or they write slower than others. The pen could also be the reason for that.
  • Later designers have found this flaw and now creating for both kinds of people.

Left handers in Sports

  • In sports, most of the times being left handed are at advantage. In sports like boxing and fencing, most of the opponent will be right handed person and is trained to fight against right handed person only. So left handed person, who is trained to fight against right can easily defeat the opponent.
  • In boxing, someone who boxes left-handed is frequently referred to as southpaw. Most boxers, southpaw or otherwise, tend to train with sparring partners who adopt a right-handed stance, which gives southpaws an advantage.
  • Written rule in polo states that one must not hold a stick in his or her left arm. There are very few left-handed professionals in polo; all are required to use their right hand.
  • We can see many good left handed players in games like cricket or baseball.
  • In tennis, left-handers impart spin on the ball that is opposite of that which a right hander would hit. As a result, right-handed players (who are accustomed to playing right handers) have difficulty dealing with a left-hander's shots which curve in a direction opposite to what they are accustomed to facing. Rafael Nadal, despite being right-handed, plays left-handed tennis after being encouraged to do so by his coach for this very reason.
  • In sports like cricket, hockey, football, basket ball, baseball; being left handed person is advantageous.

Some of the famous people

Left-Handed U.S. Presidents

  • James A. Garfield (1831-1881) 20th
  • Herbert Hoover (1874-1964) 31st
  • Harry S. Truman (1884-1972) 33rd
  • Gerald Ford (1913- ) 38th
  • Ronald Reagan (1911 - ) 40th
  • George H.W. Bush (1924- ) 41st
  • Bill Clinton (1946- ) 42nd
  • Barack Obama (1961- ) 44th
Left-Handed Actors
  • Amitabh Bachchan
  • Charlie Chaplin
  • Tom Cruise
  • Angelina Jolie
  • Nicole Kidman
  • Sarah Jessica Parker
  • Julia Roberts
  • Slyvester Stallone
  • Bruce Willis
  • Oprah Winfrey
    Left-Handed Cricketers
    • Alan Border
    • Alistair Campbell
    • Denis Compton
    • Saurav Ganguly
    • David Gower
    • Gary Sobers
    Miscellaneous Left-Handers
    • Joan of Arc, French heroine
    • Alexander the Great
    • Julius Caesar, Roman general
    • NapolĂ©on Bonaparte, French emperor
    • Queen Victoria of England
    • King George II of England
    • King George VI of England
    • Prince Charles of England
    • Prince William of England
    • Fidel Castro, Cuban leader
    • Henry Ford, automobile manufacturer
    • Dwight F. Davis, founder of the Davis Cup in tennis
    • Helen Keller, advocate for the blind
    • John F. Kennedy, Jr., lawyer/publisher
    • Michelangelo, (artist)
    • Raphael, (artist)
    • Leonardo da Vinci (artist)

    The list is quite long. I am putting very few names here. For full list click here (external link)

    Last but not the least; August 13 is celebrated as International Left Handers Day.


    Please do write your comments here about this article or give suggestions if you have some. Thanks.

    Saturday, October 24, 2009

    What are the recordable DVD formats?

    This is an overview of the Recordable DVD formats for Set Top DVD Recorders and Computer DVD Burners; DVD-R, DVD-RW, DVD-RAM, DVD+R, DVD+RW.

    Answer: There are five recordable versions of DVD: DVD-R, DVD-RW, DVD+R, DVD+RW and DVD-RAM. DVD-R and DVD+R can record data once, like CD-R, whereas DVD-RAM, DVD-RW, and DVD+RW can be rewritten thousands of times, like CD-RW. DVD-RAM is a removable storage device for computers and video recording. It has become widely used in DVD video recorders because of the flexibility it provides in editing a recording. The other two recordable format types (DVD-R/RW and DVD+R/RW) are essentially in competition with each other. There are many claims that one or the other format is better, but they are actually very similar. Many manufacturers now offer Set Top DVD Recorders and DVD Burners that record in both "dash" and "plus" format. Below is a brief look at each format.

    DVD-R

    A write-once format that is compatible with many existing DVD Players, Recorders and DVD-ROM drives. Can only be used in DVD Recorders and Burners that support DVD-R recording or multi-format recording (drives that record "plus" or "dash"). Holds 4.7GB of data or video. Typically, it can hold 2 hours of MPEG-2 video on standard (SP) speed setting.

    DVD-RW

    DVD-RW is the re-writable version of DVD-R. It allows for approximately 1,000 re-writes before it is used up. In general, DVD-RW discs are slightly less compatible than DVD-R. Can only be used in DVD Recorders and Burners that support DVD-RW recording or multi-format recording (drives that record "plus" or "dash"). Also holds 4.7GB of data or video.

    DVD+R

    Another write-once recordable DVD format developed seperate from DVD-R. These discs are basically the same as DVD-R discs. They hold 4.7GB of data or video and are compatible with most DVD Players and DVD-ROM drives. They can only be used in DVD Recorders and Burners that support DVD+R or multi-format recorders.

    DVD+RW

    The re-writable version of DVD+R. It can record approximately 1,000 times. They also hold 4.7GB of data or video and must be used in DVD+RW compatible Recorders and Burners or multi-format recorders.

    DVD-RAM

    DVD-RAM comes in two varieties and storage capacities. These discs come in both cartridge and non-cartridge varieties and come single-sided or double-sided. Offered by only a few manufacturers (Panasonic, Toshiba and a few other minor ones), DVD-RAM is useful if used like a hard drive. Because it supports and incredible 100,000 re-writes, you can use the disc to record TV shows, view them and then re-write over them many times. Single sided discs hold 4.7GB, double-sided 9.4GB, allowing for longer recording times. DVD-RAM is the least compatible of the 5 recording formats, and is typically used for recording and playback in the same Set Top DVD Recorder.

    Final Thoughts When choosing a format to use, keep in mind that DVD-R/RW won't record in a DVD+R/RW recorder or burner, and vice-versa. This is not an issue when using a Multi-Format recorder or burner, and most DVD players and DVD-ROM drives will read either format.

    Saturday, August 29, 2009

    Is Chrome challenging to hackers ?

    This is pretty old incident but I guess worth noting down here...

    Let me share one of my experience with Google's chrome.

    I face unusual behaviour from my machine during internet access. It starts normally. Even internet connection and initial browsing happens properly. Suddenly Window's damn error comes out saying something wrong in the memory space. I ignore them all as I become habituated to them and at the end they are warnings !

    One day I realized that when I use firefox then only this error comes! Then I shift to IE but it doesn't go away. Then I tried to download anti-virus and planned to scan whole space but I am not able to download and scan. Even USB ports and CD-ROMs went off. Thats frustrating point.

    Till this time, I was not habituated to Chrome and even there were no shortcuts available anywhere. I searched it.

    I tried with chrome to download AVG. Surprisingly, it went through. I got tens of virus on that scan. I guess that virus is not treated well against Chrome algorithm otherwise I was just screwed-up and about to format as no option left...

    So, Best of luck to hackers, I have Chrome now!
    I used to surf with chrome for long time now and I am as usual fan of it.

    Powered By Blogger