Skip to content

Instantly share code, notes, and snippets.

Dear Netherlanders,

On April 6 (coming Wednesday) you will decide on the future of the Association Agreement (AA) between EU and Ukraine.

As you probably know (despite my confusing name for you ;)) I am Ukrainian who lives in the Netherlands.

There are all sorts of misleadings about the agreement are spreading around recently. Unfortunately many people tend to accept them. Thus many people will vote based on the reasons that have hardly something to do with the actual matter.

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@forus
forus / ora-force-change-own-pwd.sql
Created September 14, 2015 15:10
Add a flag to the user table to make a user change own password on next login.
--ORACLE version
ALTER TABLE SEARCHAPP.SEARCH_AUTH_USER ADD CHANGE_PASSWD NUMBER(1,0);
@forus
forus / latency.txt
Last active August 29, 2015 14:25 — forked from jboner/latency.txt
Latency Comparison Numbers
--------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns
Send 1K bytes over 1 Gbps network 10,000 ns 0.01 ms
Read 4K randomly from SSD* 150,000 ns 0.15 ms
-- i2b2 Metadata Schema
alter table i2b2metadata.i2b2 add constraint i2b2_c_fullname_uq unique (c_fullname); --could be pk. domain object refers to fullName+name as composite key
alter table i2b2metadata.i2b2_secure add constraint i2b2_secure_c_fullname_uq unique (c_fullname); --could be pk. domain object refers to fullName+name as composite key
-- Delete secure concepts that are not present in i2b2 table
--delete from i2b2metadata.i2b2_secure isc where not exists(select * from i2b2metadata.i2b2 where c_fullname = isc.c_fullname);
alter table i2b2metadata.i2b2_secure add constraint i2b2_secure_c_fullname_fk foreign key (c_fullname) references i2b2(c_fullname) on delete cascade;
alter table i2b2metadata.i2b2_tags add constraint i2b2_tags_pk primary key (tag_id);
alter table i2b2metadata.i2b2_tags add constraint i2b2_tags_path_fk foreign key (path) references i2b2(c_fullname) on delete cascade;
-- i2b2 Data Schema
From a00dd10787880368f2243e709dd219872476fa2a Mon Sep 17 00:00:00 2001
From: Ruslan Forostianov <ruslan@thehyve.nl>
Date: Wed, 25 Mar 2015 16:01:47 +0100
Subject: [PATCH 1/1] Fixes in favour of constraints
---
data/common/i2b2metadata/i2b2_secure.tsv | 1 -
.../functions/i2b2_create_security_for_trial.sql | 68 ----------------------
.../tm_cz/functions/i2b2_process_mrna_data.sql | 2 +-
3 files changed, 1 insertion(+), 70 deletions(-)
-- i2b2 Metadata Schema
alter table i2b2metadata.i2b2 add constraint i2b2_c_fullname_uq unique (c_fullname); --could be pk. domain object refers to fullName+name as composite key
alter table i2b2metadata.i2b2_secure add constraint i2b2_secure_c_fullname_uq unique (c_fullname); --could be pk. domain object refers to fullName+name as composite key
-- Delete secure concepts that are not present in i2b2 table
--delete from i2b2metadata.i2b2_secure isc where not exists(select * from i2b2metadata.i2b2 where c_fullname = isc.c_fullname);
alter table i2b2metadata.i2b2_secure add constraint i2b2_secure_c_fullname_fk foreign key (c_fullname) references i2b2(c_fullname) on delete cascade;
alter table i2b2metadata.i2b2_tags add constraint i2b2_tags_pk primary key (tag_id);
alter table i2b2metadata.i2b2_tags add constraint i2b2_tags_path_fk foreign key (path) references i2b2(c_fullname) on delete cascade;
-- i2b2 Data Schema
-- Subject Sample Mapping (aka Assay) table
alter table deapp.de_subject_sample_mapping add constraint de_subject_sample_mapping_pk primary key (assay_id);
alter table deapp.de_subject_sample_mapping add constraint de_subject_sample_mapping_patient_id_fk foreign key (patient_id) references i2b2demodata.patient_dimension(patient_num) on delete cascade;
alter table deapp.de_subject_sample_mapping add constraint de_subject_sample_mapping_gpl_id_fk foreign key (gpl_id) references de_gpl_info(platform);
alter table deapp.de_subject_sample_mapping alter concept_code type character varying(50);
alter table deapp.de_subject_sample_mapping add constraint de_subject_sample_mapping_concept_code_fk foreign key (concept_code) references i2b2demodata.concept_dimension(concept_cd) on delete cascade;
-- HD data tables
-- Add PKs for data tables that miss ones