Skip to content

Instantly share code, notes, and snippets.

View qnighy's full-sized avatar

Masaki Hara qnighy

View GitHub Profile
View gist:79906
module test030;
import tango.io.Stdout: Stdout;
void main( ){
int value = 100;
if( value == 100 ){
Stdout( "VALUE is 100." )( );
}
if( value != 100 ){
Stdout( "VALUE is not 100." )( );
}
View lcm_cpptmp.cpp
#include <iostream>
using namespace std;
template <int a, int b>
struct gcm
{
static const int value = gcm<b, a%b>::value;
};
template <int a>
View tak_cpptmp.cpp
#include <iostream>
template<int x, int y, int z>
struct tak;
template<int x, int y, int z, bool x_lte_y>
struct _tak
{
static const int value = tak<tak<x-1,y,z>::value,tak<y-1,z,x>::value,tak<z-1,x,y>::value>::value;
};
View Bingoer.java
import java.awt.*;
import java.awt.event.*;
import java.awt.geom.*;
import java.awt.image.*;
import javax.swing.*;
import java.io.*;
import java.util.ArrayList;
public class Bingoer extends JFrame implements ActionListener, KeyListener {
private Timer timer;
@qnighy
qnighy / Makefile
Created April 15, 2009 09:07
Makefile I use
View Makefile
#!/bin/make
CC = gcc
CXX = g++
# 1. use VERY STRICT warning option.
# 2. use NEW STANDARD C/C++ option.
# 3. use BRAND NEW gcc extension.
CFLAGS = \
-O2 -Wall -Wshadow -Wpointer-arith -Wcast-qual -Wwrite-strings \
View rp2p.rb
#!ruby -Ku
require "socket"
require "yaml"
class RP2P
def save_stat
File.open("stat#@port.yml", "w") do|file|
YAML.dump(@stat, file)
View gist:98042
%:include /\
\
*\*\*\*\*\*\*\
konyanyachiwa!
*\*\*\*\*\*\*\
/ <stdio.h>
int ma\
in (a,b)
int a;
View hello.c
#include <stdio.h>
int main(void)
{
puts("Hello, world!");
return 0;
}
View a.c
#include <stdio.h>
int main(int argc, char *argv[], char *envp[])
{
puts("Hello, world!");
return 0;
}
View variables.c
#include <stdio.h>
int main(void) {
int var0;
var0 = 2;
printf("%d\n", var0);
var0 = 4;
printf("%d\n", var0);
var0 = 3 + 5;
printf("%d\n", var0);