Skip to content

Instantly share code, notes, and snippets.

View mizdra's full-sized avatar

mizdra mizdra

View GitHub Profile
@mizdra
mizdra / package.json
Created December 15, 2015 10:12
package.json for ts-sample
{
"name": "ts-sample",
"version": "1.0.0",
"description": "",
"main": "./lib/index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC"
@mizdra
mizdra / Test_Pokemon-Showdown.md
Last active February 27, 2016 16:55
Zarel/Pokemon-Showdownで遊ぶ。

Zarel/Pokemon-Showdown 解析

要求される知識・環境

  • git
  • Node.js(JavaScript)
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
public class PIDSkipCounter {
// パラメータの設定
static final int[] METHOD_LIST = new int[]{1, 3}; // 1, 3に対応
static final boolean[] SYNCHRONIZE_LIST = new boolean[]{true, false}; // trueでシンクロ適用
static final int[] SYNCHRONIZE_NATURE_LIST // シンクロポケモンの性格
= new int[]{
basePath: "./data/"
this.isBase: true
this.currentMod: "base"
this.parentMod: ""
basePath: "./data/"
this.isBase: true
this.currentMod: "base"
this.parentMod: ""
@mizdra
mizdra / Pokemon-Showndown-dependency.md
Last active March 29, 2016 05:47
Zarel/Pokemon-Showdown 反動ダメージ調査のための依存関係調査
function* gen() {}
var g = gen();
assert.deepEqual(g.return(1), {value: 1, done: true});
assert.deepEqual(g.return(2), {value: undefined, done: true});
assert.deepEqual(g.return(3), {value: undefined, done: true});
@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;
public class Main {
public static final int MULTIPLIER = 0x41c64e6d;
public static final int INCREMENT = 0x6073;
public static void main(String[] args){
System.out.println("MULTIPLIER: 0x" + Integer.toHexString(MULTIPLIER));
System.out.println("INCREMENT: 0x" + Integer.toHexString(INCREMENT));
int multiplierInverse = 0x00000000;
function calcPow(a, n, mask) {
return n === 0 ? 1 :
Math.imul((n & 1 ? a : 1), calcPow(Math.imul(a, a) & mask, n >>> 1, mask));
}
function calcInverse(mul, mask) {
return calcPow(mul, mask >>> 1, mask);
}
function u32(x) {
$(function(){
getModules().then(function(modules) {
// 全ての非同期通信が完了したらこの関数が実行される。
console.log(modules);
});
});
// 複数の非同期通信を実行し、全てが終了したら.thenをコールするPromise(jQuery.DeferredのPromise)を返す。