Tutorial by Examples: ect

Some functions in R produce a side effect (i.e. saving, printing, plotting, etc) and do not always return a meaningful or desired value. %T>% (tee operator) allows you to forward a value into a side-effect-producing function while keeping the original lhs value intact. In other words: the tee op...
Fast Development process Decoupling Unit test writing Fast Development process When using dependency injection node developer can faster their development proceess because after DI there is less code conflict and easy to manage all module. Decoupling Modules becomes less couple then it i...
JSON arrays represent a collection of objects. In JS, theres a bunch of collection functions off of them such as slice, pop, push. Objects have just more raw data. A JSONArray is an ordered sequence of values. Its external text form is a string wrapped in square brackets with commas separating the ...
CREATE SEQUENCE test_seq START WITH 1001; CREATE TABLE test_tab ( test_id INTEGER, test_obj base_type, PRIMARY KEY (test_id) ); INSERT INTO test_tab (test_id, test_obj) VALUES (test_seq.nextval, base_type(1,'BASE_TYPE')); INSERT INTO test_tab (test_id, test_obj) VALUES (test_...
If a function returns a std::vector type, and it is exposed to Python directly like std::vector<float> secondMethod() { return std::vector<float>(); } BOOST_PYTHON_MODULE(CppProject) { boost::python::def("getEmptyVec", secondMethod); } then when the functions...
Below is an example of an object pool that allows renting and returning of a given object type. To create the object pool a Func for the create function and an Action to destroy the object are required to give the user flexibility. On requesting an object when the pool is empty a new object will be ...
Using PostgreSQLnpm module. install dependency from npm npm install pg --save Now you have to create a PostgreSQL connection, which you can later query. Assume you Database_Name = students, Host = localhost and DB_User= postgres var pg = require("pg") var connectionString = &q...
If you want to use connection object for query database you can use this sample code. var queryString = "SELECT name, age FROM students " ; var query = client.query(queryString); query.on("row", (row, result)=> { result.addRow(row); }); query.on("end", func...
There is no such things as .sln and .proj files. Instead of them folders are being used in Visual Studio Code. Each project folder should have a seperate project.json file. /MyProject.Core SourceFile.cs project.json /MyProject.Web /Controllers /Views project.json To refe...
Best way to connect amazon redshift using JDBC , Use proper driver as per version http://docs.aws.amazon.com/redshift/latest/mgmt/configure-jdbc-connection.html Step-1: npm install jdbc Step-2: var JDBC = require('jdbc'); var jinst = require('jdbc/lib/jinst'); // isJvmCreated will be true afte...
MSDN-GetObject Function Returns a reference to an object provided by an ActiveX component. Use the GetObject function when there is a current instance of the object or if you want to create the object with a file already loaded. If there is no current instance, and you don't want the object ...
When using an inline data declaration inside of a SELECT...ENDSELECT block or SELECT SINGLE statement, the @ character must be used as an escape character for the DATA(lv_cityto) expression. Once the escape character has been used, all further host variables must also be escaped (as is the case with...
In addition to libraries defined in EcmaScript language specification and EcmaScript internationalization API specification, d8 also implements the following functions and objects. print(args...): function. Print to stdout. printErr(args...): function. Print to stderr. write(args...): function....
Usually we are not using second parameter in select([$select = '*'[, $escape = NULL]]) in CodeIgniter. If you set it to FALSE, CodeIgniter will not try to protect your field or table names. In the following example, we are going to select the datetime type field by formatting it using sql query an...
var JSONObject = { stringProp: 'stringProp', booleanProp: false, intProp: 8 } var JSONString = JSON.stringify(JSONObject); console.log(JSONString); /* output * {"stringProp":"stringProp","booleanProp":false,"intProp":8} */
Let say you want to build your API to comply jsonapi.org specification and the result should look like: { "article": { "id": "305", "type": "articles", "attributes": { "title": "Asking Alexandria&q...
from pymongo import MongoClient uri = "mongodb://localhost:27017/" client = MongoClient(uri) db = client['test_db'] # or # db = client.test_db # collection = db['test_collection'] # or collection = db.test_collection collection.save({"hello":"world"...
"Fat Model, Skinny Controller" is a very good first step, but it doesn't scale well once your codebase starts to grow. Let's think on the Single Responsibility of models. What is the single responsibility of models? Is it to hold business logic? Is it to hold non-response-related logic? ...
Connecting to Cassandra is very similar to connecting to other datasources. With Cassandra, credentials are not required. String cassandraIPAddress = "127.0.0.1"; String cassandraKeyspace = "myKeyspace"; String username = "foo"; String password = "bar"; ...
public enum Cassandra { DB; private Session session; private Cluster cluster; private static final Logger LOGGER = LoggerFactory.getLogger(Cassandra.class); /** * Connect to the cassandra database based on the connection configuration provided. * Multiple c...

Page 77 of 99