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
DECLARE | |
open_count integer; | |
BEGIN | |
-- prevent any further connections | |
EXECUTE IMMEDIATE 'alter user @USERNAME account lock'; | |
--kill all sessions | |
FOR session IN (SELECT sid, serial# | |
FROM v$session | |
WHERE username = '@USERNAME') | |
LOOP |
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
Observable.from("Foo", "Bar", null) | |
.filter[startsWith("F")] | |
.subscribe( | |
[println(it)], | |
[println("error")], | |
[|println("done")] | |
) | |
//prints Foo and error |
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
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.pickClosureMethod(ClosureMetaClass.java:212) | |
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:270) | |
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1024) | |
at groovy.lang.Closure.call(Closure.java:414) | |
at groovy.lang.Closure.call(Closure.java:430) | |
at org.gradle.api.specs.internal.ClosureSpec.isSatisfiedBy(ClosureSpec.java:32) | |
at org.gradle.api.internal.collections.CollectionFilter.filter(CollectionFilter.java:48) | |
at org.gradle.api.internal.collections.FilteredCollection$FilteringIterator.findNext(FilteredCollection.java:101) | |
at org.gradle.api.internal.collections.FilteredCollection$FilteringIterator.<init>(FilteredCollection.java:95) | |
at org.gradle.api.internal.collections.FilteredCollection.iterator(FilteredCollection.java:130) |
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 ImmutableProcessor extends AbstractClassProcessor { | |
override doRegisterGlobals(ClassDeclaration cls, RegisterGlobalsContext context) { | |
context.registerClass(cls.builderClassName) | |
} | |
override doTransform(MutableClassDeclaration cls, extension TransformationContext context) { | |
if(cls.extendedClass != object) cls.addError("Inheritance does not play well with immutability") | |
cls.final = true |
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
List<Foo> specialThings = Lists.newArrayList(); //Foo extends Base | |
Bean bean = new Bean(); | |
// normally you would correctly get a compile error here, | |
//but the setter in your example does an unsafe cast that makes this line compile | |
bean.setStuff(specialThings); | |
List<Base> things = bean.getStuff(); | |
things.add(new Bar()); // Bar extends Base |
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
private static final Calendar UTC = Calendar.getInstance(TimeZone.getTimeZone("UTC")); | |
private Calendar utc() { | |
return (Calendar) UTC.clone(); | |
} | |
//unchanged | |
public LocalDateTime getValue(ResultSet rs, int index) throws SQLException { | |
Timestamp ts = rs.getTimestamp(index, utc()); |
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
private static final Calendar UTC = Calendar.getInstance(TimeZone.getTimeZone("UTC")); | |
private Calendar utc() { | |
return UTC; | |
} | |
//unchanged | |
public LocalDateTime getValue(ResultSet rs, int index) throws SQLException { | |
Timestamp ts = rs.getTimestamp(index, utc()); |
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
private Calendar utc() { | |
return Calendar.getInstance(TimeZone.getTimeZone("UTC")); | |
} | |
public LocalDateTime getValue(ResultSet rs, int index) throws SQLException { | |
Timestamp ts = rs.getTimestamp(index, utc()); | |
return ts != null ? new LocalDateTime(ts.getTime(), DateTimeZone.UTC) : null; | |
} | |
public void setValue(PreparedStatement st, int index, LocalDateTime value) throws SQLException { |
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
public LocalDateTime getValue(ResultSet rs, int index) throws SQLException { | |
Timestamp ts = rs.getTimestamp(index); | |
return ts != null ? new LocalDateTime(ts.getTime()) : null; | |
} | |
public void setValue(PreparedStatement st, int index, LocalDateTime value) throws SQLException { | |
DateTime dt = value.toDateTime(); //uses defaul timezone | |
st.setTimestamp(index, new Timestamp(dt.getMillis())); //uses default timezone | |
} |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<settings> | |
<profiles> | |
<profile> | |
<id>default</id> | |
<activation> | |
<activeByDefault>true</activeByDefault> | |
</activation> | |
<properties> | |
<gpg.homedir>/private/${cloudbees account name}/gpg</gpg.homedir> |
NewerOlder