The book.
The author Ari Lerner is a Founder of FullStack. He also authored/co-authored:
He co-manages:
The book.
The author Ari Lerner is a Founder of FullStack. He also authored/co-authored:
He co-manages:
var ClientRouter = Backbone.Router.extend({ | |
routes: { | |
'404': 'notfound', | |
'500': 'error', | |
'auth': 'auth', | |
'authCallback?oauth_token=:oauth_token&oauth_verifier=:oauth_verifier': 'authCallback', | |
'': 'defaultRoute' | |
}, | |
defaultRoute: function() { |
# Function to get data over to PostgreSQL quickly and with minimal loss | |
# of information due to data type conversions. | |
# Note that I have had cases where the pipe() call returned an error due | |
# to lack of memory. So care should be taken with this function | |
dbWriteTable.fast <- function (conn,name,value,row.names=FALSE, | |
overwrite=TRUE,fix.names=TRUE) { | |
# Conform names to PostgreSQL requirements | |
pg.names <- make.db.names(conn,names(value)) | |
# www.analytikdat.cz | |
# www.analytikdat.cz/index.php/blog/entry/r-and-postgresql-using-rpostgresql-and-sqldf | |
# Load required libraries | |
library("RPostgreSQL") | |
library("sqldf") | |
# Establish connection | |
drv <- dbDriver("PostgreSQL") | |
# Simple version (localhost as default) |
####~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
### Cache (memoization) utilities | |
### | |
### Purpose | |
### * Functions to save the output of time consuming functions to memory and | |
### return results quickly if we already have the answers | |
### | |
### Notes: Standard usage would go like this | |
### FunctionName <- function(){ | |
### args <- c(as.list(environment()), list()) |
# R code for basic collocation statistics on a text corpus. | |
# Extracts LHS and RHS collocates of a word of interest | |
# over a user-defined span. Calculates frequency of | |
# collocates and mean distances. | |
examp1 <- "When discussing performance with colleagues, teaching, sending a bug report or | |
searching for guidance on mailing lists and here on SO, a reproducible example is often | |
asked and always helpful. What are your tips for creating an excellent example? How do | |
you paste data structures from r in a text format? What other information should you | |
include? Are there other tricks in addition to using dput(), dump() or structure()? |
/** | |
* This is a very simple example of an ember component to integrate | |
* nnick/chart.js in an ember.js application. Basically, it is simply | |
* using the components hook to create a ChartJS canvas element. | |
* Additionally, it supports an update property that allows you to | |
* let the chart re-rendet if your data or options change. Chart.js | |
* doesn't support updating its data so this will just create a new | |
* chart on the given canvas. | |
* | |
* Example usage in a handlebars template: |
package rgremlin; | |
import org.apache.tinkerpop.gremlin.driver.*; | |
import org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0; | |
import org.apache.tinkerpop.gremlin.structure.Element; | |
import org.apache.tinkerpop.gremlin.structure.Vertex; | |
import org.apache.tinkerpop.gremlin.structure.io.gryo.GryoMapper; | |
import org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry; | |
import org.json.simple.JSONObject; |
# get library path | |
lib <- .libPaths()[1] | |
# does it end in 3.3? | |
if (grepl("*3.3",lib)) { | |
# if yes then assume old library is same place with 3.2 instead | |
oldlib <- gsub("*3.3","3.2",lib) | |
} | |
# check that old library exists |
# Homework 1 - Part 1 | |
def palindrome?(string) | |
string = string.downcase.gsub(/\W/, '') | |
string == string.reverse | |
end | |
def count_words(string) | |
Hash[ | |
string.downcase.scan(/\w+/). | |
group_by{|s| s}. |