Skip to content

Instantly share code, notes, and snippets.

View AtsushiSakai's full-sized avatar
:octocat:

Atsushi Sakai AtsushiSakai

:octocat:
View GitHub Profile
@AtsushiSakai
AtsushiSakai / BayesianFilter1D.m
Last active December 20, 2015 20:29
一次元の変数のガウス分布に基づくベイズ推定のサンプルプログラム
% -------------------------------------------------------------------------
%
% File : BayesianFilter1D.m
%
% Discription : 1 dimentioanl Bayesian Filter Sample Program
%
% Environment : Octave (Matlab)
%
% Author : Atsushi Sakai
%
@AtsushiSakai
AtsushiSakai / MartinGardnerSolver.py
Last active December 21, 2015 01:48
マーティン・ガードナーの最難問を解くPython Script
#coding:utf-8
'''
マーティン・ガードナーの最難問を解くPython Script
解けるかな? 史上最難問10題 : ギズモード・ジャパン http://www.gizmodo.jp/2013/08/_so_you_th.html?utm_source=rss20&utm_medium=rss
ある数の粘度は、すべての桁を掛けて出る答えが1桁になるまでにかかる積算の回数で表す。
それぞれの桁の数を掛け算して出るのが2番目の数で、そのまた全桁の数を掛けて出るのが3番目の数…こうして1桁の数が出るまでやり、
出るまでに重ねた掛け算の回数を数えるのだ。
例えば、77は粘度4だ。なぜなら1桁になるまで4回掛け算しなきゃならないからね(77-49-36-18-8)。
@AtsushiSakai
AtsushiSakai / scipy.interpolate
Created May 30, 2017 05:47
scipy interpolate sample
{
"cells": [
{
"cell_type": "markdown",
"metadata": {
"toc": "true"
},
"source": [
"# Table of Contents\n",
" <p><div class=\"lev1\"><a href=\"#scipy.interpolate-sample\"><span class=\"toc-item-num\">1&nbsp;&nbsp;</span>scipy.interpolate sample</a></div><div class=\"lev2\"><a href=\"#一次元の補間\"><span class=\"toc-item-num\">1.1&nbsp;&nbsp;</span>一次元の補間</a></div><div class=\"lev3\"><a href=\"#線形補間\"><span class=\"toc-item-num\">1.1.1&nbsp;&nbsp;</span>線形補間</a></div><div class=\"lev3\"><a href=\"#最近傍補間\"><span class=\"toc-item-num\">1.1.2&nbsp;&nbsp;</span>最近傍補間</a></div>"
@AtsushiSakai
AtsushiSakai / scipy.interpolate.ipynb
Created May 30, 2017 05:48
scipy interpolate sample
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@AtsushiSakai
AtsushiSakai / numerical_integration_py.ipynb
Last active June 29, 2017 21:56
Numerical Integration Sample
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@AtsushiSakai
AtsushiSakai / TcpLib.hpp
Last active August 9, 2018 17:30
LinuxにおけるTCPソケット通信を利用したプロセス間通信用
/**
@file: TcpLib.hpp
@brief:Linux用TCP通信サーバ用ライブラリ
ユーザが使用するクラス
1.TcpServer サーバ用
2.TcpClient クライアント用
@note TcpMasterクラスは、サーバとクライアントの
共通変数・関数用クラスなので
import Base.Threads.@spawn
using Ipopt
# hs071
# min x1 * x4 * (x1 + x2 + x3) + x3
# st x1 * x2 * x3 * x4 >= 25
# x1^2 + x2^2 + x3^2 + x4^2 = 40
# 1 <= x1, x2, x3, x4 <= 5
# Start at (1,5,5,1)
@AtsushiSakai
AtsushiSakai / random_notion.py
Created March 5, 2022 07:58 — forked from tangjeff0/random_notion.py
get random notion notes to resurface your old ideas!
'''
author:
@tangjeff0
https://www.notion.so/tangjeff0/Public-Home-0e2636bd409b454ea64079ad8213491f
inspired by: https://praxis.fortelabs.co/p-a-r-a-iii-building-an-idea-generator-400347ef3bb6/
with help from: https://medium.com/@jamiealexandre/introducing-notion-py-an-unofficial-python-api-wrapper-for-notion-so-603700f92369
credits:
@jamiealexandre
@AtsushiSakai
AtsushiSakai / ReductionSample.cpp
Created March 23, 2013 11:24
行列演算ライブラリEigenの換算(Reduction)関連(平均,最大値,最小値,各行・列への演算)の関数サンプルプログラム
/*
FileName: ReductionSample.cpp
Discription:行列演算ライブラリEigenの換算関数のサンプル
Author: Atsushi Sakai
Update: 2013/03/23
@AtsushiSakai
AtsushiSakai / eachZip.sh
Created February 15, 2015 01:18
Shell script to zip each directory in the current directory
#!/bin/bash
# zip each directory
find . \! -name '*.zip' \! -name '.' -type d -exec zip -r {}.zip {} \;