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 X { | |
private val obst = listOf("Apple", "Pear", "Pear", "PEAR", "APPLE", "APRICOT", "Apple") | |
@Test | |
fun deduplicateCaseInsensitively_1() { | |
val deduplicated = obst.asSequence().sortedWith(String.CASE_INSENSITIVE_ORDER).fold(ArrayList<String>(obst.size)) { a, o -> | |
if (a.isEmpty() || !a.last().equals(o, true)) a += o | |
a | |
} | |
println(deduplicated) |
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
When a user write a database creation script, they give names for most of database objects (i.e. table names, | |
column names, constraint names, etc). When the DB author performs this script using a DBMS it creates a database | |
that contains objects with the names specified in the script. If the author perfroms this script several times, | |
the result will be several database with the same object names (as specified in the script). | |
However, sometimes the DB author can omit some names (i.e. names of constraints, indices, etc.), in this case | |
the DBMS makes names for these objects automatically (usually by concatenating a hardcoded prefix with a kind of | |
random or sequential number). When the author performs their script several times, the result will be databases | |
with different names (because that names were not specified in the script). We call such auto-genertated names | |
synthetic ones. So, the mentioned option includes such auto-generated stuff. |
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
2018-06-19 21:00:31 | |
Full thread dump Java HotSpot(TM) 64-Bit Server VM (25.171-b11 mixed mode): | |
"Attach Listener" #29 daemon prio=9 os_prio=0 tid=0x00007fd748001000 nid=0x28cf waiting on condition [0x0000000000000000] | |
java.lang.Thread.State: RUNNABLE | |
"DestroyJavaVM" #28 prio=5 os_prio=0 tid=0x00007fd774017800 nid=0x20c8 waiting on condition [0x0000000000000000] | |
java.lang.Thread.State: RUNNABLE | |
"TimerQueue" #25 daemon prio=5 os_prio=0 tid=0x00007fd72527b000 nid=0x210a waiting on condition [0x00007fd72275d000] |
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
SEP = ", " | |
QUOTE = "\'" | |
NEWLINE = System.getProperty("line.separator") | |
begin = true | |
def record(columns, dataRow) { | |
if (begin) { | |
OUT.append("INSERT INTO ") |
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
create function fun42(a integer, b integer, OUT c bigint, OUT d character varying) | |
returns record | |
language plpgsql | |
as $$ | |
begin | |
c = a + b; | |
d = c::varchar; | |
end; | |
$$; |
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
Index: .idea/codeStyles/codeStyleConfig.xml | |
IDEA additional info: | |
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP | |
<+>UTF-8 | |
=================================================================== | |
--- .idea/codeStyles/codeStyleConfig.xml (date 1508413887000) | |
+++ .idea/codeStyles/codeStyleConfig.xml (date 1508413887000) | |
@@ -0,0 +1,5 @@ | |
+<component name="ProjectCodeStyleConfiguration"> | |
+ <state> |