Tutorial by Examples

An antijoin returns rows from the left side of the predicate for which there are no corresponding rows on the right side of the predicate. It returns rows that fail to match (NOT IN) the subquery on the right side. SELECT * FROM employees WHERE department_id NOT IN (SELECT department_id F...
A semijoin query can be used, for example, to find all departments with at least one employee whose salary exceeds 2500. SELECT * FROM departments WHERE EXISTS (SELECT 1 FROM employees WHERE departments.department_id = employees.department_id AND employees.salary > 25...
reduce(_:combine:) can be used in order to combine the elements of a sequence into a single value. It takes an initial value for the result, as well as a closure to apply to each element – which will return the new accumulated value. For example, we can use it to sum an array of numbers: let numbe...
Normal Update UPDATE TESTTABLE SET TEST_COLUMN= 'Testvalue',TEST_COLUMN2= 123 WHERE EXISTS (SELECT MASTERTABLE.TESTTABLE_ID FROM MASTERTABLE WHERE ID_NUMBER=11);
Using Inline View (If it is considered updateable by Oracle) Note: If you face a non key preserved row error add an index to resolve the same to make it update-able UPDATE (SELECT TESTTABLE.TEST_COLUMN AS OLD, 'Testvalue' AS NEW FROM TESTTA...
Using Merge MERGE INTO TESTTABLE USING (SELECT T1.ROWID AS RID, T2.TESTTABLE_ID FROM TESTTABLE T1 INNER JOIN MASTERTABLE T2 ON TESTTABLE.TESTTABLE_ID = MASTERTABLE.TESTTABLE_ID WHERE...
Sometimes the default Scrapy user agent ("Scrapy/VERSION (+http://scrapy.org)") is blocked by the host. To change the default user agent open settings.py, uncomment and edit the following line to what ever you want. #USER_AGENT = 'projectName (+http://www.yourdomain.com)' For example ...
This example shows how to create a table, insert data, and select from the database using SQLAlchemy Core. For information re: the SQLAlchemy ORM, see here. First, we'll need to connect to our database. from sqlalchemy import create_engine engine = create_engine('sqlite://') The engine is ...
Reading line by line awk '/^>/ {printf("%s%s\t",(N>0?"\n":""),$0);N++;next;} {printf("%s",$0);} END {printf("\n");}' < input.fa one can read this awk script as: if the current line ($0) starts like a fasta header (^>). Then we prin...
download and linearize the 10 first FASTA sequences from UniProt: $ curl -s "ftp://ftp.uniprot.org/pub/databases/uniprot/current_release/knowledgebase/complete/uniprot_sprot.fasta.gz" |\ gunzip -c |\ awk '/^>/ {printf("%s%s\t",(N>0?"\n":""),$0);N...
In order to create a hotkey or hotstring that only triggers when certain windows are active or exist, you can put one or several of the following directives before the hotkey definition: #IfWinActive [, WinTitle, WinText] #IfWinExist [, WinTitle, WinText] #IfWinNotActive [, WinTitle, WinText] #I...
Default config is configured in import org.fusesource.restygwt.client.Defaults; Service root. By default, RestyGWT will use module name to get rest service root, to change it, call on module load: Defaults.setServiceRoot("/rest/"); Date format. By default, RestyGWT will send u...
Import and initialize Every module needs to be imported and pygame is no exception. Although we need to call the function pygame.init() for all imported modules in pygame to be initialized properly. If we forget this some modules won't work. The function also returns a tuple of all successfully a...
# the usual boilerplate setup cmake_minimum_required(2.8) project(my_test_project LANGUAGES CXX) # tell CMake to use CTest extension enable_testing() # create an executable, which instantiates a runner from # GoogleTest, Boost.Test, QtTest or whatever framework you use add_execut...
For more complex applications, you'll want to build up a ``settings.json` object using multiple environment variables. if(Meteor.isServer){ Meteor.startup(function()){ // this needs to be run on the server var environment, settings; environment = process.env.METEOR_ENV || "...
The METEOR_SETTINGS environment variable can accept JSON objects, and will expose that object in the Meteor.settings object. First, add a settings.json to your app root with some configuration info. { "public":{ "ga":{ "account":"UA-XXXXXXX-1" ...
Environment variables are also available to the server via the process.env object. if (Meteor.isServer) { Meteor.startup(function () { // detect environment by getting the root url of the application console.log(JSON.stringify(process.env.ROOT_URL)); // or by getting the port ...
To detect the environment on the server, we have to create a helper method on the server, as the server will determine which environment it is in, and then call the helper method from the client. Basically, we just relay the environment info from the server to the client. //------------------------...
As of Meteor 1.3, Meteor now exposes the NODE_ENV variable on the client by default. if (Meteor.isClient) { Meteor.startup(function () { if(process.env.NODE_ENV === "testing"){ console.log("In testing..."); } if(process.env.NODE_ENV === "production&...
Andrew Mao's solution. Average Aggregation Queries in Meteor Meteor.publish("someAggregation", function (args) { var sub = this; // This works for Meteor 0.6.5 var db = MongoInternals.defaultRemoteCollectionDriver().mongo.db; // Your arguments to Mongo's aggregation...

Page 567 of 1336