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 <boost/tokenizer.hpp> | |
int main() { | |
// トークンのセパレータ | |
typedef boost::char_separator<char> char_sep; | |
// トークン処理器 | |
typedef boost::tokenizer<char_sep> char_tok; | |
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 <boost/scoped_ptr.hpp> | |
#include <boost/scoped_array.hpp> | |
int square( int* x ){ | |
int y = *x; | |
return y*y; | |
} | |
int main() { |
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
<div style="margin: 0 auto;"> | |
<div style="float: left;"> | |
</div> | |
<div style="float: left;"> | |
</div> | |
<div style="clear: both;"> | |
</div> | |
</div> |
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 <gtest/gtest.h> | |
class CustomEnvironment : | |
public ::testing::Environment | |
{ | |
public: | |
virtual ~CustomEnvironment() {} | |
// 環境の初期化方法を定義するには,これをオーバーライドしてください. | |
virtual void SetUp() { | |
} |
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 <gtest/gtest.h> | |
// シンプルなテスト | |
TEST(TestCategory, TestName){ | |
// 真偽値判定 | |
ASSERT_TRUE(true); | |
ASSERT_FALSE(false); | |
EXPECT_TRUE(true); | |
EXPECT_FALSE(false); |
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
○前準備 | |
各ホストでOracle NoSQL Databaseのzipを解凍する | |
以下はkv-x.y.zディレクトリ(解凍後のディレクトリ)で実行する | |
○host1で実行 | |
java -jar lib/kvstore.jar makebootconfig -root KVROOT -port 5000 -admin 5001 -host host1 -harange 5010,5020 | |
nohup java -jar lib/kvstore.jar start -root KVROOT & | |
○host2で実行 | |
java -jar lib/kvstore.jar makebootconfig -root KVROOT -port 5000 -host host2 -harange 5010,5020 | |
nohup java -jar lib/kvstore.jar start -root KVROOT & |
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
@echo off | |
rem コメント | |
rem 環境変数の設定 | |
set HOGE="" | |
rem このバッチが存在するフォルダをカレントに | |
pushd %0\.. | |
cls |
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
class Integer | |
def combination(k) | |
self.factorial/(k.factorial*(self-k).factorial) | |
end | |
def permutation(k) | |
self.factorial/(self-k).factorial | |
end | |
def factorial |
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
#!/bin/sh | |
NAME=SAMPLE | |
for f in `ls *.h` | |
do | |
TOP=`grep -n "#include" $f | cut -f 1 -d : | tail -n 1` | |
TOP=`expr $TOP + 1` | |
sed -e "$TOP inamespace $NAME \{" -i.bak $f | |
BOTTOM=`grep -n "#endif" $f | cut -f 1 -d : | tail -n 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
# URLにアクセスするためのライブラリの読み込み | |
require 'open-uri' | |
# Nokogiriライブラリの読み込み | |
require 'nokogiri' | |
def open_url_html(url) | |
charset = nil | |
html = open(url) do |f| | |
charset = f.charset # 文字種別を取得 |
OlderNewer