Friday, November 12, 2010

“Inception” and programming

I heard a very interesting point of view about the movie “Inception”, and it says that “Inception” is a movie about computer programming. We could see those concepts: recursion, concurrency, exception handle, share memory, thread (process), system fail-over, global variables, local variables, etc..

In “Inception”, dreams are a child processes (or function? Recursion?). Therefore, characters could go down next layer, a dream in another dream. If a child process did not return properly (Cobb in beginning), system may interact to help him to end the dream (fail-over). Or, child process may be stack in limbo forever (zombie in OS).

A person in another person's dream looks like a process communicates with another, having shared memory (the same scene).

And, also, we could get different interpretations from “Inception”. In my point of view, its director must be a programmer. Is Christopher Nolan a programmer?

Tuesday, November 9, 2010

QQ vs 360

QQ is the most popular IM in China, and it has been installed in almost every computers in China . 360 is a free anti-virus software having only Chinese Version.

Recently, 360 claimed QQ scan user's personal data, and send back to QQ's server. Then, 360 published a software “QQ guard” to prevent scan user's privacy data from QQ.

Now, QQ announce that QQ will not run on computers if 360 installed.

In my point of view, QQ is using its monopoly in IM market to eliminate a potential market adversary. On other word, if Microsoft said Windows will not operate if Chrome is installed, the result is that MS will be fined by court, and enforce MS to cancel its decision.

What is the final result of QQ vs 360? I'm waiting...

Saturday, November 6, 2010

My computer was stoned

After I installed an application downloaded from Internet, I felt my computer had some virus symptoms. I had AVG free version in my laptop, and it gave some alerts. SFU wireless network also alert me that my laptop was stoned and cut my lapton's connection to SFU network. Then, I installed McAfee and full scaned my laptop. But SFU network still warned me that having virus on my laptop.

Finally, I uninstalled McAfee, and try MS essential. This free antivirus software really give me a surprise, it found a Trojan:WinNT/Bubnix.gen!A on my system\driver\, and show "Trojan:WinNT/Bubnix.gen!A is a generic detection for a kernel-mode driver installed by other malware that hides its presence on an affected computer by blocking registry and file access to itself."

It looks MS still has backdoors that other antivirus companies do not know. Therefore, after the virus in system, McAfee can not find it, but MS can.

Thursday, October 21, 2010

A thought about Russell Williams

I have to see the news about Russell Williams shocked everybody, especially recently released crimal details by court. CTV’s news called it shocking news every time. I really don’t know how to critizice him, or I should call it.

First, he is a senior office in Canadian Aire Force, commandor of an air base; second, the released details about his crimal are unbelievable crude, how cans a human being did those things?

Although, generally, death penalty may be not humane, I really can not find any reason to not treat this kind of criminal with it.

Tuesday, October 19, 2010

Binary search

In cmpt454 quiz, a problem is related to binary search. But I though it is binary search tree. Now, I need clarify these two topics.

Binary search is an “algorithm” for search an item in a sorted array.
Binary search tree is a data structure, or called ordered search tree. It left subtree is smaller than the node, and right subtree is bigger than the node. When we traverse it in in-order, its elements are retrieved by order.

The similar point is that for search an item, both running time are in O(log(n)).

Monday, October 11, 2010

Database II and modern CPU architechture

I take Database II (cmpt454) this semester, and feel the way to speed up database is very similar to modern CPU.

One of the most important issues for implementing database is that the read/write speed of disk is too slow comparing to memory read/write. Therefore, algorithms, such as B+ tree,hash index and clustered record, are solutions for disk’s tardiness.

Now we have 3 layers of cpu cache, and each layer is faster than layer, and, also, CPU caches are more speedy than memory . When we use a listed list, the efficiency is not good because it does not take the advantage of CPU cache. On the other hand, if we use an array to hold data, it should be better than listed list because array is stored in sequential block, and CPU could pre-fetch elements of array to cache.

In my point of view, algorithms for implementing database will be more popular in general software development.

Tuesday, October 5, 2010

Constant and pointers

Recently, I reviewed some basic C++ knowledge. one is qualifier CONSTANT, and another one is POINTER.

CONSTANT is a useful qualifier in team project because it will reduce the mistakes when using another’s methods, but I seldom used it in my project. I should use CONSTANT more often because it makes reuse them easier.

Using “constant” and “pointer” together make it more complicated.

1.Constant variable
2.A pointer points to a constant varaible
3.A constant pointer points to variable.
4.A constant pointer points to a contant variable

Confused? Follow is an example:

const double pi = 3.14159;
const double *const pi_ptr = π

In this case, pi_ptr is a const pointer and points to a const object.