All entries for Thursday 05 August 2004

August 05, 2004

A greate feature of Yahoo! Tools

Yahoo! provide a tools IntelliSync. It can be used to synchrnonize Yahoo! address, notepad, calendar with outlook address, note, and calendar.

It is really usefull for me to sync my address books.
Great !!!!...........


Junit Test suite

in a class,create a method called:
public static junit.framework.Test suite(){
TestSuite suite = new TestSuite('Test for upload');
//$JUnit-BEGIN$
suite.addTest(new TestSuite(HtmlFileUploaderTest.class));
suite.addTest(new TestSuite(NonHtmlFileUploaderTest.class));
suite.addTest(new TestSuite(UploaderValidationTests.class));
suite.addTest(new TestSuite(CreateNewTest.class));
//$JUnit-END$
return suite;
}

A TestSuite can extract the tests to be run automatically. To do so you pass the class of your TestCase class to the TestSuite constructor( like: new TestSuite(HtmlFileUploaderTest.class) etc.)

suite is the entry point of program, just like main()

in each class,extends junit.framework.TestCase and let each test method start with testXXXX() and optionally use setUp() and tearDown()


The Element of Java Style

1. Do not try to short the name by removing vowels.using Message instead of Msg

using appendSignature instead of appndSgntr and Captitalize only the first letter in acronyms. i.e. change loadXMLDocument() to loadXmlDocument()

2. using the following format for java doc comment.

/** * */ use tell HTML browser to render content in different style. "
" tell HTML browser retain the original format.
3.use block synchronization instead of method sychornization if possible.
4.varible and method name start with low case.
5.use uppercase letter for each word and separate each pair of words with an underscore when naming constnats: MAX_VALUE
6.break 
 double lenght=Math.sqrt(Math.pow(x,20),Math.pow(y,20));(if too long)
 into
 double length=Math.sqrt(Math.pow(x,20),
                         Math.pow(y,20))

	

and do like the following:

return this==object || (this.obj instance of MyClass && this.field== obj.field);

7.using equals , not == to test the equality of objects.

8.For Comment elemnt,
for class,method, field you have @Description @see @since @deprecated all.
for class, you also have @author @version
for method, you also have @param @return @exception


important days

31/10 Halloween
01/11 hallowmas
06/11 bonfire

Set up printer

Set up printer

add compenent in control panel for LPR port type.
then set
printer.warwick.ac.uk:wwits02ps HP LaserJet 5000 Series PS
printer.warwick.ac.uk:wwits01ps HP Color LaserJet 4550


whereis

/usr/ucb/whereis

putty setup

1. Generate your keys;

run puttygen along the bottom select ssh2 dsa and then click on generate, follow the instructions, do not type in a passphrase if you do not want to input password every time. and then save the public & private keys.

2. Copy your public key into your unix home directory:

You need to set up ssh2 for your unix code 1st, run ssh-keygen2 when logged into unix. When it's done, cd into ~/.ssh2 (and if interested, do an ls -l, this where the key went). FTP your putty public key to here, call it something like public-putty-key.pub Edit the authorization file add the new line: Key public-putty-key.pub

3. Use putty;

Select Session and select SSH, type in hawker at the hostname box (at this point if you go to the saved session box, give it a name like hawker & select save you can retrieve these settings next time). select Connection, in the auto-login username type your username. select Connection/ SSH, click on SSH protocol version 2. select Connection/ SSH/Auth, give it the location where private key is. Click on Open when you are ready. The first time you use it you will get a prompt about the server's key not being saved & do you trust it, select yes, this won't happen again.

Find out shell

echo $SHELL

/bin/sh (Bourne shell)

/etc/profile
$HOME/.profile

/usr/local/bin/bash (Bourne-Again SHell)
/etc/profile
$HOME/.bash_profile
$HOME/.bash_histroy
$HOME/.bashrc(interactive) (that mean when you type in bash to change the shell, the .bashrc file will be executeed, the old enviroment still exist. very useful!)
$HOME/.profile (if .bash_profile not found)
.bash_logout


Group and Find command

find $ARCHLOGDEST/* -mtime +1 -exec /bin/rm -f {} \; 1>/dev/null 2>&1

find out in a group, how many user:

/etc/group

find out a user belong to which group:


Dsplay x window in local machine

display x window in local machine

1) if using KDE, change /etc/kde2/kdm/xservers file
2) in local machine, using xhost +
3) in source machine, using export DISPLAY=name:0


Ftp Access

allow ftp access: add your shell into /etc/shells

Search this blog

Search Warwick Blogs

 

Tags

Most recent comments

  • Oracle 11g is the clear leader in this area. Oracle has invested heavily into self–tuning capabiliti… by shaane on this entry
  • All the features are very nice.I like Repair Advisors the most.Oracle 10G introduced some of the dat… by lucy on this entry
  • "logical standby failed to re–start, I am also getting the same error. I have search on internet and… by anemia on this entry
  • Thanks for the nice information because from last three days i am stuck on this problem…. by robot vacuum on this entry
  • So what happen City speed dating when you tried this coding once in your PC.. Please tell me so i am… by John Bergeron on this entry
Not signed in
Sign in

Powered by BlogBuilder
© MMXXII