For the code below, if we want to select records have a field with colour = Red and length > 30...
<root>
<record id="1">
<field id="colour" value="Red" />
<field id="size" value="Small" />
<field id="length" value=25 />
</record>| ######################### | |
| # find and load packages | |
| ######################### | |
| install.packages(c("nnet","caret")) | |
| library(caret) | |
| ################### | |
| # Build neural net |
| s <- function(str) { | |
| require(stringr) | |
| require(magrittr) | |
| # helper functions | |
| get_vars <- function(str) str %>% str_extract_all("\\$[a-zA-Z0-9_\\.]+") %>% unlist %>% str_replace_all("\\$","") | |
| eval_var <- function(var) eval(parse(text = var))) | |
| add_token <- function(var) paste0("\\$", var) | |
| # The MIT License (MIT) | |
| # | |
| # Copyright (c) 2012 Schaun Jacob Wheeler | |
| # | |
| # Permission is hereby granted, free of charge, to any person obtaining a copy | |
| # of this software and associated documentation files (the "Software"), to deal | |
| # in the Software without restriction, including without limitation the rights | |
| # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| # copies of the Software, and to permit persons to whom the Software is | |
| # furnished to do so, subject to the following conditions: |
| xl_col_to_num <- function(column) { | |
| # calc value for a letter given its position i | |
| # eg for'CZ', C's contrib is 26^(1-1)*3 and Z's contrib is 26^(2-1)*26 | |
| calc_pos_val <- function(x,i) 26^(i-1) * which(LETTERS == x) | |
| # for a single column like 'CZ', calc each positional value and sum the total | |
| single_col <- function(x) calc_pos_val %>% mapply(x, rev(seq_along(x)) ) %>% sum() | |
| column %>% |
| # inspired by https://stackoverflow.com/questions/16782518/is-this-a-good-way-to-make-a-multi-dimensional-dictionary-in-r/16782745#16782745 | |
| # and http://broadcast.oreilly.com/2010/03/lookup-performance-in-r.html | |
| hash <- function( ) { | |
| new.env( hash = TRUE, parent = emptyenv() ) | |
| } | |
| set <- function(key, val, hash) { | |
| invisible(mapply(assign, key, val, MoreArgs = list(envir = hash))) | |
| } |
For the code below, if we want to select records have a field with colour = Red and length > 30...
<root>
<record id="1">
<field id="colour" value="Red" />
<field id="size" value="Small" />
<field id="length" value=25 />
</record>| ```{r, echo = FALSE} | |
| library(knitr) | |
| library(plyr) | |
| library(data.table) | |
| library(dplyr) | |
| gears <- mtcars$gear | |
| mtcars <- mtcars[,1:6] | |
| mtcars$gear <- gears |
Go to http://www.oracle.com/technetwork/topics/intel-macsoft-096467.html and look for something like this:
Instant Client Package - Basic: All files required to run OCI, OCCI, and JDBC-OCI applications Download instantclient-basic-macos.x64-11.2.0.4.0.zip (62,794,903 bytes)
Once the file is downloaded, follow the instructions at the bottom of the download page (reproduced below)