Tutorial by Examples

AndroidManifest.xml: <activity android:name="com.example.MainActivity" > <intent-filter> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <c...
AndroidManifest.xml: <activity android:name="com.example.MainActivity" > <intent-filter> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <c...
AndroidManifest.xml: <activity android:name="com.example.MainActivity" > <intent-filter> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <categ...
AndroidManifest.xml: <activity android:name="com.example.MainActivity" > <intent-filter> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <categ...
public class MainActivity extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Intent intent = getIntent(); Uri data = intent.getData(); if (d...
AndroidManifest.xml: <activity android:name="com.example.MainActivity" > <intent-filter> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <categ...
This example illustrates how to configure Jersey so that you can begin using it as a JAX-RS implementation framework for your RESTful API. Assuming that you have already installed Apache Maven, follow these steps to set up Jersey: Create maven web project structure, in terminal (windows) execute...
There is also the ability to evaluate expressions when naming methods similar to how you can access an objects' properties with []. This can be useful for having dynamic property names, however is often used in conjunction with Symbols. let METADATA = Symbol('metadata'); class Car { construct...
For programs with a single source file, using gcc is simple. /* File name is hello_world.c */ #include <stdio.h> int main(void) { int i; printf("Hello world!\n"); } To compile the file hello_world.c from the command line: gcc hello_world.c gcc will then compil...
Feature detection of classes can partly be done with the property_exists and method_exists functions. class MyClass { public $public_field; protected $protected_field; private $private_field; static $static_field; const CONSTANT = 0; public function public_function() {...
Here is a basic setting of the Header to change to a new page when a button is clicked. if(isset($_REQUEST['action'])) { switch($_REQUEST['action']) { //Setting the Header based on which button is clicked case 'getState': header("Location: http://NewPageForSta...
Escaping strings is an older (and less secure) method of securing data for insertion into a query. It works by using MySQL's function mysql_real_escape_string() to process and sanitize the data (in other words, PHP is not doing the escaping). The MySQLi API provides direct access to this function $...
Retrieve the last ID generated by an INSERT query on a table with an AUTO_INCREMENT column. Object-oriented Style $id = $conn->insert_id; Procedural Style $id = mysqli_insert_id($conn); Returns zero if there was no previous query on the connection or if the query did not update an AUTO...
Dependency Injection (DI) in the context of using a Dependency Injection Container (DIC) can be seen as a superset of constructor injection. A DIC will typically analyze a class constructor's typehints and resolve its needs, effectively injecting the dependencies needed for the instance execution. ...
To run your unit tests in the simulator using xcodebuild use If you have a workspace (e.g. when using CocoaPods) xcodebuild \ -workspace MyApp.xcworkspace \ -scheme "MyScheme" \ -sdk iphonesimulator \ -destination 'platform=iOS Simulator,name=iPhone 6,OS=9.1' \ test If ...
<script src="example.js"></script> The src attribute works like the href attribute on anchors: you can either specify an absolute or relative URL. The example above links to a file inside the same directory of the HTML document. This is typically added inside the <head&gt...
There are three ways to set the classpath. It can be set using the CLASSPATH environment variable : set CLASSPATH=... # Windows and csh export CLASSPATH=... # Unix ksh/bash It can be set on the command line as follows java -classpath ... javac -classpath ... Note ...
If you want to add all the JARs in directory to the classpath, you can do this concisely using classpath wildcard syntax; for example: someFolder/* This tells the JVM to add all JAR and ZIP files in the someFolder directory to the classpath. This syntax can be used in a -cp argument, a CLASSPA...
The classpath is a sequence of entries which are directory pathnames, JAR or ZIP file pathnames, or JAR / ZIP wildcard specifications. For a classpath specified on the command line (e.g. -classpath) or as an environment variable, the entries must be separated with ; (semicolon) characters on Wi...
Sometimes, just adding all the JARs from a folder isn't enough, for example when you have native code and need to select a subset of JARs. In this case, you need two main() methods. The first one builds a classloader and then uses this classloader to call the second main(). Here is an example which...

Page 496 of 1336