This file contains hidden or 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
// ==UserScript== | |
// @name PaizaJack | |
// @namespace com.cielavenir | |
// @description PaizaJack | |
// @include https://paiza.jp/paizajack/* | |
// @run-at document-end | |
// @version 0.0.0.2 | |
// ==/UserScript== | |
// 提出制限が設けられたので本UserScriptは事実上機能しなくなりました。 |
This file contains hidden or 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
def regression(x,y): | |
mean_x = sum(x)/float(len(x)) | |
mean_y = sum(y)/float(len(y)) | |
cov = sum((a-mean_x)*(b-mean_y) for (a,b) in zip(x,y)) | |
var_x = sum((e-mean_x)**2 for e in x) | |
return (cov/var_x,mean_y-mean_x*cov/var_x) | |
def regr(x,y): | |
return numpy.linalg.lstsq(numpy.array([x,numpy.ones(len(x))]).transpose(),y) |
This file contains hidden or 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
diff --git a/Library/Homebrew/cmd/install.rb b/Library/Homebrew/cmd/install.rb | |
index 0f9a00a..c2bed9e 100644 | |
--- a/Library/Homebrew/cmd/install.rb | |
+++ b/Library/Homebrew/cmd/install.rb | |
@@ -299,7 +299,7 @@ module Homebrew | |
def symlink_ld_so | |
ld_so = HOMEBREW_PREFIX/"lib/ld.so" | |
return if ld_so.readable? | |
- sys_interpreter = ["/lib64/ld-linux-x86-64.so.2", "/lib/ld-linux.so.3", "/lib/ld-linux.so.2", "/lib/ld-linux-armhf.so.3"].find do |s| | |
+ sys_interpreter = ['/libexec/ld-elf.so.1'].find do |s| |
This file contains hidden or 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
javascript:canPost=function(){return%20$('.update_diff_score').length<=30;};for(var%20diff=$('.update_diff_score'),i=diff.length-1;i>=0;i--){var%20difficulty=diff[i].children[0].children[0].children[0].textContent;if(difficulty=='BAS'||difficulty=='ADV')diff[i].remove();} |
This file contains hidden or 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/ruby | |
require 'mechanize' | |
ATCODER_USER='' | |
ATCODER_PASSWORD='' | |
=begin | |
入力は | |
--- | |
コンテスト名 |
This file contains hidden or 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 Counter < Hash | |
def initialize(a=[]) | |
super | |
self.default=0 | |
a.each{|e|self[e]+=1} | |
end | |
def self.[](*a) | |
new(a) | |
end | |
end |
This file contains hidden or 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 "../compat.h" | |
#include <stdio.h> | |
#include <string.h> | |
static const unsigned char *tbl="\0\n\r="; | |
//todo: header | |
//=ybegin line=128 | |
static int yenc_encode(FILE *fin,FILE *fout){ | |
unsigned int x,l=0; |
This file contains hidden or 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 "../compat.h" | |
#include <stdio.h> | |
#include <string.h> | |
static const unsigned char *tbl="\0\n\r\"&\\"; | |
static int base122_encode(FILE *fin,FILE *fout){ | |
unsigned int x,y,z,c=0,b=0; | |
bool eof=false; | |
for(;!eof;){ |
This file contains hidden or 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/ruby | |
#Lobiのスタンプ吸い出し | |
#LobiのLibrary/Caches/stamp/1をplutilでxml形式に変換する(OSXがなければiOSのErica Utilitiesで。どうせアプリ領域閲覧にも脱獄必要ですし…) | |
#以下のスクリプトを食わせる | |
require 'mechanize' | |
require 'plist' | |
class Array | |
def values_rec | |
flat_map{|v|v.is_a?(Array)||v.is_a?(Hash) ? v.values_rec : v} |
This file contains hidden or 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/ruby | |
require 'mechanize' | |
agent=Mechanize.new | |
agent.get('http://blog.sina.com.cn/') | |
a=agent.page.links.map{|e|e.href}.select{|e|e&&e.start_with?('http://photo.blog.sina.com.cn/showpic.html')}.map{|e|e.split('&').find{|f|f.start_with?('url=')}[4..-1]} | |
a.each{|e| | |
agent.get(e) | |
if agent.page.response["content-type"]=="image/jpeg" | |
ext='.jpg' | |
elsif agent.page.response["content-type"]=="image/png" |