Skip to content

Instantly share code, notes, and snippets.

Decimal Binary
------- ------
0 0000000000000000
205 0000000011001101 Interleave the min(compressed_val) for each
205 0000000011001101 sort key column and we get the min(minvalue)
0 0000000000000000 from stv_blocklist
-------------------------------------------------------------------------------
1711302150 0000000000000000000000000000000001100110000000000110011000000110
1023 0000001111111111
File "/home/ubuntu/venv/local/lib/python2.7/site-packages/pyechonest/track.py", line 293, in track_from_url
return _upload(param_dict, timeout, data=None)
File "/home/ubuntu/venv/local/lib/python2.7/site-packages/pyechonest/track.py", line 203, in _upload
result = util.callm('track/upload', param_dict, POST = True, socket_timeout = 300, data = data)
File "/home/ubuntu/venv/local/lib/python2.7/site-packages/pyechonest/util.py", line 219, in callm
f = opener.open(url, data=data)
File "/usr/lib/python2.7/urllib2.py", line 400, in open
response = self._open(req, data)
File "/usr/lib/python2.7/urllib2.py", line 418, in _open
'_open', req)
Downloading https://pypi.python.org/packages/source/s/setuptools/setuptools-3.1.zip
Extracting in /tmp/tmpCfGRaR
Now working in /tmp/tmpCfGRaR/setuptools-3.1
Installing Setuptools
Traceback (most recent call last):
File "setup.py", line 203, in <module>
dist = setuptools.setup(**setup_params)
File "/usr/lib/python2.7/distutils/core.py", line 152, in setup
dist.run_commands()
File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
# Path to your oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="robbyrussell"
# Example aliases
explain
select
count(t1.user_id) as viewed_homepage,
count(distinct t2.user_id) as used_demo,
count(distinct t3.user_id) as entered_credit_card
from (
select
user_id,
@ajw0100
ajw0100 / postgres.sql
Created August 24, 2015 21:44
Documenting Your PostgreSQL Data Warehouse
create table orders(id int);
comment on table orders is 'This table holds all customer orders!';
select description from pg_description
join pg_class on pg_description.objoid = pg_class.oid
where relname = 'orders';
┌───────────────────────────────────────┐
│ description │
├───────────────────────────────────────┤
@ajw0100
ajw0100 / redshift.sql
Created August 24, 2015 21:46
Documenting Your Redshift Data Warehouse
create table orders(id int);
comment on table orders is 'This table holds all customer orders!';
select description from pg_description
join pg_class on pg_description.objoid = pg_class.oid
where relname = 'orders';
┌───────────────────────────────────────┐
│ description │
├───────────────────────────────────────┤
@ajw0100
ajw0100 / mysql.sql
Created August 24, 2015 21:46
Documenting Your MySQL Data Warehouse
create table orders(id int) comment="This table holds all customer orders!";
select table_comment
from information_schema.tables
where table_name='orders';
┌───────────────────────────────────────┐
│ table_comment │
├───────────────────────────────────────┤
│ This table holds all customer orders! │
└───────────────────────────────────────┘
@ajw0100
ajw0100 / oracle.sql
Created August 24, 2015 21:47
Documenting Your Oracle Data Warehouse
create table orders (id int);
comment on table orders is 'This table holds all customer orders!';
select comments
from user_tab_comments
where table_name='orders';
┌───────────────────────────────────────┐
│ comments |
├───────────────────────────────────────┤
@ajw0100
ajw0100 / mssql.sql
Created August 24, 2015 21:48
Documenting Your Microsoft SQL Server Data Warehouse
create table orders (
id int
)
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'This table holds all customer orders!',
'user', @CurrentUser, 'table', 'orders'