ZZucker 342 Practically a Master Poster

The perfect American worker is a person who helps other people to be prosperous.

ZZucker 342 Practically a Master Poster

... I am not supposed to eat pork, but have done it a few times and lightning has not struck me!

Wait till you get through the Pearly Gates, then you can eat all the pork you want!

I had an almond butter and grape jelly toast with my usual Costa Rican coffee.

ZZucker 342 Practically a Master Poster

In the US, if a person gets sick, goes to the hospital and then can't pay the bill, the rest of the hospital users pay for it in inflated bills. Let's face it, just a goofy type of 'take from the wealthier to pay the poorer' socialism.

ZZucker 342 Practically a Master Poster

Never go to bed angry!
Stay up and plot your revenge!

ZZucker 342 Practically a Master Poster

>>It's in the government's interest to scare the public, so they can spend more on the military.

Spending more on military is GOOD for the economy, it gives people jobs. Someone has to make all those cloths, bullets, tanks, etc. etc. I don't think we get much of that from China or Japan. So does your statement mean you don't want people to have jobs ?

No, I want those people to develop better energy sources, more fuel efficient clean cars, better medicines, improve healthcare, repair bridges and roads, produce energy efficient affordable housing, turn out much smarter students, and , oh yes, make this country safe without having to kill everyone else ...

You sound like a broken record there AD! :)

ZZucker 342 Practically a Master Poster

If you want to be in a business where the customer is always wrong, become a cop.

ZZucker 342 Practically a Master Poster

Has anybody ever bet enough on a winning horse?

ZZucker 342 Practically a Master Poster

In an ugly and unhappy world the richest man can purchase nothing but ugliness and unhappiness.
-- George Bernard Shaw

thunderstorm98 commented: Nice one.. +3
ZZucker 342 Practically a Master Poster

What's the oops for? I think you hit the nail right on the hammer. It's in the government's interest to scare the public, so they can spend more on the military.

This has been said by a wise person a long time ago:
"Keep your fears to yourself, but share your inspiration with others."

ZZucker 342 Practically a Master Poster

What the heck is going on?! Suddenly everyone is changing their avatars - I hardly recognize anyone any more.

Okay, not everyone but still scrolling down through long threads now takes longer because I can no longer discount people out of familiarity (just kidding).

Darn posters any way! Don't you just love Naru's new avatar?

ZZucker 342 Practically a Master Poster

A toasted Bagel with cream cheese and a mug of Rio coffee.

ZZucker 342 Practically a Master Poster

Why do you have to "put your two cents in ... " but it's only a "penny for your thoughts"? Where does the extra penny go?

ZZucker 342 Practically a Master Poster

About 26 percent of the water consumed in the U.S. is bottled water.

ZZucker 342 Practically a Master Poster

Science without religion is lame, religion without science is blind.
-- Albert Einstein (my hero)

ZZucker 342 Practically a Master Poster

You may want to read the IDLE part of:
http://www.daniweb.com/forums/post104834-1.html

ZZucker 342 Practically a Master Poster

It looks like you are visualizing new line characters, actually empty lines. There is got to be an option setting somewhere in IDLE where you can turn this off.

I don't use IDLE, but mostly the PyScripter IDE.

ZZucker 342 Practically a Master Poster

Study this and see if you can understand and learn:

def ask_hours():
    """return total hours worked and normal pay rate per hour"""
    hours = float(raw_input ("How many hours did you work? "))
    rate = float(input ("What is your rate of pay? "))
    return hours, rate

def find_hours(hours):
    """return regular and overtime hours"""
    if hours >= 40:
        reg_hours = 40
        ot_hours = hours - 40
    else:
        reg_hours = hours
        ot_hours = 0
    return reg_hours, ot_hours

def calc_pay(reg_hours, ot_hours, rate):
    """return regular pay and overtime pay"""
    reg_pay = reg_hours * rate
    if ot_hours > 0:
        ot_pay = ot_hours * 1.5 * rate
    else:
        ot_pay = 0
    return reg_pay, ot_pay
       

def main() :
    hours, rate = ask_hours()
    reg_hours, ot_hours = find_hours(hours)
    reg_pay, ot_pay = calc_pay(reg_hours, ot_hours, rate)
    print "Pay rate", rate
    print "Regular hours", reg_hours
    print "Overtime hours", ot_hours
    print "Regular pay", reg_pay
    print "Overtime Pay", ot_pay


main()

Using good variable names and documenting the functions will help you. Also please keep the indentations constant.

ZZucker 342 Practically a Master Poster

The U.S. Treasury shreds 7000 tons of used currency each year.

ZZucker 342 Practically a Master Poster

George Bush's official function in his fraternity at Yale was "Foosball Tournament Administrator".

ZZucker 342 Practically a Master Poster

If corn oil is made from corn, what is baby oil made from?

ZZucker 342 Practically a Master Poster

If Jimmy cracks corn and no one cares, why is there a song about him?

ZZucker 342 Practically a Master Poster

Why is "bra" singular and "panties" plural?

ZZucker 342 Practically a Master Poster

For any base other than 10 you best use strings. Also base 36 is about the highest you can go with letters from 0 - 9 and A - Z.

ZZucker 342 Practically a Master Poster

Plane #51 is sure sweet looking thing!

Jwentings plane #53 could propably fly with its exhaust pipe alone. Looks a lot like a Tucano.

ZZucker 342 Practically a Master Poster

Do you want answers?<heh,heh>

Sure sweety, give us some smart answers or smart questions.

I am usually full of questions:
"Why are you IN a movie, but you're ON TV?"

ZZucker 342 Practically a Master Poster

Since Lardmeister did such good job on Ron Paul, I came up with a nut shell for John McCain:
John McCain started as a naval aviator.
He was shot down, badly injured, and captured by the North Vietnamese in 1967.
He was released from prison in 1973.
He served in the U.S. House of Representatives representing Arizona.
He served in the U.S. Senate from 1986 to now as a senator from Arizona.
He was rebuked by the Senate Ethics Committee for poor judgment in the Keating affair.
He was named chairman of Veterans for George H. W. Bush the elder.
He lost the Republican nomination in 2000 to George W. Bush the younger.
He attacked pork barrel spending within Congress.
He proposing legislation to increase cigarette taxes.
He is a strong proponent of comprehensive immigration reform.
He supported the Bush tax cut extension.
He introduced the McCain Detainee Amendment against torture of prisoners.
He supports pro-life (anti-abortion), capital punishment, mandatory sentencing, private school vouchers, and welfare reform.

ZZucker 342 Practically a Master Poster

Any fool can paint a picture, but it takes a wise man to be able to sell it.

ZZucker 342 Practically a Master Poster

Is sex dirty? Only if it's done right.
-- Woody Allen

ZZucker 342 Practically a Master Poster

Webster's New World Dictionary has the chicken before the egg. So there you got it!

My question:
"How important does a person have to be before they are considered assassinated instead of just murdered?"

ZZucker 342 Practically a Master Poster

I still say it's the syntax.

ZZucker 342 Practically a Master Poster

Here is your chance to ask a 'smart' question in an attempt to have one of those real smart DaniWeb Geek members answer it. If the question just makes you think or smile, that is good enough too! Please no computer questions. :)

Okay, to start out:
Why does a round pizza come in a square box?

ZZucker 342 Practically a Master Poster

Saint Raymond of Barbastro is the patron saint of Star Trek fans!

ZZucker 342 Practically a Master Poster

It's tax time again, 133 million US taxpayers have to file their 2007 tax forms with the IRS. Form 1040 comes with 92 pages of instructions and takes taxpayers an average 33 hours of preparation to complete. You after year our lousy legislator promise to simplify this, and every time around it gets even more complex.

ZZucker 342 Practically a Master Poster

Do not use recursion as a loop, but use a while loop in the function itself. You also need to set a flag that the gold has been taken. Further note that a triple quoted string relaxes the indentation rule:

def prompt_house():
    global gold
    gold_taken = False
    while True:
        prompt_hou = raw_input('>')
        if prompt_hou == 'examine table' and not gold_taken:
            print \
'''There are a lot of car magazines here.
You flip through them and find 5 gold.
'''
            gold = gold+5
            gold_taken = True
        elif prompt_hou == 'go west':
            # this gets you out of the loop
            go_west()
        # more elif choices here ...
            

def go_west():
    # just a dummy funk
    global gold
    print gold
    pass

# test
gold = 0
prompt_house()
ZZucker 342 Practically a Master Poster

Java has been taught by college CS departments for many years. The typical inertia shown by CS staff makes certain that Java will be taught for many more years to come. There are hordes of Java programmers out there. Also Java, being more complex, ensures job security since development is slower and more programmers are needed to do the job.

Python, being easier and quicker to teach, would of course reduce the number of instructors too. Oh my!

Vested interest is hard to overcome! In the mean time, many students are wasting time with stuffy syntax.

ZZucker 342 Practically a Master Poster

I use Winpdb (recommended by our science prof) and like the way it follows variable values in real time as you step thrugh the code. You are right, using File/Launch to open a Python source file is not very intuitive.

It installs as a winpdb.py (also compiled optimized winpdb.pyo) in C:\Python25\Lib\site-packages on my Windows Vista computer. Also needs wxPython installed to run.

ZZucker 342 Practically a Master Poster

Better to lose a lover than love a loser

ZZucker 342 Practically a Master Poster

Leonardo de Vinci could write with one hand and draw with the other at the same time.

ZZucker 342 Practically a Master Poster

Smooth seas do not make for a skillful sailor.

ZZucker 342 Practically a Master Poster

no. an ms rip off of java is j# or j++ or whatever it was called (doesnt exist anymore)

I guess one could argue, the syntax looks a lot like Java. I think MS lost a court case on the originals. How about your vb.net code example?

ZZucker 342 Practically a Master Poster

I don't think pyqt can handle animated gifs. You could use wxPython's wx.animate.GIFAnimationCtrl widget.

ZZucker 342 Practically a Master Poster

So what is your traceback error message?

ZZucker 342 Practically a Master Poster

The way I understand it, C was developed to write the Unix operating system. C++ was a major improvement of C. Java was an improvement of C++ and C# was a MS ripoff of Java.

I started to read the book "How to teach yourself Java in ten years" :)
but I kept falling asleep.

I picked up Python that was used in my Biochemistry class in just about a day from the class handouts.

ZZucker 342 Practically a Master Poster

vb.net ftw

What would be your vb.net code to match this little Python example given here?

ZZucker 342 Practically a Master Poster

Thanks for the samples of C, C++, C# and Java they make Python code look alarmingly simple.

Paul, what C++ compiler are you using?
The open source g++ gives me lots of errors:

Compiler: Default compiler
Building Makefile: "C:\Dev-Cpp\AtestCON\NineOnes1\Makefile.win"
Executing make...
make.exe -f "C:\Dev-Cpp\testCON\NineOnes1\Makefile.win" all
g++.exe -c main.cpp -o main.o -I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include" -I"C:/Dev-Cpp/include/c++/3.4.2/backward" -I"C:/Dev-Cpp/include/c++/3.4.2/mingw32" -I"C:/Dev-Cpp/include/c++/3.4.2" -I"C:/Dev-Cpp/include"

main.cpp:1: error: expected namespace-name before ';' token

main.cpp:1: error: `<type error>' is not a namespace
main.cpp:3: error: `array' was not declared in this scope
main.cpp:3: error: `System' has not been declared
main.cpp:3: error: `String' was not declared in this scope

main.cpp:3: error: expected primary-expression before '>' token
main.cpp:3: error: expected primary-expression before '^' token
main.cpp:3: error: `args' was not declared in this scope
main.cpp:4: error: expected `,' or `;' before '{' token

make.exe: *** [main.o] Error 1

Execution terminated

Do you really think that this C++ code:

using namespace System;

int main(array<System::String ^> ^args)
{
	Int64 a = 111111111;
    Console::WriteLine( Int64(a * a) );
    return 0;
}

is easier to understand than Python:

a = 111111111
print a * a
ZZucker 342 Practically a Master Poster

Q: "How do you make a blondes' eyes light up?"
A: "Shine a flashlight in her ears."

ZZucker 342 Practically a Master Poster

The nations business is business after all.

ZZucker 342 Practically a Master Poster

Steamed rice with a little milk and brow sugar.

ZZucker 342 Practically a Master Poster

People want economy and they will pay any price to get it.
-- Lee Iacocca

ZZucker 342 Practically a Master Poster

It took Leonardo de Vinci almost twelve years to paint the Mona Lisa's lips.