Skip to content

Instantly share code, notes, and snippets.

View qnighy's full-sized avatar

Masaki Hara qnighy

View GitHub Profile
#include <stdio.h>
int main(void)
{
int x = 10;
if(x > 5) {
puts("x is greater than 5.");
} else {
puts("x is not greater than 5.");
}
#include <stdio.h>
int main(int argc, char *argv[], char *envp[])
{(
**/**/**/**/**/**/**/**/**/**/**/**/**/**/**/**/**/**/**/**/**/**/**/**/
*/**/**/**/**/**/**/**/**/**/**/**/**/**/**/**/**/**/**/**/**/**/**/**/*
/**/**/**/**/**/**/**/**/**/**/**/**/**/**/**/**/**/**/**/**/**/**/**/**
**/**/**/**/**/**/**/**/**/**/**/**/**/**/**/**/**/**/**/**/**/**/**/**/
*/**/**/**/**/**/**/**/**/**/**/**/**/**/**/**/**/**/**/**/**/**/**/**/*
/**/**/**/**/**/**/**/**/**/**/**/**/**/**/**/**/**/**/**/**/**/**/**/**
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <sys/time.h>
#include <unistd.h>
#include <err.h>
#include <errno.h>
static struct timeval starttime, endtime;
static int started = 0;
/*
* This source code is a template code to make a simple GUI program like a game with JFC/Swing.
*/
import java.awt.*;
import java.awt.geom.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
package org.acikelabo;
import java.lang.reflect.Array;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
public class RubyInspect {
private static HashMap<Class<?>, InspectMethod> inspectMethods;
static {
#::::zsh setting file::::
#I think it would not work well in zsh version 4.3.2
# ::set key bind
bindkey -v
# ::prompt setting
PROMPT='%B%F{blue}%n@%m:%b%f%~
%(?.%f.%S%F{red})%#%f%s '
#!/usr/bin/ruby -Ku
# -*- coding: utf-8 -*-
$><<$<.read.gsub(/[^※…「」、。!?ー〜一-鿿㐀-䷿𠀀-𪛿]/,"")
/**
* dvector.h
*
* #include "dvector.h"
*
* then std::vector::operator[] seems to become checking the range of index.
*
* If you aren't using default allocator, I think it may not work.
*
*/
public class Fib {
public static void main(String[] args) {
long[] js = new long[] {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,50,100,300,1000,10000,1000000,10000000L};
for(long j : js) {
long st = System.nanoTime();
String result = fib(j);
long tm = System.nanoTime() - st;
System.out.println("fib("+j+") == "+result+";time="+tm/1000000000+"s+"+(tm/1000000)%1000+"ms");
System.gc();
}
#hypersl for zsh
#usage:
#. hypersl.sh
function sl {
PROMPT='$'
PROMPT2=''
PROMPT3=''
PROMPT4=''
RPROMPT=''