This file contains 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 <string> | |
#include <stdexcept> | |
using namespace std; | |
template <typename T> | |
struct Node | |
{ | |
T value_; |
This file contains 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/bin/perl | |
binmode(STDOUT, ":utf8"); # utf-8でCSVファイルを作っているための対策 | |
use DBI; | |
$dbh = DBI->connect("dbi:CSV:", undef, undef, { | |
f_ext => ".csv/r", | |
RaiseError => 1, | |
}) or die "Cannot connect: $DBI::errstr"; | |
my $sth = $dbh->prepare("select * from english_name"); | |
$sth->execute; | |
$sth->bind_columns(\my ($eng_name, $eng_nick_name, $sex, $jpn_name)); |
This file contains 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
/** | |
* reference | |
* http://f4.aaacafe.ne.jp/~pointc/log1227.html | |
* ・一行の中のデータは ,(カンマ)で区切る。行の終りは改行。 | |
* ・データがカンマやダブルクォートを含む場合は "(ダブルクォート)で囲む。 | |
* ・データの中のダブルクォートはそれをダブルクォート2個("")で置き換える。 | |
*/ | |
#include <stdio.h> | |
char *setvalue(char *p, char *field, int size) |
This file contains 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 <sstream> | |
#include <string> | |
#include <climits> | |
using namespace std; | |
template <typename T> | |
string numToString(const T &num) | |
{ |
This file contains 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 <sstream> | |
#include <fstream> | |
#include <string> | |
#include <climits> | |
using namespace std; | |
template <typename T> |
This file contains 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> | |
/* * * * * * * * * * * * * | |
* 片方向リスト | |
* * * * * * * * * * * * */ | |
typedef struct _int_list { | |
int iv; | |
struct _int_list* next; | |
} int_list; |
This file contains 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 <ctime> | |
#include <cstdio> | |
#include "MergeSort.h" | |
static const int DataSize = 100; | |
static void initRand() | |
{ | |
srand((unsigned int)time(NULL)); |
This file contains 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/bin/python | |
# coding: utf-8 | |
from random import * | |
from math import * | |
# アークコサイン 定義 => y = cos**(-1)x |x| <=1, |y| <= pi / 2 | |
# よくわかんなけど、 | |
# アークコサインの角度(ラジアン)が-1のときは | |
# 円周率らしいので、比較用にそれなりの正確な近似値を出しておく | |
math_pi = acos( -1 ) |
This file contains 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
# this script requires some packages | |
ARCH='x86_64' # default | |
if [ $(arch) = 'x86_64' ] ; then | |
ARCH='x86_64' | |
else | |
ARCH='x86' | |
fi | |
echo "Architecture: $ARCH" |
This file contains 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
#ifdef _WIN32 /* if defined _WIN32 */ | |
#define _CRT_SECURE_NO_WARNINGS | |
#include <windows.h> | |
#else /* if linux */ | |
#include <dirent.h> | |
#include <sys/types.h> | |
#include <sys/stat.h> | |
#endif | |
#include <cstdio> | |
#include <cstdlib> |