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
############################################################################### | |
# 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
# 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
# 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
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
####################################################### | |
# 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
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
// Homework 1 | |
// Color to Greyscale Conversion | |
//A common way to represent color images is known as RGBA - the color | |
//is specified by how much Red, Grean and Blue is in it. | |
//The 'A' stands for Alpha and is used for transparency, it will be | |
//ignored in this homework. | |
//Each channel Red, Blue, Green and Alpha is represented by one byte. | |
//Since we are using one byte for each color there are 256 different |
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
#load @"..\packages\Deedle.0.9.12\Deedle.fsx" | |
#load @"..\packages\FSharp.Charting.0.90.5\FSharp.Charting.fsx" | |
// Please note that I had to use FSharp.Data.2.0.0-alpha as current stable version 1.1.10 | |
// has a bug in CSV provider that disallows to load from more than 2 sources in one execution | |
#r @"..\packages\FSharp.Data.2.0.0-alpha2\lib\net40\FSharp.Data.dll" | |
#r @"..\packages\MathNet.Numerics.FSharp.2.6.0\lib\net40\MathNet.Numerics.FSharp.dll" | |
#r @"..\packages\MathNet.Numerics.2.6.2\lib\net40\mathnet.numerics.dll" | |
open Deedle | |
open System |
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
#r @"\\psf\Home\Desktop\GitHub\eulersfsharp\src\Euler\bin\Debug\FSharp.Data.dll" | |
#r @"\\psf\Home\Desktop\GitHub\eulersfsharp\src\packages\MSDN.FSharpChart.dll.0.60\lib\MSDN.FSharpChart.dll" | |
#r "System.Windows.Forms.DataVisualization.dll" | |
open FSharp.Data | |
open MSDN.FSharp.Charting | |
open System.Windows.Forms | |
open System.Drawing | |
open System.Windows.Forms.DataVisualization.Charting |