Skip to content

Instantly share code, notes, and snippets.

View lianyi's full-sized avatar

lianyi lianyi

  • Bethesda MD
View GitHub Profile
@lianyi
lianyi / missing_indexes.sql
Created September 20, 2016 15:44 — forked from jasonmead/missing_indexes.sql
Find missing indexes in SQL Server
PRINT 'Missing Indexes: '
PRINT 'The "improvement_measure" column is an indicator of the (estimated) improvement that might '
PRINT 'be seen if the index was created. This is a unitless number, and has meaning only relative '
PRINT 'the same number for other indexes. The measure is a combination of the avg_total_user_cost, '
PRINT 'avg_user_impact, user_seeks, and user_scans columns in sys.dm_db_missing_index_group_stats.'
PRINT ''
PRINT '-- Missing Indexes --'
SELECT CONVERT (varchar, getdate(), 126) AS runtime,
mig.index_group_handle, mid.index_handle,
CONVERT (decimal (28,1), migs.avg_total_user_cost * migs.avg_user_impact * (migs.user_seeks + migs.user_scans)) AS improvement_measure,
@lianyi
lianyi / deploy-static-site-heroku.md
Created November 19, 2016 14:19 — forked from wh1tney/deploy-static-site-heroku.md
How to deploy a static website to Heroku

Gist

This is a quick tutorial explaining how to get a static website hosted on Heroku.

Why do this?

Heroku hosts apps on the internet, not static websites. To get it to run your static portfolio, personal blog, etc., you need to trick Heroku into thinking your website is a PHP app. This 6-step tutorial will teach you how.

Basic Assumptions

@lianyi
lianyi / .block
Created February 16, 2017 15:23 — forked from mbostock/.block
Line Interpolation
license: gpl-3.0
@lianyi
lianyi / README.md
Created February 16, 2017 15:25 — forked from mbostock/.block
Spline Editor

Click to add new points. Hit the DELETE key to remove the selected point. Use the dropdown menu to change the interpolation mode.

@lianyi
lianyi / classifier_from_little_data_script_3.py
Created January 10, 2018 17:27 — forked from fchollet/classifier_from_little_data_script_3.py
Fine-tuning a Keras model. Updated to the Keras 2.0 API.
'''This script goes along the blog post
"Building powerful image classification models using very little data"
from blog.keras.io.
It uses data that can be downloaded at:
https://www.kaggle.com/c/dogs-vs-cats/data
In our setup, we:
- created a data/ folder
- created train/ and validation/ subfolders inside data/
- created cats/ and dogs/ subfolders inside train/ and validation/
- put the cat pictures index 0-999 in data/train/cats
@lianyi
lianyi / readme.md
Created January 10, 2018 17:30 — forked from baraldilorenzo/readme.md
VGG-16 pre-trained model for Keras

##VGG16 model for Keras

This is the Keras model of the 16-layer network used by the VGG team in the ILSVRC-2014 competition.

It has been obtained by directly converting the Caffe model provived by the authors.

Details about the network architecture can be found in the following arXiv paper:

Very Deep Convolutional Networks for Large-Scale Image Recognition

K. Simonyan, A. Zisserman

@lianyi
lianyi / main.py
Last active February 20, 2022 20:17 — forked from khanhnamle1994/main.py
FCN - Full Code
# --------------------------
# Source and reference
# https://github.com/udacity/CarND-Semantic-Segmentation
# https://gist.github.com/lianyi/a5ba8d84f5b68401c2313b05e020b062
# https://medium.com/nanonets/how-to-do-image-segmentation-using-deep-learning-c673cc5862ef
# --------------------------
# --------------------------
# DATA PREPARATION
#create a test index with shingle mapping
curl -XPUT localhost:9200/test -d '{
"settings":{
"index":{
"analysis":{
"analyzer":{
"analyzer_shingle":{
"tokenizer":"standard",
"filter":["standard", "lowercase", "filter_stop", "filter_shingle"]
}
@lianyi
lianyi / mongo_import.js
Created September 12, 2018 21:36 — forked from RandomEtc/mongo_import.js
use node.js to copy from one mongo db to another
var url = require('url'),
mongodb = require('mongodb');
var sourceUrl = 'mongodb://user:pass@host:port/db',
targetUrl = 'mongodb://user:pass@host:port/db',
collectionName = 'my_awesome_collection';
function openDbFromUrl(mongoUrl, cb) {
var dbUrl = url.parse(mongoUrl),
dbName = dbUrl.pathname.slice(1), // no slash
@lianyi
lianyi / README-opencv-3.1-raspberry-pi-installation.md
Created February 3, 2019 14:32 — forked from willprice/README-opencv-3.1-raspberry-pi-installation.md
How to install OpenCV 3.1 on Raspbian Jessie (Lite)

Installing OpenCV 3.1 on Raspbian Jessie

Prerequisites

  • Keep your system up to date:
    • $ sudo apt-get update
    • $ sudo apt-get upgrade
    • $ sudo reboot
  • Make sure you've got an internet connection.
  • Make sure you've got
  • wget