Tutorial by Examples: e

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...
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...
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...
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 ...
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...
Defines a new type based on an existing type. Its syntax mirrors that of a variable declaration. /* Byte can be used wherever `unsigned char` is needed */ typedef unsigned char Byte; /* Integer is the type used to declare an array consisting of a single int */ typedef int Integer[1]; /* Nod...
Used to declare an object or function that is defined elsewhere (and that has external linkage). In general, it is used to declare an object or function to be used in a module that is not the one in which the corresponding object or function is defined: /* file1.c */ int foo = 2; /* Has externa...
Hints to the compiler that access to an object should be as fast as possible. Whether the compiler actually uses the hint is implementation-defined; it may simply treat it as equivalent to auto. The only property that is definitively different for all objects that are declared with register is that...
$ react-native start On latest version of React Native, no need to run the packager. It will run automatically. By default this starts the server at port 8081. To specify which port the server is on $ react-native start --port PORTNUMBER
The reduce method reduces the collection to a single value, passing the result of each iteration into the subsequent iteration. Please see reduce method. The reduce method loops through each item with a collection and produces new result to the next iteration. Each result from the last iteration ...

Page 422 of 1191