Heteroclinic.net logo

www.heteroclinic.net

I agree the following defect can be closed, but I still have something say, so I kept this file in my site.

Chrome browser gives un-expected result displaying frame border and pictures. If you know how to shoot the trouble, please let me know. I should say this problem was first almost solved in Windows 7 then almost in Windows Vista. "Almost" because some pictures' sizing/positioning is still not the same as Firefox and IE.

The "some pictures' sizing/positioning is still not the same as Firefox and IE" is created by the following mistake, a html paragraph was not well-formed. I keep this page, you can use IE, Chrome, and Firefox to see the the difference. In Chrome, at the RHS, scroll down, there is a picture's sizing is not good.

Introduction of www.heteroclinic.net

Brief in Feb 2013

Www.heteroclinic.net is the personal home page of Zhikai Wang. Zhikai holds a master degree of computer science from Concordia University, Canada.

You can consult Zhikai for general issues related to computer science and software engineering. Zhikai specilizes in:
- concurrent programming
- network programming
- computer graphics (3D)
- general enterprise IT solutions

Zhikai's brain mountaineering:
-QTPlaut
-MatPlaut
-Android Mobile + Facebook API
-Magic Hexagon
-the Lorenz System
-the CR3BP
-Depth Peeling Transparency (live)
-Real Time Caustics (live)
-Mesh Simplification (live)
-Age of Concordia
-Battleship (live)
-Cobag
-Runtime Deadlock Detection (closed and transferred to treetor/jdfr bundle)-
-Concurrency Basics(live)
-QtWagon -- study 3D objects with QT GUI (live)
-Race Condition Random Seeder (live)
-Treetor: tree visualization tool and JDFR (live)
-Recursive Random Bit Flip Permutation (live)
-Project Friends Torus: Social Network in a new Dimension (live)
-Project Sinpixa: Zhikai's Composite Number Equation (live)
-Foaken, a mini project about Facebook Login API for Java Desktop Application, based on NanoHTTPD
-Two-pass 3D Object and Mouse Collision Detection
Race Condition Random Seeder

20130917
Introduction:
Race Condition Random Seeder is a tool aiming to create random seeds for random generators. It utilizes modern computer systems' high frequency CPU clock and multitasking in paralell features. By creating man-made race condition, we retrieve a volatile boolean value that threads race upon. The values retrieved thus form a bit-bundle representing a numerical value.
We can say, we can achieve to some degree true random, or software random, in an isolated system.
Such system is like modern computer system, having two or more independent computing units.
So I may say you may let a computer do something all by itself, in some degree (to a great degree) independent of the environment.
In release R-2.0 (C/C++), we no longer utilize any mem* ops, but utilize well-implemented ADTs. The aim is to return a Bitset or std::string, so the users can parse the bit-bundle to the built-in numerical types.
This practice seems to increase the chance of survival of this program.

In release R-2.2 (Java), we tried to repeat the same principle we did in C/C++ in Java. The effect is not quite satisfying by observation. In my experiments, we have to force the threads sleep/context switch to add the entropy.
Mainly, this should relate particularly to JVM thread slicing settings. By observation, it causes a single thread dominate the shared flip.
In C++/C test, forcing threads to sleep/context switch thus yielding each other is not necessary.
We have to mention, the particular setting shown as below worked at a particular combo of OS, JVM and hardware.
You can tune the parameters so the results can be statistically satisfying.
Note: forcing the threads to sleep/context switch thus yielding each other significantly drags down the performance.
In contrast in C++/C test, forcing threads to sleep/context switch thus yielding each other is not necessary (it is a given combo of conditions leading to this observation). Again, you can find some key parameters to tune with by studying the source code. This program due to its nature will not be of high performance. It is suggested to be used as a seeder program for other random generators, e.g. linear congruential random generator etc.
Release 2.0 (C/C++) how-to in Cygwin/Linux/UNIX shell console (pthread lib required):

Download/compile/execute
RaceConditionRandomSeederR2d0BitsetImpl.cpp

Release 2.2 (Java): The effect is not quite satisfying by observation.







Jdfr and Treetor Quick-Starts Timestamp 201302

We relase jdfr1.0.jar and treetorplus3.jar in January, 2013.

Introduction:
- treetor, a tree/forest rendering tool
- jdfr, Java Dead-lock Free Runtime (the goal, may be too ambitious)

Features:
- the bundle fully supports Java ReentrantLock
- treetor can render a tree graph or forest graph with some dozens of thousand nodes
- so far, the bundle only runs with JDK/JRE 7.
- check the blog sections for more details.

Download:

Quick-starts:
Linux

or Windows

It will create ".png"s in the current directory.

Multi-tier

201301PROF_MUTLTI_TIER.gif

Fast

Random

Simple dead-lock profiled

DEAD_LOCK_VISUAL.gif





Generating a Random Permutation of the First one G Nature Numbers, G is 1024*1024*1024 Feasibility Analysis from Scratching and so forth
Episode IV, we forward G to T, T is 1024*G
Recursive Random Bit Flip Permutation
-- March 22, 2013
Zhikai presents a new algorithm -- Recursive Random Bit Flip Permutation.


A pair of sharp eyes may already see through and catch a big hole of Recursive Random Bit Flip Permutation, but to fill the hole would seem to be easier. It took longer time to imagine the bit-flip method. Shorter time (two or three) days finding the hole. Even shorter to imagine a way to fill the hole. As of today, everything is still imagination, Mar 19, 2013. In this episode, I meant to close the depth peeling transparency project and I will open the code. But I forgot to bring the code four years ago with my travel.
We will fill the hole in the coming episode(s).

Computation and Visualization of Invariant Manifold

lrzgifbw.gifComputation and Visualization of Invariant Manifold is the topic of Zhikai Wang's master thesis at computer science department of Concordia University, Canada.

The full text in pdf is here, the abstract, and the final presentation.

In this thesis, we start with the basic concepts of dynamical systems. Then we introduce the general types of problems that the well-known software package AUTO solves. AUTO uses a boundary value algorithm with Gaussian collocation and pseudo-arclength continuation. The two features distinguish AUTO from other general ODE solvers for dynamical systems. In order to compute 2D solution manifolds, AUTO uses orbit continuation. With these tools, we study two famous problems, the Lorenz system and the circular restricted Three-Body problem (CR3BP). We brie fly discuss the basic bifurcation and stability analysis of ODE systems. The numerical analysis of the two problems leads to the newest algorithm to compute the 2D stable manifold of the origin of the Lorenz system and the 2D unstable manifold of appropriate periodic orbits of the CR3BP. We utilize Python for the flow control of AUTO. We also implement two visualization packages, QTPlaut and MATPlaut. They make possible the processing of large quantities of AUTO solution data with the OpenGL graphical library, dynamic memory allocation and interpolation methods. We conclude with prospect for future research.

QTPlaut Win32-binary

QTPlaut Win32-binary EXE (md5sum result cd03d4117d953f5d4e1d695d3bcc8727) is put online, on Jan 15,2011. For install under Microsoft Windows and only, download the binary/EXE file. If some DLLs are required, please google 'vcredist 2010', download and install. Then execute the binary.

QTPlaut.jpgFor QT developer: the source code is here source code. A kaopoo/practical in-hand story is -- Visual C++ 2010 express, QT 4.7.1.(configure static, nmake).

We also put the beta version user manual in pdf form here. An AUTO solution we select is the Lorenz Manifold. More are coming. The file 's15.zip' has to be unzipped as 's.15'. According to a filter all files should begin with 's.' something.

A shortcut to play with the 's.15' is: click 'add a solution', click 'scene tool', click 'Construct a manifold'. The Lorenz manifold is computed by AUTO .

Project Sinpixa

Sinpixa is the project code name for Equation

sinpixaequ1dot1.jpg

where a is positive integer greater than 1. Euq.1.1 expresses itself very difficult to be solved. Here, rather than seeking a solution, we would like to start an investigation upon the graphical presentation of this equation. For 1-manifold

sinpixaequ1dot2.jpg

a+ and a- are the homotopies of Function1.2, so do a + 1 and a - 1. Will the solutions of a - 1 or a + 1 give a kind of bound of the solutions of Euq.1.1, or mutually, or not at all?

Sinpixa01.pdf

sinpixa01fig01.jpg

Project Friends Torus Demo4.0 Download
20140129
Click to download and check the md5sum.

Java executable jar and dependencies:
FriendsTorusDemo4.0binary.zip
md5sum: FriendsTorusDemo4.0binary.zip
b9c520543c309b0d02b34a5ab3dca743

Project Friends Torus Demo3.0 Introduction
20131231

Friends Torus Social Network in a new Dimension is a new brain tease and project adventure of Zhikai Wang/www.heteroclinic.net.
This Demo 3.0 program so far is tested on some Windows and Linux machines. The hardware requirement is quite minimal.
Demo 3.0 New Features:
- integrated with hybrid http/https server
- automatic passing token from browser to desktop application
Issues remains:
- a lot
- Chrome browser OK, IE not OK
- If the browser asks about SSL certificate questions, click "Proceed".
- You have to wait a while, while the application is downloading the pictures of your friends.
After the Web browser pops up a new window showing some Facebook ops accomplished, you can switch to the Java desktop Application see something like Demo 1.0 screenshot.

Java executable jar and dependencies:
FriendsTorusDemo3.0binary.zip
md5sum: FriendsTorusDemo3.0binary.zip
733b8a59d7d84419e0fd3184f9065f50

FriendsTorusDemo1.0Screenshot.jpg

Two-pass 3D Object and Mouse Collision Detection
20130731
Introductio
TwoPass3DObjectAndMouseCollisionDetection.pdf
In computer graphics, the 3D models are projected to the 2D canvas pane of a GUI for real visualization. A mouse click event can get the point position in the 2D canvas pane. If we want to get the real 3D model's particular position projected to the 2D pixel coordinate, probably we have to un-project the 2D point. At least, it will involve depth test. Accurate computation may also involve ray-tracing, scene graph, octree, 3D sorting etc. We try to simplify the burden by taking a different approach.

How it works
TwoPass3DObjectAndMouseCollisionDetection-pass-1.jpg


First, we draw the colorful virtual world.

TwoPass3DObjectAndMouseCollisionDetection-pass-2.jpg


Second pass, each object is drawn in back ground rendering. In Fig.(\ref{2ndpass}), they may look like the same. But each of them is drawn with a unique mono-chrome color. We click the 2D pane, get a pixel position, the pixel position gives a unique color in format like [0,15,243,255], a 4 byte RGBA color. The color is mapped to a unique object ID.

Discussion
This article is not peer reviewed. If you find some errors or you want to give some comments, please contact the author.

Download
Project Foaken
A Tutorial Project about How to Handle Facebook Access Token for Java Desktop Application

20130831

Get the source and built jar:

Foakenbeta1.0.zip
md5sum: 5af2b95052d71aa885ede1927069fb9e