Tags » Programming

Where do you find the energy to program after work? via /r/learnprogramming

Where do you find the energy to program after work?

I used to work at home, doing call center work. While solving customer problems I would program or play games on the side to keep myself entertained. 160 more words

please help me with lpthw ex41 via /r/learnprogramming

please help me with lpthw ex41

here is the code : ::SetEnvironmentVariable("Path", "$env:Path;C:\Python27", "User")import random from urllib import urlopen import sys

WORD_URL = "http://ift.tt/1JLq4YI; WORDS = [] PHRASES = { "class %%%(%%%):": "Make a class named %%% that is-a %%%.", "class %%%(object):\n\tdef __init__(self, ***)" : "class %%% has-a __init__ that takes self and *** parameters.", "class %%%(object):\n\tdef ***(self, @@@)": "class %%% has-a function named *** that takes self and @@@ parameters.", "*** = %%%()": "Set *** to an instance of class %%%.", "***.***(@@@)": "From *** get the *** function, and call it with parameters self, @@@.", "***.*** = '***'": "From *** get the *** attribute and set it to '***'." } # do they want to drill phrases first if len(sys.argv) == 2 and sys.argv[1] == "english": PHRASE_FIRST = True else: PHRASE_FIRST = False # load up the words from the website for word in urlopen(WORD_URL).readlines(): WORDS.append(word.strip()) def convert(snippet, phrase): class_names =  other_names = random.sample(WORDS, snippet.count("***")) results = [] param_names = [] for i in range(0, snippet.count("@@@")): param_count = random.randint(1,3) param_names.append(', '.join(random.sample(WORDS, param_count))) for sentence in snippet, phrase: result = sentence[:] # fake class names for word in class_names: result = result.replace("%%%", word, 1) # fake other names for word in other_names: result = result.replace("***", word, 1) # fake parameter lists for word in param_names: result = result.replace("@@@", word, 1) results.append(result) return results # keep going until they hit CTRL-D try: while True: snippets = PHRASES.keys() random.shuffle(snippets) for snippet in snippets: phrase = PHRASES question, answer = convert(snippet, phrase) if PHRASE_FIRST: question, answer = answer, question print question raw_input("> ") print "ANSWER: %s\n\n" % answer except EOFError: print "\nBye" … 86 more words

Evil Hangman

I got to know about Evil Hangman a while ago when I was reading my professor’s blog (Keith, if you read this, please don’t judge me. 684 more words


What GUI do you recommend for Python coders? via /r/learnprogramming

What GUI do you recommend for Python coders?

I'm only a beginner so something simple would be nice, but I don't want something that has just been compiled for Windows XP. 16 more words

Why gamers will love Windows 10

Or if you need just one reason, it’s called DirectX 12.
Whenever I think about Windows 10, I hear Russell Watson belting the Star Trek: Enterprise theme song: “It’s been a long road, getting from there to here…” The muchballyhooed new iteration of Microsoft’s flagship operating system is indeed here, available July 29 for anyone bold enough to make the leap. 790 more words


Taking a small break

i have just discovered that I am way ahead of my schedule of the game and I have almost completed the game 3 weeks before the set date, so I have decided to take a small break and I will resume working on the game on Monday. 107 more words


"signal 11 (SIGSEGV), code 1" - (Cocos2dx, C++ with Android & Eclipse)

The biggest drawback I’ve been having with Eclipse and cocos2dx (not sure if this also applies to Xcode …) I can think of is the annoying “Signal 11″ error. 291 more words