Skip to content

Instantly share code, notes, and snippets.

View mastern2k3's full-sized avatar
๐Ÿ™ˆ
Coding blindfolded

Nitzan Zada mastern2k3

๐Ÿ™ˆ
Coding blindfolded
View GitHub Profile
@mastern2k3
mastern2k3 / print_confs.py
Created February 8, 2018 08:44
Print all binary permutations of a given size and a given amount of ones
def print_confs(c_len, c_ones):
inner_print_confs("", c_len, c_ones)
def inner_print_confs(c_prefix, c_len, c_ones):
if c_len == c_ones:
print(c_prefix + "1" * c_len)
def p_configs(alen):
if alen == 0:
return 1
totals = 0
if alen >= 1:
totals += p_configs(alen - 1)
class Example {
void Main() {
Listener refectListener = new ReflectionListener() {
void received(Connection connection, OneMessage message) {
}