Packing C++ with R Advanced Statistical Programming Camp

Size: px
Start display at page:

Download "Packing C++ with R Advanced Statistical Programming Camp"

Transcription

1 Introduction This note documents the transition from creating R functions from C++ code via Rcpp helper functions to creating R functions by building and installing an R package. In both cases, many of low-level details (e.g. compiling C++ code, linking binary files, and loading shared library objects into R) are handled for us. This is a good thing. However, the R package approach is more flexible and powerful than what we can do with evalcpp(), cppfunction(), or sourcecpp(). By the end of this note, we will have created an R package that provides an R function interface to our C++ code for running a linear regression. Getting Started Recall from the sessions our use of sourcecpp() to pass a snippet of C++ code through Rcpp s helper functions. In particular, we used sourcecpp(file = "bootstrap_functions.cpp") which would lead to the Rcpp R package reading from the C++ snippet file. It would create a valid C++ file, compile, link, load the shared library, and then create the appropriate R functions. 1 // [[ Rcpp :: depends ( RcppArmadillo )]] /* this is called an Rcpp attribute, it is a comment from the perspective of C++, but sourcecpp () knows to look at them 6 and act in a certain way when it sees 7 them 8 9 the intervention here is making sure the 10 RcppArmadillo.h file can be found 11 */ 1 1 # include <RcppArmadillo.h> 1 # include <RcppArmadilloExtensions / sample.h> 1 16 using namespace Rcpp ; // // [[ Rcpp :: export ]] /* this intervention is make a corresponding runreg R function visible */ 6 7 Rcpp :: NumericVector runreg ( NumericMatrix Y, NumericMatrix X) { 8 arma :: mat y = as < arma :: mat >(Y) ; 9 arma :: mat x = as < arma :: mat >(X) ; 0 arma :: mat tmp1 ; 1 tmp1 = inv (x.t() * x) ; arma :: mat tmp = x.t() * y ; arma :: mat betahat = tmp1 * tmp ; NumericVector Betahat (X. cols ()) ; for ( int i = 0; i < X. cols () ; i++) { 6 Betahat (i) = betahat (i) ; 7 } 8 return Betahat ; /* We are returning a C++ class defined by the Rcpp 9 C++ code 0 */ 1 } // // [[ Rcpp :: export ]] 7 Rcpp :: List getbsdata ( NumericMatrix Y, NumericMatrix X) { 8 int N = Y. nrow () ; 9 IntegerVector indices = seq_len (N) - 1 ; 0 1 // // Draw a sample from sampling frame IntegerVector indices = indices ; indices = RcppArmadillo :: sample ( indices, N, 6 TRUE, 7 NumericVector :: create () 1

2 8 ) ; /* looks and behaves like 9 the sample () in R 60 */ 61 6 // 6 // 6 6 // 66 // Construct BS Data based on sampling from sampling frame. 67 arma :: mat Ybs (as <arma :: mat >( Y)) ; // BS Sample Y 68 arma :: mat Xbs (as <arma :: mat >( X)) ; // BS Sample X 69 for ( int r = 0; r < N ; r ++) { 70 // note, Xbs [1, ] == X[ indices [1], ] 71 // Xbs [r, ] == X[ indices [r], ] 7 // and note that the above brackets are R style and not valid C++ 7 Ybs. row (r) = (as <arma :: mat >( Y)). row ( indices (r)) ; 7 Xbs. row (r) = (as <arma :: mat >( X)). row ( indices (r)) ; 7 } 76 // 77 // return Rcpp :: List :: create (_["Y"] = wrap ( Ybs ), 80 _["X"] = wrap ( Xbs ) /* single quotes are 81 for single char chars only 8 */ 8 ) ; 8 } 8 86 // // [[ Rcpp :: export ]] NumericMatrix runbs ( NumericMatrix YY, NumericMatrix XX, int M) { 9 arma :: mat betas (M, XX. ncol ()) ; // an arm :: mat b/c of the member functions 9 betas. fill (0) ; 9 9 arma :: mat tmpbeta (M, XX. nrow ()) ; 96 List tmpdata ; 97 for ( int m = 0 ; m < M ; m ++) { 98 tmpdata = getbsdata (YY, XX) ; 99 tmpbeta = runreg ( tmpdata ["Y"], tmpdata ["X"]) ; 100 /* extract 101 elements from list in 10 R- ish fashion 10 */ 10 betas. row (m) = tmpbeta.t() ; 10 /* be careful with what 106 runreg did to tmpbeta 107 */ /* if we really wanted to 110 optimize this code, we 111 would access columns only more efficient. 11 */ 11 } 11 return as < NumericMatrix >( wrap ( betas )) ; 116 }./bootstrap_functions.cpp We can control which C++ functions generate corresponding R functions by using the // [[ Rcpp :: export ]] directive. From the perspective of C++ code, this is just a comment, but the Rcpp helper functions look for these to determine the C++ code they generate based on the snippet we write. As it stands, bootstrap_functions.cpp creates three R function and these R functions have names in R that are identical to the names in C++. Creating a Minimal R Package R has long had a package.skeleton() function which creates a minimal working package. Although the created package does not provide any useful functionality, it sets up the structure of the files inside the toplevel directory automatically. It even populates some of them with useful default values and helpful hints. If we were going to be using just the C++ code provided by Rcpp (i.e. # include <Rcpp.h>, we d only need

3 to use the Rcpp.package.skeleton() function. However, because we will use the Armadillo C++ code and access it by using the RcppArmadillo package, we will use RcppArmadillo.package.skeleton(). At a minimum, we should call this function with a package name and a path where R should set up this dummy package. For example, one might use RcppArmadillo.package.skeleton(package="RcppLM", path="~/desktop"). Of course, the path argument should be a character string to a valid location on the machine it is being run on. After running this R function, navigate to the directory for this package that was created. The contents are: man (a directory for help files) R (a directory for R code) src (a directory for code to be compiled) DESCRIPTION NAMESPACE Read-and-delete-me Before using or distributing an R package, you should check its validity. This can be done with R CMD check RcppLM (in our case). As it stands, this package won t succeed and we will make a small change to rectify this. Open the only Rd file in the man directory. The contents of \examples{} must be valid R code. Clearly this isn t the case. Go ahead and add # at the beginning of the line. Save the changes. This package, though it does nothing useful, will now check successfully. Creating R Functions Create an R script in the R sub-directory of the package directory. It can be named anything, but we ll want to use a name that will be meaningful for us. For now, we can create a file runreg.r because we ll define the R function runreg in it. For now, we can put the following contents in this file: 1 runreg.r <- function (Y, X){ ##. Call ( " runreg ", as. matrix (Y), as. matrix (X), PACKAGE = " RcppLM ") } Ultimately, we will uncomment the.call line. However, that code presently would not work (without the comment) given that we haven t defined any functions that we can access from a shared library object names "runreg". Creating C++ Functions There are two kinds of C++ functions we will create. The first corresponds to the C++ functions we were writing in our C++ snippets like bootstrap_functions.cpp. These take C++ class arguments and map to C++ class return values. We can create the file runreg.cpp in the src subdirectoy. 1 # include <RcppArmadillo.h> using namespace Rcpp ; Rcpp :: NumericVector runreg ( NumericMatrix Y, NumericMatrix X) { 6 arma :: mat y = as < arma :: mat >(Y) ; 7 arma :: mat x = as < arma :: mat >(X) ; 8 arma :: mat tmp1 ; 9 tmp1 = inv (x.t() * x) ; 10 arma :: mat tmp = x.t() * y ; 11 arma :: mat betahat = tmp1 * tmp ; 1 NumericVector Betahat (X. cols ()) ; 1 for ( int i = 0; i < X. cols () ; i++) { 1 Betahat (i) = betahat (i) ;

4 1 } 16 return Betahat ; /* We are returning a C++ class defined by the Rcpp 17 C++ code 18 */ 19 }./RcppLM/src/runReg.cpp This is simply our code to calculate the regression coefficients using the linear algebra expression (X X) 1 X y. The function is declared such that it will return NumericVector output, and we can see that this is the actual class of Betahat. After creating this file, we can check the R package. It will pass. However, still, nothing useful is done and while we have defined an R function and a C++ function, they are not connected in any way. Creating R-callable C++ Functions One of the steps that the Rcpp helper functions performed for us invisibly is the creation of C++ functions which are actually callable from R. The C++ function we ve written so far which provide our useful functionality are not. And, while it isn t required, we will walk through the process of creating an R-callable C++ function that subsequently calls a C++ function instead of making the C++ function runreg callable from R. R-callable C++ functions are a bit different than what we ve seen so far. Their arguments are all of the class SEXP and their output is of the class SEXP. The way we achieve this is no different from other classes, however. Additionally, we must include RcppExport at the beginning of the declaration. We can create the file _runreg.cpp in the src subdirectoy with the following contents. 1 // # include " runreg.h" using namespace Rcpp ; RcppExport SEXP _ runreg ( SEXP Y, SEXP X) { 6 NumericMatrix y = as < NumericMatrix >( Y) ; 7 NumericMatrix x = as < NumericMatrix >( X) ; 8 NumericVector output ; 9 // output = runreg (y, x) ; 10 return wrap ( output ) ; 11 } In this case, we are just using an underscore to indicate that this is a wrapper around C++ code to be accessed in R. Notice that two lines are commented out. Commenting these out allows us to check that the package we ve made so far is valid. Still, no useful functionality has been provided. Before we can have _runreg (the wrapper function) call runreg (the function doing computation), we must define a local header. This will tell the compiler what runreg looks like before it goes and finds the full definition. Still, _runreg is a valid (but useless) C++ function. Because it is now defined, we can update our R function definition to the following: 1 runreg.r <- function (Y, X){. Call ( "_ runreg ", as. matrix (Y), as. matrix (X), PACKAGE = " RcppLM ") }./RcppLM/R/runReg.R Be careful to.call the C++ function _runreg, it is callable..call-ing the C++ function runreg will, on the other hand, throw an error. It is not callable. Creating Local Headers to Bridge R Functions Our _runreg C++ function must ultimately call our runreg C++ function. However, we d get an error about runreg being undefined in the current scope if we tried to compile the package without commenting

5 out the output=runreg(y,x) line. Although runreg is defined in another file, we have to explicitly provide a summary of that definition. We do that by using a local header. Here, we create the following runreg.h in the src directory. 1 # ifndef _ RcppLM _ RUNREG _H # define _ RcppLM _ RUNREG _H # include <RcppArmadillo.h> 6 using namespace Rcpp ; 7 8 NumericVector runreg ( NumericMatrix Y, NumericMatrix X) ; 9 10 # endif./rcpplm/src/runreg.h This gives us access to the signature of the function the types and classes of inputs and outputs. In order to check the basic structure of our _runreg() function, this is all we need. The pre-processor directives #ifndef,#define, and #endif, ensure that we only provide the signature once. 1 In practice we will need to do this for other functions, but the structure is the same. We would just have to change _RcppLM_RUNREG_H to a different name and update the function for whatever we needed. Now that we have this header file, we can #include it in _runreg.cpp and uncomment our use of runreg(). After this, its contents are as follows: 1 # include <RcppArmadillo.h> # include " runreg.h" using namespace Rcpp ; 6 RcppExport SEXP _ runreg ( SEXP Y, SEXP X) { 7 NumericMatrix y = as < NumericMatrix >( Y) ; 8 NumericMatrix x = as < NumericMatrix >( X) ; 9 NumericVector output ; 10 output = runreg (y, x) ; 11 return wrap ( output ) ; 1 }./RcppLM/src/_runReg.cpp Finishing Touches This note walked through the inclusion of a single C++ function into an R package. In order to access the functionality we coded in C++ in R, we had to wrap it in another C++ function that was R-callable and then create the R function which actually did the calling. For actual work, there is more work to do in creating a package: writing documentation, writing unit-tests, and writing vignettes. However, as our package stands, it checks. And, after we install it, we can test it. user@machine$ Rscript -e "library(rcpplm); runreg.r(rnorm(), rnorm())" Loading required package: Rcpp Loading required package: RcppArmadillo [1] These are called header guards or includes guards. See for all of this.

Storage Classes CS 110B - Rule Storage Classes Page 18-1 \handouts\storclas

Storage Classes CS 110B - Rule Storage Classes Page 18-1 \handouts\storclas CS 110B - Rule Storage Classes Page 18-1 Attributes are distinctive features of a variable. Data type, int or double for example, is an attribute. Storage class is another attribute. There are four storage

More information

Advanced Tornado TWENTYONE. 21.1 Advanced Tornado. 21.2 Accessing MySQL from Python LAB

Advanced Tornado TWENTYONE. 21.1 Advanced Tornado. 21.2 Accessing MySQL from Python LAB 21.1 Advanced Tornado Advanced Tornado One of the main reasons we might want to use a web framework like Tornado is that they hide a lot of the boilerplate stuff that we don t really care about, like escaping

More information

Distribute your R code with R package

Distribute your R code with R package Distribute your R code with R package Feng Li feng.li@cufe.edu.cn School of Statistics and Mathematics Central University of Finance and Economics June 2, 2014 Revision: June 2, 2014 Today we are going

More information

Hypercosm. Studio. www.hypercosm.com

Hypercosm. Studio. www.hypercosm.com Hypercosm Studio www.hypercosm.com Hypercosm Studio Guide 3 Revision: November 2005 Copyright 2005 Hypercosm LLC All rights reserved. Hypercosm, OMAR, Hypercosm 3D Player, and Hypercosm Studio are trademarks

More information

An Incomplete C++ Primer. University of Wyoming MA 5310

An Incomplete C++ Primer. University of Wyoming MA 5310 An Incomplete C++ Primer University of Wyoming MA 5310 Professor Craig C. Douglas http://www.mgnet.org/~douglas/classes/na-sc/notes/c++primer.pdf C++ is a legacy programming language, as is other languages

More information

Netbeans IDE Tutorial for using the Weka API

Netbeans IDE Tutorial for using the Weka API Netbeans IDE Tutorial for using the Weka API Kevin Amaral University of Massachusetts Boston First, download Netbeans packaged with the JDK from Oracle. http://www.oracle.com/technetwork/java/javase/downloads/jdk-7-netbeans-download-

More information

Lazy OpenCV installation and use with Visual Studio

Lazy OpenCV installation and use with Visual Studio Lazy OpenCV installation and use with Visual Studio Overview This tutorial will walk you through: How to install OpenCV on Windows, both: The pre-built version (useful if you won t be modifying the OpenCV

More information

To reduce or not to reduce, that is the question

To reduce or not to reduce, that is the question To reduce or not to reduce, that is the question 1 Running jobs on the Hadoop cluster For part 1 of assignment 8, you should have gotten the word counting example from class compiling. To start with, let

More information

Week 2 Practical Objects and Turtles

Week 2 Practical Objects and Turtles Week 2 Practical Objects and Turtles Aims and Objectives Your aim in this practical is: to practise the creation and use of objects in Java By the end of this practical you should be able to: create objects

More information

Exposing C++ functions and classes with Rcpp modules

Exposing C++ functions and classes with Rcpp modules Exposing C++ functions and classes with Rcpp modules Dirk Eddelbuettel Romain François Rcpp version 0.11.5 as of March 4, 2015 Abstract This note discusses Rcpp modules. Rcpp modules allow programmers

More information

Writing R packages. Tools for Reproducible Research. Karl Broman. Biostatistics & Medical Informatics, UW Madison

Writing R packages. Tools for Reproducible Research. Karl Broman. Biostatistics & Medical Informatics, UW Madison Writing R packages Tools for Reproducible Research Karl Broman Biostatistics & Medical Informatics, UW Madison kbroman.org github.com/kbroman @kwbroman Course web: kbroman.org/tools4rr R packages and the

More information

1 Abstract Data Types Information Hiding

1 Abstract Data Types Information Hiding 1 1 Abstract Data Types Information Hiding 1.1 Data Types Data types are an integral part of every programming language. ANSI-C has int, double and char to name just a few. Programmers are rarely content

More information

C++ INTERVIEW QUESTIONS

C++ INTERVIEW QUESTIONS C++ INTERVIEW QUESTIONS http://www.tutorialspoint.com/cplusplus/cpp_interview_questions.htm Copyright tutorialspoint.com Dear readers, these C++ Interview Questions have been designed specially to get

More information

Basics of I/O Streams and File I/O

Basics of I/O Streams and File I/O Basics of This is like a cheat sheet for file I/O in C++. It summarizes the steps you must take to do basic I/O to and from files, with only a tiny bit of explanation. It is not a replacement for reading

More information

How To Port A Program To Dynamic C (C) (C-Based) (Program) (For A Non Portable Program) (Un Portable) (Permanent) (Non Portable) C-Based (Programs) (Powerpoint)

How To Port A Program To Dynamic C (C) (C-Based) (Program) (For A Non Portable Program) (Un Portable) (Permanent) (Non Portable) C-Based (Programs) (Powerpoint) TN203 Porting a Program to Dynamic C Introduction Dynamic C has a number of improvements and differences compared to many other C compiler systems. This application note gives instructions and suggestions

More information

Chapter 13 - The Preprocessor

Chapter 13 - The Preprocessor Chapter 13 - The Preprocessor Outline 13.1 Introduction 13.2 The#include Preprocessor Directive 13.3 The#define Preprocessor Directive: Symbolic Constants 13.4 The#define Preprocessor Directive: Macros

More information

Xcode Project Management Guide. (Legacy)

Xcode Project Management Guide. (Legacy) Xcode Project Management Guide (Legacy) Contents Introduction 10 Organization of This Document 10 See Also 11 Part I: Project Organization 12 Overview of an Xcode Project 13 Components of an Xcode Project

More information

Creating a Java application using Perfect Developer and the Java Develo...

Creating a Java application using Perfect Developer and the Java Develo... 1 of 10 15/02/2010 17:41 Creating a Java application using Perfect Developer and the Java Development Kit Introduction Perfect Developer has the facility to execute pre- and post-build steps whenever the

More information

ArcGIS Tutorial: Adding Attribute Data

ArcGIS Tutorial: Adding Attribute Data ArcGIS Tutorial: Adding Attribute Data Introduction A common need in GIS is to map characteristics, or attributes, of different geographic areas. These maps are called thematic maps. Examples of thematic

More information

Introduction to the data.table package in R

Introduction to the data.table package in R Introduction to the data.table package in R Revised: September 18, 2015 (A later revision may be available on the homepage) Introduction This vignette is aimed at those who are already familiar with creating

More information

CDD user guide. PsN 4.4.8. Revised 2015-02-23

CDD user guide. PsN 4.4.8. Revised 2015-02-23 CDD user guide PsN 4.4.8 Revised 2015-02-23 1 Introduction The Case Deletions Diagnostics (CDD) algorithm is a tool primarily used to identify influential components of the dataset, usually individuals.

More information

Coding conventions and C++-style

Coding conventions and C++-style Chapter 1 Coding conventions and C++-style This document provides an overview of the general coding conventions that are used throughout oomph-lib. Knowledge of these conventions will greatly facilitate

More information

0.8 Rational Expressions and Equations

0.8 Rational Expressions and Equations 96 Prerequisites 0.8 Rational Expressions and Equations We now turn our attention to rational expressions - that is, algebraic fractions - and equations which contain them. The reader is encouraged to

More information

Configuring CitectSCADA SNMP projects with MIB2CIT. A reference for CitectSCADA Customers

Configuring CitectSCADA SNMP projects with MIB2CIT. A reference for CitectSCADA Customers Configuring CitectSCADA SNMP projects with MIB2CIT A reference for CitectSCADA Customers support@citect.com Revision 1.00 Created 28-12-2009 Document revision history Please update this table whenever

More information

How To Write Portable Programs In C

How To Write Portable Programs In C Writing Portable Programs COS 217 1 Goals of Today s Class Writing portable programs in C Sources of heterogeneity Data types, evaluation order, byte order, char set, Reading period and final exam Important

More information

5 Correlation and Data Exploration

5 Correlation and Data Exploration 5 Correlation and Data Exploration Correlation In Unit 3, we did some correlation analyses of data from studies related to the acquisition order and acquisition difficulty of English morphemes by both

More information

HTML Form Widgets. Review: HTML Forms. Review: CGI Programs

HTML Form Widgets. Review: HTML Forms. Review: CGI Programs HTML Form Widgets Review: HTML Forms HTML forms are used to create web pages that accept user input Forms allow the user to communicate information back to the web server Forms allow web servers to generate

More information

Creating a Simple Macro

Creating a Simple Macro 28 Creating a Simple Macro What Is a Macro?, 28-2 Terminology: three types of macros The Structure of a Simple Macro, 28-2 GMACRO and ENDMACRO, Template, Body of the macro Example of a Simple Macro, 28-4

More information

Introduction to ROOT and data analysis

Introduction to ROOT and data analysis Introduction to ROOT and data analysis What is ROOT? Widely used in the online/offline data analyses in particle and nuclear physics Developed for the LHC experiments in CERN (root.cern.ch) Based on Object

More information

VLOOKUP Functions How do I?

VLOOKUP Functions How do I? For Adviser use only (Not to be relied on by anyone else) Once you ve produced your ISA subscription report and client listings report you then use the VLOOKUP to create all the information you need into

More information

WebPublish User s Manual

WebPublish User s Manual WebPublish User s Manual Documentation for WebPublish Version 0.1.0. Charles Henry Schoonover i Table of Contents 1 Introduction............................... 1 2 Installation................................

More information

Printing. Jason Healy, Director of Networks and Systems

Printing. Jason Healy, Director of Networks and Systems Printing Jason Healy, Director of Networks and Systems Last Updated Mar 18, 2008 2 Contents 1 Printing 5 1.1 Introduction.............................. 5 1.2 Printing Overview..........................

More information

MS ACCESS DATABASE DATA TYPES

MS ACCESS DATABASE DATA TYPES MS ACCESS DATABASE DATA TYPES Data Type Use For Size Text Memo Number Text or combinations of text and numbers, such as addresses. Also numbers that do not require calculations, such as phone numbers,

More information

SimbaEngine SDK 9.4. Build a C++ ODBC Driver for SQL-Based Data Sources in 5 Days. Last Revised: October 2014. Simba Technologies Inc.

SimbaEngine SDK 9.4. Build a C++ ODBC Driver for SQL-Based Data Sources in 5 Days. Last Revised: October 2014. Simba Technologies Inc. Build a C++ ODBC Driver for SQL-Based Data Sources in 5 Days Last Revised: October 2014 Simba Technologies Inc. Copyright 2014 Simba Technologies Inc. All Rights Reserved. Information in this document

More information

Step by Step Tutorial to creating R Packages. Heng Wang Michigan State University

Step by Step Tutorial to creating R Packages. Heng Wang Michigan State University Step by Step Tutorial to creating R Packages Heng Wang Michigan State University Introduction R is an open source statistical software R provides functions to perform statistical operations o Classical

More information

Sources: On the Web: Slides will be available on:

Sources: On the Web: Slides will be available on: C programming Introduction The basics of algorithms Structure of a C code, compilation step Constant, variable type, variable scope Expression and operators: assignment, arithmetic operators, comparison,

More information

sqlite driver manual

sqlite driver manual sqlite driver manual A libdbi driver using the SQLite embedded database engine Markus Hoenicka mhoenicka@users.sourceforge.net sqlite driver manual: A libdbi driver using the SQLite embedded database engine

More information

Rweb: Web-based Statistical Analysis

Rweb: Web-based Statistical Analysis Rweb: Web-based Statistical Analysis Jeff Banfield Department of Mathematical Science Montana State University Bozeman, MT 59717 Abstract Rweb is a freely accessible statistical analysis environment that

More information

Illustration 1: Diagram of program function and data flow

Illustration 1: Diagram of program function and data flow The contract called for creation of a random access database of plumbing shops within the near perimeter of FIU Engineering school. The database features a rating number from 1-10 to offer a guideline

More information

PloneSurvey User Guide (draft 3)

PloneSurvey User Guide (draft 3) - 1 - PloneSurvey User Guide (draft 3) This short document will hopefully contain enough information to allow people to begin creating simple surveys using the new Plone online survey tool. Caveat PloneSurvey

More information

Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science

Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science 6.035, Spring 2013 Handout Scanner-Parser Project Thursday, Feb 7 DUE: Wednesday, Feb 20, 9:00 pm This project

More information

Object systems available in R. Why use classes? Information hiding. Statistics 771. R Object Systems Managing R Projects Creating R Packages

Object systems available in R. Why use classes? Information hiding. Statistics 771. R Object Systems Managing R Projects Creating R Packages Object systems available in R Statistics 771 R Object Systems Managing R Projects Creating R Packages Douglas Bates R has two object systems available, known informally as the S3 and the S4 systems. S3

More information

Programming Exercise 3: Multi-class Classification and Neural Networks

Programming Exercise 3: Multi-class Classification and Neural Networks Programming Exercise 3: Multi-class Classification and Neural Networks Machine Learning November 4, 2011 Introduction In this exercise, you will implement one-vs-all logistic regression and neural networks

More information

Chapter 19: XML. Working with XML. About XML

Chapter 19: XML. Working with XML. About XML 504 Chapter 19: XML Adobe InDesign CS3 is one of many applications that can produce and use XML. After you tag content in an InDesign file, you save and export the file as XML so that it can be repurposed

More information

Lecture 5: Java Fundamentals III

Lecture 5: Java Fundamentals III Lecture 5: Java Fundamentals III School of Science and Technology The University of New England Trimester 2 2015 Lecture 5: Java Fundamentals III - Operators Reading: Finish reading Chapter 2 of the 2nd

More information

Brian Caffo. Using.Call in R

Brian Caffo. Using.Call in R Brian Caffo Using.Call in R R s.call Interface to C.Call is a suped up version of.c Pass R objects to C Create R objects in C Manipulate R objects in C Return R objects from C Call R functions from C The

More information

Name: Class: Date: 9. The compiler ignores all comments they are there strictly for the convenience of anyone reading the program.

Name: Class: Date: 9. The compiler ignores all comments they are there strictly for the convenience of anyone reading the program. Name: Class: Date: Exam #1 - Prep True/False Indicate whether the statement is true or false. 1. Programming is the process of writing a computer program in a language that the computer can respond to

More information

VHDL Test Bench Tutorial

VHDL Test Bench Tutorial University of Pennsylvania Department of Electrical and Systems Engineering ESE171 - Digital Design Laboratory VHDL Test Bench Tutorial Purpose The goal of this tutorial is to demonstrate how to automate

More information

Time Clock Import Setup & Use

Time Clock Import Setup & Use Time Clock Import Setup & Use Document # Product Module Category CenterPoint Payroll Processes (How To) This document outlines how to setup and use of the Time Clock Import within CenterPoint Payroll.

More information

ASCII Encoding. The char Type. Manipulating Characters. Manipulating Characters

ASCII Encoding. The char Type. Manipulating Characters. Manipulating Characters The char Type ASCII Encoding The C char type stores small integers. It is usually 8 bits. char variables guaranteed to be able to hold integers 0.. +127. char variables mostly used to store characters

More information

CMPT 373 Software Development Methods. Building Software. Nick Sumner wsumner@sfu.ca Some materials from Shlomi Fish & Kitware

CMPT 373 Software Development Methods. Building Software. Nick Sumner wsumner@sfu.ca Some materials from Shlomi Fish & Kitware CMPT 373 Software Development Methods Building Software Nick Sumner wsumner@sfu.ca Some materials from Shlomi Fish & Kitware What does it mean to build software? How many of you know how to build software?

More information

Caml Virtual Machine File & data formats Document version: 1.4 http://cadmium.x9c.fr

Caml Virtual Machine File & data formats Document version: 1.4 http://cadmium.x9c.fr Caml Virtual Machine File & data formats Document version: 1.4 http://cadmium.x9c.fr Copyright c 2007-2010 Xavier Clerc cadmium@x9c.fr Released under the LGPL version 3 February 6, 2010 Abstract: This

More information

Product: DQ Order Manager Release Notes

Product: DQ Order Manager Release Notes Product: DQ Order Manager Release Notes Subject: DQ Order Manager v7.1.25 Version: 1.0 March 27, 2015 Distribution: ODT Customers DQ OrderManager v7.1.25 Added option to Move Orders job step Update order

More information

15-150 Lecture 11: Tail Recursion; Continuations

15-150 Lecture 11: Tail Recursion; Continuations 15-150 Lecture 11: Tail Recursion; Continuations Lecture by Dan Licata February 21, 2011 In this lecture we will discuss space usage: analyzing the memory it takes your program to run tail calls and tail

More information

IVI Configuration Store

IVI Configuration Store Agilent Developer Network White Paper Stephen J. Greer Agilent Technologies, Inc. The holds information about IVI drivers installed on the computer and configuration information for an instrument system.

More information

How To Use Standard Pos On A Pc Or Macbook Powerbook 2.5.2.2 (Powerbook 2)

How To Use Standard Pos On A Pc Or Macbook Powerbook 2.5.2.2 (Powerbook 2) Integrated Point of Sales System for Mac OS X Program version: 6.3.22 110401 2012 HansaWorld Ireland Limited, Dublin, Ireland Preface Standard POS is a powerful point of sales system for small shops and

More information

Reading and Understanding Java s API Documentation

Reading and Understanding Java s API Documentation Appendix Reading and Understanding Java s API Documentation Before Java was born, people judged programming languages solely by their structural features. Does an if statement do what you expect it to

More information

Configuring the Server(s)

Configuring the Server(s) Introduction Configuring the Server(s) IN THIS CHAPTER. Introduction. Overview of Machine Configuration Options. Installing and Configuring FileMaker Server. Testing Your Installation. Hosting Your File.

More information

CREATING AND DEPLOYING ABL WEB SERVICES

CREATING AND DEPLOYING ABL WEB SERVICES CREATING AND DEPLOYING ABL WEB SERVICES Fellow and OpenEdge Evangelist Document Version 1.0 August 2010 September, 2010 Page 1 of 21 DISCLAIMER Certain portions of this document contain information about

More information

INTRODUCTION TO OBJECTIVE-C CSCI 4448/5448: OBJECT-ORIENTED ANALYSIS & DESIGN LECTURE 12 09/29/2011

INTRODUCTION TO OBJECTIVE-C CSCI 4448/5448: OBJECT-ORIENTED ANALYSIS & DESIGN LECTURE 12 09/29/2011 INTRODUCTION TO OBJECTIVE-C CSCI 4448/5448: OBJECT-ORIENTED ANALYSIS & DESIGN LECTURE 12 09/29/2011 1 Goals of the Lecture Present an introduction to Objective-C 2.0 Coverage of the language will be INCOMPLETE

More information

FileBench's Multi-Client feature

FileBench's Multi-Client feature FileBench's Multi-Client feature Filebench now includes facilities to synchronize workload execution on a set of clients, allowing higher offered loads to the server. While primarily intended for network

More information

Step by Step Tutorial to creating R Packages. Heng Wang Michigan State University

Step by Step Tutorial to creating R Packages. Heng Wang Michigan State University Step by Step Tutorial to creating R Packages Heng Wang Michigan State University Introduction R is an open source statistical software R provides functions to perform statistical operations o Classical

More information

HELP DESK MANUAL INSTALLATION GUIDE

HELP DESK MANUAL INSTALLATION GUIDE Help Desk 6.5 Manual Installation Guide HELP DESK MANUAL INSTALLATION GUIDE Version 6.5 MS SQL (SQL Server), My SQL, and MS Access Help Desk 6.5 Page 1 Valid as of: 1/15/2008 Help Desk 6.5 Manual Installation

More information

Microsoft Virtual Labs. Building Windows Presentation Foundation Applications - C# - Part 1

Microsoft Virtual Labs. Building Windows Presentation Foundation Applications - C# - Part 1 Microsoft Virtual Labs Building Windows Presentation Foundation Applications - C# - Part 1 Table of Contents Building Windows Presentation Foundation Applications - C# - Part 1... 1 Exercise 1 Creating

More information

Project 2: Bejeweled

Project 2: Bejeweled Project 2: Bejeweled Project Objective: Post: Tuesday March 26, 2013. Due: 11:59PM, Monday April 15, 2013 1. master the process of completing a programming project in UNIX. 2. get familiar with command

More information

Code Estimation Tools Directions for a Services Engagement

Code Estimation Tools Directions for a Services Engagement Code Estimation Tools Directions for a Services Engagement Summary Black Duck software provides two tools to calculate size, number, and category of files in a code base. This information is necessary

More information

HOMEWORK # 2 SOLUTIO

HOMEWORK # 2 SOLUTIO HOMEWORK # 2 SOLUTIO Problem 1 (2 points) a. There are 313 characters in the Tamil language. If every character is to be encoded into a unique bit pattern, what is the minimum number of bits required to

More information

Project 2 Database Design and ETL

Project 2 Database Design and ETL Project 2 Database Design and ETL Out: October 7th, 2015 1 Introduction: What is this project all about? We ve now studied many techniques that help in modeling data (E-R diagrams), which can then be migrated

More information

STRUCTURE AND FLOWS. By Hagan Rivers, Two Rivers Consulting FREE CHAPTER

STRUCTURE AND FLOWS. By Hagan Rivers, Two Rivers Consulting FREE CHAPTER UIE REPORTS FUNDAMENTALS SERIES T H E D E S I G N E R S G U I D E T O WEB APPLICATIONS PART I: STRUCTURE AND FLOWS By Hagan Rivers, Two Rivers Consulting FREE CHAPTER User Interface Engineering User Interface

More information

An Introduction to Modern Software Development Tools Creating A Simple GUI-Based Tool Appleʼs XCode Version 3.2.6

An Introduction to Modern Software Development Tools Creating A Simple GUI-Based Tool Appleʼs XCode Version 3.2.6 1 2 3 4 An Introduction to Modern Software Development Tools Creating A Simple GUI-Based Tool Appleʼs XCode Version 3.2.6 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 Charles J. Ammon / Penn State August, 2011

More information

Hands-On UNIX Exercise:

Hands-On UNIX Exercise: Hands-On UNIX Exercise: This exercise takes you around some of the features of the shell. Even if you don't need to use them all straight away, it's very useful to be aware of them and to know how to deal

More information

How to Configure Outlook 2013 to connect to Exchange 2010

How to Configure Outlook 2013 to connect to Exchange 2010 How to Configure Outlook 2013 to connect to Exchange 2010 Outlook 2013 will install and work correctly on any version of Windows 7 or Windows 8. Outlook 2013 won t install on Windows XP or Vista. 32-bit

More information

MS Enterprise Library 5.0 (Logging Application Block)

MS Enterprise Library 5.0 (Logging Application Block) International Journal of Scientific and Research Publications, Volume 4, Issue 8, August 2014 1 MS Enterprise Library 5.0 (Logging Application Block) Anubhav Tiwari * R&D Dept., Syscom Corporation Ltd.

More information

Object-Oriented Programming in Java

Object-Oriented Programming in Java CSCI/CMPE 3326 Object-Oriented Programming in Java Class, object, member field and method, final constant, format specifier, file I/O Dongchul Kim Department of Computer Science University of Texas Rio

More information

The little endl that couldn t

The little endl that couldn t This is a pre-publication draft of the column I wrote for the November- December 1995 issue of the C++ Report. Pre-publication means this is what I sent to the Report, but it may not be exactly the same

More information

Jenkins on Windows with StreamBase

Jenkins on Windows with StreamBase Jenkins on Windows with StreamBase Using a Continuous Integration (CI) process and server to perform frequent application building, packaging, and automated testing is such a good idea that it s now a

More information

Package packrat. R topics documented: March 28, 2016. Type Package

Package packrat. R topics documented: March 28, 2016. Type Package Type Package Package packrat March 28, 2016 Title A Dependency Management System for Projects and their R Package Dependencies Version 0.4.7-1 Author Kevin Ushey, Jonathan McPherson, Joe Cheng, Aron Atkins,

More information

Developing a Web Server Platform with SAPI Support for AJAX RPC using JSON

Developing a Web Server Platform with SAPI Support for AJAX RPC using JSON Revista Informatica Economică, nr. 4 (44)/2007 45 Developing a Web Server Platform with SAPI Support for AJAX RPC using JSON Iulian ILIE-NEMEDI, Bucharest, Romania, inemedi@ie.ase.ro Writing a custom web

More information

Ethereal: Getting Started

Ethereal: Getting Started Ethereal: Getting Started Computer Networking: A Topdown Approach Featuring the Internet, 3 rd edition. Version: July 2005 2005 J.F. Kurose, K.W. Ross. All Rights Reserved Tell me and I forget. Show me

More information

Beginner s Matlab Tutorial

Beginner s Matlab Tutorial Christopher Lum lum@u.washington.edu Introduction Beginner s Matlab Tutorial This document is designed to act as a tutorial for an individual who has had no prior experience with Matlab. For any questions

More information

Embedded Software Development with MPS

Embedded Software Development with MPS Embedded Software Development with MPS Markus Voelter independent/itemis The Limitations of C and Modeling Tools Embedded software is usually implemented in C. The language is relatively close to the hardware,

More information

G563 Quantitative Paleontology. SQL databases. An introduction. Department of Geological Sciences Indiana University. (c) 2012, P.

G563 Quantitative Paleontology. SQL databases. An introduction. Department of Geological Sciences Indiana University. (c) 2012, P. SQL databases An introduction AMP: Apache, mysql, PHP This installations installs the Apache webserver, the PHP scripting language, and the mysql database on your computer: Apache: runs in the background

More information

Chapter One Introduction to Programming

Chapter One Introduction to Programming Chapter One Introduction to Programming 1-1 Algorithm and Flowchart Algorithm is a step-by-step procedure for calculation. More precisely, algorithm is an effective method expressed as a finite list of

More information

This document presents the new features available in ngklast release 4.4 and KServer 4.2.

This document presents the new features available in ngklast release 4.4 and KServer 4.2. This document presents the new features available in ngklast release 4.4 and KServer 4.2. 1) KLAST search engine optimization ngklast comes with an updated release of the KLAST sequence comparison tool.

More information

MATLAB Functions. function [Out_1,Out_2,,Out_N] = function_name(in_1,in_2,,in_m)

MATLAB Functions. function [Out_1,Out_2,,Out_N] = function_name(in_1,in_2,,in_m) MATLAB Functions What is a MATLAB function? A MATLAB function is a MATLAB program that performs a sequence of operations specified in a text file (called an m-file because it must be saved with a file

More information

By Glenn Fleishman. WebSpy. Form and function

By Glenn Fleishman. WebSpy. Form and function Form and function The simplest and really the only method to get information from a visitor to a Web site is via an HTML form. Form tags appeared early in the HTML spec, and closely mirror or exactly duplicate

More information

CPLEX Tutorial Handout

CPLEX Tutorial Handout CPLEX Tutorial Handout What Is ILOG CPLEX? ILOG CPLEX is a tool for solving linear optimization problems, commonly referred to as Linear Programming (LP) problems, of the form: Maximize (or Minimize) c

More information

Setting up PostgreSQL

Setting up PostgreSQL Setting up PostgreSQL 1 Introduction to PostgreSQL PostgreSQL is an object-relational database management system based on POSTGRES, which was developed at the University of California at Berkeley. PostgreSQL

More information

Examining the InDesign Server Solution

Examining the InDesign Server Solution Examining the InDesign Server Solution This is an online bonus article for Chapter 13 of Paperless: Real-World Solutions with Adobe Technology. This article details the tools and techniques that were used

More information

Cluster@WU User s Manual

Cluster@WU User s Manual Cluster@WU User s Manual Stefan Theußl Martin Pacala September 29, 2014 1 Introduction and scope At the WU Wirtschaftsuniversität Wien the Research Institute for Computational Methods (Forschungsinstitut

More information

Customizing forms and writing QuickBooks Letters

Customizing forms and writing QuickBooks Letters LESSON 15 Customizing forms and writing QuickBooks Letters 15 Lesson objectives, 398 Supporting materials, 398 Instructor preparation, 398 To start this lesson, 398 About QuickBooks forms, 399 Customizing

More information

CheckBook Pro 2 Help

CheckBook Pro 2 Help Get started with CheckBook Pro 9 Introduction 9 Create your Accounts document 10 Name your first Account 11 Your Starting Balance 12 Currency 13 Optional password protection 14 We're not done yet! 15 AutoCompletion

More information

Network Security EDA491 2011/2012. Laboratory assignment 4. Revision A/576, 2012-05-04 06:13:02Z

Network Security EDA491 2011/2012. Laboratory assignment 4. Revision A/576, 2012-05-04 06:13:02Z Network Security EDA491 2011/2012 Laboratory assignment 4 Revision A/576, 2012-05-04 06:13:02Z Lab 4 - Network Intrusion Detection using Snort 1 Purpose In this assignment you will be introduced to network

More information

CEFNS Web Hosting a Guide for CS212

CEFNS Web Hosting a Guide for CS212 CEFNS Web Hosting a Guide for CS212 INTRODUCTION: TOOLS: In CS212, you will be learning the basics of web development. Therefore, you want to keep your tools to a minimum so that you understand how things

More information

Introduction to SQL for Data Scientists

Introduction to SQL for Data Scientists Introduction to SQL for Data Scientists Ben O. Smith College of Business Administration University of Nebraska at Omaha Learning Objectives By the end of this document you will learn: 1. How to perform

More information

MS Excel Template Building and Mapping for Neat 5

MS Excel Template Building and Mapping for Neat 5 MS Excel Template Building and Mapping for Neat 5 Neat 5 provides the opportunity to export data directly from the Neat 5 program to an Excel template, entering in column information using receipts saved

More information

App Building Guidelines

App Building Guidelines App Building Guidelines App Building Guidelines Table of Contents Definition of Apps... 2 Most Recent Vintage Dataset... 2 Meta Info tab... 2 Extension yxwz not yxmd... 3 Map Input... 3 Report Output...

More information

GP REPORTS VIEWER USER GUIDE

GP REPORTS VIEWER USER GUIDE GP Reports Viewer Dynamics GP Reporting Made Easy GP REPORTS VIEWER USER GUIDE For Dynamics GP Version 2015 (Build 5) Dynamics GP Version 2013 (Build 14) Dynamics GP Version 2010 (Build 65) Last updated

More information

Year 9 set 1 Mathematics notes, to accompany the 9H book.

Year 9 set 1 Mathematics notes, to accompany the 9H book. Part 1: Year 9 set 1 Mathematics notes, to accompany the 9H book. equations 1. (p.1), 1.6 (p. 44), 4.6 (p.196) sequences 3. (p.115) Pupils use the Elmwood Press Essential Maths book by David Raymer (9H

More information

Lab 1: Introduction to C, ASCII ART and the Linux Command Line Environment

Lab 1: Introduction to C, ASCII ART and the Linux Command Line Environment .i.-' `-. i..' `/ \' _`.,-../ o o \.' ` ( / \ ) \\\ (_.'.'"`.`._) /// \\`._(..: :..)_.'// \`. \.:-:. /.'/ `-i-->..

More information