Tutorial by Examples: er

To start a bibliography you need to define your sources. Create a database file (like sources.bib) and include some content: @book{Doe1993, Author = {John Doe}, Publisher = {Earth University}, Title = {Creating a bibliography with biber}, Year = {1993}} You can then include y...
Related to Monads are F# computation expressions (CE). A programmer typically implements a CE to provide an alternative approach to chaining Monads, ie instead of this: let v = m >>= fun x -> n >>= fun y -> return_ (x, y) You can write this: let v = ce { let! x = m ...
In Emacs, file has the same meaning as in the operating system, and is used for permanent storage of data. A buffer is the internal representation of a file being edited. Files can be read into buffers using C-x C-f, and buffers can be written to files using C-x C-s (save file at its current locatio...
Emacs's user interface uses terms that were coined early and can be unsettling to users used to a more modern terminology. Frame In Emacs, what is otherwise called a window (the area of the display used by a program) is called a frame. Emacs starts using one frame, though additional frames may b...
Sometimes it is desirable to evaluate a nullable expression in an if-else fashion. The elvis operator, ?:, can be used in Kotlin for such a situation. For instance: val value: String = data?.first() ?: "Nothing here." The expression above returns "Nothing here" if data?.firs...
!! suffixes ignore nullability and returns a non-null version of that type. KotlinNullPointerException will be thrown if the object is a null. val message: String? = null println(message!!) //KotlinNullPointerException thrown, app crashes
The & character appears first in entity references and must be escaped in element content or in attribute content. <?xml version="1.0"?> <document attribute="An ampersand is escaped as &"> An ampersand can also be escaped as & in element conte...
The < character appears first in entity tags and must be escaped in element content or in attribute content. <?xml version="1.0"?> <document attribute="A lower-than sign is escaped as <"> 2 + 2 < 5 </document>
The ]]> character sequence is not allowed in element content. The easiest way to escape it is to escape > as >. <?xml version="1.0"?> <document> The sequence ]]> cannot appear in element content. </document>
Characters can be escaped using character references, in element content or attribute values. Their Unicode codepoint can be specified in decimal or hex. <?xml version="1.0"?> <document> The line feed character can be escaped with a decimal (
) or hex (
) ...
Examples of numeric fields are given: AutoField An auto-incrementing integer generally used for primary keys. from django.db import models class MyModel(models.Model): pk = models.AutoField() Each model gets a primary key field (called id) by default. Therefore, it is not necessary t...
@Entity class Note { @Id Integer id; @Basic String note; @Basic int count; } Getters, setters etc. are ommitted for brevity, but they are not needed for JPA anyway. This Java class would map to the following table (depending on your database, here given in on...
Suppose we want to get all product categories with total sales greater than 20. Here is a query without Common Table Expressions: SELECT category.description, sum(product.price) as total_sales FROM sale LEFT JOIN product on sale.product_id = product.id LEFT JOIN category on product.category_id ...
SELECT x, ... FROM ( SELECT y, ... FROM ... ) AS a JOIN tbl ON tbl.x = a.y WHERE ... This will evaluate the subquery into a temp table, then JOIN that to tbl. Prior to 5.6, there could not be an index on the temp table. So, this was potentially very inefficient: SELECT ... ...
For...Next Using the iterator variable as the index number is the fastest way to iterate the elements of an array: Dim items As Variant items = Array(0, 1, 2, 3) Dim index As Integer For index = LBound(items) To UBound(items) 'assumes value can be implicitly converted to a String: D...
With a column of one of the string types, named my_date_field with a value such as [the string] 07/25/2016, the following statement demonstrates the use of the STR_TO_DATE function: SELECT STR_TO_DATE(my_date_field, '%m/%d/%Y') FROM my_table; You could use this function as part of WHERE clause a...
wildcard characters are used with the SQL LIKE operator. SQL wildcards are used to search for data within a table. Wildcards in SQL are:%, _, [charlist], [^charlist] % - A substitute for zero or more characters Eg: //selects all customers with a City starting with "Lo" SEL...
Simple one-liners may be specified as command line arguments to perl using the -e switch (think "execute"): perl -e'print "Hello, World!\n"' Due to Windows quoting rules you can't use single-quoted strings but have to use one of these variants: perl -e"print qq(Hello, W...
Windows uses only double quotes to wrap command line parameters. In order to use double quotes in perl one-liner (i.e. to print a string with an interpolated variable), you have to escape them with backslashes: perl -e "my $greeting = 'Hello'; print \"$greeting, world!\n\"" T...
perl -ne'print if /foo/' file.txt Case-insensitive: perl -ne'print if /foo/i' file.txt

Page 156 of 417