Tutorial by Examples

function myFunction(x, y, z) { } var args = [0, 1, 2]; myFunction(...args); The spread syntax allows an expression to be expanded in places where multiple arguments (for function calls) or multiple elements (for array literals) or multiple variables are expected. Just like the rest parameters s...
Throwing error means exception if any exception is not handled then the node server will crash. The following line throws error: throw new Error("Some error occurred"); or var err = new Error("Some error occurred"); throw err; or throw "Some error occurred";...
try...catch block is for handling exceptions, remember exception means the thrown error not the error. try { var a = 1; b++; //this will cause an error because be is undefined console.log(b); //this line will not be executed } catch (error) { console.log(error); //here we handl...
Eclipse does not give you the possibility to change the font size of the views like 'Project Explorer' or 'Servers', which looks ugly on Linux since Eclipse uses the default (desktop) font size. But you can edit specific configuration files to get the proper font sizes. To fix this annoying font si...
Note 1: You need some prior knowledge about java servlet page(JSP) and Apache Maven before you start this examples. Start the web server (like Apache tomcat) with existing web project or create one. Visit the index.jsp. Anybody can access that page, it's insecure! Securing application ...
We will create a simple "Hello World!" app with Angular2 2.4.1 (@NgModule change) with a node.js (expressjs) backend. Prerequisites Node.js v4.x.x or higher npm v3.x.x or higher or yarn Then run npm install -g typescript or yarn global add typescriptto install typescript globally ...
There are some general Future trait implementations in the futures crate. One of them is implemented in futures::sync::oneshot module and is available through futures::oneshot function: extern crate futures; use std::thread; use futures::Future; fn expensive_computation() -> u32 { //...
//the path of the file string filePath = "C:\\ExcelDemo.xlsx"; //or if you use asp.net, get the relative path filePath = Server.MapPath("ExcelDemo.xlsx"); //create a fileinfo object of an excel file on the disk FileInfo file = new FileInfo(filePath); //create a new Ex...
Create a file ckeditor-inline.html with the following content: <!DOCTYPE html> <html> <head> <title>CKEditor Inline Demo!</title> </head> <body> <script src="//cdn.ckeditor.com/4.6.1/basic/ckeditor.js"></script> <...
You can pass parameters to the functions in tf.cond() using lambda and the code is as bellow. x = tf.placeholder(tf.float32) y = tf.placeholder(tf.float32) z = tf.placeholder(tf.float32) def fn1(a, b): return tf.mul(a, b) def fn2(a, b): return tf.add(a, b) pred = tf.placeholder(tf....
// +build linux package lib var OnlyAccessibleInLinux int // Will only be compiled in Linux Negate a platform by placing ! before it: // +build !windows package lib var NotWindows int // Will be compiled in all platforms but not Windows List of platforms can be specified by separa...
If you name your file lib_linux.go, all the content in that file will only be compiled in linux environments: package lib var OnlyCompiledInLinux string
Different platforms can have separate implementations of the same method. This example also illustrates how build tags and file suffixes can be used together. File main.go: package main import "fmt" func main() { fmt.Println("Hello World from Conditional Compilation Doc!&...
Requirements: You need PHP >= 5.6.4 and Composer installed on your machine. You can check version of both by using command: For PHP: php -v Output like this: PHP 7.0.9 (cli) (built: Aug 26 2016 06:17:04) ( NTS ) Copyright (c) 1997-2016 The PHP Group Zend Engine v3.0.0, Copyright (c) 1998...
Detailed instructions on getting ipad set up or installed.
Vue provides event modifiers for v-on by calling directive postfixes denoted by a dot. .stop .prevent .capture .self .once For examples: <!-- the click event's propagation will be stopped --> <a v-on:click.stop="doThis"></a> <!-- the submit event will no...
When listening for keyboard events, we often need to check for common key codes. Remembering all the keyCodes is a hassle, so Vue provides aliases for the most commonly used keys: .enter .tab .delete (captures both “Delete” and “Backspace” keys) .esc .space .up .down .left .right For ...
.trim If you want user input to be trimmed automatically, you can add the trim modifier to your v-model managed inputs: <input v-model.trim="msg"> .number If you want user input to be automatically typecast as a number, you can do as follow: <input v-model.number=&q...
To install the Pug template rendering system, follow these steps: Have the Node.js environment installed on your machine Run npm install pug --save to install the pug module to your current project. You can now use pug in your project through the standard require mechanism: const pug = requi...
pthread_mutex_t queueMutex; pthread_cond_t queueCond; Queue queue; void Initialize() { //Initialize the mutex and the condition variable pthread_mutex_init(&queueMutex, NULL); pthread_cond_init(&queueCond, NULL); } void Producer() { //First we get some new data ...

Page 1082 of 1336