This file contains hidden or 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
import pandas as pd | |
## dummy covariance matrix | |
cov = eye(2) + -.7 | |
fill_diagonal(cov, 1) | |
# a little bit of non correalted random variates | |
# also sometimes called the marginal distributions | |
n = 10000 |
This file contains hidden or 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
# Generate a Monte Carlo sample using Sobol' low-discrepancy quasi-random sequences | |
# James Keirstead | |
# 3 February 2012 | |
# | |
# Random sampling with R's standard methods is inefficient for Monte Carlo analysis as | |
# the sampled values do not cover the parameter space evenly. This Gist allows users | |
# to create parameter samples using Sobol' sequences to get around this problem. | |
# makeMCSample | |
# Makes a Monte Carlo sample using Sobol' sequences |
This file contains hidden or 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/python | |
import cgi | |
import requests | |
import json | |
from simple_salesforce import Salesforce | |
#login here: | |
#https://login.salesforce.com/services/oauth2/authorize?response_type=code&client_id=3MVG9A2kN3Bn17hsWsLDatw._IVMEUBoPKv.7ksp0tz7xLX4tWDVgyzwTCA7i_yTfP.qYuNOsSoPNcdVH6DuE&redirect_uri=http://localhost/cgi-bin/python/oauth.py |
This file contains hidden or 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
max_plots <- 5 | |
shinyServer(function(input, output) { | |
# Insert the right number of plot output objects into the web page | |
output$plots <- renderUI({ | |
plot_output_list <- lapply(1:input$n, function(i) { | |
plotname <- paste("plot", i, sep="") | |
plotOutput(plotname, height = 280, width = 250) | |
}) |
This file contains hidden or 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
#!/bin/sh | |
# download | |
wget http://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.20.4.zip | |
# unzip and start | |
unzip elasticsearch-0.20.4.zip | |
cd elasticsearch-0.20.4 | |
# remove data in case you have defined some analyzers in the past (e.g. stop/start) | |
rm -rf data/ |
This file contains hidden or 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
#################################################################### | |
# Simulated Annealing je Monte Carlo metoda, která vychází z | |
# fyzikálního pozorování - při kalení oceli je vhodné její | |
# teplotu snižovat postupně, protože molekuly při pomalém tuhnutí | |
# zaujímají prostorovou konfiguraci s minimální energetickou | |
# náročností vazeb - to se projevuje v pevnosti (a křehkosti kovu) | |
# annealing si půjčuje myšlenku, že postupným zkracováním | |
# vzdálenosti pátrače od dosud nejlepšího lokálního minima se | |
# velmi často dosáhne globálního minima, nebo alespoň minima, | |
# které je mu blízké. |