This file contains hidden or 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
Trans.exec(new Atom() { | |
public void run() { | |
dao.insert("tp_pet", Chain.make("age", 12)); | |
Sql sql = Sqls.fetchLong("SELECT @@@@IDENTITY"); | |
dao.execute(sql); | |
long petId = sql.getObject(Long.class); | |
System.out.println(petId); | |
} | |
}); |
This file contains hidden or 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_cnd_in() { | |
List<String> list = new ArrayList<String>(); | |
list.add("ab,c"); | |
list.add("game:Announcement:read,update:*"); | |
Cnd cnd = Cnd.where("abc", "in", list).and("zz", "in", new String[]{"asfdsdf,fasdfasdf,asf", "XXXX"}); | |
System.out.println(cnd); | |
} |
This file contains hidden or 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.json.meta; | |
import java.lang.reflect.Type; | |
import java.util.List; | |
import org.nutz.json.JsonField; | |
import org.nutz.lang.util.NutType; | |
import org.nutz.mapl.Mapl; | |
public class TreeNode { |
This file contains hidden or 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.salesforce.chatter.provider; | |
import android.content.ContentResolver; | |
import android.content.ContentValues; | |
import android.content.Context; | |
import android.content.Intent; | |
import android.content.UriMatcher; | |
import android.database.Cursor; | |
import android.database.MatrixCursor; | |
import android.database.MatrixCursor.RowBuilder; |
This file contains hidden or 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
JdbcExpertConfigFile jdbcConf = new JdbcExpertConfigFile(); | |
Map<String, Object> config = new HashMap<String, Object>(); | |
config.put("pool-home", "~/.nutz/tmp/dao/"); | |
config.put("pool-max", 2000); | |
config.put("mysql-engine", "InnoDB"); | |
Map<String, Class<? extends JdbcExpert>> experts = new HashMap<String, Class<? extends JdbcExpert>>(); | |
experts.put("h2.*", (Class<? extends JdbcExpert>) Class.forName("org.nutz.dao.impl.jdbc.h2.H2JdbcExpert")); | |
//........... | |
jdbcConf.setConfig(config); |
This file contains hidden or 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 main | |
import ( | |
"log" | |
"net/http" | |
) | |
func main() { | |
log.Fatal(http.ListenAndServe(":8080", http.FileServer(http.Dir("/tmp")))) | |
} |
This file contains hidden or 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
//from http://0x55aa.sinaapp.com/%E7%AE%97%E6%B3%95-%E7%BC%96%E7%A8%8B/676.html?1348618006 | |
package main | |
import ( | |
"fmt" | |
"os" | |
"errors" | |
"strings" | |
) | |
//no tag |
This file contains hidden or 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 main | |
import ( | |
"database/sql" | |
_ "github.com/mattn/go-oci8" | |
"os" | |
"log" | |
"fmt" | |
) |
This file contains hidden or 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 errors | |
import ( | |
"fmt" | |
"path" | |
"runtime" | |
) | |
type Error struct { |
This file contains hidden or 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
func PathExist(_path string) bool { | |
_, err := os.Stat(_path) | |
if err != nil && err.Error() == os.ErrNotExist.Error() { | |
return false | |
} | |
return true | |
} | |
// golang新版本的应该 | |
func PathExist(_path string) bool { |