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
;; Programming Languages, Homework 5 | |
#lang racket | |
(provide (all-defined-out)) ;; so we can put tests in a second file | |
;; definition of structures for MUPL programs - Do NOT change | |
(struct var (string) #:transparent) ;; a variable, e.g., (var "foo") | |
(struct int (num) #:transparent) ;; a constant number, e.g., (int 17) | |
(struct add (e1 e2) #:transparent) ;; add two expressions | |
(struct ifgreater (e1 e2 e3 e4) #:transparent) ;; if e1 > e2 then e3 else e4 |
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
(require '[clojure.core.async :as a]) | |
(def xform (comp (map inc) | |
(filter even?) | |
(dedupe) | |
(flatmap range) | |
(partition-all 3) | |
(partition-by #(< (apply + %) 7)) | |
(flatmap flatten) | |
(random-sample 1.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
#!/usr/bin/env bash | |
# get all the PPAs installed on a system ready to share for reininstall | |
for APT in `find /etc/apt/ -name \*.list`; do | |
# list found files - helps in case of: '... public key is not available: NO_PUBKEY' | |
echo $APT | |
grep -o "^deb http://ppa.launchpad.net/[a-z0-9\-]\+/[a-z0-9\-]\+" $APT | while read ENTRY ; do | |
USER=`echo $ENTRY | cut -d/ -f4` | |
PPA=`echo $ENTRY | cut -d/ -f5` | |
echo sudo apt-add-repository ppa:$USER/$PPA |
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
;;; cobol-mode.el --- Mode for editing COBOL code -*- lexical-binding: t; -*- | |
;; Copyright (C) 2013-2015 Edward Hart | |
;; Author: Edward Hart <[email protected]> | |
;; Maintainer: Edward Hart | |
;; Version: 0 | |
;; Created: 9 November 2013 | |
;; Keywords: languages |
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
(ns gist.conduit | |
(:require [net.cgrand.enlive-html :as html] | |
[net.cgrand.tagsoup :as tagsoup])) | |
; The implementations of conduit and defconduit are modified versions of | |
; the macros template and deftemplate from the guts of Enlive. | |
; They're named 'conduit' because the selectors and transformations serve as a | |
; channel between the scaffold of HTML and some data provided as an argument. |
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
(function () { | |
d3.analog= function() { | |
var height = 200, gap=10, | |
xValue = function(d) { return d[0]; }, | |
xScale = null, | |
color = d3.scale.category10(); | |
function chart(selection) { | |
selection.each(function(d) { | |
var g = d3.select(this); |
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
public class HelloWorld { | |
public static void main (String[] args) { | |
System.out.println("Hello, World!"); | |
} | |
} |