Skip to content

Instantly share code, notes, and snippets.

View ubnt-intrepid's full-sized avatar
🦀
I may be slow to respond.

Yusuke Sasaki ubnt-intrepid

🦀
I may be slow to respond.
View GitHub Profile
@ubnt-intrepid
ubnt-intrepid / gist:2ffb56e8c183935a9621
Last active August 29, 2015 14:21
フォント設定切り替えサンプル
\input ifpdf.sty
\input ifluatex.sty
\input ifxetex.sty
\ifxetex
% XeTeX:
\typeout{---Using XeTeX---}
\documentclass{bxjsarticle}
\usepackage{xlextra}
\XeTeXlinebreaklocale "ja"
\XeTeXlinebreakskip=0pt plus 1pt
\documentclass{jsarticle}
\declareterm{%
state = \mathbf{x},
input = \mathbf{u},
}
\begin{document}
\begin{equation}
\documentclass{beamer}
\usepackage{lipsum}
\usepackage{tikz}
\usetikzlibrary{calc,shapes,positioning,backgrounds}
\usepackage[absolute,overlay]{textpos}
\setlength{\TPHorizModule}{1mm}
\setlength{\TPVertModule}{\TPHorizModule}
\textblockorigin{0mm}{6mm}
import itertools
import numpy as np
from scipy import linalg
import matplotlib.pyplot as plt
import matplotlib as mpl
from sklearn import mixture
# Number of samples per component
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ubnt-intrepid
ubnt-intrepid / example_chinese_restaurant_process.cpp
Last active August 29, 2015 14:18
implementation of sampler from Chinese Restaurant Process (CRP) in C++11
#include <algorithm>
#include <ctime>
#include <fstream>
#include <iostream>
#include <iterator>
#include <random>
#include <tuple>
#include <utility>
#include <vector>
#include <boost/progress.hpp>
#include <algorithm>
#include <iostream>
#include <iterator>
#include <random>
#include <vector>
using namespace std;
class multinominal_distribution
{
std::vector<double> m_prob;
#pragma once
#include "socketapi.hpp"
namespace network {
using boost::optional;
namespace ph = std::placeholders;
// @brief リスナソケットを生成する
// @param port :: unsigned short ソケットをbindするポート番号
// @retval 作成したソケットのディスクリプタ
#include <iostream>
#include <type_traits>
#include <utility>
#include <boost/optional.hpp>
template <typename T>
std::ostream& operator<<(std::ostream& os, boost::optional<T> const& val)
{
if (val)
return os << val.get();
#include <iostream>
#include <functional>
#include <utility>
#include <type_traits>
using namespace std;
namespace detail {
template <typename MaybeCallable, class... Args>
struct is_callable