In this chapter, you will be get started writing and working with R syntax. The ideas introduced will be useful as you interact with statistical computation, whether it be to carry out data analysis, or to write your own R program or package. To begin,
A “session” is the terminology we use to describe the duration from opening RStudio to closing RStudio. You can begin a new R session by either opening the RStudio application on your computer, or, if you are already in an existing R session, by selecting Session > New Session
from the RStudio menu.
 One of those methods is to issue commands in the RStudio console pane. Computing in the console is similar to working with a calculator: you enter syntax and R runs the syntax. The >
symbol in the console pane is called the “R prompt” and is prompting you to enter syntax. After you enter any syntax, you hit the
To get started, we will have R carry out some arithmetic. At the prompt enter each of the following lines of syntax. After each line, hit the <return>
or <enter>
key.
# Addition
2 + 3
# Subtraction
6 - 10
# Multiplication
4 * 5
# Division
23 / 2
# Exponents
10 ^ 3
Executing each line of syntax returns the results of the computation in the console pane. The result, in R parlance, is referred to as a “returned value.” After executing the computation, the R prompt reappears and you can issue a new line of syntax.
Continuation Prompt: At some point in your computational career, you will likely encounter the continuation prompt. Symbolized by +
, this prompt appears instead of the R prompt to indicate that you did not complete the syntax you entered prior to hitting the <enter>
key after inputting the slash; before inputting the 2
. You would see the continuation prompt:
> 23 /
+
The continuation prompt tells you that the syntax you started to enter is still active. If you now enter 2
and hit the <enter>
key, the syntax will be executed as if you had not inadvertently hit <enter>
in the middle of the computation. If you are in the middle of a more complex piece of syntax, you could also hit the <esc>
key until the R prompt is re-shown. Then you can start the computation over.
Space in Syntax: For the computation in R, space is irrelevant. For example, each of the following syntactical statements is equivalent:
4 * 5
4*5
4 * 5
That being said, well-written code includes space! Space in code makes it easier to read and debug, in the same way that including space in written prose helps us read and parse words, sentences, and paragraphs.
Almost all commands in R are built around the use of a function. Functions carry out operations on their inputs (called arguments) and produce an output (called a returned value).
The syntax for using most functions in R follows a simple structure: The name of the function is followed by a pair of parentheses. Argument values (inputs) are specified inside the parentheses. In general,
function_name(argument)
Below are several example of this structure for some common mathematical functions.
#Square root
sqrt(100)
[1] 10
#Absolute value
abs(-23)
[1] 23
#Factorial
factorial(5)
[1] 120
Functions can take multiple arguments (inputs). If there is more than one argument, the arguments are always separated by a comma.
function_name(argument_1, argument_2, ...)
For example, the seq()
function creates a sequence of values that have a particular start and end value.
seq(1, 5)
[1] 1 2 3 4 5
Note that the order of the arguments matters! Reversing the order of the arguments inputted to the seq()
function returns different output.
seq(5, 1)
[1] 5 4 3 2 1
Each of the arguments actually has a name, and if those names are used to assign the values we are inputting to the function, then the order of the arguments is irrelevant.
# Named arguments
seq(from = 1, to = 5)
[1] 1 2 3 4 5
# Order no longer matters
seq(to = 5, from = 1)
[1] 1 2 3 4 5
It is a good habit to use named arguments when you are writing your syntax. It makes the code more readable and easier to adapt if you come back to it later. Sometimes when the initial argument of a function is well-established, that first argument is left unnamed, but all other arguments used are named. A good example of this is the use of the lm()
function in which the initial formula=
argument is typically unnamed, but other arguments (e.g., data=
) are named.
One powerful aspect of computing is that the output from a function can be used as input into another function. This is akin to calculations you may have encountered in mathematics course like algebra. For example,
\[ \sqrt{\log(100)} \]
In carrying out this calculation, you would first compute the logarithm of 100 and then take the square root of that result. Using function notation, your algebra teacher might have written
\[ g(~f(x)~) \] where \(f(x)\) is the logarithm function and \(g(x)\) is the square root function. Regardless of how we express this,the idea is that the output of the logarithm function is used as input to the square root function. Using R, there are two primary ways to connect computations in this manner: chaining and assignment.
Chaining is a direct reflection of the functional notation \(g(~f(x)~)\) in that you embed one computation directly in another. For example, to find the absolute value of all the integers between \(-5\) and \(-1\), we can chain the abs()
function and the seq()
functions:
abs( seq(from = -5, to = -1) )
[1] 5 4 3 2 1
Note here that the output/returned value is not a single value, but five values. The absolute value function was applied to each of the values in the sequence. Compare this to the result from the following chained computations:
mean( seq(from = -5, to = -1) )
[1] -3
Here the mean function applied to the sequence of values returns a single value as output. When a function is applied to a set of multiple values (i.e., a vector), some functions will apply their computations separately on each element/value (element-wise computation returns multiple values), while others will apply the computation to the set of elements as a whole (vector-wise computation returns a single value). Most of the time it will be clear from the function name or description whether the output returns a single value or multiple values.
We can chain as many computations together as we would like. For example here we find the square root of the absolute value of all the integers between \(-5\) and \(-1\).
sqrt( abs( seq(from = -5, to = -1) ) )
[1] 2.236068 2.000000 1.732051 1.414214 1.000000
We can also connect computations through assignment. With assignment, we store the output of a computation by assigning it to a named object. We can then use that named object in another computation. For example, here we first store the integers between \(-5\) and \(-1\) in an object called chili
. Then we find the absolute value of each value by using chili
as the argument in the abs()
function.
# Assign the sequence to the object chili
= seq(from = -5, to = -1)
chili
# Compute the absolute values
abs(chili)
[1] 5 4 3 2 1
To view the contents of an object, just print the name of the object. Below, after creating the object sadie
, we view its contents.
# Assign values to sadie
= rep(3, times = 5)
sadie
# View contents of sadie
sadie
[1] 3 3 3 3 3
Pretty much any name can be used when you create an object, with some caveats: object names cannot begin with a digit nor include hyphens or spaces. Although they are legal object names, chili
and sadie
are not particularly good object names. Better object names would describe the contents of the object.
In my own workflow, I tend to use all lowercase letters in my object names and I use underscores for word breaks. For example,
ses
, gpa
, occupation
act_math
, mothers_educ
We can continue to use the objects you created (e.g., chili
and sadie
) in our computations, so long as the objects remain in our R working environment.
# Sum the pairwise elements of the two objects
+ sadie chili
[1] -2 -1 0 1 2
# Sum all the elements in chili
sum(chili)
[1] -15
# Product of all the elements in sadie
prod(sadie)
[1] 243
In RStudio you can see which objects are in your working environment by examining the Environment
pane.
Not only does this pane indicate the name of the objects in the working environment, but is also displays each object’s class. In this case we can tell that chili
is an integer vector and sadie
is a numeric vector.3 Moreover, we are told that each vector includes five elements, shown in the environment pane as [1:5]
. Lastly, we are given a preview of each object’s contents. Since these vectors only contain five elements, we see all the values in the preview.
You can also use syntax to obtain a list of objects that are in your working environment using the ls()
function with no arguments.
# List the objects in working environment
ls()
[1] "chili" "sadie"
When an object name is re-used, the previous value of the object is lost.
# Assign the values 1 to 10 in chili
= seq(from = 1, to = 10) chili
After assigning new values to chili
, we can see the information in the environment pane has been updated to reflect the new contents of the object.
Any computations carried out with chili
will use the new object.
# Sum all the elements in chili
sum(chili)
[1] 55
If you want the previous version of chili
you need to re-create the object. If you close your R session all of the objects you created will be lost.
It is important to be able to record the syntax you use. This acts as a way of “saving” your work, and it also acts as a record of the analysis for your collaborators in the spirit of reproducible work. One way to record the R syntax you use is to employ a script file. You can create a new script file by selecting File > New File > R Script
from the RStudio menu bar. You can also obtain a new R script by clicking the New File
icon (document with the plus-sign) on the tool bar and selecting R Script
.
Script files should only include your R syntax and comments. Script files should NOT include:
Comments, which are human-readable annotations or explanations of the syntax, are written using the hashtag (#
). These can be placed on their own line in the script file, or can be placed at the end of a line with syntax. The comment continues until you hit the
Script files can be saved and opened the same as any other document. So, no more worrying about losing your work or objects that you created when you close your R sesssion. Just open your saved script file, highlight the parts you want to re-run, and click the Run
button!
Not only does the script file record your syntax, but it can also act as the vehicle from which you run your R syntax. Syntax in the script file can be executed by highlighting it and pressing the Run
button in the toolbar. You can run one line at a time, or highlight multiple lines and execute all of them sequentially.
Writing syntax directly in the script file and running it is a groovy workflow for using R. Writing syntax directly in the script file also saves you from having to copy-and-paste syntax you want to save from the console. In my own work, I use this workflow almost daily.
Every R function is housed in a package. To use the functions in a particular package, the package needs to be (1) installed, and (2) loaded into memory.
You can see the packages (and which version of each package) are installed by examining the Packages
tab in RStudio. Every package listed there has been installed. You will also be able to see the version number of the package that is installed. Some of those packages may be checked. These are the packages that are also loaded into memory.
Twenty-nine packages were included when you installed R on your computer. When you start an R session by opening RStudio, some of those packages are also loaded into memory.
To load a package that is installed, you use the library()
function and include the name of the package you want to load in as the sole argument. For example, to load the splines package, use the following syntax:
library(splines)
Some packages requires other packages (dependencies) to work. For example, the lme4 package is dependent on the Matrix package. When you load packages that have dependencies, R will also load the dependencies (assuming you have them installed). When it does this, a message will be printed after you execute library()
. For example, here is what happens when we load the lme4 package.
library(lme4)
Loading required package: Matrix
Once the package is loaded, all of the functions, data sets, etc. in that package are available to you. Packages will need to be loaded every time you launch a new R session.
Sometimes you will get a message about objects being masked. This is not a problem. It is just informative and means that the package you just loaded has a function that has the exact same name as a previously loaded package. If you use that particular function, the most recently loaded package’s version of the function will be used. For example, after loading the dplyr library the following message is printed:
Attaching package: ‘dplyr’
The following objects are masked from ‘package:stats’:
filter, lag
The following objects are masked from ‘package:base’:
intersect, setdiff, setequal, union
This tells me that the dplyr package includes six functions that have the same name as functions included in other packages that have already been loaded into memory (two from the stats package and four from the base package.) Since dplyr was the most recently loaded package, if you were to use the filter()
function, R would use dplyr’s filter()
function rather than that from the stats package4.
Once in a while, when loading a package, you may get an error. Don’t panic. There are two errors that are common. The first error you may get indicates that the package did not get installed. For example, if ggplot2 were not installed, trying to use the library()
function to load that package would result in an error.
library(ggplot2)
Error in library(ggplot2) : there is no package called ‘ggplot2’
Simply install the package and then re-try loading it.
The second error that you might run across when trying to load a package occurs when the installation did not include the package dependencies. For example,
library(odbc)
Error: package or namespace load failed for ‘odbc’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
there is no package called ‘Rcpp’
Again, don’t panic! Here the error message is saying that the Rcpp package is a dependency and it is not installed. To fix this, install the Rcpp package and then try again. (You may need to open a new R session first.) You may need to install more than one dependency, so just keep installing what is missing until it works.
You can also install other packages onto your R system. R, in fact, has a repository called CRAN5, that includes 16,000 different packages (as of July 2020). The easiest way to install a package from CRAN onto your computer is to use the Install
button in the `Packages tab of RStudio.
This will open a pop-up window where you can type the CRAN package you want to install in a text box. Ensure that the “Install dependencies” box is checked (this will also install any package dependencies), and then click “Install.”
You may be prompted to choose a nearest mirror. If so, choose a mirror location. If you are successful in installing the package, you will get a message like the following:
Installing package into ‘/Users/zief0002/Library/R/4.0/library’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.0/dplyr_1.0.0.tgz'
Content type 'application/x-gzip' length 1209135 bytes (1.2 MB)
==================================================
downloaded 1.2 MB
The downloaded binary packages are in
/var/folders/s3/sqlc9xw92w54166w86dgkd000000gr/T//Rtmps80Uf8/downloaded_packages
The message you get on Windows may be slightly different, but the key is that there is not an error. Furthermore, you should immediately be able to load the package using the library()
function.
An equivalent manner of installing a package via syntax is to use the install.packages()
function. For example, to install the dplyr package we could have used the following syntax:
install.packages("dplyr", dependencies = TRUE)
Note that the name of the package is included in quotation marks (it is a character string). The argument dependencies=TRUE
installs all package dependencies, similar to checking the “Install dependencies” box in the pop-up menu.
CRAN is not the only place to get R packages. Many developers add packages to a website called GitHub. Packages hosted on GitHub can be installed using the install_github()
function from the remotes package.
First, you will need to install the remotes package from CRAN and then load it using the library()
function. Then, you can use the install_github()
function to actually install the package. This function is provided a character string that specifies the user name and GitHub repository for the package, separated by a slash. You can find this in the part of the URL that follows “https://github.com/” in your web browser. For example, the URL for the educate package is: “https://github.com/zief0002/educate,” so to install this we would use:
# Load remotes package
library(remotes)
# Install dplyr from GitHub
install_github("zief0002/educate")
The message I get when installing this is
Installing package into ‘/Users/zief0002/Library/R/4.0/library’
(as ‘lib’ is unspecified)
* installing *source* package ‘educate’ ...
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
*** copying figures
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (educate)
The “DONE” message typically signified successful installation. Note that you may be prompted to update some packages. If you get this message, choose the option to update “ALL” packages. As with packages installed from CRAN, if things worked you should be able to load the package you just installed using the library()
function without any errors.
You may need to install some additional functionality to your system in order to get certain packages to install or load properly. On a Windows machine, you might need to install Rtools. Mac users might need to add the Command Line Tools. These tools also allow you to write and compile your own R packages. RStudio has well written instructions for adding these tools at: https://support.rstudio.com/hc/en-us/articles/200486498-Package-Development-Prerequisites.
The difference between the two classes is technical and related to how R internally stores the information in the vector.↩
If you really wanted to use the filter()
function from the stats package you could specify this in the syntax using the ::
operator, stats::filter()
. This operator also allows you to use a function without loading the package with the library()
function.↩
“CRAN is a network of ftp and web servers around the world that store identical, up-to-date, versions of code and documentation for R.”↩


---
layout: post
title: ! 'Project YakShayQRS : another CQRS evolution'
---
Introduction
TL;DR: I managed to minimize the CQRS overhead even further.
Over the years, I have been trying to minimize CQRS in several iterations, even releasing a framework and a lib in doing so. Yet, I have still not been satisfied by the approach I reached. This time I once again am pretty satisfied with the way things turned out, and they actually seem to require even way less overhead...
How it works
The concept is quite simple: I use a generic message class to implement messaging. Next to this I use the virtual keyword:
- A class can contain virtual properties; these properties define the unique key of the instance. (f.e. an "Account" class has a "protected virtual string AccountId {get;set;}").
- When invoking a message on a class type, an instance is loaded where the unique key is loaded based on the match between the message parameters and the classes' virtual properties. A message only gets invoked if it contains all the virtual properties from the class.
- In order to alter state, one should use a virtual method.
- One can only send messages targetting non-virtual methods to a class instance.
- Non-virtual methods should never alter state, but instead call a virtual method that alters the state...
- When rebuilding state based on past events, only the messages targetting the virtual methods are invoked to rebuild the state; no messages are emitted.
The advantage: all the wiring is convention-based; and once you get it it is quite easy: altering state should only happen through virtual methods, but these virtual methods should never contain any logic and just alter state or do nothing. The intercepted call to the virtual method gets emitted and gets processed by any non-virtual methods in other classes (if the message matches the classes' key).
Maybe an example can make it more clear
As usual, the full source can be found over at github.
Conclusion
This is yet another evolutionary approach to CQRS, and it feels pretty neat (event though the same things applied to the previous versions. Let me know what you think !


{% extends "_layouts/cp" %} {% import "_includes/forms" as forms %} {% set appHandle = app.handle %} {% block content %}


Something went wrong. Please try again.
Full Name Please enter your full name containing at lease 2 characters
Email Please enter a valid email
Message {{message.value?.length || 0}} / 140 Please enter your message
Submit Reset


DDE is a Windows feature which permits two applications to run simultaneously exchanging data. Visual Basic uses the Properties of a Control to establish a Link with Pegaesys. All three control properties must be included in the Visual Basic code for the application you are writing.
where: Control is a Form, label, picture box or text box and LinkTopic, LinkItem, and LinkMode are Properties of the control.
Refer to the Visual Basic Manual for supported functions. You can use a shell function to start Pegaesys if it is not already running:
X = Shell("drive:\dir\PEGAES.exe", 4)
Using Visual Basic you can write a applications which, when compiled to a .EXE file, can interact with Pegaesys. Refer to documentation provided by the client software for instructions in setting up an application.
The following sequence is based on an Visual Basic Program as the Source:


We optimize platforms!
- streamline viral web-readiness
- drive strategic schemas
- streamline holistic markets
- syndicate viral users
- whiteboard visionary networks
- streamline visionary infomediaries
- drive plug-and-play convergence
- envisioneer cutting-edge methodologies


2019 Mercedes-Benz ESF safety vehicle showcased in India
by Akbar MerchantThe 2019 ESF is based on the upcoming new GLE SUV; gets a long list of innovative safety tech.
Mercedes took the wraps off its latest research car, the ESF 2019, in New Delhi. The model was showcased at the second edition of the Safe Roads Summit India that also had Nitin Gadkari, Honourable Minister for Road Transport & Highways of India, Minister of Micro, Small and Medium Enterprises, Government of India, present.
For those who don’t know, the Safe Roads India Summit is part of the nationwide ‘Safe Roads’ initiative launched in 2015 by Daimler entities operating in India – Mercedes-Benz Research and Development India (MBRDI), Mercedes-Benz India (MBIL) and Daimler India Commercial Vehicles (DICV).
Coming back to the ESF 2019, the research vehicle first made its debut earlier this year at the Frankfurt motor show. The 2019 model is based on the new Mercedes-Benz GLE SUV that’s equipped with semi-autonomous tech and powered by a plug-in hybrid system. It also boasts innovative safety features inside, and an exterior that can warn fellow drivers of potential hazards. It gets multi-coloured lights, projective panels and a warning triangle robot. The vehicle is designed to be intuitive in order to provide safety benefits not just to its passengers, but also for the surroundings.
Additionally, when the vehicle is in fully-automated mode, its steering wheel and pedals can be retracted in order to reduce the risk of injury in the event of an impact. The airbags and head restraints feature alternative installation spaces, which means the driver airbag is located in the dashboard and the integral side airbag is positioned in the side bolsters of the seat backrests. The car also comes with a Pre-Safe Child system, which preventively tensions the seat belt and extends the side-mounted impact protection elements before a crash.
The ESF 2019 is also equipped with a rear airbag that has a new inflation concept and Active Brake Assist. The first uses a belt tensioner to warn the driver that they might have underestimated an approaching bend (Pre-Safe Curve), while the Pre-Safe Side Lights with electro-luminescent paint can “defuse potentially hazardous situations.” Aside from the new rear airbag, rear seat passengers also get belt-feeders, belt buckle illumination, USB belt buckles and belt heating.
The ESF 2019 replaces the S-class-based ESF 2009 (also showcased in India) that had innovations like a belt bag, Pre-safe Impulse and Side and Active beam assist, all of which made their debut in production Mercedes Benz vehicles.
Also see:
Mercedes-Maybach GLS to debut on November 21
Next-gen Mercedes-Benz GLA: New details surface
Mercedes-Benz Classic Car Rally 2019: the rolling museum


| 011:104 Yusufali | : |
Nor shall We delay it but for a term appointed. |
| 011:105 Khan | : |
On the Day when it comes, no person shall speak except by His (Allah's) Leave. Some among them will be wretched and (others) blessed. |
| 011:105 Maulana | : |
On the day when it comes, no soul will speak except by His permission; so (some) of them will be unhappy and (others) happy. |
| 011:105 Pickthal | : |
On the day when it cometh no soul will speak except by His permission; some among them will be wretched, (others) glad. |
| 011:105 Rashad | : |
The day it comes to pass, no soul will utter a single word, except in accordance with His will. Some will be miserable, and some will be happy. |
| 011:105 Sarwar | : |
On the Day of Judgment no one will speak without the permission of God. Some will be condemned and others blessed. |
| 011:105 Shakir | : |
On the day when it shall come, no soul shall speak except with His permission, then (some) of them shall be unhappy and (others) happy. |
| 011:105 Sherali | : |
On the day it comes, no soul shall speak except by HIS permission; then some of them will be unfortunate and other fortunate. |
Concepts/Themes Covered: الإيمان > الغيب > الغيب النفسي > النفس Faith> The Unseen World> The Psychological Secret> The Self الإيمان > اليوم الآخر > أهواله Faith> The Hereafter> Its Horrors
This tool uses eight English parallel translations for the Holy Quran imported from Mr. Clay Smith. You can also visit Qurany Concepts for browsing the Quran themes or topics. If you want to search the Holy Quran for keywords, please visit Qurany Keywords.


neutral
blink high
happy
glee
blink low
sad low
sad high
worried
determined
annoyed
surprised
skeptic
bored
unimpressed
sleepy
suspicious
squint
angry
furious
scared
slept


4.6.4 Term Output
Term output operations include:
- writing to a stream (various “write” Predicates)
- displaying, usually on the user's terminal (
display/1
)
- changing the effects of
print/[1,2]
(user:portray/1
)
- writing a clause as
listing/[0,1]
does. (portray_clause/[1,2]
)
Send feedback on this subject.


|
Helix
|
Classes | |
| class | Api |
| class | ApiTest |
| class | Application |
| class | ApplicationTest |
| class | DObject |
| class | DObjectTest |
| class | DOChild |
| class | DOChildTest |
| class | DOStmt |
| class | DOStmtInput |
| class | DOStmtInputTest |
| class | DOStmtOutput |
| class | DOStmtOutputTest |
| class | DOStmtTest |
| class | GetProject |
| class | GetProjectList |
| class | Project |
| class | ProjectData |
| class | ProjectDataTest |
| class | ProjectTable |
| class | ProjectTableTest |
| class | ProjectTest |
| class | SaveProject |
| class | Screen |
| class | ScreenTest |
| class | TableCol |
| class | TableColTest |
Typedefs | |
| typedef sptr< vector< Api * >, Api::deleteVector > | Api_svect |
| typedef sptr< vector< Application * >, Application::deleteVector > | Application_svect |
| typedef sptr< vector< DObject * >, DObject::deleteVector > | DObject_svect |
| typedef sptr< vector< DOChild * >, DOChild::deleteVector > | DOChild_svect |
| typedef sptr< vector< DOStmt * >, DOStmt::deleteVector > | DOStmt_svect |
| typedef sptr< vector< DOStmtInput * >, DOStmtInput::deleteVector > | DOStmtInput_svect |
| typedef sptr< vector< DOStmtOutput * >, DOStmtOutput::deleteVector > | DOStmtOutput_svect |
| typedef sptr< vector< Project * >, Project::deleteVector > | Project_svect |
| typedef sptr< vector< ProjectData * >, ProjectData::deleteVector > | ProjectData_svect |
| typedef sptr< vector< ProjectTable * >, ProjectTable::deleteVector > | ProjectTable_svect |
| typedef sptr< vector< Screen * >, Screen::deleteVector > | Screen_svect |
| typedef sptr< vector< TableCol * >, TableCol::deleteVector > | TableCol_svect |
| typedef sptr< vector< Api* >, Api::deleteVector> Helix::Logic::dev::Api_svect |
This typedef makes it easy to declare smart pointer vectors of the Api object type. Use this to keep your code clean and easy to read. For example:
Api_svect myVect = Api::selectSomething(odbc);
| typedef sptr< vector< Application* >, Application::deleteVector> Helix::Logic::dev::Application_svect |
This typedef makes it easy to declare smart pointer vectors of the Application object type. Use this to keep your code clean and easy to read. For example:
Application_svect myVect = Application::selectSomething(odbc);
| typedef sptr< vector< DObject* >, DObject::deleteVector> Helix::Logic::dev::DObject_svect |
This typedef makes it easy to declare smart pointer vectors of the DObject object type. Use this to keep your code clean and easy to read. For example:
DObject_svect myVect = DObject::selectSomething(odbc);
| typedef sptr< vector< DOChild* >, DOChild::deleteVector> Helix::Logic::dev::DOChild_svect |
This typedef makes it easy to declare smart pointer vectors of the DOChild object type. Use this to keep your code clean and easy to read. For example:
DOChild_svect myVect = DOChild::selectSomething(odbc);
| typedef sptr< vector< DOStmt* >, DOStmt::deleteVector> Helix::Logic::dev::DOStmt_svect |
This typedef makes it easy to declare smart pointer vectors of the DOStmt object type. Use this to keep your code clean and easy to read. For example:
DOStmt_svect myVect = DOStmt::selectSomething(odbc);
| typedef sptr< vector< DOStmtInput* >, DOStmtInput::deleteVector> Helix::Logic::dev::DOStmtInput_svect |
This typedef makes it easy to declare smart pointer vectors of the DOStmtInput object type. Use this to keep your code clean and easy to read. For example:
DOStmtInput_svect myVect = DOStmtInput::selectSomething(odbc);
| typedef sptr< vector< DOStmtOutput* >, DOStmtOutput::deleteVector> Helix::Logic::dev::DOStmtOutput_svect |
This typedef makes it easy to declare smart pointer vectors of the DOStmtOutput object type. Use this to keep your code clean and easy to read. For example:
DOStmtOutput_svect myVect = DOStmtOutput::selectSomething(odbc);
| typedef sptr< vector< Project* >, Project::deleteVector> Helix::Logic::dev::Project_svect |
This typedef makes it easy to declare smart pointer vectors of the Project object type. Use this to keep your code clean and easy to read. For example:
Project_svect myVect = Project::selectSomething(odbc);
| typedef sptr< vector< ProjectData* >, ProjectData::deleteVector> Helix::Logic::dev::ProjectData_svect |
This typedef makes it easy to declare smart pointer vectors of the ProjectData object type. Use this to keep your code clean and easy to read. For example:
ProjectData_svect myVect = ProjectData::selectSomething(odbc);
| typedef sptr< vector< ProjectTable* >, ProjectTable::deleteVector> Helix::Logic::dev::ProjectTable_svect |
This typedef makes it easy to declare smart pointer vectors of the ProjectTable object type. Use this to keep your code clean and easy to read. For example:
ProjectTable_svect myVect = ProjectTable::selectSomething(odbc);
| typedef sptr< vector< Screen* >, Screen::deleteVector> Helix::Logic::dev::Screen_svect |
This typedef makes it easy to declare smart pointer vectors of the Screen object type. Use this to keep your code clean and easy to read. For example:
Screen_svect myVect = Screen::selectSomething(odbc);
| typedef sptr< vector< TableCol* >, TableCol::deleteVector> Helix::Logic::dev::TableCol_svect |
This typedef makes it easy to declare smart pointer vectors of the TableCol object type. Use this to keep your code clean and easy to read. For example:
TableCol_svect myVect = TableCol::selectSomething(odbc);


Why join us?
Your work will be shared with the Geography undergraduate community throughout our various social media platforms including email, Instagram, Twitter , or LinkedIn. You will be tagged and appropriately credited. Reach out by email or DM'ing us on any of these platforms!
Position open until filled.
To apply for any of the roles listed below, simply send us an email at<EMAIL_ADDRESS>Please state your name, year, major, desired role, and why you're interested in joining Plenum. If you have a relevant portfolio or related experience feel free to include that as well. Selection in this year’s application cycle will make you eligible for positions on the 2021-2022 Plenum Editing Board.
We're always looking for peer reviewers to help guide us through the submission selection process. Peer reviewers have the important role of reviewing submissions and providing valuable feedback to the students. Please provide a sample of writing produced by you that you are most proud of (doesn't need to be Geography specifically). Core responsibilities include:


Home
Log In
Log out
Your Profile
Name
Email address
Phone Number
Address
Save Changes
Your Pet(s)
Name
Breed
Walks Per Day
Food Allergies
Save Changes
Book Now!


How to install PostgreSQL on Amazon AWS?
PostgreSQL is an open source object-relational database management system (ORDBMS), developed at the University of California at Berkeley Computer Science Department.
It supports a large part of the SQL standard and offers many modern features:
- complex queries
- foreign keys
- triggers
- updatable views
- transactional integrity
- multiversion concurrency control
Architectural Fundamentals
PostgreSQL1 uses a client/server model and its session consists of the following cooperating processes (programs):
• A server process: which manages the database files, accepts connections to the database from client applications and performs database actions on behalf of the clients. The database server program is called postgres
.
• The user’s client: frontend application that wants to perform database operations. Client applications can be very diverse in nature: a client could be a text-oriented tool, a graphical application, a web server that accesses the database to display web pages, or a specialized database maintenance tool. Some client applications are supplied with the PostgreSQL distribution.
As is typical of client/server applications, the client and the server can be on different hosts. In that case, they communicate over a TCP/IP network connection. You should keep this in mind because the files that can be accessed on a client machine might not be accessible (or might only be accessible using a different file name) on the database server machine.
Installation of PostgreSQL
You can install the Postgres package and a -contrib
2package that adds some additional utilities and functionality by the following command.
sudo apt-get update
sudo apt-get install postgresql postgresql-contrib
Installing PostgreSQL on Amazon AWS instance
Tables are grouped into databases, and a collection of databases managed by a single PostgreSQL server instance constitutes a database cluster.
Creating a Database
A user account postgres
is created, with the default Postgres role, after the installation. To use PostgreSQL, you have to log into this account, by typing:
sudo -i -u postgres
Accessing postgres account
Now you are logged in postgres
account, and you can create a database called company_insights
for our project by typing:
createdb company_insights
If you do not want to use your database anymore you can remove it. For example, if you are the owner(creator) of the database company_insights
, you can destroy it using the following command:
dropdb company_insights
Accessing the Database
Once you have created a database, you can access it by:
- Running the PostgreSQL interactive terminal program, called psql, which allows you to interactively enter, edit, and execute SQL commands.
- Using an existing graphical frontend tool like pgAdmin or an office suite with ODBC or JDBC support to create and manipulate a database. These possibilities are not covered in this tutorial.
You will use psql
for executing SQL commands so type psql
on the command line:
psql
You can exit the interactive Postgres session, by typing
\q
. You can log out from the userpostgres
by typingexit
on the command line.
Creating database and tables with the postgres account in Amazon AWS instance
Accessing a Database from our local machine
You will install pgAdmin, in order to access the database from our local machine to the amazon aws instance.
pgAdmin is one of the most popular Open Source administration and development platforms for PostgreSQL, which is designed to meet the needs of both novices and experienced PostgreSQL users alike, providing a powerful graphical interface that simplifies the creation, maintenance and use of database objects.
The steps for installing pgAdmin could be found here3, but for the sake of completing this tutorial, I wrote them here.
First, you need to import the repository key.
sudo apt-get install curl ca-certificates
curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
Importing keys and postgres certificate
Now, you will add apt.postgresql.org repository
by using vi.
$ vi /etc/apt/sources.list.d/pgdg.list
After this, you need to update the package lists, and install the pgadmin package:
sudo apt-get update
sudo apt-get install pgadmin4
Installing pgadmin4
Then, you only need to run the pgadmin4 command:
pgadmin4
Once it started, you can configure it.
In case, one has to delete PostgreSQL from the instance, the following command should be used.
sudo apt-get --purge remove postgresql
Downloading and copying the dataset to the Amazon EC2 instance.
Download the data from Crunchbase.
Once the data is downloaded, you will copy the data to the Amazon EC2 instance. Our task is to copy the data to the instance of Amazon EC2. For which you have to first connect the user with the instance. Once you are connected to the instance, you can copy the files on the Amazon EC2 from the local machine with the following command.
scp ~/Documents/data/people.csv guest@ec2-52-14-200-6.us-east-2.compute.amazonaws.com:~/
scp /home/ds/Documents/data/organizations.csv guest@ec2-52-14-200-6.us-east-2.compute.amazonaws.com:~/
Now, you will connect to the company_insights
database.
guest@ip-172-31-37-92:~$ sudo -i -u postgres
postgres@ip-172-31-37-92:~$ psql
or just by
guest@ip-172-31-37-92:~$ sudo -u postgres psql postgres
you will create two tables, organizations
and people
.
Run the command to create TABLE organizations
.
CREATE TABLE organizations ( organization_id serial primary key, crunchbase_uuid TEXT , name varchar(50) , type varchar(50), primary_role varchar(50), crunchbase_url TEXT , homepage_domain TEXT , homepage_url TEXT , profile_image_url TEXT, facebook_url TEXT, twitter_url TEXT, linkedin_url TEXT, stock_symbol varchar(50), location_city varchar(50), location_region varchar(50), location_country_code varchar(50), short_description TEXT );
Run the command to create TABLE people
.
CREATE TABLE people (people_id serial primary key, crunchbase_uuid TEXT , type varchar(50), first_name varchar(50), last_name varchar(50), crunchbase_url TEXT , profile_image_url TEXT , facebook_url TEXT, twitter_url TEXT, linkedin_url TEXT, location_city varchar(50), location_region varchar(50), location_country_code varchar(50), title varchar(255), organization TEXT , organization_crunchbase_url TEXT );
Since the dataset are already saved on the Amazon instance, you will copy the data into the respective tables.
company_insights=# \COPY people (crunchbase_uuid , type , first_name , last_name , crunchbase_url , profile_image_url , facebook_url , twitter_url , linkedin_url , location_city, location_region , location_country_code , title, organization , organization_crunchbase_url ) FROM '/home/guest/data/people.csv' DELIMITER ',' CSV HEADER;
Conclusion:
In this post, you learned about PostgreSQL and how to install it on Amazon Web Services. You explore it’s architecture, installation and how to create a database and access it from the local machine. You also downloaded and copied the data-set to the Amazon EC2 instance. For further exploration, please go through the references.
References and further reading list
1: https://www.postgresql.org/files/documentation/pdf/11/postgresql-11-A4.pdf
2: https://www.digitalocean.com/community/tutorials/how-to-install-and-use-postgresql-on-ubuntu-16-04
3: https://severalnines.com/blog/top-gui-tools-postgresql


Before Change
// file lock to prevent race condition
with fasteners.InterProcessLock("/tmp/report_lock"):
if input is not None:
if script is not None and script.strip():
raise ValueError("Please specify only one of parameter script and input: script={}, input={}".format(script, input))
if isinstance(input, str):
env.logger.debug("Loading report from {}".format(input))
with open(input) as ifile:
writer(ifile.read())
After Change
try:
env.logger.debug("Loading report from {}".format(ifile))
with open(ifile) as itmp:
writer(itmp.read().rstrip() + "\n\n")
except Exception as e:
raise ValueError("Failed to read input file {}: {}".format(ifile, e))
else:


Theming service allows to automatically set theme based on provided URL query parameter.
Parameter name can be configured through ThemingModule
.
See example by adding ?customQueryParam=sap_fiori_3_dark
to URL.
To make it work properly, you need to have imported RouterModule
into the project.
Developers can easily configure ThemingService
and provide custom configuration object to
manipulate the behaviour of ThemingService
.
For more information please refer to ThemingConfig
class available in the API section.
ThemingModule
.


Before Change
for x in xrange(5):
for y in xrange(5):
countries = ["US", "Russia", "China", "Bulgaria"]
country = countries[bdb._np_prng.randint(0, len(countries))]
mass = bdb._np_prng.normal(1000, 50)
bdb.sql_execute("""
INSERT INTO satellites_ucs
(country_of_operator, launch_mass, class_of_orbit,
After Change
SELECT COUNT(*) FROM satellites_ucs
""").next()[0]
for rowid in xrange(n_rows):
bdb.sql_execute("""
UPDATE satellites_ucs
SET relaunches = (SELECT apogee + perigee)
WHERE _rowid_ = ?
""", (rowid+1,))
// Nobody will ever create a QUAGGA statistical type!
with pytest.raises(BQLError):
// No such statistical type at the moment.
bdb.execute("""


Get ready to work smarter, better, faster
Combining messaging with file sharing and tasks, Fleep has everything you need to coordinate your team’s work from idea to execution.
Create account Get fleep for AndroidCombining messaging with file sharing and tasks, Fleep has everything you need to coordinate your team’s work from idea to execution.
Create account Get fleep for AndroidConversations are at the heart of Fleep. Set them up around projects, teams or any specific topics to stay connected and discuss ideas. Highlight any decisions or plans on the conversation's Pinboard and create tasks to coordinate execution.
Communicate with any other Fleep user or team, without having to sign out or sign in separately. Simply search for and add your partners or clients to the conversation. If they're not Fleep users yet, send them an invite to join you.
Use Fleep on the web browser or on the native apps for Windows, Mac, Linux, Android or iOS. Your files and messages are stored securely in the cloud, accessible from any device you log in from.
Download FleepReady to go?
Try Fleep now.
Fleep logo
Copyright © Fleep Technologies
All Rights Reserved


Location/Hours
Members
Menu
Story
Become a Member
Full Name:
Email:
Phone Number:
Address:
City:
Postal Code:
Province:
Birth date:
Where did you find out about us?
Friend/Colleague
Google
News
Other, Please Specify:
Submit


APOLLO 13 A film review by Ed Powell Copyright 1995 Ed Powell
All I could think of during the movie was the film MAROONED (starring Gregory Peck & Gene Hackman), and how APOLLO 13 was so much better than it.
The story of APOLLO 13 isn't fiction ... it is a dramatic recreation of the actual situation that happened during the Apollo 13 mission to the moon. During the flight to the moon, one of the oxygen tanks on the command module exploded, causing massive system failures. It was on luck and ingenuity alone that the crew of the Apollo 13 mission made it back to Earth alive.
I cannot comment on the story and plot of this film. It was so incredible, that it could not have come from anywhere but real life. The writing also falls under this description, except that there were some moments that seemed a bit false ... a little artificial. The film, though, was filled with drama, emotion, and moments of comedy. An excellent script.
There cannot be enough praise for the actors. Although I cannot really name names at the moment (my local paper doesn't have an ad for the film in it), all were quite convincing in their roles.
Design of the film was consistent with the time period, that being the late 60s/early 70s. A couple of items, however, seemed to be a bit too modern for the time period. The computer text on the screen at Mission Control looked like they came off of an off-the-shelf IBM PS/2, and a few of the controls on the space vehicles looked like they came from the modern-day Space Shuttle. Then again, I am not an expert on space vehicles ... all of this could have been 100% accurate.
There were quite a few visual effects in the film, all of which looked very realistic. Tom Hank's character's daydream of walking on the moon looked as if they actually went to the moon and filmed the scene. All the zero-gee effects were realistic ... because they were actually in zero gravity! They filmed those scenes inside of the training airplane lovingly known as the "Vomit Comet," where the plane goes up to about 35,000 feet and then dives, giving up to 30 seconds of near zero gravity conditions inside the plane. Very well thought out, very well executed.
Ron Howard did a splendid job of directing this film. My only complaint is that there were just a few too many fancy camera moves ... I felt at times I was going to be sick with all the tilts, pans, and zooms the camera was doing.
The music for the film was absolutely PERFECT! From opening credits to the end of the film, the music evoked the right emotions and the right times. Even I, ol' Joey "Stoneheart" Lemur, was brought to tears at times (all quickly blinked back, of course.)
This film contained strong language at times, and was quite emotional. You might want to think twice before bringing children under thirteen to see this film. Teens and older will thoroughly enjoy this film, though.
I cannot recommend this film enough. This will probably win Best Picture at this year's Oscars. It is a stunning film, filled with nail-biting tension and peppered with lighter moments. Go. See it. You'll be glad you did! :-)
Produced by Brian Grazer, directed by Ron Howard. A Universal Pictures release.
RATINGS (out of ten) -------------------- Plot/Story: 10 Writing: 9 Acting: 8 Design: 7 Effects: 9 Direction: 9 Family Value: 7 Music: 10
TOTAL: 69 out of 80 (Overall: 8.625)
-- Ed Powell, MSTie #27968
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


From https://www.blackhat.com/docs/us-17/thursday/us-17-Munoz-Friday-The-13th-Json-Attacks.pdf
FastJSON
Always includes Type discriminators
There is no Type check controls other than a post-deserialization cast - Var obj = (ExpectedType) JSON.ToObject(untrusted);
Invokes
Should never be used with untrusted data
Example:
JavaScriptSerializer
System.Web.Script.Serialization.JavaScriptSerializer
By default, it will not include type discriminator information - Type Resolver can be used to include this information.
- JavaScriptSerializer sr = new JavaScriptSerializer(new SimpleTypeResolver());
- string reqdInfo = apiService.authenticateRequest();
- reqdDetails det = (reqdDetails)(sr.Deserialize(reqdInfo));
Weak Type control: post-deserialization cast operation
During deserialization, it will call:
It can be used securely as long as a type resolver is not used or the type resolver is configured to whitelist valid types.
System.Runtime.Serialization.Json.DataContractJsonSerializer
Performs a strict type graph inspection and whitelist creation.
However, we found that if the attacker can control the expected type used to configure the deserializer, they will be able to gain code execution. Eg: - var typename = cookie["typename"];
- …
- var serializer = new DataContractJsonSerializer(Type.GetType(typename));
- var obj = serializer.ReadObject(ms);
Invokes: - Setters
- Serialization Constructors
Can be used securely as long as the expected type cannot be controlled by users.
Json.Net
It does not include Type discriminators unless TypeNameHandling setting other than None is used
Performs an inspection of Expected Type’s Object Graph - public class Message {
- [JsonProperty(TypeNameHandling = TypeNameHandling.All)]
- public object Body { get; set; }
- }
Invokes: - Setters
- Serialization callbacks
- Type Converters
Use SerializationBinder to whitelist Types if TypeNameHandling is required


The following option launches the selected Development Tool from the left navigation bar.
The Minecraft-DT2 launcher will shutdown after successful execution of the selected Development Tool.
The following option checks if a new version of the Minecraft-DT2 launcher is available. All release notes are then displayed in the main body.
Note that this option requires an internet connection to compare the necessary data from our official website API.
The following option removes all files from the selected Development Tools directory. Once pressed, the user is asked to confirm the deletion action.


snprintf
OS/161 Reference Manual
Name
snprintf - print formatted text to string
Library
Standard C Library (libc, -lc)
Synopsis
#include <unistd.h>
int
snprintf(char *buf, size_t buflen,
const char *format, ...);
int
vsnprintf(char *buf, size_t buflen,
const char *format, va_list);
Description
snprintf performs printf-style formatting on
the string format and subsequent arguments. The resulting
string is placed in buf, which is a memory area at least
buflen bytes long. A null terminator is always added to
buf; the space for this is presumed to be counted in
buflen.
vsnprintf is the same as snprintf, except that the subsequent
arguments are presumed to have already been collected using the
stdarg facility.
Return Values
snprintf and vsnprintf return the number of characters printed.


--- title: Building a levitating LEGO Baby Yoda model with R author: Luke McGuinness date: '2021-02-02' slug: baby-yoda-in-r categories: - R - side-project - LEGO tags: [] math: no meta: yes excerpt : "\"Always more questions than answers, there are.\"" ---
As a kid I was fascinated with LEGO sets, and last year, with the additional free time that lockdown provided, I got back into playing around with some old pieces. Discovery of the amazing brickr
R package, which allows you to create 3D models from LEGO bricks, led me to marry my interests and try to create a levitating LEGO Baby Yoda/Grogu model.
The finished product is shown in the GIF below:
Always pass on what you have learned.
Taking the true Yoda’s advice, this post contains the detailed brick requirements and building instructions for creating your own Baby Yoda/Grogu LEGO model.
The model was designed using brickr
and was adapted from the LEGO Baby Yoda/Grogu model originally designed by Ryan Timpe.See here for the code for that model, and here for Ryan’s GitHub profile. Adaption was necessary, as the original model contained a number of “floating bricks” (i.e. bricks that are not supported by another brick from either above or below), which work fine when rendering the model in R but cannot be used in a physical version.
All data and code needed to reproduce the model are available from the GitHub repository for this project.See here.
The pieces you will need to build your own LEGO Baby Yoda/Grogu model are listed in the image below. These can be acquired from the Pick A Brick service on the LEGO store website.See here. The total cost for all pieces included in this model was ~£30 pounds.
The instructions below will guide you through building your own Baby Yoda, using the pieces detailed in the previous section. It can sometimes be awkward to get some of the pieces to work together when building from the bottom up, as they are supported by a brick on the next level up. In this case, a useful tip is to try building down (i.e. descending through the steps).
The finished model should look something like this:
More photos of the finished model from different angles can be found here.
As shown in the GIF at the start of this post,Jump to GIF this model was designed to work with a electromagnetic levitation display to give it a true-to-life feel. I used the Hongzer Magnetic Levitation Platform (£6-7 pounds from Amazon),See here. but it will (/should!) work with any display where the diameter of the floating magnet is <5.5cm.


Wainaina Alvin is my name, student at Moringa school undertaking the Pre section "The first stage towards becoming a fully fledged software developer". I currently completed my degree.I've had minimal work experience pertaining the tech field but looking foward togo far and beyond in gaining to aquiring the right content in the tech field.
The reasons why I chose to do programming is because of the endless possibilities that come with the skills aquired to keep up with the new trends in computing
some of the projects I've engaged myself in so far are listed below :-
hello world hello-world
My-FavouriteMy-Favourite
Band Project Band-Project
Here is a link to the webpage web-pagelink
My intersts and hobbies span over various activities


Enter the name of the topic in a stream that you want to send build notifications or messages to. You can additionally customize the topic name on a per-project basis. If you don't set topic here or in project, project name will be used as topic name.
You can use Jenkins build environment variables like build or project name in the topic name.


§501-46 Default; effect. If no person appears and answers within the time allowed, the court may at once, upon motion of the applicant and no reason to the contrary appearing, order a general default to be recorded and the application to be taken for confessed. By the description in the notice "to all whom it may concern," all the world are made parties defendant and shall be concluded by the default and order. After the default and order the court may enter a decree confirming the title of the applicant and ordering registration of the same. The court shall not be bound by the report of the examiner of title, but may require other or further proof. [L 1903, c 56, §35; RL 1925, §3224; RL 1935, §5029; RL 1945, §12629; RL 1955, §342-30; HRS §501-46]
Cross References
Duty of attorney general when there are grounds for contesting, see §501-44.
Case Notes
Cited: 35 H. 816, 822.


Walking Dead Quiz
How many walkers have you killed?
1 - 5
6 - 20
I've lost count...
How many people have you killed?
0 - 3
4 - 10
Too many to remember...
Why?
To save my family's life.

Submit
You are GLENN!
You are CARL!
You are the GOVERNOR!


---
layout: post
date: 2011-03-15
time: "10:00:00"
authors: ["Greg Wilson"]
title: Twenty Questions (Minus Two)
tags: ["Content", "Education"]
---
Following up on last week's musings about reorganizing the course, we've drawn up eighteen questions that we think cover the reasons people come to this course. That leaves us two short of the traditional twenty: what would you add to this list?
- How can I automate this task?
- How can I read/control hardware?
- How can I control my program?
- How do I count things?
- How can I clean up this data?
- How can I get insight into my data?
- How do I track down bugs in my program?
- How can I parse this legacy data file?
- How can I save data so that I can read it later?
- How can I tell if my program is working correctly?
- How can I make this program easier to use?
- How can I use remote machines?
- How can I reuse this legacy program?
- How can I share my work with others?
- How can I make my program faster?
- How can I make my code easier to reuse?
- How can I keep track of my work?
- How can I plug my code into a framework like Galaxy or Taverna?


Not specific to this projec, but can be incredibly useful ways to maximizes your time. Mastering the command line is the best way to get things done, quick and cheaply.
Reapeat after me:
Some very big time-saving commands
Some people like it. sed -- i always use "perl -pe 's/find/replace/'")
Getting used to using perl is better. This page was originally written thinking markdown had table support like confluence does. Soo all lines where using "| command | description |" formatting. Markdown doesn't have that, so I changed it to a list syntax with the following command on my mac:
pbpaste | perl -ne '@f = split(" *\\| *", $_); print " - **$f[1]** - $f[2]\n"' | pbcopy


The istream and ostream iterators by themselves have no means of indicating the success or failure of an operation. The stream being operated on should be probed for good(), eof(), fail(), or bad() conditions. This is convenient, as stream state can be checked for exception conditions that were set in basic_ios (using the member function exceptions(iostate)) after each input or output operation.
void print() { std::ostream_iterator<int, char, char_traits<char> > os(cout); try { std::cout.exceptions (std::ios::failbit | std::ios::badbit); *os = 3; //output `3' os++; // receive next output } catch(std::ios_base::failure& emsg) { std::cerr<<emsg.what(); } }
Since stream buffers do not retain information about the success or failure of operations, streambuf iterators provide a member function, failed(), to indicate success or failure in a preceding operation on the stream buffer.


Introduction
Welcome to the 1MT Authentication API. Use this API to manage the syncing of user authentication data from your MT platform to the 1MT authentication service.
Authentication
All calls to the API require a valid access token. Once granted (provided they are not revoked), tokens are valid for 12 hours.
Requesting access tokens
Request an access token:
POST /auth/token HTTP/1.1
Accept: application/json
Authorization: Basic Y3ItZWNvbW06YTljZTFhMWYtOWI1ZS00ZDllLTkzYjctN2VmMTBmZWRiZDYz
Content-Type: application/json
Host: id.markettrack.com
User-Agent: PriceVision/1.0.0
{
"grant_type": "client_credentials"
}
curl /auth/token
-H "Content-Type: application/json"
-X POST
-u identifier:secret
-d '{"grant_type": "client_credentials"}'
A successful response:
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: ea49faf8-f7ad-48fa-b72a-e659db0f16e4
{
"access_token": "216fee3f-404d-4663-b32a-dcb765020125",
"expires_at": "2017-02-01T16:59:20.112Z",
"token_type": "Bearer"
}
Access tokens are granted at the end of an OAuth2 client-credentials handshake. To request a new token, use HTTP basic auth with your platform ID and secret to POST to the /auth/token
endpoint. The grant_type
body parameter should be set to ‘client_credentials’.
"grant_type": "client_credentials"
If the token request is valid and authorised, the access token is returned in the JSON body of the response, along with details of its expiry.
Invalid token requests result in a 401
error. If encountered, check the platform credentials that were supplied.
A note on case
In order to conform to OAuth2 specifications, all request/response parameters specific to authentication are in snake_case
. This is different to the wider 1MT API convention, where all such parameters are presented in camelCase
.
HTTP request
POST /auth/token
Body parameters
| Parameter | Type | Default |
|---|---|---|
| grant_type | string |
Using access tokens
Authenticate a request:
GET /api/v1 HTTP/1.1
Accept: application/json
Authorization: Bearer 216fee3f-404d-4663-b32a-dcb765020125
Host: id.markettrack.com
User-Agent: PriceVision/1.0.0
curl /api/v1
-H "Authorization: Bearer 216fee3f-404d-4663-b32a-dcb765020125"
In possession of a valid access token, you can make requests to the API. Credentials should be passed as bearer tokens in the request header…
Authorization: Bearer 216fee3f-404d-4663-b32a-dcb765020125
Recall that invalid or expired tokens will result in a 401: Bad Request
error.
Using the API
Status codes
The 1MT Authentication API uses the following status codes:
| Code | Description |
|---|---|
| 200 | OK: the request succeeded |
| 201 | Created: one or more resources created |
| 204 | No Content: success, but nothing to return |
| 400 | Bad Request: malformed or invalid request |
| 401 | Unauthorized: the access token is invalid |
| 403 | Forbidden: insufficient permissions |
| 404 | Not Found: the requested resource could not be found |
| 406 | Not Acceptable: a format was requested that isn’t JSON |
| 409 | Conflict: internal resource state conflict |
| 410 | Gone: the requested resource has been removed |
| 415 | Unsupported Media Type: the request’s payload is not JSON |
| 422 | Unprocessable Entity: validation failed |
| 500 | Internal Server Error: unexpected API error |
| 503 | Service Unavailable: API temporarily offline |
Making requests
All requests to the API should be over HTTPS.
HTTP verbs
The API uses RESTful design patterns. As such, it implements the following HTTP verbs:
| Verb | Description |
|---|---|
| GET | Read resource(s) |
| POST | Create new resource |
| PATCH | Modify existing resource |
| DELETE | Remove resource |
Content type
When making requests, ensure that the Accept
header is set to application/json
and, when relevant, make sure that the Content-Type
is also set to application/json
.
User agent
Set the user agent according to the platform name and current version.
User-Agent: PriceVision/1.0.0
Responses
A successful response:
{
"succeeded": true,
"message": "User created<EMAIL_ADDRESS>"data": {
"name": "Me",
"email"<EMAIL_ADDRESS>}
}
An unsuccessful response:
{
"succeeded": false,
"message": "RAML validation error",
"data": {
"fields": [{
"field": "firstName",
"value": "null",
"error": "invalid json (required, true)"
}]
}
}
Outside of authentication, all API responses have a similar JSON payload.
| Key | Type | Description |
|---|---|---|
| succeeded | boolean | Whether or not the request was successful |
| message | string | A short description of the response |
| data | object | An optional object describing the result in detail |
Errors
Unsuccessful responses can include details on the error in the data
object. For example, a validation error would include each invalid field and describe why the validation failed.
Request ID
Each request to the API is given a unique request ID. This is passed back in the response via the X-Request-Id
header…
x-Request-Id: ea49faf8-f7ad-48fa-b72a-e659db0f16e4
If you want to pass on your own request ID as part of a communication chain, then supply a similar header in the request. When such a header is identified, the API will not create a new ID, but will instead pass back the supplied ID in the response.
Fields
IDs
All resource IDs are represented in UUID format…
"id": "4a8e9a36-c902-42c5-bbd6-19d222acf178"
Timestamps
All timestamps are returned in ISO8601 format, in UTC, with fields ending in the postfix _at or At…
"expires_at": "2016-12-01T00:55:47Z"
"createdAt": "2016-12-01T00:55:47Z"
Base API
Available at /api/v1
.
Hello
Check API status:
GET /api/v1 HTTP/1.1
Accept: application/json
Authorization: Bearer Y3ItZWNvbW06YTljZTFhMWYtOWI1ZS00ZDllLTkzYjctN2VmMTBmZWRiZDYz
Host: id.markettrack.com
User-Agent: PriceVision/1.0.0
curl /api/v1
-H "Authorization: Bearer 216fee3f-404d-4663-b32a-dcb765020125"
A successful response:
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: ea49faf8-f7ad-48fa-b72a-e659db0f16e4
{
"succeeded": true,
"message": "Hello from 1MT resource server"
}
Check status of API.
HTTP request
GET /api/v1
Users API
Available at /api/v1/users
.
User resource
Example user payload:
{
"id": "da2d3e9a-e84e-11e6-bf01-fe55135034f3",
"firstName": "Fred",
"lastName": "Flintstone",
"email"<EMAIL_ADDRESS>"status": "active",
"internal": false,
"createdAt": "2016-12-01T00:55:47Z",
"updatedAt": "2016-12-01T00:55:47Z",
"subscription": {
"id": "f5e9dc78-e84f-11e6-bf01-fe55135034f3",
"status": "active",
"default": false,
"createdAt": "2016-12-01T00:55:47Z",
"updatedAt": "2016-12-01T00:55:47Z",
"accounts": [{
"id": "f9a5b170-e84f-11e6-bf01-fe55135034f3",
"identifier": "fred",
"name": "Fred's account",
"status": "active",
"default": false,
"createdAt": "2016-12-01T00:55:47Z",
"updatedAt": "2016-12-01T00:55:47Z"
}]
}
}
| Attribute | Type | Description |
|---|---|---|
| id | string | User ID |
| firstName | string | |
| lastName | string | |
| string | /[a-z0-9._%+-]+@[a-z0-9.-]+.[a-z]{2,}/ | |
| status | string | One of: active, inactive, orphaned, pending |
| internal | boolean | Internal user? |
| createdAt | datetime | |
| updatedAt | datetime | |
| subscription | Subscription | User’s subscription to current platform |
User status
A user can have one of four states.
| Status | Description |
|---|---|
| active | The user is allowed to authenticate |
| inactive | The user has been disabled and cannot authenticate |
| orphaned | The user has been addedm but has no subscriptions |
| pending | The user has been added, but has yet to validate their email address |
Create user
Create user:
POST /api/v1/users HTTP/1.1
Accept: application/json
Authorization: Bearer Y3ItZWNvbW06YTljZTFhMWYtOWI1ZS00ZDllLTkzYjctN2VmMTBmZWRiZDYz
Content-Type: application/json
Host: id.markettrack.com
User-Agent: PriceVision/1.0.0
{
"firstName": "Fred",
"lastName": "Flintstone",
"email"<EMAIL_ADDRESS>}
curl /api/v1/users
-H "Authorization: Bearer 216fee3f-404d-4663-b32a-dcb765020125"
-H "Content-Type: application/json"
-X POST
-d '{"firstName": "Fred", "lastName": "Flintstone", "email"<EMAIL_ADDRESS>A successful response:
HTTP/1.1 201 OK
Content-Type: application/json
X-Request-Id: ea49faf8-f7ad-48fa-b72a-e659db0f16e4
{
"succeeded": true,
"message": "User created: da2d3e9a-e84e-11e6-bf01-fe55135034f3",
"data": {
"user": "payload"
}
}
Create a new user (and optionally a subscription and account).
Note
If an account identifier is given, a subscription and an accompanying account is also created.
HTTP request
POST /api/v1/users
Body parameters
| Parameter | Type | Default |
|---|---|---|
| firstName | string | |
| lastName | string | |
| string | ||
| internal? | boolean | false |
| account.identifier? | string | null |
Get user
Get user:
GET<EMAIL_ADDRESS>HTTP/1.1
Accept: application/json
Authorization: Bearer Y3ItZWNvbW06YTljZTFhMWYtOWI1ZS00ZDllLTkzYjctN2VmMTBmZWRiZDYz
Host: id.markettrack.com
User-Agent: PriceVision/1.0.0
GET /api/v1/users/da2d3e9a-e84e-11e6-bf01-fe55135034f3 HTTP/1.1
Accept: application/json
Authorization: Bearer Y3ItZWNvbW06YTljZTFhMWYtOWI1ZS00ZDllLTkzYjctN2VmMTBmZWRiZDYz
Host: id.markettrack.com
User-Agent: PriceVision/1.0.0
curl<EMAIL_ADDRESS>-H "Authorization: Bearer 216fee3f-404d-4663-b32a-dcb765020125"
curl /api/v1/users/da2d3e9a-e84e-11e6-bf01-fe55135034f3
-H "Authorization: Bearer 216fee3f-404d-4663-b32a-dcb765020125"
A successful response:
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: ea49faf8-f7ad-48fa-b72a-e659db0f16e4
{
"succeeded": true,
"message": "User found<EMAIL_ADDRESS>"data": {
"user": "payload"
}
}
Get details of a specific user.
HTTP request
GET /api/v1/users/:userIdentifier
URL parameters
| Parameter | Type | Description |
|---|---|---|
| userIdentifier | string | Email or ID of user |
Update user
Update user:
PATCH<EMAIL_ADDRESS>HTTP/1.1
Accept: application/json
Authorization: Bearer Y3ItZWNvbW06YTljZTFhMWYtOWI1ZS00ZDllLTkzYjctN2VmMTBmZWRiZDYz
Content-Type: application/json
Host: id.markettrack.com
User-Agent: PriceVision/1.0.0
{
"firstName": "Wilma"
}
curl<EMAIL_ADDRESS>-H "Authorization: Bearer 216fee3f-404d-4663-b32a-dcb765020125"
-H "Content-Type: application/json"
-X PATCH
-d '{"firstName": "Wilma"}'
A successful response:
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: ea49faf8-f7ad-48fa-b72a-e659db0f16e4
{
"succeeded": true,
"message": "User updated<EMAIL_ADDRESS>"data": {
"user": "payload"
}
}
Update an existing user.
Note
At least one body parameter is required.
HTTP request
PATCH /api/v1/users/:userIdentifier
URL parameters
| Parameter | Type | Description |
|---|---|---|
| userIdentifier | string | Email or ID of user |
Body parameters
| Parameter | Type | Default |
|---|---|---|
| firstName? | string | null |
| lastName? | string | null |
Delete user
Delete user:
DELETE<EMAIL_ADDRESS>HTTP/1.1
Accept: application/json
Authorization: Bearer Y3ItZWNvbW06YTljZTFhMWYtOWI1ZS00ZDllLTkzYjctN2VmMTBmZWRiZDYz
Host: id.markettrack.com
User-Agent: PriceVision/1.0.0
curl<EMAIL_ADDRESS>-H "Authorization: Bearer 216fee3f-404d-4663-b32a-dcb765020125"
-X DELETE
A successful response:
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: ea49faf8-f7ad-48fa-b72a-e659db0f16e4
{
"succeeded": true,
"message": "User deleted: da2d3e9a-e84e-11e6-bf01-fe55135034f3"
}
Delete an existing user.
Note
The operation will fail with a 409
error if the user is subscribed to other platforms.
HTTP request
DELETE /api/v1/users/:userIdentifier
URL parameters
| Parameter | Type | Description |
|---|---|---|
| userIdentifier | string | Email or ID of user |
Subscriptions API
A subscription defines a user’s ability to access a platform. A user can have multiple subscriptions, but can only have one to each platform. If a user has more than one subscription, one of them can be flagged as being the default one.
Available at /api/v1/users/:userIdentifier/subscription
.
Subscription resource
Example subscription payload:
{
"id": "f5e9dc78-e84f-11e6-bf01-fe55135034f3",
"status": "active",
"default": false,
"createdAt": "2016-12-01T00:55:47Z",
"updatedAt": "2016-12-01T00:55:47Z",
"accounts": [{
"id": "f9a5b170-e84f-11e6-bf01-fe55135034f3",
"identifier": "fred",
"name": "Fred's account",
"status": "active",
"default": false,
"createdAt": "2016-12-01T00:55:47Z",
"updatedAt": "2016-12-01T00:55:47Z"
}]
}
| Attribute | Type | Description |
|---|---|---|
| id | string | Subscription ID |
| status | string | One of: active, inactive |
| default | boolean | Default subscription? |
| createdAt | datetime | |
| updatedAt | datetime | |
| accounts | Account[] | Accounts associated to the subscription |
Create subscription
Create subscription:
POST<EMAIL_ADDRESS>HTTP/1.1
Accept: application/json
Authorization: Bearer Y3ItZWNvbW06YTljZTFhMWYtOWI1ZS00ZDllLTkzYjctN2VmMTBmZWRiZDYz
Content-Type: application/json
Host: id.markettrack.com
User-Agent: PriceVision/1.0.0
{}
curl<EMAIL_ADDRESS>-H "Authorization: Bearer 216fee3f-404d-4663-b32a-dcb765020125"
-H "Content-Type: application/json"
-X POST
-d '{}'
A successful response:
HTTP/1.1 201 OK
Content-Type: application/json
X-Request-Id: ea49faf8-f7ad-48fa-b72a-e659db0f16e4
{
"succeeded": true,
"message": "Subscription created: f5e9dc78-e84f-11e6-bf01-fe55135034f3",
"data": {
"subscription": "payload"
}
}
Create a new subscription (and optionally an associated account).
Notes
If an account identifier is given, an accompanying account is also created.
A user can only have one default subscription.
HTTP request
POST /api/v1/users/:userIdentifier/subscription
URL parameters
| Parameter | Type | Description |
|---|---|---|
| userIdentifier | string | Email or ID of user |
Body parameters
| Parameter | Type | Default |
|---|---|---|
| default | boolean | false |
| account.identifier? | string | null |
Get subscription
Get subscription:
GET<EMAIL_ADDRESS>HTTP/1.1
Accept: application/json
Authorization: Bearer Y3ItZWNvbW06YTljZTFhMWYtOWI1ZS00ZDllLTkzYjctN2VmMTBmZWRiZDYz
Host: id.markettrack.com
User-Agent: PriceVision/1.0.0
curl<EMAIL_ADDRESS>-H "Authorization: Bearer 216fee3f-404d-4663-b32a-dcb765020125"
A successful response:
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: ea49faf8-f7ad-48fa-b72a-e659db0f16e4
{
"succeeded": true,
"message": "Subscription found: f5e9dc78-e84f-11e6-bf01-fe55135034f3",
"data": {
"subscription": "payload"
}
}
Get details of the subscription associated to the given user and platform.
HTTP request
GET /api/v1/users/:userIdentifier/subscription
URL parameters
| Parameter | Type | Description |
|---|---|---|
| userIdentifier | string | Email or ID of user |
Update subscription
Update subscription:
PATCH<EMAIL_ADDRESS>HTTP/1.1
Accept: application/json
Authorization: Bearer Y3ItZWNvbW06YTljZTFhMWYtOWI1ZS00ZDllLTkzYjctN2VmMTBmZWRiZDYz
Content-Type: application/json
Host: id.markettrack.com
User-Agent: PriceVision/1.0.0
{
"status": "inactive"
}
curl<EMAIL_ADDRESS>-H "Authorization: Bearer 216fee3f-404d-4663-b32a-dcb765020125"
-H "Content-Type: application/json"
-X PATCH
-d '{"status": "inactive"}'
A successful response:
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: ea49faf8-f7ad-48fa-b72a-e659db0f16e4
{
"succeeded": true,
"message": "Subscription updated: f5e9dc78-e84f-11e6-bf01-fe55135034f3",
"data": {
"subscription": "payload"
}
}
Update an existing subscription.
Notes
At least one body parameter is required.
A user can only have one default subscription.
HTTP request
PATCH /api/v1/users/:userIdentifier/subscription
URL parameters
| Parameter | Type | Description |
|---|---|---|
| userIdentifier | string | Email or ID of user |
Body parameters
| Parameter | Type | Default |
|---|---|---|
| status? | string | null |
| default? | boolean | null |
Delete subscription
Delete subscription:
DELETE<EMAIL_ADDRESS>HTTP/1.1
Accept: application/json
Authorization: Bearer Y3ItZWNvbW06YTljZTFhMWYtOWI1ZS00ZDllLTkzYjctN2VmMTBmZWRiZDYz
Host: id.markettrack.com
User-Agent: PriceVision/1.0.0
curl<EMAIL_ADDRESS>-H "Authorization: Bearer 216fee3f-404d-4663-b32a-dcb765020125"
-X DELETE
A successful response:
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: ea49faf8-f7ad-48fa-b72a-e659db0f16e4
{
"succeeded": true,
"message": "Subscription deleted: f5e9dc78-e84f-11e6-bf01-fe55135034f3"
}
Delete an existing subscription.
HTTP request
DELETE /api/v1/users/:userIdentifier/subscription
URL parameters
| Parameter | Type | Description |
|---|---|---|
| userIdentifier | string | Email or ID of user |
Accounts API
Available at /api/v1/users/:userIdentifier/accounts
.
Account resource
Example account payload:
{
"id": "f9a5b170-e84f-11e6-bf01-fe55135034f3",
"identifier": "fred",
"name": "Fred's account",
"status": "active",
"default": false,
"createdAt": "2016-12-01T00:55:47Z",
"updatedAt": "2016-12-01T00:55:47Z"
}
| Attribute | Type | Description |
|---|---|---|
| id | string | Subscription ID |
| identifier | string | Unique account identifier (e.g. username) |
| status | string | One of: active, inactive |
| default | boolean | Default account? |
| createdAt | datetime | |
| updatedAt | datetime |
Create account
Create account:
POST<EMAIL_ADDRESS>HTTP/1.1
Accept: application/json
Authorization: Bearer Y3ItZWNvbW06YTljZTFhMWYtOWI1ZS00ZDllLTkzYjctN2VmMTBmZWRiZDYz
Content-Type: application/json
Host: id.markettrack.com
User-Agent: PriceVision/1.0.0
{
"identifier": "fred"
}
curl<EMAIL_ADDRESS>-H "Authorization: Bearer 216fee3f-404d-4663-b32a-dcb765020125"
-H "Content-Type: application/json"
-X POST
-d '{"identifier": "fred"}'
A successful response:
HTTP/1.1 201 OK
Content-Type: application/json
X-Request-Id: ea49faf8-f7ad-48fa-b72a-e659db0f16e4
{
"succeeded": true,
"message": "Account created: f9a5b170-e84f-11e6-bf01-fe55135034f3",
"data": {
"account": "payload"
}
}
Create a new account.
Note
A subscription can only have one default account.
HTTP request
POST /api/v1/users/:userIdentifier/accounts
URL parameters
| Parameter | Type | Description |
|---|---|---|
| userIdentifier | string | Email or ID of user |
Body parameters
| Parameter | Type | Default |
|---|---|---|
| identifier | string | |
| name? | string | |
| default? | boolean | false |
Get accounts
Get accounts:
GET<EMAIL_ADDRESS>HTTP/1.1
Accept: application/json
Authorization: Bearer Y3ItZWNvbW06YTljZTFhMWYtOWI1ZS00ZDllLTkzYjctN2VmMTBmZWRiZDYz
Host: id.markettrack.com
User-Agent: PriceVision/1.0.0
curl<EMAIL_ADDRESS>-H "Authorization: Bearer 216fee3f-404d-4663-b32a-dcb765020125"
A successful response:
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: ea49faf8-f7ad-48fa-b72a-e659db0f16e4
{
"succeeded": true,
"message": "Accounts found: 2",
"data": [{
"account": "payload"
}, {
"account": "payload"
}]
}
Get details of all accounts belonging to the given subscription.
HTTP request
GET /api/v1/users/:userIdentifier/accounts
URL parameters
| Parameter | Type | Description |
|---|---|---|
| userIdentifier | string | Email or ID of user |
Get account
Get account:
GET<EMAIL_ADDRESS>HTTP/1.1
Accept: application/json
Authorization: Bearer Y3ItZWNvbW06YTljZTFhMWYtOWI1ZS00ZDllLTkzYjctN2VmMTBmZWRiZDYz
Host: id.markettrack.com
User-Agent: PriceVision/1.0.0
curl<EMAIL_ADDRESS>-H "Authorization: Bearer 216fee3f-404d-4663-b32a-dcb765020125"
A successful response:
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: ea49faf8-f7ad-48fa-b72a-e659db0f16e4
{
"succeeded": true,
"message": "Account found: f9a5b170-e84f-11e6-bf01-fe55135034f3",
"data": {
"account": "payload"
}
}
Get details of given account.
HTTP request
GET /api/v1/users/:userIdentifier/accounts/:accountIdentifier
URL parameters
| Parameter | Type | Description |
|---|---|---|
| userIdentifier | string | Email or ID of user |
| accountIdentifier | string | Identifier or ID of account |
Update account
Update account:
PATCH<EMAIL_ADDRESS>HTTP/1.1
Accept: application/json
Authorization: Bearer Y3ItZWNvbW06YTljZTFhMWYtOWI1ZS00ZDllLTkzYjctN2VmMTBmZWRiZDYz
Content-Type: application/json
Host: id.markettrack.com
User-Agent: PriceVision/1.0.0
{
"status": "inactive"
}
curl<EMAIL_ADDRESS>-H "Authorization: Bearer 216fee3f-404d-4663-b32a-dcb765020125"
-H "Content-Type: application/json"
-X PATCH
-d '{"status": "inactive"}'
A successful response:
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: ea49faf8-f7ad-48fa-b72a-e659db0f16e4
{
"succeeded": true,
"message": "Account updated: f5e9dc78-e84f-11e6-bf01-fe55135034f3",
"data": {
"account": "payload"
}
}
Update an existing account.
Notes
At least one body parameter is required.
A subscription can only have one default account.
HTTP request
PATCH /api/v1/users/:userIdentifier/accounts/:accountIdentifier
URL parameters
| Parameter | Type | Description |
|---|---|---|
| userIdentifier | string | Email or ID of user |
| accountIdentifier | string | Identifier or ID of account |
Body parameters
| Parameter | Type | Default |
|---|---|---|
| identifier? | string | |
| name? | string | |
| status? | string | |
| default? | boolean |
Delete account
Delete account:
DELETE<EMAIL_ADDRESS>HTTP/1.1
Accept: application/json
Authorization: Bearer Y3ItZWNvbW06YTljZTFhMWYtOWI1ZS00ZDllLTkzYjctN2VmMTBmZWRiZDYz
Host: id.markettrack.com
User-Agent: PriceVision/1.0.0
curl<EMAIL_ADDRESS>-H "Authorization: Bearer 216fee3f-404d-4663-b32a-dcb765020125"
-X DELETE
A successful response:
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: ea49faf8-f7ad-48fa-b72a-e659db0f16e4
{
"succeeded": true,
"message": "Account deleted: f5e9dc78-e84f-11e6-bf01-fe55135034f3"
}
Delete an existing account.
HTTP request
DELETE /api/v1/users/:userIdentifier/accounts/:accountIdentifier
URL parameters
| Parameter | Type | Description |
|---|---|---|
| userIdentifier | string | Email or ID of user |
| accountIdentifier | string | Identifier or ID of account |
Notifications API
Available at /api/v1/notifications
.
Notification resource
Example notification payload:
{
"id": "e6750448-0481-4ec4-b48d-a87fa7187cf5",
"type": "welcome",
"sentAt": "2016-12-01T00:55:47Z",
"recipient": {
"id": "da2d3e9a-e84e-11e6-bf01-fe55135034f3",
"firstName": "Fred",
"lastName": "Flintstone",
"email"<EMAIL_ADDRESS>"status": "active",
"internal": false,
"createdAt": "2016-12-01T00:55:47Z",
"updatedAt": "2016-12-01T00:55:47Z"
}
}
| Attribute | Type | Description |
|---|---|---|
| id | string | Message ID |
| type | string | Only ‘welcome’ currently supported |
| sentAt | datetime | |
| recipient | User | The recipient of the notification |
Notification type
| Type | Description |
|---|---|
| welcome | Welcomes user to a platform, with password link if applicable |
Create notification
Create account:
POST /api/v1/notifications HTTP/1.1
Accept: application/json
Authorization: Bearer Y3ItZWNvbW06YTljZTFhMWYtOWI1ZS00ZDllLTkzYjctN2VmMTBmZWRiZDYz
Content-Type: application/json
Host: id.markettrack.com
User-Agent: PriceVision/1.0.0
{
"user"<EMAIL_ADDRESS>"type": "welcome"
}
curl /api/v1/notifications
-H "Authorization: Bearer 216fee3f-404d-4663-b32a-dcb765020125"
-H "Content-Type: application/json"
-X POST
-d '{"user"<EMAIL_ADDRESS>"type": "welcome"}'
A successful response:
HTTP/1.1 201 OK
Content-Type: application/json
X-Request-Id: ea49faf8-f7ad-48fa-b72a-e659db0f16e4
{
"succeeded": true,
"message": "Notification sent<EMAIL_ADDRESS>"data": {
"notification": "payload"
}
}
Create a new notification and queue for delivery.
HTTP request
POST /api/v1/notifications
Body parameters
| Parameter | Type | Description |
|---|---|---|
| user | string | Email or ID of user |
| type | string | Only 'welcome’ currently supported |


Opening hours
Is the New York stock exchange open now? Hmm...
Next open NY, USA (GMT-5):
Date:
Open:
Close:
Session open:
Session close:
Is the New York stock exchange open now? Hmm...
Next open NY, USA (GMT-5):


Programmers ask me all the time. Meouzer! How do I display great JavaScript code in HTML that I can be proud of? I say it's just just 50,000 lines of JSHTML that form the basis of every great JavaScript display! Meouzer
To allow JSHTML to convert JavaScript in HTML to formatted JavaScript first include JSHTML.js and JSHTML.css in the header.
<link href="../00-Commons/JSHTML.css" rel="stylesheet" type="text/css" />
Then call applyJSHTML() after the window or body has loaded, e.g.,
Then all divs of class codeBox will have their unformatted JavaScript neatly formatted, with appropriate indentations, code numbers, and colorization. A code box is a div with class codeBox.
The previous box shows formatted JavaScript in a code box. Originally, the JavaScript in the code box could look like the following, but JSHTML don't care.  It will format anyway.
window.addEventListener("load", function() { applyJSHTML(); });
As you can see JSHTML respects line breaks in the unformatted code, turning them into HTML breaks
 in the formatted code.
Switch Specialist
switch(y) { case 1: z++; /* comment comment */ y++; default: /* comment comment*/ "An oyster met an oyster "; y++; } break; } }This paragraph mixed in with the JavaScript code introduces the following table, also mixed in with the JavaScript code, explaining the four indentations.
| The Four Indentations | |||
|---|---|---|---|
| Indentation | Description | Default | Example Lines |
| body indent | The indentation from the left edge to the main body of code |
4 x | 1 |
| brace indent | The indentation from a left brace to subsequent code |
4 x | 2, 7, 10 |
| case indent | The indentation from a case X: to subsequent code |
5 x | 8-9, 11-12, 14-15 |
| implicit indent | The indentation for uncompleted statements. |
4 x | 3-5 |
A code box with attribute data-codeNumbers and value true will have code numbers displayed. Code numbers are displayed only for lines that have code. Displaying numbers for all lines isn't useful and would make the code box look too busy.

To put a shield over the numbers, after the start tag of the code box write an empty div with class numberShield as demonstrated. To give the code box a code listing, which is a number in the top right corner enumerating the code boxes, write an empty div with class codeListing as demonstrated. Both are optional and order of writing doesn't matter.

You can put a number directive on its own line (with nothing else) to turn code numbering off, turn code number back on, or restart code numbering at 1.
Double clicking on a code numbered code box will cause the code numbers to disappear. Double clicking again will bring the code numbers back.
| Number Directives | |
|---|---|
| Directive | Description |
| \numbersOff | stop subsequent code numbering |
| \numbersOn | turn subsequent code numbering back on |
| \numbersRestart | restart code numbering at number 1 |
Use indentation directives to fine tune or change indentations. Only on rare occasions should this be useful. An indentation directive must not be written on its own line. Indentation directives belong at the start of a line of code or at the end of a line of code.
The indentation directives take the form \^xy or \$xy, where x and y are two decimal digits with x usually being zero. At the start or end of a line of code \^xy will move subsequent indentations to the right by xy spaces. At the start or end of a line of code \$xy will move subsequent indentations to the left by xy spaces.
For example the following unformatted JavaScript code

 x = func(a,b, \^09c,d,e, f,g,h, i,j,k);\$09will produce the following formatted JavaScript code.
Observe from code listing 2 that the implicit indent telescopes. For each line of code that does not end the statement, the indentation increases by the implicit indent each time. You might prefer a non telescoping implicit indent shown as follows.
x = func(a, b, c, d, e, f, g, h, i, j, k);
In JSHTML.js, search for var DO_TELESCOPE_IMPLICIT_INDENT and change it's value to false to make non telescoping implicit indents the default.
Also, for a particular code box you can override the default by setting the data-doTelescope attribute to "true" or "false". You can also override the previous two by using the two directives written on their own lines: \telescopeOff; \telescopeOn.
You can see from code listing 1 that JSHTML knows how to place block comments so that everything looks nice and neat. Block comments condense white space.
JSHTML also knows how to place EOL comments. EOL comments respect white spaces, both before and after "//", and does not condense them.
Look at the EOL comments in code listing 1. You can align all five comments by using white space before the comment. To align comment 5, which is on its own line, write one hard space at the beginning of the line and then as many soft white spaces as are needed for alignment. Alignment is always done by trial and error when fonts that aren't monospace are used.
In code listing 1, a code header is shown displaying the text "Indentations." The code header comes before any JavaScript code. Here is how it is achieved.

 Indentations
Inside the code header is pure HTML, so the
 tag is used for line breaks.
The number shield, code listing, and code header are all optional an can be written in any order. The code listing may be placed in the code header.
A code section is a code header for subsequent code, used after some previous code is displayed.
Here's the pertinent code.
function userType(x) { if (x === null) return "null"; if (typeof (x) != 'object' && typeof (x) != 'function') return typeof (x); try { x.constructor; } catch(e) { return "CrossOriginObject";} etc; ...; }  Code Section with Code Numbers Restarting at 1  \numbersRestart function foo(){} function bar(){}
 function foobar(){};
You can also section the code box by using the
 tag.
If xyz is any HTML element other than div, then the element displays pure HTML. That is <xyz>...</xyz> is pure HTML even if it contains div elements.
So divs, not in any non-div element, define the structure of the formatted JavaScript, while other elements output pure HTML.
You might want to quote code for eval to operate on.
To achieve this effect write \c after beginning quotes as in "\c(function(" and "\c)\.
Styling of course is done with JSHTML.css.  However, to set the font of the JavaScript code, and also the font of the HTML mixed in with the JavaScript, to your default preferences see the last two lines of JSHTML.css.
It's too complicated to display the code that produces this. So just look inside this file. It's named index.html and lies in the 06-JSHTML-Guide directory.
Here's a variant of the code box above.


commercetools PAYONE Integration
commercetools GmbH website
PAYONE website
Latest
Functional Tests:
Specification
Outputs
Service unit tests output
Known issues
See
README: Known functional tests issues


{% load static %}
Based on your entries, here's what we were able to locate for you:
{{ingredient.name}} - {{ingredient.price}}
If you would like to build another recipe, click the button below.


Geospatial Web Development
Designing Custom User-Interactive Mapping Interfaces
Health4theWorld PPE Locator
Global Tool Mapping Personal Protective Equipment Supplers
Hydraulic Modeling
Identifying Risk Zones of 7 Regions in Denver County
Columbine Valley Ash Tree Data Collection
Users able to geolocate current position, draw features, add attributes and pictures and view current tree catalog all while mobile in the field
Nissen Reservoir Channel
Alternative Improvements to Existing Channel Bank Conditions
Cherry Hills Village Floodplain
Displaying Risk Areas by Parcel
Surrey Ridge Trails
Interative map of neighborhood biking and pedestrian paths


{% extends "base.html" %} {% block navigation %}
Your password has been set. You may go ahead and log in now.
Login


Chapter 6 Instrumental Variable
6.1 IV without covariates X
Goal: Estimate the causal effect of \(A\) on \(Y\), especially when:
- A is “hopelessly” confounded
- A can never be randomized
Idea: Use “external” random variation in the data to “extract” randomness out of confounded A
Controversy: It’s “impossible” to find such Z.
Set up:
- \(Z \in {0,1}\), Instrumental Variable
- \(A \in {0,1}\), Treatment
- \(Y \in \mathbb{R}\), Outcome
Potential Outcome:
- \(A_i^{(Z=1)}\): potential treatment when \(Z=1\)
- \(A_i^{(Z=0)}\): potential treatment when \(Z=0\)
- \(Y_i^{(Z=1, A=1)}\),\(Y_i^{(Z=0, A=1)}\),\(Y_i^{(Z=1, A=0)}\),\(Y_i^{(Z=0, A=0)}\)
- \(Y_i^{(z, a)}\) is the potential outcome if unit \(i\) received \(z\) and \(a\)
Assumptions:
- A1: SUTVA \[A_i = Z_iA_i(1) + (1-Z_i)A_i(0)\] \[Y_i = Z_iY_i^{(1, A_i(1))} + (1-Z_i)Y_i^{(0, A_i(0))}\]
- A2: \(Z \perp Y^{(z,a)}, A^{(z)}\), I.V. is randomized
- A3: \(0 < \mathbb{P}(Z_i = 1) <1\)
- A4: \(\mathbb{E}[A(1) - A(0)] \neq 0\), I.V.(Z) has casual effect on A
- A5: \(Y_i^{(Z=1, a)}=Y_i^{(Z=0, a)} = Y_i^{(a)}\)
- A6: \(A^{(1)} \geq A^{(0)}\), monotoncity
Notes on the assumptions:
- If Z was completely randomized like in a RCT, A1-A3 are plausible.
- A4 can be checked from data if Z was randomized
- A5 can never be fully verified with data!! We can observe \(Y_i^{(1,a)}\),\(Y_i^{(0,a)}\) at the same time.
- A6 means one-sided complicance exists in the experiment design. One-sided complicance: \(A_i(0) = 0\), i.e \(A_i(0) = 1\) will never happen.
Accoding to this paper, Angrist, Imbens and Rubin (1996) “Identification of Causal Effects Using Instrumental Variables”, we can divide the subjects into four categories:
- G1: \(A_i(1) =1,A_i(0) =1\): Always takers (doesn’t exist for one-sided compliance)
- G2: \(A_i(1) =0,A_i(0) =0\): Never takers
- G3: \(A_i(1) =1,A_i(0) =0\): Compliers
- G4: \(A_i(1) =0,A_i(0) =1\): Defiers
G1-4 partitions the population in a non-overlapping manner. If monotonicity holds, then defiers cannot exists.
Theorem: If A1-A6 held, then \[\begin{align*}\mathbb{E}[Y_i(1) - Y_i(0) | \,i\text{ is complier }] &= \mathbb{E}[Y_i(1) - Y_i(0) | A_i(1)=1, A_i(0)=1] \\ &= \frac{\mathbb{E}(Y_i | Z_i=1)-\mathbb{E}(Y_i | Z_i=0)}{\mathbb{E}(A_i | Z_i=1)- \mathbb{E}(A_i | Z_i=0)} \end{align*}\]
Note that the estimand identifies the ATE, but among a group of people (compliers) and we don’t know who they are!
proof:
First, let us look at the numerator.
\[\begin{align*} &\,\,\,\,\,\,\,\,E(Y_i |Z_i=1) - E(Y_i|Z_i=0) \\ &=^{A_1} E(Z_iY_i^{(1,A_i(1))}+(1-Z_i)Y_i^{(0,A_i(0))} |Z_i=1 )-\\ &\,\,\,\,\,\,\,\,E(Z_iY_i^{(1,A_i(1))}+(1-Z_i)Y_i^{(0,A_i(0))} |Z_i=0 ) \\ &= E(Y_i^{(1, A_i(1))}|Z_i=1) - E(Y_i^{(0, A_i(0))}|Z_i=0) \\ &=^{A_2} E(Y_i^{(1, A_i(1))}) - E(Y_i^{(0, A_i(0))}) \\ &= E[ (Y_i^{(1, A_i(1))}) - E(Y_i^{(0, A_i(0))})I(A_i(1)=1,A_i(0)=0)+\\ &\,\,\,\,\,\,\,(Y_i^{(1, A_i(1))}) - E(Y_i^{(0, A_i(0))})I(A_i(1)=1,A_i(0)=1)+\\ &\,\,\,\,\,\,\,(Y_i^{(1, A_i(1))}) - E(Y_i^{(0, A_i(0))})I(A_i(1)=0,A_i(0)=0)]\\ & = E[ (Y_i^{(1, A_i(1))}) - E(Y_i^{(0, A_i(0))})I(A_i(1)=1,A_i(0)=0) ] \\ & = E[ (Y_i^{(1)}) - E(Y_i^{(0)})I(A_i(1)=1,A_i(0)=0) ] \end{align*}\]
Then, we look at the denominator. \[\begin{align*} &\,\,\,\,\,\,\,\,E[A_i |Z_i=1] - E[A_i|Z_i=0]\\ &= E[Z_iA_i(1)+(1-Z_i)A_i(0)|Z_i=1] -\\ &\,\,\,\,\,\,\,\,E[Z_iA_i(1)+(1-Z_i)A_i(0)|Z_i=0]\\ &= E[A_i(1) |Z_i=1] - E[A_i(0)|Z_i=0]\\ &= E[A_i(1) ] - E[A_i(0)] \\ &= E[A_i(1) - A_i(0)] \end{align*}\]
Thus, \[\begin{align*} &\,\,\,\,\,\,\,\,E[Y_i(1) - Y_i(0) | A_i(1)=1, A_i(0)=1] \\ &= \frac{E[(Y_i(1) - Y_i(0))I(A_i(1)=1, A_i(0)=1)]}{E[I(A_i(1)=1, A_i(0)=1)]} \\ &= \frac{E[(Y_i(1) - Y_i(0))I(A_i(1)=1, A_i(0)=1)]}{E[A_i(1) - A_i(0)]} \end{align*}\]
How to estmate?
First method:We can use the sample mean to estimate the terms in the theorem, i.e. \[\hat E(Y_i |Z_i=1) = \frac{\sum_{i=1}^{n}Y_iZ_i}{\sum_{i=1}^{n}Z_i} \]
Theorem: \(\hat E(Y_i |Z_i=1) \overset{p}{\to} E(Y_i |Z_i=1)\)
proof:
\[\frac{1}{n}\sum_{i=1}^{n}Y_iZ_i \overset{p}{\to} E[Y_iZ_i]\] \[\frac{1}{n}\sum_{i=1}^{n}Z_i \overset{p}{\to} E[Z_i]\] Thus, by using Slutsky’s theorem:
\[\frac{\sum_{i=1}^{n}Y_iZ_i}{\sum_{i=1}^{n}Z_i} \overset{p}{\to} \frac{E[Y_iZ_i]}{E[Z_i]} = E[Y_i|Z_i=1]\]
Theorem:
\[\hat{\tau}_w = \frac{\hat{E}_{YZ}-\hat{E}_{Y(1-Z)}}{\hat{E}_{AZ}-\hat{E}_{A(1-Z)}} \overset{p}{\to} \tau = \frac{{E}_{YZ}-{E}_{Y(1-Z)}}{{E}_{AZ}-{E}_{A(1-Z)}}\] and
\[\sqrt{\hat{\tau}_w - \tau} \to N(0, E\bigg[ \frac{\frac{Y_i(1)^2}{p}+\frac{Y_i(0)^2}{1-p}}{\tau_A^2} \bigg] - \tau^2),\] where \(p = \mathbb{P}(Z_i=1)\) and \(\tau_A = E[A_i |Z_i=1]-E[A_i |Z_i=0]\)
Second method: Two Stage Least Square
Theorem: If \(Z\) is binary, then \(\hat{\tau}_{TSLS} = \hat{\tau}_w\)
6.2 IV with covariates X
Assumptions:
- A1: SUTVA \[A_i = Z_iA_i(1) + (1-Z_i)A_i(0)\] \[Y_i = Z_iY_i^{(1, A_i(1))} + (1-Z_i)Y_i^{(0, A_i(0))}\]
- A2: \(Z_i \perp A_i(1),A_i(0), Y_i^{(1, A_i(1))},Y_i^{(0, A_i(0))} | X_i\)
- A3: \(0 < \mathbb{P}(Z_i = 1 |X_i=x) <1\,\,\forall x\)
- A4: \(\mathbb{E}[A(1) - A(0)|X_i=x] \neq 0\,\,\forall x\)
- A5: \(Y_i^{(Z=1, a)}=Y_i^{(Z=0, a)} = Y_i^{(a)}\)
- A6: \(A^{(1)} \geq A^{(0)}\), monotoncity
Theorem: Under assumptions A1-A6, The ATE among compliers:
\[{E}[Y_i(1) - Y_i(0) | A_i(1)=1, A_i(0)=1]=\frac{E_X\{E[Y_i|Z_i=1,X_i]-E[Y_i|Z_i=0,X_i]\}}{E_X\{E[A_i|Z_i=1,X_i]-E[A_i|Z_i=0,X_i]\}}\]
Strategy of estimating with Xs:
1:Two stage least square
Property of \(\hat \tau_{TSLS}\)
- \(\hat \tau_{TSLS}\to\tau\)
- \(\sqrt{n}(\hat \tau_{TSLS}-\tau) \to N(0, V_{TSLS})\)
2:Matching (non-parametric)
Take the ratio of the coef estimate between \(Y\sim Z+.\) and \(A\sim Z+.\)
Property of \(\hat \tau_{match}\)
- \(\hat \tau_{match}\to\tau\)
- \(\sqrt{n}(\hat \tau_{match}-\tau) \to N(0, V_{match})\)
- \(V_{match} \geq V_{TSLS}\)
3:IPW OR DR
6.3 New topics in I.V.
- Multiple IVs
- Privacy and IV


Preparation time
over 2 hours
Cooking time
30 mins to 1 hour
Serves
Serves 4
A deconstructed cheesy lasagne with a wonderful seafood twist.
To make the pasta, soak the saffron in 1 tablespoon of boiling water for 5 minutes.
Place all the pasta ingredients, including the saffron in its water, in a food processor and pulse until the dough comes together. Turn it out onto a lightly floured work surface and knead well, until smooth. Divide the dough into four pieces, wrap each piece in cling film and refrigerate for 2 hours.
Cut each piece of dough in half. Flatten one piece on a lightly floured surface. Roll it through a pasta machine, gradually making your way to two notches from the thinnest setting. Lay the pasta on a work surface and cut out a 7.5cm/3in disc. Repeat this step with the remaining dough, you should have eight discs. Allow the pasta to dry out on the surface while you make the sauce.
Preheat the oven to 200C/180C Fan/Gas 6.
To make the sauce, fry the shallot in the oil over a medium heat until softened. Add the lemon peel and vermouth and bring to the boil. Simmer until reduced by half. Add the cream and Gruyère, bring back to the boil and simmer until thickened. Pass through a sieve into a clean saucepan and set aside.
Drop the pasta discs into a pan of simmering salted water. Cook for about 3 minutes, then lift out with a slotted spoon. Season and drizzle over a splash of olive oil.
Heat a frying pan over a medium heat, add a splash of rapeseed oil and cook the spinach until just wilted. Season with salt and pepper.
Lightly oil a large baking tray and lay on four pasta discs. Divide the spinach between the discs and top with the crab meat and two slices of tomato. Finish with another pasta disc and spoon over the Gruyère sauce. Bake for 10–15 minutes, or until bubbling and lightly browned. Serve immediately on warmed plates.


We sell metrics!
- deliver holistic infrastructures
- repurpose world-class infrastructures
- engineer synergistic ROI
- engineer clicks-and-mortar bandwidth
- reinvent rich content
- orchestrate next-generation convergence
- redefine distributed markets
- redefine revolutionary networks
- innovate proactive infrastructures
- enhance bricks-and-clicks bandwidth
- iterate distributed web-readiness
- cultivate 24/7 e-tailers
- reintermediate strategic partnerships
- utilize sexy methodologies


Below you will see an image in the same folder.
It's also possible to load images located in different folders, however, the other folder must be inside the current folder.
Another way to insert images it is through a full URL.


MARTINS AKIM. ___________________________________________________________ Tiscali Broadband from 14.99 with free setup! http://www.tiscali.co.uk/products/broadband/