Skip to content

Instantly share code, notes, and snippets.

View chooblarin's full-sized avatar

Sota Hatakeyama chooblarin

View GitHub Profile
defmodule Prac1 do
def fib(0) do 0 end
def fib(1) do 1 end
def fib(n) do fib(n-1) + fib(n-2) end
def qsort([]) do [] end
def qsort([h|tail]) do
{left, right} = Enum.partition(tail, &(&1 < h))
qsort(left) ++ [h] ++ qsort(right)
end

Elixir勉強会(社内向け)Aug 19 2015

前回までのあらすじ

  • Elixirがどこかで流行っているプログラミング言語だということがわかった
  • 動的型付けの関数型言語だった
  • Elixirの文法の雰囲気がちょっとわかった
  • 色々なことがほんのりとわかった気になれた
  • OTP
@chooblarin
chooblarin / strictmode.java
Created June 14, 2015 10:34
Android Strict Mode
if (BuildConfig.DEBUG) {
StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder()
.detectAll()
.penaltyLog()
.build());
StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder()
.detectAll()
.penaltyLog()
.build());
}
public class CircleGraphView extends View {
static class Data {
int value;
int color;
Data(int value, int color) {
this.value = value;
this.color = color;
}
@chooblarin
chooblarin / calculate.js
Last active July 17, 2022 03:53
四則演算器 (JavaScript ver.)
/*
四則演算器プログラムです.
ex.) caluculate('1+2*3'); // => 7
caluculate('(1+2)*3') // => 9
* 有理数は未実装
*/
// 演算子たち