Tutorial by Examples

This program demonstrates how to run another process using fork() and wait its termination using waitpid(): fork() creates an identical copy of the current process. The original process is the parent process, while the newly created one is the child process. Both processes continue exactly afte...
To view all the implicits in-scope during a REPL session: scala> :implicits To also include implicit conversions defined in Predef.scala: scala> :implicits -v If one has an expression and wishes to view the effect of all rewrite rules that apply to it (including implicits): scala> ...
Given a noisy signal: import numpy as np import matplotlib.pyplot as plt np.random.seed(1) x = np.linspace(0,2*np.pi,100) y = np.sin(x) + np.random.random(100) * 0.2 plt.plot(x,y) plt.show() one can smooth it using a Savitzky–Golay filter using the scipy.signal.savgol_filter() method...
The ranges of the integer types are implementation-defined. The header <limits> provides the std::numeric_limits<T> template which provides the minimum and maximum values of all fundamental types. The values satisfy guarantees provided by the C standard through the <climits> and (&...
Since workers run in a separate thread from the one that created them, communication needs to happen via postMessage. Note: Because of the different export prefixes, some browsers have webkitPostMessage instead of postMessage. You should override postMessage to make sure workers "work" (n...
If a class, enum, inline function, template, or member of a template has external linkage and is defined in multiple translation units, all definitions must be identical or the behavior is undefined according to the One Definition Rule (ODR). foo.h: class Foo { public: double x; private...
Use the link attribute in the document's head: <head> <link rel="stylesheet" type="text/css" href="stylesheet.css"> </head> You can also use stylesheets provided from websites via a content delivery network, or CDN for short. (for example, Bo...
You can also include CSS elements internally by using the <style> tag: <head> <style type="text/css"> body { background-color: gray; } </style> </head> Multiple internal stylesheets can be included in a program as...
You can style a specific element by using the style attribute: <span style="color: red">This text will appear in red.</span> Note: Try to avoid this -- the point of CSS is to separate content from presentation.
It's possible to load multiple stylesheets: <head> <link rel="stylesheet" type="text/css" href="general.css"> <link rel="stylesheet" type="text/css" href="specific.css"> </head> Note that later files a...
The complete sample code for this application (Android + Node server) is available in the PayPal Developer Github repository. The first stage of creating the Android portion of our application is to set up a basic layout and handle responses that come back from the server that we'll set up in Node....
The complete sample code for this application (Android + Node server) is available in the PayPal Developer Github repository. At this point the PayPal future payments button has been clicked, we have an auth code and metadata ID from the PayPal SDK, and we need to pass those on to our server to com...
The complete sample code for this application (Android + Node server) is available in the PayPal Developer Github repository. From step 2, an async request has been made to our server at the /fpstore endpoint, passing along the auth code and metadata ID. We now need to exchange those for a token in...
XSD schema (schema.xsd) The following xml schema (xsd) defines a list of users with attributes name and reputation. <?xml version="1.0"?> <xs:schema version="1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ns="http://www...
Review Partial Application before proceeding. In Haskell, a function that can take other functions as arguments or return functions is called a higher-order function. The following are all higher-order functions: map :: (a -> b) -> [a] -> [b] filter :: (a -> Bool) -> [a] ...
Lets say we have a class Classy that has property Propertua public class Classy { public string Propertua {get; set;} } to set Propertua using reflection: var typeOfClassy = typeof (Classy); var classy = new Classy(); var prop = typeOfClassy.GetProperty("Propertua"); prop.Se...
When editing text, a common task is to navigate to a particular word on the screen. In these examples we explore how we can navigate to the word updated. For the sake of consistency across the examples, we aim to land on the first letter of the word. Mid-screen jump M$B This approach is quick...
An example of code showing how nodes can be inserted at a doubly linked list, how the list can easily be reversed, and how it can be printed in reverse. #include <stdio.h> #include <stdlib.h> /* This data is not always stored in a structure, but it is sometimes for ease of use */ s...
Every tag has an overview topic. This topic has a special section named "Versions". In that section, different versions can be defined in a table that has that should have at least 2 columns: the first one should be the name of the version the last one should be the release ...
For some tags it makes sense to have multiple version tables. There might be different subsets of a programming language or framework available, say for different device types as in this example. The different tables should be prefaced with a heading. This markup: ## desktop development kit ## ...

Page 614 of 1336