Tutorial by Examples: f

Fabric is a modular mobile platform that provides useful kits you can mix to build your application. Crashlytics is a crash and issue reporting tool provided by Fabric that allows you to track and monitor your applications in detail. How to Configure Fabric-Crashlytics Step 1: Change your build....
Example of calling an extension method as an extension and as a regular method. public Class MyClass Sub Main() 'Extension called directly on the object. Dim Version = Assembly.GetExecutingAssembly.GetVersionFromAssembly() 'Called as a regular method. ...
There are times when an include file has to generate different output from the preprocessor depending on whether the compiler is a C compiler or a C++ compiler due to language differences. For example a function or other external is defined in a C source file but is used in a C++ source file. Since...
When allocating multidimensional arrays with malloc, calloc, and realloc, a common pattern is to allocate the inner arrays with multiple calls (even if the call only appears once, it may be in a loop): /* Could also be `int **` with malloc used to allocate outer array. */ int *array[4]; int i; ...
There's no built in way to search a list for a particular item. However Programming in Lua shows how you might build a set that can help: function Set (list) local set = {} for _, l in ipairs(list) do set[l] = true end return set end Then you can put your list in the Set and test for m...
Objective-C UIColor *color = [UIColor redColor]; NSString *textToFind = @"redword"; NSMutableAttributedString *attrsString = [[NSMutableAttributedString alloc] initWithAttributedString:yourLabel.attributedText]; // search for word occurrence NSRange range = [yourLabel.text rangeO...
To start the process: $ forever start index.js warn: --minUptime not set. Defaulting to: 1000ms warn: --spinSleepTime not set. Your script will exit if it does not stay up for at least 1000ms info: Forever processing file: index.js List running Forever instances: $ forever list i...
In Python 2, True, False and None are built-in constants. Which means it's possible to reassign them. Python 2.x2.0 True, False = False, True True # False False # True You can't do this with None since Python 2.4. Python 2.x2.4 None = None # SyntaxError: cannot assign to None In ...
When adding a LIMIT to a UNION, this is the pattern to use: ( SELECT ... ORDER BY x LIMIT 10 ) UNION ( SELECT ... ORDER BY x LIMIT 10 ) ORDER BY x LIMIT 10 Since you cannot predict which SELECT(s) will the "10" will come from, you need to get 10 from each, then further whittle do...
Remember to npm install all the files into devDependencies first. E.g. npm install --save-dev gulp gulp-concat gulp-rename gulp-uglify gulp-uglifycss Gulpfile.js var gulp = require('gulp'); var gulp_concat = require('gulp-concat'); var gulp_rename = require('gulp-rename'); var gulp_uglify = ...
Do not use parallel collections when the collection elements must be received in a specific order. Parallel collections perform operations concurrently. That means that all of the work is divided into parts and distributed to different processors. Each processor is unaware of the work being done by...
The most common mode of using TensorFlow involves first building a dataflow graph of TensorFlow operators (like tf.constant() and tf.matmul(), then running steps by calling the tf.Session.run() method in a loop (e.g. a training loop). A common source of memory leaks is where the training loop conta...
All lines must be terminated with a line feed character (LF, ASCII value 10) and not for instance CR or CR+LF. There may be no trailing white space at the end of a line. The name of a source file must equal the name of the class it contains followed by the .java extension, even for fil...
class ExampleClass { // Access modifiers first (don't do for instance "static public") public static void main(String[] args) { System.out.println("Hello World"); } } interface ExampleInterface { // Avoid 'public' and 'abstract' since they are imp...
It is possible to specify log destination with something that statisfies io.Writer interface. With that we can log to file: package main import ( "log" "os" ) func main() { logfile, err := os.OpenFile("test.log", os.O_RDWR|os.O_CREATE|os.O_APPEND,...
context.fillStyle=color Sets the color that will be used to fill the interior of the current path. These are color options (these must be quoted): A CSS named color, for example context.fillStyle='red' A hex color, for example context.fillStyle='#FF0000' An RGB color, for example ...
shadowColor = color // CSS color shadowBlur = width // integer blur width shadowOffsetX = distance // shadow is moved horizontally by this offset shadowOffsetY = distance // shadow is moved vertically by this offset This set of attributes will add a shadow around a path. Bo...
import std.stdio; T min(T)(in T arg1, in T arg2) { return arg1 < arg2 ? arg1 : arg2; } void main() { //Automatic type inference writeln(min(1, 2)); //Explicit type writeln(min!(ubyte)(1, 2)); //With single type, the parenthesis might be ommited ...
package main import ( "fmt" "net/http" "os" "text/template" ) var requestTemplate string = ` {{range $i, $url := .URLs}} {{ $url }} {{(status_code $url)}} {{ end }}` type Requests struct { URLs []string } func main() {...
You can check for syntax errors and referenced files in an NGINX configuration file before running it with: nginx -t Alternatively you can run service script service nginx configtest While both of these commands will tell you if your new nginx configuration is ok [without killing your curren...

Page 170 of 457