Skip to content

Instantly share code, notes, and snippets.

View samuell's full-sized avatar
💻
Hacking away

Samuel Lampa samuell

💻
Hacking away
View GitHub Profile
@dergachev
dergachev / README.md
Created October 10, 2012 16:49
Vagrant tutorial

Vagrant Setup

This tutorial guides you through creating your first Vagrant project.

We start with a generic Ubuntu VM, and use the Chef provisioning tool to:

  • install packages for vim, git
  • create user accounts, as specified in included JSON config files
  • install specified user dotfiles (.bashrc, .vimrc, etc) from a git repository

Afterwards, we'll see how easy it is to package our newly provisioned VM

@debasishg
debasishg / gist:8172796
Last active March 15, 2024 15:05
A collection of links for streaming algorithms and data structures

General Background and Overview

  1. Probabilistic Data Structures for Web Analytics and Data Mining : A great overview of the space of probabilistic data structures and how they are used in approximation algorithm implementation.
  2. Models and Issues in Data Stream Systems
  3. Philippe Flajolet’s contribution to streaming algorithms : A presentation by Jérémie Lumbroso that visits some of the hostorical perspectives and how it all began with Flajolet
  4. Approximate Frequency Counts over Data Streams by Gurmeet Singh Manku & Rajeev Motwani : One of the early papers on the subject.
  5. [Methods for Finding Frequent Items in Data Streams](http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.187.9800&rep=rep1&t
use std::io::fs::File;
enum ReadState {
Normal,
Newline,
Skipline,
}
fn main() {
let mut at = 0i;
@Ismael-VC
Ismael-VC / gc_count.jl
Last active July 13, 2017 17:52
GC Count
#!/usr/bin/env julia
function gc_count(fasta::String)
file = open(fasta, "r")
lines = readall(file)
gc = at = 0
for c in lines.data
if (c == 'G') || (c == 'C')
gc += 1
@knewter
knewter / roles_elixir_tasks_main.yml
Created August 18, 2014 14:23
elixir ansible deploy
---
- name: Create directory to put elixir in
sudo: 'yes'
shell: "mkdir -p /opt/elixir/v0.15.0"
- name: Install unzip
apt: name=unzip state=present update_cache=true
- name: Unzip elixir release
sudo: 'yes'
@behe
behe / gc_count.exs
Last active November 11, 2016 09:38 — forked from samuell/gc_count.exs
defmodule ATGCCount do
def count(sequence), do: cnt(String.to_char_list(sequence),0,0)
def cnt([65|t],at,gc), do: cnt(t,at+1,gc)
def cnt([84|t],at,gc), do: cnt(t,at+1,gc)
def cnt([71|t],at,gc), do: cnt(t,at,gc+1)
def cnt([67|t],at,gc), do: cnt(t,at,gc+1)
def cnt([62|_],at,gc), do: {at,gc}
def cnt([],at,gc), do: {at,gc}
# def cnt(_,0,0), do: {0,0}
def cnt([_|t], at, gc), do: cnt(t,at,gc)
@sgsfak
sgsfak / Drugbank parse to DB
Last active December 23, 2018 08:11
Parse DrugBank XML file with xmlstarlet
We couldn’t find that file to show.
SELECT node.title,timestamp,node_revisions.body
FROM node
LEFT JOIN node_revisions ON node.vid=node_revisions.vid
INTO OUTFILE '/tmp/nodes.csv'
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY '\n';
@markjay4k
markjay4k / animated3Dplot.py
Last active April 24, 2024 00:13
animated 3D example using PyQtGraph and OpenGL
# -*- coding: utf-8 -*-
"""
Animated 3D sinc function
"""
from pyqtgraph.Qt import QtCore, QtGui
import pyqtgraph.opengl as gl
import pyqtgraph as pg
import numpy as np
import sys
@lindenb
lindenb / Drugbank.java
Created March 21, 2018 15:56
Parsing drugbank using a xml schema and java keywords: drugbank xjc xsd schema xml java javac
/*
Author: Pierre Lindenbaum @yokofakun
related:
http://bionics.it/posts/parsing-drugbank-xml-or-any-large-xml-file-in-streaming-mode-in-go
*/
import ca.drugbank.*;
import java.util.*;
import java.util.stream.*;