Tutorial by Examples

I wrote a simple C code foo.c int main() { int i = 0; int j = 0; for (i = 0; i < 5; i++) { j = i + 1; } return 0; } When compiled with -O0 i.e. by disabling all compiler optimizations $ gcc -o foo.S foo.c -O0 -S I got this: .file "foo.c&...
Declaring a DLL procedure to work with different VBA versions: Option Explicit #If Win64 Then Private Declare PtrSafe Sub xLib "Kernel32" Alias "Sleep" (ByVal dwMilliseconds As Long) #ElseIf Win32 Then Private Declare Sub apiSleep Lib "Kernel32" Ali...
Option Explicit #If Win64 Then 'Win64 = True, Win32 = False, Win16 = False Private Declare PtrSafe Sub apiCopyMemory Lib "Kernel32" Alias "RtlMoveMemory" (MyDest As Any, MySource As Any, ByVal MySize As Long) Private Declare PtrSafe Sub apiExitProcess Lib "Kern...
#ElseIf Win32 Then 'Win32 = True, Win16 = False Private Declare Sub apiCopyMemory Lib "Kernel32" Alias "RtlMoveMemory" (MyDest As Any, MySource As Any, ByVal MySize As Long) Private Declare Sub apiExitProcess Lib "Kernel32" Alias "ExitProcess" (ByVa...
hello_world.c #include <linux/module.h> #include <linux/kernel.h> #include <linux/init.h> #define AUTHOR "Bruce Lee" #define DESC "Hello World driver" static int __init init(void) { printk(KERN_DEBUG "Hello World\n"); return 0;...
https://logging.apache.org/log4cxx/ currently undergoing Incubation - there is no official release update/bug fixes once in the past 12 years, last release was 2008 user can select different LogLevels – TRACE, DEBUG, INFO, WARN, ERROR, and FATAL hierarchical Loggers it is possible to log asy...
https://sourceforge.net/projects/log4cplus/ updates/bug fixes - last release was Jan. 2016 user can select select different LogLevels – TRACE, DEBUG, INFO, WARN, ERROR, and FATAL hierarchical Loggers supports multi–threaded applications but is not safe to be used from asynchronous signals’ ha...
https://sourceforge.net/projects/log4cpp/ bug fixes are about once a year, last release was April 2015 supports multi-threaded applications •no clear documentation exist is licensed under the GNU Lesser General Public License (LGPL) as of version 0.2.1, before that have been released under the...
val foo : Int by lazy { 1 + 1 } println(foo) The example prints 2.
var foo : Int by Delegates.observable("1") { property, oldValue, newValue -> println("${property.name} was changed from $oldValue to $newValue") } foo = 2 The example prints foo was changed from 1 to 2
val map = mapOf("foo" to 1) val foo : String by map println(foo) The example prints 1
class MyDelegate { operator fun getValue(owner: Any?, property: KProperty<*>): String { return "Delegated value" } } val foo : String by MyDelegate() println(foo) The example prints Delegated value
This module can be used to : Create a new element. Delete an element from HTML document. Place element in HTML document. Iinitialisation To be able to use the dom-construct module we need to load it as fallow : require(["dojo/dom-construct"], function(domConstruct){...
interface Foo { fun example() } class Bar { fun example() { println("Hello, world!") } } class Baz(b : Bar) : Foo by b Baz(Bar()).example() The example prints Hello, world!
val a = arrayOf(1, 2, 3) // creates an Array<Int> of size 3 containing [1, 2, 3].
val a = Array(3) { i -> i * 2 } // creates an Array<Int> of size 3 containing [0, 2, 4]
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...
This module provides function that allows you to manipulate CSS classes of DOM elements. Initialization To be able to use the dom-class module we need to load it as fallow : require(["dojo/dom-class"], function(domClass){ // Write code here }); contains() This function check...
<View style={[(this.props.isTrue) ? styles.bgcolorBlack : styles.bgColorWhite]}> If the value of isTrue is true then it will have black background color otherwise white.

Page 1286 of 1336