Tutorial by Examples: al

Introduction As memory prices dropped, Intel-based PCs were able to have more and more RAM affordably, alleviating many users' problems with running many of the ever-larger applications that were being produced simultaneously. While virtual memory allowed memory to be virtually "created" ...
/* Callback for JVMTI_EVENT_VM_INIT */ static void JNICALL vm_init(jvmtiEnv* jvmti, JNIEnv* env, jthread thread) { jint runtime_version; jvmti->GetVersionNumber(&runtime_version); stdout_message("JVMTI Version: %d\n", runtime_verision); } /* Agent_OnLoad() is ca...
With the RequireQualifiedAccess attribute, union cases must be referred to as MyUnion.MyCase instead of just MyCase. This prevents name collisions in the enclosing namespace or module: type [<RequireQualifiedAccess>] Requirements = None | Single | All // Uses the DU with qualified acc...
In Lua, booleans can be manipulated through logical operators. These operators include not, and, and or. In simple expressions, the results are fairly straightforward: print(not true) --> false print(not false) --> true print(true or false) --> true print(false and true) --> false ...
Note that many datatypes don't need to be quoted, since they evaluate to themselves. QUOTE is especially useful for symbols and lists, to prevent evaluation as Lisp forms. Example for other datatypes not needed to be quoted to prevent evaluation: strings, numbers, characters, CLOS objects, ... Her...
class MyHello { def sayHello() { "Hello, world" } } def cl = { sayHello() } cl() // groovy.lang.MissingMethodException cl.delegate = new MyHello() cl(); // "Hello, world" Used extensively by Groovy DSLs.
Detailed instructions on getting asp.net-web-api 2 set up or installed.
If you have a foreach loop that you want to speed up and you don't mind what order the output is in, you can convert it to a parallel foreach loop by doing the following: using System; using System.Threading; using System.Threading.Tasks; public class MainClass { public static void Main...
Processing tabular data with awk is very easy, provided that the input is correctly formatted. Most software producing tabular data use specific features of this family of formats, and awk programs processing tabular data are often specific to a data produced by a specific software. If a more gener...
Given a file using ; as a column delimiter. We compute the mean of the values in the second column with the following program, the provided input is the list of grades of a student group: awk -F';' '{ sum += $2 } END { print(sum / NR) }' <<EOF Alice;2 Victor;1 Barbara;1 Casper;4 Deborah;...
Given a file using ; as a column delimiter. We compute the median of the values in the second column with the following program, written for GNU awk. The provided input is the list of grades of a student group: gawk -F';' '{ sample[NR] = $2 } END { asort(sample); if(NR % 2 == 1) { p...
If you import two libraries that have conflicting identifiers, then you can specify a prefix for one or both libraries. For example, if library1 and library2 both have an Element class, then you might have code like this: import 'package:lib1/lib1.dart'; import 'package:lib2/lib2.dart' as lib2; /...
If you want to use only part of a library, you can selectively import the library. For example: // Import only foo and bar. import 'package:lib1/lib1.dart' show foo, bar; // Import all names EXCEPT foo. import 'package:lib2/lib2.dart' hide foo;
Deferred loading (also called lazy loading) allows an application to load a library on demand, if and when it’s needed. To lazily load a library, you must first import it using deferred as. import 'package:deferred/hello.dart' deferred as hello; When you need the library, invoke loadLibrary() us...
For example we have WordCountService with countWords method: class WordCountService { def countWords(url: String): Map[String, Int] = { val sparkConf = new SparkConf().setMaster("spark://somehost:7077").setAppName("WordCount")) val sc = new SparkContext(sp...
To implement the equals method of an object easily you could use the EqualsBuilder class. Selecting the fields: @Override public boolean equals(Object obj) { if(!(obj instanceof MyClass)) { return false; } MyClass theOther = (MyClass) obj; EqualsBuilder builde...
#include <stdio.h> int main(void) { /* define a small bit-field that can hold values from 0 .. 7 */ struct { unsigned int uint3: 3; } small; /* extract the right 3 bits from a value */ unsigned int value = 255 - 2; /* Binary 11111101 */ small.u...
You can retrieve post data as Array. $post_data= $this->request->data; You can retrieve post data for particular key. $this->request->data['field']; Retrieve specific key value $this->request->data('key_name'); Retrieve specific key value of nested array $this->requ...
Hex Opacity Values ------------------------------ | Alpha(%) | Hex Value | ------------------------------ | 100% | FF | | 95% | F2 | | 90% | E6 | | 85% | D9 | | 80% | ...
<svg> <defs> <radialGradient id="g"> <stop offset="10%" stop-color="green" /> <stop offset="90%" stop-color="white" /> </radialGradient> </defs> <rect width='100%' height...

Page 88 of 269