I hereby claim:
- I am safiire on github.
- I am safiire (https://keybase.io/safiire) on keybase.
- I have a public key whose fingerprint is 06DC 5901 70E2 350A 4BCE 7C1D 9EFD 7244 59CC 7EB0
To claim this, I am signing this object:
;;;; RC Filter Simulation | |
;; Calculates the frequency response of an RC filter | |
;; and displays it with ASCII art | |
;; This is just a program I always write to learn a new programming language | |
;; I tried out Scheme's lazy lists for this | |
;; | |
;; Frequency Response | |
;; ---------------------------------------------------------------- | |
;; |****************************** | | |
;; | ***** | |
import("math.lib"); | |
Tau = 6.283185307179586; | |
Pi = 3.141592653589793; | |
Fs = SR; | |
oscillator(f, amplitude) = phase_accumulator(w) : sinf * amplitude with { | |
w = f / Fs * Tau; | |
sinf = ffunction(float sinf(float), <math.h>, ""); | |
}; |
#include <iostream> | |
using namespace std; | |
//// | |
// Pattern match on a list of types, recursively ask for the last one | |
template <typename Head, typename... Tail> | |
struct last { | |
using type = typename last<Tail...>::type; | |
}; |
// C++11 is pretty neat so far. | |
// | |
// clang++ yay.cpp -o yay -std=c++11 -stdlib=libc++ | |
#include <iostream> | |
#include <memory> | |
#include <vector> | |
#include <functional> | |
using namespace std; |
#!/usr/bin/env ruby | |
# Really inefficient toy | |
#### | |
## A little wrapper to make signals either with | |
## lambda functions or arrays. | |
class SignalFunction | |
def self.ramp | |
SignalFunction.new(lambda{|n| n < 0 ? 0r : n/1r}) | |
end |
require 'matrix' | |
## Note: In ruby the notation x**n means x raised to the nth power | |
## | |
## In linear algebra, Dual numbers are in the form: | |
## a + bε | |
## | |
## Where ε is what is called nilpotent, you can think of | |
## ε as an infinitesimal (sort of kinda), like how they used to do Calculus in the | |
## olden days. |
I hereby claim:
To claim this, I am signing this object:
require 'kleisli' | |
def do_lots(count) | |
(0..count).reduce(0){|sum, value| sum + value } | |
end | |
future = Future(100000000) >-> value { | |
Future { | |
do_lots(value.call) | |
} >-> big_sum { |
{-# LANGUAGE OverloadedStrings, DeriveGeneric #-} | |
import Data.Text (Text) | |
import Data.Aeson | |
import GHC.Generics | |
import qualified Data.ByteString.Lazy as B | |
data Person = | |
Person { first :: !Text | |
, last :: !Text |
abstract PassiveComponent | |
type Resistor <: PassiveComponent | |
value::Complex{Float64} | |
end | |
type Capacitor <: PassiveComponent | |
value::Complex{Float64} | |
end |