Monthly Archives: September 2014

pache.commons.lang AtomicIntializer

apache.commons.lang AtomicIntializer The documentation : This class maintains a member field of type AtomicReference. It implements the following algorithm to create and initialize an object in its get() method: First it is checked whether the AtomicReference variable contains already a … Continue reading

Posted in programming | Tagged , | Leave a comment

Another usage example of foldr

I feel foldr or foldr1 sometimes hard to understand. Here is another example to show its usage. get the last element of list? the solution is like this: how this works? let’s say tail’ [1,2,3,4], then you got 1. (flip … Continue reading

Posted in programming | Tagged | Leave a comment

use linux command line like a hacker

print the most frequently used 10 commands use ^ remove unwanted characters my question : why ^o will remove the o from fooo, not from log 3. use ^old^new to do replace use !:gs/old/new to replace all old with new … Continue reading

Posted in Uncategorized | Tagged | Leave a comment

how scanr and scanl works

How Scanr and scanl works let’s start with some code what’s the result it would be? firstly, let’s have a look what ‘flip’ does in haskell. here is a good link so flip (:) [] 1 is the same thing … Continue reading

Posted in Uncategorized | Leave a comment

apache.commons.lang study notes 3

ArrayUtils remove see the source the code uses System.arrayCopy to do it. toMap notice the Generic usage. toString this method would do : 1. put all the elements of the array into bracket {} 2. if the element is collection, … Continue reading

Posted in programming | Tagged | Leave a comment

markdown test

A markdown test second title italic and bold italic bold italic and bold h h h h h h h h aljdla alsafa h link

Posted in Uncategorized | Leave a comment