This gist has been superceedes by this small talon cheatsheet suitable for learning beginner commands.
audioStreamInitialize() { | |
/* | |
Feature detecting is a simple check for the existence of "navigator.mediaDevices.getUserMedia" | |
To use the microphone. we need to request permission. | |
The parameter to getUserMedia() is an object specifying the details and requirements for each type of media you want to access. | |
To use microphone it shud be {audio: true} | |
*/ | |
navigator.mediaDevices.getUserMedia(self.audioConstraints) |
(previous Yoneda blog) (reddit) (twitter)
Let's explore the Yoneda lemma. You don't need to be an advanced Haskeller to understand this. In fact I claim you will understand the first section fine if you're comfortable with map
/fmap
and id
.
I am not out to motivate it, but we will explore Yoneda at the level of terms and at the level of types.
sudo su | |
yum --enablerepo=extras install epel-release | |
yum -y install patch dkms kernel-devel perl | |
yum update | |
#Required for kernel num 5: | |
yum --enablerepo=elrepo-kernel -y install kernel-ml-devel | |
reboot |
on local and remote machine: | |
go get github.com/pocke/lemonade (if you have Go installed, if not download lemonade binary from github) | |
make sure $GOPATH/bin is in your path on both machines | |
-- or move $GOPATH/bin/lemonade to a place already in your path like /usr/local/bin | |
on your local machine add a script like this: | |
cat ~/bin/remote |
Disclaimer 1: Type classes are great but they are not the right tool for every job. Enjoy some balance and balance to your balance.
Disclaimer 2: I should tidy this up but probably won’t.
Disclaimer 3: Yeah called it, better to be realistic.
Type classes are a language of their own, this is an attempt to document features and give a name to them.
{-# LANGUAGE GADTs #-} | |
{-# LANGUAGE PolyKinds #-} | |
{-# LANGUAGE FunctionalDependencies #-} | |
{-# LANGUAGE MultiParamTypeClasses #-} | |
{-# LANGUAGE TypeOperators #-} | |
{-# LANGUAGE DataKinds #-} | |
{-# LANGUAGE KindSignatures #-} | |
{-# LANGUAGE TemplateHaskell #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE OverloadedLabels #-} |
This document is licensed CC0.
These are some questions to give a sense of what you know about FP. This is more of a gauge of what you know, it's not necessarily expected that a single person will breeze through all questions. For each question, give your answer if you know it, say how long it took you, and say whether it was 'trivial', 'easy', 'medium', 'hard', or 'I don't know'. Give your answers in Haskell for the questions that involve code.
Please be honest, as the interviewer may do some spot checking with similar questions. It's not going to look good if you report a question as being 'trivial' but a similar question completely stumps you.
Here's a bit more guidance on how to use these labels:
löb is a well-known function in Haskell for implementing spreadsheet-like behaviors and tying the knot. It is defined as:
loeb :: Functor f => f (f a -> a) -> f a
loeb fs = xs
where xs = fmap ($ xs) fs
------------------------------------------------------------------------------------------ | |
-- A formalization of the Cheryl's birtday problem; using Haskell/SBV | |
-- | |
-- See: http://www.nytimes.com/2015/04/15/science/a-math-problem-from-singapore-goes-viral-when-is-cheryls-birthday.html | |
-- | |
-- By Levent Erkok, This file is in the public domain. Use it as you wish! | |
-- | |
-- NB. Thanks to Amit Goel for suggesting the formalization strategy used in here. | |
------------------------------------------------------------------------------------------ |