Tutorial by Examples: sin

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...
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...
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...
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...
While developing, inserting the following line to your code: assert False, value will cause django to raise an AssertionError with the value supplied as an error message when this line is executed. If this occurs in a view, or in any code called from a view, and DEBUG=True is set, a full and de...
Debugging takes time and effort. Instead of chasing bugs with a debugger, consider spending more time on making your code better by: Write and run Tests. Python and Django have great builtin testing frameworks - that can be used to test your code much faster than manually with a debugger. Writ...
First Test.class: package foo.bar public class Test { } Also Test.class in another package package foo.bar.baz public class Test { } The above is fine because the two classes exist in different packages.
In Java if you don't provide an access modifier the default scope for variables is package-protected level. This means that classes can access the variables of other classes within the same package as if those variables were publicly available. package foo.bar public class ExampleClass { do...
Refer to this original Post by e.James According to Apple's NSInvocation class reference: An NSInvocation is an Objective-C message rendered static, that is, it is an action turned into an object. And, in a little more detail: The concept of messages is central to the objective-c philosophy....
To do this in Postman, you simply have to set the following: Set request type to POST In the Headers, set the following: Content-Type = application/json Authorization = < Your FCM Server Key > (See your Firebase Console's Cloud Messaging Tab) Set the payload parameters in the Body...
When using a function as a constructor, it has a special this binding, which refers to the newly created object: function Cat(name) { this.name = name; this.sound = "Meow"; } var cat = new Cat("Tom"); // is a Cat object cat.sound; // Returns "Meow" var ca...
import React, { Component } from 'react'; type Props = { posts: Array<Article>, dispatch: Function, children: ReactElement } class Posts extends Component { props: Props; render () { // rest of the code goes here } }
The reference to the outer class uses the class name and this public class OuterClass { public class InnerClass { public void method() { System.out.println("I can access my enclosing class: " + OuterClass.this); } } } You can access fields and ...
The async package provides functions for asynchronous code. Using the auto function you can define asynchronous relations between two or more functions: var async = require('async'); async.auto({ get_data: function(callback) { console.log('in get_data'); // async code to ...
You can delete trailing spaces with the following command. :%s/\s\+$//e This command is explained as follows: enter Command mode with : do this to the entire file with % (default would be for the current line) substitute action s / start of the search pattern \s whitespace character \+ e...
You can delete all blank lines in a file with the following command: :g/^$/d This command is explained as follows: enter Command mode with : g is a global command that should occur on the entire file / start of the search pattern the search pattern of blank line is ^g /end of the search pat...
Let's say that you have the following class: public class PersonInfo { public int ID { get; set; } [Display(Name = "First Name")] [Required(ErrorMessage = "Please enter your first name!")] public string FirstName{ get; set; } [Display(Name = "L...
In the file myConfig.groovy is the following content. message = 'Hello World!' aNumber=42 aBoolean=false aList=["apples", "grapes", "oranges"] Then in your main script you create a ConfigSlurper for your myConfig.groovy file which is really just another groovy sc...
Define a new visitor class by overriding some of the methods of ExpressionVisitor: class PrintingVisitor : ExpressionVisitor { protected override Expression VisitConstant(ConstantExpression node) { Console.WriteLine("Constant: {0}", node); return base.VisitConstant(...
The following tests range A2 to A7 for duplicate values. Remark: This example illustrates a possible solution as a first approach to a solution. It's faster to use an array than a range and one could use collections or dictionaries or xml methods to check for duplicates. Sub find_duplicates() ...

Page 129 of 161