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
import scala.collection.mutable.{ Map => MMap } | |
object Solution { | |
case class PrefixTrieNode( | |
base: Char, // current node | |
next: MMap[Char, PrefixTrieNode]) { | |
var v: Boolean = false | |
} | |
class PrefixTrieTree { |
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
/********************************************************************** | |
Author: Sherlock | |
Created Time: 2008-10-28 16:24:47 | |
File Name: | |
Description: | |
**********************************************************************/ | |
#include <cstdio> | |
#include <cstring> | |
#include <cstdlib> | |
#include <algorithm> |
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
import scala.collection.mutable.{ Map => MMap } | |
object Solution { | |
case class PrefixTrieNode(next: MMap[Char, PrefixTrieNode]) { | |
var v: Boolean = false | |
} | |
class PrefixTrieTree { | |
val root: PrefixTrieNode = PrefixTrieNode(MMap[Char, PrefixTrieNode]()) |
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
const size_t K_TH_FIND_LENGTH_THRESHOLD = 5; | |
template <typename T> | |
bool k_th_find_default_comparator(T l, T r) { | |
return l < r; | |
} | |
template <typename T> | |
void k_th_find_partition(std::vector<T> *_v, T e, // |
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 2014 Yu Jing<[email protected]> | |
#include <cstdio> | |
#include <syslog.h> // syslog | |
#include <vector> | |
#include <string> | |
#include <map> | |
#include <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
#sudo pip install --upgrade git+https://github.com/dav1dde/glad.git#egg=glad | |
#python main.py --api gl=3.3 --generator=c --out-path=GL | |
find_package(CUDA) | |
find_package(GLFW) | |
include_directories(${GLFW_INCLUDE_DIRS}) | |
include_directories(GL/include) | |
cuda_add_executable(main main.c assert_cuda.c interop.c GL/src/glad.c kernel.cu) | |
target_link_libraries(main ${GLFW_LIBRARY}) |
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
pub struct DataSet<X, Y> { | |
d: Vec<(Vec<X>, Y)> | |
} | |
impl DataSet { | |
pub fn new<X, Y>() -> DataSet<X, Y> { | |
DataSet { d: Vec::<(Vec<X>, Y)>::new() } | |
} | |
} |
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
curl 'http://ftp.apnic.net/apnic/stats/apnic/delegated-apnic-latest' | grep ipv4 | grep CN | awk -F\| '{ printf("%s/%d\n", $4, 32-log($5)/log(2)) }' > chnroute.txt |
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
#!/bin/bash | |
### BEGIN INIT INFO | |
# Provides: <service name> | |
# Required-Start: $remote_fs $syslog | |
# Required-Stop: $remote_fs $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: <service description> | |
### END INIT INFO |
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
#!/usr/bin/python | |
# encoding: utf-8 | |
import sys | |
import argparse | |
from workflow import Workflow | |
#from workflow import Workflow3 | |
from DictionaryServices import * | |
import urllib2 |