Tutorial by Examples

REPEAT, will repeat itself forever unless you explicitly exit the loop: //Runs forever REPEAT: // Do stuff END. To exit the loop you can use the LEAVE keyword. With or without a label. Without a label LEAVE will always effect the current loop. With a name you can specify what loop to LEAV...
Standard example: @models = Model.all select_tag "models", options_from_collection_for_select(@models, "id", "name"), {} This will generate the following HTML: David The last argument are options, which accepts the following: { multiple: false, disabled: false, ...
Let's explore an example Transaction search where we define a filter for a single transaction's internal ID: We've specified a filter to only show us results for the Transaction with the internal ID of 875; here is that Transaction: We can see it is a Sales Order with a single line item. Beca...
When we only want one result per transaction, that means we only want the Body, or Main Line, of each transaction. To accomplish this, there is a filter named "Main Line". By setting the Main Line filter to Yes in our search criteria, we are essentially saying "Only show me body-leve...
Recall that every transaction contains multiple sublists of data. Now that we can show only sublist data using Main Line, we can further refine our search results to specific sublist data. Most of the sublists included in Transaction results have a corresponding search filter to toggle whether they...
Recoding missing values Regularly, missing data isn't coded as NA in datasets. In SPSS for example, missing values are often represented by the value 99. num.vec <- c(1, 2, 3, 99, 5) num.vec ## [1] 1 2 3 99 5 It is possible to directly assign NA using subsetting num.vec[num.vec == 99]...
To coerce a variable to a logical use the as.logical() function. > x <- 2 > z <- x > 4 > z [1] FALSE > class(x) [1] "numeric" > as.logical(2) [1] TRUE When applying as.numeric() to a logical, a double will be returned. NA is a logical value and a logical ...
See Missing values for details. > TRUE & NA [1] NA > FALSE & NA [1] FALSE > TRUE || NA [1] TRUE > FALSE || NA [1] NA
Lambdas are a useful shortcut for hooking up behaviors to GUI elements. b = cmds.button("make a cube", command = lambda _: cmds.polyCube()) However, due to the way Python captures variables inside of lambdas, you can get unexpected results if you bind commands using lambdas inside a lo...
npm install --save mongodb npm install --save mongoose //A simple wrapper for ease of development In your server file (normally named index.js or server.js) const express = require('express'); const mongodb = require('mongodb'); const mongoose = require('mongoose'); const mongoConnectString...
const Schema = mongoose.Schema; const ObjectId = Schema.Types.ObjectId; const Article = new Schema({ title: { type: String, unique: true, required: [true, 'Article must have title'] }, author: { type: ObjectId, ref: 'User' } }); module.exports = mongoose....
A simple GET request. Let's assume the Model from the example above is in the file ./db/models/Article.js. const express = require('express'); const Articles = require('./db/models/Article'); module.exports = function (app) { const routes = express.Router(); routes.get('/articles', (r...
The BigDecimal class contains an internal cache of frequently used numbers e.g. 0 to 10. The BigDecimal.valueOf() methods are provided in preference to constructors with similar type parameters i.e. in the below example a is preferred to b. BigDecimal a = BigDecimal.valueOf(10L); //Returns cached O...
You can create custom dialogs which contains many component and perform many functionality on it. It behaves like second stage on owner stage. In the following example an application that shows person in the main stage tableview and creates a person in a dialog (AddingPersonDialog) prepared. GUIs c...
/** * data - passed in object * switch - get file extension if there is one * nlapiCreateFile - create file in File Cabinet * nlapiAttachRecord - attach file to record */ function StoreAttachFile(data) { var record_type = data.recordType var record_id = data.recordId; ...
Making a sequence of HTTP requests has two primary reasons: Requests are depending on each other (the result from one requests is required for a consecutive request). We want to spread server load into multiple requests. 1. Making multiple dependent requests This can be performed usi...
Check your current magento version php bin/magento --version Now Add the latest version to your composer. composer require magento/product-community-edition 2.1.6 --no-update Run Composer Update This will ask for the username and password take from your credentials from your marketplace acco...
Assume you have formatted data in a large text file or string, e.g. Data,2015-09-16,15:41:52;781,780.000000,0.0034,2.2345 Data,2015-09-16,15:41:52;791,790.000000,0.1255,96.5948 Data,2015-09-16,15:41:52;801,800.000000,1.5123,0.0043 one may use textscan to read this quite fast. To do so, get a f...
Detailed instructions on getting mediawiki set up or installed.
WITH RECURSIVE t(n) AS ( VALUES (1) UNION ALL SELECT n+1 FROM t WHERE n < 100 ) SELECT sum(n) FROM t; Link to Documentation

Page 1133 of 1336