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. PlatformAndBridge
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-List8/4
144.
WordRover-perfect★★9/4
145. Transaction
146. CFGReader-moon1★
147. CFGReader-moon2★20/4
147. CFGReader-moon3★★21/4
148. Multiple-Reader28/4
149. 24Revisited2/5
150. Vigenere3/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.
Elevator2 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-Success30/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
Travellog

video
online
Yes, PrimeMinister
Yes, Minister.
My future???
find everything here
|
Diablo Forum
 
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.
24/09/10
ec2-run-instances myami -k mykey --block-device-mapping "/dev/sda1=mysnapid:20:true"
sudo dd if=/dev/zero of=/etc/4G.swap bs=1M count=4096
sudo resize2fs /dev/sda1 sudo mkswap /etc/4G.swap sudo swapon -f /etc/4G.swap in /etc/fstab add line /etc/4G.swap none swap sw 0 0 To check swap: free
Note: in ec2, /mnt does NOT belong to your ami. Do NOT leave
anything their! So, you cannot create swap over there.
03/12/10
Finally I can take however vacation I want, if I can afford. Yesterday
morning I was chatting with Alex about the so-called everybody's dream:
unemployed richman, then in the late afternoon I was informed that I
would be able to become unemployed poorman right before X'mas. Poorman
as I have been all the time, just occationally I become employed or
unemployed. However, I feel released and relaxed, also a sort of happy,
like the kind of feel after orgasm. Void and relaxed.
Freedom comes with the price
of eternal vigilance. Any race or individual evolves because of
pressure of survival. And it is always to place yourself at edge of
abysse.
Actually Amazon wraps all
AWS api into sdk. The ec2 api lib is an 2009 version which is a sort of
obsolete. I understood this just a hour ago.
Isn't it good for me to do
my own freestyle coding all day at home? I am looking forward to this
soon. Nevertheless who can pay my bill? Last month's bill of AWS is
more than $600, a even 15% increase than previous month! Damn money!
15/12/10
Don't cry for me, Argentina.
As for fortune, and as for
fame, I never invited them in. Though it seems to the world they were
all I desired. They are illusions. They are not solutions they promised
to be.
To be here or not to be
here, it is a question.
04/01/11
My little DVD ripper which
is based on open-source tool DVDcss
and what I did is simply add a handy command line parameter. Of course
I also modify the code a little bit because original one copy and
concat all VTS file together. But using this libdvdreader means I have
to depend on libdvdcss as dynamic library. This is painful. What I can
remember now is that I ran into some error of libdvdcss.
20/05/11
My guess is
that your brain is part of your eyes and verse vesa.
02/06/11
Arrived in
LA.
Compilation of blender is not a trivial job. When I say "compilation",
I didn't mean just typing configure/make. What I mean is to create a
codeblocks project. Of course, cmake can create it for you, but I find
it hard to understand and not convinient for modifying as the project
purely uses a external makefile to compile.
The thing goes more complex when I intend to create a minimal project
for "render" as I don't want to include gui editor, for example.
However, I found it almost impossible or too difficult for people like
me to achieve. One of time-consuming job is to add search path for
"included" header files. Of course they are done in cmake files by
program. However, I have to do it one by one in codeblocks, especially
I start with as few source files as possible to probe in blind to hope
they don't require more sources/headers to be included in this project.
Well, it turns out I have to include almost entire project! What a
design! This reminds me the approach of C when we worked together in
LM. He just managed to use a perl script to copy all sources/headers
into a trunk directory to compile the "mixed soup". And he has to
manually change all "include-path" to exclude "relative path", i.e.
only file name remains in Qualcomm's code. Now I can feel his pain. At
that time, I just want to argue with him.
A second painful thing tortured me a whole night when I was dreaming.
The "makesrna" is creating some problem with "multiple-definition"
which gives me no clue. Obviously if someone know how to read in
English should be able to guess that this is supposed to be a separate
project or tools which will automatically generate some source code
files. That is the mystery
of blender files saving magic.
Clearly I read it last night, but my brain seems to be insulated to be
injected with the hints. Under the "build" directory, cmake generated a
lot of "rna_*_gen.c" files which should give me a clue that I should
only inlucde these "generated" source files in project and all other
sources in "makesrna" are fuels for generating. (Also it is really
amazing for cmake to do this complex compilation. As for codeblocks, I
have to create a separate project,
named "makesrna", to generate these sources.) And what makes things a
bit tricky is that two files are needed both for generating and using
for later compilations. They are rna_access.c/rna_ID.c. Of course here
I just assume we both understand that header files are unimportant to
include or not as long as you just add "search path" in codeblocks.
Still I have to figure out what exactly library to be added. "link.txt"
in cmake gives very little info this time???
Well, it took me more than 14 hours to create this blender-render project of codeblocks.
Nothing special, just to compile blender! It is not exactly what I
expected as it almost include all of blender instead of a tiny-fast
render. (It only exists in my illusion. Of course with this step stone,
it is possible to cut all unnecessary parts from rendering.) And it is
based on newest blender2.57 which down-ward compatible of all old
version blender file. So, it is a great start to me! Does this guide
help? I am not sure as I just look into it in the middle of my struggle
and it gives me little hint how to follow it. People in blender org are
terrible-busy genius and don't bother to give stepbystep instruction
for beginners. So, you would better to rely on the standard
"cmake/scons" to do the compilation.
For some reasons which was unknown to me a moment ago, my synaptic is
broken. google doesn't tell me anything very useful and then I realized
that it is python3.2 which I upgraded for blender. I guess even
"aptitude" itself relies on python2.6 as it keeps giving out syntax
error of configure files. Then I changed the symbolic link in
/usr/bin/python to point to good old 2.6. WOW, everything seems to be
normal! DO NOT UPGRADE TO PYTHON3.2! Only compile and link for your
project only!
Yes, I can see why linux can only become toys of programmers. How can
you imagine common users to deal these day-in, day-out issues?
03/06/11
Yet, it is
incorrect! The problem is still with python3.2 which is required by
2.57 while all other 2.5x requires only python3.1. The official version
recompiled with correct python turns out to be right, but my version is
still not right. Now I truly understand my problem of multiple
definition of "makesrna" which has a "include xxx.c" for each generated
"rna_xx_gen.c". I hate people who use "include x.c"!
So, it is not my compilation problem, even though linking with static
python3.2 still has problems. It is the "script etc." of blender. I
need to add all stuff in "release" folder to my project which contains
all python scripts for running. Good to know and it takes me more than
8 hours to figure out! Funny??
04/06/11
Finally I
think I make it right! This is the correct version of "makesdna","makesrna","blender-render"
codeblocks project files. You need place them in blender-2.57/2.57b
folders. The position is critical as all search path are relative
paths. dna==>rna==>render.
I don't know exactly what happened. I just check the cmake file to copy
all "switch" into defines of project. Probably I didn't enable all
options. It is misleading as previously official version gave exact
same ray-tracing error when using python3.1 instead of python3.2 and
this makes me suspect linking error. Chaoes! OpenMP doesn't work!
And this is package which
gives the postion of projects.
It is good to know:/etc/profile, /etc/environment, ~/.profile,
~/.bashrc(~/.bash_profile if it exists.) This gives order of your
environment setup. And .bash_history gives you more than "history".
It is a long story for a longest day and night. It all starts with my
AMD 1055T which has 6cores, but Ubuntu10.04 seems not be able to
recognize. Therefore blender will only use one core even though you set
parameter to allow multiple threads to do rendering. Based on this
observation, I have following assumptions and actions:
1. For some reason, ubuntu is unaware of exact model of my cpu, and not
be courageous enough to allocate jobs. (In System Monitor, I can see 6
cores and /etc/proc also show correct number of cpu. So, I tried to
download bios of motherboard from Asus. Updating mother board bios is
far more easier nowadays than before. You just copy it in one of your
windows drive(no linux file system) and EZ-flash allow you to uploading
bios to rom. (Of course you must be very careful to reset all setting
to default, no overclocking!) Then it seems Ubuntu can recognize my cpu
model.(It is really unbelieveable as I bought this PC from NewEgg last
July and the bios version showed on screen when booting is dated Jan,
2010. It is just six month old! However, I check website of Asus, the
bios version jumped from 0629 to 2215 within six month! What a
development team! )
2. In the meantime, I want to confirm that Blender indeed does correct
multi-threading and Ubuntu is able to allocate multiple thread to
multiple cores. I clone my blender project in my AMD Athlon-due-core
laptop and it uses two cpu when multi-threading. So, it is all due to
my AMD 1055T cpu.
3. Also in the mean time, I am trying another approach to
forcefully set "cpu affinity" so that thread will be created on
different cpu. And after hours googling, I found this API and sample
code.
Actually you can see example when you man
"pthread_setaffinity_np". Then I modified a little in Blender
where pthreads are created in source file
"source/blender/blenlib/intern/threads.c".
It makes me feel some kind
of satisfactory after coding as I am trying to contribute to Blender.
However, compilation gives me some trouble: a simple macro "CPU_ZERO"
etc cannot be found by linker. This is ridiculous as it is just a macro
and you don't even need to link with pthread. API pthread_setaffinity_np
is ok, but why this macro! The search path is fine. And my glibc is
more than 2.33---ldd --version. Wild trial for more than half hour
revealled me that the header "feature.h" in "sched.h" tries to filter
various macro and only allow "__USE_GNU" and "_GNU_SOURCE". Damn it! What a fool am I to waste so much
time on such simple question!
4. After all these are done, my mind is already blown for this takes me
more than 24 hours! And it is all for nothing! There is no question
about modern operating system to allocate threads to different cores.
You don't have to write program to force it to do so. You are wasting
your meaningless life!
Well, I do learn something.
I know how to upgrade my motherboard bios. The last time I did this was
ten years ago. I learned how to use this api. I learned how to compile
it?? I learned how to waste one's worthless life in meaningless stuff.
I can call it a day.
06/06/11 LA SunShine
Yesterday is
my
headache day, literally as I need better sleeping. Today I decided to
go back to Ubuntu64 as blender needs more memory than 32bit Ubuntu can
support when do ray tracing. Then I run into some Python issue, now it
seems to be right, but I don't know exactly what is wrong. Roughly the
issue seems to be related with correct compilation of Python3.2 which
also depends on sqlite3-0 and for some reason my ubuntu64 didn't
install this prerequest before I compile python. This is not treated
seriously until I run into lots of issues when I finally realized that
"python3.2-config" requires some "codec". Strange?! It messed up with
blender which reads .blend file incorrectly. Anyway, I was lost and
have to recompile and it seems right now.
08/06/11 LA SunShine
It is another
futile day as I tried to modify a bit of thread-part
of blender.
It all starts like this: in source
"source/blender/render/intern/source/pipeline.c", I happened to notice
that the threading code is a bit "inefficient" as it uses main thread
to assign job for worker thread. For example, in function
"threaded_tile_processor", the loop is like this:
main_thread_check_if_thread_available;
main_thread_create_worker_thread_and_assign_job;
And for each worker thread, it simply finishes its job and quit.
Therefore main_thread has to create A thread for EACH job. I think it
is very "inefficient" because why cannot we allow thread to find next
job by itself without quit thread loop? And that is simple and
straight-forward. And I thought it might have some sort of improvement.
Here is the code and do you know what surprised me? It almost makes no
improvement. Well, indeed just think it over it is very TRIVIAL for a
thread creation, especially compared with a large job which runs for
few seconds.
09/06/11 LA SunShine
It is another
day of fruitless efforts. I tried to put
threads during ray-tree creation of Blender.
However, it turns out there is little concurrency in that part and it
is even slower in some cases. However, it is a good brain-teaser for me.
10/06/11 LA SunShine
Probably you can say this is
too TRIVIAL, but it takes me nearly two hours to figure out the stupid
python3.2 config issue. My python3.2-config simply doesn't work! It
keeps complaining some strange issue like "make" file cannot be found: IOError:
invalid Python installation: unable to open
/usr/local/lib/python3.2/lib/python3.2/config-3.2m/Makefile
Later I found
some clue (not directly) that it must be related with "PYTHONHOME"
variable. Instead pointing to "/usr/local/lib/python3.2", set export
PYTHONHOME=/usr/local in your ~/.bashrc
It is really annoying to use python or any other scripting language!!!
And I will never in any millions of years use them in my programming at
all. In fact, I don't know them at all, or forget about them just as
soon as I was force to learn them. (perl? I almost forget about them
all.) To compile python3.2, you have to install various "dev" package,
like "tk-dev", "libgdbm-dev" etc.
A very educational user guide
from Yafaray. Here is the yafaray-0.1.1.
11/06/11 LA OverCloud
For a moment, I thought I must
be insane as the header of Blender is corrupted and then it turns out
to be that Blender file can be gz-compressed.
I have been tortured by python3.2 configuration and personally consider
it is a such stupid language as I have no idea of how it works. Later
following instruction of Blender again, I reconfirmed my understanding
that the best way of compilation is to avoid using "scons" which
requires python2.6 to run. However, to compile Blender2.57 which is
using python3.2 and makes it impossible to compile. I don't understand
those guys how make it work. I simply choose to use cmake which is good
enough.
And then I understand the usage of "update-alternatives" which is a
good thing when I need to frequently switch between different version
of python. (For example, you need python3.2 to run Blender, if you
don't setup "environment variable" properly. There is way to simply
restrict your blender to its shipping Python3.2 by setting
"--system-pythonpath" as parameter, but I am not perfectly sure how it
works. And I have to setup system env variable in my .bashrc as
"PYTHONHOME=/usr/local" which is bad. And then you cannot use
"synaptic" properly because the "repositary" will not work under
python3.2!! So, that is why I need to "update-alternatives" like
following:
sudo update-alternatives --install /usr/bin/python python
/usr/bin/python2.6 26
sudo update-alternatives --install /usr/bin/python python
/usr/local/bin/python3.2 32
later when you want to switch, simply : sudo update-alternatives
--config python
Good to know!!!
It is such a simple question and how come I didn't realize the answer?!
What a stupid problem! Just link with python3.2 static lib instead of
dynamic lib and that is it. Don't bother to setup env/path etc.!!!
14/06/11 LA OverCloud
My graphic card is too old for
ATI to support and the only choice is the "open-source" driver. The
"ppa" doesn't work for me. If you want to restore back, do as following and "reboot"! (Actually you can do this at recovery mode before startx.)
sudo apt-get update
sudo apt-get remove --purge fglrx*
sudo apt-get remove --purge xserver-xorg-video-ati
xserver-xorg-video-radeonhd
sudo apt-get install xserver-xorg-video-ati
sudo apt-get install --reinstall libgl1-mesa-glx libgl1-mesa-dri
xserver-xorg-core
sudo dpkg-reconfigure xserver-xorg
Reboot or
sudo restart gdm
if in terminal or tt
startx
if in shell.
I decide to make some notes about Blender.
18/06/11 LA OverCloud
Morphius: The body cannot live without mind.
Sir Humphrey: The secret of keeping secret is the secret that the one
who has the secret keeps the secret that he has the secret.
How many secret words did he say?
I now realized that "cycle" is simply a plugin which may or may not be
part of blender and it also depends on the branch of
blender---blender-cycle. It needs a special build process.
Finally I setup and compiled "blender-cycle", and "OpenImageIO"
with codeblocks. However, the rendering failed with black screen. Apart
from OpenImageIO lib issue, it complains about "RNA_Lamp" is missing.
All the trouble for compiling comes from my own stupidity for setup
another version of "OpenImageIO" which is from google summer code
official web. They have changed quite a lot. And I setup some system
symbolic link to pointing to "include" and ".so". Then later when I recompile this version, it gives strange error of linking which costs me "literally" one whole day to realize the source of error.
One interesting issue is about a small detail of the error which
probably never happen for linux programmer who has not suffered from
Microsoft torture of function calling convention issues. In MS
compiler, the function name of declaration in binary is changed with
some strange prefix like "_" or "@" etc for different calling
convention and even for C++ method name. So, that is not strange when I
noticed the linking error for a function of "ustring" is like
"_make_unique" which has indeed a method called "make_unique". Please
note the prefix "_". I guess all linux programmers would first consider
the method name is wrong. However, to my numb brain, I thought it is
the same name as compiler twisted it. It later turns out that
"OpenImageIO" guys did changed the name from "_make_unique" to
"make_unique". So simple, so stupid and it costs me one whole day and
night!!!
20/06/11 LA OverCloud
It takes me more than a
whole day to understand such a simple fact about cycle-render:
cycle-render is simply a plugin to a special-edition of blender, say
cycle-blender which is a branch of main blender2.5. With that in mind,
you now understand that the project involves these following sub-projects:
makesdna==>makesrna==>(cycle-blender, libcycle-render). Actually
you need to place libcycle-render under directory like this
2.57/scripts/addons/cycles/libcycle-blender.so. Where do you put this
"2.57"? It should be the version of your "blender" and the easiest way
is just put in same folder with your blender. (I remember seeing the
code searching for config/lib/python/script/ etc somewhere in blenlib.)
One redicular thing is that I have to create this "plugin", or
libcycle-blender.so almost the same as the real "cycle-blender". You
can see that I have included all "extern", "intern", "source" and
"build" from "blender" project. The final .so is more than 130M! what
is the concept of a plugin-render? Still it crashes after 10/10 passes
of path-tracing. This happens exactly the same as the official
build of "cycle" which I follow instruction step by step. (Unless
my environment has something wrong??) In order to run the "blender"
which depends on python3.2, (How stupid is this?!), I have to export
PYTHONHOME=/usr/local, export PYTHONPATH=/usr/local/lib/python3.2 .
(This paradox has tortured me for weeks! The standard environment in
Ubuntu10.04 is using python2.6 which means even the compilation tools
like scons, and apt-get etc all needs to run with 2.6. However,
blender2.57 needs python3.2 to interpret. And this is why blender guys
decide to ship with built-in python with blender cause it creates all
kinds of problems.)
I still need to trace why cycle-render crashes!
topcoder practice for fun: triplestring, muddyroad.
The sad thing about topcoder is that you find out your code is so naive
and slow while elites are coding like maigic which are so hard to
understand in many cases. Also it seems topcoders are having very
similar coding. Of course they are probably using the same editor, but
sometimes I suspect the editor can help them achieve coding. (It is a
pathetic execuse for my own stupidity, however, it does comfort me
after sufferring defeat again and again. ) For a moment, I thought I
can peek other people's code without opening the problem! That is the
way of cheating which I remembered is impossible when I browsed from
windows. So, after this unconfirmed explanation, it makes me feel much
better that there are very few real top coders who can write such
efficient codes in such short time because maybe some of them are done
through cheating. (One simple way is well-known for even beginner of
web-gamer. You simply can open two accounts and use one to open
question and then peek top coders' submitted codes and then copy to
another account to achieve exactly same scores with a very little
delay. This can explain why so many top scores have so similar coding.
Personally I believe coders do have coding signatures which distinguish
themselves from others. And I have been fighting for this coding style
with Denis ever since I started working in DataWind several years ago
when he insisted me to follow his coding style. This is almost
unacceptable to me, unless I have to wait paycheck to pay rent next
Monday which happens occasionally.)
3/08/11 San Jose (the weather here is always sunshine!)
Does anybody consider boost::spirit easy? I find it a bit hard as it is like brain gymnastic and the example
takes me quite some time to understand all details in tutorial.
The difficult part is that you have to be very familiar with many libs
of boost to understand "spirit" and many of them is literally new to me
like fution,variant, phoenix etc. And I think I am enjoying this to
some extent.
Yesterday I compiled the libipoddevice
in an attempt to transfer mp3 to my ipod touch 6th generation. Then I
run the test code and give up as google says Apple uses some hash code
for song name in db files. It is meaningless to wild guess how it is
done as people in Apple may be out of mind. However, it is good to know
there is tools lib to access ipod device.
20/08/11 San Jose Should I call my happy hour in CISCO?
Dam it! The AWS S3 causes
me a headache! It all starts with such a trivial idea like this: I
spent so much time to rip my favourite DVD of <Yes, Prime Minister> and <Yes, Minister>
into 700M AVI video for each episode. In order to let more people to
have a chance to view this remarkable, wonderful, splendid political
satire, I plan to upload them to my S3 website,
which is a mirror site of this website. Here I solomnly swear that I am
promoting piracy of this wonderful master piece. Simply to promote
democracy and etc. :)
Then, it takes so long to upload because "s3cmd" fails for large file uploading. The obvious solution is to take advantage of "multiple-part-file-upload" in S3.
It seems a trivial task to me since I already conqured ec2 RESTful web
service in my "unfinished project" of cloud computing. Sigh...
Well, it takes me unexpectedly several hours to just pass AWS signature of S3 request. What a shame!
1. In EC2, what troubles me is that those query are all part of url.
i.e. The whole request parameters, values are in "key=value" format and
they must be "url-encoded". Even for the time stamp. Then when switch
to S3, the timestamp is moved to "HTTP-header", say "Date". It should
NOT be url-encoded. This takes me nearly one hour to debug!
2. The signature also has two flavours. One is using ec2-like
"?accessid=val&expires=val&signature=val". Or taking advantage
of "authorization: AWS accessid-val:signature-val". Either way should
be OK, and I choose the later one because it will make use
"http-header" which make me feel confortable. Now, I am really tired
and it is now past midnight. Let's keep a raw debug version and sleep.
11/09/11 San Jose Should I call my happy hour in CISCO?
So, this is supposed to be a
trivial task which I expect no difficulty whatsoever. Then this
"trivial task" takes me more than two weeks to finish. Of course it is
hard for one to do all serious coding at his spare time, especially
when he feels no other exciting matter to do except uploading large
video files to S3 to share with strangers. What a pathetic excuse! Here goes the un-optimized multi-threading multi-part-uploading, infinite failure-retry, default-curl-lib-hacked, ugly c++ tool.
Of course you may find it is not working for "uploading" because I have
to hack "curl" to not to add default "/" when "POST". Exactly
where did I changed curl?
24/09/11 San Jose Should I call my happy hour in CISCO?
amazon S3 uploading tool.
It supports big files multipart uploading, whole directory
uploading,single file uploading with option of using original dir/file
structure in S3 bucket, or using file MD5 as object name. The multipart
uploading uses multi-thread with each own curl. The curl is modified by
me for merely single lines of code and you have to compile/link it for
such one line modification. There is one known issue when multipart
uploading a file with object name bigger than 40bytes, amazon returns
some gibbish, claiming my signature is wrong as amazon tries to escape
my "multipart uploading parameter" by replacing "&" with
"&" etc. I think it is not my fault, it should be amazon's
known bug for years. Does anybody ever uses multipart upload API in
REST?
17/10/11 San Jose Should I call my happy hour in CISCO?
I literally struggled for several days to just achieve this simple stuff: video capture and display with my webcam.
Isn't it easy? Provided with so many examples and source code, still it
takes me quite some days to realize a simple solution. Using SDL to
display because it has even access to framebuffer. Even though I doubt
if I am actually using it. Using libv4l2 to access v4l2 standard
webcamera. Although I don't really think libv4l2 is really necessary
since it is just a simple thin layer of v4l api which is nothing but
system calls. (What I guess is that they are now part of kernel. This
is good thing of linux. Whenever you find whatever good stuff, you can
put it into part of kernel.) Yesterday it actually took me hours to
realize the "fourcc" of SDL and V4L2 is not exactly matching.
(Considering some of fourcc are actually like alias as they are just of
copy of others. So, picking up which one is a human choice.) That is
stupid of me to waste my time on my stupid assumption. One final note
is that the fps seems mainly depended on usb transmission rate because
it just slows down from 30fps to 10-20fps after a few runs with no
reasons.
10/11/11 San Jose Should I call my happy hour in CISCO?
In matrix, it is said that there is some truth in your fiction and there is some truth i your fiction.
19/11/11 San Jose Should I call my happy hour in CISCO?
Let's try to translate the following into Chinese by "google translate":
I know I
know something, but I don't know what exactly I know. However, I do
know what I want to know. That is, I want to know what is I don't know
that I already know.
The following is the translation and it is not so bad at all:
我知道我知道的东西,但我不知道我知道究竟是什么。不过,我知道我想知道什么。也就是说,我想知道什么是我不知道,我已经知道。
Do you know what I know and do you know what I want to know?
This is a simple depth-first-search and what I try to find out is something like: I know I know something, but I cannot explain exactly how I come to know it.
Let me try to put it this way: The total weight of pattern can be
considered as energy. In case of image, it maybe something like
luminance. The recognition algorithm probably does some sort of
hierarchical search from top to bottom. The total weight of any
rectangular part can be quickly calculated by using "image integral".
Then if we can pre-calculate all "unique" weight of pattern, there may
be some way we can recognize pattern quickly.
12/06/12 San Jose Should I call my happy hour in CISCO?
Should I call the
end of my happy hour in cisco? Unfortunately my family's visit is such
a bad timing that I have to keep them from worrying about my life. So,
this is the reason I have to write down my diary in English.
I really hope this version can work. Basically the mysql error 1205 is
very difficult to deal with: Should I "rollback" explicitly? Should I
kill the thread explicitly? Because I have been trying all these: 1.
ignore error, just restart transaction. 2. sleep and wait to see if
error is gone.(mysql doc says by default, the rollback won't start
automatically unless you setup a variable xxxx_on_rollback, I forget
the name.) 3. rollback and restart the transaction,(Then I ended up
with two running thread of same query.)
So, now I want to try to
rollback and then kill the thread, then reconnect and restart query.
The painful thing is that each test failure require me to shutdown
mysql to allow it running rollback in "fullspeed", meaning my 24 cores
are all close to 100%. If I kill mysqld by force and restart, then the
crash recovery only runs on single-threaded. However, running into
error 1205 takes me nearly 8 hours, kill server to rollback take me
another whole day. And if you kill by force then recovery may take you
forever. Now you should know how painful this whole debugging process
is. One version takes more than two days to test. (After all I have to
sleep and only see results when I wake up in morning.) Let's pray for this version works which I add a little state machine with error handling code.
13/06/12 San Jose Should I call the end of my happy hour in CISCO?
No, no, it doesn't
work. After hours running, I can see error of wrong threadid which is
0. I don't want to spend more time on this difficult issue. Maybe
preventing it from happening is a better way in dealing with deadlock
issues. This is the one I will try.
20/06/12 San Jose Should I call the end of my happy hour in CISCO?
An interesting question of 300points in topcoder.It takes me quite some time.
20/06/30 San Jose A new life
Finally this is a
good way to publish, but not sure how to allow update: Suppose you have
git and you want to clone this repositary:
git clone http://www.staroceans.net/mygit/mysqlQuery.git myclone
20/07/11 San Jose A new life
What is best source browser in Linux? I believe it is "source-navigator".
|