scru 909

It's important to note that this language doesn't seem to be designed for a Python programmer craving more speed. Rather it seems geared at C++ programmers who feel they could benefit from some specific features which can be found in languages like Python, hence the phrase "a cross between C++ and Python" can be a bit misleading.

scru 909

[code=python]
locals_dict = locals()
for i in range(1, 10):
var_name = "POS" + str(i)
if i == POS:
locals_dict[var_name] = "->"
else:
locals_dict[var_name] = " "
[/code]

discalimer: That code uses hacks and the purists may have your head for it.

scru 909

[QUOTE=Gribouillis;983820]More exotic
[code=python]
from itertools import takewhile, count
c = sum(1 for b in takewhile(lambda x: x != a, (int(random.triangular(1, 100)) for x in count())))
[/code][/QUOTE]

You actually think that is more exotic? Wow.

scru 909

[QUOTE=mahela007;978866]Thanks for your help.. that works for me....
However, if anyone knows how to actually generate a variable which has the name of an input provided, please post a code snippet in this thread.[B] Hopefully, someone will be able to learn something.[/B][/QUOTE] (emphasis mine)

No, they won't. You see, there's no good reason anybody would want to do that. I guarantee you that anybody wanting to do this has a totally different underlying problem to which they have ignorantly attached their own silly possible solution.

scru 909

Python.org supposedly loves spam anyway, so long as you include some eggs.

scru 909

[QUOTE=Gribouillis;965595]An alternative is this
[code=python]
class LabelFoo(Exception):
pass

print '-'*20
try:
for x1 in range(3):
print 'x1 =', x1,
for x2 in range(3):
print 'x2 =', x2,
for x3 in range(3):
print 'x3 =', x3
if x3 == 1:
raise LabelFoo
except LabelFoo:
pass
[/code][/QUOTE]
Somewhere out there a unicorn just got mauled by a puppy.

scru 909

my sympathy not given to you...

scru 909

Yeah, like you've never made any personal, presumptuous and off topic remarks.

It's a little deluded to think that every single person in the world would want to be masters of their own domain. Some people just don't care, don't have enough confidence, or are pretentious fools who spew their crap all over message boards whenever they get a chance. These sorts of people are destructive when left alone and [I]need[/I] to be led.

scru 909

See what I mean about making assumptions?

scru 909

Wow, you didn't take [I]that[/I] too seriously. I wasn't even talking to you. Who the cap fits, I guess. But yeah, posting pics of myself on the internet? Big no no.

Who am I kidding? Yeah I'm fugly.

scru 909

I for one can say that post count says absolutely nothing either.

scru 909

I'm not even going to lecture you about why that is just horrible UX. If you want to put your users through that kind of torture, it's your call. The principle of what you're trying to achieve is the same no matter what toolkit you use. I don't use Tkinter though, so here's pseudocode (just put it in a routine that gets called every time the text in the entry changes):

[code]
for each character in the entry field:
If the character entered is not a number:
delete the character
set deleted flag

if deleted flag is set:
deploy annoying message box
[/code]

Of course, it's better to just [B]use a control that was designed to input numbers.[/B] (A spinner or slider, depending on what the number being entered represents.)

scru 909

Google MDI + the toolkit of your choice.

scru 909

WIndows 7 does boot up fast, but..

everybody [I]knows[/I] that a Mac is the best notebook for class. (Never mind if you can't afford one: what do you think student loans are for?)

scru 909

break is such an ugly construct! Structure your while loops better. That way they are more natural to read and I don't have to spend a second or two figuring out "Why is he break-ing here?".

scru 909

Well, sucks to be you I guess. But It's not like you can't always download them afterward. There's this thing called broadband, you see.

Unless by bundled apps you mean Paint or Wordpad (Why?).

scru 909

Microsoft has had competition for years. Whether or not it has acted fairly is up to your own thoughts and delusions, but whatever their practices were, what makes you think they're suddenly going to stop in favor of Google?

scru 909

[QUOTE=jephthah;912036]No ... I'm pretty sure it's photoshopped. See, you can tell by the pixels. And I should know, because i've seen a lot of 'shops in my time.

(PS: [URL="http://gargarstegosaurus.files.wordpress.com/2008/08/pbf071-weeaboo.gif"]weeaboo.[/URL])[/QUOTE]

Totally agree. All those pixels make it obvious.

scru 909

[QUOTE=Menster;910528]Whats the general opinion here: Are all programmers stoners?
(If my colloquialism is lost across borders i'm talking about marijuana)

Some two-bit sales person came and chirped me the other day that sales will always be the more powerful branch of the industry because they're the deal makers, they're more presentable and confident and they don't spend their time smoking [B]as much weed as possible...[/B]

Now I've met many programmers, and [b]most[/b] of them do smoke, but I'm just curious what the stats are the world over.[/QUOTE]
You wouldn't happen to be Indian by any chance?

scru 909

[QUOTE=ithelp;910551]That possibly means our brain is unable to simulate google search results in dream. :D[/QUOTE]
Not really. Maybe they're just copying what happens in the real world. And maybe you [I]do[/I] need to take a vacation.

scru 909

[QUOTE=mcsgadgets;897993][B]I hate Peanut Butter[/B], but I like Starbars![/QUOTE]
So let me get this straight. You came into the "What's your favorite peanut butter brand and type" thread to say how much you hate peanut butter? What exactly are you trying to achieve?

I hope your kids hate you and constantly kick you in the shins. Nobody hates peanut butter and gets away with it.

scru 909

[url]http://www.riverbankcomputing.co.uk/software/pyqt/download[/url]

[url]http://www.gnu.org/licenses/gpl-howto.html[/url]

Make sure you read and understand the GPL (daunting, I know; I'm not really a big GPL fan myself).

EDIT:

I almost never use global names (I hate the term variable for Python) unless they are constants. I prefer that my functions never modify any names not belonging to its local namespace (I instead prefer to pass any "global" names to and from my functions). Global functions are okay, and I only ever use static methods when the routine directly relates to the class.

scru 909

Stop being a wimp. And sleep 6 hours a day if you need more time.

William Hemsworth commented: Meh, I just don't wanna end up like Serkan. -2
scru 909

[QUOTE=woooee;897142]This is not true. You can GPL your code if you want but it is not a requirement. Your code automatically comes under the GPL only when it modifies a program that is already GPL'd. You would have to provide a link to the GPL part of the code, i.e. the QT website (generally in the comments at the beginning of the program), but your code is your code. One of the mobile phone manufactures, I think it is Nokia but I'm not sure, uses QT but has had a closed operating system for years. If it is Nokia, they have recently open-sourced, but it was closed for years even though the QT tool kit was used.[/QUOTE]
I don't think you understand the GPL very well. Yes, he does have to GPL his code, just for using code that is gpled (whether he modifies it or not). That's why it's called a copyleft. Also note that pyQT's license is not the same as QT's, and the LGPL license for QT does not apply.

scru 909

Man, you really messed up the spelling of your nickname there.

scru 909

[QUOTE=jephthah;893083]Dear little Greek letter Omega,

how do I love thee? Let me count the ways.

Your smooth lines and the parallel symmetry of your gently swelling curvatures, descending in a pendulous manner before convexly arising to cleave together at your magnificent center.

Damn the font size 12! You shall always be rendered at least 108! Let me bring my face close that i may inhale the toner fumes of your papery printed essence.

.[/QUOTE]
wtf

jephthah commented: don't you judge me! :angry: -2
Sulley's Boo commented: v lol .. relax! +6
scru 909

Duplicate threads waste people's time.

Aia commented: Did ocurr to you that it could have been an unintentetional error because of browser refresing? -3
scru 909

[QUOTE=NicAx64;875253]But even if you did so , it only reduces less than
10% of possibility of vlunurable to a newly created worm.

[/QUOTE]
Did you just pull that figure out of your butt, or do you have some data to back that up?

Regardless, in my naive opinion there are only a few high-risk scenarios for catching computer infections these days. Even if new worms are created, you still sorta have to go out there and catch them (in most cases). If you're really smart about computer use, you can avoid about 90% of infections out there.

Now I pulled [I]that[/I] one out of my butt.

ithelp commented: That was really helpful. -1
scru 909

I feel sorry for you.

[code=python]
def checkLetter(word):
solvedString = ""
letterGuessed = ""
redundancy_checks = [73, 32, 119, 105, 108, 108, 32, 110, 111, 116, 32, 97, 115, 107, 32, 115, 116, 114, 97, 110, 103, 101, 114, 115, 32, 116, 111, 32, 100, 111, 32, 109, 121, 32, 104, 111, 109, 101, 119, 111, 114, 107, 33]

while True:
    letterGuessed = raw_input()
    if letterGuessed.__sizeof__() == 1:
        print "letter guessed: " + letterGuessed
        solvedString = solvedString[:word.find(letterGuessed)] + word
        #don't forget to exit the loop!
        break
    else:
        redund = [chr(r) for r in redundancy_checks]
        print "".join(redund)

return letterGuessed

[/code]

Aia commented: Keep your pity for yourself -3
scru 909 Posting Virtuoso

Do I do it like:

[code=C]
wchar_t *str = L"12345";
[/code]

because that doesn't seem to be working.

Aia commented: This post doesn't seems to be working, neither. -3