Tutorial by Examples

// initialize a LinkedList of integers LinkedList list = new LinkedList<int>(); // add some numbers to our list. list.AddLast(3); list.AddLast(5); list.AddLast(8); // the list currently is 3, 5, 8 list.AddFirst(2); // the list now is 2, 3, 5, 8 list.RemoveFirst(); // the list...
A StringBuilder represents a series of characters, which unlike a normal string, are mutable. Often times there is a need to modify strings that we've already made, but the standard string object is not mutable. This means that each time a string is modified, a new string object needs to be created,...
Type Annotations // There should be one space after the colon of the type // annotation. This rule applies in variable declarations, // struct fields, functions and methods. // GOOD: let mut buffer: String = String::new(); // BAD: let mut buffer:String = String::new(); let mut buffer : Str...
You can install the postgreSQL adapter via NPM. npm install sails-postgresql
You can configure the database settings in config/connections.js. Here's an example: postgresql: { database: 'databaseName', host: 'localhost', user: 'root', password: '', port: 5432, poolSize: 10, ssl: false }; Alternatively, you can supply the connection information in U...
Sometimes we want the model to give more weight to some data points or examples than others. This is possible by specifying the weight for the input data while learning the model. There are generally two kinds of scenarios where we might use non-uniform weights over the examples: Analytic Weights...
Short circuiting is a functionality that skips evaluating parts of a (if/while/...) condition when able. In case of a logical operation on two operands, the first operand is evaluated (to true or false) and if there is a verdict (i.e first operand is false when using &&, first operand is tr...
If you are using Leiningen and your tests are located in the test directory in your project root then you can run your tests using lein test
OSX Implement the contract of the role-specific protocol (NSAccessibilityButton, NSAccessibilityImage, NSAccessibilityGroup, etc) within the NSAccessibility protocol that best matches the behavior of the GUI element being rendered. Linux / BSD For GNOME applications, the GNOME Accessibility Impl...
Lazy loading is enabled by default. Lazy loading is achieved by creating derived proxy classes and overriding virtual navigation proeprties. Lazy loading occurs when property is accessed for the first time. int companyId = ...; Company company = context.Companies .First(m => m.Id == compan...
Eager loading lets you load all your needed entities at once. If you prefer to get all your entities to work on in one database call, then Eager loading is the way to go. It also lets you load multiple levels. You have two options to load related entities, you can choose either strongly typed or st...
After turning Lazy loading off you can lazily load entities by explicitly calling Load method for entries. Reference is used to load single navigation properties, whereas Collection is used to get collections. Company company = context.Companies.FirstOrDefault(); // Load founder context.Entry(com...
The most common way is to apply the extension via Config. Example: # File: mysite/_config/config.yml Member: extensions: - MyMemberExtension The extensions config variable is of type "array", so you can add multiple extensions like this: # File: mysite/_config/config.yml Mem...
Some procedures have optional arguments. Optional arguments always come after required arguments, but the procedure can be called without them. For example, if the function, ProcedureName were to have two required arguments (argument1, argument2), and one optional argument, optArgument3, it could b...
library(gpuR) # gpuMatrix objects X <- gpuMatrix(rnorm(100), 10, 10) Y <- gpuMatrix(rnorm(100), 10, 10) # transfer data to GPU when operation called # automatically copied back to CPU Z <- X %*% Y
library(gpuR) # vclMatrix objects X <- vclMatrix(rnorm(100), 10, 10) Y <- vclMatrix(rnorm(100), 10, 10) # data always on GPU # no data transfer Z <- X %*% Y
From MSDN Use the CInt function to provide conversions from any other data type to an Integer subtype. For example, CInt forces integer arithmetic when currency, single-precision, or double-precision arithmetic would normally occur. Assuming that you have 1 button and 2 textbox. If you type...
TRACE and DEBUG log levels are there to be able to convey high detail about the operation of the given code at runtime. Setting the log level above these is usually recommended, however some care must be taken for these statements to not affect performance even when seemingly "turned off"....
RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_URI} !(.*)/$ RewriteRule ^(.*)$ /$1/ [L,R=301] The first RewriteCond helps exclude the files. The second RewriteCond checks if there is already a trailing slash. If the case is so RewriteRule is not applied. If you have any URL that s...
Download the Apache Felix Framework Distribution and extract it into a directory: $ tar xf org.apache.felix.main.distribution-5.4.0.tar.gz $ cd felix-framework-5.4.0 And then start the framework with the following command: $ java -jar bin/felix.jar ____________________________ Welcome to...

Page 637 of 1336