View process.c
/* exit() */
#include <stdlib.h>
#include <sys/types.h>
/*
* fork()
*/
#include <unistd.h>
View stitch.sh
convert -density 100 in.pdf -background white -alpha remove out.png
convert -append `ls -1 *.png | sort -n | tr '\n' ' '` all.png
View douban.sh
#!/bin/bash
set +x
tmp=`mktemp -t douban.tmp`
contacts=`mktemp -t douban.contacts`
rlist=`mktemp -t douban.rlist`
START="0"
user_count="1"
echo $contacts
echo $rlist
View gist:ebc7f534428291fabd47101811bbd617
[weli@localhost httpd22]$ git diff
diff --git a/httpd22.spec b/httpd22.spec
index 4986669..231481b 100644
--- a/httpd22.spec
+++ b/httpd22.spec
@@ -14,13 +14,12 @@
%define without_src_zips %{!?_without_src_zips:1}%{?_without_src_zips:0}
# scldir points to the root dir of the jbcs collection
%define scldir /opt/rh/jbcs-httpd24/root
-%define ews_release ews-2.1.1
View gist:a6c109ec783dbbc098f09c913107fb74
buildconf: checking installation...
buildconf: autoconf version 2.63 (ok)
buildconf: libtool version 2.2.6 (ok)
buildconf: libtoolize --automake --copy
buildconf: aclocal
buildconf: autoheader
buildconf: automake -a --foreign --copy
buildconf: autoconf
View VolatileTest.java
/**
* @author <a href="mailto:l.weinan@gmail.com">Weinan Li</a>
*/
public class Lock {
volatile boolean waiting = true;
public void test() {
new Thread(new Runnable() {
public void run() {
View Counter.java
package concurrent.course.intro01;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.Vector;
import java.util.concurrent.atomic.AtomicLong;
/**
* @author <a href="mailto:l.weinan@gmail.com">Weinan Li</a>
View TimeoutLock.java
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicReference;
import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.Lock;
/**
* @author <a href="mailto:l.weinan@gmail.com">Weinan Li</a>
*/
public class TimeoutLock implements Lock {
View generated.js
power:resteasy-jsapi-testing weinanli$ mvn -q jetty:run
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=128m; support was removed in 8.0
Aug 18, 2015 12:43:48 AM org.jboss.resteasy.plugins.server.servlet.ConfigurationBootstrap
WARNING: The use of javax.ws.rs.core.Application is deprecated, please use javax.ws.rs.Application as a context-param instead
Aug 18, 2015 12:43:48 AM org.jboss.resteasy.spi.ResteasyDeployment
INFO: Deploying javax.ws.rs.core.Application: class org.jboss.resteasy.jsapi.testing.TestApplication
Aug 18, 2015 12:43:48 AM org.jboss.resteasy.spi.ResteasyDeployment
INFO: Adding singleton resource org.jboss.resteasy.jsapi.testing.AddImpl from Application class org.jboss.resteasy.jsapi.testing.TestApplication
Aug 18, 2015 12:43:48 AM org.jboss.resteasy.spi.ResteasyDeployment
INFO: Adding singleton resource org.jboss.resteasy.jsapi.testing.MinusImpl from Application class org.jboss.resteasy.jsapi.testing.TestApplication