As parameters (8, 16, 32 bits)
8, 16, 32 bits integers are always passed, on the stack, as full width 32 bits values1.
No extension, signed or zeroed, is needed.
The callee will just use the lower part of
the full width values.
//C prototype of the callee
void __attribute__((cdecl)) foo(char ...
As parameters (float, double)
Floats are 32 bits in size, they are passed naturally on the stack.
Doubles are 64 bits in size, they are passed, on the stack, respecting the Little Endian convention1,
pushing first the upper 32 bits and than the lower ones.
//C prototype of callee
double foo(dou...
The clear property is directly related to floats.
Property Values:
none - Default. Allows floating elements on both sides
left - No floating elements allowed on the left side
right - No floating elements allowed on the right side
both - No floating elements allowed on either the left or the r...
This is a very common workflow when using Ansible for provisioning an AWS EC2 instance. This post assumes a basic understand of Ansible and most importantly, assumes you've properly configured it to connect to AWS.
As Ansible official documentation insists, we are going to use four roles:
1- ami_f...
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...
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...
import cv2
image_path= #put your image path here
#use imread() function to read image data to variable img.
img = cv2.imread(image_path)
#display image data in a new window with title 'I am an image display window'
cv2.imshow('I am an image display window',img)
#wait until user hi...
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 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...
This is a simple application with primefaces, it is a login page:
1-Configuration of web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.1" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-...