Tutorial by Examples: ect

Consider this simple project with a flat directory structure: example |-- example.asd |-- functions.lisp |-- main.lisp |-- packages.lisp `-- tools.lisp The example.asd file is really just another Lisp file with little more than an ASDF-specific function call. Assuming your project depends o...
The class name selector select all elements with the targeted class name. For example, the class name .warning would select the following <div> element: <div class="warning"> <p>This would be some warning copy.</p> </div> You can also combine class n...
ID selectors select DOM elements with the targeted ID. To select an element by a specific ID in CSS, the # prefix is used. For example, the following HTML div element… <div id="exampleID"> <p>Example</p> </div> …can be selected by #exampleID in CSS as sho...
INSERT INTO Customers (FName, LName, PhoneNumber) SELECT FName, LName, PhoneNumber FROM Employees This example will insert all Employees into the Customers table. Since the two tables have different fields and you don't want to move all the fields over, you need to set which fields to insert int...
Each individual CSS Selector has its own specificity value. Every selector in a sequence increases the sequence's overall specificity. Selectors fall into one of three different specificity groups: A, B and c. When multiple selector sequences select a given element, the browser uses the styles appli...
Reflection is often used as part of software testing, such as for the runtime creation/instantiation of mock objects. It's also great for inspecting the state of an object at any given point in time. Here's an example of using Reflection in a unit test to verify a protected class member contains the...
The first two arguments to format are an output stream and a control string. Basic use does not require additional arguments. Passing t as the stream writes to *standard-output*. > (format t "Basic Message") Basic Message nil That expression will write Basic Message to standard ou...
readFloat :: IO Float readFloat = fmap read getLine main :: IO () main = do putStr "Type the first number: " first <- readFloat putStr "Type the second number: " second <- readFloat putStrLn $ show first ++ " + " ++ show se...
5 It allows us to define a property in an existing object using a property descriptor. var obj = { }; Object.defineProperty(obj, 'foo', { value: 'foo' }); console.log(obj.foo); Console output foo Object.defineProperty can be called with the following options: Object.definePropert...
Syntax: SELECT * FROM table_name Using the asterisk operator * serves as a shortcut for selecting all the columns in the table. All rows will also be selected because this SELECT statement does not have a WHERE clause, to specify any filtering criteria. This would also work the same way if you...
Disclaimer: Creating array-like objects is not recommend. However, it is helpful to understand how they work, especially when working with DOM. This will explain why regular array operations don't work on DOM objects returned from many DOM document functions. (i.e. querySelectorAll, form.elements)...
The function std::find, defined in the <algorithm> header, can be used to find an element in a std::vector. std::find uses the operator== to compare elements for equality. It returns an iterator to the first element in the range that compares equal to the value. If the element in question is...
An array can easily be converted into a std::vector by using std::begin and std::end: C++11 int values[5] = { 1, 2, 3, 4, 5 }; // source array std::vector<int> v(std::begin(values), std::end(values)); // copy array to new vector for(auto &x: v) std::cout << x << &q...
What are Array-like Objects? JavaScript has "Array-like Objects", which are Object representations of Arrays with a length property. For example: var realArray = ['a', 'b', 'c']; var arrayLike = { 0: 'a', 1: 'b', 2: 'c', length: 3 }; Common examples of Array-like Objects...
- (void)reachabilityChanged:(NSNotification *)note { Reachability* reachability = [note object]; NetworkStatus netStatus = [reachability currentReachabilityStatus]; switch (netStatus) { case NotReachable: NSLog(@"Network unavailable"); br...
5 Object.freeze makes an object immutable by preventing the addition of new properties, the removal of existing properties, and the modification of the enumerability, configurability, and writability of existing properties. It also prevents the value of existing properties from being changed. Howev...
5 Object.seal prevents the addition or removal of properties from an object. Once an object has been sealed its property descriptors can't be converted to another type. Unlike Object.freeze it does allow properties to be edited. Attempts to do this operations on a sealed object will fail silently ...
// Java: String phrase = persons .stream() .filter(p -> p.age >= 18) .map(p -> p.name) .collect(Collectors.joining(" and ", "In Germany ", " are of legal age.")); System.out.println(phrase); // In Germany Max and Peter a...
// Java: Map<Integer, String> map = persons .stream() .collect(Collectors.toMap( p -> p.age, p -> p.name, (name1, name2) -> name1 + ";" + name2)); System.out.println(map); // {18=Max, 23=Peter;Pamela, ...
// Java (verbose): Collector<Person, StringJoiner, String> personNameCollector = Collector.of( () -> new StringJoiner(" | "), // supplier (j, p) -> j.add(p.name.toUpperCase()), // accumulator (j1, j2) -> j1.merge(j2), // c...

Page 6 of 99