Skip to content

Instantly share code, notes, and snippets.

sudo jupyter notebook --allow-root --ip=0.0.0.0 --port=80 --no-browser
[Unit]
Description=Jupyter Notebook
[Service]
Type=simple
PIDFile=/run/jupyter.pid
# Step 1 and Step 2 details are here..
# ------------------------------------
ExecStart=/usr/local/bin/jupyter notebook --ip=0.0.0.0 --no-browser
User=ubuntu
sudo cp jupyter.service /usr/lib/systemd/system/
sudo systemctl enable jupyter.service
sudo systemctl daemon-reload
sudo systemctl restart jupyter.service
journalctl -u jupyter > /tmp/test.txt && cat /tmp/test.txt
jupyter nbconvert --to script config_template.ipynb
-- show tables
SELECT * FROM pg_catalog.pg_tables;
-- describe table
select column_name, data_type, character_maximum_length from INFORMATION_SCHEMA.COLUMNS where table_name = 'tablename';
SELECT *, pg_size_pretty(total_bytes) AS total
, pg_size_pretty(index_bytes) AS INDEX
, pg_size_pretty(toast_bytes) AS toast
, pg_size_pretty(table_bytes) AS TABLE
FROM (
SELECT *, total_bytes-index_bytes-COALESCE(toast_bytes,0) AS table_bytes FROM (
SELECT c.oid,nspname AS table_schema, relname AS TABLE_NAME
, c.reltuples AS row_estimate
, pg_total_relation_size(c.oid) AS total_bytes
, pg_indexes_size(c.oid) AS index_bytes
@timotta
timotta / dependencies.json
Created March 10, 2021 20:20
Lib versions that works together on package.json
{
"babel-preset-expo": "^5.0.0",
"babel-preset-react-native": "^5.0.0",
"jest": "^24.8.0",
"jest-expo": "^26.0.0",
"react-test-renderer": "^16.2.0",
"react": "^16.3.0",
"react-native": "0.61.5",
"@babel/core": "7.13.10"
}
rDCG^{k,n} =
\frac {
\sum_{i=1}^{n}\frac{rel_{i}}{log_{2}^{i+1}}
}{
\sum_{i=1}^{k}\frac{rel_{max}}{log_{2}^{i+1}}
}
Algoritmo A Algoritmo B
1 Vendo nintendo switch colorido (relevância = 1) Nintendo Switch Cinza (relevância = 2)
2 Nintendo Wii U (relevância = 0) Nintendo Wii U (relevância = 0)
3 Nintendo Switch Cinza (relevância = 2) Vendo nintendo switch colorido (relevância = 1)
Algoritmo A Algoritmo B Ranking Ideal
1 Vendo nintendo switch colorido (relevância = 1) Nintendo Switch Cinza (relevância = 2) Nintendo Switch Cinza (relevância = 2)
2 Nintendo Wii U (relevância = 0) Nintendo Wii U (relevância = 0) Vendo nintendo switch colorido (relevância = 1)
3 Nintendo Switch Cinza (relevância = 2) Vendo nintendo switch colorido (relevância = 1) Nintendo Wii U (relevância = 0)