Association Lisps 💥
Running:
$ brew install sbcl
$ sbcl --script association.cl
(defun pad(thing) | |
(concatenate 'string "0" thing)) | |
(defun pad-if-length-not-same(thing length) | |
(cond | |
((not | |
(= (length thing) length)) | |
(pad thing)) | |
(t thing))) |
(defun pad(num) | |
(concatenate 'string "0" num)) | |
(defun should-pad(num) | |
(= (length num) 1)) | |
(defun apply-padding(num) | |
(cond | |
((should-pad num) (pad num)) | |
(t num))) |
module DFASpec (spec) where | |
import Test.Hspec | |
data State = S1 | S2 deriving (Eq, Show) | |
data Symbols = Zero | One deriving (Eq, Show) | |
data Alphabet = Alphabet [Symbols] deriving (Eq, Show) | |
data FiniteStates = FiniteStates [State] deriving (Eq, Show) | |
#[derive(Debug, PartialEq)] | |
enum Token { | |
Symbol(Symbol), | |
Type(Type), | |
Keyword(Keyword), | |
Word(Word), | |
Char(char), | |
} | |
#[derive(Debug, PartialEq)] |
package xyz.jacobclark.day3; | |
import org.junit.Test; | |
import java.util.ArrayList; | |
import java.util.List; | |
import static org.junit.Assert.assertEquals; |
const query = require('./query.js'); | |
require('es6-promise').polyfill(); | |
exports.handler = function(event, context, callback) { | |
query(event["queryStringParameters"]['username']).then(function(data){ | |
var resp = { | |
"isBase64Encoded": false, | |
"statusCode": 200, |
module Main where | |
import Network.HTTP.Conduit | |
import qualified Data.ByteString.Lazy as L | |
import Text.Regex.PCRE | |
findNewsroundLinks :: String -> [String] | |
findNewsroundLinks = map read . getAllTextMatches . (=~ "href=\"/newsround([^\"#]+)") | |
bytestringToString :: L.ByteString -> [String] |
package xyz.jacobclark; | |
import java.util.List; | |
import java.util.stream.Collectors; | |
import java.util.stream.IntStream; | |
import static java.util.Arrays.asList; | |
public class LinearRegression { | |
private static final List<Integer> x = asList(2, 3, 5, 7, 9, 11, 14); // Consecutive hours developer codes |
def nn(input1, input2): | |
bias = 1 | |
weight0 = -1 | |
weight1 = 0.5 | |
weight2 = 0.5 | |
net = (bias*weight0)+(input1*weight1)+(input2*weight2) | |
return "1" if net >= 0 else "0" |
Association Lisps 💥
Running:
$ brew install sbcl
$ sbcl --script association.cl