Tutorial by Examples

SELECT item.item_id, item.name, /* not SQL-92 */ COUNT(*) number_of_uses FROM item JOIN uses ON item.item_id, uses.item_id GROUP BY item.item_id will show the rows in a table called item, and show the count of related rows in a table called uses. This works well, but unfo...
SELECT item.item_id, uses.category, /* nonstandard */ COUNT(*) number_of_uses FROM item JOIN uses ON item.item_id, uses.item_id GROUP BY item.item_id will show the rows in a table called item, and show the count of related rows in a table called uses. It will also show the va...
#include <gtk/gtk.h>//jjk.c static void destroy(GtkWidget *widget, gpointer data) { gtk_main_quit(); } int main(int argc, char *argv[]) { gtk_init(&argc, &argv); GtkWidget *window = gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_window_set_title(GTK_WINDOW(window), "Window&quot...
Sometimes a query looks like this, with a * in the SELECT clause. SELECT item.*, /* nonstandard */ COUNT(*) number_of_uses FROM item JOIN uses ON item.item_id, uses.item_id GROUP BY item.item_id Such a query needs to be refactored to comply with the ONLY_FULL_GROUP_BY sta...
A typical use case for RxJS is creating HTTP requests and caching their results for some period of time. Also, we always want to run only one request at a time and share its response. For example the following code caches 1 item for max. 1000ms: var updateRequest = Observable.defer(() => makeMo...
A very easy way to connect to an ORACLE database is by using oracledb module. This module handles the connection between your Node.js app and Oracle server. You can install it like any other module: npm install oracledb Now you have to create an ORACLE connection, which you can later query. co...
Use may now use the connExecute-Function for executing a query. You have the option to get the query result as an object or array. The result ist printed to console.log. function connExecute(err, connection) { if (err) { console.error(err.message); return; } sql = ...
To simplify your querying from ORACLE-DB, you may want to call your query like this: const oracle = require('./oracle.js'); const sql = "select 'test' as c1, 'oracle' as c2 from dual"; oracle.queryObject(sql, {}, {}) .then(function(result) { console.log(result.rows[0]['C...
It is sometimes easiest to just declare a global of type any, especially in simple projects. If jQuery didn't have type declarations (it does), you could put declare var $: any; Now any use of $ will be typed any.
For more complicated projects, or in cases where you intend to gradually type a dependency, it may be cleaner to create a module. Using JQuery (although it does have typings available) as an example: // place in jquery.d.ts declare let $: any; export default $; And then in any file in your pr...
If you just want to indicate the intent of an import (so you don't want to declare a global) but don't wish to bother with any explicit definitions, you can import an ambient module. // in a declarations file (like declarations.d.ts) declare module "jquery"; // note that there are no ...
trash is a minimalistic vendoring tool that you configure with vendor.conf file. This example is for trash itself: # package github.com/rancher/trash github.com/Sirupsen/logrus v0.10.0 github.com/urfave/cli v1.18.0 github.com/cloudfoundry-incubat...
Use a <template> element to design a HTML template that you can then reuse in your code. <template id="Template1"> Hello, World ! <template> <div id="Target1"></div> <script> Target1.appendChild( Template1.content.cloneNode( tr...
Create a new HTML tag named <hello-world> that will display "Hello, World!": <script> //define a class extending HTMLElement class HelloWorld extends HTMLElement { connectedCallback () { this.innerHTML = 'Hello, World!' } } //register the new custom elem...
Add a Shadow DOM to a div that will display "Hello, World!" instead of its initial content. <div id="Div1">intial content</div> <script> var shadow = Div1.attachShadow( { mode: 'open' } ) shadow.innerHTML = "Hello, World!" </script>...
Import an HTML file that will add a div with "Hello, World!" at the end of the main document's DOM tree. Imported file hello.html: <script> var div = document.createElement( 'div' ) div.innerHTML = 'Hello, World!' document.body.appendChild( div ) </script> Mai...
This example combines Custom Element, Template, Shadow DOM and HTML Import to display a the "Hello, World!" string in HTML. In file hello-world.html: <!-- 1. Define the template --> <template> Hello, World! </template> <script> var template = document....
In lua, the logical operators and and or returns one of the operands as the result instead of a boolean result. As a consequence, this mechanism can be exploited to emulate the behavior of the ternary operator despite lua not having a 'real' ternary operator in the language. Syntax condition and...
NSMutableArray *array = [NSMutableArray arrayWithObjects:@"Ken", @"Tim", @"Chris", @"Steve",@"Charlie",@"Melissa", nil]; NSPredicate *bPredicate = [NSPredicate predicateWithFormat:@"SELF beginswith[c] 'c'"]; NSArray ...
String and character literals provide an escape mechanism that allows express character codes that would otherwise not be allowed in the literal. An escape sequence consists of a backslash character (\) followed by one ore more other characters. The same sequences are valid in both character an st...

Page 1065 of 1336