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
| #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
| // Copyright 2014 Yu Jing<yu@argcv.com> | |
| #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
| 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
| 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
| /********************************************************************** | |
| 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( | |
| 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
| package org.aminer.io.utils | |
| import scala.util.Try | |
| import com.google.common.cache.CacheBuilder | |
| import com.google.common.cache.CacheLoader | |
| import com.google.common.cache.LoadingCache | |
| //import com.google.common.cache.CacheBuilder | |
| //import com.google.common.cache.CacheLoader |
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
| object Solution { | |
| def main(args: Array[String]): Unit = { | |
| val n = Console.in.readLine().toInt | |
| val sl = (1 to n).map(i => (Console.in.readLine(),i)) | |
| //io.Source.stdin.getLines().take(1).map(_.toInt) | |
| println(math.abs(sl.par.foldLeft(0){(l,e) => | |
| val i = e._2 - 1 | |
| val arr = e._1.split(" ") | |
| l + arr(i).toInt - arr(n - i - 1).toInt |
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
| <?xml version="1.0" encoding="UTF-8"?> | |
| <rexster> | |
| <http> | |
| <server-port>8182</server-port> | |
| <server-host>0.0.0.0</server-host> | |
| <base-uri>http://127.0.0.1</base-uri> | |
| <web-root>public</web-root> | |
| <character-set>UTF-8</character-set> | |
| <enable-jmx>false</enable-jmx> | |
| <enable-doghouse>true</enable-doghouse> |