Skip to content

Instantly share code, notes, and snippets.

View torus's full-sized avatar
😎
Focusing

Toru Hisai torus

😎
Focusing
View GitHub Profile
@torus
torus / js-with-vs-function-call.html
Created November 2, 2010 02:35
Comparing with structure and Function.call method.
<html>
<head>
<title>with vs Function.call</title>
</head>
<body>
<p>See JavaScript console using Chrome developer tool or Firebug.</p>
<script id="script">
console.log ("using with...");
@torus
torus / SafeTween.as
Created December 3, 2010 01:12
A Tween replacement to avoid getting GC-ed during playing a tween.
package {
import fl.transitions.Tween;
import flash.utils.*;
public class SafeTween {
var tw : Tween;
public function SafeTween (obj:Object, prop:String, func:Function,
begin:Number, finish:Number,
duration:Number, useSeconds:Boolean = false) {
@torus
torus / README.md
Created February 11, 2011 11:24
リブルラブル風塗りつぶし。
@torus
torus / yahtml-xhtml.patch
Created March 3, 2011 02:57
yahtml for XHTML
diff -r 127a36f4cd6a yahtml.el
--- a/yahtml.el Mon Sep 28 12:48:28 2009 +0900
+++ b/yahtml.el Wed Mar 02 16:55:11 2011 -1000
@@ -880,7 +880,9 @@
(if (string= form "") (setq form yahtml-last-form))
(setq yahtml-last-form form)
(if yahtml-prefer-upcases (setq form (upcase form)))
- (insert (format "<%s%s>" form (yahtml-addin form)))
+ (insert (format "<%s%s%s>" form (yahtml-addin form)
+ (if (and yahtml-need-single-closer
// http://community.topcoder.com/stat?c=problem_statement&pm=11509
var results = {};
for (var i in a) {
for (var j in b) {
for (var k in c) {
var val = a[i] + b[j] + c[k];
var origval = val;
while (val % 10 == 5 || val % 10 == 8) {val = (val / 10)|0}
if (val == 0) {console.log(origval, i, j, k);results[origval] = true}
@torus
torus / threads.lua
Created September 5, 2011 01:47
thread-ring benchmark
-- The Computer Language Benchmarks Game
-- http://shootout.alioth.debian.org/
-- contributed by Toru Hisai
function make_thread (name, next)
return coroutine.create (
function (m)
while m > 0 do
m = coroutine.yield (next)
@torus
torus / tumblr_theme.html
Created September 22, 2011 23:53
Tumblr theme definition
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- Lightweight Theme by Artur Kim (http://arturkim.com) for Tumblr | version 1.1 -->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{block:SearchPage}Search results for: {SearchQuery} | {/block:SearchPage}{block:IndexPage}{Title}{/block:IndexPage}{block:PostSummary}{PostSummary}{/block:PostSummary}</title>
{block:Description}<meta name="description" content="{MetaDescription}" />{/block:Description}
<link rel="shortcut icon" href="{Favicon}" />
<link rel="apple-touch-icon" href="{PortraitURL-128}"/>
<link rel="alternate" type="application/rss+xml" href="{RSS}" />
GL_RENDERER = Intel HD Graphics 3000 OpenGL Engine
GL_VERSION = 2.1 APPLE-7.12.9
GL_VENDOR = Intel Inc.
GL_EXTENSIONS = GL_ARB_color_buffer_float GL_ARB_depth_buffer_float GL_ARB_depth_clamp GL_ARB_depth_texture GL_ARB_draw_buffers GL_ARB_draw_elements_base_vertex GL_ARB_draw_instanced GL_ARB_fragment_program GL_ARB_fragment_program_shadow GL_ARB_fragment_shader GL_ARB_framebuffer_object GL_ARB_framebuffer_sRGB GL_ARB_half_float_pixel GL_ARB_half_float_vertex GL_ARB_instanced_arrays GL_ARB_multisample GL_ARB_multitexture GL_ARB_occlusion_query GL_ARB_pixel_buffer_object GL_ARB_point_parameters GL_ARB_point_sprite GL_ARB_provoking_vertex GL_ARB_seamless_cube_map GL_ARB_shader_objects GL_ARB_shader_texture_lod GL_ARB_shading_language_100 GL_ARB_shadow GL_ARB_sync GL_ARB_texture_border_clamp GL_ARB_texture_compression GL_ARB_texture_compression_rgtc GL_ARB_texture_cube_map GL_ARB_texture_env_add GL_ARB_texture_env_combine GL_ARB_texture_env_crossbar GL_ARB_texture_env_dot3 GL_ARB_texture_float GL_ARB_textu
@torus
torus / gist:2436326
Created April 21, 2012 10:08
アルゴリズム・イントロダクション 11.2-4
  • 使用中フラグ
  • 要素
  • next ポインタ

初期化

  • すべての要素のフラグを false にセットする

挿入

  • もし T[h(x)] のフラグが偽なら