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.argcv.util.mongo; | |
import java.io.FileInputStream; | |
import java.io.FileNotFoundException; | |
import java.io.IOException; | |
import java.util.ArrayList; | |
import java.util.Arrays; | |
import java.util.List; | |
import java.util.Properties; | |
import java.util.Set; |
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
// usage : g++ thread_pool.cc -o tp -pthread --std=c++11 | |
// remove chrono header and timer, you may modify this file to c | |
// usage : gcc xxx.c -o tp_in_c -pthread --std=c99 | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <math.h> | |
#include <pthread.h> | |
#include <unistd.h> | |
#include <chrono> // for timer |
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 <stdlib.h> | |
#include <string.h> | |
#include <string> | |
#include <vector> | |
#include <fstream> | |
#include <sys/socket.h> | |
#include <netinet/in.h> | |
#include <arpa/inet.h> | |
#include <assert.h> |
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
val json = net.liftweb.json.JsonParser.parse("[{\"foo\":1,\"bar\":2},{\"foo\":3,\"bar\":4}]") | |
implicit val formats = net.liftweb.json.DefaultFormats | |
case class Info(foo:Int,bar:Int) | |
val m = json.extract[List[Info]] | |
m.foreach{x=> println(x.foo+"|"+x.bar)} |
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 <cstdio> | |
#include <cstring> | |
#include <pthread.h> // thread | |
#include <unistd.h> // usleep | |
#include <string> | |
#include <mutex> // std::lock_guard , mutex | |
#include <queue> // queue |
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
class Solution { | |
public: | |
void reverse(string &w) { | |
unsigned int len = w.length(); | |
for(unsigned int i = 0 ; i < len / 2 ; i ++ ) { | |
char t = w[i]; | |
w[i] = w[len - 1 - i]; | |
w[len - 1 - i] = t; | |
} | |
} |
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
// Copyright [2015] <Yu Jing> | |
#include <cstdio> | |
#include <string> | |
#include <map> | |
using std::string; | |
using std::map; | |
char ch_searcher(const std::string & s) { |
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
[2015-01-19 14:57:37,939][WARN ][org.elasticsearch.river.mongodb.Indexer] failed to script process {document={ "_id" : { "$oid" : "53e9978ab7602d9701f45733"} , "abstract" : "Objective To study the effects of bikunin on the invasion of PC3 prostate cancer cells and its und | |
erlying mechanism.Methods We treated PC3 cells with bikunin and assessed its effects on cell invasion.We also detected the level of phosphorylated PI3K and AKT after bikunin treatment.Moreover,we assessed the influence of the inhibitors of PI3K and AKT on cell invasion in | |
PC3 cells.Furthermore,we assessed the impact of constitutively active PI3K transfection on bikunin's activity.Results Our results revealed that bikunin treatment significantly suppressed cell invasion in PC3 cells.The activity of PI3K and AKT was also inhibited by bikuni | |
n treatment.Constitutively active PI3K transfection suppressed the inhibition of bikunin on cell invasion.Conclusion Bikunin can inhibit the invasion of PC3 cells.PI3K/AKT pathway might be involved in this |
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
/* | |
* my result as follow : | |
### O0: | |
$ g++ -std=c++11 string_generator.cc -o string_generator -O0 && ./string_generator | |
final val is :first_strsecond_strthird_str | |
Method 0 : 614.236 ms. | |
final val is :first_strsecond_strthird_str | |
Method 1 : 579.361 ms. | |
final val is :first_strsecond_strthird_str | |
Method 2 : 2782.47 ms. |
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
def pi1(lsz: Int): Double = { | |
var a = 3.0 | |
var off = 1 | |
var lcnt = lsz | |
def p_elem(t: Int): Double = 4.0 / ((2 * t) * (2 * t + 1) * (2 * t + 2)) | |
while (lcnt > 0) { | |
if (off % 2 == 0) { | |
a -= p_elem(off) | |
} else { | |
a += p_elem(off) |