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 TABLE BIG_TABLE AS SELECT level id, SYSDATE OperationDate FROM dual CONNECT BY level < 10000; | |
--DROP TABLE BIG_TABLE; | |
SELECT * FROM BIG_TABLE; | |
DECLARE | |
PROCEDURE rCleanUpOutOfDateRows | |
IS | |
-- 1.4M rows got deleted in 20 minutes | |
-- Unfortunatelly the are triggers on BIG_TABLE. | |
-- So we disable them for the time of delete wchis is safe in our case. |
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 | |
TYPE TIdx IS TABLE OF BINARY_INTEGER INDEX BY VARCHAR2(20); | |
TYPE rec1_ex_TP IS RECORD | |
( | |
rec_col1 CHAR(1), | |
rec_col2 CHAR(1), | |
rec_col3 CHAR(1) | |
); | |
TYPE rec1_ex_ARRAY IS VARRAY(12) OF rec1_ex_TP; |
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
/** Applies a function `f` to all elements of this $coll. | |
* | |
* {{{ | |
* // here is sample code | |
* val c = Seq(1,2,3) | |
* c foreach { i => println(s"got $i")} | |
* }}} | |
* | |
* @param f the function that is applied for its side-effect to every element. | |
* The result of function `f` is discarded. |
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 TABLE test_ExpV1 (value NUMBER(38)); | |
CREATE TABLE test_ExpV2 (value NUMBER(38)); | |
CREATE TABLE test_10r (Id NUMBER(38) NOT NULL); | |
INSERT INTO test_10r SELECT ROWNUM FROM dual CONNECT BY LEVEL <= 10; | |
INSERT INTO test_ExpV1 | |
SELECT TRUNC(dbms_random.value(1, 10000)) FROM dual CONNECT BY LEVEL <= 10000 | |
UNION ALL SELECT 0 FROM dual CONNECT BY LEVEL <= 500000 | |
UNION ALL SELECT -1 FROM dual CONNECT BY LEVEL <= 490000; |
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 TABLE test_ExpV1 (value NUMBER(38)); | |
CREATE TABLE test_ExpV2 (value NUMBER(38)); | |
CREATE TABLE test_10r (Id NUMBER(38) NOT NULL); | |
INSERT INTO test_10r SELECT ROWNUM FROM dual CONNECT BY LEVEL <= 10; | |
INSERT INTO test_ExpV1 | |
SELECT TRUNC(dbms_random.value(1, 10000)) FROM dual CONNECT BY LEVEL <= 10000 | |
UNION ALL SELECT 0 FROM dual CONNECT BY LEVEL <= 500000 | |
UNION ALL SELECT -1 FROM dual CONNECT BY LEVEL <= 490000; |
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
#! /bin/sh | |
# ================================================================== | |
# ______ __ _____ | |
# /_ __/___ ____ ___ _________ _/ /_ /__ / | |
# / / / __ \/ __ `__ \/ ___/ __ `/ __/ / / | |
# / / / /_/ / / / / / / /__/ /_/ / /_ / / | |
#/_/ \____/_/ /_/ /_/\___/\__,_/\__/ /_/ | |
# Multi-instance Apache Tomcat installation with a focus | |
# on best-practices as defined by Apache, SpringSource, and MuleSoft |
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 enum EntityType { | |
Customer("CS"), | |
ContactPerson("CP"); | |
EntityType(String symbol) { | |
this.symbol = symbol; | |
} | |
private String symbol; | |
public String getName() { |
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
/** Ensure statuses */ | |
object EnsureStatus { | |
sealed trait Type | |
case object Created extends Type // cannot match so need to create | |
case object Modified extends Type // matched and modified | |
case object NotModified extends Type // matched and not modified | |
val statuses = (Created, Modified, NotModified) | |
} |
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 using(closeable: {def close(): Unit}, f: => Unit) { | |
try { | |
f | |
} finally { | |
closeable.close | |
} | |
} |
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
Answers http://stackoverflow.com/questions/10373318/mixing-in-a-trait-dynamically. | |
Compile as follows: | |
scalac Common_1.scala Macros_2.scala | |
scalac Common_1.scala Test_3.scala -cp <path to the result of the previous compilation> | |
Tested in 2.10.0-M3, will most likely not compile by the time 2.10.0 final is released, because we're actively rehashing the API. | |
However the principles will remain the same in the final release, so the concept itself is okay. | |
upd. Code updated for 2.10.0-M7. | |
upd. Code updated for 2.10.0-RC1. |