Managing AWS resources that scale up and down runs into the limits of the static inventory host file, that's why we need something dynamic. And that's what the dynamic inventories are for. Let's start:
Download these ec2.ini and ec2.py files to the your project folder:
cd my_ansible_project
wget...
There is a maximum capacity an integer can store. And when you go over that limit, it will loop back to the negative side. For int, it is 2147483647
int x = int.MaxValue; //MaxValue is 2147483647
x = unchecked(x + 1); //make operation explicitly unchecked so that the ...
Overflow also happens during the operation. In the following example, x is an int, 1 is an int by default. Therefore addition is an int addition. And the result will be an int. And it will overflow.
int x = int.MaxValue; //MaxValue is 2147483647
long y = x + 1; //...
If you are using multiple namespaces that may have same-name classes(such as System.Random and UnityEngine.Random), you can use an alias to specify that Random comes from one or the other without having to use the entire namespace in the call.
For instance:
using UnityEngine;
using System;
Ran...
Create a file named SCALA_PROJECT/build.gradle with these contents:
group 'scala_gradle'
version '1.0-SNAPSHOT'
apply plugin: 'scala'
repositories {
jcenter()
mavenCentral()
maven {
url "https://repo.typesafe.com/typesafe/maven-releases"
}
}
dep...
Over time, our classes may implement more and more interfaces. When these interfaces have many methods, the total number of methods in our class will become very large.
For example, let's suppose that we have two interfaces and a class implementing them:
interface Printable {
public functio...
To install an APK file, use the following command:
adb install path/to/apk/file.apk
or if the app is existing and we want to reinstall
adb install -r path/to/apk/file.apk
To uninstall an application, we have to specify its package
adb uninstall application.package.name
Use the following...
Query
SELECT * FROM stack;
Result
+------+----------+----------+
| id | username | password |
+------+----------+----------+
| 1 | admin | admin |
| 2 | stack | stack |
+------+----------+----------+
2 rows in set (0.00 sec)
You can select all columns from one table...
SQL aliases are used to temporarily rename a table or a column. They are generally used to improve readability.
Query
SELECT username AS val FROM stack;
SELECT username val FROM stack;
(Note: AS is syntactically optional.)
Result
+-------+
| val |
+-------+
| admin |
| stack |
+----...
It's also possible to use data binding within your RecyclerView Adapter.
Data model
public class Item {
private String name;
public String getName() {
return name;
}
}
XML Layout
<TextView
android:layout_width="wrap_content"
android:layou...
With the ~ selector, you can easily implement a global accessible boolean without using JavaScript.
Add boolean as a checkbox
To the very beginning of your document, add as much booleans as you want with a unique id and the hidden attribute set:
<input type="checkbox" id="sideba...
The horizontally justified navigation (menu) bar has some number of items that should be justified. The first (left) item has no left margin within the container, the last (right) item has no right margin within the container. The distance between items is equal, independent on the individual item w...
The backface-visibility property relates to 3D transforms.
With 3D transforms and the backface-visibility property, you're able to rotate an element such that the original front of an element no longer faces the screen.
For example, this would flip an element away from the screen:
JSFIDDLE
<d...
C++11
The C++11 standards guarantees that the initialization of function scope objects are initialized in a synchronized manner. This can be used to implement a thread-safe singleton with lazy initialization.
class Foo
{
public:
static Foo& instance()
{
static Foo inst;
...
Suppose you have complex code that creates and returns a list by starting with a blank list and repeatedly appending to it:
def create():
result = []
# logic here...
result.append(value) # possibly in several places
# more logic...
return result # possibly in several places...
Clojure functions can be defined with zero or more parameters.
(defn welcome
"Without parameters"
[]
"Hello!")
(defn square
"Take one parameter"
[x]
(* x x))
(defn multiplier
"Two parameters"
[x y]
(* x y))
...