Tutorial by Examples: any

Use the analytical function row_number(): with t as ( select col1 , col2 , row_number() over (order by col1, col2) rn from table ) select col1 , col2 from t where rn between N and M; -- N and M are both inclusive Oracle 12c handles this more easily with OFFSET and FETCH.
app.use() and middleware can be used for "before" and a combination of the close and finish events can be used for "after". app.use(function (req, res, next) { function afterResponse() { res.removeListener('finish', afterResponse); res.removeListener('clos...
To illustrate relation OneToMany we need 2 Entities e.g. Country and City. One Country has multiple Cities. In the CountryEntity beloww we define set of cities for Country. @Entity @Table(name = "Country") public class CountryEntity implements Serializable { private static final l...
If you are attempting to get an Angular2 site running on your Windows work computer at XYZ MegaCorp the chances are that you are having problems getting through the company proxy. There are (at least) two package managers that need to get through the proxy: NPM Typings For NPM you need to ad...
The C standard says that there is very little difference between the #include <header.h> and #include "header.h" notations. [#include <header.h>] searches a sequence of implementation-defined places for a header identified uniquely by the specified sequence between the &l...
- (UIImage *)drawImageBySize:(CGSize)size quality:(CGInterpolationQuality)quality { UIGraphicsBeginImageContextWithOptions(size, NO, 0.0); CGContextRef context = UIGraphicsGetCurrentContext(); CGContextSetInterpolationQuality(context, quality); [self drawInRect: CGRectMake (0, 0...
One to Many mapping is generally simply a bidirectional relationship of Many to One mapping. We will take same example that we took for Many to one mapping. Employee.java @Entity public class Employee { @TableGenerator(name = "employee_gen", table = "id_gen", pkColumnNa...
Employee Entity @Entity public class Employee { @TableGenerator(name = "employee_gen", table = "id_gen", pkColumnName = "gen_name", valueColumnName = "gen_val", allocationSize = 1) @Id @GeneratedValue(strategy = GenerationType.TABLE, generat...
Employee entity. package com.thejavageek.jpa.entities; import java.util.List; import javax.persistence.CascadeType; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.Joi...
Insert the analytics function within index.js function analytics(){ (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a...
In SuiteScript 1.0, use nlobjContext.getRemainingUsage() to retrieve the remaining units. An nlobjContext reference is retrieved using the global nlapiGetContext function. // 1.0 var context = nlapiGetContext(); nlapiLogExecution("DEBUG", "Governance Monitoring", "Remai...
let inline getLength s = (^a: (member Length: _) s) //usage: getLength "Hello World" // or "Hello World" |> getLength // returns 11
01 a PIC 9. 01 b PIC 99. 01 c PIC 999. 01 s PIC X(4). 01 record-group. 05 field-a PIC 9. 05 field-b PIC 99. 05 field-c PIC 999. 01 display-record. 05 field-a PIC Z. 05 field-b PIC ZZ. 05 field-c PIC $Z9. *> numeric fields are moved left to right *> a set to...
List all the node versions installed nvm ls v4.5.0 v6.7.0 Run command using any node installed version nvm run 4.5.0 --version or nvm exec 4.5.0 node --version Running node v4.5.0 (npm v2.15.9) v4.5.0 nvm run 6.7.0 --version or nvm exec 6.7.0 node --version Running node v6.7.0...
here countInstance is a static class variable class StaticTest{ static countInstance : number= 0; constructor(){ StaticTest.countInstance++; } } new StaticTest(); new StaticTest(); console.log(StaticTest.countInstance);
To reverse a list, it isn't important what type the list elements are, only what order they're in. This is a perfect candidate for a generic function, so the same reverseal function can be used no matter what list is passed. let rev list = let rec loop acc = function | [] -...
var pipeline = {}; // (...) adding things in pipeline for(var key in pipeline) { fs.stat(pipeline[key].path, function(err, stats) { if (err) { // clear that one delete pipeline[key]; return; } // (...) pipeline[key].count++; }); } The problem i...
SELECT 1 NUM_COLUMN, 'foo' VARCHAR2_COLUMN from DUAL UNION ALL SELECT NULL, NULL from DUAL; NUM_COLUMNVARCHAR2_COLUMN1foo(null)(null)
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...

Page 4 of 6