Skip to content

Instantly share code, notes, and snippets.

View karupanerura's full-sized avatar
👷‍♂️
Please assign issue to me. but, I may be slow to respond.

karupanerura karupanerura

👷‍♂️
Please assign issue to me. but, I may be slow to respond.
View GitHub Profile
@karupanerura
karupanerura / libhsclient.rb
Last active September 27, 2016 07:25
un-official homebrew formula for libhsclient (Handler Socket Client library)
class Libhsclient < Formula
desc "HandlerSocket Client library"
homepage "https://github.com/DeNA/HandlerSocket-Plugin-for-MySQL"
url "https://github.com/DeNA/HandlerSocket-Plugin-for-MySQL/archive/1.1.2.tar.gz"
sha256 "79aafb1e46307d1b5c14d9c91aad1c39ac626432b6adcc2636a03f6a4ccce5fd"
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "libtool" => :build
@karupanerura
karupanerura / aaa.pl
Last active July 19, 2016 07:35 — forked from mattn/aaa.pl
use strict;
use warnings;
use Encode;
use Encode::Locale;
use LWP::Protocol;
use URI;
sub dump_env { join ", ", map { "$_: ".($ENV{$_}||'(undef)') } qw/REQUEST_METHOD HTTP_PROXY CGI_HTTP_PROXY/ }
package main;
use Scope::UndefSafe;
sub it() { $_ }
package Let::it;
sub be { __PACKAGE__ }
package main;
my $let = my $it = my $be = \&Let'it::be;
let { it->be } Let'it::be()->$let->$it->$be;
#include <stdio.h>
#include <dlfcn.h>
#include <sys/types.h>
int main(void) {
void *handle = dlopen("/usr/lib/libc.dylib", RTLD_LAZY);
unsigned int (*mysleep)(unsigned int) = dlsym(handle, "sleep");
int (*myfork)(void) = dlsym(handle, "fork");
void (*mywait)(int*) = dlsym(handle, "wait");
pid_t (*mygetpid)(void) = dlsym(handle, "getpid");
@karupanerura
karupanerura / module-versions.txt
Created August 29, 2015 06:13
YAPC::EU benchmark environment
Time::Strptime: 0.01_1
Time::Moment: 0.24
POSIX::strptime: 0.10
Time::Piece: 1.30
DateTime: 1.20
DateTime::TimeZone: 1.92
DateTime::Locale: 0.46
@karupanerura
karupanerura / README.md
Last active August 29, 2015 14:27
GeoHexのテストケースの変更依頼

発生した問題

C99実装の浮動小数点演算の演算精度をチューニングした結果、一部のテストケースがFAILするようになった。

問題になるテストケース

  • 緯度:0
  • 経度:-60.46875

該当ファイル:

@karupanerura
karupanerura / 01_ddl.sql
Last active August 29, 2015 14:26
Using filesortが付くのが納得いかない…。
CREATE TABLE `foo` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`created_at` datetime NOT NULL,
PRIMARY KEY (`id`,`created_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8
PARTITION BY RANGE COLUMNS(created_at) (
PARTITION p201505 VALUES LESS THAN ('2015-06-01') COMMENT = '2015-06-01' ENGINE = InnoDB,
PARTITION p201506 VALUES LESS THAN ('2015-07-01') COMMENT = '2015-07-01' ENGINE = InnoDB,
PARTITION p201507 VALUES LESS THAN ('2015-08-01') COMMENT = '2015-08-01' ENGINE = InnoDB,
PARTITION p201508 VALUES LESS THAN ('2015-09-01') ENGINE = InnoDB
@karupanerura
karupanerura / talk-abstract.md
Created July 17, 2015 02:00
YAPC::EU 2015 - Optimize Perl5 code for performance freaks.

No reason. We just need code that makes processing faster! Yes! We are performance freak.

In this talk, I'll talk about tips of how to write code in perl that makes processing faster.

Topics:

  • XS vs PP implementation
    • Example: DateTime vs Time::Piece vs Time::Moment
  • Example: Time::Strptime
@karupanerura
karupanerura / client.c
Last active January 14, 2019 23:47
UDP echo server sample.
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <netinet/in.h>
#include <arpa/inet.h>
struct udp_socket {
@karupanerura
karupanerura / MainActivity.java
Created April 30, 2015 08:59 — forked from yanzm/マッチョじゃないActivity
マッチョじゃないActivityサンプル
package net.yanzm.profileapplication;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.app.Activity;
import android.app.FragmentManager;
import android.content.Intent;
import android.net.Uri;