This file contains 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 matplotlib | |
import matplotlib.pyplot as plt | |
matplotlib.rc('font', family='MS Gothic') | |
%matplotlib inline | |
plt.plot([1,2,3,4]) | |
plt.title(u'日本語') | |
plt.show() | |
# 利用可能なフォント一覧 |
This file contains 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 | |
for FILE in `s3cmd ls -r s3://auone-search/spfeature/ | awk '{print $4}'` | |
do | |
echo $FILE | |
s3cmd modify --add-header=Cache-Control:max-age=2592000 $FILE | |
done | |
This file contains 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 tempfile | |
import sys | |
import urllib2 | |
import shutil | |
import json | |
import base64 | |
def request(api_key, data): |
This file contains 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
DataNodeの挙動について | |
DataNode.java | |
DataNode#main | |
-> DataNode#secureMain | |
# BlockPoolManagerの初期化まで | |
-> DataNode#createDataNode | |
-> DataNode dn = DataNode#instantiateDataNode |
This file contains 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
int setbit(int x, int n){ | |
return x | 1 << n; | |
} | |
bool testbit(int x, int n){ | |
return (x & 1 << n) != 0; | |
} | |
void printbit(int x){ | |
for(size_t i = 0; i < sizeof(int) * 8; i++){ |
This file contains 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 SmartElevator { | |
vector<int> arrive,start,dest; | |
int rec(int pos, int t, vector<bool> &startVisited, vector<bool> &destVisited){ | |
if(count(destVisited.begin(),destVisited.end(),true) == (int)dest.size()){ | |
return t; | |
} | |
int minn = 1E+8; | |
for(size_t i = 0; i < start.size(); i++){ | |
if(startVisited[i]) continue; |
This file contains 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 TheBasketballDivOne { | |
set<vector<int> > s; | |
int n,m; | |
void check_and_insert(vector<vector<bool> > &v){ | |
vector<int> v2; | |
for(int i = 0; i < n; i++){ | |
int cnt = 0; | |
for(int j = 0; j < 2*n; j++){ | |
if(v[i][j]) cnt++; |
This file contains 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 MagicWords | |
{ | |
void permute0(size_t i, vector<int> &used, vector<int> &path, const vector<int> &v, vector<vector<int> > &result){ | |
if(i == v.size()){ | |
result.push_back(path); | |
return; | |
} | |
for(int j = 0; j < int(v.size()); j++){ | |
if(used[j] != 1){ | |
used[j] = 1; |
This file contains 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
struct DDMY{ ostringstream o; template<class T>DDMY& operator,(const T &t){o<<t<<",";return *this;} string operator*(){ return o.str().substr(0,o.str().size()-1); } }; | |
#define debug(args...) cout<<"("#args")=("<< *(DDMY(),args)<<") (L"<<__LINE__<<")"<<endl | |
template<class T> std::ostream &operator<<(std::ostream &o,const std::vector<T> &v) | |
{ o << "["; for(std::size_t i=0;i<v.size();i++) o << v[i] << (i < v.size()-1 ? ",":""); return o << "]"; } | |
template<class T,class U> std::ostream &operator<<(std::ostream &o,const std::pair<T,U> &v) | |
{ return o << v.first << ":" << v.second; } | |
template<class T,class U> std::ostream &operator<<(std::ostream &o,const std::map<T,U> &v) | |
{ o << "{"; typename std::map<T,U>::const_iterator i=v.begin(),j=i;++j;for(;i!=v.end();++i,++j) o << *i << (j!=v.end()? ",":""); return o << "}"; } | |
template<class T> std::ostream &operator<<(std::ostream &o,const std::set<T> &v) | |
{ o << "{"; typename std::set<T>::const_iterator i=v.begin(),j=i;++j;for(;i!=v.end();++i,++j) o << *i << (j!=v.end()? ", |
This file contains 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 python | |
import math | |
def f(MP,t): | |
return MP * (0.3 + ((0.7 * 75.0 * 75.0) / (10.0 * t * t + 75.0 * 75.0))) | |
def check(y,SCORE,MP): | |
if SCORE > f(MP,y): | |
return True |
NewerOlder