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
/* Adapted from Tom Cunningham's 'Data Warehousing with MySql' (www.meansandends.com/mysql-data-warehouse) */ | |
###### small-numbers table | |
DROP TABLE IF EXISTS numbers_small; | |
CREATE TABLE numbers_small (number INT); | |
INSERT INTO numbers_small VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); | |
###### main numbers table | |
DROP TABLE IF EXISTS numbers; | |
CREATE TABLE numbers (number BIGINT); |
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
# This is a skeleton for testing models including examples of validations, callbacks, | |
# scopes, instance & class methods, associations, and more. | |
# Pick and choose what you want, as all models don't NEED to be tested at this depth. | |
# | |
# I'm always eager to hear new tips & suggestions as I'm still new to testing, | |
# so if you have any, please share! | |
# | |
# @kyletcarlson | |
# | |
# This skeleton also assumes you're using the following gems: |
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
look process: | |
`lsof -i :<PORT NUMBER> | |
kill process | |
`kill -9 <PID>` |
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
After setting up your layout, right-click on any terminal background and choose Preferences → Layouts tab and click on Add button. | |
Give it a name and hit Close. | |
This should create the mentioned ~/.config/terminator/config file. | |
Now you can start terminator using the saved layout using: terminator -l yourLayout (replace yourLayout with whatever you chose on step 2). | |
(optional) Edit the ~/.config/terminator/config file so that where it says [layouts] and nested below it [[yourLayout]], rename yourLayout to default and remove/rename the previous default layout. Now, when Terminator starts without any parameters, it will load your custom [[default]] layout! |
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
# Importing the libraries | |
from scipy.stats.stats import pearsonr | |
import pandas as pd | |
import numpy as np | |
import json | |
data = pd.read_csv("../../Downloads/data_books.csv", sep = ",", header=None, | |
names=['Reviewer', 'Book', 'Rating']) | |
# Picking 2 books |
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 math | |
import random | |
import csv | |
import cProfile | |
import numpy as np | |
import hashlib | |
memoization = {} | |
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
class ClusteringQuality: | |
""" | |
Instances of this class implement the two measures of clustering quality discussed in the article, namely the davies | |
bouldin index and the silhouette index. It also implements a number of useful helper methods. | |
:param solution: the clustering solution of type Clustering | |
:param minimum: the minimum distance allowable | |
""" | |
def __init__(self, solution, minimum): | |
""" |
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/sh | |
# Git pre-commit hook to check all staged Ruby (*.rb/haml/coffee) files | |
# for Pry binding references | |
# | |
# Installation | |
# | |
# ln -s /path/to/pre-commit.sh /path/to/project/.git/hooks/pre-commit | |
# chmod +x pre-commit | |
# | |
# Based on |
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
http://stackoverflow.com/questions/927358/how-to-undo-last-commits-in-git | |
http://askubuntu.com/questions/97936/terminal-command-to-set-audio-volume | |
http://utahcon.com/i3-config-and-xev/ | |
http://www.ninjaducks.in/hacking/gnome-3-to-i-3/ | |
http://blog.tunnelshade.in/2014/05/making-i3-beautiful.html | |
http://stackoverflow.com/questions/4241211/how-do-i-convert-an-activerecord-result-array-to-a-normal-array | |
http://stackoverflow.com/questions/942543/operation-on-every-pair-of-element-in-a-list | |
http://askubuntu.com/questions/40126/how-to-copy-paste-a-table-from-libreoffice-calc-to-libreoffice-writer | |
https://ask.libreoffice.org/en/question/21286/change-page-numbering-in-the-content-field/ | |
http://imron02.blogspot.co.id/2012/04/penomoran-halaman-pada-libreoffice.html |
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
git branch -d branch_name #local | |
git push origin --delete <branch_name> |
OlderNewer