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/env python | |
# -*- coding:utf-8 -*- | |
import argparse | |
import requests | |
from bs4 import BeautifulSoup | |
if __name__ == '__main__': | |
# 引数解析 | |
parser = argparse.ArgumentParser() |
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
# | |
# -*- coding: utf-8 -*- | |
import unittest | |
import mock | |
import contextlib as ctxlib | |
class TestPySample(unittest.TestCase): | |
def test_single_mock_test(self): |
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
#! | |
# -*- coding: utf-8 -*- | |
import unittest | |
import numpy as np | |
import numpy.testing as npt | |
import pandas as pd | |
import pandas.util.testing as pdt |
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 # 文字種別を取得 |
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
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
@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
○前準備 | |
各ホストで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
#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
#include <gtest/gtest.h> | |
class CustomEnvironment : | |
public ::testing::Environment | |
{ | |
public: | |
virtual ~CustomEnvironment() {} | |
// 環境の初期化方法を定義するには,これをオーバーライドしてください. | |
virtual void SetUp() { | |
} |
NewerOlder