△AOC = △BOC + △BCM + △BAM
△AOC * b/a = △BOC
△AOC * d/c = △AOD
= △BOC + △BCM + △DCM + △BAM + △DAM
= △BOC + 2△BCM + 2△BAM (△BCM = △DCM, △BAM = △DAM)
△AOC * (b/a + d/c)
= 2△BOC + 2△BCM + 2BAM
This file contains hidden or 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 <cassert> | |
| #include <utility> | |
| #include <tuple> | |
| #include <functional> | |
| #include <iostream> | |
| #include <vector> | |
| #include <array> | |
| #include <list> | |
| #include <memory> |
This file contains hidden or 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
| sudo pkill blued |
This file contains hidden or 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
| # $1 : description (ex, MYSQL DB Name) | |
| input_password() { | |
| tmp1="" | |
| while [ "$tmp1" = "" ]; do | |
| read -sp "Enter $1: " tmp1 | |
| tty -s && echo >&2 | |
| if [ -z tmp1 ]; then | |
| continue | |
| fi |
This file contains hidden or 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
| http://d.hatena.ne.jp/ykmbpp/20080527/1211850475 | |
| yでヤンク | |
| :s/CTRL-Rに続いて"/<置換文字列>/gc |
- 参考: https://qiita.com/kktk-KO/items/aad50e11e2aa84bce174#comment-65a5c36f4be828315ab8
- テストコード: https://wandbox.org/permlink/ccAavGVm03GU1vpC
#include <iostream>
#include <vector>
#include <list>
#include <initializer_list>
template class U = std::initializer_list, class E = int, class T = U>
This file contains hidden or 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
| https://insideflag.blogspot.jp/2013/10/grep-punicode.html | |
| ``` | |
| UTF-8モードについて調べるためman pcreしてみると、non-UTF-8 modeではUnicodeプロパティのテストは255以下のコードポイントに制限されると書いてあったので、GNU grepでもなんとかしてUTF-8モードにする必要がある。さらにドキュメントを読むと、パターンの先頭に(*UTF8)があればUTF-8モードになるとのことなので試してみる。 | |
| $ echo "あ" | ggrep -P "(*UTF8)\p{Hiragana}" | |
| あ | |
| できた。だけど英数記号混じりで毎回7文字もタイプするのはだるい。 | |
| ``` |
This file contains hidden or 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("stdfaust.lib"); | |
| maxdel = 8192; | |
| // value: 0 .. 1 | |
| curve_eq_power(value) = cos(ma.PI * (1 - (value * 2 - 1)) / 4.0); | |
| dry_wet = hslider("Dry/Wet", 0.5, 0, 1, 0.01); | |
| wet_gain = curve_eq_power(dry_wet); | |
| dry_gain = curve_eq_power(1 - dry_wet); |
This file contains hidden or 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 | |
| #if defined(_MSC_VER) | |
| #include <array> | |
| #include <string> | |
| #include <windows.h> | |
| //! (NFCであるような)文字列をApple-NFDに変換する | |
| /*! カタカナと濁点/半濁点などがあらかじめ一文字に合成された「合成済み文字」を、それぞれが分解された「結合文字列」に分解する |
This file contains hidden or 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
| #if defined(_MSC_VER) | |
| //! @file | |
| /*! std::cout, std::wcerrなどのストリームへの出力を、DebugOutputString()に流して、 | |
| * Visual Studioの出力ウィンドウに出力できるようにする。 | |
| * (DebugOutputString()への出力はリリースモードでも有効であることに注意すること) | |
| * 参考: http://fa11enprince.hatenablog.com/entry/2015/07/04/192645 | |
| * 参考: http://blog.livedoor.jp/tek_nishi/archives/5004322.html | |
| */ |