This file contains hidden or 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
| set saveFolder to (choose folder) as string | |
| tell application "OmniGraffle" | |
| set theDocument to front document | |
| set area type of the current export settings to all graphics | |
| repeat with thisCanvas in canvases of theDocument | |
| set canvas of front window to thisCanvas | |
| save theDocument as "png" in file (saveFolder & name of thisCanvas & ".png") |
This file contains hidden or 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 formatString | |
| ( | |
| p_string IN VARCHAR2, | |
| p_placeholder1 IN VARCHAR2 DEFAULT NULL, | |
| p_placeholder2 IN VARCHAR2 DEFAULT NULL, | |
| p_placeholder3 IN VARCHAR2 DEFAULT NULL, | |
| p_placeholder4 IN VARCHAR2 DEFAULT NULL, | |
| p_placeholder5 IN VARCHAR2 DEFAULT NULL, | |
| p_placeholder6 IN VARCHAR2 DEFAULT NULL, | |
| p_placeholder7 IN VARCHAR2 DEFAULT NULL, |
This file contains hidden or 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 | |
| l_exception EXCEPTION; | |
| lc_max_tries CONSTANT PLS_INTEGER := 3; | |
| --- | |
| l_unsuccessful_tries PLS_INTEGER := 2; | |
| BEGIN | |
| <<some_loop>> | |
| FOR iterator IN 1 .. lc_max_tries LOOP | |
| BEGIN | |
| dbms_output.put_line('try #' || iterator); |
This file contains hidden or 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
| // Dependency resolution, adapted from https://gist.github.com/1232505/f16308bc14966c8d003c2686b1c258ec41303c1f | |
| function resolve(graph) { | |
| var sorted = [], // sorted list of IDs ( returned value ) | |
| visited = {}; // hash: id of already visited node => true | |
| // 2. topological sort | |
| Object.keys(graph).forEach(function visit(name, ancestors) { | |
| if (!Array.isArray(ancestors)) ancestors = []; | |
| ancestors.push(name); | |
| visited[name] = true; |
This file contains hidden or 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 OR REPLACE PROCEDURE clob2file | |
| ( | |
| clob_in IN CLOB, | |
| directory_name IN VARCHAR2, | |
| file_name IN VARCHAR2 | |
| ) IS | |
| -- this is safe value less then 6400 as recommended by utl_file comments, rounded to multiple of 1024 | |
| lc_amount CONSTANT INTEGER := 6144; | |
| l_file utl_file.file_type; | |
| l_blob_buffer BLOB; |
This file contains hidden or 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
| with | |
| -- NoFormat Start | |
| regexp as ( | |
| select '^[[:blank:]=v]*(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(-[a-zA-Z0-9\.-]*)?(\+[a-zA-Z0-9\.-]*)?[[:blank:]]*$' as expression from dual | |
| ), | |
| sample as ( | |
| select '' test_value, '<null>,<null>,<null>,<null>,<null>' expected from dual union all | |
| select '1.2.3' test_value, '1,2,3,<null>,<null>' expected from dual union all | |
| select ' 1.2.3' test_value, '1,2,3,<null>,<null>' expected from dual union all | |
| select ' 1.2.3 ' test_value, '1,2,3,<null>,<null>' expected from dual union all |
This file contains hidden or 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
| logconfig = { | |
| "version": 1, | |
| "disable_existing_loggers": 0, | |
| "root": { | |
| "level": "DEBUG", | |
| "handlers": [ | |
| "console", | |
| "file", | |
| "debugfile" | |
| ] |
This file contains hidden or 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
| -- GMT vs. CET | |
| with dates as | |
| (select from_tz(cast(trunc(sysdate, 'YYYY') + level as timestamp), 'GMT') as gmt from dual connect by level <= 365), | |
| tzs as | |
| (select gmt, gmt at time zone 'CET' as cet from dates) | |
| select to_date(to_char(gmt, 'YYYY-MM-DD HH24:MI:SS'), 'YYYY-MM-DD HH24:MI:SS') as gmt, | |
| to_date(to_char(cet, 'YYYY-MM-DD HH24:MI:SS'), 'YYYY-MM-DD HH24:MI:SS') as cet | |
| from tzs; |
This file contains hidden or 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 | |
| l_handle_filter integer; | |
| l_handle_remap integer; | |
| l_handle_transform integer; | |
| begin | |
| -- create filter handle and filter objects to transform | |
| l_handle_filter := dbms_metadata.open('TABLE', version => 'LATEST'); | |
| dbms_metadata.set_filter(l_handle_filter, 'SCHEMA', user); | |
| dbms_metadata.set_filter(l_handle_filter, 'NAME', 'ETL_PROCESS'); | |
| -- create transform handle |
OlderNewer