Tutorial by Examples: c

A subquery in a FROM clause acts similarly to a temporary table that is generated during the execution of a query and lost afterwards. SELECT Managers.Id, Employees.Salary FROM ( SELECT Id FROM Employees WHERE ManagerId IS NULL ) AS Managers JOIN Employees ON Managers.Id = Employees.Id ...
SELECT Id, FName, LName, (SELECT COUNT(*) FROM Cars WHERE Cars.CustomerId = Customers.Id) AS NumberOfCars FROM Customers
package main import ( "fmt" "io/ioutil" ) func main() { files, err := ioutil.ReadDir(".") if err != nil { panic(err) } fmt.Println("Files and folders in the current directory:") for _, fileInfo := range fi...
To access member variables and member functions of an object of a class, the . operator is used: struct SomeStruct { int a; int b; void foo() {} }; SomeStruct var; // Accessing member variable a in var. std::cout << var.a << std::endl; // Assigning member variable b in v...
To create a pure JSON table you need to provide a single field with the type JSONB: CREATE TABLE mytable (data JSONB NOT NULL); You should also create a basic index: CREATE INDEX mytable_idx ON mytable USING gin (data jsonb_path_ops); At this point you can insert data in to the table and que...
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]", ...
Creation of a Button is simple: Button sampleButton = new Button(); This will create a new Button without any text or graphic inside. If you want to create a Button with a text, simply use the constructor that takes a String as parameter (which sets the textProperty of the Button): Button samp...
The current stable version of scikit-learn requires: Python (>= 2.6 or >= 3.3), NumPy (>= 1.6.1), SciPy (>= 0.9). For most installation pip python package manager can install python and all of its dependencies: pip install scikit-learn However for linux systems it is recomm...
Returns unique values from an IEnumerable. Uniqueness is determined using the default equality comparer. int[] array = { 1, 2, 3, 4, 2, 5, 3, 1, 2 }; var distinct = array.Distinct(); // distinct = { 1, 2, 3, 4, 5 } To compare a custom data type, we need to implement the IEquatable<T> i...
Every case class defines an extractor that can be used to capture the members of the case class when pattern matching: case class Student(name: String, email: String) def matchStudent1(student: Student): String = student match { case Student(name, email) => s"$name has the following...
Strings in JavaScript can be enclosed in Single quotes 'hello', Double quotes "Hello" and (from ES2015, ES6) in Template Literals (backticks) `hello`. var hello = "Hello"; var world = 'world'; var helloW = `Hello World`; // ES2015 / ES6 Strings can be created...
If your string is enclosed (i.e.) in single quotes you need to escape the inner literal quote with backslash \ var text = 'L\'albero means tree in Italian'; console.log( text ); \\ "L'albero means tree in Italian" Same goes for double quotes: var text = "I feel \"high\&quot...
Swift textView.text = "Hello, world!" Objective-C: textView.text = @"Hello, world!";
Swift textView.textAlignment = .left Objective-C textView.textAlignment = NSTextAlignmentLeft;
Swift //System Font textView.font = UIFont.systemFont(ofSize: 12) //Font of your choosing textView.font = UIFont(name: "Font Name", size: 12) Objective-C //System Font textView.font = [UIFont systemFontOfSize:12]; //Font of your choosing textView.font = [UIFont fontWithName:...
Swift textView.textColor = UIColor.red Objective-C textView.textColor = [UIColor redColor];
To keep a container running in the background, supply the -d command line option during container startup: docker run -d busybox top The option -d runs the container in detached mode. It is also equivalent to -d=true. A container in detached mode cannot be removed automatically when it stops, t...
A Docker volume is a file or directory which persists beyond the lifetime of the container. It is possible to mount a host file or directory into a container as a volume (bypassing the UnionFS). Add a volume with the -v command line option: docker run -d -v "/data" awesome/app bootstrap....
fn to_test(output: bool) -> bool { output } #[cfg(test)] // The module is only compiled when testing. mod test { use super::to_test; // This function is a test function. It will be executed and // the test will succeed if the function exits cleanly. #[test] fn...
You have started an interactive rebase. In the editor where you pick your commits, you decide that something is going wrong (for example a commit is missing, or you chose the wrong rebase destination), and you want to abort the rebase. To do this, simply delete all commits and actions (i.e. all lin...

Page 77 of 826