Skip to content

Instantly share code, notes, and snippets.

#include <iostream>
#include <string>
#include <sstream>
#include <vector>
using namespace std;
void solve(istream& in)
{
vector<vector<int> > v;
import pylab
x = range(10)
y = range(10)
pylab.plot(x,y,'-')
pylab.title(u"日本語")
pylab.show()
元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:
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()
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()
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);
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);
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);
#! /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
#define _USE_MATH_DEFINES
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <cfloat>
#include <ctime>
#include <cassert>
#include <map>