本文。[1]
次の文。[2]
<?php | |
$enc = "cp932"; | |
for ($cp = 0; $cp < 0x100; $cp++) { | |
$c = chr($cp); | |
$ret = mb_convert_encoding($c, $enc, $enc); | |
echo | |
bin2hex($c), " ", |
def chr_unsafe(cp, enc) | |
[cp.to_s(16)].pack("H*").force_encoding(enc) | |
end | |
enc = 'cp932' | |
count = 0 | |
count2 = 0 | |
(0x8000..0xffff).each do |cp| | |
begin |
<?php | |
function utf8_ord($char) { | |
$x = ord($char[0]); | |
if ($x < 0x80) { | |
return $x; | |
} else if ($x < 0xE0) { | |
$y = ord($char[1]); |
<?php | |
$a = chr(0xfa).chr(0x4a); | |
var_dump( | |
"fa4a" === bin2hex($a), | |
"8754" === bin2hex(mb_strtolower($a, "CP932")), | |
"8754" === bin2hex(mb_strtoupper($a, "CP932")) | |
); |
<?php | |
$a = chr(0xfa).chr(0x4a); | |
var_dump( | |
"fa4a" === bin2hex($a) | |
); | |
$a = mb_convert_encoding($a, "UTF-8", "CP932"); | |
$a = mb_convert_encoding($a, "CP932", "UTF-8"); |
// http://stackoverflow.com/a/14947838/531320 | |
const fromId = document.getElementById.bind(document); | |
const snabbdom = require('snabbdom'); | |
const patch = snabbdom.init([ | |
require('snabbdom/modules/class'), | |
require('snabbdom/modules/props'), | |
require('snabbdom/modules/style'), | |
require('snabbdom/modules/eventlisteners'), | |
]); |
The purpose of this proposal is to provide a set of common interfaces for HTTP messages as described in RFC 7230 and RFC 7231, and URIs as described in RFC 3986 (in the context of HTTP messages).
<?php | |
function timer(callable $block) { | |
$start = microtime(true); | |
for ($i = 0; $i < 100000; ++$i) { | |
$block(); | |
} | |
$end = microtime(true); | |
return $end - $start; | |
} |
<?php | |
function timer(callable $block) { | |
$start = microtime(true); | |
for ($i = 0; $i < 100000; ++$i) { | |
$block(); | |
} | |
$end = microtime(true); | |
return $end - $start; | |
} |