var s = "Hello"; // The string referenced by variable 's' is normally immutable, but
// since it is memory, we could change it if we can access it in an
// unsafe way.
unsafe // allows writing to memory; methods on Syste...
var scene = new THREE.Scene();
var camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 50);
camera.position.z = 25;
var renderer = new THREE.WebGLRenderer();
renderer.setSize(window.innerWidth, window.innerHeight);
document.body.appendChild(renderer.domElemen...
String bucketName = "bucket";
List<String> nodes = Arrays.asList("node1","node2"); // IP or hostname of one or more nodes in the cluster
Cluster cluster = CouchbaseCluster.create(nodes);
Bucket bucket = cluster.openBucket(bucketName);
//check for a documen...
Queue follow FIFO as it is mentioned in the introduction.
Five major operations:
Enqueue(x): pushes x to the back of the queue.
Dequeue(): pops an element from the front of the queue.
isEmpty(): Finds whether the queue is empty or not.
isFull(): Finds whether the queue is full or not.
frontV...
For example
if the input is:
Output should be false:
As 4 in the left sub-tree is greater than the root value(3)
If the input is:
Output should be true
A Vector3 structure can be created in several ways. Vector3 is a struct, and as such, will typically need to be instantiated before use.
Constructors
There are three built in constructors for instantiating a Vector3.
ConstructorResultnew Vector3()Creates a Vector3 structure with co-ordinates of...
The Vector3 structure contains some static functions that can provide utility when we wish to apply movement to the Vector3.
Lerp and LerpUnclamped
The lerp functions provide movement between two co-ordinates based off a provided fraction. Where Lerp will only permit movement between the two co-or...
Setup ActiveMQ
Download a ActiveMQ distribution from activemq.apache.org and unpack it somewhere
You can start the server immediately, running unsecured on localhost, using the script bin/activemq
When it is running, you can access your local server's console on http://localhost:8161/admin/
Co...
As you know you can have one activity but different fragments embedded in it. That is why fragment lifecycle is also important for developers.
On the diagram below you can see how Android fragment lifecycle looks like:
As described in the official Android documentation you should implement at le...
If you would like to get base project with methods described below you can download Xamarin.Android application template from my GitHub. You can find examples for:
Application lifecycle methods
Activity lifecycle methods
Fragment lifecycle methods
https://github.com/Daniel-Krzyczkowski/Xamar...
// Create a new read-only List<String>
val list = listOf("Item 1", "Item 2", "Item 3")
println(list) // prints "[Item 1, Item 2, Item 3]"
You can pass parameters by Bundle:
Bundle myBundle = new Bundle();
myBundle.putString(MY_KEY, myValue);
Get the value in onCreateLoader:
@Override
public Loader<String> onCreateLoader(int id, final Bundle args) {
final String myParam = args.getString(MY_KEY);
...
}
Consider the tree:
Lowest common ancestor of nodes with value 1 and 4 is 2
Lowest common ancestor of nodes with value 1 and 5 is 3
Lowest common ancestor of nodes with value 2 and 4 is 4
Lowest common ancestor of nodes with value 1 and 2 is 2
The core data structure of Keras is a model, a way to organize layers. The main type of model is the Sequential model, a linear stack of layers. For more complex architectures, you should use the Keras functional API.
Here's the Sequential model:
from keras.models import Sequential
model = Sequ...
Usually, an HTML form element submitted to PHP results in a single value. For example:
<pre>
<?php print_r($_POST);?>
</pre>
<form method="post">
<input type="hidden" name="foo" value="bar"/>
<button type="su...
One of the ways to think about the commands that should be executed, to edit a text in a certain manner, is as entire sentences.
A command is an action performed on an object. Therefore it has a verb:
:normal i " insert
:normal a " append
:normal c " overwrite
:normal y ...
The idea is to measure a layout before and after each change and if there is a significant change you can be somewhat certain that its the softkeyboard.
// A variable to hold the last content layout hight
private int mLastContentHeight = 0;
private ViewTreeObserver.OnGlobalLayoutListener keyboa...