Skip to content

Instantly share code, notes, and snippets.

#include <stdio.h>
#include <limits.h>
int main()
{
long i1 = -1;
long i2 = LONG_MIN; // -9223372036854775808
unsigned long u = ULONG_MAX; // 18446744073709551615
printf("%ld\n", i1>>1); // 最上位ビット維持、算術シフト (-1)
<?php
abstract class Foo {
abstract public function func(int $y);
}
class Bar extends Foo {
public function func(int $y) {
return 1;
}
package main
import (
"log"
"time"
)
func main() {
log.Fatalf("Now() = %s", time.Now())
// -----------------------------------------------------------------------------
// To build softfloat enabled go binary, apply this patch to go1.8.3 source tree.
//
// $ patch -p1 <this file>
//
// And then, build like below.
//
// $ cd src
// $ GOROOT_BOOTSTRAP=<your_GOROOT> GOOS=linux GOARCH=misp GOMIPS=softfloat ./make.bash
//
<?php
$sleep_time = 0;
$loop = 1000;
if (preg_match('/^(\d+)s$/', $argv[1])) {
$sleep_time = (int)$argv[1];
}
$usleep_time = (isset($argv[1]) && $argv[1] > 0) ? (int)$argv[1] : 1000;
if ($sleep_time > 0) {
printf("sleep%d\n", $sleep_time);
APCu
APM
Bitset
Druid
Mosquitto
PDO_IBM
PDO_INFORMIX
PDO_SQLANYWHERE
SeasLog
Weakref
#!/usr/bin/env php
<?php
/*
+----------------------------------------------------------------------+
| PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2017 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
<?php
$manufacture = "敇瑭步挮浯䩟";
echo mb_convert_encoding($manufacture, "UTF-16LE", "UTF-8");
<?php
$array_size =isset($_SERVER['argv'][1]) ? $_SERVER['argv'][1] : 1024;
$access_loop = isset($_SERVER['argv'][2]) ? $_SERVER['argv'][2] : 16;
$usleep_time = 200000; // 200ms
$loop_for_accuracy = ($array_size >= 1024) ? 1 : (1024 / $array_size);
// 事前準備
for ($j = 0; $j < $loop_for_accuracy; $j++) {
for ($i = 0; $i < $array_size; $i++) {
#!/bin/bash
# Channel hopping shell script
# GPLv2
# Portions of code graciously taken from Bill Stearns defragfile
# http://www.stearns.org/defragfile/
#
# jwright@hasborg.com
# Defaults
BANDS="IEEE80211B"