Skip to content

Instantly share code, notes, and snippets.

View KhaledTo's full-sized avatar
😀

khaledto KhaledTo

😀
  • Paris
View GitHub Profile
@mrorii
mrorii / gist:961963
Created May 9, 2011 02:47
calculate kl divergence between two documents
# refer to http://staff.science.uva.nl/~tsagias/?p=185
import re, math, collections
def tokenize(_str):
stopwords = ['and', 'for', 'if', 'the', 'then', 'be', 'is', 'are', 'will', 'in', 'it', 'to', 'that']
tokens = collections.defaultdict(lambda: 0.)
for m in re.finditer(r"(\w+)", _str, re.UNICODE):
m = m.group(1).lower()
if len(m) < 2: continue
@rocarvaj
rocarvaj / .vimrc
Created April 27, 2012 21:28
Minimal .vimrc for C/C++ developers
" VIM Configuration File
" Description: Optimized for C/C++ development, but useful also for other things.
" Author: Gerhard Gappmeier
"
" set UTF-8 encoding
set enc=utf-8
set fenc=utf-8
set termencoding=utf-8
" disable vi compatibility (emulation of old bugs)
@leesmith
leesmith / simple-git-workflow.md
Last active December 30, 2023 23:37
Simple Git Workflow For Continuous Delivery

Simple Git Workflow For Continuous Delivery

Workflow guidelines:

  • master branch is always production-ready, deployable, 100% green test suite
  • New development is done on feature branches, with frequent rebasing onto master
  • Clean commit history by preferring to rebase instead of merge (git pull is configured to automatically rebase)

rebase workflow

Workflow

@ognis1205
ognis1205 / kullback_leibler.py
Last active January 11, 2023 09:27
Calculate Kullback-Leibler Divergence of Given Corpus
import numpy
import sys
import scipy.stats as stats
import matplotlib.pyplot as plotter
from gensim import corpora, models, similarities, matutils
# Defines dictionary from the specified corpus.
dictionary = corpora.Dictionary(
line.lower().split() for line in open('corpus_train.txt', 'rb')
/* ==================================================================== */
/* STEPHANE TUFFERY
/* MODELISATION PREDICTIVE ET APPRENTISSAGE STATISTIQUE AVEC R
/* ==================================================================== */
# ---------------------------------------------------------------------------------------------------------
# Installation des packages
# ---------------------------------------------------------------------------------------------------------
@mjdietzx
mjdietzx / waya-dl-setup.sh
Last active March 13, 2024 15:08
Install CUDA Toolkit v8.0 and cuDNN v6.0 on Ubuntu 16.04
#!/bin/bash
# install CUDA Toolkit v8.0
# instructions from https://developer.nvidia.com/cuda-downloads (linux -> x86_64 -> Ubuntu -> 16.04 -> deb (network))
CUDA_REPO_PKG="cuda-repo-ubuntu1604_8.0.61-1_amd64.deb"
wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/${CUDA_REPO_PKG}
sudo dpkg -i ${CUDA_REPO_PKG}
sudo apt-get update
sudo apt-get -y install cuda
def getProjectName() {
return 'JenkinsPipeline'
}
def getJDKVersion() {
return 'jdk1.8.0_101'
}
def getMavenConfig() {
return 'maven-config'