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
## working strongly typed version | |
# function incr(d::Dict{String,Float64},k::String,v::Float64) | |
# if haskey(d,k) | |
# if (d[k] += v)==0 | |
# delete!(d, k) | |
# end | |
# else | |
# d[k] = v | |
# end | |
# end |
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
// [[Rcpp::export]] | |
Rcpp::List fieldInfo_Impl(SEXP con_, std::vector<std::string> fields) { | |
Session* session = | |
reinterpret_cast<Session*>(checkExternalPointer(con_, "blpapi::Session*")); | |
// get the field info | |
std::vector<FieldInfo> fldinfos(getFieldTypes(session, fields)); | |
std::vector<std::string> colnames {"id","mnemonic","datatype","ftype"}; | |
std::vector<RblpapiT> res_types(4,RblpapiT::String); |
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
tickers <- c("ATVI UW Equity","ADBE UW Equity","AKAM UW Equity","ALXN UW Equity","ALTR UW Equity","AMZN UW Equity","AMGN UW Equity","APOL UW Equity","AAPL UW Equity","AMAT UW Equity","ADSK UW Equity","ADP UW Equity","AVGO UW Equity","BIDU UW Equity","BBBY UW Equity","BIIB UW Equity","BMC UW Equity","BRCM UW Equity","CA UW Equity","CELG UW Equity","CERN UW Equity","CHRW UW Equity","CHKP UW Equity","CSCO UW Equity","CTXS UW Equity","CTSH UW Equity","CMCSA UW Equity","COST UW Equity","DELL UW Equity","XRAY UW Equity","DTV UW Equity","DLTR UW Equity","EBAY UW Equity","EA UW Equity","EXPE UW Equity","EXPD UW Equity","ESRX UW Equity","FFIV UW Equity","FAST UW Equity","FISV UW Equity","FLEX UW Equity","FOSL UW Equity","GRMN UW Equity","GILD UW Equity","GOOG UW Equity","GMCR UW Equity","HSIC UW Equity","INFY UW Equity","INTC UW Equity","INTU UW Equity","ISRG UW Equity","KLAC UW Equity","MDLZ US Equity","LRCX UW Equity","LINTA UW Equity","LIFE UW Equity","LLTC UW Equity","MRVL UW Equity","MAT UW Equity","MXIM UW Equit |
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
/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ | |
#include <iostream> | |
#include <vector> | |
#include <ql/quantlib.hpp> | |
using namespace QuantLib; | |
int main() { | |
Date todaysDate(10, Feb, 2014); | |
Settings::instance().evaluationDate() = todaysDate; |
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
library(AWS.tools) | |
library(rzmq) | |
estimatePi <- function(seed) { | |
set.seed(seed) | |
numDraws <- 1e6 | |
r <- .5 | |
x <- runif(numDraws, min=-r, max=r) |