Tutorial by Examples: amp

One of the use cases of callback URLs is OAuth. Let us do this with an Instagram Login: If the user enters their credentials and clicks the Login button, Instagram will validate the credentials and return an access_token. We need that access_token in our app. For our app to be able to listen to suc...
stats::heatmap Example 1 (Basic usage) require(graphics); require(grDevices) x <- as.matrix(mtcars) rc <- rainbow(nrow(x), start = 0, end = .3) cc <- rainbow(ncol(x), start = 0, end = .3) hv <- heatmap(x, col = cm.colors(256), scale = "column", RowSideColo...
Without timezone, with microseconds from datetime import datetime datetime.now().isoformat() # Out: '2016-07-31T23:08:20.886783' With timezone, with microseconds from datetime import datetime from dateutil.tz import tzlocal datetime.now(tzlocal()).isoformat() # Out: '2016-07-31T23:09:4...
In simple terms: UNION joins 2 result sets while removing duplicates from the result set UNION ALL joins 2 result sets without attempting to remove duplicates One mistake many people make is to use a UNION when they do not need to have the duplicates removed. The additional performance cost...
For example, in the sentence: That cake is extremely nice. The rules of the English language would make cake a noun, extremely an adverb that modifies the adjective nice, and through this analysis the meaning could be understood. However, this analysis is dependent on us recognising that the...
#!/bin/bash #Print Date / Time in different Formats date1=$(date +'%d-%m-%y') date2=$(date +'%d-%m-%Y') date3=$(date +'%d-%b-%Y') date4=$(date +'%d-%B-%Y') date5=$(date +'%a %d-%b-%Y') date6=$(date +'%a %d-%b-%Y %Z') date7=$(date +'%A %d-%b-%Y') echo "Print Date in different forma...
// A simple class hierarchy that uses the visitor to add functionality. // class VehicleVisitor; class Vehicle { public: // To implement the visitor pattern // The class simply needs to implement the accept method // That takes a reference to a visitor object tha...
Usage: $ nodetool repair [-h | -p | -pw | -u] <flags> [ -- keyspace_name [table_name]] Default Repair Option $ nodetool repair This command will repair the current node's primary token range (i.e. range which it owns) along with the replicas of other token ranges it has in all tables a...
You can find the Android Sample in [SFML_ROOT]\examples\android You can copy it to leave the SFML repository in it's original state. Open cmd.exe in the sample location. To get a list of all available Android build targets: android list target Run Update Project for the Sample: android upda...
We shall create a simple Alert Dialog in Xamarin.Android Now considering you have gone through the getting started guide from the documentation. You must be having the project structure like this: Your Main Activity must be looking like this: public class MainActivity : Activity { ...
Click the “Move examples” button Select the examples you want to move Click “Move” Select “Search for a Topic” Paste the URL of the topic in the search box Click “Move Examples”. Click “Submit Drafts” or “Edit Drafts”
A great existing example of the Adapter pattern can be found in the SWT MouseListener and MouseAdapter classes. The MouseListener interface looks as follows: public interface MouseListener extends SWTEventListener { public void mouseDoubleClick(MouseEvent e); public void mouseDown(MouseE...
using System; namespace myProject { public partial class WebForm1 : System.Web.UI.Page { public string PageSteps = string.Empty; //Raised after the start stage is complete and before the initialization stage begins. protected void Page_PreInit(object sender...
The TIMESTAMP column will show when the row was last updated. CREATE TABLE `TestLastUpdate` ( `ID` INT NULL, `Name` VARCHAR(50) NULL, `Address` VARCHAR(50) NULL, `LastUpdate` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ) COMMENT='Last Update' ;
# Will display task as: # -------- Rebuild -------- # -------- Build -------- FormatTaskName "-------- {0} --------" # will display tasks in yellow colour: # Running Rebuild FormatTaskName { param($taskName) "Running $taskName" - foregroundcolor yellow } ...
Python follows PEMDAS rule. PEMDAS stands for Parentheses, Exponents, Multiplication and Division, and Addition and Subtraction. Example: >>> a, b, c, d = 2, 3, 5, 7 >>> a ** (b + c) # parentheses 256 >>> a * b ** c # exponent: same as `a * (b ** c)` 7776 >>...
CREATE TABLE all_datetime_types( c_date date, c_timestamp timestamp ); Minimum and maximum data values: insert into all_datetime_types values ('0001-01-01','0001-01-01 00:00:00.000000001'); insert into all_datetime_types values ('9999-12-31','9999-12-31 23:59:59.999999999');
New build systems can be created from the menu (Tools | Build System | New Build System). { "shell_cmd": "somecommand -u \"$file\"", "result_file_regex": "^[ ]*File \"(.*?)\"", "result_line_regex": "^[ ]*File ...
This class is called Greeter. Its responsibility is to output a greeting. It has two dependencies. It needs something that will give it the greeting to output, and then it needs a way to output that greeting. Those dependencies are both described as interfaces, IGreetingProvider and IGreetingWriter....
This is an example on how to use React Native's BackAndroid along with the Navigator. componentWillMount registers an event listener to handle the taps on the back button. It checks if there is another view in the history stack, and if there is one, it goes back -otherwise it keeps the default beha...

Page 14 of 46