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
val artifactoryUrl = "http://host:port/artifactory/sbt-dev" | |
resolvers += "Artifactory" at artifactoryUrl | |
publishTo := Some("Artifactory Realm" at s"$artifactoryUrl;build.timestamp=" | |
+ new java.util.Date().getTime) | |
credentials += Credentials(new File("credentials.properties")) |
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
import numpy as np | |
import os | |
import tensorflow as tf | |
import vgg | |
import vgg_preprocessing | |
from pycocotools.coco import COCO | |
slim = tf.contrib.slim | |
LOG_DIR = './log/fe' |
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
#!/usr/bin/env bash | |
# Path to the project directory (that should include requirements.txt), | |
# Files and directories within that need to be deployed. | |
project=../backend | |
contents=(module lamdba_handler.py) | |
# Unnecessary parts. Note that there are some inter-dependencies in SciPy, | |
# for example to use scipy.stats you also need scipy.linalg, scipy.integrate, | |
# scipy.misc, scipy.sparse, and scipy.special. |
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
-- pg equivalent of DESCRIBE TABLE | |
select column_name, data_type, character_maximum_length | |
from INFORMATION_SCHEMA.COLUMNS where table_name = 'my_table_name'; | |
-- General Table Size Information, Performance Snippets | |
-- Disk usage, Works with PostgreSQL>=9.2 | |
-- This will report size information for all tables, in both raw bytes and "pretty" form. | |
SELECT *, pg_size_pretty(total_bytes) AS total |
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
SELECT | |
pg_terminate_backend(pid) | |
FROM | |
pg_stat_activity | |
WHERE | |
-- don't kill my own connection! | |
pid <> pg_backend_pid() | |
-- don't kill the connections to other databases | |
AND datname = 'analytics' | |
; |
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
language: scala | |
jdk: oraclejdk8 | |
scala: | |
- "2.11.12" | |
# Use container-based infrastructure | |
sudo: false |
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 retry(isDone, next) { | |
var current_trial = 0, max_retry = 50, interval = 10, is_timeout = false; | |
var id = window.setInterval( | |
function() { | |
if (isDone()) { | |
window.clearInterval(id); | |
next(is_timeout); | |
} | |
if (current_trial++ > max_retry) { | |
window.clearInterval(id); |
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
{% for k, v in params.lifecycle_days.items() %} | |
alter table {{ k }} drop if exists partition (ds<'{{ macros.ds_format(macros.ds_add(ds, v*-1), "%Y-%m-%d", "%Y%m%d") }}'); | |
{% endfor %} | |
{% for k, v in params.lifecycle_days.items() %} | |
analyze table {{ k }} partition (ds='{{ ds_nodash }}') compute statistics; | |
{% endfor %} |
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
for (tuple <- spark.sparkContext.getConf.getAll) println(tuple) |
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
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using System.Text; | |
namespace SuffixTreeAlgorithm | |
{ | |
public class SuffixTree | |
{ |