Tutorial by Examples: er

For any object (i.e, variable, array, union, struct, pointer or function) the unary address operator can be used to access the address of that object. Suppose that int i = 1; int *p = NULL; So then a statement p = &i;, copies the address of the variable i to the pointer p. I...
Please see here: Pointer Arithmetic
An immutable object is an object whose state cannot be changed. An immutable class is a class whose instances are immutable by design, and implementation. The Java class which is most commonly presented as an example of immutability is java.lang.String. The following is a stereotypical example: ...
Array.join(separator) can be used to output an array as a string, with a configurable separator. Default (separator = ","): ["a", "b", "c"].join() === "a,b,c" With a string separator: [1, 2, 3, 4].join(" + ") === "1 + 2 + 3 + 4&q...
# this method can be anything and anywhere as long as it is accessible for connection @pyqtSlot() def run_on_complete(): pass # An object containing methods you want to run in a thread class Worker(QObject): complete = pyqtSignal() @pyqtSlot() def a_method_to_run...
Like JavaScript, numbers are floating point values. let pi: number = 3.14; // base 10 decimal by default let hexadecimal: number = 0xFF; // 255 in decimal ECMAScript 2015 allows binary and octal. let binary: number = 0b10; // 2 in decimal let octal: number = 0o755; // 493 in de...
Number formatting, grouping digits according to the localization. const usNumberFormat = new Intl.NumberFormat('en-US'); const esNumberFormat = new Intl.NumberFormat('es-ES'); const usNumber = usNumberFormat.format(99999999.99); // "99,999,999.99" const esNumber = esNumberFormat.form...
Add one common horizontal line for all categorical variables # sample data df <- data.frame(x=('A', 'B'), y = c(3, 4)) p1 <- ggplot(df, aes(x=x, y=y)) + geom_bar(position = "dodge", stat = 'identity') + theme_bw() p1 + geom_hline(aes(yintercept=5), colour=...
To convert decimal number to binary format use base 2 Int32 Number = 15; Console.WriteLine(Convert.ToString(Number, 2)); //OUTPUT : 1111 To convert decimal number to octal format use base 8 int Number = 15; Console.WriteLine(Convert.ToString(Number, 8)); //OUTPUT : 17 To conv...
The most feasible way is to use, the DateTime class. An example: <?php // Create a date time object, which has the value of ~ two years ago $twoYearsAgo = new DateTime("2014-01-18 20:05:56"); // Create a date time object, which has the value of ~ now $now = new DateTime("2016...
GetLastError returns a numerical error code. To obtain a descriptive error message (e.g., to display to a user), you can call FormatMessage: // This functions fills a caller-defined character buffer (pBuffer) // of max length (cchBufferLength) with the human-readable error message // for a Win32 ...
The query function takes a valid SQL string and executes it directly against the database connection $conn Object oriented style $result = $conn->query("SELECT * FROM `people`"); Procedural style $result = mysqli_query($conn, "SELECT * FROM `people`"); CAUTION A ...
The DATEDIF function returns the difference between two date values, based on the interval specified. It is provided for compatibility with Lotus 1-2-3. The DATEDIF function cannot be found on the function list and autocomplete and screen tips are unavailable. Note: It is pronounced "date diff&...
You can call memset to zero out a string (or any other memory block). Where str is the string to zero out, and n is the number of bytes in the string. #include <stdlib.h> /* For EXIT_SUCCESS */ #include <stdio.h> #include <string.h> int main(void) { char str[42] = &quo...
This illustrates that union members shares memory and that struct members does not share memory. #include <stdio.h> #include <string.h> union My_Union { int variable_1; int variable_2; }; struct My_Struct { int variable_1; int variable_2; }; int main (void) { ...
Some C implementations permit code to write to one member of a union type then read from another in order to perform a sort of reinterpreting cast (parsing the new type as the bit representation of the old one). It is important to note however, this is not permitted by the C standard current or pas...
Assert.That(actual, Is.EqualTo(expected));
Normally your tests should be created in such a way that execution order is no concern. However there is always going to be an edge case were you need to break that rule. The one scenario I came across was with R.NET whereby in a given process you can only initialize one R Engine and once disposed ...
let sel = document.getSelection(); sel.removeAllRanges();
Let's extend our template from above and include content from header.php and footer.php Including header: We will include header right after Template name comment There are two common ways to do this. Both are right and work same, it's just about your style and how code looks First way: <?ph...

Page 114 of 417