Skip to content

Instantly share code, notes, and snippets.

View theronic's full-sized avatar

Petrus Theron theronic

View GitHub Profile
@kierendavies
kierendavies / b.py
Created April 15, 2013 21:24
Google Code Jam 2013 Qualification Round Problem B
#!/usr/bin/python3
from itertools import product
T = int(input())
for t in range(T):
N, M = list(map(int, input().split()))
grid = [list(map(int, input().split())) for n in range(N)]
rowmax = list(map(max, grid))
@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
@yokolet
yokolet / memo.md
Last active December 28, 2019 15:02
Datomic Pro with PostgreSQL setup
@shaharz
shaharz / friend_oauth.clj
Created January 27, 2014 16:47
Twitter/OAuth workflow for Friend
(ns friend-oauth
(:require
[cemerick.friend :as friend]
[cemerick.friend.workflows :refer [make-auth]]
[clj-http.client :as client]
[oauth.client :as oauth]
[ring.util.request :as request]))
(defn- which-oauth-uri
[config request]
@mookerji
mookerji / rocksdb.clj
Last active March 5, 2020 10:12
Idiomatic Clojure bindings for the C++ RocksDB library, an embedded persistent key-value store for flash storage and server workloads based on LevelDB. This implementation is based partially on Factual's clj-leveldb and is up here for some early review. If I've shared it with you, please don't repost until merged into a public Github.
(ns org.flausenhaus.rocksdb
"Idiomatic Clojure bindings for the C++ RocksDB library, an embedded
persistent key-value store for flash storage and server workloads based on
LevelDB. More details about RocksDB are given at
https://github.com/facebook/rocksdb/wiki/Rocksdb-Architecture-Guide.
The implementation here borrows heavily from Factual's clj-leveldb.
This namespace provides a few things:
0. Protocols/type definitions: byte serialization (IByteSerializable),
closeable sequences (CloseableSeq), and mutable
@pervognsen
pervognsen / dbg-test.el
Last active April 23, 2023 05:27
dbg.el
(require 'dbg)
(global-set-key (kbd "<C-S-f5>") 'dbg-restart)
(global-set-key (kbd "<f5>") 'dbg-continue)
(global-set-key (kbd "<f9>") 'dbg-toggle-breakpoint)
(global-set-key (kbd "<f8>") 'dbg-watch)
(global-set-key (kbd "<f10>") 'dbg-next)
(global-set-key (kbd "<C-f10>") 'dbg-continue-to-here)
(global-set-key (kbd "<f11>") 'dbg-step)
(global-set-key (kbd "<C-S-f10>") 'dbg-jump)
@protrolium
protrolium / ffmpeg.md
Last active May 3, 2024 18:58
ffmpeg guide

ffmpeg

Converting Audio into Different Formats / Sample Rates

Minimal example: transcode from MP3 to WMA:
ffmpeg -i input.mp3 output.wma

You can get the list of supported formats with:
ffmpeg -formats

You can get the list of installed codecs with:

@ccfontes
ccfontes / change-datomic-schema-fulltex-idx.clj
Last active January 16, 2024 12:06
Change datomic schema by adding a fulltext index to :url/path attribute
; 1. rename attribute: :url/path → :legacy/url-path-v1
(do (require '[datomic.api :as datomic] '[kanasubs.db :as db])
(datomic/transact @db/connection
[{:db/id :url/path, :db/ident :legacy/url-path-v1}]))
; 2. repurpose :url/path
(do (in-ns 'kanasubs.db)
(transact @connection
[{:db/id #db/id[:db.part/db]
:db/ident :url/path
@raymcdermott
raymcdermott / core.async filtering by time
Last active June 6, 2018 14:12
core.async filtering by time
(ns green-eggs.core
(:require [clojure.core.async
:as a
:refer [>! <! >!! <!! go chan buffer close! thread
alts! alts!! timeout onto-chan]]
[clj-time.core :as t]
[clj-time.coerce :refer [from-date]]))
;If you were to implement yourself, you could make a `go` that simply pulls from a channel, and adds to another as a
;`[timestamp item]` pair, then finally pushes into an unbounded `chan` that has a transducer that filters based on