Let's Meet at PyCon 2017 Taiwan

It is nice to have a talk at PyCon 2017 Taiwan. If you are around there, please come to join us. The talk held by John Hu is "OpenCLGA - Run Your GA on Top of PyOpenCL". It is about a new Genetic Algorithm implementation based on OpenCL. With OpenCL, OpenCLGA can run on top of all devices you have, including GPU, CPU, DSP, etc. We had also finished an example to run the GA across multiple computer with multiple computing devices, like Nvidia GPU, Intel GPU, Intel CPU, etc.

An Awesome OpenCL Library - CUDAfy.net

It's not typo. CUDAfy.net is an awesome library for C# programmer to write OpenCL code. As surveying OpenCL libraries, we found a good library for beginners to write OpenCL code. Since John Hu work with a junior programmer who can only program .net framework, we start to survey a tool to for .net programmers. CUDAfy.net is a .net framework library. It is made to translate .net framework bytecode to CUDA and OpenCL. We can use it to generate OpenCL source code from .net framework bytecode. That means you can write a OpenCL program in C#/VB.net. It's awesome.

Build nokogiri 1.6.8 at Mac OS X 10.11

Since we need to use a jekyll theme, it has a dependency on nokogiri. If you cannot install it just with "gem install nokogiri". Please check this post.


This is the error message we met:

Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.


    /Users/hchu/.rvm/rubies/ruby-2.0.0-p247/bin/ruby extconf.rb

Using pkg-config version 1.1.7

checking if the C compiler accepts ... yes

checking if the C compiler accepts -Wno-error=unused-command-line-argument-hard-error-in-future... no

Building nokogiri using packaged libraries.

Using mini_portile version 2.1.0

checking for iconv.h... yes

checking for gzdopen() in -lz... yes

checking for iconv... yes




Building Nokogiri with a packaged version of libxml2-2.9.4.


Team Nokogiri will keep on doing their best to provide security

updates in a timely manner, but if this is a concern for you and want

to use the system library instead; abort this installation process and

reinstall nokogiri as follows:


    gem install nokogiri -- --use-system-libraries




If you are using Bundler, tell it to use the option:


    bundle config build.nokogiri --use-system-libraries

    bundle install


Note, however, that nokogiri is not fully compatible with arbitrary

versions of libxml2 provided by OS/package vendors.


Extracting libxml2-2.9.4.tar.gz into tmp/x86_64-apple-darwin12.3.0/ports/libxml2/2.9.4... OK

Running 'configure' for libxml2 2.9.4... OK

Running 'compile' for libxml2 2.9.4... ERROR, review '/Users/hchu/.rvm/gems/ruby-2.0.0-p247/gems/nokogiri-1.6.8/ext/nokogiri/tmp/x86_64-apple-darwin12.3.0/ports/libxml2/2.9.4/compile.log' to see what happened. Last lines are:


    unsigned short* in = (unsigned short*) inb;


encoding.c:815:27: warning: cast from 'unsigned char *' to 'unsigned short *' increases required alignment from 1 to 2 [-Wcast-align]

    unsigned short* out = (unsigned short*) outb;


4 warnings generated.

  CC       error.lo

  CC       parserInternals.lo

  CC       parser.lo

  CC       tree.lo

  CC       hash.lo

  CC       list.lo

  CC       xmlIO.lo

xmlIO.c:1450:52: error: use of undeclared identifier 'LZMA_OK'

    ret =  (__libxml2_xzclose((xzFile) context) == LZMA_OK ) ? 0 : -1;


1 error generated.

make[2]: *** [xmlIO.lo] Error 1

make[1]: *** [all-recursive] Error 1

make: *** [all] Error 2

Web animations on large screen (MDN post)

Although John Hu had left mozilla, he had wrote a post before leaving. This post is a post that John Hu felt good. Please go to this URL to see the post:


John Hu would suggest you to see the post at MDN's page.


John Hu's Bugzilla

It's time to leave mozilla. For John Hu, it's a special adventure to be in mozilla. This picture is John Hu's Bugzilla statistic page. It shows the work done by John Hu. John Hu had done the followings within 2 years:

1. 309 bugs, 0.5 bugs filed by John Hu per day

2. 3366 comments, 5 comments made by John Hu per day

3. 183 patches submitted, 0.25 patches submitted by John Hu per day

4. 239 patches reviewed, 0.33 patches reviewed by John Hu per day


CSS art - flower

This CSS art is made by a tricky croping CSS effect. The tricky part is to make a leaf. But the hardest part is to calculate the correct math arguments. This CSS art is scalable. You may change the width and height to have different size of flow:


See the Pen Flower icon by John Hu (@john-hu) on CodePen.