h12 Stand With Ukraine

Go 1.4.1 Build Failure and Solution

29 January 2015

Today I tried to build Go 1.4.1 from source but it failed with this error:

    go/src/liblink/anames9.c:6:29: fatal error: ../cmd/9l/9.out.h: No such file or directory

At first I thought the building routine might have be changed so I opened and read Installing Go from Source again, carefully, and found nothing special.

Then I searched for the error source and it turned out that I should deleted anames*.c, manually. There is no document and no automatic cleaning script, and you would have to figure it out yourself if no one ever mentioned it (source).

How to configure a custom domain name in GAE?

19 January 2015

Steps:

  1. Visit Developers Console.
  2. In your project: Compute -> App Engine -> Settings.
  3. On the tab labelled CUSTOM DOMAINS, you can verify your domain and assign it and/or its subdomains to your GAE project.
  4. Add the DNS settings provided by Google into the DNS server of your domain provider.

Notes:

  1. Only HTTP is supported, HTTPS is not.
  2. It will not work if you only modify the DNS record without actually assigning the custom domain in the Developer Console.

How to install a self-signed CA Certificate to Android 4.4

17 January 2015

See this blog Remove “Network May Be Monitored by an Unknown Third Party” in Android 4.4 KitKat.

A Shorter Domain Name

16 December 2014

This year, I decided not to renewal the previous domain name (hailiang.ws) last year, but to register a shorter one. There are two reasons:

  1. Both the site URL and the email address will be cleaner.
  2. A more friendly Go import path will be possible for my repositories on Github.

After comparing various choices on major domain providers, I chose h12.io as the new domain. It is the shortest but still meaningful domain that I can afford. H is the initial letter of my given name, 12 is simply the number of letters of my full name, and .me is a top level domain quite suitable for a personal website.

Gombi: Creating Your Own Parser is Easier than Regular Expressions

7 August 2014

Gombi is a combinator-style scanner & parser library written in Go. It is practical, reasonably fast and extremely easy to use.

Quick start

go get -u h12.io/gombi

Design

Combinator parsers are straightforward to construct, modular and easily maintainable, compared to parser generators like Lex/Yacc.

  • Internal DSL
    • no additional code generation and compilation.
  • Composable
    • a subset of the syntax tree is also a parser.
    • a language can be easily embedded into another one.

Gombi is inspired by but not limited to parser combinators. Unlike a combinator parser, Gombi neither limits its API to functional only, nor limits its implementation to functional combinators. Go is not a pure functional language as Haskell, so cloning a combinator parser like Parsec to Go will only lead to an implementaion much worse than Parsec. Instead, Gombi is free to choose any Go language structures that are suitable for a modular and convenient API, and any algorithms that can be efficiently implemented in Go.

Under development

Learning Resources on Parser Combinator

4 August 2014

Resources on Offline Hyphenation

30 July 2014

CSS hyphenation is supported by latest version of Firefox, Safari & IE. However, Chrome does not support it. Though Hyphenator.js can solve this problem, it runs in the browser and affects the rendering speed of above-the-fold content. So there is only one option left: soft hyphen (U+00AD, ­).

Here is a list of resources that leads to its implementation:

  • An article about CSS3 hyphenation by Hyphenator.js
  • Hunspell: the spell checker & hyphenator used by LibreOffice
  • English Dictionary of LibreOffice
  • Pyphen: A Python hyphenator using Hunspell dictionary file
  • A test page for soft hyphen