Friday, November 16, 2007

Sophy


Sophy
Originally uploaded by StarGirl714
Isn't my girl lovely?

Tuesday, October 16, 2007

I am back

In fact, Blogger is back in China.

Saturday, October 13, 2007

Don't use directly the sample code in your real life project

most sample code doesn't handle error, the simply show you how to use a function.
of course they use their functions correctly, but they may need others' functions to make their functions run. Here is the problem, they may not use others right.

Saturday, September 22, 2007

One Anti-Piracy System to Rule Them All

September 21, 2007, 4:31 pm
One Anti-Piracy System to Rule Them All

By Brad Stone

Tags: Audible Magic, digital fingerprinting, MPAA, vobile

Hollywood appears to have a preliminary winner in its bake-off of anti-piracy technologies.

For the last year, the film industry, through its Palo Alto-based R&D joint venture MovieLabs, has been testing a dozen so-called “digital fingerprinting” technologies. The technology purports to scan file sharing sites, Internet providers and peer-to-peer networks to identify copyrighted material.
fingerprinting technologies“Fingerprinting Performance” (Leonard Kleinrock, 2007)

Yesterday in Los Angeles, people affiliated with the Motion Picture Association of America talked about the ongoing tests at a day-long anti-piracy workshop that the MPAA co-hosted with the University of California. In his introductory keynote at the event, UCLA professor and Internet pioneer Leonard Kleinrock showed a single slide that suggested that one of the anti-piracy filtering companies had outperformed the other 11, with the highest number of matches of infringing content and lowest number of false-positives. But professor Kleinrock and MPAA execs declined to name the participating companies or who had scored best on the test, saying that secrecy was a precondition for their participation in the tests.

Nevertheless, afterwards, executives from Santa Clara, Calif-based Vobile were crowing in the hallways of the Universal Hilton Hotel.

The two-year old company’s technology, called Video DNA, has apparently bested others from the Royal Philips Electronics, Thomson Software & Technology, and the highest profile digital fingerprinting company, the Los Gatos, Calif.-based Audible Magic, which has deals to filter video sharing sites like YouTube and Microsoft’s Soapbox.

The MPAA told Business Week in the spring that Vobile was doing “very well” on the tests.

Movie Labs stress-tested the anti-piracy systems by loading hundreds of hours of copyrighted video content into the databases of the various filters, and then by flooding them with thousands of video files, some distorted, darkened and cropped, to try to scuttle their ability to find matches.

In the next phase of the ongoing tests, MovieLabs will see if the systems can handle ever larger quantities of copyrighted works. Theoretically, adding more songs, TV shows and movies in their databases could slow down these systems—and the Internet video sites that use them— since it could take longer to find possible matches.

MovieLabs has been sharing tests results with its member movie studios since the summer. MovieLabs chief executive Steve Weinstein says the technology is ready for prime time. “In a year you’re going to see many Internet companies using it. This technology has shown its viability.”

* Link
* E-mail this

*
*

* Internet, Music and Video, Audible Magic, digital fingerprinting, MPAA, vobile

Sunday, August 12, 2007

is the rumer ture? Google will use flash to cross platform

Google is going to occupy all OS platform by flash? It doesn't need its own operating system to compete with Microsoft / MacOS / Linux. But with flash, its software can run every where, also in mobile phone!

I just saw gtalk in flash..

Wednesday, July 25, 2007

what I did last year?

C code : 13000 lines
Java code : 8000 lines

for the last week...I wrote 4000 lines C++!! and more work are coming.

Wednesday, July 18, 2007

don't abuse OS's cache

I was writing a simple program, open a file, read the data. Each data structure is n bytes.
At first, I read it once a block (n bytes). I think it is fastest, because when I read the first block, OS should cache the whole page ( i.e. 4K) for future use. So when I fetch the next block, it doesn't need to load from hard-disk.
But when I change the reading method, each time reads 4K in to buffer, then separate from buffer, the speed boost up like 10 times.
Why? I think the reason lies in when you ask OS to load data, it will invoke system call, then Interrupt, and the OS copy the data from kernel mode to user mode for your use. This also cost time.

Tuesday, July 17, 2007

direction of computing

Moshe Bar, openMosix founder and project leader, also engage Xen, KVM, has decided to close openMosix, and focus on single machine's computing.

Hmm, I have loved both three technology, was hoping openMosix can turn hundreds of old machine into a super power computer.

But now, hardware development out weight the software. multi-cpu, multi-core has gained more attention. I hope this can give us unlimited computing power.

here is the announce:
link: http://sourceforge.net/forum/forum.php?forum_id=715406

Posted By: bruceknox
Date: 2007-07-15 09:35
Summary: openMosix Project End of Life Announcement

Tel Aviv (July 15, 2007) - openMosix Project Ending

Moshe Bar, openMosix founder and project leader, has announced plans to end the openMosix Project effective March 1, 2008.

The increasing power and availability of low cost multi-core processors is rapidly making single-system image (SSI) Clustering less of a factor in computing. The direction of computing is clear and key developers are moving into newer virtualization approaches and other projects.

openMosix has been a very successful project with tens of thousands of installations. Another measure of this success is found in the many projects that have incorporated openMosix into their own products.

openMosix’ Auto-Discovery innovation paved the way for the Instant SSI Clusters that soon exploded the number of cluster installations. Instant Clusters made installation and setup automatic for the non-computer specialist and for the first time brought significant computing power to many researchers worldwide.

openMosix also broke new ground in Operating Systems theory including important lessons learned in Distributed Shared Memory and other challenging areas. Many individuals have learned Linux kernel development through openMosix which has been used in computing curriculum, laboratories, and research.

openMosix source will remain on SourceForge indefinitely, frozen as of March 1st, 2008. The openMosix website will remain open until March 1st, 2008 and the openMosix-Devel List will close as of December 1, 2007.

Moshe Bar stated that, “I wish to thank all the users and developers who enthusiastically supported openMosix and made the project such a success.”

Project website is http://www.openmosix.org/

openMosix is a Linux kernel extension for single-system image (SSI) clustering that allows building a cluster from ordinary networked computers. Applications benefit without modification specifically for openMosix.

auto generate code using UML

hum, finally feel why drawing UML is helpful. since it can generate code (the dumpy and duplicate part), release programmer's work. And you have a cool drawing and deep thought before coding. :)

ps: I use open source tool dia to draw UML, and it can generate code. or use dia2code.

Sunday, July 15, 2007

automatic test for http interface

Ha~ I wrote a AJAX web page last night, which will run several cases, each post different data to my fcgi program, and check the return value, then output PASS or FAIL. And a simple synchronize for separate running tests.
That make QA life easier.

here is my page:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf8" />

<title>login test</title>

</head>



<body>

<script type="text/javascript" language="javascript">

var http_request = false;

var output = null;

var expect = null;

var pass_out = null;

function makePOSTRequest(url, parameters) {

http_request = false;

if (window.XMLHttpRequest) { // Mozilla, Safari,...

http_request = new XMLHttpRequest();

if (http_request.overrideMimeType) {

// set type accordingly to anticipated content type

//http_request.overrideMimeType('text/xml');

http_request.overrideMimeType('text/html');

}

} else if (window.ActiveXObject) { // IE

try {

http_request = new ActiveXObject("Msxml2.XMLHTTP");

} catch (e) {

try {

http_request = new ActiveXObject("Microsoft.XMLHTTP");

} catch (e) {}

}

}

if (!http_request) {

alert('Cannot create XMLHTTP instance');

return false;

}



http_request.onreadystatechange = alertContents;

http_request.open('POST', url, true);

http_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");

http_request.setRequestHeader("Content-length", parameters.length);

http_request.setRequestHeader("Connection", "close");

http_request.send(parameters);

}



function alertContents() {

if (http_request.readyState == 4) {

if (http_request.status == 200) {

//alert(http_request.responseText);

result = http_request.responseText;



// code for IE

if (window.ActiveXObject)

{

var doc=new ActiveXObject("Microsoft.XMLDOM");

doc.async="false";

doc.loadXML(result);

}

// code for Mozilla, Firefox, Opera, etc.

else

{

var parser=new DOMParser();

var doc=parser.parseFromString(result,"text/xml");

}



var xml=doc.documentElement;

document.getElementById(output).innerHTML = xml.childNodes[1].childNodes[0].nodeValue;

if ( parseInt(document.getElementById(output).innerHTML) == parseInt(expect))

{

document.getElementById(pass_out).innerHTML = "<font color=\"green\">" + "PASS" + " </font>";

}

else

{

document.getElementById(pass_out).innerHTML = "<font color=\"red\">" + "FAIL" + " </font>";



}

} else {

alert('There was a problem with the request.');

}

mutex = 1;

}

}



var mutex = 1;

function get(user, pass, my_output, my_expect_output, my_pass_out) {

if(mutex == 1)

{

mutex = 0;

var poststr = "user=" + encodeURI( document.getElementById(user).value ) +

"&pass=" + encodeURI( document.getElementById(pass).value );

output = my_output;

pass_out = my_pass_out;

expect = document.getElementById(my_expect_output).innerHTML;

makePOSTRequest('/cgi-bin/login.fcgi', poststr);

}

else

{

setTimeout('get(\"'+user+'\",\"'+pass+'\",\"'+my_output+'\",\"'+my_expect_output+'\",\"'+my_pass_out+'\")', 1000);

}

}



function test_all()

{

document.getElementById("button1").click();

document.getElementById("button2").click();

document.getElementById("button3").click();

document.getElementById("button4").click();

document.getElementById("button5").click();

document.getElementById("button6").click();

document.getElementById("button7").click();



}



</script>

<input name="TestALL" type="button" value="TestALL" onclick="javascript:test_all();"/>



<table width="894" border="1">

<tr>

<th width="94" scope="row">TestCase</th>

<th width="174" scope="row">Aim</th>

<th width="174" scope="row">input</th>

<td width="194">expect output </td>

<td width="192">actual output </td>

<td width="10">Run</td>

<td width="10">Pass?</td>

</tr>

<tr>



<th scope="row">1</th>

<th scope="row">correct</th>

<th scope="row">Username

<input name="user" id="user1" type="text" value="abc" />

<br/>

Password

<input name="pass" type="password" id="pass1" value="abc" /></th>

<td><span id="expect1">0</span></td>

<td><span id="output1"></span></td>

<td><input name="button1" type="button" id="button1"

onclick="javascript:get('user1','pass1', 'output1','expect1', 'pass_out1');" value="test" /></td>

<td><span id="pass_out1" ></span></td>



</tr>

<tr>





<th scope="row">2</th>

<th scope="row">mising username </th>

<th scope="row">Username

<input name="user" id="user2" type="text" />

<br/>

Password

<input name="pass" type="password" id="pass2" value="abc" /></th>

<td><span id="expect2">-40001</span></td>

<td><span id="output2"></span></td>

<td><input name="button2" type="button" id="button2"

onclick="javascript:get('user2','pass2', 'output2','expect2', 'pass_out2');" value="test" /></td>

<td><span id="pass_out2" ></span></td>



</tr>

<tr>





<th scope="row">3</th>

<th scope="row">mising password </th>

<th scope="row">Username

<input name="user" id="user3" type="text" value="abc" />

<br/>

Password

<input name="pass" type="password" id="pass3" /></th>

<td><span id="expect3">-40001</span></td>

<td><span id="output3"></span></td>

<td><input name="button3" type="button" id="button3"

onclick="javascript:get('user3','pass3', 'output3','expect3', 'pass_out3');" value="test" /></td>

<td><span id="pass_out3" ></span></td>



</tr>

<tr>





<th scope="row">4</th>

<th scope="row">incorrect username </th>

<th scope="row">Username

<input name="user" id="user4" type="text" value="abcd" />

<br/>

Password

<input name="pass" type="password" id="pass4" value="abc" /></th>

<td><span id="expect4">-40003</span></td>

<td><span id="output4"></span></td>

<td><input name="button4" type="button" id="button4"

onclick="javascript:get('user4','pass4', 'output4','expect4', 'pass_out4');" value="test" /></td>

<td><span id="pass_out4" ></span></td>



</tr>

<tr>





<th scope="row">5</th>

<th scope="row">incorrect password </th>

<th scope="row">Username

<input name="user" id="user5" type="text" value="abc" />

<br/>

Password

<input name="pass" type="password" id="pass5" value="abcd" /></th>

<td><span id="expect5">-40003</span></td>

<td><span id="output5"></span></td>

<td><input name="button5" type="button" id="button5"

onclick="javascript:get('user5','pass5', 'output5','expect5', 'pass_out5');" value="test" /></td>

<td><span id="pass_out5" ></span></td>



</tr>

<tr>





<th scope="row">6</th>

<th scope="row">both incorrect</th>

<th scope="row">Username

<input name="user" id="user6" type="text" value="abcd" />

<br/>

Password

<input name="pass" type="password" id="pass6" value="abcd" /></th>

<td><span id="expect6">-40003</span></td>

<td><span id="output6"></span></td>

<td><input name="button6" type="button" id="button6"

onclick="javascript:get('user6','pass6', 'output6','expect6', 'pass_out6');" value="test" /></td>

<td><span id="pass_out6" ></span></td>



</tr>

<tr>





<th scope="row">7</th>

<th scope="row"><p>Server </p>

<p>internal</p>

<p>error </p></th>

<th scope="row"><p>need to test by hand </p>

<p>Username

<input name="user7" id="user7" type="text" value="abcd" />

<br/>

Password

<input name="pass7" type="password" id="pass7" value="abcd" />

</p></th>

<td><span id="expect7">-40002</span></td>

<td><span id="output7"></span></td>

<td><input name="button7" type="button" id="button7"

onclick="javascript:get('user7','pass7', 'output7','expect7', 'pass_out7');" value="test" /></td>

<td><span id="pass_out7" ></span></td>



</tr>

</table>







</body>

</html>

use rude::cgi in fastCGI

rude::cgi was designed for CGI. when I put it in use for my fastCGI program, I make it a patch.
1) rude::cgi use singleton pattern , which doesn't work under fastCGI, because fcgi need to create new instance each time to parse new request. So I modify rude's constructor and destructor, make it destroy the instance after use.
2)fastCGI replace the stdio.h, and most of its functions. so where rude::cgi uses stdio.h, put #include before #include . that will work.

I am enjoying fast speed of fastcgi, while easy programming with rude::cgi.


ps:I have tried to use qDecoder, also patch a similar modification, but it doesn't work for fcgi (giving a signal 11, SIGSEG ). but it works under cgi mode. I have no idea.

Monday, June 25, 2007

How to give credit to other's skype ?

Call me~ Skype id: zheng.walter

Monday, May 21, 2007

Isolate your problem when debug

When you combine your code with the others, and it crashes, you should isolate your code and the other's to reproduce the crash. so that you can find the spot.

bloger's bug

Everything is a feedback system

link: http://news.csdn.net/n/20070519/104271.html
想一下你考虑一下亚马逊、雅虎这些网站,如果这些网站没有用户的话,那么这些网站就 什么都不是了。网站一开始是和报纸一样的,提供信息,有人来看。这是单向的交流,但是现代的网络来说,它比之前要更简单来维护了,因此你只需要有很多的理 念和环境,很好的气氛,这样每个人在你网站上的点击都可以帮助你把网站变得更好。受关注程度越来越高,所以每次用户的互动可以使网站变得更好。说道雅虎问 答的网站,也变得越来越好了。

feedback 在计算机发展中有着很重要的地位,从小小的精元到庞大的系统,都是依靠feedback是运行更精确.

PS: 正在阅读 the dream machine

Sunday, April 29, 2007

how many GDP is wasted on GRE / TOEFL?

Recently, I found that it really really hard to find a open sit for GRE / TOEFL test.

the new three month TOEFL schedule was published yesterday, and it's already full last night. You can't tell how many people are waiting for the registration, and how many can't find a sit.

That's why New East get the huge market for preparing the test.

But...how many time have been spent (or wasted?) on these English test? how many GDP spend on it? and how much we can produce if we don't do such things.

Sunday, April 15, 2007

Hum, SUN JAVA JDK 1.5 bug on linux

Latest update: 2008-4-9
Haha, this is not JDK's bug, its our code's problem.
we use fdopen on a socket fd twice, and fclose it twice which will close the fd as well.
when the fd is close once, system may reuse it for another socket, and we close other socket's same fd num again. brings the problem.
====================================================================

causing our file close exception, and mix different fd's content with each other, put what I write to a file into a socket!

we upgrade to JDK 1.6, hoping those bugs are fixed and not bringing in some new bugs.

seems some one has met the same problem:
http://256.com/gray/docs/misc/java_bad_file_descriptor_close_bug.shtml

Java Bad File Descriptor Close Bug

We have been fighting for a number of weeks with a bad file descriptor bug on a search project at work. Although we initially assumed it was our buggy software to blame, a closer look at the problem seems to point elsewhere. Our current research seems to indicate that a bug in Sun's JDK under Linux (maybe others) is at fault here.

Background

We have been seeing a large number of the 'Bad file descriptor' exceptions in various places around our software. We initially thought that we were someone double closing or otherwise improperly using file handles. However, after a more aggressively review of the code in question as well as the JDK, we came to the conclusion that aside from creating input or output streams using the FileDescriptor constructor (which we were not doing) there should be no way to get these problems. In addition, many of the places which were throwing the exceptions (see below) were in 3rd party libraries including Lucene and Berkeley Database JE.

Our application is a search system which is using ActiveMQ JMS to receive, index, and store documents. We use 10s of JMS queues and topics to coordinate a distributed collection of search nodes. This translates into 10s of sockets which are mostly TCP but some UDP and multicast packets. Local disk descriptors to standard SCSI disks or hardware/software raid configurations. No network filesystems are being used. Mostly EXT3, some XFS, and Some temporary filesystems but otherwise nothing exotic.

Possible Solution

As of February 26, 2007, more testing has revealed that our problems seem to be coming from concurrency issues in Sun's 1.5 JDK (through v.11) combined with Lucene v2.0's calling close() in FSIndexInput.finalize() and FSIndexOutput.finalize() methods -- a real no-no. Looks like v2.1 has 2 bug fixes that would resolve this (669 and 750). We think that the problem is a race condition between a user thread which has caused close and the finalizer which is also calling close. The fact that the FileDescriptor has already been closed is not properly synchronized between the 2 threads so a double close is performed, closing a file that was just opened.

This problem also seems to be fixed in Sun's v1.6 JDK. Looking through the change logs, we see that a number of garbage collection bugs have been fixed. Right now our speculation is that the problems stem from a synchronization bug in 1.5 versions between the GC (maybe just the finalizer parts) and user threads. The finalizer thread does not know that a user thread had closed a file descriptor -- or vice versa. Although we are seeing 30%+ worse performance with 1.6, we have not seen any Bad File Descriptor exceptions. If they fixed some problems by adding synchronization or memory barriers to the GC, this also may account for the performance losses.

JDK Analysis

One of the things that we noticed in looking at the JDK is that if the close() system call fails, the FileDescriptor is not reset to -1 even though the system's file descriptor is invalid (see Linux kernel source). This could mean that if the close syscall fails, it might cause a close of either an invalid file descriptor, or a valid descriptor which happened to call open and get the latest file descriptor that was just closed. This may be the ultimate problem although we are unsure of when, aside from NFS which we are not using, close returns failure. This bug was not in Sun's 1.4 JDK, but was introduced in 1.5 when the error code from close was detected. The bug in is all 1.5 versions through 1.5.11 as well as 1.6. Since the Linux version is using the Solaris code for close, we wonder if the Solaris kernel does something different of it the Solaris version has a bug as well.

We decided initially to copy and override the FileDescriptor class and the classes which open them so we can instrument, and hopefully protect against, the problems. We also wanted to put some synchronized blocks around the closes to make sure that we don't have a concurrency problem. Initial takes at this seemed to have reduced but not removed the problems. As of February 2007 we are working on rev 3 of these classes however these were unable to fix the problem although they gave us more information of the call graphs at fault.

Linux Kernel

Below is the source for the close() syscall from the 2.6.18.3 Linux kernel. As you can see, if the file descriptor is valid, there is no way to leave this routine without it being closed and made available for the next call to open(). If filep_close returns an error, and the JDK does not set the file descriptor to -1, a double close will most likely happen in the future.

asmlinkage long sys_close(unsigned int fd)
{
struct file * filp;
struct files_struct *files = current->files;
struct fdtable *fdt;

spin_lock(&files->file_lock);
fdt = files_fdtable(files);
if (fd >= fdt->max_fds)
goto out_unlock;
filp = fdt->fd[fd];
if (!filp)
goto out_unlock;
rcu_assign_pointer(fdt->fd[fd], NULL);
FD_CLR(fd, fdt->close_on_exec);
__put_unused_fd(files, fd);
spin_unlock(&files->file_lock);
return filp_close(filp, files);

out_unlock:
spin_unlock(&files->file_lock);
return -EBADF;
}


Updated news:
I replaced the JNI part with pure Java socket, and it works fine now. Oops.
And here comes another challenge, how to stop those complicate sub-thread safely.

blogger is BANed from China

What the F**K! I can't visit my blog from China. And won't be able to update it for a long time.

Thursday, March 29, 2007

Jump into real project

Don't rely on text book only. Code and test, you will know if it is true.

Tuesday, March 27, 2007

Why can't my blog be visited?

I can login, and post new blog. But I can't visit my blog using zdwalter.blogspot.com

Sunday, March 18, 2007

Find out who is viewing your blog

Google Analysis is amazing.

I can find out people from where, through what way find my blog.

currently, some people from Japan, Australia , US have visited.

they are looking for LSH, VTune, kerrighed, openMosix, openSSI.

it's great to find people with the same interest.

What do berkeley CS student read?

link track:
http://www.cs.berkeley.edu/~christos/classics/cs298.html

Examples of classics:

  • Edmonds, Jack , Paths, trees, and flowers, Canadian Journal of Mathematics, Vol 17, No -, 449-467, 1965
  • Three papers on NP-completeness: S. A. Cook The complexity of theorem-proving procedures, 1971 STOC; R.M. Karp. Reducibility among combinatorial problems. In R.E. Miller and J.W. Thatcher, editors, Complexity of Computer Computations, pages 85--103. Plenum Press, 1972; and Levin, Universal Search Problems. [Problemy Peredatsi Informatsii] 9(3):265-266, 1973 (c). Annals of the History of Computing 6(4):384-400, 1984.

What do you work for?

confusing...

If you work for living, you may work hard, but you will find the work boring.

If you don't have to worry about life, why will you work?

And what do you live for?

Thursday, March 15, 2007

Quick Tips On Raising Startup Funding Without A Plan Or A PowerPoint

link track: http://onstartups.com/home/tabid/3339/bid/1289/4-Quick-Tips-on-Raising-Startup-Funding-Without-A-Plan-Or-A-PowerPoint.aspx

Have A Story

Demonstrate Leverage

Accept That Your Baby Is Ugly

Dream Big, But Plan Small

Wednesday, March 14, 2007

Top 5 Things That Should Be Taught In Every School

track link: http://briankim.net/blog/2007/03/top-5-things-that-should-be-taught-in-every-school/

#1. Personal Finance

#2. Communicating Effectively

#3. Social Skills

#4. Sales

#5: Time Management


Monday, March 12, 2007

book list for programmer

link track: http://weblog.raganwald.com/2006/11/first-seven-books-i-would-buy-if-my_17.html

The first seven books I would buy if my shelves were bare
Lucas Carlson won a $100 gift certificate on Amazon.com for his 2nd place entry at Rails Day (in collaboration with John Butler). Congratulations, Lucas!

Lucas asked for suggestions on spending the money. I tried suggesting a new iPod Nano loaded up with the SICP lectures in video podcast form. But as you would expect for someone working in a music-related venture, he has plenty of toys already.

So… here are the first seven books I would buy if my shelves were bare (in no particular order):
  1. Structure and Interpretation of Computer Programs. You can read it for free on line, but it’s even better as a physical book. One for the ages, it’s the kind of thing that ought to be bound in rich leather (if you go for that sort of thing) and kept in the library you build for your luxury castle.

  2. To Mock a Mockingbird. It seems you can’t raise micro-capital these days without understanding fixed point combinators. Here’s the most enjoyable text on the subject of combinatory logic ever written. What other textbook features starlings, kestrels, and other songbirds?

  3. The Media Lab: Inventing the Future at M. I. T.. Stewart Brand’s book captures the legendary think tank’s culture and ideas. Compare and contrast their view of broadcatch with today’s RSS feeds, or narrowcasting with today’s 500 channel television.

  4. On Intelligence A book that shook my views about how my brain works. To pick one nugget out of many, neurons are so slow that in the time it takes for us to react suddenly—say to duck a flying object—there is only time for a chain of at most 100 steps to complete. 100 steps do not permit us to perform any complex reasoning or look-up. Jeff explains how the neocortex can accomplish complex tasks using layers of parallel switches.

  5. Philip and Alex’s Guide to Web Publishing. While the technologies suggested (TCL, AOLServer) are unlikely to float your boat, this is the most beautiful technical book on my shelves. Philip’s advice on how to build software for web publishing and approach is still relevant several generations of web developers later. (Also available on line for free.)

  6. The Recursive Universe: Cosmic Complexity and the Limits of Scientific Knowledge. Although it seems to be out of print, hunt down a copy for yourself. A thrilling journey into the ideas of the great John Horton Conway and computation’s building blocks. Best of all, it’s explained beautifully using the legendary Game of Life. Who knew that puffer trains and spaceships are Turing Complete?

  7. QED: The Strange Theory of Light and Matter. Yes, the full Feynman Lectures are incomparable, and for further thrills you can listen to him give the lectures on audiobook. But in QED, Feynman does this one magical thing: he explains how a mirror reflects light. And in the process of explaining how light actually reflects off a mirror, Feynman deconstructs classical physics and rebuilds our understanding with Quantum Electrodynamics. For a moment, you can understand how little we really know about how the universe works.

Is there a book you would recommend? What’re your feelings about the books I’ve suggested?

p.s. Shane Sherman’s The 5 Books that Every Programmer Should Read

email spam

currently more and more email spam with images, because email client will open image automatically. and it's more difficult to detect its content.

When will video become the email spam? huge band width will be wasted, and harder to detect too.

sqlite 源码分析

Wow,
解析sql语句用的是 编译原理的东西,把语句解析成自己虚拟机的汇编代码。
整个后台流程是用过虚拟机实现。

总算发现编译原理怎么用了,还能结合汇编。哈哈

Today's reading

Why Publish CS Papers Without Code?

link track: http://billmill.org/why_no_code

Imagine that you read a paper analyzing "Hamlet" in great detail. Intrigued, you went to the bookstore to look for a copy, only to find that there were none. Confused, you checked the library - nothing. Finally, you went online to shakespeare.com, only to find a note saying that "Hamlet" was still being edited and would be released Any Day Now.

Unfortunately, an analogous situation is the norm in the world of academic computer science. Graduate students and professors produce code by the truckload, and a majority of them produce only papers about their work. While this is certainly not always the case, it was difficult for me to even find these examples of academic source code. In all four cases, it has proven very useful to programmers outside of academia.

Life, not Math

The fact is, computer science research is more like biology research than it is like mathematical research. For an experiment to be valid, it should be repeatable. If you're publishing analyses of programs without publishing the code that was analyzed, how can the community possibly verify what you claim?

Bugs are endemic to source code everywhere, and there is no reason to believe that academic code is any different. All of the analysis in the world is irrelevant if the program you are analyzing has a subtle bug embedded in it. We, computer scientists, should expect and demand that published, well tested code be made available with every paper which claims to analyze or draw conclusions from a program of any significant size.

A Problem of Environment?

At the moment, there is just no easy way to do this. Where the open source world has SourceForge and other project hosting sites, there is no similar environment where academic papers can live alongside the code they reference. Instead, computer science researchers are encouraged to publish papers in traditional, copyright-locked, academic journals. These journals are not prepared to handle large volumes of code, nor should they be. Computer science research was made for the web, and there should be a home for it on the web.

It is intimidating for a harried academic that just wants to get work done, and advance in his field, to have to set up the host of tools required to share code effectively. If there were a SourceForge-for-academics site where they could simply register their paper, drop in the source code, and have a project ready made for them, it would be much more likely that they would participate. If such a project were to gain steam, the network effect would make it an invaluable resource for academic and industry programmers alike. Collaboration and open code sharing would lead to much more rapid progress in the field, and hopefully encourage the greater rigor that other fields require of their practitioners.

Two Different Worlds

Right now, academics and open-source programmers live largely in two separate, often parallel, worlds. Where they do collide, as they do in the Haskell language, there is often extremely interesting work being produced. Each brings a different, interesting, viewpoint to the table, and greater coordination between the two would have nearly universal benefits for programmers of every stripe.

So free the code! If you're an academic programmer, consider publishing the code that you have, regardless of what you may think of it. Consider asking the journal that you publish in to retain copyright over your work. If you're an open source programmer, look for some work in a field that interests you, and email the author if he hasn't released his code. Ask him an interesting question, and convince him that his code would be useful. If you're both, tell the world your ideas for how we can all work better together.

Update:

I've been contacted already by two scientists who care about the reproducibility of programs. First, Gavin Baker wrote to tell me about the insight toolkit, which "is a cross-platform open-source image processing toolkit for performing registration and segmentation" that attempts to provide reference implementations of published algorithms. He also pointed me towards The Insight Journal, which allows authors to publish open articles which are automatically verified with CMake. This is exactly the type of thing I was hoping to hear about.

Only a few minutes later, "I. Vlad" wrote to tell me that computational geophysicists have a similar system called Madagascar, which uses SCons to provide automated verification of results. Furthermore, they encourage the use of open data sets from a website they've set up, something similar to a post I made a while ago.

Good to hear that these scientists are out there making stuff happen, while I sit here on my duff.


stock 101 - day 2 : S南航(上海,600029) 当前价:5.830 涨跌幅: +1.22% 2007-03-09 15:02:54

最近交易价:5.83
交易时间:3月9日
涨跌:涨 0.07 (1.22%)
昨日收盘:5.76
开盘:5.76
买入:5.82
卖出:5.83
一年目标预测:
今日价格幅度:5.71 - 5.86
52周价格幅度:2.19 - 3.13
成交量:33,784,406
平均成交量(3个月):34,331,600
市值:
市盈率(12个月):42.2
每股收益(12个月):010
股利和股息:N/A ()


最新提示:1)02月28日S南航:退购一架空客A330(详见后)
2)02月27日刊登董事会公告(详见后)
3)预计2006年度业绩与2005年度相比将扭亏为盈.
4)2006年年报预约披露:2007年04月17日
分红扩股:1)2006年中期利润不分配,不转增
2)2005年利润不分配,不转增
股权分置:国家股现在占南航股权的50.3%,目前实施股改有一定的困难,南航集团和
本公司正积极与国家有关部门沟通,务求积极稳妥地推进南航的股改.
●06-09-30 净利润:45300.00万 同比增:4933.33 主营收入:349.15亿 同比增:18.54
────────┬────┬────┬────┬────┬───────
主要指标(元) │06-09-30│06-06-30│06-03-31│05-12-31│05-09-30
每股收益(摊薄) │ 0.1036│ -0.1909│ -0.1520│ -0.4101│ 0.0021
每股净资产(摊薄)│ 2.3790│ 2.0845│ 2.1229│ 2.2749│ 2.6688
每股资本公积金 │ 1.3477│ 1.3477│ 1.3472│ 1.3472│ 1.3289
每股未分配利润 │ -0.1267│ -0.4211│ -0.3822│ -0.2266│ 0.1863
净资产收益率 %│ 4.4500│ -8.7600│ -6.9000│-16.6100│ 0.0800
────────┴────┴─┬──┴────┴───┬┴───────
证券简称:S南航 │总股本(万):437418 │法人:刘绍勇
证券代码:600029 │A 股 (万):100000 │总经理:司献民
H 股简称:南方航空 代码:1055 │H 股 (万):117418 │行业:交通运输
上市日期:03.07.25 发行价:2.70 │国家股(万):220000 │ 仓储
上市推荐及主承销商:银河证券 │主营范围:国内和经批准的国际、地区航空客
电话:020-86124738 董秘:苏亮 │ 、货、邮、行李运输业务


┌───────────┬─────┬─────┬─────┬─────┐
│主要指标 │2006-09-30│2006-06-30│2006-03-31│2005-12-31│
├───────────┼─────┼─────┼─────┼─────┤
│每股收益(元) │ 0.1000│ -0.1900│ -0.1500│ -0.4100│
│每股收益(扣除)(元) │ --│ -0.2200│ -0.1500│ -0.4300│
│每股净资产(元) │ 2.3800│ 2.0800│ 2.1200│ 2.2800│
│调整后每股净资产(元) │ 2.2900│ 1.9500│ 2.0300│ 2.1900│
│每股收益(摊薄)(元) │ 0.1036│ -0.1909│ -0.1520│ -0.4101│
│每股净资产(摊薄)(元) │ 2.3790│ 2.0845│ 2.1229│ 2.2749│
│每股资本公积金(元) │ 1.3477│ 1.3477│ 1.3472│ 1.3472│
│每股盈余公积金(元) │ 0.1580│ 0.1580│ 0.1580│ 0.1580│
│每股未分配利润(元) │ -0.1267│ -0.4211│ -0.3822│ -0.2266│
│每股现金净流量(元) │ 0.2613│ 0.3301│ 0.1621│ -0.0329│
│每股经营现金净流量(元)│ 0.9060│ 0.3452│ 0.1193│ 1.3527│
│净资产收益率(扣除)(%) │ 3.0300│ -10.6200│ -7.0000│ 18.8000│
│净资产收益率(%) │ 4.4500│ -8.7600│ -6.9000│ -16.6100│
│总资产(万) │7864800.00│7546400.00│7355400.00│7230400.00│
│股东权益(万) │1040600.00│ 911800.00│ 928600.00│ 995100.00│
│主营业务收入(万) │3491500.00│2102400.00│9429000.00│3905200.00│
│主营业务利润(万) │ 476500.00│ 221700.00│ 66000.00│ 362600.00│
│投资收益(万) │ 500.00│ -500.00│ -1100.00│ -20200.00│
│利润总额(万) │ 63200.00│ -74600.00│ -66000.00│-177300.00│
│净利润(万) │ 45300.00│ -83500.00│ -66500.00│-179400.00│
└───────────┴─────┴─────┴─────┴─────┘

┌───────────┬─────┬─────┬─────┬─────┐
│主要指标 │2005-09-30│2005-06-30│2005-03-31│2004-12-31│
├───────────┼─────┼─────┼─────┼─────┤
│每股收益(元) │ 0.0021│ -0.1900│ -0.0650│ 0.0240│
│每股收益(扣除)(元) │ 0.0080│ -0.1900│ -0.0650│ 0.0210│
│每股净资产(元) │ 2.6700│ 2.4700│ 2.6000│ 2.6600│
│调整后每股净资产(元) │ 2.5700│ 2.3600│ 2.6000│ 2.5500│
│每股收益(摊薄)(元) │ 0.0021│ -0.1927│ -0.0652│ 0.0235│
│每股净资产(摊薄)(元) │ 2.6688│ 2.4741│ 2.5989│ 2.6640│
│每股资本公积金(元) │ 1.3289│ 1.3289│ 1.3262│ 1.3262│
│每股盈余公积金(元) │ 0.1536│ 0.1536│ 0.1536│ 0.1536│
│每股未分配利润(元) │ 0.1863│ -0.0085│ 0.1191│ 0.1843│
│每股现金净流量(元) │ 0.4088│ 0.5875│ 0.4577│ 0.2179│
│每股经营现金净流量(元)│ 0.7199│ 0.6010│ 0.3420│ 0.9853│
│净资产收益率(扣除)(%) │ 0.3000│ -7.5300│ -2.5000│ 0.8070│
│净资产收益率(%) │ 0.0800│ -7.8000│ -2.5000│ 0.8840│
│总资产(万) │7188600.00│6872700.00│6676200.00│6315500.00│
│股东权益(万) │1167400.00│1082200.00│1136800.00│1165300.00│
│主营业务收入(万) │2945400.00│1805300.00│ 826600.00│2419400.00│
│主营业务利润(万) │ 341100.00│ 161100.00│ 76800.00│ 420600.00│
│投资收益(万) │ 9200.00│ -1000.00│ -300.00│ 6300.00│
│利润总额(万) │ 18500.00│ -92800.00│ -30800.00│ 39200.00│
│净利润(万) │ 900.00│ -84300.00│ -28500.00│ 10300.00│
└───────────┴─────┴─────┴─────┴─────┘


───────────┬─────────┬─────────┬────
项 目 │ 前 期│ 近 期│ 幅度%
───────────┼─────────┼─────────┼────
股东户数 (户)│ 144164.00(06中期)│ 114044.00(06三季)│ -20.89
户均持流通股 (股)│ 15081.28(06中期)│ 19064.38(06三季)│ 26.41
十大股东持股 (万股)│ 351463.48(05年度)│ 346378.24(06中期)│ -1.45
十大流通股东持股(万股)│ 126988.02(06中期)│ 128926.66(06三季)│ 1.53
投资基金 (万股)│ 3893.53(06中期)│ 8865.06(06三季)│ 127.69
社保基金 (万股)│ 4755.59(06中期)│ 3945.81(06三季)│ -17.03
证券公司 (万股)│ --│ --│ --
QFII (万股)│ 1011.37(06中期)│ 1200.00(06三季)│ 18.65
───────────┴─────────┴─────────┴────

散户减少,投资基金加入


意见:
是否良好公司还需要观察,因为扭亏为盈如果单是依赖油价下调,人民币升值,不能说明经营改善。而且价钱过高,高于价值。




tomorrow : 000024 招商地产

Friday, March 09, 2007

stock 101 - day 1

pick from 华夏大盘精选

序号

股票代码

股票名称

数量(股)

期末市值(元)

占净值比例

1

000933

神火股份

10,001,647

112,118,462.87

5.66%

2

600029

S南航

26,900,000

110,021,000.00

5.56%

3

600787

中储股份

12,534,386

78,339,912.50

3.96%

4

000807

云铝股份

7,275,000

77,551,500.00

3.92%

5

000860

顺鑫农业

7,806,192

61,200,545.28

3.09%

6

000960

锡业股份

6,891,100

61,124,057.00

3.09%

7

000617

S 济 柴

3,414,749

58,016,585.51

2.93%

8

000819

S 岳兴长

3,176,289

56,537,944.20

2.86%

9

000888

峨眉山A

5,798,923

55,611,671.57

2.81%

10

600005

武钢股份

8,004,776

50,910,375.36

2.57%


stock

000933

神火股份


主营业务|煤炭的生产、销售、洗选加工及发供电

当前:
最近交易价:14.16
交易时间:3月8日
涨跌:涨 0.39 (2.83%)
昨日收盘:13.77
开盘:14.00
买入:14.16
卖出:14.17
一年目标预测:
今日价格幅度:13.80 - 14.17
52周价格幅度:5.66 - 16.45
成交量:7,002,664
平均成交量(3个月):3,678,540
市值:70.80亿
市盈率(12个月):15.31
每股收益(12个月):0.92
股利和股息:1.50 ()

截至日期:2006-09-30 十大流通股东情况 股东总户数:40237
──────────────┬─────┬─────┬────┬─────
股东名称 | 持股数 |占流通股比|股东性质|增减情况
| (万股) | (%) | | (万股)
──────────────┼─────┼─────┼────┼─────
安顺证券投资基金 | 661.69| 2.80 A股| 基金 | 281.69
中国人寿保险股份有限公司 | 529.49| 2.24 A股|保险公司| 50.00
天元证券投资基金 | 506.10| 2.14 A股| 基金 | 13.54
华夏大盘精选证券投资基金 | 500.04| 2.11 A股| 基金 | 365.06
中国人寿保险(集团)公司 | 416.81| 1.76 A股|保险公司| 未变
建信优选成长股票型证券投资基| 327.57| 1.38 A股| 基金 | 新进
金 | | | |
华安创新证券投资基金 | 280.00| 1.18 A股| 基金 | -78.86
安瑞证券投资基金 | 271.44| 1.15 A股| 基金 | 151.77
鸿阳证券投资基金 | 262.78| 1.11 A股| 基金 | -137.73
刘梅英 | 232.17| 0.98 A股| 个人 | 未变
──────────────┴─────┴─────┴────┴─────
合计持有3988.09万流通A股,分别占总股本7.97%,流通A股16.86%
─────────────────────────────────────


意见:
可以买入

Thursday, March 08, 2007

buying stocks

i am starting off by spending a year tracking and picking stocks, but not with real money. Let me research a stock per day.

Friday, March 02, 2007

blogger can learn from open source

bloggers compete with people working for money, often win.
people have always been willing o do great work for free.
people work a lot harder on stuff they like.

no one reads the average blog. print media is competing against the best writing online.
Aggregators show how much better you can do than the channel.
most articles in the print media are boring.

blogs and open source software are made by people working at home.
people make what they want, and the best stuff prevails.

Hum, We programmers are craftsmen

I first realize why computer programmers can earn more money. because we hand-made objects create wealth.
Wanna be wealthy?

start or join a startup.

startups don't change the laws of wealth creation. you will get a million a year because you work much harder than being an employee, and your creation worths that much. the more you work, the more you get. so you can get the same money in several years, while working for others takes your whole life.

need measurement and leverage. be part of a small group working on a hard problem.

if you are in a job that feels safe, you are NOT going to get rich. big potential for gain there must also be a terrifying possibility of loss.

startup's success or failure depends on the first ten employees, even first five. the small in the sense of an all-star team, ten people work as hard as you.

Wednesday, February 28, 2007

As a student, it will hold you back when you are working for startup, because you have a build-in escape hatch. Even you fail, you can still be back at school anyway. This is not good for startup.

As earning more money, it will draw you back from creating cheap thing, which may change the world.

Don't wait to get more experience before starting a company, you will lose those student co-founders who will be involved in other project they don't want to abandon...That's True. this has changed my attitude towards student startup, a huge advantage.

Ha? Not to work for Google, because there are ZERO startup come out of there.

It's best to work for a startup if you want to start a startup.
you will end up rich,, or the startup will ge bought, in which case it will start to suck to work there and easy to leave. or most likely, the thing will blow up and you'll be free again. Lalala, that's true.

starting startups is harder than you expect, but you are also capable of more than you expect.

Work experience is not some specific expertise, but the elimination of certain habits left over from childhood.elimination of the flak reflex - the ability to get things done, with no excuses.

Getting rich means you can stop treading water.
understand the relationship between money and work changes the way you work. you work for doing things other people want, focus more on the user.

the most important skill for a startup founder isn't a programming technique, it's a knack for understanding users and figuring out how to give them what they want.
怎么做网站的感觉总比不上写程序?

虽然也是要写程序,但写起来都是一小段一小段的,类似的重复的工作很多,导致很容易疲惫。需要调整起来了~ Gooooo
5 years ahead of industry technology?
Wow, let's see how well we can perform. Exciting. Keep it a secret now.

Monday, February 26, 2007

Key note on reading "The 18 mistakes that kill startups"

link: http://www.paulgraham.com/startupmistakes.html

Not Making something Users want

1) Single Founder
2) Bad location
3) Marginal Niche
4) Derivative Idea
5) Obstinacy
6) Hiring Bad Programmers
7. Choosing the Wrong Platform
8. Slowness in Launching
9. Launching too early
10. having no specific user in mind
11. raising too little money
12. spending too much
13.raising too much money
14. poor investor management
15. sacrificing users to supposed profit
16. not wanting to get your hands dirty
17. fights between founders
18. a half-hearted effort
创业是一场漫长的战斗

除了需要发现创业的点子,还需要激情去实现,然后需要坚持,还需要想方设法发展。一步一步,不能一步登天。

Sunday, February 04, 2007

Google + google reader + blogger

google's ajax technology is amazing. now I can share item in google reader, also adding them to blogger.

and I can edit blogger template by drag and drop.

Saturday, January 27, 2007

Installing Intel Vtune

It's so easy to install VTune under Windows. Nothing much to discuss.

It took me 3 days to install VTune under Linux...finally I made it.

We are using Debian, but Vtune depends seriously on Red Hat or SUSE's RPM . so I turn to CentOS. but VTune need kernel source to compile sampling driver. I don't know how to use yum for getting proper source. And failed to use our own build kernel. Can't start the OS...faint.

And Vtune only tested on old Linux kernel/distribution. like Fedora Core 3, it can't recognize the newest Inter Server's hardware (Serials SCSI HD, etc). So I install FC 6. Yes, OS works, and I get source code installed as well. Mmm.. VTune is installing, compiling driver. Ops, but it can't mount the driver to kernel. VTune depends on kernel struct tasklist_lock, which is moved away from kernel 2.6.16...my FC 6 kernel is 2.6.18...Finally google saved my life. I found someone's solution, change several line of code in vtune, compile it , and it is ON!
although I still can't run collector on the machine, I can use a remote client while the server is running at server mode.

I can use VTune now.
Hurry, the internet connection to US is coming back to normal now.

without the fast connection, Linux user is like out of work. I can't do any update or installation.

Linux is so depending on Server Mirrors.

Friday, January 12, 2007

Tencent is stupid to modify the QQ protocol.

Now most QQ client under Linux can't login.!

Damn, I am using GAIM.

Sunday, January 07, 2007

心灵的力量是无穷的

恕-- 己所不欲,勿施于人