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
scanner(FILE *fd) { | |
beginning: | |
c = fgetc(fd); | |
switch (c) { | |
case ' ': goto beginning; | |
case '\n': return TOKEN_NEWLINE; | |
default: fseek(fd, -1, SEEK_CUR); | |
} | |
... |
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 <algorithm> | |
#include <array> | |
#include <iostream> | |
template<typename T, size_t N> | |
struct vec { | |
T v[N]; | |
T* begin() { return &v[0]; }; | |
T* end() { return &v[N]; }; | |
const T* begin() const { return &v[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
{-# LANGUAGE GADTs #-} | |
{-# LANGUAGE DeriveFunctor #-} | |
{-# LANGUAGE StandaloneDeriving #-} | |
{-# LANGUAGE RankNTypes #-} | |
{-# LANGUAGE TypeApplications #-} | |
import Control.Monad | |
import Control.Monad.Free | |
import System.Random |
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
module Main where | |
import Data.List (splitAt, foldl') | |
import Control.Monad (forM_) | |
import System.Random (randomRs, getStdGen) | |
import System.Environment (getArgs) | |
import qualified Data.Map.Strict as M | |
main = do | |
[size, digits, columns] <- map read <$> getArgs :: IO [Int] |
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
{-# LANGUAGE TypeApplications #-} | |
module Main where | |
import Prelude hiding (readFile) | |
import Data.Binary | |
import Data.Binary.Get | |
import qualified Data.ByteString as B | |
import qualified Data.ByteString.Lazy as BL |
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
{-# LANGUAGE TupleSections #-} | |
import Data.List (findIndex) | |
import Control.Arrow ((&&&)) | |
import Numeric.LinearAlgebra | |
data NN = NN { nnWs :: [Matrix R], nnBs :: [Vector R] } | |
nn = NN [ matrix 2 [6,7,8,9], matrix 2 [-6,-5,-4,-3], matrix 1 [-2,-1] ] |
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
module Main where | |
import Data.List (unfoldr, mapAccumL, foldl') | |
import Data.Matrix | |
import Data.Foldable (sum) | |
import System.Random | |
layers = [28*28,16,16,10] |
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
/* more readable chat */ | |
.chat-list, | |
.chat-input textarea, | |
.video-chat, | |
.video-chat__input textarea { | |
font-size: 18px !important; | |
font-family: -apple-system !important; | |
font-weight: 500 !important; | |
color: hsl(0,0%,90%) !important; | |
line-height: 1.2 !important; |
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
module Main where | |
import System.Environment (getArgs) | |
import Data.ByteString (ByteString) | |
import qualified Data.ByteString as B | |
import Data.Text.ICU.Convert | |
import Data.Text.Encoding as T |
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
#ifdef GL_ES | |
precision mediump float; | |
#endif | |
uniform vec2 u_resolution; | |
#define PI 3.14159265358979 | |
uniform float u_time; | |
float stroke(float x, float s, float w) { |
NewerOlder