Tutorial by Examples

You can also fire your own events and then listen to them from either Polymer element of HTML page This Element fires the custom event <dom-module id="custom-event"> <template> <style> #inner{ width: 200px; height: 50px; bor...
Properties with notify:true also fires an event <link rel="import" href="../bower_components/paper-input/paper-input.html"> <dom-module id="property-change-event"> <template> <style></style> <paper-input id="input&quo...
It is possible to retarget an event in Polymer ie you can change event details like path thus hiding the actual details of an event/element from user. For e.g if a div inside event-retargeting element is firing the event but developer does not want the user to know that he can retarget the event to...
To search for text foo within a {} block surrounding the cursor use the following command (<ESC> - escape key, <CR> - enter key) : vi{<ESC>/\%Vfoo<CR> now you can jump between the matches within the block by pressing n and p. If you have hlsearch option enabled this will ...
As a privileged user (root or sudo): Create scollector directory: mkdir /opt/scollector In the /opt/scollector directory, download the latest binary build from the bosun/scollector site, [http://bosun.org/scollector/][1] wget https://github.com/bosun-monitor/bosun/releases/download/"version...
The Runnable interface defines a single method, run(), meant to contain the code executed in the thread. The Runnable object is passed to the Thread constructor. And Thread's start() method is called. Example public class HelloRunnable implements Runnable { @Override public void run()...
Detailed instructions on getting datepicker set up or installed.
Almost any MPI call returns an integer error code, which signifies the success of the operation. If no error occurs, the return code is MPI_SUCCESS: if (MPI_Some_op(...) != MPI_SUCCESS) { // Process error } If an error occurs, MPI calls an error handler associated with the communicator, ...
When using vim from the command line, you can suspend vim and get back to your prompt, without actually quitting vim. Hence you will later be able to get back your vim session from the same prompt. When in Normal mode (if not, press esc to get there), issue either of these commands: :stenter :s...
An example of a class that contains a parcelable class inside: public class Repository implements Parcelable { private String name; private Owner owner; private boolean isPrivate; public Repository(String name, Owner owner, boolean isPrivate) { this.name = name; ...
On windows Navigate to http://www.lfd.uci.edu/~gohlke/pythonlibs/#pygame – an unofficial site providing windows binaries of open-source python packages for the official CPython distribution by Christoph Gohlke. Download the appropriate pygame .whl file according to your installed python ve...
function earlyexit { "Hello" return "World" } "Hello" will be placed in the output pipeline, "World" will not
get-childitem | foreach-object { if ($_.IsReadOnly) { return } } Pipeline cmdlets (ex: ForEach-Object, Where-Object, etc) operate on closures. The return here will only move to the next item on the pipeline, not exit processing. You can use break instead of return if you want to exit processing...
Inspired by PowerShell: Function doesn't have proper return value function bar { [System.Collections.ArrayList]$MyVariable = @() $MyVariable.Add("a") | Out-Null $MyVariable.Add("b") | Out-Null $MyVariable } The Out-Null is necessary because the .NET ArrayLis...
(paraphrased from about_return) The following methods will have the same values on the pipeline function foo { $a = "Hello" return $a } function bar { $a = "Hello" $a return } function quux { $a = "Hello" $a }
A function is similar in look to a mixin but it doesn't add any styles, it only returns a value. Functions should be used to prevent repeated logic in your styles. Sass has some built-in functions that are called using the standard CSS function syntax. h1 { background: hsl(0, 25%, 50%); } ...
To make a module eligible for Hot Module Replacement (HMR), the simplest way is to add module.hot.accept() inside the module, like this: // ... if(module.hot) { module.hot.accept(); // This will make current module replaceable }
Install webpack-dev-server via npm. npm i -D webpack-dev-server Configure webpack-dev-server by adding server.js. // server.js var webpack = require("webpack"); var WebpackDevServer = require("webpack-dev-server"); var config = require("./webpack.dev.config...
To create a redistributable package (e.g. a ZIP archive or setup program), it's usually enough to simply invoke CPack using a syntax very similar to calling CMake: cpack path/to/build/directory Depending on the environment this will gather all required/installed files for the project and put the...
To create a package using a specific format, it is possible to pick the Generator to be used. Similar to CMake this may be done using the -G argument: cpack -G 7Z . Using this command line would package the built project in the current directory using the 7-Zip archive format. At the time of w...

Page 651 of 1336