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 demo1 | |
import com.espertech.esper.client.EventBean | |
import com.espertech.esper.client.EPAdministrator | |
import com.espertech.esper.client.UpdateListener | |
import com.espertech.esper.client.EPListenable | |
import com.espertech.esper.client.EPServiceProvider | |
object EsperUtil { |
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 demo.invoke; | |
import java.lang.invoke.*; | |
import java.lang.reflect.Method; | |
@SuppressWarnings("unused") | |
public class TestSimple { | |
public static final int LOOPS = 100000000; |
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 demo; | |
import java.util.ArrayList; | |
import java.util.List; | |
public class KillTheGarbageCollector { | |
private List<String> outerStore = new ArrayList<>(1_000_000); | |
private List<String> oldStore = new ArrayList<>(1_000_000); | |
private static int nThread = 3; |
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
#include <pth.h> | |
#include <stdio.h> | |
#include <sys/time.h> | |
pth_uctx_t u_main; | |
pth_uctx_t u_test; | |
char stack[16*1024]; | |
void test(void *); |
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 demo; | |
import java.io.IOException; | |
import java.nio.ByteBuffer; | |
import java.nio.channels.Pipe; | |
import java.nio.channels.Pipe.SinkChannel; | |
import java.nio.channels.Pipe.SourceChannel; | |
public class ThreadSwitch { |
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
#include <stdio.h> | |
#include <unistd.h> | |
#include <sys/time.h> | |
#include <sys/types.h> | |
#include <sys/stat.h> | |
#include <fcntl.h> | |
main(){ |
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 wangzx.util.json; | |
import java.io.IOException; | |
import javax.xml.transform.sax.SAXSource; | |
import net.sf.json.JSONArray; | |
import net.sf.json.JSONObject; | |
import org.xml.sax.ContentHandler; |
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 demo | |
import scala.util.continuations._ | |
object Demo1 { | |
def main(args: Array[String]) { | |
var cont: (Int=>String) = null | |
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
# -*- coding: utf-8 | |
''' | |
从数据源同步获取Channel在线的数据,保存到mongodb中 | |
这个脚本一般以crontab方式运行,每30秒运行一次 | |
@author: [email protected] | |
''' | |
from app_logger import Logger, set_logging_path |
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 macro_basic | |
import scala.reflect.macros.Context | |
import scala.language.experimental.macros | |
object BeanMacros { | |
def ToString[A](obj: A): String = macro toStringMacro[A] | |
def toStringMacro[A](c: Context)(obj: c.Expr[A]): c.Expr[String] = { | |
import c.universe._ |
OlderNewer