Tutorial by Examples: am

Dialog is a window which is overlay positioned within the viewport. <script> $(function() { $( "#dialog" ).dialog(); }); </script> <div id="dialog" title="Basic dialog"> <p>This is the default dialog which is useful for displayin...
Enable draggable functionality on any DOM element. <script> $(function() { $( "#draggable" ).draggable(); }); </script> <div id="draggable" class="ui-widget-content"> <p>Drag me around</p> </div>
- (void)methodWithBlock:(returnType (^)(paramType1, paramType2, ...))name;
A module can be "imported", or otherwise "required" by the require() function. For example, to load the http module that ships with Node.js, the following can be used: const http = require('http'); Aside from modules that are shipped with the runtime, you can also require mod...
<script src= "http://player.twitch.tv/js/embed/v1.js"></script> <div id="{PLAYER_DIV_ID}"></div> <script type="text/javascript"> var options = { width: 854, height: 480, channel: "{CHANNEL}" ...
Bosun alerts are defined in the config file using a custom DSL. They use functions to evaluate time series data and will generate alerts when the warn or crit expressions are non-zero. Alerts use templates to include additional information in the notifications, which are usually an email message and...
To find files/directories with a specific name, relative to pwd: $ find . -name "myFile.txt" ./myFile.txt To find files/directories with a specific extension, use a wildcard: $ find . -name "*.txt" ./myFile.txt ./myFile2.txt To find files/directories matching one of ma...
A lambda expression provides a concise way to create simple function objects. A lambda expression is a prvalue whose result object is called closure object, which behaves like a function object. The name 'lambda expression' originates from lambda calculus, which is a mathematical formalism invented...
Writing bytes to an OutputStream one byte at a time OutputStream stream = object.getOutputStream(); byte b = 0x00; stream.write( b ); Writing a byte array byte[] bytes = new byte[] { 0x00, 0x00 }; stream.write( bytes ); Writing a section of a byte array int offset = 1; int length = ...
This sample will show you how to update an existing webhook forwarding URL (where the notifications should be POSTed to). To run this, you should have the ID provided back by PayPal when you first created your webhooks. First, add the PayPal SDK and configure the environment (sandbox below). var p...
Streams provide the most direct access to the binary content, so any InputStream / OutputStream implementations always operate on ints and bytes. // Read a single byte from the stream int b = inputStream.read(); if (b >= 0) { // A negative value represents the end of the stream, normal values ...
Browse to File > New > Solution to bring you up the new project dialog. Select Android App and press Next. Configure your app by setting your app name and organization ID. Select the Target Platform most suited for your needs, or leave it as the default. Press Next: Set your Project name ...
Here is an example of a Bosun config file used in a development environment: tsdbHost = localhost:4242 httpListen = :8070 smtpHost = localhost:25 emailFrom = [email protected] timeAndDate = 202,75,179,136 ledisDir = ../ledis_data checkFrequency = 5m notification example.notification { ...
For multi-stage CSS animations, you can create CSS @keyframes. Keyframes allow you to define multiple animation points, called a keyframe, to define more complex animations. Basic Example In this example, we'll make a basic background animation that cycles between all colors. @keyframes rainbow...
Whilst extracting dependencies out of your code so that they can be injected makes your code easier to test, it pushes the problem further up the hierarchy and can also result in objects that are difficult to construct. Various dependency injection frameworks / Inversion of Control Containers have ...
Libraries other than jQuery may also use $ as an alias. This can cause interference between those libraries and jQuery. To release $ for use with other libraries: jQuery.noConflict(); After calling this function, $ is no longer an alias for jQuery. However, you can still use the variable jQuery...
> mysqldump -u username -p [other options] Enter password: If you need to specify the password on the command line (e.g. in a script), you can add it after the -p option without a space: > mysqldump -u username -ppassword [other options] If you password contains spaces or special chara...
c++14 Lambda functions can take arguments of arbitrary types. This allows a lambda to be more generic: auto twice = [](auto x){ return x+x; }; int i = twice(2); // i == 4 std::string s = twice("hello"); // s == "hellohello" This is implemented in C++ by making the closur...
performance.now() returns a precise timestamp: The number of milliseconds, including microseconds, since the current web page started to load. More generally, it returns the time elapsed since the performanceTiming.navigationStart event. t = performance.now(); For example, in a web browser's ma...
Date.now() returns the number of whole milliseconds that have elapsed since 1 January 1970 00:00:00 UTC. t = Date.now(); For example, Date.now() returns 1461069314 if it was called on 19 April 2016 at 12:35:14 GMT.

Page 6 of 129