Skip to content

Instantly share code, notes, and snippets.

@sambaiz
sambaiz / setup.py
Created March 19, 2014 07:54
cocos2d-xのsetup.py fish対応版
#!/usr/bin/python
#coding=utf-8
"""****************************************************************************
Copyright (c) 2014 cocos2d-x.org
http://www.cocos2d-x.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
@sambaiz
sambaiz / button.kt
Last active December 2, 2018 21:57
Kotlin Android
val button: Button = findViewById(R.id.Button02) as Button
button setOnClickListener (object: View.OnClickListener {
public override fun onClick(view: View): Unit {
}
})
import tensorflow as tf
import pandas as pd
import numpy as np
import inspect
from bayes_opt import BayesianOptimization
import shutil
import os
class MNIST_CNN:
def __init__(self, learning_rate, variable_default_stddev, bias_default, keep_prob=1.0):
@sambaiz
sambaiz / rust_fizz_buzz.rs
Last active September 5, 2017 10:53
RustでFizzBuzz
use std::fmt;
fn main() {
println!("Hello, world!");
for i in 1..100 {
println!("{}", fizz_buzz(i))
}
}
enum FBN<'a> {
@sambaiz
sambaiz / file0.txt
Created December 24, 2013 09:19
SpriteKitで横画面の左下を(0,0)にする ref: http://qiita.com/sambaiz/items/681ff4c0db90613b9312
SKSpriteNode *ground = [SKSpriteNode spriteNodeWithColor:[SKColor yellowColor]
size:CGSizeMake(self.frame.size.width, self.frame.size.height*0.2)];
ground.anchorPoint = CGPointMake(0, 0);
ground.position = CGPointMake(CGRectGetMinX(self.frame), 0);
# prefixキーをC-tに変更してC-bを解除
set -g prefix C-t
unbind C-b
# Vimのキーバインドでペインを移動する
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
@sambaiz
sambaiz / hbase.txt
Last active October 9, 2015 07:43
hbase動かすところまでのメモ
http://codezine.jp/article/detail/7128
# hbase起動まで
cd /usr/local
wget http://ftp.kddilabs.jp/infosystems/apache/hbase/stable/hbase-1.1.2-bin.tar.gz
tar -zxvf hbase-1.1.2-bin.tar.gz
cd hbase-1.1.2
echo "export JAVA_HOME=/usr/lib/jvm/jre-openjdk" >> /root/.bashrc
@sambaiz
sambaiz / chapter10.scala
Created September 3, 2015 09:56
Scala関数型デザイン&プログラミング10章
// EXERCISE 10.1
// 整数の加算と乗算、および論理演算子に対するMonoidインスタンスを考え出せ
trait Monoid[A] {
def op(a1: A, a2: A): A
def zero: A
}
val intAddition: Monoid[Int] = new Monoid[Int] {
def op(a1: Int, a2: Int) = a1 + a2
@sambaiz
sambaiz / chapter4.scala
Created July 21, 2015 02:46
Scala関数型デザイン&プログラミング4章
/**
EXERCISE 4.1
trait Option[+A]{
def map[B](f: A => B): Option[B]
def flatMap[B](f: A => Option[B]): Option[B]
def getOrElse[B >: A](default: => B): B
def orElse[B >: A](ob: => Option[B]): Optino[B]
def filter(f: A => Boolean): Option[A]
}
を実装せよ
@sambaiz
sambaiz / chapter3.scala
Created July 9, 2015 09:07
Scala関数型デザイン&プログラミング3章
/**
* EXERCISE 3.1
* 以下のマッチ式はどのような結果になるか
*/
sealed trait List[+A]
case object Nil extends List[Nothing]
case class Cons[+A](head: A, tail: List[A]) extends List[A]
object List{