Skip to content

Instantly share code, notes, and snippets.

View funatsufumiya's full-sized avatar

Fumiya Funatsu funatsufumiya

View GitHub Profile
@funatsufumiya
funatsufumiya / Demo.java
Last active August 29, 2015 14:02
Java vs Scala vs Clojure
import java.util.Map;
import java.util.HashMap;
public class Demo {
public static void main(String[] args) {
String years[] = {
"2009-11", "2009-01",
"2010-01", "2010-12",
"2010-01", "2010-04",
"2010-01", "2010-12",
@funatsufumiya
funatsufumiya / Result.txt
Created June 10, 2014 09:13
Draw Triangles on REPL
o
oo
ooo
oooo
ooooo
o
oo
ooo
oooo
ooooo
@funatsufumiya
funatsufumiya / file0.cpp
Created July 1, 2014 12:09
【C++】ポインターのスコープをチェックする【修正済】 ref: http://qiita.com/atmarksharp/items/db1afac2ba4c64f88e4d
#include <iostream>
#include <string>
#define bold "\e[1;30m"
#define red "\e[0;31m"
#define green "\e[0;32m"
#define cyan "\e[0;36m"
#define reset "\e[0m"
using namespace std;
// Project : VST SDK
// Version : 3.6.0
//
// Category : Examples
// Filename : public.sdk/samples/vst/pitchnames/source/pitchnames.h
// Created by : Steinberg, 12/2010
/* ============ */
/* === 中略 === */
/* ============ */
@funatsufumiya
funatsufumiya / file0.txt
Created July 15, 2014 02:24
Rubyで配列言語(Array Language)を実現する ref: http://qiita.com/atmarksharp/items/bd881b91d1074cc36f0c
-->sqrt(2)
ans = 1.4142136
-->sqrt([1,2,3,4,5])
ans = 1. 1.4142136 1.7320508 2. 2.236068
@funatsufumiya
funatsufumiya / file0.java
Created July 15, 2014 09:04
JavaでOS独自のファイルダイアログを表示する方法 ref: http://qiita.com/atmarksharp/items/f047dccee4c2d8b2c28a
import java.awt.*;
import javax.swing.*;
import java.io.File;
class NativeFileDialog {
public static void print(String s){
System.out.print(s);
}
@funatsufumiya
funatsufumiya / gradient.glsl
Created August 10, 2014 04:45
GLSL Gradient Shader with Processing
uniform float millis;
uniform float width;
uniform float height;
void main()
{
float rx = gl_FragCoord.x / width;
float ry = gl_FragCoord.y / height;
float rate = sin(millis)/2.0 + 0.5;
@funatsufumiya
funatsufumiya / hsv_to_rgb.glsl
Created August 10, 2014 10:58
GLSL convert from HSV(A) to RGB(A)
vec4 hsv_to_rgb(float h, float s, float v, float a)
{
float c = v * s;
h = mod((h * 6.0), 6.0);
float x = c * (1.0 - abs(mod(h, 2.0) - 1.0));
vec4 color;
if (0.0 <= h && h < 1.0) {
color = vec4(c, x, 0.0, a);
} else if (1.0 <= h && h < 2.0) {
@funatsufumiya
funatsufumiya / gif2mp4
Last active August 29, 2015 14:07
gif2mp4
#!/usr/bin/env tcsh -f
set gif = $argv[1]
set loop = $argv[2]
set mp4 = $argv[3]
set framerate = $argv[4]
if($loop < 1) then
echo "loop must >0"
exit
@funatsufumiya
funatsufumiya / linked-list.c
Created January 24, 2015 04:08
LinkedList implemented in C
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define DEBUG
typedef int VALUE;
typedef struct linkedList {
VALUE head;