Tutorial by Examples: o

The special operator block allows grouping of several Lisp forms (like an implicit progn) and it also takes a name to name the block. When the forms within the block are evaluated, the special operator return-from can be used to leave the block. For instance: (block foo (print 'hello) ; e...
For lots of control in a group forms, the tagbody special operator can be very helpful. The forms inside a tagbody form are either go tags (which are just symbols or integers) or forms to execute. Within a tagbody, the go special operator is used to transfer execution to a new location. This type...
When writing macros that expand into forms that might involve grouping, it is worthwhile spending some time considering what grouping construction to expand into. For definition style forms, for instance, a define-widget macro that will usually appear as a top-level form, and that several defuns, d...
You can use npm install -g to install a package "globally." This is typically done to install an executable that you can add to your path to run. For example: npm install -g gulp-cli If you update your path, you can call gulp directly. On many OSes, npm install -g will attempt to writ...
Node Version Manager (nvm) greatly simplifies the management of Node.js versions, their installation, and removes the need for sudo when dealing with packages (e.g. npm install ...). Fish Shell (fish) "is a smart and user-friendly command line shell for OS X, Linux, and the rest of the family&...
Square Root Use Math.sqrt() to find the square root of a number Math.sqrt(16) #=> 4 Cube Root To find the cube root of a number, use the Math.cbrt() function 6 Math.cbrt(27) #=> 3 Finding nth-roots To find the nth-root, use the Math.pow() function and pass in a fractional expo...
This is a custom JAX-RS @Provider to use Gson as the JSON parser. The example also shows how to use custom Java 8 date/time converters. @Provider @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) public class JerseyServerGson implements MessageBodyWriter<O...
2005 The following iterates over the characters of the string s. It works similarly for looping over the elements of an array or a set, so long as the type of the loop-control variable (c, in this example) matches the element type of the value being iterated. program ForLoopOnString; {$APPTYPE ...
OpenCL is short for Open Computing Language. OpenCL is a Framework for parallel programming across heterogeneous platforms, called compute devices, ranging from CPUs over GPUs to more special platforms like FPGAs. OpenCL provides a standard interface for parallel computing on these compute devices b...
Every Windows Phone project contains App.cs class: public sealed partial class App : Application This class is your global application context. General Application class usage: App entry point, particularly for various activation contracts. Application lifecycle management. Application g...
Perl supports many kinds of conditional statements (statements that are based on boolean results). The most common conditional statements are if-else, unless, and ternary statements. given statements are introduced as a switch-like construct from C-derived languages and are available in versions Per...
Perl supports many kinds of loop constructs: for/foreach, while/do-while, and until. @numbers = 1..42; for (my $i=0; $i <= $#numbers; $i++) { print "$numbers[$i]\n"; } #Can also be written as foreach my $num (@numbers) { print "$num\n"; } The while loop ev...
When I first started managing the keyboard I would use separate Notifications in each ViewController. Notification Method (Using NSNotification): class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() NSNotificationCenter.defaultCenter().a...
// Get the reference to your ListView ListView listResults = (ListView) findViewById(R.id.listResults); // Set its adapter listResults.setAdapter(adapter); // Enable filtering in ListView listResults.setTextFilterEnabled(true); // Prepare your adapter for filtering adapter.setFilter...
Objects can be centered by using margin: 0 auto; if they are block elements and have a defined width. HTML <div class="containerDiv"> <div id="centeredDiv"></div> </div> <div class="containerDiv"> <p id="centeredPara...
Many tasks require elevated privileges. You can elevate user privileges to Administrator level for your batch runtime using a shortcut: Press alt+ and the batch file to a selected folder to create a shortcut. Right click and select "Properties". Select the "Shortcut&quo...
In most scripting languages, if a function call fails, it may throw an exception and stop execution of the program. Bash commands do not have exceptions, but they do have exit codes. A non-zero exit code signals failure, however, a non-zero exit code will not stop execution of the program. This can...
The behaviour of virtual functions in constructors and destructors is often confusing when first encountered. #include <iostream> using namespace std; class base { public: base() { f("base constructor"); } ~base() { f("base destructor"); } virtual co...
Detailed instructions on getting database-design set up or installed.
Principal Component Analysis finds sequences of linear combinations of the features. The first linear combination maximizes the variance of the features (subject to a unit constraint). Each of the following linear combinations maximizes the variance of the features in the subspace orthogonal to that...

Page 511 of 1038