Tutorial by Examples: c

A checkable menuitem that has three possible values: true, false, or mixed. <ul role="menu"> <li role="menuitem">Console</li> <li role="menuitem">Layout</li> <li role="menuitemcheckbox" aria-checked="true"&g...
A graphical object that controls the scrolling of content within a viewing area, regardless of whether the content is fully displayed within the viewing area. <div id="content1">Lorem ipsum...</div> <div role="scrollbar" aria-controls="content1" ...
A landmark region that contains a collection of items and objects that, as a whole, combine to create a search facility. <div role="search"> <input role="searchbox" type="text"> <button role="button">Search</button> </div>...
A type of textbox intended for specifying search criteria. <div role="search"> <input role="searchbox" type="text"> <button role="button">Search</button> </div>
A type of checkbox that represents on/off values, as opposed to checked/unchecked values. <select role="switch" aria-checked="false"> <option>On</option> <option selected>Off</option> </select>
import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.IOException; import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Paths; public class ReadingUTF8TextFile { public static void main(String[] args) throws IOException { ...
When an expression contains multiple operators, it can potentially be read in different ways. For example, the mathematical expression 1 + 2 x 3 could be read in two ways: Add 1 and 2 and multiply the result by 3. This gives the answer 9. If we added parentheses, this would look like ( 1 + 2 )...
If you want to see the schema information of your table, you can use one of the following: SHOW CREATE TABLE child; -- Option 1 CREATE TABLE `child` ( `id` int(11) NOT NULL AUTO_INCREMENT, `fullName` varchar(100) NOT NULL, `myParent` int(11) NOT NULL, PRIMARY KEY (`id`), KEY `momm...
In general, it is considered good practice to throw by value (rather than by pointer), but catch by (const) reference. try { // throw new std::runtime_error("Error!"); // Don't do this! // This creates an exception object // on the heap and would require you to catch the ...
Updating one row UPDATE customers SET email='[email protected]' WHERE id=1 This query updates the content of email in the customers table to the string [email protected] where the value of id is equal to 1. The old and new contents of the database table are illustrated below on the left an...
Unlike other middleware functions error-handling middleware functions have four arguments instead of three: (err, req, res, next). Sample: app.use(function(err, req, res, next) { console.error(err.stack); res.status(500).send('Error found!'); });
Given a file sample: hello Hello HELLO_there A normal grep for "hello" returns: $ grep "hello" sample hello Using -i allows to ignore case and match any "hello": $ grep -i "hello" sample hello Hello HELLO_there
Given a file sample: hello world ahello here hello_there A normal grep for "hello" returns: $ grep hello sample hello world ahello here hello_there Using -w allows to select those lines containing matches that form whole words: $ grep -w hello sample hello world
DBContract.java //Define the tables and columns of your local database public final class DBContract { /*Content Authority its a name for the content provider, is convenient to use the package app name to be unique on the device */ public static final String CONTENT_AUTHORITY =...
A module is an importable file containing definitions and statements. A module can be created by creating a .py file. # hello.py def say_hello(): print("Hello!") Functions in a module can be used by importing the module. For modules that you have made, they will need to be in t...
This object, Shape has a property image that depends on numberOfSides and sideWidth. If either one of them is set, than the image has to be recalculated. But recalculation is presumably long, and only needs to be done once if both properties are set, so the Shape provides a way to set both propertie...
In C#, types can define custom Conversion Operators, which allow values to be converted to and from other types using either explicit or implicit casts. For example, consider a class that is meant to represent a JavaScript expression: public class JsExpression { private readonly string expres...
Suppose you have types like the following: interface IThing { } class Thing : IThing { } LINQ allows you to create a projection that changes the compile-time generic type of an IEnumerable<> via the Enumerable.Cast<>() and Enumerable.OfType<>() extension methods. IEnumerabl...
A Closure is a function taken together with an environment. The function is typically an anonymous function defined inside another function. The environment is the lexical scope of the enclosing function (very basic idea of a lexical scope of a function would be the scope that exists between the fun...
Suppose you have many changes in one or more files but from each file you only want to commit some of the changes, you can select the desired changes using: git add -p or git add -p [file] Each of your changes will be displayed individually, and for each change you will be prompted to choose...

Page 214 of 826