API Documentation, generated 2011-06-23T18:10:05+01:00
Actions : 7
Errors : 4
Output Types : 8
-- | |
-- Is there a better way to celebrate ones birthday than | |
-- generating an Ascii cake and some text-output wishin | |
-- happy birthday to the person I consider one of the most | |
-- important person in the history of automated computation. | |
-- | |
-- Note: | |
-- Compile with gcc after having installed GNAT (If on OSX) | |
-- $> gcc -c happybirthdayadatask.adb | |
-- $> gnatbl -o happybirthday happybirthdayadatask.ali |
#!/usr/bin/perl | |
############## | |
# udp flood. | |
############## | |
use Socket; | |
use strict; | |
my $argc = @ARGV + 1; |
$ ./sapi/cli/php -r 'print_r([1, 2, 3]);' | |
Array | |
( | |
[0] => 1 | |
[1] => 2 | |
[2] => 3 | |
) |
> x <- c(1,3,6,9,12) | |
> y <- c(1.5,2,7,8,15) | |
> plot(x,y) | |
*** caught segfault *** | |
address 0x0, cause 'memory not mapped' |
function [maxtab, mintab]=peakdet(v, delta, x) | |
%PEAKDET Detect peaks in a vector | |
% [MAXTAB, MINTAB] = PEAKDET(V, DELTA) finds the local | |
% maxima and minima ("peaks") in the vector V. | |
% MAXTAB and MINTAB consists of two columns. Column 1 | |
% contains indices in V, and column 2 the found values. | |
% | |
% With [MAXTAB, MINTAB] = PEAKDET(V, DELTA, X) the indices | |
% in MAXTAB and MINTAB are replaced with the corresponding | |
% X-values. |
Year Divided Unified D Unified R | |
1938 10 21 15 | |
1940 15 19 12 | |
1942 9 17 20 | |
1944 10 18 18 | |
1946 8 17 21 | |
1948 15 18 13 | |
1950 15 15 16 | |
1952 8 14 24 | |
1954 16 16 14 |
require(RColorBrewer) | |
require(ggplot2) | |
require(scales) | |
# Thanks to drew conway for this handy function. | |
get.stack<-function(tok) { | |
# Must check for XML install, thanks onertipaday! | |
if (!require(XML)) install.packages('XML') | |
library(XML) | |
# Enter a SO tag as character string, and number of tags are returned |
Often times when working with data in R
, you find yourself needing to summarise a data.frame by a column, a
SELECT SUM(..)
or SELECT COUNT(..)
in MySQL if you will.
For instance, you may have a lot of page-visits to analyse and you aren't quite certain how to summarise some
of that data using R
.
Let's consider the following (trivial) dataset:
Earlier today an interesting article about plotting the streets of france appeared in my feed. What Simon does in his blog post is essentially read OSM street-lines-data for France and displays it in what I find to be a rather traditional and elegant way.
The first thing I immediately though of was: "I'd love to see this for Ireland". As an OSX user, it took a few tricks to get the article replicated for Ireland therefore I've decided to share my notes.
Should you wish to replicate this for your country, here are some notes I've taken.