Skip to content

Instantly share code, notes, and snippets.

View mizdra's full-sized avatar

mizdra mizdra

View GitHub Profile
package synchronizedtest1;
import java.util.logging.Level;
import java.util.logging.Logger;
public class SynchronizedTest1 {
public static void main(String[] args) {
A a = new A();
B b = new B(a);
package futurecanceltest1;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
public class FutureCancelTest1 {
private static final int task_size = 3; // 起動するタスク数
private static final boolean mayInterruptIfRunning = true; // cancelメソッドに渡す引数
@mizdra
mizdra / Nature.java
Created February 16, 2015 12:12
ポケモンの性格の列挙型
/*
* Nature.java
* Copyright (c) 2015 mizdra
* License: MIT License
*/
import java.util.Locale;
public enum Nature {
@mizdra
mizdra / AnchorPaneSample.fxml
Created February 25, 2015 16:23
JavaFX Samples
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.*?>
<?import java.lang.*?>
<?import javafx.scene.layout.*?>
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1">
<children>
<TableView prefHeight="200.0" prefWidth="200.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
@mizdra
mizdra / ability.json
Last active August 29, 2015 14:18
Pokemon data (for Gen 3)
[
[
"?",
"?"
],
[
"しんりょく",
"しんりょく"
],
[
@mizdra
mizdra / emerald.json
Created March 30, 2015 09:25
Encounter data (for Gen 3)
{
"normal": [
{
"name": "101ばんどうろ",
"slot": [
{
"index": 265,
"level": {
"min": 2,
"diff": 0
@mizdra
mizdra / pokedex-gen3-ja.json
Last active September 18, 2015 15:39
種族値, 性別しきい値, 持ち物, 特性をまとめた第三世代向けのポケモン図鑑 (コメントで解説有り)
[
{
"id": 1,
"national_id": 1,
"name": "フシギダネ",
"form_name": null,
"height": 7,
"weight": 69,
"types": [
"くさ",
@mizdra
mizdra / lcg-generator.js
Created August 25, 2015 08:04
var g = generator(0x41c64e6d, 0x6073, 0x0);
'use asm';
'use strict';
function* generator(a, b, s) {
a = a | 0;
b = b | 0;
s = s | 0;
while (true) {
s = (Math.imul(s, a) + b) | 0;
yield s;
/**
* OS: Windows 7 CPU: i7-2670QM 2.20GHz 4コア 8スレッド RAM: 8GB 計算時間: 12分6秒
*/
public class PIDSkipCounter {
private static final int METHOD = 3; // 1, 3に対応
private static final boolean SYNCHRONIZE = false; // trueでシンクロ適用
private static final int SYNCHRONIZE_NATURE = 0; // シンクロポケモンの性格
@mizdra
mizdra / index.js
Last active December 15, 2015 10:10
node-sample
var moment = require("moment");
var str = moment().format("YYYY-MM-DD HH:mm:ss");
console.log(str);