This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LuaState lua = LuaStateFactory.newLuaState(); | |
lua.openLibs(); | |
lua.pushJavaObject(new Thread() { | |
public void run() { | |
System.out.println("Lua Thread?"); | |
} | |
}); | |
lua.setGlobal("t"); | |
int re = lua.LloadString("function f() t:run() return 123 end return f()"); | |
System.out.println(re); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LOCAL_PATH := $(call my-dir) | |
include $(CLEAR_VARS) | |
# NDK 7d支持硬浮点的直接编译 | |
#APP_ABI := armeabi-v7a-hard | |
LOCAL_MODULE := liblive555 | |
LOCAL_ARM_MODE := arm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
public void test_1000_threads() throws InterruptedException { | |
final JQ jq = new JQ(100, -255, -1); | |
ExecutorService es = Executors.newFixedThreadPool(1000); | |
for (int i = 0; i < 1000*1000; i++) { | |
es.submit(new Runnable() { | |
@Override | |
public void run() { | |
Json.toJson(jq); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Request req = Request.create("http://xxxxx", METHOD.POST); | |
req.setData(jsonStr); | |
req.getParams().put("access_token", "abczxd"); | |
Response resp = Sender.create(req).send(); | |
if (resp.isOK()) { | |
System.out.println(resp.getContent()); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.nutz.integration.jsr303; | |
import java.util.Set; | |
import javax.validation.ConstraintViolation; | |
import javax.validation.Valid; | |
import javax.validation.Validation; | |
import javax.validation.Validator; | |
import javax.validation.ValidatorFactory; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public String subscribe(String key) { | |
if (Strings.isBlank(key)) | |
return null; | |
try { | |
log.info("subscribe >> " + key); | |
String url = "某某服务器" + "/subscribe?key=" + key; | |
Response resp = Sender.create(url).setTimeout(60 * 60 * 1000).send(); | |
if (resp == null) | |
return null; | |
if (resp.getStatus() == 404) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.nutz.dao.entity; | |
import java.sql.ResultSet; | |
import java.sql.ResultSetMetaData; | |
import java.sql.SQLException; | |
import java.sql.Timestamp; | |
import java.sql.Types; | |
import java.util.Collection; | |
import java.util.HashMap; | |
import java.util.Map; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package jetbrick.template.web.nutz; | |
import javax.servlet.http.HttpServletRequest; | |
import javax.servlet.http.HttpServletResponse; | |
import jetbrick.template.JetContext; | |
import jetbrick.template.JetTemplate; | |
import jetbrick.template.web.JetWebContext; | |
import jetbrick.template.web.JetWebEngineLoader; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.androx_dev; | |
import android.app.Activity; | |
import android.os.Bundle; | |
import android.os.FileObserver; | |
import android.view.Menu; | |
public class MainActivity extends Activity { | |
private FileObserver watcher; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dao.run(new ConnCallback() { | |
public void invoke(Connection conn) throws Exception { | |
ResultSet rs = conn.prepareStatement("你的sql语句").executeQuery(); | |
} | |
}); |