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 | |
#-* coding:utf-8 -*- | |
import feedparser,sys,urllib | |
import json | |
import requests | |
from requests_oauthlib import OAuth1 | |
def get_username(auth): | |
response = requests.get("http://api.b.hatena.ne.jp/1/my", auth=auth) |
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 sys | |
from PIL import Image | |
if __name__ == "__main__": | |
filename = sys.argv[1] | |
raw_img = Image.open(filename,'r') | |
gray_img = raw_img.convert('L') | |
size = raw_img.size |
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 | |
def kolakoski_transformation(seq): | |
l = [] | |
temp = seq[0] | |
count = 0 | |
for n in seq: | |
if(n == temp): | |
count+=1 | |
else: |
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
\documentclass{jsarticle} | |
\usepackage[all]{xy} | |
\begin{document} | |
$\xymatrix{ | |
G \ar[r]^{f} \ar[d]_{\pi} & G' \\ | |
G/ker f \ar@{.>}[ru]_{\psi} | |
}$ | |
\end{document} |
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
\documentclass{jsarticle} | |
\usepackage{amscd} | |
\begin{document} | |
$\begin{CD} | |
A @>f>> B @>g>> C @>h>> D @>i>> E \\ | |
@VlVV @VmVV @VnVV @VpVV @VqVV \\ | |
A' @>r>> B' @>s>> C' @>t>> D' @>u>> E' | |
\end{CD}$ | |
\end{document} |
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 -*- | |
Plugin.create :fav_eject do | |
on_favorite do |service, user, message| | |
Thread.new { | |
system("eject") | |
} | |
end | |
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
import Text.Regex | |
import Data.List | |
readCSV :: (String,String)->IO [[String]] | |
readCSV (fileName,delimiter) = do | |
text <- (readFile fileName) | |
let column = lines text::[String] | |
elements = map (splitRegex (mkRegex delimiter)) column | |
return elements |
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
main(a,b,m){ | |
scanf("%d%d",&a,&b); | |
b=(a+=b)-2*b; | |
m=b>>31; | |
!((a=(a+(b^m)-m)/2)%2)&&printf("%d",a); | |
} |
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 -*- | |
Plugin.create :message_box_google do | |
command(:message_box_google, | |
name: 'メッセージボックスの内容をぐぐる', | |
condition: lambda{ |opt| true }, | |
visible: true, | |
role: :postbox)do |opt| | |
baseurl = 'https://www.google.co.jp/#q=' | |
str = Plugin.create(:gtk).widgetof(opt.widget).widget_post.buffer.text | |
Plugin.create(:gtk).widgetof(opt.widget).widget_post.buffer.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
# -*- coding: utf-8 -*- | |
Plugin.create :makopero do | |
on_appear do |ms| | |
ms.each do |m| | |
if m.message.to_s =~ /まこぺろ/ && !(m.user.is_me?) | |
Service.primary.post(:message => "#{"@" + m.user.idname + "阻止"}", :replyto => m) | |
m.message.favorite(true) | |
end | |
end | |
end |