Saturday, November 27

Hi 5?

I sent out some Gmail invitations and Wallop invitations and Huminity invitations, and now I got invited into Hi 5 too. There're too many SNS(Social Network Service)s right now, and I'm sick of it. Actually, I didn't answer the invitation of Hi 5, and I quitted the Huminity. They are good societies, but you can't just stay on-line all day long to make friends in the Virual Network, you got to go out and play soccer sometimes.

Thursday, November 25

阳春白雪

(White Snow in Early Spring)

Wednesday, November 24

Yesterday I decided to install LateX and start to use it.

Then I found, no one wants to make it clear how to download/use it. Most websites give a link to http://www.ctan.org, the Comprehensive TeX Archive Network, then you can click some link to see some files, some ftp directory, some mirrors of those files, and some links will lead you back to the CTAN again.

In blog world, people keep talking about blog/RSS/Blogroll/WIKI/flickr, but actually no one knows what they're talking, and they don't want you to know either.

Then I went back to http://www.latex-project.org/, the official LaTeX project website, and followed the links to http://www.fptex.org/fptexli2.html, because I'm using Windows system. Gees, the method to download the program is toooo Unix:
run getfptex.bat in DOS console. It took me 3 hours to download 460M bytes files.
Then you downloaded it, then you run a "TeXSetup.exe" . Is that all? No!

But it is still not clear how to use it.

Follow those links in Google, I was induced to install WinEdt before I found it was ONLY an editor, so I uninstalled it, went back to my favorite editor: EditPlus.

To make the long story short, I only tell you how to make a "Hello Word" in LaTeX:

In any editor, create a txt file with this:

\documentclass[a4paper,12pt]{article}
\begin{document}

Hello World!
$$\sum_{p\rm\;prime}f(p) = \int_{t>1}f(t)d\pi(t).$$

\end{document}

then go to DOS Commend Console, go to the folder where you saved your file and type in

latex filename.txt

LaTeX.exe is supposed to be in your path after you install those 460M files. So in the same folder it will create a filename.DVI, which can be read by the "DVI Viewer" from the Start Menu:

(The LaTeX source of beautiful equation is copied from http://learn.tsinghua.edu.cn/homepage/2001315450/tex_frame.html, a pretty good LaTeX tutorial in Chinese Language)

But I'm waiting to see the PDF, not DVI... What a mess!

 It might be easier to use Winedt (a software) to edit .tex files. You need to download MiTex before installing Winedt. If interested to learn what they are, google will give you answers.. Good luck! # posted by  vieplivee : November 26, 2004 5:35 AM
 Thank you, vv. I installed WinEdt before TeX, so I don't see anything new from this editor. After I read your comment, I installed it again, and I found it's useful. It's a hybrid software between Unix and Windows... It's not WYSIWYG software like Windows, but it's not commend line software either.Thanks for your recommendation. # posted by  Ben : November 28, 2004 8:52 AM

Friday, November 19

My answer for the Prime Ring

// Problem A: Prime Ring

#include 〈 stdio.h>
#include 〈 math.h>
int ring[16];
int m;

bool NotInRing(int iPos, int iNum)
{
int i;
for(i=0; i〈 iPos; i++){
if (iNum == ring[i]){
return false;
}
}
return true;
}

int GetNumber(int iPos, int iNumber)
{
int i;
for(i=iNumber+1; i〈 =m; i++){
if (NotInRing(iPos, i))
return i;
}
return 0;

}

bool IsPrime(int iNum)
{
int i;
for (i=2; i〈 =sqrt((double)iNum); i++) //sqr/sqrt
{
if (iNum == ((int)iNum/i)*i)		// (inum%i == 0)
return false;
}
return true;
}

bool FindNumber(int iPos)
{
int iNumberTwo, iTotal;
if(iPos〈 1)
return false;

if (iPos == m)
{
iTotal = ring[iPos-1] + ring[0];
if (IsPrime(iTotal))
{
for(int j=0; j〈 m; j++){
printf("%d ", ring[j]);
}
printf("\n");
return true;
}
else
return false;
}

iNumberTwo = GetNumber(iPos, 0);
while(iNumberTwo != 0){
ring[iPos] = iNumberTwo;
iTotal = ring[iPos]+ring[iPos-1];
if (IsPrime(iTotal)){

//      printf("Now in %d, try %d, and %d is prime\n", iPos, ring[iPos], iTotal);
//   for(int i=0; i〈 =iPos; i++)
//   printf("%d ", ring[i]);
//   printf("\n\n");

if (FindNumber(iPos+1) == true){
// iPos --;
}
}
iNumberTwo = GetNumber(iPos, iNumberTwo);
}
return false;
}

main()
{
int  i, j, k;
//  int ring[16];
ring[0] = 1;

while (scanf("%d", &m)){
if (m == 0)
break;

//      printf("Get %d\n", m);
if (FindNumber(1) == true)
{
for(j=0; j〈 m; j++){
printf("%d ", ring[j]);
}
printf("\n");
}
}// end while.
}


Labels: ,

Thursday, November 18

Gmail Invitation

I have 5 gmail invitations left. Anyone wants to get one can send email to me:
BenInCampus AT gmail

Happy gooooogling!

btw: If you want to try wallop, you can also send email to me. I got it from Keso, and I found it's pretty cool. You can share music, picture, and blog. It's better than the Huminity. It will be more powerful if the MSN is integrated, which I think it will be.

But the wallop is NOT Mozilla-friendly. I can't upload my picture from Mozilla 1.4.2 / Redhat 9.
Also, this flash website used up my 100% CPU time, in Windows and in Redhat.

 on linux, flash support is not as good as in IE. in firefox on my lab computer with debian, everything is cool and smooth. in my laptop in home with debian, text does not show at all.its interface is supercool although it is not stronger the google's orkut so far.anyway, if you still have more invitation, i'd like you can send me one.PS: welcome to My Blog (li zhao) # posted by  Li-Zhao 李钊 : November 19, 2004 1:58 AM
 forgot, my email is lizhao.ok(at)gmail.com # posted by  Li-Zhao 李钊 : November 19, 2004 2:03 AM
 I wonder if you're asking for Gmail invitation or Wallop invitation, then I saw you're already using your gmail account, so I sent a Wallop invitation to you :) # posted by  Ben : November 21, 2004 8:52 AM
 Hello! I'm form Hong Kong ,On the Web, Most of the people talk with wallop ,I also want to see how strong with ths and the new technology of microsoft!There's my E-mail: stephenyuen1@hotmail.comThank you for your attention. # posted by  Stephen Yuen : December 24, 2004 10:50 PM
 Hi there,Do you have any invites left? I'd love to try Wallop!my email address is acidophilus [at] gmail [dot] comThank you! # posted by  Anonymous : January 27, 2005 2:10 PM
 Invitation sent. # posted by  Ben : January 28, 2005 4:26 PM
 hi i would like 2 have ainvitation 4 a gmail account iwill be very grateful 2 u if any one can provide me with it.neufneuf1982@yahoo.fr # posted by  Anonymous : August 08, 2005 9:28 AM
 Hi Ben I'm interested of getting Gmail do you still have an invitation that you could send me. Thanks Dan Email: parkplace@sharpsav.com # posted by  Anonymous : October 21, 2005 8:44 AM

Tuesday, November 16

This year my team ranked 38 out of 131 in the 2004 ACM East Central North AmericaRegional Programming Contest. This competition is funded by IBM, and the winner will go to the 2005 ACM Final in Shanghai. There're 72 colleges and universities throughout western Pennsylvania, Ohio, Michigan, eastern Ontario, and Indiana (excluding the Greater Chicago Metropolitan Area) in this competition.

You can read the problem set I met in this competition. Usually the problems are easy to understand, but hard to solve. For example, Prime Ring is a classic ACM problem:

Prime Ring Problem

A ring is composed of n (even number) circles as shown in diagram. Put natural numbers 1, 2, ..., n into each circle separately, and the sum of numbers in two adjacent circles should be a prime.

Note: the number of first circle should always be 1.

Input
n (1 -- 16)

Output
The output format is shown as sample below. Each row represents a series of circle numbers in the ring beginning from 1 clockwisely and anticlockwisely. The order of numbers must satisfy the above requirements.

You are to write a program that completes above process.

Sample Input

6
8

Sample Output

Case 1:
1 4 3 2 5 6
1 6 5 2 3 4

Case 2:
1 2 3 8 5 6 7 4
1 2 5 8 3 4 7 6
1 4 7 6 5 8 3 2
1 6 7 4 3 8 5 2

There're 8 problems in the competition, and you have 5 hours to work on them. You can use C, C++ or JAVA to solve the problems. Usually the source code of the answer is NO longer than 2 pages. You can visit a PROBLEM SET ARCHIVE at http://online-judge.uva.es/problemset/ and you can even submit your answer, and get feedback from the judges.

Every year Dr. Kobti organizes 2 seminars, in March and in September. In October, there'll be a Local Contest, and the first 2 teams can go to Oakvill for the Region Competition. If any of you are interested in the contest, you can find 2 friends and start working on it now.

Labels: ,

 Congratulations! Ben # posted by  ALBERT LUO : November 27, 2004 6:51 AM
 Thanks, Albert. When will you build your blog? # posted by  Ben : November 28, 2004 8:54 AM

Wednesday, November 10

愚民政策

---中国教育和科研计算机网管理委员会副主任 李志民

Tuesday, November 9

keso: 你联结中有一个数字部落的"IBM linux奖赛", 里面提:
IBM举办了一个Linux知识大奖赛，参加者解决IBM在利用Linux时遇到的29个挑战。

Labels: ,

Sunday, November 7

The Forgotten

Friday afternoon, I went to watch movie "The Forgotten" with Eugene in Cineplex of Square One, Mississauga.

From the posting, we thought that's a scary movie. In the posting, a woman is looking forward so hopeless, with shadows of other people. "Everything you experienced never happened".
At the beginning, Telly was thinking of her 10-year old son. From an old news paper, we now know that her son was killed in an accident 1 year ago. She watched his happy video, read the photos. Her husband and her psychology doctor gave her advice to stop thinking of him, face the fact that the child is gone forever. Everything is so normal, so I told Eugene: Maybe this is only a family-movie, not a scare-movie.

Then something happened. She refused to forget her son, but one day her son's image was erased from the photos, and the video tapes were blank, and she even couldn't find the accident from newspaper in library. People told her that her son was never existed, she created that image because she thought of that too much.

She ran away from her family. She went to a drunk man(Ash)'s house because she sent her son to meet Ash's daughter who was also killed in that accident. But Ash couldn't remember his daughter either, and he called the police.

When the policemen got Telly, two NSA agents came over and said they took care of her case. At the same time, Ash walked into his daughter's room, suddenly something hit him, he remembered everything. He went after the NSA agents and saved Telly, then they ran in the city. Car-chashing, boxing, running... Now it turns into an action-movie.

Finally, it IS an alien-movie. Some outspace-aliens didn't believe the connection between mother and child, so they and NSA created the accident and erased the memory of other people, waiting Telly to forget her son. But the connection was so strong, that Telly couldn't forget him forever, so those aliens had to admit their failures and turned everything over. Telly got her son back. (Bullshit)

Thursday, November 4

Bush, Phishing

Anyway, Bush won the election.

I learned this word "phishing" yesterday. Last week in "Hacking--do the pros now rule?" of CNet, Robert Graham said:
It's not so much that they get paid to hack, but that they earn money from hacking. Take phishing attacks: It's usually the people who are running the attacks themselves that are earning money; no one is paying them to do it.

I followed the link of phishing but found it's too complicate, so I was confused.
Yesterday watching CTV I heard this word, then I totally understood. If I read it lound, I should have found out it was respell from "fishing". My blog "Spoof email trying to steal money" on Oct, 18 descriped what was phishing already.

According to Colloquialisms Dictionary of Babylon, this term has been known in the hacker culture since about 1996, but it has only hit the headlines in the mainstream press since about July, 2003. Anti-Phishing Working Group gives an astonished number:
By hijacking the trusted brands of well-known banks, online retailers and credit card companies, phishers are able to convince up to 5% of recipients to respond to them.

Yes, that kind of email is convincing.

The Anti-Phishing Working Group encourage people to report phishing email to build a Phishing Achieve, so I sent my 2 phishing emails. It's good to know that somebody is working on it.

Labels:

Wednesday, November 3

Kerry, Uncompresser, and English training

Who will be the winner? Kerry? Bush?

A report said Kerry was more ambiguous than Bush. Kerry is a politician, and Bush is a cow boy. The point is: Is a politician better than a cow boy?

For me, I don't like Bush. He is keen on religion, so he doesn't like science much. Most people in Information Technology industry like Bill Clinton because he made some good decisions to promote the Internet, and it turns out the Internet is a big success. So I think they might vote Kerry this time.

This morning I got up and remembered the assignment 2 of 60-141. Yesterday many students asked questions of it in my office hour. Why don't I make a Flash to show the animation? It is a question in 1995's ACM Scholastic Programming Contest Finals. So I spent 1 hour to create uncompress Flash.

Yesterday I dig out an old software I made 2 years ago. I'm not so good at English Numbers, so I created this software to train myself. Click the button, the program will create 7 random numbers and speak out loud; then I must follow the numbers quickly. It helps for me, and it might help others too. One problem is: The software is created using Microsoft Speech SDK, so if the client's computer don't have that, it won't work. I should make a package including the SDK, then it will be at least 5M to download... :(

Anyway, let's see who's interested.

Tuesday, November 2

Quote: P=NP? Knuth said:

(1995)

P=NP is the most famous unsolved problem in computer science, analogous to Fermat's Last Theorem, although the P=NP problem has only been around for about 30 years, 25 maybe. In the context of combinatorial algorithms, it says: Are we going to be able to solve problems that would require going through 2^n cases? Can we actually do those in n^10, or something like that, if we knew the best method? if P=NP, the answer would be "yes", with some polynomial: we could reduce all these exponential problems to polynomial problems. If not, the answer is "no", we'll never to able to reduce them.

I have a feeling that someone might resolve the problem in the worst possible way, which is that following. Somebody will prove that P is equal to NP because there are only finitely many obstructions to it not being equal to NP. [laughter] The result would be that there is some polynomial such that we could solve all NP problems in polynomial time. However, we won't know what the polynomial is; we'll just know that it exists. So maybe the complexity will be n to the trillionth or something like that --- but it'll be a polynomial. In such a scenario we'll never be able to figure it out because it would probably take too long to find out what the polynomial is. But it might exist. Which means that the whole question P=NP was the wrong question![laughter] It might go that way. You see, even if you have a method that takes 2^n steps and you compare it to a method that takes n^100, then at least you can use the 2^n one for n up to 20 or 30. But the n^100 you can't even do for n=2. So the degree of that polynomial is very important. There are so many algorithms out there, the task of showing that no polynomial algorithms exist is going to be very hard. Still, I really thought that Fermat's Theorem was a similar kind of thing, where it was more important to have the problem than to solve it. Therefore, my real feeling about Wiles's Theorem is that he did a marvelous wonderful piece of work, but I wish he'd solved something else! [laughter]

A lot of people think that as soon as a problem is shown to be in this class NP, they shouldn't work on it, because it means that there's probably no polynomial way to solve the problem. But before we studied NP, we had unsolvable problems --- problems for which there didn't exist any algorithms at all. No matter how long you worked, you could never solve the problem. To tell whether a given Turing machine ever stops: This problem is unsolvable by any algorithm, in general, no matter how long you give yourself. In the days before NP became famous, people would stop working on a problem as soon as it was proved to be unsolvable in general. But that was a bad strategy, because almost every problem we ever solve is a special case of some unsolvable problem.

Take calculus, for example --- the problem of taking a formula, a function of n, and saying: "Is the limit as n goes to infinity equal to zero or not?" That's an unsolvable problem. But its unsolvability doesn't imply that we shouldn't study calculus. I mean, limits of lots of useful functions do go to zero, and therefore people were able to develop calculus. But the general problem is unsolvable. I mean, you could define f of n --- it only takes a few lines to make a formula that is equal to zero if a given Turing machine is stopped at time n, and it's equal to 1 if the Turing machine is still going at time n. And so the limit is equal to zero if and only if that Turing machine stops. It's unsolvable.

A similar thing happens with NP. That is, we have lots of special cases of problems that are NP-hard that we can solve efficiently; just knowing that something is NP doesn't mean that it's a good idea to give up on it or to stop trying to get good heuristic methods for it.

Labels: ,