Tutorial by Examples: er

Let's say we have type ENUM('fish','mammal','bird') An alternative is type VARCHAR(20) COMENT "fish, bird, etc" This is quite open-ended in that new types are trivially added. Comparison, and whether better or worse than ENUM: (same) INSERT: simply provide the string (worse?)...
To insert data retrieved from SQL query (single or multiple rows) INSERT INTO Table_name (FirstName, LastName, Position) SELECT FirstName, LastName, 'student' FROM Another_table_name Note, 'student' in SELECT is a string constant that will be inserted in each row. If required, you can select a...
attr() gets/sets the HTML attribute using the DOM functions getAttribute() and setAttribute(). prop() works by setting the DOM property without changing the attribute. In many cases the two are interchangeable, but occasionally one is needed over the other. To set a checkbox as checked: $('#tosAcc...
$q is a built-in service which helps in executing asynchronous functions and using their return values(or exception) when they are finished with processing. $q is integrated with the $rootScope.Scope model observation mechanism, which means faster propagation of resolution or rejection into your m...
The ng-pattern directive accepts an expression that evaluates to a regular expression pattern and uses that pattern to validate a textual input. Example: Lets say we want an <input> element to become valid when it's value (ng-model) is a valid IP address. Template: <input type="tex...
#include <stdio.h> #include <threads.h> #include <stdlib.h> struct my_thread_data { double factor; }; int my_thread_func(void* a) { struct my_thread_data* d = a; // do something with d printf("we found %g\n", d->factor); // return an succes...
In Insert mode, press <C-r> and then % to insert the filename. This technique is applicable to all registers. For e.g. if in insert mode, you want to paste the current search pattern, you can type <C-r> and then /.
While running any web application it’s necessary to take loading time into consideration. If your code tries to access any element that is not yet loaded, WebDriver will throw an exception and your script will stop. There are three types of Waits - Implicit Waits Explicit Waits Fluent Waits ...
In explicit wait, you expect for a condition to happen. For example you want to wait until an element is clickable. Here is a demonstration of a few common problems. Please note: In all of these examples you can use any By as a locator, such as classname, xpath, link text, tag name or cssSelector ...
In Racket, we use recursion very frequently. Here is an example of a function that sums all of the numbers from zero to the parameter, n. (define (sum n) (if (zero? n) 0 (+ n (sum (sub1 n))))) Note that there are many helpful convenience based functions used here, such as ...
Standard properties Depending on the type of the property, there are up to 3 methods for a single property. Let <property> denote the name of a property and <Property> the name of the property with an uppercase first letter. And let T be the type of the property; for primitive wrappers ...
The following example shows the declaration of a property (StringProperty in this case) and demonstrates how to add a ChangeListener to it. import java.text.MessageFormat; import javafx.beans.property.SimpleStringProperty; import javafx.beans.property.StringProperty; import javafx.beans.value.Ch...
This example shows how to use a readonly wrapper property to create a property that cannot be written to. In this case cost and price can be modified, but profit will always be price - cost. import java.text.MessageFormat; import javafx.beans.property.IntegerProperty; import javafx.beans.property...
The JavaScript coding convention is to place the starting bracket of blocks on the same line of their declaration: if (...) { } function (a, b, ...) { } Instead of in the next line: if (...) { } function (a, b, ...) { } This has been adopted to avoid semicolon insertion ...
Since arrays are reference types, it is possible to have multiple variables pointing to the same array object. Dim array1() As Integer = {1, 2, 3} Dim array2() As Integer = array1 array1(0) = 4 Console.WriteLine(String.Join(", ", array2)) ' Writes "4, 2, 3"
If we want to replace only the first occurrence in a line, we use sed as usual: $ cat example aaaaabbbbb aaaaaccccc aaaaaddddd $ sed 's/a/x/' example xaaaabbbbb xaaaaccccc xaaaaddddd But what if we want to replace all occurrences? We just add the g pattern flag at the end: $ sed 's/a/x/...
A form gives the user a way to change data in your application, in a structured way. To mutate a simple array of data, we create a form using a form builder: use Symfony\Component\Form\Extension\Core\Type\TextType; use Symfony\Component\Form\Extension\Core\Type\NumberType; use Symfony\Component\F...
manifest.json { "name": "Hello Page", "description": "Add 'Hello' to the current page.", "version": "1.0", "permissions": [ "activeTab" ], "background": { "scripts": [&quo...
Essential for data references is the addition REF TO after TYPE. Dynamic Creation of Structures If the type of a structure should be decided on runtime, we can define our target structure as reference to the generic type data. DATA wa TYPE REF TO data. To give wa a type we use the statement CR...
Dedicated Workers A dedicated web worker is only accessible by the script that called it. Main application: var worker = new Worker('worker.js'); worker.addEventListener('message', function(msg) { console.log('Result from the worker:', msg.data); }); worker.postMessage([2,3]); worker.j...

Page 190 of 417