Tutorial by Examples: amp

Here's a simple example that uses XSLT to convert data in an XML file into a table in an HTML file. You can use it to experiment with simple XSLT transforms. Prerequisite: Install a Java Runtime Environment and add the location of the JRE to your PATH variable. (On Windows, most installers will add...
class ImageExample extends Component { render() { return ( <View> <Image style={{width: 30, height: 30}} source={{uri: 'http://facebook.github.io/react/img/logo_og.png'}} /> </View> ); } }
Create a Java class which extends org.apache.hadoop.hive.ql.exec.hive.UDAF Create an inner class which implements UDAFEvaluator Implement five methods init() – This method initializes the evaluator and resets its internal state. We are using new Column() in the code below to indicate th...
A BroadcastReceiver is basically a mechanism to relay Intents through the OS to perform specific actions. A classic definition being "A Broadcast receiver is an Android component which allows you to register for system or application events." LocalBroadcastManager is a way to send ...
Input file Mary had a little lamb its fleece was white as snow and everywhere that Mary went the lamb was sure to go. Pig Word Count Code -- Load input from the file named Mary, and call the single -- field in the record 'line'. input = load 'mary' as (line); -- TOKENIZE splits the line...
First, make sure your app can be backed up in AndroidManifest.xml, i.e. android:allowBackup is not false. Backup command: adb -s <device_id> backup -noapk <sample.package.id> Create a tar with dd command: dd if=backup.ab bs=1 skip=24 | python -c "import zlib,sys;sys.stdout.wri...
The DATE datatype comprises the date but no time component. Its format is 'YYYY-MM-DD' with a range of '1000-01-01' to '9999-12-31'. The DATETIME type includes the time with a format of 'YYYY-MM-DD HH:MM:SS'. It has a range from '1000-01-01 00:00:00' to '9999-12-31 23:59:59'. The TIMESTAMP type is...
I'll demonstrate the basic usage of using functions vs using labels+gosub. In this example we'll implement simple functionality to add two numbers and store them in a variable. With functions: c := Add(3, 2) ; function call MsgBox, Result: %c% Add(a, b) { ; This is a function. Put it wherever...
This script demonstrates how to receive complicated GUI events from different controls in the same event callback function. We'll be using two ListView controls for that. Now every time an action is detected on one of those ListView controls, we want a precise description of what happened and have ...
Here is a very simple example to illustrate how to write a NIF. Directory structure: nif_test ├── c_src │   ├── Makefile │   └── nif_test.c ├── rebar.config └── src ├── nif_test.app.src └── nif_test.erl This structure can be easily initialized using Rebar3: $ rebar3 new lib nif_...
var client = new AmazonDynamoDBClient(); // Store item client.PutItem(new PutItemRequest { TableName = "Books", Item = new Dictionary<string, AttributeValue> { { "Title", new AttributeValue { S = "Cryptonomicon" } }, { "...
var client = new AmazonDynamoDBClient(); Table booksTable = Table.LoadTable(client, "Books"); // Store item Document book = new Document(); book["Title"] = "Cryptonomicon"; book["Id"] = 42; book["Authors"] = new List<string> { "Ne...
This example consists of two parts: first, we must define our Book type; second, we use it with DynamoDBContext. [DynamoDBTable("Books")] class Book { [DynamoDBHashKey] public int Id { get; set; } public string Title { get; set; } public List<string> Authors { ...
MailApp is the api from Google App Script that can be used to send mail function sendEmails() { var subject = "A subject for your new app!"; var message = "And this is the very first message" var recipientEmail = "[email protected]"; MailApp.sendEmail(rec...
A downcast can be used to make use of a subclass's code and data inside of a function taking a parameter of its superclass. class Rat { var color = "white" } class PetRat: Rat { var name = "Spot" } func nameOfRat(🐭: Rat) -> String { guard let petRat = ...
import java.util.stream.IntStream; public class Concurrent { public static void printAndWait(String s) { System.out.println(s); try { Thread.sleep(1000); } catch (Exception e) {} } public static void main(String[] args) { Threa...
Description This is a self-contained running example including/showcasing: minimum dependencies needed, Java Configuration, Bean declaration by annotation and Java Configuration, Dependency Injection by Constructor and by Property, and Pre/Post hooks. Dependencies These dependencies are needed in...
Here is an example of an IntentService that pretends to load images in the background. All you need to do to implement an IntentService is to provide a constructor that calls the super(String) constructor, and you need to implement the onHandleIntent(Intent) method. public class ImageLoaderIntentSe...
SCOPE_IDENTITY() returns the last identity value inserted into an identity column in the same scope. A scope is a module: a stored procedure, trigger, function, or batch. Therefore, two statements are in the same scope if they are in the same stored procedure, function, or batch. INSERT INTO ([col...
Example of setting the isolation level: SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; SELECT * FROM Products WHERE ProductId=1; SET TRANSACTION ISOLATION LEVEL REPEATABLE READ; --return to the default one READ UNCOMMITTED - means that a query in the current transaction can't access the...

Page 15 of 46