This file contains 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
{ "data":[ | |
{ | |
"question": "Is the earth round?", | |
"type": "multiple-choice", | |
"choices": { | |
"a": "yes", | |
"b": "no", | |
"c": "in a sense", | |
"d": "none of your beeswax" | |
}, |
This file contains 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
{- Write a program which returns a list of sorted tuples based on the | |
- second element: | |
- e.g. tuple_list = [ (a, 5), (b, 2), (c, 3), (d, 1), (e, 4) ] | |
- Output: [d, b, c, e, a] | |
-} | |
import Data.Tuple | |
import Data.List | |
foo :: (Ord b) => [(a, b)] -> [a] |
This file contains 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
{- Count the number of vowels in a string -} | |
-- Is the character a vowel? | |
isVowel :: Char -> Bool | |
isVowel x = case x of | |
'a' -> True | |
'e' -> True | |
'i' -> True | |
'o' -> True | |
'u' -> True |
This file contains 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
/* Doing exercises in K&R, 03/17/2019 | |
* | |
* Write a program `entab` that replaces strings of blanks by the minimum | |
* number of tabs and blanks to achieve the same spacing. Use the same tab | |
* stops as for `detab`. When either a tab or a single blank would suffice to | |
* reach a tab stop, which should be given preference? | |
*/ | |
#include <stdio.h> | |
# define TABSTOP 4 |
This file contains 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
;; Unicode | |
(prefer-coding-system 'utf-8-unix) | |
;; MELPA Repository | |
;; ================== | |
(require 'package) | |
(let* ((no-ssl (and (memq system-type '(windows-nt ms-dos)) | |
(not (gnutls-available-p)))) | |
(proto (if no-ssl "http" "https"))) | |
(when no-ssl |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.