Tutorial by Examples: al

Conjunction (logical AND) is represented by the comma , operator (among other roles). Conjunction between clauses can appear in a query: ?- X = 1, Y = 2. Conjunction can also appear between the subgoal clauses in the body of a rule: triangleSides(X,Y,Z) :- X + Y > Z, X + Z > Y, Y + ...
ValueAnimator introduces a simple way to animate a value (of a particular type, e.g. int, float, etc.). The usual way of using it is: Create a ValueAnimator that will animate a value from min to max Add an UpdateListener in which you will use the calculated animated value (which you can obtain ...
Rebar3 is written in Erlang, so you need Erlang to run it. It is available as a binary that you can download and run. Just fetch the nightly build and give it execution permissions: $ wget https://s3.amazonaws.com/rebar3/rebar3 && chmod +x rebar3 Place this binary in a convenient place a...
As Rebar3 is free, open source and written in Erlang, it's possible to simply clone and build it from the source code. $ git clone https://github.com/erlang/rebar3.git $ cd rebar3 $ ./bootstrap This will create the rebar3 script, which you can put on your PATH or link to /usr/local/bin as expl...
We can always use ListView or RecyclerView for selection from list of items, but if we have small amount of choices and among those choices we want user to select one, we can use AlertDialog.Builder setAdapter. private void showDialog() { AlertDialog.Builder builder = new AlertDia...
Download and install the WiX Toolset from wixtoolset.org. The installer for the WiX Toolset provides also the integration with Visual Studio, after the installation you should be able to create WiX specific projects. Warnings Admin rights are needed. Some versions of WiX are compatible only with...
Detailed instructions on getting asp.net-identity set up or installed.
Gradle will only run one task at a time by default, regardless of the project structure. By using the --parallel switch, you can force Gradle to execute independent subprojects - those that have no implicit or explicit project dependencies between one another - in parallel, allowing it to run multip...
Almost every function in C standard library returns something on success, and something else on error. For example, malloc will return a pointer to the memory block allocated by the function on success, and, if the function failed to allocate the requested block of memory, a null pointer. So you sho...
On Windows Download the Visual Studio Code installer for Windows. Once it is downloaded, run the installer (VSCodeSetup-version.exe). This will only take a minute. By default, VS Code is installed under C:\Program Files (x86)\Microsoft VS Code for a 64-bit machine. Note: .NET Framework 4.5.2...
When this program #include <stdio.h> #include <string.h> int main(void) { int num = 0; char str[128], *lf; scanf("%d", &num); fgets(str, sizeof(str), stdin); if ((lf = strchr(str, '\n')) != NULL) *lf = '\0'; printf("%d \"%s\&...
Depending on the version of Chart.JS you are using (the current one being 2.X), the syntax is different to create a minimal example of a bar chart (JSFiddle Demo for 2.X). Chart.js 2.X <html> <body> <canvas id="myChart" width="400" height="400&...
Create a new project dotnet new -l f# Restore any packages listed in project.json dotnet restore A project.lock.json file should be written out. Execute the program dotnet run The above will compile the code if required. The output of the default project created by dotnet new -l f# con...
There are two Collections.sort() methods: One that takes a List<T> as a parameter where T must implement Comparable and override the compareTo() method that determines sort order. One that takes a List and a Comparator as the arguments, where the Comparator determines the sort order. ...
The Null-Coalescing operator ?? will return the left-hand side when not null. If it is null, it will return the right-hand side. object foo = null; object bar = new object(); var c = foo ?? bar; //c will be bar since foo was null The ?? operator can be chained which allows the removal of if...
Often times you will have reason to catch when your program is being told to stop by the OS and take some actions to preserve the state, or clean up your application. To accomplish this you can use the os/signal package from the standard library. Below is a simple example of assigning all signals fr...
When deploying RethinkDB in production, you want to either turn off or lock down the WebUI. This will only respond to localhost to access the WebUI allowing you to SSH Tunnel to the host machine and access it for diagnostics and troubleshooting. docker run -d \ -v host_data_path:/data \ ret...
To setup for using Android Gradle Plugin you need many things: java gradle the Android project folder structure an Android Manifest initial plugin setup The easiest way to get all of them is to follow these steps: Donwload and Install Java OpenJDK version 6 or 7 (you can use 8 with addi...
Knitr is an R package that allows us to intermingle R code with LaTeX code. One way to achieve this is internal code chunks. This apporach is demonstrated below. # r-noweb-file.Rnw \documentclass{article} \begin{document} This is an Rnw file (R noweb). It contains a combination of LateX a...
This is an example of a package-info.java file that binds an XML namespace to a serializable Java class. This should be placed in the same package as the Java classes that should be serialized using the namespace. /** * A package containing serializable classes. */ @XmlSchema ( xmlns = ...

Page 117 of 269