Skip to content

Instantly share code, notes, and snippets.

View mogumogu2333's full-sized avatar

SilverAsh mogumogu2333

View GitHub Profile
@mogumogu2333
mogumogu2333 / vim_hive.sh
Created October 10, 2017 17:41 — forked from ikegami-yukino/vim_hive.sh
Hive syntax for Vim
mkdir -p .vim/syntax
wget -O .vim/syntax/hive.vim https://raw.githubusercontent.com/autowitch/hive.vim/master/syntax/hive.vim
echo "au BufNewFile,BufRead *.hql set filetype=hive expandtab" >> ~/.vimrc
echo "au BufNewFile,BufRead *.q set filetype=hive expandtab" >> ~/.vimrc
@mogumogu2333
mogumogu2333 / sort_dict.py
Last active September 30, 2020 18:49
[sort by dict value] Sort a python dict by value #python
import operator
sorted_x = sorted(word_count.items(), key=operator.itemgetter(1), reverse=True)
@mogumogu2333
mogumogu2333 / tfidf_keywords
Last active June 1, 2017 18:08
Given a list of documents, return the keywords using tfidf score
from sklearn.feature_extraction.text import TfidfVectorizer
def get_tfidf_features(docs):
tf = TfidfVectorizer(min_df=1, max_df=0.8)
tfidf_matrix = tf.fit_transform(docs)
idf = tf.idf_
feature_names = tf.get_feature_names()
keywords_list = []
POST /launcher_service_with_appname_0524/_search
{
"query": {
"multi_match": {
"query": "restaur review",
"tie_breaker": 0.3,
"fields": [
"service_name_parsed",
"desc_user_parsed",
"desc_dev_parsed"
@mogumogu2333
mogumogu2333 / tf_serving.sh
Created November 2, 2016 17:07 — forked from jarutis/tf_serving.sh
Install Tensorflow Serving on Centos 7 (CPU)
sudo su
# Java
yum -y install java-1.8.0-openjdk-devel
# Build Esentials (minimal)
yum -y install gcc gcc-c++ kernel-devel make automake autoconf swig git unzip libtool binutils
# Extra Packages for Enterprise Linux (EPEL) (for pip, zeromq3)
yum -y install epel-release

Steps to install Tensorflow Serving on Centos 7

Basic Prerequisites

sudo yum install git

sudo yum install gcc

sudo yum install gcc-c++
# How to export a mysql table into csv file with header
# the overall ideas in to attach the column names to the select * ....into outfile .. statement
# (select 'c1','c2','c3') union select c1,c2,c3 from tbl into outfile 'cc.csv'...
# 1st get the column names
select GROUP_CONCAT(CONCAT("'",COLUMN_NAME,"'"))
from INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = 'my_table'
AND TABLE_SCHEMA = 'my_schema'
order BY ORDINAL_POSITION
# Export MYSQL tables into csv file
SELECT
orderNumber, status, orderDate, requiredDate, comments
FROM
orders
WHERE
status = 'Cancelled'
INTO OUTFILE 'C:/tmp/cancelled_orders.csv'
FIELDS ENCLOSED BY '"'