Skip to content

Instantly share code, notes, and snippets.

@satomacoto
satomacoto / index.html
Created November 17, 2012 02:38
pf on d3
<html>
<head>
<title>
</title>
<script src="http://d3js.org/d3.v2.js"></script>
<style>
.axis path, .axis line {
fill: none;
stroke: grey;
@satomacoto
satomacoto / pf.py
Created November 15, 2012 14:37
pf
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Particle Filter
"""
import numpy
def f(x, u):
"""Transition model
@satomacoto
satomacoto / lkf.py
Last active August 2, 2016 10:09
lkf
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import numpy as np
import matplotlib.pyplot as plt
def lkf(T, Y, U, mu0, Sigma0, A, B, C, Q, R):
'''Linear Kalman Filter
- 状態方程式
@satomacoto
satomacoto / ekf.py
Created November 3, 2012 16:01
ekf
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import numpy as np
import scipy as sp
from scipy.optimize.slsqp import approx_jacobian
import matplotlib.pyplot as plt
def main():
# 初期化
@satomacoto
satomacoto / app.yaml
Created October 24, 2012 09:48
aozoramakura
application: aozoramakura
version: 1
runtime: python
api_version: 1
handlers:
- url: /post_update
script: app.py
login: admin
@satomacoto
satomacoto / gist_import.html
Last active October 10, 2015 08:28
BloggerでGistのファイルをAPIで取得して表示させる
<h1 id="gist_120907_description" style="font-weight:300;">Loading...</h1>
<iframe id="gist_120907_hello_html" marginwidth="0" marginheight="0" scrolling="no" style="border:solid 1px #ccc; display:inline; margin:0px; position:static; width:400px; height:300px;"></iframe>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script>
<script>
$(document).ready(function() {
var id = '3347397';
var filename = 'hello.html';
$.ajax({
type: 'GET',
@satomacoto
satomacoto / nx_karate.py
Created September 6, 2012 06:03
NetworkX
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import networkx as nx
import numpy as np
import matplotlib.pyplot as plt
# Zachary's Karate Club graph
G = nx.karate_club_graph()
@satomacoto
satomacoto / labeledarrow.html
Created August 18, 2012 06:56
labeled arrow w/ D3.js
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
<script src="http://d3js.org/d3.v2.js"></script>
<style>
line.arrow {
stroke: #666;
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Hello world!</title>
</head>
<body>
<h1>Hello world!</h1>
<p>hogehoge</p>
</body>
@satomacoto
satomacoto / AttachLabelsToPoints.bas
Created July 20, 2012 08:20
Excelの散布図にラベルをつける AttachLabelsToPoints
Sub AttachLabelsToPoints()
'Dimension variables.
Dim RCounter As Integer, CCounter As Integer, xVals As String
'Disable screen updating while the subroutine is run.
Application.ScreenUpdating = False
'Store the formula for the first series in "xVals".
xVals = ActiveChart.SeriesCollection(1).Formula