Bonfire section
Reverse a string str:
str.split().reverse().join();
Factorialize a number:
{ | |
"id": "foo", | |
"name": "bar | |
"publisher": "baz | |
"compose": { | |
"include": [ | |
{ | |
"system": "urn:oid:2.16.840.1.113883.3.8.287.41", | |
"concept": [ | |
{ |
Bonfire section
Reverse a string str:
str.split().reverse().join();
Factorialize a number:
# launch R console from Mac Spotlight | |
# navigate to file directory | |
setwd("/Users/Tenorio/Desktop") | |
# load the file 'times.txt' in table format | |
counts <- read.table('times.txt') | |
# check if the file is read properly | |
# V1 is the default column name if no column title is specified |
C00002PMS | LILO-AN | |
---|---|---|
C00005PMS | LILO-AN | |
C00006PMS | LILO-AN | |
C00007PMS | TALIBON | |
C00008PMS | TALIBON | |
C00009PMS | TALIBON | |
C00010PMS | LAPU-LAPU | |
C00012PMS | LAPU-LAPU | |
C00013PMS | LILO-AN | |
C00015PMS | LAPU-LAPU |
C00006PMS | VOLUTIDAE | |
---|---|---|
C00006PMS | VOLUTIDAE | |
C00006PMS | VOLUTIDAE | |
C00017PMS | TURRIDAE | |
C00017PMS | TURRIDAE | |
C00017PMS | TURRIDAE | |
C00029PMS | TURRIDAE | |
C00034PMS | TURRIDAE | |
C00034PMS | TURRIDAE | |
C00034PMS | TURRIDAE |
The SQL dump was stolen from here and imported into MySQL.
!!! Strict | |
%html{:xmlns => 'http://www.w3.org/1999/xhtml'} | |
%head | |
%meta{'http-equip' => 'Content-Type', :content => 'text/html; charset=utf-8'} | |
%meta{:name => 'viewport', :content => 'widt=device-width, initial-scale=1.0'} | |
%title= subject | |
:css | |
/* Based on The MailChimp Reset INLINE: Yes. */ | |
/* Client-specific Styles */ | |
#outlook a {padding:0;} /* Force Outlook to provide a "view in browser" menu link. */ |
{ | |
"timeline": { | |
"headline": "Emily", | |
"type": "default", | |
"text": "A Timeline", | |
"startDate": "1922,10,30", | |
"date": [ | |
{ | |
"startDate": "2012,11,17", | |
"endDate": "2012,11,17", |
require 'net/http' | |
require 'xmlsimple' | |
url = "http://www.user-agents.org/allagents.xml" | |
xml_data = Net::HTTP.get_response(URI.parse(url)).body | |
data = XmlSimple.xml_in(xml_data) | |
agents = data['user-agent'].select{|agent| type = agent["Type"].first; type.include?("R") || type.include?("S")} | |
agent_names = agents.collect {|agent| agent["String"].first} |