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
package org.saekiyoshiyasu.common; | |
/** | |
Copyright: (c) SAEKI Yoshiyasu | |
License : MIT-style license | |
<http://www.opensource.org/licenses/mit-license.php> | |
last updated: 2012/03/16 | |
**/ | |
import java.net.URL; |
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 <stdio.h> | |
int main() { | |
char buf[256]; | |
printf("string> "); | |
scanf("%s", buf); | |
printf(buf); | |
return; | |
} |
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
package main | |
import ( | |
"fmt" | |
"os" | |
"strconv" | |
) | |
func stream(ch chan int) { |
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
-- Copyright : (c) SAEKI Yoshiyasu | |
-- License : MIT-style license | |
-- <http://www.opensource.org/licenses/mit-license.php> | |
-- last updated: 2012/01/21 | |
on open droppedItems | |
tell application "Finder" | |
repeat with obj in droppedItems | |
set fileName to ((name of obj) as string) | |
set fileNameNoExt to (do shell script "basename " & fileName & " .pdf") |
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 tablib | |
ds = tablib.Dataset() | |
ds.rpush(("Bob", 20), tags=['male', 'us']) | |
ds.rpush(("Carol", 31), tags=['female', 'us']) | |
ds.lpush(("Alice", 21), tags=['female', 'us']) | |
ds.rpush(("Taro", 10), tags=['male', 'jp']) | |
ds.headers = ["name", "age"] |
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
diff -r tablib-0.9.11.org/tablib/compat.py tablib-0.9.11/tablib/compat.py | |
15c15 | |
< | |
--- | |
> is_jython = sys.platform.lower().startswith("java") | |
28c28,29 | |
< from tablib.packages.odf3 import opendocument, style, text, table | |
--- | |
> if not is_jython: | |
> from tablib.packages.odf3 import opendocument, style, text, table |
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 hashlib | |
import urllib | |
user = "MY_IM_KAYAC_COM_ID" | |
secret_key = "MY_SECRET_KEY" | |
url = "http://im.kayac.com/api/post/" + user | |
message = u"This is a test message".encode("UTF-8") |
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 logging | |
import sleekxmpp | |
class MonitoringBot(sleekxmpp.ClientXMPP): | |
def __init__(self, id, password): | |
sleekxmpp.ClientXMPP.__init__(self, id, password) |
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
class Calc: | |
def __init__(self): | |
print "init Calc" | |
def add(self, a, b): | |
return (a + b) | |
def sub(self, a, b): | |
return (a - 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
;; Copyright : (c) SAEKI Yoshiyasu | |
;; License : MIT-style license | |
;; <http://www.opensource.org/licenses/mit-license.php> | |
;; last updated: 2011/10/29 | |
(defun join (sep lst) | |
(mapconcat 'identity lst sep)) | |
(defun tail (lst) | |
(reverse (cdr (reverse lst)))) |