- 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.
- Models and Issues in Data Stream Systems
- 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
- Approximate Frequency Counts over Data Streams by Gurmeet Singh Manku & Rajeev Motwani : One of the early papers on the subject.
- [Methods for Finding Frequent Items in Data Streams](http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.187.9800&rep=rep1&t
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
// Just before switching jobs: | |
// Add one of these. | |
// Preferably into the same commit where you do a large merge. | |
// | |
// This started as a tweet with a joke of "C++ pro-tip: #define private public", | |
// and then it quickly escalated into more and more evil suggestions. | |
// I've tried to capture interesting suggestions here. | |
// | |
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_, | |
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant, |
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
//Provide an implementation of the abstract class Nat that represents non-negative integers | |
// | |
//Do not use standard numerical classes in this implementation. | |
//Rather, implement a sub-object and sub-class: | |
// | |
//class Zero : Nat | |
//class Succ(n: Nat) : Nat | |
// | |
//One of the number zero, then other for strictly positive numbers. | |
namespace Nat |
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
from contextlib import contextmanager | |
import logging | |
@contextmanager | |
def all_logging_disabled(highest_level=logging.CRITICAL): | |
""" | |
A context manager that will prevent any logging messages | |
triggered during the body from being processed. | |
:param highest_level: the maximum logging level in use. |
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 ReverseForLookupItem : ForLookupItemBase | |
{ | |
public ReverseForLookupItem([NotNull] PrefixExpressionContext context, | |
[NotNull] LiveTemplatesManager templatesManager, | |
[CanBeNull] string lengthPropertyName) | |
: base("forR", context, templatesManager, lengthPropertyName) { } | |
protected override IForStatement CreateStatement(CSharpElementFactory factory, ICSharpExpression expression) | |
{ | |
... |
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
"Hopefully the third answer is right; but who knows, maybe I made a mistake; I’m just a human, I can throw exceptions as well." | |
"I am waving my hands on purpose here, this is very spaghetti like code. And spaghetti is great as food, but not good as code." | |
"flatMap will allow us to focus on the happy path. flatMap will take care of all the noise. flatMap is the dolby for programmers." | |
"Great programmers write baby code" | |
"it's obviously correct" |
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
# You should have pswatch installed (http://psget.net/directory/pswatch/) | |
# You need small modification to the FSharpKoans/PathToEnlightenment.fs to make sure that you will not need to press any key | |
# Comment out | |
# printf "Press any key to continue..." | |
# System.Console.ReadKey() |> ignore | |
# 1. Open separate powershell window | |
# 2. Make sure you are in FSharpKoans solution folder | |
# 3. Run watch_fsharpkoans.ps1 | |
# 4. Make both your visual studio and powershell window visitble at the same time | |
# 5. Enjoy! |
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
public static class EnumerableEx | |
{ | |
public static IEnumerable<R> Select<T1, T2, R>(this IEnumerable<Tuple<T1, T2>> source, Func<T1, T2, R> f) | |
{ | |
return source.Select(t => f(t.Item1, t.Item2)); | |
} | |
} | |
Enumerable.Range(1, 10) | |
.Select(x => Tuple.Create(x, x)) |
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
процедура MergeSort (мод a: t) це | |
процедура Merge(арг a: t; Size: нат; рез b: t) це | |
змін i, j, k, r1, r2: нат; | |
поч | |
k <- 1; | |
поки k<=n повт | |
{визначення границь підмасивів} | |
i <- k; r1 <- i+Size-1; | |
якщо r1>n то r1 <- n кр; | |
j <- r1+1; r2 <- j+Size-1; |
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
#Example for the kaggle forums. | |
library(FNN) | |
library(stats) | |
train <- read.csv("data/train.csv", header=TRUE, comment.char="") | |
test <- read.csv("data/test.csv", header=TRUE, comment.char="") | |
N <- 30000 | |
set.seed(20140202) | |
trainingSet <- train[sample(1:nrow(train), N), ] |