Tutorial by Examples: 2

5.0 This attribute is used to change the navigation bar (one, that contain Back, Home Recent button). Usually it is black, however it's color can be changed. <style name="AppTheme" parent="Theme.AppCompat"> <item name="android:navigationBarColor">@col...
HTTP/2 (RFC 7540) changed on-the-wire format of HTTP from a simple text-based request and response headers to binary data format sent in frames. HTTP/2 supports compression of the headers (HPACK). This reduced overhead of requests, and enabled receiving of multiple responses simultaneously over a s...
(defun fn (x) (cond (test-condition1 the-value1) (test-condition2 the-value2) ... ... ... (t (fn reduced-argument-x)))) CL-USER 2788 > (defun my-fib (n) (cond ((= n 1) 1) ((= n...
cdecl is a Windows 32-bit function calling convention which is very similar to the calling convention used on many POSIX operating systems (documented in the i386 System V ABI). One of the differences is in returning small structs. Parameters Parameters are passed on the stack, with the first arg...
stdcall is used for 32-bit Windows API calls. Parameters Parameters are passed on the stack, with the first parameter closest to the top of the stack. The callee will pop these values off of the stack before returning. Return Value Scalar return values are placed in EAX. Saved and Clobbered Re...
# make this routine available outside this translation unit .globl string_to_integer string_to_integer: # function prologue push %ebp mov %esp, %ebp push %esi # initialize result (%eax) to zero xor %eax, %eax # fetch pointer to the string mov 8(%ebp), %e...
This example connects to a Wi-Fi access point with WPA2 encryption. public boolean ConnectToNetworkWPA(String networkSSID, String password) { try { WifiConfiguration conf = new WifiConfiguration(); conf.SSID = "\"" + networkSSID + "\""; // Please note th...
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...
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...
Since the Physical Address Extension (PAE) mode that was introduced in the Pentium Pro (and Pentum M) was such a change to the Operating System memory management subsystem, when Intel designed the Pentium II they decided to enhance the "normal" Page mode to support the new Physical Address...
Note: you should use this way if you've installed a "website" module and you have a public website available. Add following record in 'your_file.xml': <openerp> <data> <template id="assets_frontend" name="your_module_name assets" inherit...
#Get the active Worksheet my $Book = $Excel->Activewindow; my $Sheet = $Book->Activesheet; #List of Worksheet names my @list_Sheet = map { $_->{'Name'} } (in $Book->{Worksheets}); #Access a given Worksheet my $Sheet = $Book->Worksheets($list_Sheet[0]); #Add new Worksheet...
You can obtain information about EC2 instances using: aws ec2 describe-instances You can obtain information about specific EC2 instances using: aws ec2 describe-instances --instance-ids ... where ... contains one or more instance identifiers. For example: aws ec2 describe-instances --instan...
The sum 1 + 2 + 3 + ... + n Simplifies to n(n+1) / 2. Notice that this quantity is Θ(n2). This shortcut arises frequently in the analysis of algorithms like insertion sort or selection sort. Numbers of the form n(n+1)/2 are called the triangular numbers.
The sum 20 + 21 + 22 + ... + 2n-1 simplifies to 2n - 1. This explains why the maximum value that can be stored in an unsigned 32-bit integer is 232 - 1.
The sum of the geometric series r0 + r1 + r2 + ... + rn-1 In the case where r ≠ 1, simplifies to (rn - 1) / (r - 1). If r < 1, this sum is bounded from above by 1 / (1 - r). If r = 1, this sum is rn.
Note: I am assuming that debugfs is mounted under /sys/kernel/debug If not, try: mount -t debugfs none /sys/kernel/debug Change into the tracing directory: cd /sys/kernel/debug/tracing/ Make sure the function tracer is disabled: echo nop > current_tracer Enable all I2C events: echo ...
Note: Before upgrading your Rails app, always make sure to save your code on a version control system, such as Git. To upgrade from Rails 4.2 to Rails 5.0, you must be using Ruby 2.2.2 or newer. After upgrading your Ruby version if required, go to your Gemfile and change the line: gem 'rails', '...
Suppose you have two lists: A and B, and you need to find the elements that exist in both lists. You can do it by just invoking the method List.retainAll(). Example: public static void main(String[] args) { List<Integer> numbersA = new ArrayList<>(); List<Integer> numb...

Page 4 of 21