Tutorial by Examples: comp

Compiler warnings can be generated using the #warning directive, and errors can likewise be generated using the #error directive. #if SOME_SYMBOL #error This is a compiler Error. #elif SOME_OTHER_SYMBOL #warning This is a compiler Warning. #endif
Line #line controls the line number and filename reported by the compiler when outputting warnings and errors. void Test() { #line 42 "Answer" #line filename "SomeFile.cs" int life; // compiler warning CS0168 in "SomeFile.cs" at Line 42 #line defa...
Array types inherit their equals() (and hashCode()) implementations from java.lang.Object, so equals() will only return true when comparing against the exact same array object. To compare arrays for equality based on their values, use java.util.Arrays.equals, which is overloaded for all array types...
A view can be a really complex query(aggregations, joins, subqueries, etc). Just be sure you add column names for everything you select: Create VIEW dept_income AS SELECT d.Name as DepartmentName, sum(e.salary) as TotalSalary FROM Employees e JOIN Departments d on e.DepartmentId = d.id GROUP BY...
List Comprehensions can use nested for loops. You can code any number of nested for loops within a list comprehension, and each for loop may have an optional associated if test. When doing so, the order of the for constructs is the same order as when writing a series of nested for statements. The ge...
div { font-size: 7px; border: 3px dotted pink; background-color: yellow; color: purple; } body.mystyle > div.myotherstyle { font-size: 11px; background-color: green; } #elmnt1 { font-size: 24px; border-color: red; } .mystyle .myotherstyle { ...
// Create a block with an asynchronous action var block = new ActionBlock<string>(async hostName => { IPAddress[] ipAddresses = await Dns.GetHostAddressesAsync(hostName); Console.WriteLine(ipAddresses[0]); }); block.Post("google.com"); // Post items to the block's ...
If you have several objects of monadic types, we can achieve combinations of the values using a 'for comprehension': for { x <- Option(1) y <- Option("b") z <- List(3, 4) } { // Now we can use the x, y, z variables println(x, y, z) x // the last expre...
A custom component that takes the type of a component as input and creates an instance of that component type inside itself. When the input is updated, the previously added dynamic component is removed and the new one added instead. @Component({ selector: 'dcl-wrapper', template: `<div #...
Strings are compared for equality using isEqualToString: The == operator just tests for object identity and does not compare the logical values of objects, so it can't be used: NSString *stringOne = @"example"; NSString *stringTwo = [stringOne mutableCopy]; BOOL objectsAreIdentical =...
Step 1 If you already have Django installed, you can skip this step. pip install Django Step 2 Create a new project django-admin startproject hello That will create a folder named hello which will contain the following files: hello/ ├── hello/ │ ├── __init__.py │ ├── settings.py │...
Python 2.x2.3 Objects of different types can be compared. The results are arbitrary, but consistent. They are ordered such that None is less than anything else, numeric types are smaller than non-numeric types, and everything else is ordered lexicographically by type. Thus, an int is less than a st...
There are two types of comparison: loose comparison with == and strict comparison with ===. Strict comparison ensures both the type and value of both sides of the operator are the same. // Loose comparisons var_dump(1 == 1); // true var_dump(1 == "1"); // true var_dump(1 == true); // t...
This Makefile will cross compile and zip up executables for Windows, Mac and Linux (ARM and x86). # Replace demo with your desired executable name appname := demo sources := $(wildcard *.go) build = GOOS=$(1) GOARCH=$(2) go build -o build/$(appname)$(3) tar = cd build && tar -cvzf $...
From your project directory, run the go build command and specify the operating system and architecture target with the GOOS and GOARCH environment variables: Compiling for Mac (64-bit): GOOS=darwin GOARCH=amd64 go build Compiling for Windows x86 processor: GOOS=windows GOARCH=386 go build ...
Taking a complex JSON document in a table: CREATE TABLE mytable (data JSONB NOT NULL); CREATE INDEX mytable_idx ON mytable USING gin (data jsonb_path_ops); INSERT INTO mytable VALUES($$ { "name": "Alice", "emails": [ "[email protected]", ...
Composer is a dependency/package manager for PHP. It can be used to install, keep track of, and update your project dependencies. Composer also takes care of autoloading the dependencies that your application relies on, letting you easily use the dependency inside your project without worrying about...
While composer provides a system to manage dependencies for PHP projects (e.g. from Packagist), it can also notably serve as an autoloader, specifying where to look for specific namespaces or include generic function files. It starts with the composer.json file: { // ... "autoload&q...
While many people think that ^ means the start of a string, it actually means start of a line. For an actual start of string anchor use, \A. The string hello\nworld (or more clearly) hello world Would be matched by the regular expressions ^h, ^w and \Ah but not by \Aw
PowerShell comparison operators are comprised of a leading dash (-) followed by a name (eq for equal, gt for greater than, etc...). Names can be preceded by special characters to modify the behavior of the operator: i # Case-Insensitive Explicit (-ieq) c # Case-Sensitive Explicit (-ceq) Case-I...

Page 3 of 34