W3C — World Wide Web Consortium
XML — Extensible Markup Language 可扩展标示语言
SGML — Standard Generalized Markup Language
SMTP — Simple Mail Transfer Protocol 简单邮件传输协议
TCP — Transmission Control Protocol
IP — Internet Protcol
Configuration of Eclipse and Tomcat
Posted at
6/23/2011 11:00:00 AM
1. Install Eclipse and Tomcat
Extract compressed files into your desired directories.
2. Create an Environment Variable JAVA_HOME for Tomcat if under Windows environment
Start --> Control Panel --> System --> Advanced --> Environment Variables
--> System Variables --> New :
name: JAVA_HOME
value: "Path to tomcat"
Extract compressed files into your desired directories.
2. Create an Environment Variable JAVA_HOME for Tomcat if under Windows environment
Start --> Control Panel --> System --> Advanced --> Environment Variables
--> System Variables --> New :
name: JAVA_HOME
value: "Path to tomcat"
[Java] Renaming a batch of files
Posted at
6/23/2011 09:41:00 AM
Due to some reason, the file names in my MP3 folder begin with two digits like this: 01 file.mp3. It is too tedious to rename them one by one since there are too many (hundreds of them). So I wrote a small program to remove the digits :) .
Block Cellphone Spam Text Message
Posted at
4/29/2011 09:15:00 PM
It's really bothering to receive spam text messages on cell phone. I got four today!
Here is an article telling you how to block spams.
http://pogue.blogs.nytimes.com/2008/06/12/how-to-block-cellphone-spam/
Hope it works.
Here is an article telling you how to block spams.
http://pogue.blogs.nytimes.com/2008/06/12/how-to-block-cellphone-spam/
Hope it works.
Canon D420 Printer Issue on Ubuntu 11.04
Posted at
4/04/2011 02:49:00 PM
After installing Ubuntu 11.04Beta, the Canon D420 printer driver can't be installed because it depends on gs-esp which is not supported in the new environment. So here is an alternative way to install the driver.
Download the driver from here.
Extract it and go to its RPM foder.
Install alien which allows you to install rpm file on Debian/Ubuntu:
Download the driver from here.
Extract it and go to its RPM foder.
Install alien which allows you to install rpm file on Debian/Ubuntu:
sudo apt-get install alien dpkg-dev debhelper build-essential
Finding maximum
Posted at
2/14/2011 11:57:00 AM
/* Finding max number in an integer array
using recursive method.
*/
using recursive method.
*/
Josephus Problem
Posted at
2/12/2011 06:21:00 PM
/*
Josephus Problem
N people have decided to elect a leader by arranging themselves in a
circle and eliminating every M th person around the circle, closing
ranks as each person drops out. The problem is to find out which person
will be the last one remaining ( a mathematically inclined potential
leader will figure out ahead of time which position in the circle to take).
From Algorithms in C++.
*/
Josephus Problem
N people have decided to elect a leader by arranging themselves in a
circle and eliminating every M th person around the circle, closing
ranks as each person drops out. The problem is to find out which person
will be the last one remaining ( a mathematically inclined potential
leader will figure out ahead of time which position in the circle to take).
From Algorithms in C++.
*/
Connectivity Problem
Posted at
2/12/2011 10:11:00 AM
/*
This program reads a sequence of pairs of nonnegative integers less than N from standard input (interpreting the pair p q to mean "connect object p to object q") and prints out pairs
representing objects that are not yet connected. It maintains an array id that has an entry for each object, with the property that id[p] and id[q] are equal if and only if p and q are connected. For simplicity, we define N as a compile-time constant. Alternatively, we could take it from the input and allocate the id array
dynamically.From Algorithms in C++
*/
This program reads a sequence of pairs of nonnegative integers less than N from standard input (interpreting the pair p q to mean "connect object p to object q") and prints out pairs
representing objects that are not yet connected. It maintains an array id that has an entry for each object, with the property that id[p] and id[q] are equal if and only if p and q are connected. For simplicity, we define N as a compile-time constant. Alternatively, we could take it from the input and allocate the id array
dynamically.From Algorithms in C++
*/
Output of char * Variable
Posted at
9/07/2010 02:10:00 PM
(from http)
A character string is of type char *. Suppose we want to print the value of that pointer,i.e., the memory address of the first
character of that string. But the << operator has been overloaded to print data of type char* as a null-terminated string.
The solution is to cast the pointer to void * (this should be done to any pointer variable the programmer wishes to output as an address.)
A character string is of type char *. Suppose we want to print the value of that pointer,i.e., the memory address of the first
character of that string. But the << operator has been overloaded to print data of type char* as a null-terminated string.
The solution is to cast the pointer to void * (this should be done to any pointer variable the programmer wishes to output as an address.)
Subscribe to:
Posts (Atom)
