Tutorial by Examples: com

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...
/// <summary> /// This interface can do Foo /// </summary> public interface ICanDoFoo { // ... } /// <summary> /// This Bar class implements ICanDoFoo interface /// </summary> public class Bar : ICanDoFoo { // ... } Result Interface summary Clas...
Default behaviour is when the merge resolves as a fast-forward, only update the branch pointer, without creating a merge commit. Use --no-ff to resolve. git merge <branch_name> --no-ff -m "<commit message>"
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 #...
The function php_sapi_name() and the constant PHP_SAPI both return the type of interface (Server API) that is being used by PHP. They can be used to restrict the execution of a script to the command line, by checking whether the output of the function is equal to cli. if (php_sapi_name() === 'cli')...
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 =...
Consider following DOM Structure <ul class="parentUl"> <li> Level 1 <ul class="childUl"> <li>Level 1-1 <span> Item - 1 </span></li> <li>Level 1-1 <span> Item - 2 </span></li&gt...
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]", ...
To jump back to a previous commit, first find the commit's hash using git log. To temporarily jump back to that commit, detach your head with: git checkout 789abcd This places you at commit 789abcd. You can now make new commits on top of this old commit without affecting the branch your head is...
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...

Page 5 of 65