Skip to content

Instantly share code, notes, and snippets.

View ya-s-u's full-sized avatar
🍺
Drinking

Yasuaki Goto ya-s-u

🍺
Drinking
View GitHub Profile
@yutori
yutori / redis_cluster.md
Last active April 20, 2019 23:17
Redis Cluster のリシャーディングとorphaned masterの話 - CyberAgent エンジニア Advent Calendar 2014 2日目

Redis Cluster のリシャーディングとorphaned masterの話

(2019/04 追記 こちらの情報は非常に古く、またRC版での結果となります。記録として残していますが参考になさらないでください

CyberAgent エンジニア Advent Calendar 2014 2日目です。

昨日に引き続き、秋葉原ラボの柿島が担当します。仕事ではHadoopクラスタの運用を中心に、秋葉原ラボのインフラ/ミドルウェアまわりを担当しています。今年はHadoop、mesos、Aerospikeと分散型のシステムを触る機会が多い1年でした。

この記事のテーマはRedis Clusterです。Redis Clusterが使えるようになるRedis 3.0.0は10月にRC1がリリースされました。2015年のQ1にstableリリースを目指しているようです。

@Akiyah
Akiyah / jibanyan_equation
Created November 12, 2014 00:28
jibanyan_equation
jibanyan_equation <- function(x,y) {
min(max(min(1-(x/108)^2-(y/94)^2,y),min(1-((abs(x)-119)/103)^2-((y-56)/86)^2,1-((abs(x)-15)/77)^2-((y-119)/100)^2),1-((abs(x)-42)/66)^2-(y/55)^2,min(55+y,51-abs(x),-y)),3*abs(y-100)-2*(x-75)) *
min(min(max(min(1-(x/106)^2-(y/92)^2,y),min(1-((abs(x)-119)/101)^2-((y-56)/84)^2,((abs(x)-99)/40)^2+((y-54)/86)^2-1,92-abs(x)),1-((abs(x)-42)/64)^2-(y/53)^2),min(((abs(x)-52)/26)^2+((y+28)/26)^2-1,((abs(x)-51)/13)^2+(y/13)^2-1,max(abs(x)-51,y))),abs(x/51+10/51*sin(abs(y/61.2)^(1.2)*pi*(7/2)))^(2/3)+abs(y/61.2)^(2/3)-1) *
min(1-(x/32)^2-((y+30)/32)^2,1-((abs(x)+5)/22)^2-((y-18)/22)^2) *
min(1-((abs(x)-18)/20)^2-((y+10)/20)^2,((abs(x)-20)/22)^2+((y+7)/20)^2-1) *
(1-((abs(x)-51)/11)^2-(y/11)^2)
}
x <- seq(-150, 150, length=400)
z <- outer(x,x, Vectorize(jibanyan_equation))
@companje
companje / globe.cpp
Created September 24, 2014 13:31
getting Longitude/Latitude when clicking on a rotated sphere
#include "ofMain.h"
class ofApp : public ofBaseApp {
public:
ofImage earth;
ofQuaternion qTo;
float angle;
ofVec3f axis;
ofPoint green;
@MichaelSnowden
MichaelSnowden / MemeLabel.swift
Created September 15, 2014 02:41
A simple UILabel subclass in Swift that will display white text with a black border
import UIKit
class MemeLabel : UILabel {
override func drawTextInRect(rect: CGRect) {
let shadowOffset = self.shadowOffset
let c = UIGraphicsGetCurrentContext()
CGContextSetLineWidth(c, 3)
CGContextSetLineJoin(c, kCGLineJoinRound)
@tado
tado / physics.swift
Created August 27, 2014 22:53
Swift + Playground physics
import SpriteKit
import XCPlayground
let width:CGFloat = 400
let height:CGFloat = 400
let canvasWidth: UInt32 = UInt32(width)
let canvasHeight: UInt32 = UInt32(height)
let view:SKView = SKView(frame:CGRectMake(0, 0, width, height))
let scene:SKScene = SKScene(size:CGSizeMake(width, height))
@takashi
takashi / tips.md
Last active August 29, 2015 14:05
for my c++ programming study with oF

c++ tips

debugはcoutで

int hoge = 100
cout << hoge << endl;  // 100

#pragma once

@kozyty
kozyty / OrderedBehavior
Created August 18, 2014 07:01
This behavior lets you order items in a very similar way to the tree behavior.
<?php
/**
* OrderedBehavior 2.2.2
*
*
* This behavior lets you order items in a very similar way to the tree
* behavior, only there is only 1 level. You can however have many
* independent lists in one table. Usually you use a foreign key to
* set / see what list you are in (see example bellow) or if you have
* just one list for the entire table, you can do that too.
@gakuzzzz
gakuzzzz / gist:8d497609012863b3ea50
Last active January 12, 2021 12:50
Scalaz勉強会 主要な型クラスの紹介
@hironomiu
hironomiu / gist:4f23da6be771be5b5afa
Last active August 29, 2015 14:02
ネクストキーロックの検証

ネクストキーロックの検証

準備

テーブルの作成

create table test_next_key_lock (
id int(8) not null AUTO_INCREMENT,
col1 char(1) not null,
col2 int(8),
rec_date datetime,
PRIMARY KEY (id),