Tutorial by Examples: alle

The following example listens to window.onerror event and uses an image beacon technique to send the information through the GET parameters of an URL. var hasLoggedOnce = false; // Some browsers (at least Firefox) don't report line and column numbers // when event is handled through window.addE...
$ react-native -v Example Output react-native-cli: 0.2.0 react-native: n/a - not inside a React Native project directory //Output from different folder react-native: react-native: 0.30.0 // Output from the react native project directory
Signals and slots are used for communication between objects. The signals and slots mechanism is a central feature of Qt and probably the part that differs most from the features provided by other frameworks. The minimal example requires a class with one signal, one slot and one connection: counte...
var arr = [1, 2, 3, 4]; Method 1 Creates a new array and overwrites the existing array reference with a new one. arr = []; Care must be taken as this does not remove any items from the original array. The array may have been closed over when passed to a function. The array will remain in mem...
Each pair in the dictionary is an instance of KeyValuePair with the same type parameters as the Dictionary. When you loop through the dictionary with For Each, each iteration will give you one of the Key-Value Pairs stored in the dictionary. For Each kvp As KeyValuePair(Of String, String) In curren...
For named (non-anonymous) functions, you can break when the function is executed. debug(functionName); The next time functionName function runs, the debugger will stop on its first line.
You can find the installers on Node.js download page. Normally, Node.js recommends two versions of Node, the LTS version (long term support) and the current version (latest release). If you are new to Node, just go for the LTS and then click the Macintosh Installer button to download the package. I...
Note: it's strongly advised to use Composer. The instruction below is basically what Composer does for you. Download archive extension file of needed version from Github Open composer.json Find PSR-4 autoload section and remember it for e.g. kmit/select2 Extract files to corresponding fold...
This example show how you can check if a service already exists (i.e., is installed on the machine) or not. This code requires only the lowest privileges necessary, so each process can perform the check, no matter what level of security it is running at. #define UNICODE #define _UNICODE #include ...
In Visual studio go to Tools > Extensions and updates... In the window that opens go to online Select Visual Studio Gallery You can search for an extension on the search box at the upper right corner Select the extension you want to add Click on download. Once download is complete, click...
In the simplest use-case, just navigate to the directory your file is in, and type: pyinstaller myfile.py Pyinstaller analyzes the file and creates: A myfile.spec file in the same directory as myfile.py A build folder in the same directory as myfile.py A dist folder in the same directory as m...
The idea here is to move the computationally intensive jobs to C (using special macros), independent of Python, and have the C code release the GIL while it's working. #include "Python.h" ... PyObject *pyfunc(PyObject *self, PyObject *args) { ... Py_BEGIN_ALLOW_THREADS //...
To generate a list (tree view) of currently installed packages, use npm list ls, la and ll are aliases of list command. la and ll commands shows extended information like description and repository. Options The response format can be changed by passing options. npm list --json json - Sh...
To list available local versions of node through NVM: nvm ls For example, if nvm ls returns: $ nvm ls v4.3.0 v5.5.0 You can switch to v5.5.0 with: nvm use v5.5.0
The Meteor Tool will notify you when a newer release is available. To update Meteor projects to the latest release, execute the following command inside a Meteor project: meteor update In case you want to update your Meteor project to a specific Meteor release, run the following command inside ...
Add the following code to functions.php to remove it from everyone except the Administrator user level: add_action('after_setup_theme', 'no_admin_bar'); function no_admin_bar() { if (!current_user_can('administrator') && !is_admin()) { show_admin_bar(false); ...
You can use the zip operator to make request in parallel and combine the results eg: Observable.zip(api.getRepo(repoId1), api.getRepo(repoId2), (repo1, repo2) -> { //here you can combine the results }).subscribe(/*do something with the result*/);
The following examples show 3 main methods for installing Erlang/OTP on FreeBSD. Method 1 - Pre-built Binary Package Use pkg to install the pre-built binary package: $ pkg install erlang Test your new installation: $ erl Erlang/OTP 18 [erts-7.3.1] [source] [64-bit] [smp:2:2] [async-threads:1...
This example uses Parallel.ForEach to calculate the sum of the numbers between 1 and 10000 by using multiple threads. To achieve thread-safety, Interlocked.Add is used to sum the numbers. using System.Threading; int Foo() { int total = 0; var numbers = Enumerable.Range(1, 10000).ToLis...
This example uses Parallel.For to calculate the sum of the numbers between 1 and 10000 by using multiple threads. To achieve thread-safety, Interlocked.Add is used to sum the numbers. using System.Threading; int Foo() { int total = 0; Parallel.For(1, 10001, () => 0, // in...

Page 2 of 7