Skip to content

Instantly share code, notes, and snippets.

View ompugao's full-sized avatar

ompugao

View GitHub Profile
@ompugao
ompugao / dstarlite.cpp
Created May 4, 2019 14:13
D* Lite implementation in C++ (experimental)
////
// D* Lite implementation in C++
// @tokoro10g
// Reference: http://idm-lab.org/bib/abstracts/papers/aaai02b.pdf
////
#include <bits/stdc++.h>
using namespace std;
using Cost = float;
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ompugao
ompugao / linux_magic.cpp
Created August 15, 2020 15:30 — forked from xymopen/linux_magic.cpp
C++ equivalences of the famous offset_of and container_of(owner_of) macro from Linux kernel
template< class T, class M >
static inline constexpr ptrdiff_t offset_of( const M T::*member ) {
return reinterpret_cast< ptrdiff_t >( &( reinterpret_cast< T* >( 0 )->*member ) );
}
template< class T, class M >
static inline constexpr T* owner_of( M *ptr, const M T::*member ) {
return reinterpret_cast< T* >( reinterpret_cast< intptr_t >( ptr ) - offset_of( member ) );
}
@ompugao
ompugao / casadi_mpc.py
Last active October 8, 2021 02:56 — forked from mayataka/casadi_mpc.py
MPC via CasADi
from casadi import *
import math
import numpy as np
class MPC:
def __init__(self):
# 問題設定
T = 1.0 # ホライゾン長さ (MPCなので短め)
N = 20 # ホライゾン離散化グリッド数 (MPCなので荒め)
@ompugao
ompugao / LICENSE
Created December 10, 2019 13:02 — forked from IshitaTakeshi/LICENSE
Huber weighted IRLS
Copyright (C) 2006, Jonathan E. Taylor
All rights reserved.
Copyright (c) 2006-2008 Scipy Developers.
All rights reserved.
Copyright (c) 2009-2018 statsmodels Developers.
All rights reserved.

Google Speech To Text API

Base URL: https://www.google.com/speech-api/v1/recognize
It accepts POST requests with voice file encoded in FLAC format, and query parameters for control.

Query Parameters

client
The client's name you're connecting from. For spoofing purposes, let's use chromium

lang
Speech language, for example, ar-QA for Qatari Arabic, or en-US for U.S. English

@ompugao
ompugao / README.md
Created March 3, 2019 06:51 — forked from gunyarakun/README.md
旺文社『表現のための実践ロイヤル英文法』別冊付録「英作文のための暗記用例文300」JSON
@ompugao
ompugao / changeslope.py
Created July 30, 2018 07:54 — forked from 8bit-pixies/changeslope.py
Interactive tkinter matlibplot example.
import Tkinter
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
from matplotlib.figure import Figure
class App:
def __init__(self, master):
# Create a container
frame = Tkinter.Frame(master)
# Create 2 buttons
self.button_left = Tkinter.Button(frame,text="< Decrease Slope",
@ompugao
ompugao / cute_AA.txt
Created September 18, 2017 14:49 — forked from Tosainu/cute_AA.txt
顔文字詰め合わせ
あせ (・_・;) 顔文字
あせ (・∀・;) 顔文字
あせ (^ω^;;) 顔文字
あせ (゚∀゚ ;)タラー 顔文字
あたふた ヽ(´・ω・`ヽ)​ 顔文字
あつい (。>﹏<)あㄘ”ゅい 顔文字
あつい ι(´Д`υ)アジィー 顔文字
あつい あㄘ”ゅい(>﹏<。Ξ。>﹏<)あㄘ”ゅい 顔文字
あはは ( ゚∀゚)アハハ八八ノヽノヽノヽノ \ / \/ \ 顔文字
あひゃ アヒャヒャヒャ(゚∀゚≡゚∀゚)ヒャヒャヒャ 顔文字
@ompugao
ompugao / extend.sh
Last active February 6, 2017 14:19 — forked from wvengen/extend.sh
Extend non-HiDPI external display above HiDPI internal display
#!/bin/sh
# extend non-HiDPI external display on DP* above HiDPI internal display eDP*
# see also https://wiki.archlinux.org/index.php/HiDPI
# you may run into https://bugs.freedesktop.org/show_bug.cgi?id=39949
# https://bugs.launchpad.net/ubuntu/+source/xorg-server/+bug/883319
EXT=`xrandr --current | sed 's/^\(.*\) connected.*$/\1/p;d' | grep -v '^eDP' | head -n 1`
INT=`xrandr --current | sed 's/^\(.*\) connected.*$/\1/p;d' | grep -v '^DP' |grep -v 'HDMI' | head -n 1`
ext_w=`xrandr | sed 's/^'"${EXT}"' [^0-9]* \([0-9]\+\)x.*$/\1/p;d'`