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 <iostream> | |
#include <string> | |
#include <sstream> | |
#include <vector> | |
using namespace std; | |
void solve(istream& in) | |
{ | |
vector<vector<int> > v; |
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 pylab | |
x = range(10) | |
y = range(10) | |
pylab.plot(x,y,'-') | |
pylab.title(u"日本語") | |
pylab.show() |
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
元URL : https://gist.github.com/masashinakata/5668219 | |
### 補足 ### | |
# インストールする先は CentOS 5.9(final) x86_64(intelの64bitのこと) | |
# PATHは$HOME/usr/local/binと$HOME/usr/local/gcc-4.8.0/binへ、 | |
# LD_LIBRARY_PATHは$HOME/usr/local/libを追加すると捗る | |
# お好みでmake checkする ただしPPLのmake checkは恐ろしく時間がかかる? | |
# Assuming that everything will reside on $HOME/usr/local directory as | |
# depicted below: |
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
public class TupleFunc | |
{ | |
public static Func<Tuple<T1, T2>, TResult> Create<T1, T2, TResult>(Func<T1, T2, TResult> f) | |
{ | |
return new Func<Tuple<T1, T2>, TResult>(t => f(t.Item1, t.Item2)); | |
} | |
} | |
public static Main{ | |
static void 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
public class TupleFunc | |
{ | |
public static Func<Tuple<T1, T2>, TResult> Create<T1, T2, TResult>(Func<T1, T2, TResult> f) | |
{ | |
return new Func<Tuple<T1, T2>, TResult>(t => f(t.Item1, t.Item2)); | |
} | |
} | |
public static Main{ | |
static void 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
private string GetPythonPath() | |
{ | |
Func<Microsoft.Win32.RegistryKey, string> get_path = key => | |
{ | |
using (var sub_key = key.OpenSubKey(@"SOFTWARE\Python\PythonCore\2.7\InstallPath")) | |
{ | |
if (sub_key == null) | |
return null; | |
var path = (string)sub_key.GetValue(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
private string GetPythonPath() | |
{ | |
Func<Microsoft.Win32.RegistryKey, string> get_path = key => | |
{ | |
using (var sub_key = key.OpenSubKey(@"SOFTWARE\Python\PythonCore\2.7\InstallPath")) | |
{ | |
if (sub_key == null) | |
return null; | |
var path = (string)sub_key.GetValue(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
template<class T> T gcd(T a, T b) { return b ? gcd(b, a % b) : a; } | |
template<class T> T lcm(T a, T b) { return a / gcd(a,b) * b; } | |
template<class T> | |
class Fraction{ | |
void normalize(){ | |
if(p == 0){ | |
q = 1; | |
} else { | |
T g = gcd(p,q); |
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 | |
import subprocess,glob,time | |
def execute(cmd): | |
print cmd | |
p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) | |
for _ in xrange(10): | |
if p.poll() != None: | |
stdout_data, stderr_data = p.communicate() | |
return stdout_data |
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
#define _USE_MATH_DEFINES | |
#include <cstdio> | |
#include <cstdlib> | |
#include <cstring> | |
#include <cmath> | |
#include <climits> | |
#include <cfloat> | |
#include <ctime> | |
#include <cassert> | |
#include <map> |
OlderNewer