Wednesday, March 12, 2008

VIM-Text Editor

Vim's manual:
http://vimdoc.sourceforge.net/htmldoc/usr_toc.html
Vim Mode
http://vimdoc.sourceforge.net/htmldoc/intro.html#vim-modes-intro
Vim quick reference Card
http://tnerual.eriogerg.free.fr/vimqrc.html
Linux Gym 2
Q1 :Insert text
Within your "ch2-vim" directory, create a file called "hw.txt", with only one line of text saying: "hello world" (without the quotes) and save the file.

1. Starting Vim

From the command line you can start editing a file called "test.txt" (whether the file "test.txt" exists or not) with the command:
vim test.txt

2. Switching Modes

There are eleven types of mode when running Vim, but they can be categorised as two types: normal modes and insert modes.

Normal mode: When you start Vim you will be in normal mode, and at any time you can return to the normal mode by pressing the key at the top left-hand side of your keyboard.

Insert mode: There are many ways to enter the insert mode, but the simplest is to type i. After typing i all the characters you type will be inserted into the docuement.

3. Exiting Vim

To exit Vim and return to the command-line:

  1. Go to normal mode by typing
  2. Save and Exit: type :wq which stands for "write and quit".
  3. Exit without saving: typing :q! returns to the command-line without saving the changes you have made to the file
Q2:Join lines
Copy the file "/usr/local/linuxgym-data/vimdata/wordlist.txt" into your "ch2-vim" directory. Edit the file so that all of the text is on a single line with only a space (not a newline) between the words.

A: cp /usr/local/linuxgym-data/vimdata/wordlist.txt .
or
cp /usr/local/linuxgym-data/vimdata/wordlist.txt ./

Don't forget the dot
. at the end. Remember, in UNIX, the dot means the current directory.
Q4:
Deletion by line numbers
Copy the file "/usr/local/linuxgym-data/gutenberg/0ws3110.txt" into your "ch2-vim" directory. Starting at line 50 delete 4000 lines (including line 50) - and save the file. Make absolutely no other changes.
A :
Move to 50 line
then press "4000dd"
Q5:
Cut and paste by line numbers
Copy the file "/usr/local/linuxgym-data/teeny/3mwsm10.txt" into your "ch2-vim" directory. Delete the first 10 lines and append them to the end of the file. Save the file and make no other changes.
A:
delete first 10 lines --> press : 10dd
move to the end of the text ,press : p
Q:Search and replace strings
In the next two questions we have to distinguish between words and strings. A string is a sequence of characters, while a word is a sequence of letters within a string, surrounded by non-word characters. For example, the string "This is a testing time" contains the words "This", "is", "a", "testing" and "time". It does not contain the word "test", but it does contain the string "test".

Copy the file "/usr/local/linuxgym-data/vimdata/hermit.txt" into your "ch2-vim" directory. Replace every occurence of the string "and" with the string "OR". Ensure you make

A
Press
:%s/and/OR/gc -->Confirm every substitution.

Q9:Cut and paste by markers
Copy the file "/usr/local/linuxgym-data/teeny/4mwsm10.txt" into your "ch2-vim" directory. Cut (remove) the lines between (and containing) those with "START HERE" and "UPTO HERE" and insert them at the marker "PASTE HERE". Save the file and make no other changes
A:
Type ':11,64d'

Then 'Paste'--->Shift P



:e![cr] says "I made a right mess of that - abandon my changes and re-read the input file

Sunday, March 9, 2008

Reflect on the second week of Uni

Second week seems going to fast .So Im now in the third week and begin preparation for this week .
Last week, I mentioned abt finding an effective way for uni .Here are some new ideas :
1) Review the lesson on the same day I have lecture .
2) On Monday and Tuesday ,I 'll begin studying the subjects which are taught on Friday first and then on Wednesday , Thursday .
3) and I can do more research during the time I am studying.
Some things needed in my schedule that are sporting time eg.play basketball ,reading time which can be taken place in Park on Weekend , visit Museum.
English :
-How to be a critical thinker
-Writing in field of Science
-Watching TV program to study English as well

ONE MORE IMPORTANT THING : LEARNING AUSTRALIAN CULTURE

Wednesday, March 5, 2008

Research Group

Eddie :
edward.o.chan@student.uts.edu.au
04162448651
Andrea :
andrea_santos90@hotmail.com
0415 911 805
Aninda:
a_das90@hotmail.com
0432 661 518
Ninad :
Ninad_sd1@hotmail.com
0432 737 880

Tuesday, March 4, 2008

Question Arised

1) What languages are used to write Microsoft Window ?


2 )How did they create Unix by C language ?

Sunday, March 2, 2008

Reflect on the first week of Uni

Setting a new schedule for next week ,it could be another busy week.
So what I did last week were getting to know things in Uni .Tried to get acquainted with my flatmate .No too bad,however ,there are some problems which are not to speak as much with them and not feel confident .A major reason is bad pronunciation leading to difficulties for them .-->Need to be improved by Flatmate program of BBC .No worry abt incorrect speaking .Try to speak as much .And especially,don't be shy .

About studying in first week seem good .Goal for next week is still choosing the most effective ways to study .Concentrate on subjects ,and make sure of not sidetracking .1 more goal is , get information and set schedule for finishing first assignment od every subjects .

Writing notes of the subjects which I've studied in the afternoon or morning.By that I can review what I've studied on the day and those notes become references for final exams.

That 's for this week .
See u next week !