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 models | |
import com.mongodb._ | |
import com.osinka.mongodb._, shape._ | |
class Question(val user: User) extends MongoObject with Oid { | |
var title: String = _ | |
var comments: List[QComment] = Nil | |
} |
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
import java.io.InputStream; | |
import java.net.Socket; | |
public class Client { | |
static int PORT = 6666; | |
public static void main(String[] args) throws Exception { | |
Socket socket = new Socket("127.0.0.1", PORT); | |
InputStream input = socket.getInputStream(); |
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
import java.io.InputStream; | |
import java.net.Socket; | |
public class SimpleClient { | |
public static void main(String[] args) throws Exception { | |
Socket socket = new Socket("127.0.0.1", 6666); | |
InputStream input = socket.getInputStream(); | |
long total = 0; | |
long start = System.currentTimeMillis(); |
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 readwritelock; | |
import java.util.concurrent.locks.ReentrantReadWriteLock; | |
import java.util.concurrent.locks.ReentrantReadWriteLock.ReadLock; | |
import java.util.concurrent.locks.ReentrantReadWriteLock.WriteLock; | |
public class NonfairLock { | |
private static long start = System.nanoTime(); |
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 ebb | |
package snippet | |
import net.liftweb.http._ | |
import net.liftweb.util._ | |
import net.liftweb.common._ | |
import ebb.model.Models._ | |
import ebb.util.FaqReader | |
import org.squeryl._ | |
import PrimitiveTypeMode._ |
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
# # # # # # # ##### ###### # # #### # # | |
# # ## # # # # # # # ## # # # # # | |
# # # # # # ## ##### ##### # # # # ###### | |
# # # # # # ## # # # # # # # # # | |
# # # ## # # # # # # # ## # # # # | |
#### # # # # # ##### ###### # # #### # # | |
Version 5.1.2 Based on the Byte Magazine Unix Benchmark | |
Multi-CPU version Version 5 revisions by Ian Smith, |
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 ebb | |
package snippet | |
import net.liftweb.http._ | |
import net.liftweb.util._ | |
import org.squeryl._ | |
import PrimitiveTypeMode._ | |
import net.liftweb.util.Helpers._ | |
import java.util._ | |
import java.text._ |
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 static void index() { | |
// 用于首页中各列表板块取最新文章 | |
Category categoryMail = Category.getByCode("MAIL"); // 校友来函 | |
Category categoryFengcai = Category.getByCode("FENGCAI"); // 校友风采 | |
Category categoryJuanzeng = Category.getByCode("JUANZENG"); // 校友捐赠(文章) | |
Category categoryService = Category.getByCode("SERVICE"); // 校友服务 | |
Category categoryNotice = Category.getByCode("NOTICE"); // 通知公告 |
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
import java.lang.reflect.Array; | |
import java.util.Arrays; | |
import java.util.Date; | |
public class TestArr { | |
public static <T> T[][] createArray(int rows, int cols, T init) { | |
T[] row = (T[]) Array.newInstance(init.getClass(), cols); | |
Arrays.fill(row, init); | |
T[][] result = (T[][]) Array.newInstance(row.getClass(), rows); |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"> | |
<!-- The definition of the Root Spring Container shared by all Servlets and Filters --> | |
<context-param> | |
<param-name>contextConfigLocation</param-name> | |
<param-value>/WEB-INF/spring/root-context.xml</param-value> | |
</context-param> |
OlderNewer