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 struct | |
import StringIO | |
import binascii | |
import zlib | |
import datetime | |
def deflate(data, compresslevel=9, flush_mode=zlib.Z_FINISH): | |
compress = zlib.compressobj( | |
compresslevel, # level: 0-9 |
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 "google_drive" | |
session = GoogleDrive.saved_session | |
spreadsheet = session.spreadsheet_by_url("https://docs.google.com/spreadsheets/d/1ScxgwUUrXOtvxw4eqhoR6pMkEdC4oYM3zOjq_6gZAAc/edit#gid=0") | |
ws = spreadsheet.worksheets[0] | |
start_time = Time.now | |
ws.cells | |
end_time = Time.now | |
puts("Took %f secs." % (end_time - start_time)) |
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
<link rel="import" href="../core-field/core-field.html"> | |
<link rel="import" href="../core-icon/core-icon.html"> | |
<link rel="import" href="../core-input/core-input.html"> | |
<link rel="import" href="../core-icons/core-icons.html"> | |
<link rel="import" href="../paper-button/paper-button.html"> | |
<link rel="import" href="../paper-checkbox/paper-checkbox.html"> | |
<link rel="import" href="../core-icons/av-icons.html"> | |
<link rel="import" href="../paper-fab/paper-fab.html"> | |
<link rel="import" href="../paper-toggle-button/paper-toggle-button.html"> | |
<link rel="import" href="../paper-tabs/paper-tabs.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
import scala.collection.mutable.ArrayBuffer | |
import scala.io.Source | |
object ShantenAnalysis { | |
val NUM_PIDS = 9 * 3 + 7 | |
var mentsus:ArrayBuffer[Array[Int]] = null | |
def main(args: Array[String]) { | |
mentsus = createMentsus() |
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 "tilt" | |
require "tempfile" | |
f = Tempfile.open("template") | |
f.puts('<%# coding: UTF-8 %>') | |
f.puts('ふが <%= @hoge %>') |
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 "enumerator" | |
$stdout.sync = true | |
while true | |
line = `ps auxww`.enum_for(:each_line).grep(/^\S+\s+#{ARGV[0]}\s+/)[0] | |
break if !line | |
puts(Time.now.to_s() + " " + line) | |
sleep(10) | |
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
# Workaround code to solve garbled text issue in appengine-jruby from | |
# http://d.hatena.ne.jp/yune_kotomi/20090922/1253627829 | |
module AppEngine | |
module Datastore | |
def Datastore.ruby_to_java(value) # :nodoc: | |
if SPECIAL_RUBY_TYPES.include? value.class | |
value.to_java | |
else | |
case value |
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 java.util.Timer; | |
import java.util.TimerTask; | |
import android.app.Service; | |
import android.os.Handler; | |
public class MyService extends Service { | |
private Handler handler = new Handler(); | |
private Timer timer; |
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
--- setup.rb.orig Mon Jul 20 21:29:03 2009 | |
+++ setup.rb Mon Jul 20 21:28:21 2009 | |
@@ -1457,14 +1457,9 @@ | |
return | |
end | |
$stderr.puts 'Running tests...' if verbose? | |
- begin | |
- require 'test/unit' | |
- rescue LoadError | |
- setup_rb_error 'test/unit cannot loaded. You need Ruby 1.8 or later to invoke this task.' |
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 | |
# Copyright (c) 2009, Shinichiro Hamaji | |
# All rights reserved. | |
# | |
# Redistribution and use in source and binary forms, with or without | |
# modification, are permitted provided that the following conditions are met: | |
# | |
# * Redistributions of source code must retain the above copyright notice, this | |
# list of conditions and the following disclaimer. |
NewerOlder