Skip to content

Instantly share code, notes, and snippets.

@hideaki-t
hideaki-t / javafx20_custombrowser.groovy
Created June 29, 2011 23:01
JavaFX 2.0 and Groovy
import javafx.animation.Interpolator
import javafx.animation.TranslateTransition
import javafx.application.Application
import javafx.event.Event
import javafx.event.EventHandler
import javafx.geometry.Pos
import javafx.scene.Group
import javafx.scene.Scene
import javafx.scene.control.Button
import javafx.scene.control.TextBox
@hideaki-t
hideaki-t / groovyfx_custombrowser.groovy
Created July 3, 2011 01:04
a custom browser using GroovyFX.
import groovyx.javafx.ClosureEventHandler
import groovyx.javafx.GroovyFX
import groovyx.javafx.SceneGraphBuilder
import javafx.animation.Interpolator
import javafx.animation.TranslateTransition
import javafx.util.Duration
GroovyFX.start({
def loadAction = { view.engine.load(new URI(urlBox.getText()).toString()) }
def stage = new SceneGraphBuilder().stage(title: "GroovyFXのテスト") {
@hideaki-t
hideaki-t / compositing1.js
Created July 16, 2011 17:22
compositing multiple non-transparent images(graphs of munin)
var imgs = document.querySelectorAll('img[src*="netstat"]');
var c = document.createElement('canvas');
var c2 = document.createElement('canvas');
c.width = c2.width = imgs[0].width;
c.height = c2.height = imgs[0].height;
document.body.appendChild(c);
var ctx = c.getContext('2d');
var ctx2 = c2.getContext('2d');
var i = 0, n = imgs.length;
@hideaki-t
hideaki-t / gist:1088268
Created July 18, 2011 00:04
sleepsort with barrier(python3.2+)
import threading
import time
import random
from sys import argv
from queue import Queue
class T(threading.Thread):
def __init__(self, num, barrier, queue):
self.barrier = barrier
@hideaki-t
hideaki-t / gist:1090953
Created July 18, 2011 23:33
check performance and consistency of several counter implementations.
import java.util.concurrent.atomic.AtomicInteger;
public class test {
static final int n = 500_000_000;
int i = 0;
int si = 0;
volatile int vi = 0;
AtomicInteger ai = new AtomicInteger(0);
AtomicInteger ai2 = new AtomicInteger(0);
@hideaki-t
hideaki-t / gist:1101054
Created July 23, 2011 05:18
another custom browser using GroovyFX with JavaFX 2.0 build36+
import groovyx.javafx.GroovyFX
import groovyx.javafx.SceneGraphBuilder
import javafx.beans.value.ChangeListener
import static javafx.concurrent.Worker.State.*
GroovyFX.start({
def sg = new SceneGraphBuilder(it)
def engine = sg.webEngine()
def loadAction = { engine.load(new URL(urlBox.getText()) as String) }
def stage = sg.stage(title: "GroovyFXのテスト") {
@hideaki-t
hideaki-t / aozora_html2txt.py
Created September 1, 2011 12:44
igo-python testing tool
import lxml.html
import sys
if sys.version_info[0] < 3:
import codecs
sys.stdout = codecs.lookup('utf-8').streamwriter(sys.stdout)
else:
import io
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')
@hideaki-t
hideaki-t / gist:1238013
Created September 23, 2011 17:55
another custom browser using GroovyFX with JavaFX 2.0 build45+
import groovyx.javafx.GroovyFX
import groovyx.javafx.SceneGraphBuilder
import javafx.beans.value.ChangeListener
import static javafx.concurrent.Worker.State.SCHEDULED
import static javafx.concurrent.Worker.State.SUCCEEDED
GroovyFX.start({
def sg = new SceneGraphBuilder(it)
def loadAction = { wv.engine.load(new URL(urlBox.getText()) as String) }
def stage = sg.stage(title: "GroovyFXのテスト") {
@hideaki-t
hideaki-t / gist:1301876
Created October 20, 2011 18:21
PKGBUILD for OpenBLAS(based on gotoblas2's PKGBUILD)
# Maintainer: Hideaki Takahashi <[email protected]>
pkgname=openblas
_pkgname=OpenBLAS
pkgver=20111021
pkgrel=1
pkgdesc="OpenBLAS is an optimized BLAS library based on GotoBLAS2 1.13 BSD version"
arch=('i686' 'x86_64')
url="https://github.com/xianyi/OpenBLAS"
license=('custom')
depends=('gcc-libs')
@hideaki-t
hideaki-t / checkversion.hta
Created December 18, 2011 02:28
check JScript engine version and functionality in HTA environment
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=8 ; IE=9" />
<title>chcek JavaScript engine version</title>
</head>
<body>
</body>
<script>