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
gistup |
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
gistup |
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 urllib | |
import os | |
import gzip | |
import re | |
from collections import Counter | |
import sys | |
import time | |
import urllib2 | |
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
# -*- coding: utf-8 -*- | |
import numpy as np | |
import matplotlib.pyplot as plt | |
x = np.linspace(0, 2*np.pi, 400) | |
y = np.sin(x**2) | |
f, ([ax1, ax2], [ax3, ax4]) = plt.subplots(2, 2, sharey=True) | |
ax1.plot(x, y) | |
ax2.plot(x, y) |
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
function onDeviceReady(){ | |
if ( window.device.platform === 'iOS' && parseFloat(window.device.version) >= 7.0 ) { | |
$('<style/>').html('.ui-header{margin-top:20px}').appendTo('body'); | |
} | |
} | |
document.addEventListener('DOMContentLoaded', function(){ | |
document.addEventListener('deviceready',onDeviceReady,false); | |
}); |
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
# -*- coding: utf-8 -*- | |
import numpy as np | |
def dtw_distance(ts_a, ts_b, d=lambda x, y: abs(x-y), window=0): | |
if window <= 0: | |
window = max(len(ts_a), len(ts_b)) | |
ts_a_len = len(ts_a) | |
ts_b_len = len(ts_b) |
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
1 : 0.02373 : 特別:カテゴリ | |
2 : 0.00381 : 日本 | |
3 : 0.00286 : ファイル:Disambig_gray.svg | |
4 : 0.00262 : ファイル:Flag_of_Japan.svg | |
5 : 0.00245 : Wikipedia:スタブ | |
6 : 0.00240 : Wikipedia:出典を明記する | |
7 : 0.00237 : Wikipedia:検証可能性 | |
8 : 0.00222 : 英語 | |
9 : 0.00217 : アメリカ合衆国 | |
10 : 0.00214 : Wikipedia:信頼できる情報源 |
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
#include <iostream> | |
#include <vector> | |
using namespace std; | |
int main(){ | |
vector<int> a(10,0); | |
vector<int> b(10,1); | |
vector<int> c(9,1); | |
cout << (a==b) << endl; // 0 | |
a[0] = 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
#include <iostream> | |
#include <algorithm> | |
using namespace std; | |
int main(){ | |
bool is_prime[10000001]; | |
fill(is_prime,is_prime+10000001,true); | |
is_prime[0] = false; is_prime[1] = false; | |
for(int i=2;i<10000001;i++){ | |
if(is_prime[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
#include <iostream> | |
#include <algorithm> | |
using namespace std; | |
bool is_prime[10000001]; | |
int main(){ | |
fill(is_prime,is_prime+10000001,true); | |
is_prime[0] = false; is_prime[1] = false; | |
for(int i=2;i<10000001;i++){ |
OlderNewer