Jim Cheung

Thursday, July 02, 2015

Clojure 1.7 is released, on Hacker News someone posts a transducer example:

(reduce + 0 (filter odd? (map inc (range 1000))))

by using transducer:

(def xf (comp (map inc) (filter odd?)))

(transduce xf + 0 (range 1000))

and need to watch Transducers by Rich Hickey - YouTube one more time.

base16 color scheme is simple and good looking, especially the grayscale one, so good.

Friday, July 03, 2015

when cider-jack-in it complaints about WARNING: CIDER requires nREPL 0.2.7 (or newer) to work properly even I already added the newer version in project.clj. finally it is resolved by add them to ~/.lein/profiles.clj:

{:user {:dependencies [[org.clojure/tools.nrepl "0.2.10"]]
    :plugins [[cider/cider-nrepl "0.9.1"]]}}

Thursday, July 09, 2015

a good series of talks on java: Official ZeroTurnaround Account

Wednesday, July 15, 2015

still playing little bit clojure, conch is a library for executing shell commands.

also reading some books:

Thursday, July 16, 2015

to allow self-signed certificate when using java, import the key to jvm:

openssl s_client -connect example.com:443

copy lines from -----BEGIN CERTIFICATE----- to xyz.pem, then import using keytool

keytool -import -alias myserver -keystore /path/to/jre/lib/security/cacerts -file xyz.pem

the default password is changeit.

talking about PHP7, the beta is out. this slide has a good summary of the new stuffs: Speeding up the Web with PHP 7

I like this javascript-like syntax (haha):

(function() { ... })()

some ufw notes:

do a ufw reload after changes.

Friday, July 17, 2015

podcasts of this week:

looks like there are many good talks on Curry On Prague! 2015, check their youtube channel

Tuesday, July 21, 2015

convert flac to mp3

for f in *.flac; do flac -cd "$f" | lame -b 320 - "${f%.*}".mp3; done

Thursday, July 23, 2015

JRuby 9000 is released.

also installed java 9 via JDK 9 Early Access Releases, in order to test the new repl thing (details here: Java 9's New HTTP/2 and REPL)

OSCON 2015, Speaker Slides & Video

Friday, July 24, 2015

Spark Summit 2015 has some slides too.

reading Effective Ruby: 48 Specific Ways to Write Better Ruby, quite good.

it tells you difference between

class Counter
    attr_accessor(:counter)

	def initialize
        counter = 0
    end
end

and

class Counter
    attr_accessor(:counter)

	def initialize
        self.counter = 0
    end
end

and something like differnce between super and super(), and many. it's a good read.

another book Working with Ruby Threads looks interesting too. two free chapters, gonna read it first.

this week also read some MySQL cluster, actually it's better than I thought. from this reddit thread: MySQL 5.7 will considerably improve defaults, there are some good people working for MySQL~

but it's not the only option, Percona and MariaDB also provide cluster servers.

Monday, July 27, 2015

wonder what's the difference between if ($x) and if (!empty($x)) in php? check this table: PHP type comparison tables (they are the same). however:

prior to PHP 5.5, empty() only supports variables; anything else will result in a parse error.

Thursday, July 30, 2015

start reading Clojure Web Development Essentials, it's about Luminus too.

first chapter has this one liner, it prints a tree of current directory, very cool:

find . -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g'

it seems latest version of Luminus doesn't use lein-ring plugin as default, so instead of lein ring server just do lein run

also borrowed Effective Modern C++: 42 Specific Ways to Improve Your Use of C++11 and C++14 from local library, just because it's written by Scott Meyers.

Friday, July 31, 2015

in search of a list of hosts to block, i found this repo: StevenBlack/hosts

this video has a little bit more detailed about the java 9 repl: jshell JDK 9 quick peek

Blog Archive