Tutorial by Examples

Use defdelegate to define functions that delegate to functions of the same name defined in another module: defmodule Math do defdelegate pi, to: :math end iex> Math.pi 3.141592653589793
Inheritance the a fundamental mechanism of CSS by which the computed values of some properties of an element are applied to its' children. This is particularly useful when you want to set a global style to your elements rather than having to set said properties to each and every element in your mark...
Some properties are not automatically inherited from an element down to its' children. This is because those properties are typically desired to be unique to the element (or selection of elements) to which the property is applied to. Common such properties are margin, padding, background, display, e...
iex> :observer.start :ok :observer.start opens the GUI observer interface, showing you CPU breakdown, memory usage, and other information critical to understanding the usage patterns of your applications.
Hierarchy - LinearLayout(horizontal) - ImageView - LinearLayout(vertical) - TextView - TextView Code LinearLayout rootView = new LinearLayout(context); rootView.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT)); rootView.s...
Simple item insertion can be done with Array.prototype.splice method: arr.splice(index, 0, item); More advanced variant with multiple arguments and chaining support: /* Syntax: array.insert(index, value1, value2, ..., valueN) */ Array.prototype.insert = function(index) { this.splice.a...
public class ExampleActivity extends Activity { private final static String EXAMPLE_ARG = "example_arg"; private int mArg; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layou...
With the appropriate storage backend running a new titan graph can be initialised via: graph = TitanFactory.open("config.properties"); Wehere config.properties defines several configurations relevant to the storage backend. Titan provides some sample configs in its downloadable package...
First, install socket.io module in node.js application. npm install socket.io --save Basic HTTP Setup The following example attaches socket.io to a plain node.js HTTP server listening on port 3000. var server = require('http').createServer(); var io = require('socket.io')(server); io.on(...
// Uses Windows authentication. Replace the Trusted_Connection parameter with // User Id=...;Password=...; to use SQL Server authentication instead. You may // want to find the appropriate connection string for your server. string connectionString = @"Server=myServer\myInstance;Database=myDa...
#!/usr/bin/env perl use strict; use warnings 'all'; use XML::Twig; my $twig = XML::Twig->parse( \*DATA ); #we can use the 'root' method to find the root of the XML. my $root = $twig->root; #first_child finds the first child element matching a value. my $title = $root->firs...
Pseudo-elements are often used to change the look of lists (mostly for unordered lists, ul). The first step is to remove the default list bullets: ul { list-style-type: none; } Then you add the custom styling. In this example, we will create gradient boxes for bullets. li:before { conte...
The default gnuplot command plot (also only p) plot dataset with columns, of the form of the data_set.dat file below. # Prototype of a gnuplot data set # data_set.dat # X - X^2 - 2*X - Random 0 0 0 5 1 1 2 15 1.4142 2 2.8284 1 2 ...
Android $ react-native log-android iOS $ react-native log-ios
The first step is to import Platform from the 'react-native' package like so: import { Platform } from 'react-native' After you've done that, you can go ahead and access the OS type through Platform.OS allowing you to use it in conditional statements like const styles = StyleSheet.create({ h...
JasperReports Library JasperReports is a open source Java based reporting tool. The JasperReports Library can be downloaded from the Jaspersoft Community for the latest release. In recent releases the third-party jars in the lib folder are not distributed, they need to be download from public r...
Windows Phone 8.1 SDK requires Visual Studio. Either check "SDK" when installing Visual Studio or install the SDK directly here.
To change view in your application you can use setState - this will re-render your component and any of its child components. setState performs a shallow merge between the new and previous state, and triggers a re-render of the component. setState takes either a key-value object or a function that...
You should initialize state inside the constructor function of your component like this: export default class MyComponent extends Component { constructor(props) { super(props); this.state = { myInteger: 0 } } render() { return ( <View> ...
To initialize react-native init MyAwesomeProject To initialize with a specific version of React Native react-native init --version="0.36.0" MyAwesomeProject To Run for Android cd MyAwesomeProject react-native run-android To Run for iOS cd MyAwesomeProject react-native run-io...

Page 477 of 1336