Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

GPL loophole

Name: Anonymous 2012-11-11 12:20

Program X is GPL'd. You want to modify it but don't want to release your modifications. Slightly modify the source of X so that it can dynamically load foreign executable code. Have it load your proprietary additions.

Release the source of your Program X fork as GPL, but do not reveal the source of your proprietary additions.

Name: Anonymous 2012-11-11 13:23

Can someone convert this python code into C++ please?


#!/usr/bin/python

# find the number of ways to reach a total with the given number of combinations

cents = 200
denominations = [25, 10, 5, 1]
names = {25: "quarter(s)", 10: "dime(s)", 5 : "nickel(s)", 1 : "pennies"}

def count_combs(left, i, comb, add):
    if add: comb.append(add)
    if left == 0 or (i+1) == len(denominations):
        if (i+1) == len(denominations) and left > 0:
            comb.append( (left, denominations[i]) )
            i += 1
        while i < len(denominations):
            comb.append( (0, denominations[i]) )
            i += 1
        print " ".join("%d %s" % (n,names[c]) for (n,c) in comb)
        return 1
    cur = denominations[i]
    return sum(count_combs(left-x*cur, i+1, comb[:], (x,cur)) for x in range(0, int(left/cur)+1))

print count_combs(cents, 0, [], None)



Thanks in advance

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List