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 <stdio.h> | |
#define binary_to_gray_code(binary) ((binary)^(binary)>>1) | |
int fputb(unsigned int input,unsigned int digit,FILE *output) | |
{ | |
if(digit){ | |
fputb(input>>1,digit-1,output); | |
fputc('0'+(input&1),stdout); |
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 <stdio.h> | |
#include <stdlib.h> | |
static int mergesort_(void *base,const size_t num,const size_t size | |
,int (*compare)(const void *,const void *),int *temp) | |
{ | |
size_t counter_a = 0,counter_b = 0; | |
if(size != 1){ | |
mergesort_(array,size>>1,temp); |
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 <cstdlib> | |
#include <ctime> | |
#include <iostream> | |
#include <list> | |
#include <vector> | |
template <typename Type> | |
static int quicksort_compare(Type a,Type b) | |
{ |
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 <stdio.h> | |
#include <stddef.h> | |
#define GENERATE_SORTING_FUNCTION(function_name,data_type) \ | |
void function_name(data_type *base \ | |
,const size_t size,int (*compare)(const data_type,const data_type)) \ | |
{ \ | |
size_t pivot_pos = 0,first2last = 0,last2first = size-1; \ | |
data_type temp,pivot; \ |
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
/* | |
urn:isbn: なリンクを Amazon.co.jp へのリンクに変換するスクリプト | |
*/ | |
document.addEventListener('DOMContentLoaded',isbn2amazon,false); | |
function isbn2amazon() | |
{ | |
var links = document.getElementsByTagName('a'); |
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
/* | |
quicksort - C | |
*/ | |
#include <alloca.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <time.h> |
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
{- | |
sample | |
*Main> interactiveParser | |
a b c | |
d | |
e | |
f g | |
h |
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 Data.List | |
data RationalNum = RationalNum Int Int | |
data Expr = NumExpr Int | |
| OpExpr String Expr Expr | |
instance Show Expr where | |
show (NumExpr a) = show a |
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
%!PS-Adobe-2.0 EPSF-2.0 | |
/nextpos { | |
3 index 2 index add 2 div | |
3 index 2 index sub 12 sqrt div sub | |
4 index 3 index sub 12 sqrt div | |
4 index 3 index add 2 div add | |
mark 7 3 roll cleartomark | |
} def |
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
%!PS-Adobe-3.0 | |
%%BoundingBox: 0 0 595.28 841.89 | |
gsave | |
/xsize 3 def | |
/ysize 6 def | |
/ruledLine { | |
/ysize exch def |
OlderNewer