Skip to content

Instantly share code, notes, and snippets.

View jjlumagbas's full-sized avatar

JJ Lumagbas jjlumagbas

View GitHub Profile
@jjlumagbas
jjlumagbas / lists.py
Created October 20, 2016 02:21
Lists and for-loops
# sum
def sum(lst):
"""[Number] -> Number
Returns the sum of all elements of the list
"""
result = 0
for el in lst:
result = result + el
return result
@jjlumagbas
jjlumagbas / shapes.hs
Created October 19, 2016 04:08
Shapes module
module Shapes
( Point(..)
, Shape(..)
, surface
, nudge
, baseCircle
, baseRect
) where
data Point = Point Float Float deriving (Show)
@jjlumagbas
jjlumagbas / modules.hs
Created October 19, 2016 03:35
module
import qualified Data.List as L hiding (nub)
numUniques :: (Eq a) => [a] -> Int
numUniques = length . nub

Film crit HULK smash: luke cage, netflix and the death of episodic tv

Whatever happened to telling stories within stories?

Film crit HULK Oct. 12, 2016

1. Stories within stories

HULK worries we're witnessing the death of episodic tv.

def is_vowel(ch):
"""String -> Bool
Determines whether a single char string
is a vowel
"""
return ch == "a" or ch == "e" or ch == "i" or ch == "o" or ch == "u" or ch == "A" or ch == "E" or ch == "I" or ch == "O" or ch == "U"
import java.util.*;
public class LList implements MyList {
private MyNode head;
private int size;
public LList() {
size = 0;
}
for char in 'hello':
print('The character is', char)
public class IteratorTest {
public static void main(String[] args) {
Collection<Integer> l = new LinkedList<Integer>();
l.add(1);
l.add(2);
l.add(5);
System.out.println(average(l));
System.out.println(countInRange(l, 0, 3));
}
public interface MyList {
public void add(Object item);
public void add(int i, Object item);
public Object get(int i);
public void remove(int i);
public void set(int i, Object item);