Diablo Forum

During Investigating an Interaction, I Monitor a Motion;

While I Monitor a Motion, I try to Deduct a Direction;

After I Deduct a Direction, I may Conclude a Connection;

From the Concluded Connection, I can Accumulate a series of Actions;

(question: what am I doing?)

I am running out of space and here is a image space which stores all broken links.

http://nickhuang.ihuahua.com/

Feedback and Opinion | Diablo Forum

My Sky (lyric)

1. Let's date on someday

2.Can i have you in my arms?

3.Dream comes to be true

4.I stand alone in the rain

5.Don't say goodbye

Beautiful Montreal(photo)
1. pure scenery

2. besides of scenery--me

3. my roommates

4. grand church

5. my hometown (Xiamen)

6. Dean and me.

My days in TAV

Assignment

1. English translation of Chinese poem

2. Computer Education

3. Internet Courses

4. Exam

Program

{You are not fish,

how can you know the joy of fish}

A. Knight's Tour★

B. zebra puzzle★

C. Maze(1)★

D. Maze(2)★

E. Maze(3)★

F. 24game★

G. Morse★

H. Quicksort (template)★★

I. Dynamic List★★

J. pirate (unfinished)

Download

1. 24game

2. knight's tour

3. data for Maze

My days in Concordia

Program

(You are not fish,

how can you know the joy of fish)

1. Dictionary★

2. puzzle of feof

3. Logic★

4. Matrix(1)★

5 Matrix(2)★

6. Stack

7. Detective★

8. ArrayTest

9. WordReader

10. PowerDictionary★★

11. Logic(improved)★★

12. SuperDictionary★★

13. Sentence

14. PowerLogic★★

15. CodeCompetition1★

16. CodeCompetition2★

17. CodeCompetition3★

18. CodeCompetition4★

19. Assembly assignment(1)

20. C++ little game(assignment)

21. Square root (MASM version)★★

22. Square root (improved version)★★

23. Assembly assignment(2)

24. C++ assignment (simplified Monopoly)

25. Matrix(3)★

26. MyLib(MASM)★★

27. LogicSets(1)

28. Assembly assignment(3)

29. Prove by contradiction (application of Logic)★★

30. Relation(1)

32. Relation(2)

33. Generator(1)★

34. WhoAmI★

35. RSA(1) encryption★★

36. RSA(2) encryption★★

37. RSA(2.5) encryption★★

38. Generator(2)★

39. Counting★

40. SpaceWalker★

41. Depth-First-Search★★

42. Container

43. Partition★

44. Matrix3★

45. NumberDivider★

46. CountNumber★

47. Dijkstra★

48. Consecutive★

49. Prim★

50. Kruskal

51. Queue

52. SortMachine★

53. Cartesian

54. Fraction

55. DFS--Standardized★★

56. Zebra--DFS★★

57. Polynomial★

58. StackArray

59. DFSArray★★

60. Missionary★★

61. Message

62. NewKnights★★

63. NewWordReader★★

64. ArrayException★

65. StringSearch★★

66. Poke

67. Sequence

68. Haskell★

69. Reduce1★

70. Shuffle

71. Reduce2★

72. SimpleShuffle

73. Reduce3★

74. Crap

75. Haskell2

76. DirViewer★★

77. Login★★

78. SimpleLogin

79. Reduce4★

80. LevelPrint

81. Dynamic-Static

82. Double-Library

83. withoutDynamic

84. SortComp

85. Radix

86. Schedule

87. TemplateArray★

88. makefile

89. sortComp(revised)

90. shortest★

91. shortest(simplified)

92. practice(1)

93． simpleScanner★★

94． practice(2)

95. depend

96. depend(improved)

97. memoryManagement

98. Practice(3)

99. AVLTree★★

100. MinMaxHeap(1)

101. MinMaxHeap(2)

102. Helloworld

103. MinMaxHeap(3)

104. MinMaxHeap(4)★

105. RealScanner★

106. CFGReader★

107. Table-Driven-Scanner★★

108. ScannerImproved★★

109. StrangeDictionary★

110. LayoutManager

111. WhyJava?

112. CFGReader-CLF★

113. CFGReader-RLR1★

114. CFGReader-RLR2★

115. CFGReader-First★

116. CFGReader-Follow★

117. CFGReader-Table★

118. CFGReade-Parser★★

119. CFGReade-LookAhead★★

120. practice(4)

121. PrefixSum

122. Philosopher

123. SleepingBarber

124. ConsoleDisplay

125. ConsoleBoard

126. ConsoleBoard-improved

127. Console-rummy

128. AVLTree-Remove★★

129. CFGReade-LR(0)★★

130. CFGReade-LR(1)DFA★★

131. Console-Rack

132. Hash-Table★

133. PrefixSum-Multi

134. PrefixSum-final

135. Console-Player

136. CFGReade-LL(1)Symtab★★

137. Platform&Bridge

138. LL(1)Symtab-debug★★

139. WordRover(1)

140. WordRover(2)

141. LL(1)-3-add-code★★5/4

142. WordRover-ultimate★★7/4

143. Parallel-Rank-List 8/4

144. WordRover-perfect★★9/4

145. Transaction

146. CFGReader-moon1★

147. CFGReader-moon2★20/4

147. CFGReader-moon3★★21/4

148. Multiple-Reader 28/4

149. 24Revisited 2/5

150. Vigenere 3/5

151. JapanCode 10/5

152. Polynomial-revised 25/5

153. Dependency-Reader 28/5

154. Dependency-Set 29/5

155. Dependency-Key 1/6

156. Dependency-Canonical 3/6

157. CallBack-Template 4/6

158. Dependency-Application★★ 5/6

159. Random-Data-Generator 13/6

160. QAR-Project ★17/6

161. Enigma-failure 27/6

162. Enigma-Success★ 29/6

163. SQLServer-Connector 5/7

164. Replace 7/7

165. 15Puzzle-Failure 8/7

166. SequenceDFA ★★?/?(a year ago?)

167. 15Puzzle-AnotherFailure 12/7

168 water-allocation 14/7

169. BloodTest★ 18/7

170. BloodTest2 19/7

171. Labyrinth 23/7

172。 Snake 25/7

173. MySet★★ 27/7

174. MySet-PowerSet★★ 29/7

175. Huffman 10/8

176. NaughtyBoys 16/8

177. Elevator1 21/8

178. Elevator 2 22/8

179. repeatFinding 25/8

180. tracker 29/8

181. file-transfer 13/9

182. SimpleVector 15/9

183. FTPServer 17/9

184. FileTransfer★★ 21/9

185. Lempel-Ziv-1 3/10

186. UDP★★ 11/10

187. LCS 19/10

188. LCS-experiment 8/11

189. monotone 10/11

190. monotone-analysis 12/11

191. goback-N★★ 14/10

192. Dynamic-Programming★ 17/11

193. LCS_counting 17/11

194. goback-N(largeSequence) 20/11

195. PocketRuler 26/11

196. Bellman-Ford 29/11

197. Scheduler-I★ 02/12

198. Scheduler-II★★ 04/12

199. Template-Vector(failure) 12/12

200. extensible-hashing★ 27/12

201. bitmatrix(trivial) 07/01

202. unix (practice) 14/01

203. searchString-Linux 22/01

204. dynamicArray-Linux 24/01

205. SRC-Linux 30/01

206. TicTacToe 26/02★at nick of time

207. File-Server1 26/03

208. 3-CNF(naive) 27/03

209. 3-CNF(slight-improved) 28/03

210. minishell ★ 30/03

211. file-server2 ★ 05/04

212. quantum-collision ★ 09/04

213. quantum-scheduler ★ 22/04

214. inexactmatch 04/05

215. bigNumber(trivial) 14/05

216. inexactmatch-DFS 10/05

217. inexactmatch- pureC 30/05

218. GlutObject 12/10

219. CNF-Converstion 12/10

220. Transformation(trivial) 15/10

221. helicopter 16/10

222. cnf-sat 21/10

223. 15puzzle-revisited 28/10

224. GlutObject-face 28/10

225. GlutObject-Success 30/10-11/05★

226. helicopter-camera 31/10

227. alpha-beta-prune ★ 04/11

228. zebra-tester 08/11

229. zebra-brute-force 13/11

230. shortest-path(scheme) 28/11

231. HEX-game-human-AI 01/12

232. ID3 03/12

233. LatinSquare(trivial) 15/01

234. FirstJava(RMI) ★ 30/01

235. gifPartition (first MPI) 04/02

236. BankServer(CORBA) ★★ 22/02

237. Quantity(template)★ 26/02

238. MinimalWeight★ 03/03

239. MinimalWeighy(MPI-Imp) 04/03

240. Comb-Algo-Prog 05/03

241. BankServer(Web)★ 07/03

242. MinimalWeighy(Final)★10/03

243. Trotter-Johnson 15/03

244. max-clique 24/03

245. sudoku(trivial) 28/03

246. Primary-Back(huge)★★ 13/04

247. Danckinglink★ 14/04

248. N-Queen★ 16/04

249. Comb-Algo-Final★ 09/04

250. HowEasy 29/08

251. RemoteWakeup(fake) 30/10

252. Reg-Sample-Sort 08/11

253. ConvexHull 04/01

254. ConvexHull-display 06/01

255. rootReader(trivial?)19/01

256. simplePolygon(trivial?)01/02

257. hibernate(practice)09/02

258. ply-reading(practice)12/03

259. outOfCore(preprocess)18/03

260. RenderEngine(NoWorking)22/03

261. trianGO(game of GO)04/04

262. LinuxDeviceDriver 06/04

263. OutOfCoreRendering 09/04

264. GPU-Programming 09/04

265. chopper2005(forgotten) 09/04

266. OutOfCoreRenderingfinal)15/04

267. zebra-again ★ 01/05

268. bmpReader(temporary)15/08

269. jpegEditor ★ 20/08

270. jpegEditor(Intel-IJL) 10/09★

271. MAPI-readMail(joke) 25/09

272. multi-pro-con ★27/09

273. threadTest(test) 09/10

274. renderBox(huge)★★★16/10

275. matching 18/10

276. basicMessage(practice) 30/10

277. prerequisites 20/02

278. TopCoder(2001-semi) 25/02

279. TopCoder(2002-semi) 13/03

230. My-GDI-SDK(link-only) 13/03

231. MySQL(link-only) 13/03

232. HttpServer(link-only) 13/03

233. HttpServer(multi-thread) 25/03

Legend:

1. ★ average

2. ★★ good

3. ★★★ no such stuff!

Code competition

1. CodeCompetition

2. CodeCompetition No.1

3. CodeCompetition No.2

4. CodeCompetition No.3

5. CodeCompetition No.4

Record

{So it is said. So it is written.}

1. Probability

2. Hardware

3. C++ programming

4. Misc

5. Discrete mathematics

6. Newcomer

7. Java

8. database

9. number, number, number

10. memorandum

11. scheme

12. graphic

Footstep (Assignments)

1. Comp229

2. Comp335

3. Comp352

4. Comp348

5. MyView

6. MyReview

7. MyIdea

Tutorials

1. comp6231(2006summer)

2. comp5461(2006fall)

3. soen423(2006fall)

Download

1. MyTree

2. Square root by MASM

3. Square root by MASM (improved)

4. Assembly assignment

5. input of LogicMatrix

6. output of LogicMatrix

7. chessboard

8. source code of chessboard(cheating)

9. head of Logic lib

10. cpp of Logic lib

11. Logic library file

12. Assembly assignment (final verstion) (win98 OK, XP cannot see mouse)

13.input matrix of shortest path (Dijkstra).

14. Result of Shuffle

15. input of minimum DFA

16. input of Scanner

17. input of CGReader

18. input for strange dictionary

19. input for testing strange dictionary

20. WordRover experience

21. Manual of comp346

22. Moon-Machine

23. My compiler project

27. Dependency

My Collection of DVD's

My Favorite Show

My future???

When chapters in memory become scattered,

when pictures in brain become blurred,

we can only seek answer in digital stored solution.

(Came here before? This might be what you are looking for.)

The dirt and dust from my pilgrimage form the oceans of stars... (my main page which is in Chinese)

It all starts like this... (Do you know why you can see these garbage?)

The day-dreaming-gossip is so long that I save them here and here you will only see the latest ones.

08/11/06

When I looked at it, I didn't see it; When it was removed, I felt its existence; When it was brought in, I realized its significance; Finally I carve its figure in my heart and then I get a visual; This is called recognition.

From time to time, I was bothered by a simple question. Which way is easier for us to notify? To add a small tree into a forest or to remove a small tree from a forest? If this is considered as a meaningless question, then how about this one? To add a tree in a grassland where no tree is there at all or to remove the single tree from grassland so there is no tree in grassland. Which way is easier to notice? Probably same and most people would say that.

If the above questions are all nonsense, then how about this question. In a structured system, say an AVL tree which means a balanced binary search tree. Does it cost same when you either add one element into the tree or remove one element from the tree? Not exactly same because it depends how we implement the structure of AVL tree. In some data structure, maybe removing is easier. So, back the above question, it depends. It depends on how you construct your knowledge system to represent what you see and how you implement a "fast-recognition" algorithm.

Of course the above comments are all garbage which I don't believe myself. I finished the "regular-sampling-quick-sorting" of MPI.

14/11/06

Yesterday Dr. Hopcroft came to make a lecture and here is some inspiration from his lecture. Or precisely it is simply what I remembered.

24/12/06

I guess the origin of AI is from vision because it is the most intuitive method to observe and recognize pattern. Maybe all high-level concepts need to be first transferred into visual image before comparison and recognition are done.

4/01/07

Convex Hull is a typical algorithm that the definition gives out the clue of construction itself! See, the definition says that any edge of the two vertices in the convex polygon will leave all other vertices in its right-hand-side. And the algorithm takes advantage of this. After the lecture I spent about one and half hour to finish a simple implementation of this algorithm. When I finished, I noticed the name of algorithm is "Graham's Scan-type". I am happy because it proves I am still capable of coding after so many months. Even though I am doing the MPI programming which is far more hard than these kind of single-machine programming.

14/01/07

99% of Chinese ancient philosophy is purely mysticism which is practically useless except for fortune-telling. Their dirty trick is to use as many as ambiguous terms, words, concepts, expressions etc. to express something so ambiguous such that they can always explain themselves if you are foolish enough to give the truth before asking for prediction. Most defenders of so-called Chinese traditions feel so blindly proud for this kind of useless philosophy and claim it to be unique. Let me quote President Bush to comment on this: Shame on you and a fool cannot be fooled again. (These are so popular in "youtube" and surely you will find it by searching "Bush") However, there is something I also feel like to note down and it is one of my favorite. For those who consider themselves as guru of programming and experts of AI, this might be interesting. "Expressions themselves cannot be expressed; Names themselves cannot be named." This is the very first sentence from <DaoDeJing> which is one of most famous ancient Chinese philosophy. And maybe it touches the most profound and most basic topics of language and origin of intelligence.

01/02/07

It is said that I think, so I live. In order to prove I am alive, I write a simple algorithm to generate simple polygon from a set of points because I only think when I do coding. Thus I live when I am programming. The trivial algorithm is inspired by assignment from comp6711.

09/02/07

Professor C's lecture must be interesting. However, it is really a headache for me to understand those proofs' of Erdos. I guess I never have talents for math because I simply have difficulty understanding all those stuff related with continuity. Even for discrete math I learn them more from intuition. Anyway I enjoyed myself by reading those stories about mathematicians'. Women may be natural enemy of math. So, math may be natural enemy of women because enemy is a kind of relation of symmetric. And it must be very rare for a woman mathematician married with a man mathematician who coincided with related theorem of same problem for which Erdos called it "Happy End Theorem". And what's more interesting is that Canadian mathematicians were said to be Maoist in 70's because they talked about "Reactionary Math" and "Revolutionary Math" in the sense how easy they can be understood by layman. Like the "Friendship Theorem" which is expressed such as in a group of persons each of them has exactly one common friend and there exists a politician who is friends of everybody. And these are all math I can understand. :)

Another old story is about number which I sometimes find very unfamiliar after long time rendering about. What exactly is number? Maybe from perspective of computer, they are infinite statically predefined variable names such that can be dynamically used as helper of counting or memorization. I mean we simply take for granted that we know how to calculate difference between numbers which I think is purely depended on encoding. For example, binary or hexadecimal would be a completely different story of calculating the difference of two numbers compared with decimals. When we discuss about computation complexity, we naturally ignore the computation complexity difference between different number encodings. This maybe the only thing I learned from "design and analysis of algorithm" in which we describe the size of problem in its encoding length. Therefore the different number encoding will play an important role in size of problem. Say a number is represented in binary format must be much bigger than decimal and then the calculation of time complexity of algorithm maybe much different. And perhaps if we human can find an as easy way to store and calculate vector as natural numbers then our math will be completely different.

10/02/07

In the era of Cold War, almost all extremists like to label themselves as communists. Nowadays they like to expose themselves as terrorists.

The "hibernate" program is really an irony for myself. The original intension of it is simply to schedule a timed shutdown of my computer to force myself sleep early instead of watching the internet TV till very late in night. However, coding of such a simple program simply took away my sleep of the night because it is first time for me to handle the windows privilege accessing rights which is a bit messy. It seems to me that Linux tends to store these rights in data while windows tends to associate these rights with operations. Both approaches have its limit and disadvantages. The password file is a dilemma for Linux because it belongs to everybody and cannot be accessed by everybody. Operations or methods can be distinguished with privileged or not. However, the methods maybe the most dynamic part in software engineering. Thus maintaining is practically difficult.

Today I think my mind is becoming clear about the depth-buffer algorithm after I was pushed to give a clear definition of input and output. Indeed, let's note down this: "Well defined, well designed".

Suddenly I see the essence of "sweeping line" algorithm. It is used to do a kind of sorting job when the searched and the searching objects share a same "well-order" property. The status structure is a currently "working window". The event queue is as its name indicated, the trigger of our handling operation. The size of event queue decides the size of problem. The size of status structure decides how efficient our algorithm is. The event handler is the key of algorithm.

02/03/07

What is incomputable question? You setup a communication protocol with your receiver such that she will reply Yes when the message is correct, No when the message is incorrect and Don't Know when she doesn't know how to answer. However, what if she doesn't reply? The problem is exactly the example of incomputable problem.

The word "voronoi diagram" sounds to me like paranoid which is a total chaos. For the whole lecture I was almost in lost.

09/03/07

There is a nice design of WOW, the parental control, which can constraint the playing time. And I made my mind to restrict my playing time to only two hours per day and at the same time trying my best to forget the password of parental control. If worst case happens, I can send the password to my friend and ask him to change the password to prevent myself from modifying the schedule. It is the only way of starting my project.

12/03/07

It is said that in this world only two kinds of people are unable to read properly. One kind is blind people. The other one is those who refuse to read or believe what they read. I am the second kind. The "ply" header reads clearly it is big-endian, but I just refused to believe it. Sick and silly.

18/03/07

Zealot yells: I long for combat!

It is such an exciting moment to face challenge! When the going gets tough, the tough gets going!

30/03/07

Coding work requires you to have cold blood because your brain needs to be cooled down. Coding work requires you to have hot blood because your heart needs to be warmed up. So, you become a cold-blooded, warm-hearted, passionate, emotionless hybrid.

When I was twinkling with DCEL, I got an "Internal Compiler Error (C1001)" which didn't make me slightest panic at all because I know there must be somebody else running into it long time ago. Let me hold it on for an hour before checking Google.

Do you like ICE? I don't, because it is really an annoying thing. What is ICE? It is "Internal Compiler Error". They said it is compiler bugs and some guys give a simple example to indicate such kind of errors. It is like a kind of pseudo C++ syntax. For example, declare a class within a function and pass the parameter of function to member function of nested class. Is it valid. No, but compiler doesn't give an error when do syntax parsing or P2 or 2nd pass. And when compiler needs to generate code and finds out the error. LOL, and my case is a little bit similar. I declare a static data member which is a type of struct such that it has another static data member which also has static data member which is struct. Am I crazy? Or do I make compiler crazy? Maybe both. Anyway I must finish DCEL today! This morning I have wasted a lot of time to fix my last bug of "out of core rendering" which I really hope is the last bug. I re-calculate the size of leaf octree node such that it won't waste too much file storage. Also I fixed the single "break" bug which "inflates" data file by many times.

31/03/07

I must be a fool! Such a simple algorithm of triangulation takes me half day of tracing!!! What a simple rule! You just count the internal convex hull vertices and also count the internal convex hull vertices. Is that too difficult for me to figure out? Why do I use a combined counter for both internal and external convex hull? You know, you cannot cross the limit, don't you? I was doomed to be starving to death. What a shame!!! Now I am completely behind schedule!!! Can I finish rule of "TrianGO" tonight? I must finish it! Otherwise I will have no time for assignment 3 and quiz on Tuesday! But...

04/04/07

TrianGO go go go!

06/04/07

Excuse 1: I am a weathered hunter who has been hunting vicious beasts in jungle for years and suddenly I am ordered to kill an innocent bunny which I stop killing since my childhood. My mind is a blank for any skills I learned long time ago. Is it a good excuse? The hunting skill should be no different from killing a tiger or killing a rabbit. Yeah... I have no excuse.

Excuse 2: It is like a fever. It makes me sleepless a whole night. I hardly eat. I cannot concentrate my mind. My heart beats 30% faster than usual for day and night. My mind is totally a blank. Does that mean you cannot work under pressure. Yeah... a kind of...No, that is not true. I have no excuse.

Excuse 3: From bottom of my heart, I know it is not mine. I am not ready. It is not ready. Better to let this finish early before my ego inflates to uncontrolled extent. So, beat it. I don't need it. Does that sound like sour grape? Yeah...I know. I have no excuse.

However, my heart beat reduces to only 10% faster than usual and I feel much better after that. Last night I dreamed about the life in CAIEC again. That old business man from Pakistan comes again. My life becomes again the hopeless struggle for those meaningless coins. Before this dream, the other dream is that I found big bugs just before my demo and tried to solved desperately. Compared with the hopeless past, I feel much released. After all I now live with honor and shame.

The data file may not be correct. Let me check from scratch.

I feel much better now. This is a simple example how to make Linux device driver accessible by multiple user.

Dude, call of honour! Go to lab!

There is a time when a victory created a victim; There is a time when a defeat constructed a hero! So, let me finish a rendering engine tomorrow before we plunge myself into debugging.

09/04/07

Dude! Don't underestimate your potentials! You are invincible! Here goes my Out-Of-Core-Rendering project.

Here is the forgotten assignment of GPU programming. It is good that I now recall and post it. Otherwise it might be buried in my computer forever. I don't like this GPU programming cause I think it is a kind of easy if you know the algorithm and I lost interest so soon that I almost forget to keep a copy.

Because of this out-of-core-rendering project, I dig out a long-forgotten project. The pilot control system is what I am borrow and modified in outOfCore rendering. To download full source and data report, you need to go to here.

10/04/07

Finally the demo finished with some success and I am happy that my work is recognized. Dr.M is absolutely right about the "error-checking" idea. I should have this sense before. Let's make a note here. By linearly checking all leaf nodes and compare with the dataset collected by my "flooding algorithm" we will know the error rate. I think the "neighbourhood recursion" algorithm fails to advance when there is some gap between near nodes and far node. How to solve it? Maybe try parent nodes which has less chances of "holes" or "gaps" in space. Another thing is "GlobalMemoryStatusEx" API. Let me use this at beginning and "exhausts" user's memory for my performance! hahahaha...

17/04/07

My most respected Chinese writer has a famous saying about literature. It is like this. Either you play with literature or you are played by literature. Replacing literature with program suits perfectly with my idea.

18/04/07

Comrade Stalin in <Red Alert> says: Killing one person is killing; Killing one million of people is just a number. Yes, indeed in USA killing a person becomes a news. And in China it is just a number. It is said at the same day exact same number of coal miners were killed in an accident. That number happens to be 33.

25/04/07

Passion must be a kind of chemical energy which drives you forward even though you are starved and exhausted. And I am starved and exhausted with IJG library. Using pure C library which aimed to be portable in all platform, various compilers, multiple purpose is a nightmare. I think the only possible error of linking I got maybe comes from the type of function pointer which acts as a parameter in those functions declared in library. Otherwise I will surrender by giving it up after almost three days futile tracing. I am really hungry now, with hands shaking when typing. Sometimes I really suspect computer science is the most cruel master whom you have ever served because it makes you feel like an idiot all the time.

01/05/07

Zebra-again!

01/05/07

"Without brain the body cannot live." Morphius told Neo. <The Matrix>

07/05/07

Can you use vector to store an array? Yes, you can, but you must be careful because an array is basically a constant pointer which will pose difficulty for vector. See: typedef int IVector[3]; typedef vector<IVector> FaceVector; ...

09/05/07

The price of loyalty must be much, much bigger than the price of freedom.

15/06/07

Totally clueless! To be better to deal with insane world, should you be more insane or more sane? MPI sometimes is a puzzle.

If someone considers about finding brain teaser, this is not a good one because it will only cost you ten minutes of brain exercise provided you know what algorithms is instead of how algorithms spells because as a computer science student you should know what complexity of an algorithm like this can be.

28/06/07

I long for combat! It took me 12 hours in lab to finish debugging of my Linux-version! It finally works!

Again the Great Mokhov figures out the riddle even faster than I can imagine!

30/06/07

The marvelous comment from <Yes, Prime Minister> about British press by Prime Minister.

07/07/07

I seldom understand man page and this time I find more convenient to write the simple "find" for myself. Then I find the strange thing that command line parameter cannot have "*" as wild char.

10/07/07

Actually the "simple find" has at least two big bug in linux version. Do you find it?

02/08/07

A day of chaos! First I found another problem of windows API--GetTempFileName. The programmer must be very naive to believe that any program at most only uses 65535 temp files cause he simply uses a short int to increment without checking it reaches 0xFFFF. Linux version of mkstemp is much better because it uses 6 wild char to make unique file name and opens with "exl" to make sure no one open it before. Say 26^6 is much reasonable compared with 65535. (However, indeed my requirement is weird. Just imagine how many programmer will use temp file to pass parameter in order to save memory usage in stack? Can I blame MS windows?) Although I highly suspect it might help by running more processes than number of nodes, still I have to give it a try and various weird things come out. HP MPI allocates ranks not in usual "modulo" policy. i.e. 14 process for 7nodes, node0 got rank0 and 1. And in other MPI, node0 gets rank 0 and 7. So, it is like this: mpirun -srun -n 14 ./myprogram.exe. But be noted that you must make sure "master" runs on display node. But again, program crashes after a few seconds which never happens before. Clueless!!!

11/08/07

To compile with __stdcall, use /GZ in compiler option. To compile with __cdecl, use /Gd. And they are before function name after return type. OK, finally I give up the efforts to make it a real dll because it is said the file pointer cannot be shared between dll and caller. It is reasonable because "file library" is simply a library and the FILE struct is definitely a local struct unless you use file HANDLE which is OS-wise. So, let me keep a handy version here.

21/08/07

Nobody claims he/she likes my tool!

06/09/07

Suddenly I can see ...

10/09/07

So, this is second edition of jpeg editor. The only big difference is that I am using Intel Jpeg Library which allow you to decompress jpg to memory. Here is the Intel Jpeg library.

26/09/07

It is a joke, but a good joke. This is the a performance comparison between conditional wait and naive mutex. The result is really stunning!

27/09/07

It is a simulation of a scenario of my project. And I think it is not a trivial problem. This is the only one I feel a bit satisfied because the previous jpeg tool is simply a modification of ijg which can be considered a bit trivial. Sometimes I even feel shameful to mention it at all. I happen to see an old project of my predecessor in his computer which also uses the code from "game tutorial" and the code is very similar to what I am doing. So, it is a bit trivial which means common people would do the common thing. That is what I mean trivial.

16/10/07

Here is my project that I have been working for more than one year!

18/10/07

HPMPI does support multiple threads who are making MPI calls. You only need to link with "thread-compliant library" by "`-libmtmpi".` And in SVA_conf, there is a specific node lists of "compute" nodes which are in LSF. So, I can use it if I want and if my "compute" nodes don't require X-window. But the problem is "sva_remote" may require x-window to be setup??(Let me try and see!)

<MPI: The Complete Reference> is really a great book and I begin to understand it after one year when I borrowed it from library a second time. It not only addresses users but also discusses with implementers in many interesting subjects. i.e. Generally speaking, the sending buffer will not be altered by MPI, but it is not recommended to be accessed before completion of sending. The author gives an argument that maybe implementation involves DMA moving data from buffer and the reading may not be coherent with cache. Even I am not fully aware of the exact meaning, still I am convinced with the point. MPI_Waitany is an interesting thing and I will use it in my code because I am stupid to think that it returns an array of indexes. The "short-protocol" and "long-protocol" in non-blocking communication is really like a "two-phase-transaction" and "three-phase-transaction". And it aims to solve the possible "starvation problem" when large message blocks for progress of other message sending.

"P-completeness" is interesting. "Bandersnatch": A fleet, furious, fuming, fabulous creature, of dangerous propensities, immune to bribery and too fast to flee from. Lewis Carroll, Through the Looking Glass, 1871.

matching...

19/10/07

No strategy is the best strategy!

21/10/07

Even as stupid as Forest Gump can figure out he is stupid. You see, you don't have to be smart to realize your algorithm is shabby. Isn't this important for an Intelligent Automation system to have such a simple algorithm to figure out if it is a good or bad algorithm no matter however complicity that one might be. It should be essential for a generic evolutionary program.

Mama told Forest that he must make the best of what God gives him. And his life is like a box of chocolate that he never knows what is inside the box. Now the question is like this. Is it an optimization problem or decision problem to make the best of what God gives him. When we say decision problem you only have to answer yes or no to a statement like whether Forest can become a good soldier or not, or whether Forest can become CEO of Apple corporation. However, when we say optimization problem you not only have to answer the yes or no for that statement, but you have to give a detailed way how to fulfill that claim like what exactly Forest needs to do to become CEO of Bubb Shrimp Corporation. So, this is really a difficult question. Suppose it is a simple decision problem, then Forest might have to try various career in his whole life to figure out what he can make the best of what God gives him. Common people simply don't have that damn luck to try out so many roles of life, war hero, ping pong player, shrimp boat captain, owner of Apple corporation etc. I tried once in my life and it takes more than ten years to find only one negative answer. How many should I try?

22/10/07

This winter there seems to be two good news for Canada. One is the loonie is soaring like a loony. For the first time, I think, one Canadian dollar is even more valuable than one US dollar. Is it good? It depends. Another thing is that it seems this winter will turn out to be a warm one. It is very warm today and it is almost end of October. Isn't good? It depends. As if it is a consequence of global warming, then it may not be a good news for many people on this planet. Actually what is good news? It is said no news is a good news. CNN news host is a kind of aggressive. Religion issue is used as a political signature, at least for potential voting behaviour. And there is one interesting thing they mentioned about Islamic. It is said its expansion is, quote "by reproduction"; Whilst Christen is expanding not only by reproduction but also by conversion. What an interesting pattern of religion! If you were born in a Islamic family there is huge chance you will become an Islamist. Most people argue that every religion should be treated equally, just like people from different region or racial origin. But is it true? People are born unequally and we want to ignore their difference intentionally.

23/10/07

When Hugh Grant asks Julia Roberts that if she always say "No" to everything, she hesitates and say, "No".

27/10/07

Do you know or do you not know?

25/11/07

I always consider NP-complete problem as a kind of dirty trick of encoding. They play with concept of problem size over the time complexity of algorithm. Just imagine that if you consider Travel-Salesman-Problem has a problem size of O(N!) then why do you still consider we haven't found a faster algorithm. You are presented with N! choices and without scrutinizing all of them can you be sure enough to see the best solution? I still remember clearly the counter-example given by professor to illustrate the trick of encoding when considering the time-complexity of algorithm. Say you are given a decimal number and you have an algorithm for finding all prime number smaller than it. How would you calculate the time-complexity of your algorithm? based on size of encoding of decimal number or based on size of encoding of binary number? Turing machine can only do a linear probing and modern computer can access memory randomly. Do these factors change the time complexity of an algorithm? Suppose you are using super-scalar machine to do matrix calculation, do you consider you are advancing in algorithm efficiency? What kind of advantage do we borrow from our familiar natural number system? Say by establishing an isomorphic mapping between actual problem with a consecutive sequence of natural number, we actually are able do a binary search instead of linear probing. However, the procedure of establishment of this mapping is not always successful. It requires the problem to be of equivalence class which has reflexive, symmetric and transitive property. What if our natural naive concept of number system also includes logarithms or trigonometrics?

29/11/07

I heard some "magic" algorithm from my friends and they are the killer of one's confidence. So, don't read them if you want to be happy.

07/12/07

If I have time I will add a small improvement such that the octree leaf nodes will be assigned to the render nodes to which they were assigned in previous frame. This will reduce the file-mapping overhead when viewer moves its view point.

11/12/07

The seminar is brain-shocking! Professor claims that there is a misconception regarding TSP: the problem size is not the source of its difficulty! What an amazing statement! But I have to admit he is right and I once again being wrong. Even he himself admits that he doesn't know what makes the TSP so difficult. Maybe it is the nature of all problems.

10/01/08

To bypass nfs setup in linux, you need to login as single. It is "kernel" plus single. To setup printer in Linux, you go to printing, new "printhost-um" which is a "samber" service by adding printer name as "shared". Then choose "postscript".

15/01/08

The thing scaring me very much is that I try to break the dependency to achieve parallel computation by redundant computation in parallel. However, what if the nature of dependency is such that whenever you "intentionally" create redundant work to try to break the dependency you might suffer more than you gain. Or in other words, dependency is the impossible leap you want to make. You pay the price to buy something and the price is only a result after you get what you want. But you don't just pretend you pay your money and expect what you want "automatically" comes to your hand, isn't it? This is something I feel frightful. Parallel computation seems to me is more and more like a perfect way of wasting our "precious" computation resources. People in 60-70's worries about memory usage so much that they might want to share same constant value between code and data. Whatever algorithms which makes extensive usage of memory might be regarded as dumb one. Nowadays nobody really cares about memory cause it will someday become as cheap as disk. Maybe only when cluster nodes are becoming common equipment of every family then some of our parallel computation idea may look like feasible.

30/01/08

What a shame! The only available tool for png file is "libpng" which is as ugly as "ijg". I spent a whole day to compile and made a small adept for convinience. Here it is zlib which is required for libpng.

08/02/08

What is new?

19/02/08

int x=10; ++x=x++; printf("x=%d\n", x);

What is output? I said 10, microsoft said 12, Linux said 11. What is your answer? I think this is a purely compiler issue. Imagine that VC++ simplifies "x=x++;" to be simply "x++;". And if you believe x=x++; is equal to x++; then you may not find surprised about x=12. I tried vc2005 and change optimisation settings, but it remains 12.

(WH informs me that x=x++; is syntactically nonsense to C++ standard because they don't think it makes senses. Therefore it is up to compiler to decide what they are going to do. In VC, it translates into x++. That is why x=x++; is different from y=x++;)

The phrase "the pursuit of happiness" is originated from "Declaration of Independence" and it is used as a film title which reflects the "American Dream" of many common people. It took American eight years and tens of thousands of lives to pursue their independence and for a common mortal such as you and me it may take more. So, naturally I am not happy now because I am in the procedure of pursuit of my happiness which may never come even till the end.

ok,ok, finally I read the STL careful enough and find my solution. If the system doesn't support set<T>::insert(set<T>::iterator, set<T>::iterator); then you can use this "copy(set<T>::iterator, set<T>::iterator, inserter(set<T>, set<T>::iterator));". Isn't it a lovely solution? I get this from the book <C++ STL> by Nicolai. The heap is very neat.

25/02/08

There are countless problems waiting for you in TopCoder and I am pretty slow in coding. Here are what I have done in past few days.

12/03/08

Question: Should Http server be stateless? Why is HttpHeaderKeepAlive not working? Because it is, quote "massively misunderstood", end quote. By default http1.1 allows connection be persistent unless client asks to stop. My mistake is to assume "request id" remains the same between requests which is wrong.

Windows Live starts a new free service called "sky drive" and it gives me a chance to store my project there because I really run out of my space in this web hosting. Sadly I think I will not continue my little GDI SDK(I called it for myself.) Let's save it here for future. In my home old computer, I start a purely C-based web service. It is using "my SQL" C-API to access database, using "windows httpAPI" to implement the simplest http server. Currently it only concentrates on binary files web browsing which I think is only challenging part for me. So, in all, it is a purely C program. (http server part are mostly borrowed from MSDN sample, but I changed and plan to change a lot.)

This is a stand alone "MySQL" access project which also acts a dataset inserter. By the way, it calculates MD5 of file as a signature to make sure no repeat picture or music is inserted. Of course the MD5 part is downloaded from wiki, but it is not that complicated.

My HttpServer+MySQL kit requires a small thing for compiling. It needs http.h+basetsd.h(replace) from "platformSDK". PlatformSDK is supposed to be compatible between VC6 and VC200X, but you need to update the "basetsd.h".

By the way, here is my experimental web site with my home old computer. http://76.68.250.205:80/

25/03/08

Finally I finished my multi-threaded version. It takes me so long because I am quite busy and the conflicting problem between VC6 and platformSDK takes me about one week to fix. Now it is a stateless http-server with one listening thread + multiple DB threads. Here is the backup. And here is the server, the content may contain nudity and mature material, viewer's discretion is recommended: http://74.12.223.226

02/04/08

This is very educational and I copy the discussion here for future reference!

Do you want to know the weather in Montreal? see here.

write email to me