Skip to content

Instantly share code, notes, and snippets.

@neguse
neguse / LICENSE
Last active August 29, 2015 13:56
GYP( https://code.google.com/p/gyp/ )にglobでのパターンマッチを入れてみた。未テスト。
Copyright (c) 2009 Google Inc. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following disclaimer
@neguse
neguse / h.pl
Last active August 29, 2015 14:00
動かない原因がわからない
use h1;
use h2;
use Data::Dumper;
print "h1::\n" . Dumper \%h1::;
print "h2::\n" . Dumper \%h2::;
h1sub1;
h2sub1;
@neguse
neguse / json.go
Last active August 29, 2015 14:05
composite literal( https://golang.org/ref/spec#Composite_literals ) で入れ子になっているanonymous structをリテラルとして書きたかった
package main
import (
"encoding/json"
"fmt"
)
type Struct struct {
Inner struct {
Value string
@neguse
neguse / segv_go-sdl2.go
Created September 21, 2014 11:58
This code causes segmentation fault on my machine( OS X 10.9.5, go1.3.1 darwin/amd64, sdl2-2.0.3 )
package main
import "github.com/veandco/go-sdl2/sdl"
func main() {
window := sdl.CreateWindow("test", sdl.WINDOWPOS_UNDEFINED, sdl.WINDOWPOS_UNDEFINED,
800, 600, sdl.WINDOW_SHOWN)
surface := window.GetSurface()
rect := sdl.Rect{0, 0, 200, 200}
@neguse
neguse / math_utils.go
Created November 5, 2014 14:05
VectorとMatrixを実装する時に値渡しと参照渡しとでどのぐらい差が出るか調べてみた
package box2dlite
type Vec2 struct {
X, Y float32
}
func V2Add_Copy(v1 Vec2, v2 Vec2) Vec2 {
return Vec2{v1.X + v2.X, v1.Y + v2.Y}
}

ISUCONとは

「Iikanjini Speed Up Contest」

優勝賞金100万円!今年もやります ISUCON5 開催と日程のお知らせ #isucon

お題となるWebサービスを決められたレギュレーションの中で限界まで高速化を図るチューニングバトル、それがISUCONです。過去の実績も所属している会社も全く関係ない、結果が全てのガチンコバトルです。

俺の考えるISUCON - たごもりすメモ

ある日の朝、Webアプリケーションが一式、適当に設定されたサーバごと渡されます。あとベンチマークツールも渡されます。

#!/usr/bin/env perl
use strict;
use warnings;
use utf8;
use enum qw(Normal Fight Flying Poison Ground Rock Bug Ghost Steel Fire Water Grass Electr Psychc Ice Dragon Dark Fairy Max);
use enum qw(S D H N); # Single, Double, Half, Nothing
my $type_chart = [
@neguse
neguse / gist:7714835
Created November 30, 2013 02:57
Nifty Cloudのsmall2でCentOS 6.4のインスタンスたててUnixBenchまわしてみました。
========================================================================
BYTE UNIX Benchmarks (Version 5.1.3)
System: localhost.localdomain: GNU/Linux
OS: GNU/Linux -- 2.6.32-358.el6.x86_64 -- #1 SMP Fri Feb 22 00:31:26 UTC 2013
Machine: x86_64 (x86_64)
Language: en_US.utf8 (charmap="UTF-8", collate="UTF-8")
CPU 0: Intel(R) Xeon(R) CPU E5-2690 0 @ 2.90GHz (5800.0 bogomips)
x86-64, MMX, Physical Address Ext, SYSENTER/SYSEXIT, SYSCALL/SYSRET
11:25:00 up 8 min, 1 user, load average: 0.03, 0.08, 0.02; runlevel 3
@neguse
neguse / note_pc_with_english_keyboard_in_2015.md
Created August 30, 2015 17:57
2015年に日本で英語配列キーボードを備えたノートパソコンを買いたい

2015年に日本で英語配列キーボードを備えたノートパソコンを買いたい

背景

  • ノートパソコンあると便利
    • 外でプログラム書いたり、勉強会のメモとったり、ネットみたりに使う
    • プログラム書くにはiOSとかAndroidはきついので、フル機能のOSが動いてほしい
  • 買うとしたら手頃な価格で買いたい
@neguse
neguse / config.py
Created February 12, 2018 10:42
Keyhacの設定
# coding: utf-8
# てすと
import sys
import os
import datetime
import pyauto
from keyhac import *