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/env ruby | |
# | |
# dblp.rb --- Parse dblp.xml to generate graphs | |
# | |
# Usage: | |
# dblp.rb author <dblp.xml --> co-author network | |
# dblp.rb key cite <dblp.xml --> citation network | |
# dblp.rb key author <dblp.xml --> paper-author network | |
# dblp.rb key venue <dblp.xml --> paper-venue network |
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/env ruby | |
# | |
# qsub.rb --- Torque job machine-gun | |
# | |
# Usage: | |
# 1. Rewrite the shell script template & parameters | |
# 2. Execute | |
# $ qsub.rb (cat) --> Output generated shell scripts | |
# $ qsub.rb sh --> Execute locally |
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 it.unimi.dsi.fastutil.ints.IntArrayFIFOQueue; | |
import it.unimi.dsi.fastutil.ints.IntArrays; | |
import it.unimi.dsi.logging.ProgressLogger; | |
import it.unimi.dsi.webgraph.GraphClassParser; | |
import it.unimi.dsi.webgraph.ImmutableGraph; | |
import it.unimi.dsi.webgraph.LazyIntIterator; | |
import java.io.*; | |
import java.util.*; |
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/env ruby | |
# | |
# crawler.rb --- Lightweight parallel web graph crawler | |
# | |
# Usage: | |
# ./crawler.rb START_URL TARGET_REGEXP | |
# | |
# Output: | |
# stdout --- edge list (tab separated URLs) |
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/env ruby | |
# | |
# sockets.rb --- by Takuya Akiba (@iwiwi) | |
# | |
# Usage: | |
# sockets.rb PID | |
# | |
`ls -l /proc/#{ARGV[0]}/fd | grep [s]ocket`.scan(/\[([0-9]+)\]/).each_with_index do |m, i| |
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
/* | |
* Basic usage: | |
* $ CXXFLAGS=-O3 make shrink_ids | |
* $ ./shrink_ids < EDGES > SHRINKED_EDGES | |
* | |
* Example: | |
* $ echo "hoge piyo\nfuga hoge" | ./shrink_ids | |
* 0 1 | |
* 2 0 | |
* |
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
/* | |
* An xorshift random generator implementation, which is compatible to std::random. | |
* | |
* References: | |
* - http://cpplover.blogspot.jp/2013/03/blog-post_22.html | |
* - http://xorshift.di.unimi.it/xorshift64star.c | |
* - http://xorshift.di.unimi.it/xorshift1024star.c | |
*/ | |
#include <random> |
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 2016, Takuya Akiba | |
# All rights reserved. | |
# | |
# Redistribution and use in source and binary forms, with or without | |
# modification, are permitted provided that the following conditions are | |
# met: | |
# | |
# * Redistributions of source code must retain the above copyright | |
# notice, this list of conditions and the following disclaimer. | |
# * Redistributions in binary form must reproduce the above |
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 numpy as np | |
import sklearn.datasets | |
import sklearn.ensemble | |
import xgboost | |
N_TRAIN = 60000 | |
NS_ITERATIONS = [2 ** k for k in range(8)] | |
MODELS = [ | |
('RandomForestClassifier', sklearn.ensemble.RandomForestClassifier, {'n_jobs': -1}), |
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 A: | |
... def hello(self): | |
... print('hellooooo') | |
... def __len__(self): | |
... print('lennnnnn') | |
... return 10 | |
... def __call__(self): | |
... print('calllllled') | |
... |
OlderNewer