Skip to content

Instantly share code, notes, and snippets.

SPLIT include/autoconf.h -> include/config/*
GEN include/bbconfigopts.h
HOSTCC applets/usage
GEN include/usage_compressed.h
HOSTCC applets/applet_tables
GEN include/applet_tables.h
CC applets/applets.o
In file included from /opt/android-ndk-r7/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.4.3/include-fixed/syslimits.h:7,
from /opt/android-ndk-r7/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.4.3/include-fixed/limits.h:11,
from include/platform.h:138,
for (StackTraceElement ste : Thread.currentThread().getStackTrace()) {
if (ste.getClassName().contains("sunfire"))
return true;
}
return false;
@wendal
wendal / gist:4537679
Created January 15, 2013 10:08
演示golang转编码 (gb2312 --> utf8)
package main
import (
iconv "github.com/djimenez/iconv-go"
"io/ioutil"
"log"
"net/http"
@wendal
wendal / gist:5142489
Last active December 14, 2015 20:18
统计代码中字母出现的频率
package xxx;
import java.io.File;
import java.io.FileFilter;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.concurrent.atomic.AtomicInteger;
import org.nutz.lang.Files;
@wendal
wendal / BeetlViewMaker.java
Last active December 15, 2015 10:28
Beetl与Nutz的集成
package org.nutz.mvc.view.beetl;
import java.io.IOException;
import java.util.Enumeration;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.bee.tl.core.GroupTemplate;
import org.bee.tl.core.Template;
@wendal
wendal / gist:5319463
Last active July 21, 2018 02:22 — forked from anonymous/gist:5319452
golang,在windows下获取磁盘空间数据
package main
import (
"log"
"net/http"
"syscall"
"unsafe"
)
func main() {
@wendal
wendal / gist:5589738
Created May 16, 2013 06:19
查找同网段的linux主机
#!/usr/bin/python
'''
Created on 2013-4-20
@author: wendal
'''
import socket, threading, time
def main():
@wendal
wendal / gist:5627360
Created May 22, 2013 13:00
nginx lua模块下的 id转特殊路径
function id2path(IN)
local B,K,OUT,I,D=16,"0123456789ABCDEF","",0
local now = 0
local len = 0
while IN>0 do
if len > 0 and math.mod(len,2) == 0 then
OUT="/"..OUT
end
I=I+1
IN,D=math.floor(IN/B),math.mod(IN,B)+1
@wendal
wendal / gist:5682733
Created May 31, 2013 03:03
nutz ioc注入一个map
{
"xXX": {
"type" : "org.nutz.ioc.meta.map.XXX",
"fields" : {
"fuck" : {"age": "28", "abc": "kkkkk"}
}
}
}
/*fuck字段的类型是Map<String,String>*/
@wendal
wendal / gist:5812060
Created June 19, 2013 06:27
通过NutType构建复杂的Json反序列化对象
Map<String, List<Province>> map = (Map<String, List<Province>>) Json.fromJson(NutType.mapStr(NutType.list(Province.class)), new FileReader("city.min.js"));
List<Province> provinces = map.values().iterator().next();
System.out.println(Json.toJson(provinces));