Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
"""Kernel K-means""" | |
# Author: Mathieu Blondel <mathieu@mblondel.org> | |
# License: BSD 3 clause | |
import numpy as np | |
from sklearn.base import BaseEstimator, ClusterMixin | |
from sklearn.metrics.pairwise import pairwise_kernels | |
from sklearn.utils import check_random_state |
require(inline) | |
require(RcppArmadillo) | |
## extract cosine similarity between columns | |
cosine <- function(x) { | |
y <- t(x) %*% x | |
res <- 1 - y / (sqrt(diag(y)) %*% t(sqrt(diag(y)))) | |
return(res) | |
} |
This post examines the features of [R Markdown](http://www.rstudio.org/docs/authoring/using_markdown) | |
using [knitr](http://yihui.name/knitr/) in Rstudio 0.96. | |
This combination of tools provides an exciting improvement in usability for | |
[reproducible analysis](http://stats.stackexchange.com/a/15006/183). | |
Specifically, this post | |
(1) discusses getting started with R Markdown and `knitr` in Rstudio 0.96; | |
(2) provides a basic example of producing console output and plots using R Markdown; | |
(3) highlights several code chunk options such as caching and controlling how input and output is displayed; | |
(4) demonstrates use of standard Markdown notation as well as the extended features of formulas and tables; and | |
(5) discusses the implications of R Markdown. |
#!/usr/bin/env python | |
# | |
# To run, first set this environment variable to point to the Evernote API python bindings you downloaded from Evernote: | |
# export PYTHONPATH=/path/to/evernote/python/api | |
# | |
import sys | |
import hashlib | |
import time | |
import thrift.protocol.TBinaryProtocol as TBinaryProtocol |
license: gpl-3.0 | |
redirect: https://observablehq.com/@d3/d3-color-schemes |
doInstall <- TRUE | |
toInstall <- c("alphahull") | |
if(doInstall){install.packages(toInstall, repos = "http://cran.us.r-project.org")} | |
lapply(toInstall, library, character.only = TRUE) | |
# Generate some sample data: | |
myData <- data.frame(x = rnorm(500), y = rnorm(500)) | |
# With a unit-circle hole in the center: | |
myData <- myData[sqrt(rowSums(myData^2)) > 1, ] | |
plot(myData) |
# the code uses 'facebook' function from the previous gist (https://gist.github.com/1634662) or | |
# see the original http://romainfrancois.blog.free.fr/index.php?post/2012/01/15/Crawling-facebook-with-R | |
# scrape the list of friends | |
friends <- facebook( path="me/friends" , access_token=access_token) | |
# extract Facebook IDs | |
friends.id <- sapply(friends$data, function(x) x$id) | |
# extract names | |
friends.name <- sapply(friends$data, function(x) iconv(x$name,"UTF-8","ASCII//TRANSLIT")) | |
# short names to initials |
//Demonstrates basic manipulation to predict a EI-MS in Bioclipse using | |
//a sdf file containing a list of molecule. | |
//Requires medea data installed in default location | |
var mols = cdk.loadMolecules("/Sample Data/SDFfiles/CAS.5.sdf"); | |
for (var i = 0; i < mols.size(); i++) { | |
var mol = mols.get(i); | |
mol = cdk.generate2dCoordinates(mol); | |
ui.open(mol); | |
cmlSpectrum = medea.predictMassSpectrum(mol) |
license: gpl-3.0 | |
redirect: https://observablehq.com/@d3/d3-horizon-chart |