Skip to content

Instantly share code, notes, and snippets.

View hajimehoshi's full-sized avatar
:octocat:
ギットハブ

Hajime Hoshi hajimehoshi

:octocat:
ギットハブ
View GitHub Profile
@hajimehoshi
hajimehoshi / index.html
Created February 15, 2015 12:54
Simplest WebGL example
<!DOCTYPE html>
<style>
html, body {
position: relative;
margin: 0;
padding: 0;
width: 100%;
height: 100%;
}
#canvas {
@hajimehoshi
hajimehoshi / test.go
Created June 22, 2015 16:02
OpenGL: Fail on Windows
package main
import (
"fmt"
"log"
"runtime"
"github.com/go-gl/gl/v2.1/gl"
"github.com/go-gl/glfw/v3.1/glfw"
)
@hajimehoshi
hajimehoshi / test.c
Last active August 29, 2015 14:23
OpenGL: Fail on Windows on Paralells
#include <assert.h>
#include <stdio.h>
#include <GL/gl.h>
#include <GL/glext.h>
#include "GLFW/glfw3.h"
PFNGLGENFRAMEBUFFERSEXTPROC glGenFramebuffersEXT;
PFNGLBINDFRAMEBUFFEREXTPROC glBindFramebufferEXT;
PFNGLFRAMEBUFFERTEXTURE2DEXTPROC glFramebufferTexture2DEXT;
@hajimehoshi
hajimehoshi / index.html
Created August 24, 2015 16:42
tsc.js on browser
<!DOCTYPE html>
<script>
'use strict';
var require = (function() {
class FS {
writeSync(fd, buffer, offset, toWrite) {
// TODO: Implement
console.log(buffer.str_);
}
@hajimehoshi
hajimehoshi / gist:63795
Created February 13, 2009 08:26
ゼル伝
;;; ゼルダの伝説 (SFC) で、鍵と扉がそれぞれ n 個のとき、
;;; ダンジョンのとりうる状態数を返す zelda 関数 (仮)
(use srfi-1)
(define (zelda n)
(define (combination n m)
(/ (apply * (iota m (+ (- n m) 1) 1))
(apply * (iota m 1 1))))
(define (sum list)
package main
import (
"fmt"
)
func main() {
a := [...][4]int{
[...]int{1,2,3,4},
[...]int{1,2,3,4},
$ gcc-mp-4.5 -o test -std=c++0x -L/opt/local/lib test.cpp
Undefined symbols:
"operator new(unsigned long)", referenced from:
std::_Function_base::_Base_manager<main::{lambda()#1}>::_M_clone(std::_Any_data&, std::_Function_base::_Base_manager<main::{lambda()#1}> const&, std::integral_constant<bool, false>) in ccBk7Dwv.o
std::_Function_base::_Base_manager<main::{lambda()#1}>::_M_init_functor(std::_Any_data&, {lambda()#1}&&, std::integral_constant<bool, false>) in ccBk7Dwv.o
"std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)", referenced from:
main::{lambda()#1}::operator()() const in ccBk7Dwv.o
"std::ios_base::Init::Init()", referenced from:
__static_initialization_and_destruction_0(int, int) in ccBk7Dwv.o
"operator delete(void*)", referenced from:
#include <iostream>
#include <boost/range.hpp>
class foo {
private:
int values_[10];
public:
typedef decltype(values_) values_type;
foo()
: values_{3, 1, 4, 1, 5, 9, 2, 6, 5, 3} {
#include <algorithm>
#include <iostream>
#include <boost/range.hpp>
template<class Values>
int foo(Values values) {
std::for_each(boost::begin(value), boost::end(values), [](int& value) {
std::cout << value << std::endl;
});
}