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
#!/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) |
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
commit 37114709f33b0818ed3f18174d740015c786fff9 | |
Author: Ihor Kaharlichenko <[email protected]> | |
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 |
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
// 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 |