Tutorial by Examples: c

Single character escape sequences Some escape sequences consist of a backslash followed by a single character. For example, in alert("Hello\nWorld");, the escape sequence \n is used to introduce a newline in the string parameter, so that the words "Hello" and "World" ...
This is a basic project that uses FXML, created with NetBeans (New Project -> JavaFX -> JavaFX FXML Application). It contains just three files: Main Application class package org.stackoverflow; import javafx.application.Application; import javafx.fxml.FXMLLoader; import javafx.scene.Par...
The time for Scheduler Tasks are measured in Ticks. Under normal conditions, there are 20 ticks per second. Tasks scheduled with .scheduleSyncDelayedTask will be run on the Main Thread Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() { @Override public void run() { ...
You can make code run asynchronously from the main thread using runTaskAsynchronously. This is useful for doing intensive math or database operations, as they will prevent the main thread from freezing (and the server from lagging). Few Bukkit API methods are thread-safe, so many will cause undefin...
For an ID 5 The only restrictions on the value of an id are: it must be unique in the document it must not contain any space characters it must contain at least one character So the value can be all digits, just one digit, just punctuation characters, include special characters, whatever. ...
post-receive hooks can be used to automatically forward incoming pushes to another repository. $ cat .git/hooks/post-receive #!/bin/bash IFS=' ' while read local_ref local_sha remote_ref remote_sha do echo "$remote_ref" | egrep '^refs\/heads\/[A-Z]+-[0-9]+$' >/dev/null &am...
Update: TensorFlow now supports 1D convolution since version r0.11, using tf.nn.conv1d. Consider a basic example with an input of length 10, and dimension 16. The batch size is 32. We therefore have a placeholder with input shape [batch_size, 10, 16]. batch_size = 32 x = tf.placeholder(tf.float...
This code shows a simple example of animation in Unity. For this example, you should have 2 animation clips; Run and Idle. Those animations should be Stand-In-Place motions. Once the animation clips are selected, create an Animator Controller. Add this Controller to the player or game object you w...
As of Kafka 0.9, the new high level KafkaConsumer client is availalbe. It exploits a new built-in Kafka protocol that allows to combine multiple consumers in a so-called Consumer Group. A Consumer Group can be describes as a single logical consumer that subscribes to a set of topics. The partions ov...
KafkaConsumers request messages from a Kafka broker via a call to poll() and their progress is tracked via offsets. Each message within each partition of each topic, has a so-called offset assigned—its logical sequence number within the partition. A KafkaConsumer tracks its current offset for each p...
KafkaConsumers can commit offsets automatically in the background (configuration parameter enable.auto.commit = true) what is the default setting. Those auto commits are done within poll() (which is typically called in a loop). How frequently offsets should be committed, can be configured via auto.c...
There are multiple strategies to read a topic from its beginning. To explain those, we first need to understand what happens at consumer startup. On startup of a consumer, the following happens: join the configured consumer group, which triggers a rebalance and assigns partitions to the consumer ...
from django.contrib.auth.models import User from rest_framework import authentication from rest_framework import exceptions This example authentication is straight from the official docs here. class ExampleAuthentication(BaseAuthentication): def authenticate(self, request): usernam...
This is a snippet of master report. Two parameters and the connection (for example, jdbc) are passing to the subreport. One value is returned from the subreport back to the master report, this value (variable) can be used in master report <subreport> <reportElement x="0" y=&...
The JasperReports-plugin by Alex Nederlof is a good alternative of abandoned org.codehaus.mojo:jasperreports-maven-plugin plugin. The adding of plugin is a typical, simple procedure: <build> <plugins> <plugin> <groupId>com.alexnederlof</groupId...
Classification in Machine Learning is the problem that identifies to which set of categories does a new observation belong. Classification falls under the category of Supervised Machine Learning. Any algorithm that implements classification is known as classifier The classifiers supported in P...
This topic explains the concept of an object reference; it is targeted at people who are new to programming in Java. You should already be familiar with some terms and meanings: class definition, main method, object instance, and the calling of methods "on" an object, and passing parameter...
Every custom loader must directly or indirectly extend the java.lang.ClassLoader class. The main extension points are the following methods: findClass(String) - overload this method if your classloader follows the standard delegation model for class loading. loadClass(String, boolean) - overloa...
Clustering is about grouping similar objects together. It is widely used for pattern recognition. Clustering comes under unsupervised machine learning, therefore there is no training needed. PHP-ML has support for the following clustering algorithms k-Means dbscan k-Means k-Means separates ...
The Java language allows you to use new to create instances Integer, Boolean and so on, but it is generally a bad idea. It is better to either use autoboxing (Java 5 and later) or the valueOf method. Integer i1 = new Integer(1); // BAD Integer i2 = 2; // BEST (autoboxing)...

Page 470 of 826