Tutorial by Examples: ti

Adding a product to a shopping cart (Label item.name references the name property of the product added): ga('send', 'event', 'Cart', 'Add', product.name); This lets you see what people are adding to the shopping cart, even if they never complete the order, allowing more insight into where users ...
PHPUnit provides the following function to assert whether an object is an instance of a class: assertInstanceOf($expected, $actual[, $message = '']) The first parameter $expected is the name of a class (string). The second parameter $actual is the object to be tested. $message is an optional ...
After a statement was executed, a call to sqlite3_reset() brings it back into the original state so that it can be re-executed. Typically, while the statement itself stays the same, the parameters are changed: const char *sql = "INSERT INTO MyTable(ID, Name) VALUES (?, ?)"; sqlite3_stmt...
/_build /cover /deps erl_crash.dump *.ez /rel
/_build /db /deps /*.ez erl_crash.dump /node_modules /priv/static/ /config/prod.secret.exs /rel
One to Many mapping is generally simply a bidirectional relationship of Many to One mapping. We will take same example that we took for Many to one mapping. Employee.java @Entity public class Employee { @TableGenerator(name = "employee_gen", table = "id_gen", pkColumnNa...
Employee Entity @Entity public class Employee { @TableGenerator(name = "employee_gen", table = "id_gen", pkColumnName = "gen_name", valueColumnName = "gen_val", allocationSize = 1) @Id @GeneratedValue(strategy = GenerationType.TABLE, generat...
Example code : In main.html <template name="test"> <input type="checkbox" id="checkbox1" name="name" value="data">Check Me {{showData}} </template> In Main.js var check_status=''; //Reactive Var Initialization...
First we can specify the directories of header files by include_directories(), then we need to specify the corresponding source files of the target executable by add_executable(), and be sure there's exactly one main() function in the source files. Following is a simple example, all the files are a...
If you have a moment object you can use add and substract to manipulate it or set any property of the time directly moment("2016-01-01").add(1, 'year').format('YYYY-MM-DD') // -> "2017-01-01" Or use .day(), .month(), .year(), .seconds(), .milliseconds() to set those val...
// resize the image to be contained within a maximum width and height, keeping aspect ratio public static UIImage MaxResizeImage(this UIImage sourceImage, float maxWidth, float maxHeight) { var sourceSize = sourceImage.Size; var maxResizeFactor = Math.Min(maxWidth / sourceSize.Width, max...
// resize the image (without trying to maintain aspect ratio) public static UIImage ResizeImage(this UIImage sourceImage, float width, float height) { UIGraphics.BeginImageContext(new SizeF(width, height)); sourceImage.Draw(new RectangleF(0, 0, width, height)); var resultImage = UIG...
It is suggested that you define groups based on purpose of the host (roles) and also geography or datacenter location (if applicable): File inventory/production [rogue-server] 192.168.1.1 [atlanta-webservers] www-atl-1.example.com www-atl-2.example.com [boston-webservers] www-bos-1.examp...
Start by downloading the latest stable release from https://hive.apache.org/downloads.html -> Now untar the file with $ tar -xvf hive-2.x.y-bin.tar.gz -> Create a directory in the /usr/local/ with $ sudo mkdir /usr/local/hive -> Move the file to root with $ mv ~/Downloads/hive-2.x.y /...
Dependency installation ( https://www.npmjs.com/package/gulp-imagemin ) $ npm install --save-dev gulp-imagemin Usage /* * Your other dependencies. */ var imagemin = require('gulp-imagemin'); /* * `gulp images` - Run lossless compression on all the images. */ gulp.task('images', f...
You can create a custom exception and throw them during the execution of your function. As a general practice you should only throw an exception when your function could not achieve its defined functionality. Private Function OpenDatabase(Byval Server as String, Byval User as String, Byval Pwd as S...
You can import a single package with the statement: import "path/to/package" or group multiple imports together: import ( "path/to/package1" "path/to/package2" ) This will look in the corresponding import paths inside of the $GOPATH for .go files and ...
Generics was introduced in Java in its version (1.)5. These are erased during compilation, so runtime reflection is not possible for them. Generics generate new types parametrized by other types. For example we do not have to create new classes in order to use type safe collection of Strings and Num...
Say you have a table named table or you want to create a table with name which is also a keyword, You have to include the name table in pair of double quotes "table" Select * from table; Above query will fail with syntax error, where as below query will run fine. Select * from "tab...
When publishing Sitecore item programmatically the developer should keep in mind that Sitecore could be configured for several publishing targets, as well that several languages could be defined for item. ID targetDatabaseFieldId = ID.Parse("{39ECFD90-55D2-49D8-B513-99D15573DE41}"); ...

Page 334 of 505