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
| /* | |
| * alsa_filter_test.cpp | |
| * | |
| * Created by fukuroda (https://github.com/fukuroder) | |
| */ | |
| // g++ alsa_filter_test.cpp -std=c++0x -O3 -lasound -lsndfile | |
| #include<alsa/asoundlib.h> // sudo apt-get install libasound2-dev | |
| #include<sndfile.h> // sudo apt-get install libsndfile1-dev |
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
| (* | |
| * ocaml_alsa_test.ml | |
| * | |
| * Created by fukuroda (https://github.com/fukuroder) | |
| *) | |
| (* sudo apt-get install libalsa-ocaml-dev *) | |
| (* ocamlfind ocamlopt -o ocaml_alsa_test ocaml_alsa_test.ml -package alsa -linkpkg *) |
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
| # | |
| # elixir_wav_read_test.exs | |
| # | |
| # Created by fukuroda (https://github.com/fukuroder) | |
| # | |
| # >elixir elixir_wav_read_test.exs | |
| use Bitwise |
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
| # -*- coding: utf-8 -*- | |
| import scipy.io, numpy as np, numpy.linalg as nl | |
| name = 'hcircuit' | |
| eps = 1.0e-3 | |
| # read matrix and vector | |
| print '#A:', scipy.io.mminfo(name + '.mtx.gz') | |
| print '#b:', scipy.io.mminfo(name + '_b.mtx.gz') | |
| A = scipy.io.mmread(name + '.mtx.gz').tocsr() |
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
| # create lowpass filter | |
| function create_lowpass_filter( | |
| [double]$samplerate, | |
| [double]$cutoff_freq, | |
| [double]$resonance) | |
| { | |
| # a0 + a1*z^-1 + a2*z^-2 | |
| # H(z) = ------------------------ | |
| # 1 + b1*z^-1 + b2*z^-2 | |
| $s = [Math]::Tan($cutoff_freq*3.14159265/$samplerate) |
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
| Add-Type -AssemblyName presentationframework | |
| [xml]$xaml = @' | |
| <Window | |
| xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
| xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
| Title="MainWindow" Height="100" Width="200" ResizeMode="NoResize"> | |
| <Grid> | |
| <Button Name="button1" Content="XAML"/> | |
| </Grid> | |
| </Window> |
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 "../JuceLibraryCode/JuceHeader.h" | |
| int main () | |
| { | |
| var json = JSON::parse("{\"a\":[ {\"b\":[1,2,3,4,5]}, {\"c\":[6,7,8,9]} ] }"); | |
| std::cout << static_cast<int>(json["a"][0]["b"][4]) << std::endl; // 5 | |
| return 0; | |
| } |
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 "../JuceLibraryCode/JuceHeader.h" | |
| int main() | |
| { | |
| DynamicObject* obj1 = new DynamicObject(); | |
| obj1->setProperty("b", Array<var>{1, 2, 3, 4}); | |
| DynamicObject* obj2 = new DynamicObject(); | |
| obj2->setProperty("c", Array<var>{6, 7, 8, 9}); | |
| DynamicObject* obj3 = new DynamicObject(); | |
| obj3->setProperty("a", Array<var>{obj1, obj2}); |
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 "../JuceLibraryCode/JuceHeader.h" | |
| std::vector<uint32> Encrypt(const std::string& text, const std::string& key) | |
| { | |
| // create Blowfish | |
| BlowFish bf(key.data(), key.length()); | |
| // encrypt | |
| std::vector<uint32> result; | |
| auto p = text.begin(); |
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
| PKG core | |
| PKG alsa | |
| PKG yojson |