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
require 'open-uri' | |
require 'Nokogiri' | |
require 'pp' | |
uri = "http://www.agqr.jp/timetable/digital-mf.php" | |
html = Nokogiri::HTML(open(uri),nil,"utf-8") | |
html.xpath("//table[@id='timeline']/tbody/tr").each do |timeline| | |
puts "==============" | |
if timeline.xpath("th").text != "" |
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 | |
# -*- coding: utf-8 -*- | |
import feedparser | |
import pymongo | |
import datetime | |
anond_feed = feedparser.parse("http://anond.hatelabo.jp/rss") | |
client = pymongo.MongoClient() | |
db = client["anond"] |
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 | |
# -*- coding: utf-8 -*- | |
import sys | |
# File format : GROUPID,GOODSID,VIEWRATE,BUYRATE | |
# Usage : calculate_score.py target.csv predict.csv | |
def read_submit_file(submit_file): | |
viewrate = {} |
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 numpy as np | |
import scipy as sp | |
import xgboost as xgb | |
from sklearn import datasets | |
from sklearn.metrics import confusion_matrix | |
from sklearn.grid_search import GridSearchCV | |
from sklearn.grid_search import RandomizedSearchCV | |
iris = datasets.load_iris() | |
trainX = iris.data[0::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
# -*- coding: utf-8 -*- | |
require "pp" | |
require "optparse" | |
def open_t_delimited_file(filename) | |
h = { } | |
File.open(filename).readlines.each do |line| | |
a = line.split("\t") | |
if /\d+/ =~ a[6] | |
if h[a[0]] #もし既にidとfpkmの配列がhに入っている場合 |
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/sh | |
#$ -o cuffout.txt -e cufferr.txt | |
LD_LIBRARY_PATH=/usr/local/boost-1.40.0/lib | |
export LD_LIBRARY_PATH | |
/usr/local/cufflinks-0.8.2/bin/cufflinks -p 2 $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
#/usr/bin/env ruby | |
require "pp" | |
require "optparse" | |
# Usage : ruby bedgraph.rb [-o output_dir] input_file | |
# Output_dir is optional. Default output_dir is "bedgraph". | |
# | |
# Input_file format must be tab delimited file and the following format below. | |
# gene_id gene_name fpkm chr start 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 ruby | |
def open_t_delimited_file(filename) | |
h = {} | |
File.open(filename).readlines.each do |line| | |
a = line.split("\t") | |
h[a[0]] = a | |
end | |
puts filename.to_s + " was loaded." | |
return h |
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 "pp" | |
def input_marshal_data(path) | |
a = 0 | |
a_id_list = [] | |
open(path,"rb") {|f| | |
a = Marshal.load(f) |
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 | |
def open_indel_file(filename) | |
h = [] | |
open(filename) { |f| | |
f.each_line do |line| | |
a = line.chomp.split("\t") | |
h << a | |
end |
OlderNewer