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
width = 800 | |
height = 600 | |
const params = d3.select("body") | |
.append("div") | |
.attr("style", "width:100%;display:flex;height:10%;align-items:center;"); | |
params.append("label") | |
.text("Size of Rectangles: ") |
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 <stdio.h> | |
#include <string.h> | |
#define RULE_SIZE 7 | |
char toLower(char c) | |
{ | |
if (c >= 'A' && c <= 'Z') | |
return (c + (('a' - 'A'))); | |
return c; |
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
def get_key(params, key): | |
if key not in params: | |
return "" | |
return params[key] | |
def put_key(params, key, value): | |
if key == "": | |
return params | |
params[key] = value | |
return params |
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
def printHelloWorld(args): | |
return "Hello world, " + args[0] | |
def printYoloWorld(args): | |
return "Yolo " + args[0] | |
def prettyPrint(state): | |
if state == None: | |
return; | |
for s in state: |
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
{ | |
"cols": [ | |
"Location", | |
"2020", | |
"2010", | |
"2000", | |
"1990", | |
"1980", | |
"1970", | |
"1960", |
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
def main(): | |
log = initLog(0) | |
log = logRunner(log, addTwo) | |
log = logRunner(log, square) | |
log = logRunner(log, divideBy5) | |
print(log) | |
def square(n): |
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
# Simulate and visualize entropy | |
# Entropy(X) = -1 * (sum p(X=x) log(P(X=x))) | |
# Author: Chirath Nissanka | |
import pygame | |
import random | |
import math | |
WINDOW_WIDTH = 1280 | |
WINDOW_HEIGHT = 1000 |