Skip to content

Instantly share code, notes, and snippets.

<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="7zip.install" version="18.1" />
<package id="GoogleChrome" version="65.0.3325.18100" />
<package id="GoogleJapaneseInput" version="1.3.24.20141007" />
<package id="lhaplus" version="1.72" />
<package id="nodejs.install" version="9.11.1" />
<package id="qttabbar" version="1038.0" />
<package id="rapidee" version="9.1.936.20170923" />
<package id="SourceTree" version="2.4.8.0" />
@poppycocker
poppycocker / fukashigi_dfs.cpp
Last active December 28, 2017 02:19
フカシギの数え方_深さ優先探索
#include <iostream>
#include <sstream>
#include <memory>
#include <vector>
#include <chrono>
#include <emscripten/emscripten.h>
using namespace std;
struct Node {
@poppycocker
poppycocker / WebAssembly,Emscripten.md
Last active December 27, 2017 18:06
WebAssembly,Emscripten
@poppycocker
poppycocker / index.html
Last active December 26, 2017 05:53
Web Workers Demo
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>ww</title>
<script
src="https://code.jquery.com/jquery-3.2.1.min.js"
integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4="
crossorigin="anonymous"></script>
</head>
@poppycocker
poppycocker / yapcasia2015_tote.js
Created August 21, 2015 15:30
YAPC::Asia 2015 tote bag code on JS
'115.117.112.112.111.114.116.101.100.32.98.121.32.76.105.118.101.115.101.110.115.101.32.73.110.99.46.10'
.split('.')
.map(function(v){
return String.fromCharCode(+v);
})
.join('');
// => "supported by Livesense Inc.¥n"
@poppycocker
poppycocker / radixcnv.js
Created January 8, 2015 08:55
multiple radix converter
(function() {
var def = [];
def[2] = {
label: 'bin',
regex: /^\-{0,1}(0|1)+$/g
};
def[10] = {
label: 'dec',
regex: /^\-{0,1}[0-9]+$/g
};
// Poison Wine
// http://blog.livedoor.jp/kinisoku/archives/4023190.html
(function() {
var WINE_COUNT = 1000;
// Phase0: Preparing
var poisonousWineIdx = Math.floor(Math.random() * (WINE_COUNT + 1));
var slaveNum = Math.floor((Math.log(WINE_COUNT) / Math.log(2)) + 1);
var slaves = [];
var i = 0, j = 0;
@poppycocker
poppycocker / CStdioFile64.hpp
Last active August 29, 2015 13:57
StdioFile64
#include "StdAfx.h"
class CStdioFile64 : public CStdioFile
{
public:
CStdioFile64(LPCTSTR lpszFileName, UINT nOpenFlags) : CStdioFile(lpszFileName, nOpenFlags){}
virtual ~CStdioFile64(){};
ULONGLONG Seek(LONGLONG lOff, UINT nFrom);
ULONGLONG GetLength() const;
ULONGLONG GetPosition() const;
// http://advpro.co.jp/Devlop/?p=530
Number.prototype.toRadian = function() {
return this * Math.PI / 180;
};
Number.prototype.toDeg = function() {
return this * 180 / Math.PI;
};
L.Point.prototype.cross = function(p1, p2) {
var p01 = this.subtract(p1),
@poppycocker
poppycocker / getCodePoint.js
Last active October 5, 2015 07:17
UTF-8 Hex String(of 1character) To Unicode code point value
/*-----------------------------------------------------------------------------------------
[UCS-2 (UCS-4)] [codepoint bit pattern] [1st byte] [2nd byte] [3rd byte] [4th byte]
U+ 0000.. U+007F 00000000-0xxxxxxx 0xxxxxxx
U+ 0080.. U+07FF 00000xxx-xxyyyyyy 110xxxxx 10yyyyyy
U+ 0800.. U+FFFF xxxxyyyy-yyzzzzzz 1110xxxx 10yyyyyy 10zzzzzz
U+10000..U+1FFFFF 00000000-000wwwxx 11110www 10xxxxxx 10yyyyyy 10zzzzzz
-xxxxyyyy-yyzzzzzzz
------------------------------------------------------------------------------------------*/
// e.g.
// [in] 0xC6A9 ('Σ', U+01A9)