- Don't do things just because they worked once
Need for Sleep: the Impact of a Night of Sleep Deprivation on Novice Developers’ Performance
| import Data.Maybe | |
| fizzBuzzList :: Int -> Maybe String | |
| fizzBuzzList n = list !! index where | |
| list = [ Just "fizzbuzz" | |
| , Nothing | |
| , Nothing | |
| , Just "fizz" | |
| , Nothing | |
| , Just "buzz" |
| #include "./main.h" | |
| #include <inttypes.h> | |
| #include <stdint.h> | |
| #include <stdio.h> | |
| static uint64_t (*steps[2])(uint64_t) = {&collatz_even_step, &collatz_odd_step}; | |
| uint64_t collatz_even_step(uint64_t n) { return n >> 1u; } | |
| uint64_t collatz_odd_step(uint64_t n) { return 3u * n + 1u; } |
Need for Sleep: the Impact of a Night of Sleep Deprivation on Novice Developers’ Performance
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <omp.h> | |
| #include <stdint.h> | |
| #define BUFF_SIZE 1024*1024*16 | |
| #define UCHAR_MAX 255 | |
| int main(void) { | |
| FILE *f = fopen("/home/connorbaker/storage/large_test_file-02", "r"); |
| import javafx.application.Application; | |
| import javafx.scene.Scene; | |
| import javafx.scene.chart.*; | |
| import javafx.stage.Stage; | |
| import java.io.BufferedReader; | |
| import java.io.FileNotFoundException; | |
| import java.io.FileReader; | |
| import java.util.Map; | |
| import java.util.function.Function; |
| time parallel --jobs 8 mawk -v "N={}" -f euclidsAlgo.awk ::: (seq 1 10000) | mawk -f removeGCD.awk | gsort -t "," -V | uniq | wc -l | |
| myalgo | |
| BEGIN{ | |
| for (i = 0; i < N; i++) { | |
| printf "%d,%d,%d\n", sideA(N, i), sideB(N, i), sideC(N, i); | |
| } | |
| } | |
| function sideA(m, n) { |
| if [ $# -ne 4 ]; then | |
| echo "Usage: bash wrapper.sh <precision> <number of iterations> <number to find orbit of> <base>" | |
| exit 1 | |
| fi | |
| gawk -M -v "PREC=$1" -v "ITER=$2" -v "NUM=$3" -v "BASE=$4" \ | |
| 'BEGIN{ | |
| r = NUM; | |
| pair[0] = 0.0; | |
| pair[1] = 0.0; |
| luhnDouble :: Int -> Int | |
| luhnDouble n | |
| | n <= 5 = 2 * n | |
| | otherwise = 2 * n - 9 | |
| luhn :: [Int] -> Bool | |
| luhn [] = False | |
| luhn ns = mod (sum $ altMap luhnDouble id ns) 10 == 0 |
| altMap :: (a -> b) -> (a -> b) -> [a] -> [b] | |
| altMap _ _ [] = [] | |
| altMap f g (x:xs) = f x : altMap g f xs |
| channelNoisy :: [Bit] -> [Bit] | |
| channelNoisy = tail | |
| transmitNoisy :: String -> String | |
| transmitNoisy = decodeWithParityBit | |
| . channelNoisy | |
| . encodeWithParityBit |