This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Generates a SQL query that validates that none of your foreign key | |
-- constrainted columns are invalid (values that don't exist in the column that | |
-- defines valid values). | |
-- The query returns a list of foreign key constraints and the number of | |
-- violations present. If you want this query to return all constraints then | |
-- you can lop off the 'foo WHERE count > 0' below, this'll cause it to return | |
-- all foreign key constraints and the number of violations, even when 0. | |
SELECT 'SELECT * FROM (' || string_agg(query, ' UNION ') || ') foo WHERE count | |
> 0;' FROM ( | |
SELECT 'SELECT count(*), ' || ''''|| constraint_name || '''' || ' FROM ' || table_name || ' WHERE ' || column_name || ' NOT IN ( SELECT ' || foreign_column_name || ' FROM ' || foreign_table_name || ')' query |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
angular.module('simplest', []) | |
.directive( 'hello', function () { | |
return {template: '<span>Hello, world!</span>'}; | |
}); | |
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
client.email = email | |
client.password = password | |
client.source = 'my-source' | |
self.client = False | |
try: | |
client.ProgrammaticLogin() | |
self.client = client | |
except CaptchaRequired: | |
rospy.logerr('Google has started requiring captchas for Picasa.') | |
except BadAuthentication: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class M { | |
protected foo() { println 'foo' } | |
} | |
@Mixin(M) class A { | |
def bar() { foo() } | |
} | |
class B extends A {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def a = [(4 as Long):4] | |
def b = [4:4] | |
assert a == b |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def a = [(4 as Long):4] | |
def b = [4:4] | |
assert a == b |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
assert a == b | |
| | | | |
| | [4:4] | |
| false | |
[4:4] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Long a = 4 | |
Integer b = 4 | |
def map = [(a):1, (b):2] | |
assert map[a] != map[b] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Long a = 4 | |
Integer b = 4 | |
assert a == b | |
assert a.class != b.class |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
addForeignKeyConstraint( | |
baseColumnNames: 'column_name, | |
baseTableSchemaName: 'my_schema', | |
baseTableName: 'my_table', | |
constraintName: 'my_constraint_name', | |
deferrable: 'false', | |
initiallyDeferred: 'false', | |
onDelete: 'CASCADE', | |
onUpdate: 'CASCADE', | |
referencedTableName: 'referenced_table', |
NewerOlder