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
pollutantmean <- function(directory, pollutant, id = 1:332) { | |
files <- list.files(directory, full.names=T) | |
frame <- read.csv(files[1]) | |
#for(file in files[2:3]) { # XXX DELETE ME | |
for(file in files[2:length(files)]) { | |
frame <- rbind(read.csv(file), frame) | |
} | |
#frame <- frame[1:1000,] # XXX delete me!! |
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
bool is_palindrome(ullong n) | |
{ | |
char s[ULLONG_MAX_DIGITS+1]; | |
sprintf(s, "%i", n); | |
if(strlen(s) == 1) | |
{ | |
return true; | |
} | |
else if(strlen(s) == 2) |
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
bool is_palindrome(ullong n) | |
{ | |
char s[ULLONG_MAX_DIGITS+1]; | |
sprintf(s, "%i", n); | |
if(strlen(s) == 1) | |
{ | |
return true; | |
} | |
else if(strlen(s) == 2) |
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 'json' | |
require 'open-uri' | |
module EnglishToNorwegian | |
def self.translate(str) | |
JSON.parse(open("http://translate.google.com/translate_a/t?client=t&text=#{URI.escape(str)}&hl=en&sl=en&tl=no&ie=UTF-8&oe=UTF-8&multires=1&prev=btn&ssel=4&tsel=4&sc=1").read.gsub(/\,+/, ","))[0].collect{|a| a[0]}.join " " | |
end | |
end |
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 'json' | |
require 'open-uri' | |
module EnglishToNorwegian | |
def self.translate(str) | |
JSON.parse(open("http://translate.google.com/translate_a/t?client=t&text=#{URI.escape(str)}&hl=en&sl=en&tl=no&ie=UTF-8&oe=UTF-8&multires=1&prev=btn&ssel=4&tsel=4&sc=1").read.gsub(/\,+/, ","))[0].collect{|a| a[1]}.join " " | |
end | |
end |
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 'json' | |
require 'open-uri' | |
module EnglishToNorwegian | |
def self.translate(str) | |
JSON.parse(open("http://translate.google.com/translate_a/t?client=t&text=#{URI.escape(str)}&hl=en&sl=en&tl=no&ie=UTF-8&oe=UTF-8&multires=1&prev=btn&ssel=4&tsel=4&sc=1").read.gsub(/\,+/, ","))[0][0][0] | |
end | |
end |
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 | |
(module main racket) | |
(define spade #\♠) | |
(define heart #\♥) | |
(define diamond #\♦) | |
(define club #\♣) | |
(define suits (list spade heart diamond club)) | |
(define (card->value card) | |
(let ([id (car card)]) | |
(case id |
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/perl | |
use File::Basename qw(dirname); | |
sub path { dirname(__FILE__)."/$_[0]"; } | |
use lib path('lib'); | |
use POSIX qw(strftime); | |
use DBI; | |
use Mojo::DOM; | |
use URI::Escape qw(uri_unescape); | |
use HTML::Entities qw(encode_entities); | |
use strict; |
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 buffer is for notes you don't want to save, and for Lisp evaluation. | |
;; If you want to create a file, visit that file with C-x C-f, | |
;; then enter the text in that file's own buffer. | |
'http://piratepad.net/0B2HW6v4dZ' |
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
$ buildr run |
NewerOlder