Tutorial by Examples: al

{$DEFINE MyRuntimeCheck} // Comment out this directive when the check is no-longer required! // You can also put MyRuntimeCheck in the project defines instead. function MyRuntimeCheck: Boolean; {$IFNDEF MyRuntimeCheck} inline; {$ENDIF} begin result := TRU...
Suppose you are comparing value with some variable if ( i == 2) //Bad-way { doSomething; } Now suppose you have mistaken == with =. Then it will take your sweet time to figure it out. if( 2 == i) //Good-way { doSomething; } Then, if an equal sign is accidentally left out, the ...
CHMOD Calculation CHMOD is binary. _ / _ _ _ / _ _ _ / _ _ _ = _/4+2+1/4+2+1/4+2+1 = 777 = _/rwx/rwx/rwx = 777 Therefore _rwx = _/4+2+1 = 7 D / _ _ _ / _ _ _ / _ _ _ (‘D’ = directory, another use is L = Link) So e.g. _rwxr_xr_x = _/rwx/rx/r_x = 755
BottomSheet DialogFragment opens up in STATE_COLLAPSED by default. Which can be forced to open to STATE_EXPANDEDand take up the full device screen with help of the following code template. @NonNull @Override public Dialog onCreateDialog(Bundle savedInstanceState) { BottomSheetDialog dialog = ...
In PHP, variable values have an associated "truthiness" so even non-boolean values will equate to true or false. This allows any variable to be used in a conditional block, e.g. if ($var == true) { /* explicit version */ } if ($var) { /* $var == true is implicit */ } Here are some fun...
Small object optimization is a technique which is used within low level data structures, for instance the std::string (Sometimes referred to as Short/Small String Optimization). It's meant to use stack space as a buffer instead of some allocated memory in case the content is small enough to fit with...
There are two ways to uninstall a particular version of Ruby. The easiest is to simply remove the directory from ~/.rbenv/versions: $ rm -rf ~/.rbenv/versions/2.1.0 Alternatively, you can use the uninstall command, which does exactly the same thing: $ rbenv uninstall 2.1.0 If this version ha...
This is what I did to install CakePHP on a fresh installed minimal CentOS 7 Installed a CentOS-7-x86_64-Minimal-1611.iso in VirtualBox, two network interfaces: first NAT, second Host-Only set ONBOOT=yes in /etc/sysconfig/network-scripts/ifcfg-enp0s3 reboot yum update yum install net-tools (to...
Array ( [0] => Array ( [id] => 13 [category_id] => 7 [name] => Leaving Of Liverpool [description] => Leaving Of Liverpool [price] => 1.00 [virtual] => 1 [active] =...
Detailed instructions on getting sap set up or installed.
REPORT z_template. CLASS lcl_program DEFINITION ABSTRACT FINAL. PUBLIC SECTION. CLASS-METHODS start_of_selection. CLASS-METHODS initialization. CLASS-METHODS end_of_selection. ENDCLASS. CLASS lcl_program IMPLEMENTATION. METHOD initialization. ENDMETHOD. ...
There are binary installer for pandoc available for Windows and MacOS, as well as a debian package, available for the latest release. There are usually not up-to-date versions of pandoc in "Debian, Ubuntu, Slackware, Arch, Fedora, NiXOS, openSUSE, and gentoo" repositories. A reliable way ...
Detailed instructions on getting office-js set up or installed.
int i, space, rows, k=0, count = 0, count1 = 0; row=5; for(i=1; i<=rows; ++i) { for(space=1; space <= rows-i; ++space) { printf(" "); ++count; } while(k != 2*i-1) { if (count <= rows-1) { printf("...
Firstly you need to download and install the VSCode. This VSCode latest version is available for download in its Official website . After download the VSCode you should install and open it. Introduction of Extensions in VSCode VSCode is a open editor so it provide editor for all languages but ...
Some digital image processing algorithm such as edge detection, information carried by the image intensity (i.e. grayscale value) is sufficient. Using color information (R, G, B channel) may provides slightly better result, but the algorithm complexity will be increased. Thus, in this case, we need ...
Lets have the following file called library.cmd : @echo off echo -/-/- Batch Functions Library -/-/- :function1 echo argument1 - %1 goto :eof To execute only the :function1 without the code of the rest of the file you should put a label :function1 in the caller bat and use it lik...
val foo : Int by lazy { 1 + 1 } println(foo) The example prints 2.
val a = arrayOfNulls<Int>(3) // creates an Array<Int?> of [null, null, null] The returned array will always have a nullable type. Arrays of non-nullable items can't be created uninitialized.
General-purpose stopwatch for timing how long a function takes to run: object Benchmark { fun realtime(body: () -> Unit): Duration { val start = Instant.now() try { body() } finally { val end = Instant.now() return Duration.b...

Page 258 of 269