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/ls | xargs -i chown -R {}:{} {} |
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
rsync -Cav -e ssh . other_mac:Pictures/iPhoto\\\ Library/ |
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
nkf -w8 unchi.html|tr -d '\r\n'|tr -d '\t'|tr -s ' ' ' '|nkf -s >madamashi.html |
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
public ArrayList<Integer> | |
execClusterAnalize(int clusterSize, int maxTrialFreq){ | |
/* セントロイド */ | |
double[][] center = new double[clusterSize][getTagsLength()]; | |
double[][] previousCenter = new double[clusterSize][getTagsLength()]; | |
/* 試行回数のカウンタ */ | |
int trialFreq=0; | |
/* 所属クラスタ(pagesと関連づけ) */ | |
ArrayList<Integer> belongingCluster = | |
new ArrayList<Integer>(); |
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 ruby | |
# -*- coding: utf-8 -*- | |
require 'rubygems' | |
require 'MeCab' | |
require 'net/http' | |
require 'uri' | |
require 'extractcontent.rb' | |
$KCODE='u' | |
Net::HTTP.version_1_2 |
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 ruby | |
# -*- coding: utf-8 -*- | |
require 'uri' | |
require 'open-uri' | |
class Results | |
@l = nil | |
@cache = nil |
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 ruby | |
# -*- coding: utf-8 -*- | |
require 'net/http' | |
require 'uri' | |
Net::HTTP.version_1_2 | |
class Shindan | |
def initialize(arr) | |
@arr = arr |
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
public String load(String uri) throws IOException, InterruptedException { | |
final String LINE_SEPA = System.getProperty("line.separator"); | |
Process p = Runtime.getRuntime().exec( | |
new String[] { "/path/to/ruby", | |
"/path/to/extract_content_uri.rb", uri }); | |
BufferedReader br = null; | |
try { | |
StringBuffer out = new StringBuffer(); | |
br = new BufferedReader(new InputStreamReader(p.getInputStream())); |
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
module ECC | |
class ECC_Point | |
def initialize(x, y) | |
@x = reduce(x, MOD) | |
@y = reduce(y, MOD) | |
end | |
def zero? | |
(@x == 0 && @y == 0) |
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
module ECC | |
MOD = 1049 | |
ORD = 1033 | |
class EC_func | |
def self.l(y) | |
y**2 | |
end |