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
import Html exposing (text) | |
type alias T = {name: String} | |
type alias R b = {b | name: String, age: Float} | |
type alias S a = {a | name: String} | |
type alias Q = {age: Float} | |
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
#lang racket | |
(require json) | |
(require net/url) | |
(define (get url) | |
(call/input-url (string->url url) | |
(curry get-pure-port #:redirections 4) | |
port->string)) |
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
module RegisterMachine exposing (..) | |
import Html | |
import Time exposing (Time, second) | |
import Array exposing (Array) | |
import Html exposing (..) | |
import Html.Attributes exposing (style) | |
type Msg |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>lazy table</title> | |
<link rel="stylesheet" href="style.css"> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore-min.js"></script> | |
</head> | |
<body> | |
<table id="lazyTable"></table> |
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
-module(assignment1). | |
-export([bits/1, area/1, perimeter/1, enclose/1, bits_rec/1]). | |
% Shapes | |
% How the shapes are defined: | |
% circle: {circle, {x, y}, r} | |
% rectangle: {rectangle, {x1, y1},{x2, y2}} | |
% triangle: {triangle, {x1, y1}, A, B, C} | |
area({circle, {_X, _Y}, R}) -> |
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
-module(assignment2). | |
-export([index/1]). | |
% test the code by calling | |
% assignment2:index("gettysburg-address.txt"). | |
% assignment2:index("dickens-christmas.txt"). | |
clean_line([], C) -> | |
lists:reverse(C); |
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
#lang datalog | |
town(ben, slumerville). | |
street(ben, ridge_road). | |
str_number(ben, 10). | |
department(ben, computer). | |
position(ben, guru). | |
salary(ben, 60000). | |
town(alyssa, cambridge). |
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
import Html exposing (text) | |
import Json.Decode exposing (..) | |
type Status | |
= Done | |
| Open | |
| Failed | |
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
%% Based on code from | |
%% Erlang Programming | |
%% Francecso Cesarini and Simon Thompson | |
%% O'Reilly, 2008 | |
%% http://oreilly.com/catalog/9780596518189/ | |
%% http://www.erlangprogramming.org/ | |
%% (c) Francesco Cesarini and Simon Thompson | |
-module(frequency). | |
-export([start/0,allocate/0,deallocate/1,stop/0,clear/0]). |
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
:- use_module(library(semweb/rdf_db)). | |
:- use_module(library(semweb/rdf_http_plugin)). | |
load_band(A, S) :- | |
rdf_load(A, [format(xml)]), | |
findall(B, (rdf(A,'http://dbpedia.org/ontology/associatedBand',B)), L1), | |
findall(C, (rdf(C,'http://dbpedia.org/ontology/associatedBand',A)), L2), | |
append(L1, L2, S). | |
load_bands(_, _, _, 500) :- |