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 <vector> | |
#include <boost/range.hpp> | |
using namespace std; | |
namespace RangeAdapter { | |
namespace Detail { | |
template<class Range> | |
struct RandomSampledRange; | |
// Range |
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
#pragma once | |
#include <boost/noncopyable.hpp> | |
namespace { | |
/// 一時的にロックを解除するためのクラス | |
template<class Mutex> | |
class unlock_guard : private boost::noncopyable { | |
Mutex& m; | |
public: | |
typedef Mutex mutex_type; | |
/// unlock() |
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
; Function compile flags: /Ogtpy | |
; File c:\data\test\statictest.cpp | |
; COMDAT ?StaticTest@@YAHXZ | |
_TEXT SEGMENT | |
?StaticTest@@YAHXZ PROC ; StaticTest, COMDAT | |
; 6 : static int s = std::rand(); | |
mov eax, DWORD PTR ?$S1@?1??StaticTest@@YAHXZ@4IA | |
test al, 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
""" | |
アンサンブルのお試しコード | |
""" | |
import numpy as np | |
import sklearn.base | |
import sklearn.ensemble | |
import sklearn.metrics | |
import sklearn.model_selection | |
import sklearn.linear_model |
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
import importlib.machinery | |
import sys | |
class CustomFinder(importlib.machinery.PathFinder): | |
def find_spec(self, fullname, path=None, target=None): | |
if fullname == 'tensorflow.python.client.session': | |
spec = super().find_spec(fullname, path, target) | |
loader = CustomLoader(fullname, spec.origin) |
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
import matplotlib | |
import matplotlib.pyplot as plt | |
import numpy as np | |
for i, iou in enumerate(np.linspace(1, 0, 11)): | |
# ↓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
/* | |
log4netのLockingModel。<lockingModel type="Diagnostics.Log4netLazyMinimalLock" /> とか。 | |
特徴はこんな感じ。 | |
- 別スレッドで遅延書き込み | |
- ファイルへの排他はMinimalLockと同じように書き込む時のみ | |
- Mutexによる排他も行うので複数プロセスから同じファイルに書き込めるかも? | |
- エラー時はリトライ | |
- 空ファイルを作成しない | |
- UTF-8のBOMだけの書き込みを行わない |