Skip to content

Instantly share code, notes, and snippets.

Ihor Kaharlichenko kaharlichenko

  • Cracow, Poland
Block or report user

Report or block kaharlichenko

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@kaharlichenko
kaharlichenko / easy217.fs
Last active Aug 29, 2015
Solution for /r/dailyprogrammer 217 easy challange without input parsing
View easy217.fs
// See https://www.reddit.com/r/dailyprogrammer/comments/3840rp/20150601_challenge_217_easy_lumberjack_pile/
let pileUpCollectionOnce distributeLogs collection logs =
let rec pileUpCollectionOnceRec acc element logs =
match acc, element, logs with
| acc, [], _ -> (List.rev acc, logs)
| acc, _, 0 -> (List.append (List.rev acc) element, logs)
| acc, head :: tail, logs ->
let newElement, remainingLogs = distributeLogs head logs
pileUpCollectionOnceRec (newElement :: acc) tail remainingLogs
@kaharlichenko
kaharlichenko / unix-domain-socket.patch
Created Sep 19, 2014
Unix Doman Sockets for Twisted@802ba0f on Python3
View unix-domain-socket.patch
commit 37114709f33b0818ed3f18174d740015c786fff9
Author: Ihor Kaharlichenko <madkinder@gmail.com>
Date: Fri Sep 19 15:21:30 2014 +0400
Port Unix Domain Socket support to Python3
See https://twistedmatrix.com/trac/ticket/6466
diff --git a/twisted/internet/endpoints.py b/twisted/internet/endpoints.py
index 238c272..f851ee4 100644
@kaharlichenko
kaharlichenko / regexp.py
Created Jun 2, 2012
Parsing subset of regexp
View regexp.py
#!/usr/bin/env python
# We will consider the following regular expressions:
#
# single characters # a
# regexp1 regexp2 # ab
# regexp * # a*
# regexp1 | regexp2 # a|b
# ( regexp ) # (a|b)* -- same as (?:a|b)
You can’t perform that action at this time.