Tutorial by Examples: and

Smack (Java) Using Smack 4.1 It is recommended to include Smack as Maven dependency in your project (e.g. by using gradle or Maven). Otherwhise the following Smack artifacts/jars have to be added manually to the classpath: smack-core, smack-extensions, smack-experimental, smack-im, smnack-tcp,...
#include <iostream> #include <boost/accumulators/accumulators.hpp> #include <boost/accumulators/statistics/stats.hpp> #include <boost/accumulators/statistics/mean.hpp> #include <boost/accumulators/statistics/variance.hpp> int main() { using namespace boost...
Generic redirect to https: # Enable Rewrite engine RewriteEngine on # Check if URL does not contain https RewriteCond %{HTTPS} off [NC] # If condition is true, redirect to https RewriteRule (.*) https://%{SERVER_NAME}/$1 [R=301,L] Generic redirect to http: # Enable Rewrite engine Rewr...
An Observable can be thought of as just a stream of events. When you define an Observable, you have three listeners: onNext, onComplete and onError. onNext will be called every time the observable acquires a new value. onComplete will be called if the parent Observable notifies that it finished prod...
Creating a chart that displays a static dataset is relatively simple. For example, if we have this array of objects as the data: var data = [ {title: "A", value: 53}, {title: "B", value: 12}, {title: "C", value: 91}, {title: "D", value: 24...
AUTOCOMMIT MySQL automatically commits statements that are not part of a transaction. The results of any UPDATE,DELETE or INSERT statement not preceded with a BEGIN or START TRANSACTION will immediately be visible to all connections. The AUTOCOMMIT variable is set true by default. This can be chan...
import java.awt.EventQueue; import java.awt.GridLayout; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.awt.event.WindowListener; import java.util.ArrayList; import java.util.List; import javax.swing.JFrame; import javax.swing.JTextArea; import javax.sw...
Create a font extension using the IDE. See the iReport or Jaspersoft Studio documentation for details. The font extension can also be created manually. What are font extensions? Using a textElement you can specify a font (if not specified default font SansSerif is used) <textElement> &...
Erlang on OpenBSD is currently broken on alpha, sparc and hppa architectures. Method 1 - Pre-built Binary Package OpenBSD let you choose desired version you want to install on your system: ###################################################################### # free-choice: ####################...
Suppose that we wanted to create a simple Hello World document: In iText 7, we could do that like this: public void createPdf(String dest) throws IOException { PdfDocument pdf = new PdfDocument(new PdfWriter(dest)); Document document = new Document(pdf); document.add(new Paragraph...
A session is simply an array consisting of the following user information: The user's unique Session ID (this is a statistically random string with very strong entropy, hashed with MD5 for portability, and regenerated (by default) every five minutes) The user's IP Address The user's User Agent ...
What is Flink Like Apache Hadoop and Apache Spark, Apache Flink is a community-driven open source framework for distributed Big Data Analytics. Written in Java, Flink has APIs for Scala, Java and Python, allowing for Batch and Real-Time streaming analytics. Requirements a UNIX-like environment,...
GET your REST data and store in a PowerShell object: $Post = Invoke-RestMethod -Uri "http://jsonplaceholder.typicode.com/posts/1" Modify your data: $Post.title = "New Title" PUT the REST data back $Json = $Post | ConvertTo-Json Invoke-RestMethod -Method Put -Uri "h...
GET your REST data and store in a PowerShell object: $Users = Invoke-RestMethod -Uri "http://jsonplaceholder.typicode.com/users" Modify many items in your data: $Users[0].name = "John Smith" $Users[0].email = "[email protected]" $Users[1].name = "Jane S...
In Julia, you can have an Array that holds other Array type objects. Consider the following examples of initializing various types of Arrays: A = Array{Float64}(10,10) # A single Array, dimensions 10 by 10, of Float64 type objects B = Array{Array}(10,10,10) # A 10 by 10 by 10 Array. Each ele...
Creating Expressions mentions that expressions are closely related to strings. As such, the principles of interpolation within strings are also relevant for Expressions. For instance, in basic string interpolation, we can have something like: n = 2 julia> MyString = "there are $n ducks&q...
If you have an image and want to create a new image, with new dimensions, you can use imagecopyresampled function: first create a new image with desired dimensions: // new image $dst_img = imagecreatetruecolor($width, $height); and store the original image into a variable. To do so, you may us...
After finding an official Julia package, it is straightforward to download and install the package. Firstly, it's recommended to refresh the local copy of METADATA: julia> Pkg.update() This will ensure that you get the latest versions of all packages. Suppose that the package we want to inst...
This example covers common errors with using the 'java' command. "Command not found" If you get an error message like: java: command not found when trying to run the java command, this means that there is no java command on your shell's command search path. The cause could be: yo...

Page 90 of 153