This file contains 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
CREATE SEQUENCE "temp1_id_seq" OWNED BY "Temp1". ID; | |
ALTER TABLE "Temp1" ALTER COLUMN ID | |
SET DEFAULT nextval('temp1_id_seq'); | |
COMMIT; | |
--Temp1 is table name, however, sequence name must be low-cased. |
This file contains 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
MySQL 5.6 | |
1. Download officla one, since it create lib folder for you | |
2. After installation | |
- Lib directory: | |
/usr/local/mysql/lib | |
- Bin, Data dir: | |
/usr/local/mysql-5.6.27-osx10.8-x86_64/bin/mysql | |
/usr/local/mysql-5.6.27-osx10.8-x86_64/data/mysql |
This file contains 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 argparse | |
import sqlite3 | |
conn = sqlite3.connect('saved_words.db') | |
parser = argparse.ArgumentParser() | |
parser.add_argument("-a", "--add", help="add word") | |
parser.add_argument("-c", help="compiling table", action='store_true') | |
parser.add_argument("-l", help="list words", action="store_true") | |
parser.add_argument("-v", "--verbosity", type=int, choices=[0, 1, 2], help="increase output verbosity") |
This file contains 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
\begin{code} | |
{-# LANGUAGE BangPatterns #-} | |
{-| | |
Module : Data.Digest.VowpalHash | |
Copyright : (c) Carter Tazio Schonwald | |
License : BSD-style | |
Maintainer : first dot last @gmail.com |
This file contains 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
# a slightly more realistic version of the 'Healthy' vs. 'Fever' model is outlined and then generated | |
import random | |
states = ('Healthy', 'Fever') | |
observations = ('normal', 'cold', 'dizzy') | |
start_probability = {'Healthy': 0.6, 'Fever': 0.4} | |
transition_probability = { | |
'Healthy' : {'Healthy': 0.8, 'Fever': 0.2}, | |
'Fever' : {'Healthy': 0.4, 'Fever': 0.6} |
This file contains 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
% !TeX spellcheck = <yes> | |
\documentclass[14pt,a4paper]{article} | |
\usepackage[latin1]{inputenc} | |
\usepackage{amsmath} | |
\usepackage{amsfonts} | |
\usepackage{amssymb} | |
\usepackage{graphicx} | |
\author{MZ} | |
\title{Share Terms} | |
\begin{document} |
This file contains 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
#!/bin/bash | |
# Bash Progress Bar: https://gist.github.com/F1LT3R/fa7f102b08a514f2c535 | |
progressBarWidth=20 | |
# Function to draw progress bar | |
progressBar () { | |
# Calculate number of fill/empty slots in the bar |
This file contains 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
#!/bin/bash | |
# usage: | |
# ls *.avi | ./video_to_audio.sh | |
# for f in `ls *.avi`; | |
# do | |
# echo item: $f | |
# done |
This file contains 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/perl | |
## ----------------------------------------------------------------------- | |
## | |
## Copyright 2002-2008 H. Peter Anvin - All Rights Reserved | |
## Copyright 2009 Intel Corporation; author: H. Peter Anvin | |
## | |
## This program is free software; you can redistribute it and/or modify | |
## it under the terms of the GNU General Public License as published by | |
## the Free Software Foundation, Inc., 53 Temple Place Ste 330, | |
## Boston MA 02111-1307, USA; either version 2 of the License, or |
This file contains 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
drop table if exists sales; | |
create table sales ( | |
prod_id int, | |
month_end varchar(10), | |
amount int | |
); | |
-- need to paddle zero if no sales, but we fill manually here | |
insert into sales values | |
(1, '2017-01-31', 100), (1, '2017-02-28', 300), |