Tutorial by Examples: amp

Example is the main part of Documentation, it is thus important to provide clear and useful examples. Good examples are self-contained and succinct. Examples usually would have code for users to understand the topic better. Refer to the Help Center for more information.
SRXMPPDemo Download the example and all the classes here - https://github.com/SahebRoy92/SRXMPPDemo A demo on XMPP in Objective C, with various simple and complex features implemented in it. All the features of XMPP is done by "in band" xmpp functions. Few features this project contains...
To get the timestamp in seconds Math.floor((new Date().getTime()) / 1000)
A Simple FXML document outlining an AnchorPane containing a button and a label node: <?xml version="1.0" encoding="UTF-8"?> <?import java.lang.*?> <?import java.util.*?> <?import javafx.scene.*?> <?import javafx.scene.control.*?> <?import ...
import pandas as pd Create a DataFrame from a dictionary, containing two columns: numbers and colors. Each key represent a column name and the value is a series of data, the content of the column: df = pd.DataFrame({'numbers': [1, 2, 3], 'colors': ['red', 'white', 'blue']}) Show contents of d...
Create a DataFrame of random numbers: import numpy as np import pandas as pd # Set the seed for a reproducible sample np.random.seed(0) df = pd.DataFrame(np.random.randn(5, 3), columns=list('ABC')) print(df) # Output: # A B C # 0 1.764052 0.400157 0.9787...
Read text file from path: val sc: org.apache.spark.SparkContext = ??? sc.textFile(path="/path/to/input/file") Read files using wildcards: sc.textFile(path="/path/to/*/*") Read files specifying minimum number of partitions: sc.textFile(path="/path/to/input/file&qu...
const auto input = "Some people, when confronted with a problem, think \"I know, I'll use regular expressions.\""s; smatch sm; cout << input << endl; // If input ends in a quotation that contains a word that begins with "reg" and another word begining...
This code takes in various brace styles and converts them to One True Brace Style: const auto input = "if (KnR)\n\tfoo();\nif (spaces) {\n foo();\n}\nif (allman)\n{\n\tfoo();\n}\nif (horstmann)\n{\tfoo();\n}\nif (pico)\n{\tfoo(); }\nif (whitesmiths)\n\t{\n\tfoo();\n\t}\n"s; cout &lt...
A std::regex_token_iterator provides a tremendous tool for extracting elements of a Comma Separated Value file. Aside from the advantages of iteration, this iterator is also able to capture escaped commas where other methods struggle: const auto input = "please split,this,csv, ,line,\\,\n&quot...
When processing of captures has to be done iteratively a regex_iterator is a good choice. Dereferencing a regex_iterator returns a match_result. This is great for conditional captures or captures which have interdependence. Let's say that we want to tokenize some C++ code. Given: enum TOKENS { ...
import pandas as pd import numpy as np np.random.seed(123) x = np.random.standard_normal(4) y = range(4) df = pd.DataFrame({'X':x, 'Y':y}) >>> df X Y 0 -1.085631 0 1 0.997345 1 2 0.282978 2 3 -1.506295 3
This example will guide you through setting up a back end serving an a Hello World HTML page. Installing Requirements Order matters for this step! sudo apt-get install apache2 Setting up the HTML Apache files live in /var/www/html/. Lets quickly get there. Make sure you're in your root ...
A generic class with the type parameter Type class MyGenericClass<Type>{ var value: Type init(value: Type){ self.value = value } func getValue() -> Type{ return self.value } func setValue(value: Type){ self.value = value }...
# For Python 2 compatibility. from __future__ import print_function import lxml.html import requests def main(): r = requests.get("https://httpbin.org") html_source = r.text root_element = lxml.html.fromstring(html_source) # Note root_element.xpath() gives a *...
jquery-ui-rotatable is a plugin for jQuery UI that works in a similar way to Draggable and Resizable, without being as full-featured. By default, it puts a small rotation icon in the bottom left of whatever element you want to make rotatable. <html> <head> <title>My Ro...
Generally, dialog relies on a div within the HTML. Sometimes you may want to create a dialog from scratch, programmatically. Here is an example of a complex modal dialog created dynamically with interactive functions. HTML <div id="users-contain" class="ui-widget"> &lt...
BigInteger is in an immutable object, so you need to assign the results of any mathematical operation, to a new BigInteger instance. Addition: 10 + 10 = 20 BigInteger value1 = new BigInteger("10"); BigInteger value2 = new BigInteger("10"); BigInteger sum = value1.add(value...
Assuming a source file of hello_world.v and a top level module of hello_world. The code can be run using various simulators. Most simulators are compiled simulators. They require multiple steps to compile and execute. Generally the First step is to compile the Verilog design. Second step is to ...
STEP 1: Installation Before you can use Angular-UI Router you must include AngularJS itself in your project. For a detailed guide on that see this documentation. You can download Angular-UI Router either from their GitHub-Page or from NuGet, NPM, Bower respectively. After you have included the J...

Page 4 of 46