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
namespace SideEffect | |
{ | |
using System; | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
// SideEffecty(); |
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
####################################################### | |
# Evaluating Quandl Data Quality | |
# | |
# [email protected] - Nov 2013 | |
####################################################### | |
library(quantmod) | |
library(Quandl) | |
library(Rbbg) | |
library(XML) |
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
fun is_older (day1 : int*int*int, day2 : int*int*int) = | |
if (#1 day1) < (#1 day2) | |
then true | |
else if (((#2 day1) < (#2 day2)) andalso ((#1 day1) = (#1 day2))) | |
then true | |
else if (((#3 day1) < (#3 day2)) andalso ((#2 day1) = (#2 day2)) andalso ((#1 day1) = (#1 day2))) | |
then true | |
else false | |
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
# agecount.R | |
agecount <- function(age = NULL) { | |
## Check that "age" is non-NULL; else throw error | |
if (is.null(age)) { | |
stop("Age input cannot be NULL") | |
} | |
## Read "homicides.txt" data file | |
homicides <- readLines("homicides.txt") |
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.R | |
# setwd("~/ComputingForDataAnalysis/Assignment4") | |
count <- function(cause = NULL) { | |
## Check that "cause" is non-NULL; else throw error | |
if (is.null(cause)) { | |
stop("Cause has not been specified.") | |
} | |
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
############################################################################### | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. | |
# | |
# This program is distributed in the hope that it will be useful, | |
# but WITHOUT ANY WARRANTY; without even the implied warranty of | |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
# GNU General Public License for more details. |
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
# Rock-paper-scissors-lizard-Spock | |
# The key idea of this program is to equate the strings | |
# "rock", "paper", "scissors", "lizard", "Spock" to numbers | |
# as follows: | |
# | |
# 0 - rock | |
# 1 - Spock | |
# 2 - paper | |
# 3 - lizard |
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> | |
<meta charset="utf-8"> | |
<style> | |
div.tooltip { | |
position: absolute; | |
text-align: right; | |
z-index:9999; | |
width: 6px; | |
height: 18px; |
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
.DS_STORE |
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
fun number_before_reaching_sum (sum : int, xs : int list) = | |
if null xs then 0 | |
(*else if null (tl xs) then 1*) | |
else if hd xs > sum then 0 | |
else | |
let fun helper (i : int, partial_sum : int, tl_xs : int list) = | |
if partial_sum < 0 then i | |
else | |
helper(i + 1, partial_sum - hd tl_xs, tl tl_xs) | |
in |