This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <memory> | |
class Hoge | |
{ | |
public: | |
static Hoge& GetInstance(); | |
void Hey() | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <functional> | |
#include <tuple> | |
std::tuple<unsigned long, unsigned long> fib2( unsigned long n ) | |
{ | |
if ( n == 0 ) | |
{ | |
return std::tuple<unsigned long, unsigned long>( 0, 1 ); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import "js/web.jsx"; | |
import "timer.jsx"; | |
class _Main | |
{ | |
static function main() : void | |
{ | |
var renderer = new WebGLRenderer( dom.window.document.getElementById("webgl-canvas") as HTMLCanvasElement ); | |
Timer.setInterval( function():void{ renderer.render(); }, 30 ); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import "js/web.jsx"; | |
import "js.jsx"; | |
class _Main | |
{ | |
static function getRequestAnimationFrame() : function( tick : function(:number) : void ) : void | |
{ | |
if ( js.global["requestAnimationFrame"] != undefined ) | |
{ | |
return function( tick : function(:number) : void ) : void |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <boost/algorithm/string.hpp> | |
// Boost1.49.0 | |
#include <boost/filesystem.hpp> | |
int main() | |
{ | |
boost::filesystem::path p( "/hoge/fuga.foo" ); | |
std::cout << p.filename() << std::endl; // EXC_BAD_ACCESS | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <boost/regex.hpp> | |
int main() | |
{ | |
std::string file_path = "/foo/bar/bunny.obj"; | |
std::string type = "unknown"; | |
boost::regex rx_find_extension("([^\\.]+)$"); | |
boost::smatch result; | |
if ( boost::regex_match( file_path, result, rx_find_extension ) ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class C | |
@count = 0; # class variable | |
constructor: (num) -> | |
C.count += 1; | |
@hoge = num; # instance variable | |
console.log( C.count ); # => 0 | |
s = new C(72); | |
console.log( C.count ); # => 1 | |
t = new C(64); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# input txt style | |
# 00 00 14 66 2a ... | |
# | |
input = open("input.hex") | |
output = open("output.bin", "w") | |
while line = input.gets | |
a = line.split.collect{|c| c.hex} | |
output.write a.pack("C*") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func Init(cfg : Kuin@CCfg) | |
do cfg.Title :: "AOBench" | |
do cfg.FullScr :: false | |
do cfg.PadNum :: 1 | |
do cfg.WaitTime :: 60 | |
end func | |
func Main() | |
var ao : AOBench@AOBench | |
do ao :: @new AOBench@AOBench |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/bin/ruby | |
require "rubygems" | |
require "mechanize" | |
require "termcolor" | |
class Mean | |
attr_reader :text | |
def initialize word_class, text | |
@word_class = word_class |