Search found 87 matches

by Jof16's
Sun Nov 18, 2012 9:33 pm UTC
Forum: The Help Desk
Topic: More help with Matlab
Replies: 1
Views: 737

Re: More help with Matlab

Also, is there anything similar to the "Find()" function in MathCAD? Just curious. It's not necessary as I can program it in myself. EDIT: Also, I need to be able to get a result within a certain error. I would use ([result - actual value]/actual value)*100, except that the actual value co...
by Jof16's
Sun Nov 18, 2012 9:11 pm UTC
Forum: The Help Desk
Topic: More help with Matlab
Replies: 1
Views: 737

More help with Matlab

Yep. I once again need some help. Though it's very simple (I hope) this time. Is there any way to use units in Matlab? I want to be able to specify units like I can in MathCAD and have it tell me the output units. It doesn't matter if this is done separately from the program, so long as any conversi...
by Jof16's
Sun Nov 18, 2012 9:06 pm UTC
Forum: Mathematics
Topic: Help solving an equation symolically
Replies: 3
Views: 1624

Re: Help solving an equation symolically

Thanks for the help guys. We did end up having to solve it by hand and put the formula in, though.
by Jof16's
Sun Nov 04, 2012 11:12 pm UTC
Forum: Mathematics
Topic: Help solving an equation symolically
Replies: 3
Views: 1624

Help solving an equation symolically

I have an equation that has 2 unknowns. I want to solve for one unknown in terms of the other and have the answer in symbolic form. I have access to Mathcad 15 and Matlab R2010a, but I'm not sure if either of these are even capable of it. Example: z = (x-y)/(0.1 + (ln(a/b)/2*pi*l*k) + 1/h*2*pi*a*l) ...
by Jof16's
Wed Oct 31, 2012 1:55 am UTC
Forum: The Help Desk
Topic: Help with Matlab
Replies: 2
Views: 2853

Re: Help with Matlab

...
*facepalm*

Thank you. That's the only problem I've got. It works now.
by Jof16's
Tue Oct 30, 2012 10:58 pm UTC
Forum: The Help Desk
Topic: Help with Matlab
Replies: 2
Views: 2853

Help with Matlab

It might be because I haven't had any sleep last night, but I can't figure out why I'm getting the follow error in Matlab: ??? Undefined function or method 'arccos' for input arguments of type 'double'. Error in ==> *file* at *line* i = arccos(h(3)/h1); Can someone check please? Here's the code: clc...
by Jof16's
Sun Mar 04, 2012 6:44 pm UTC
Forum: The Help Desk
Topic: [Problem Solved] Can't remove a file from archive
Replies: 2
Views: 835

Re: Can't remove a file from archive

I don't think so but I'll check anyway.

EDIT: FFFFFFFUUUUUUUUUUUU...

It is.

Thank you.
by Jof16's
Sun Mar 04, 2012 3:31 pm UTC
Forum: The Help Desk
Topic: [Problem Solved] Can't remove a file from archive
Replies: 2
Views: 835

[Problem Solved] Can't remove a file from archive

I'm trying to root my Samsung SCH-i500 phone and downloaded a zip package that should have everything I need. However, I can't remove one of the files needed. I can see it when I use 7zip to view the archive, but when I try to remove it, the file disappears after a few seconds out of the zip archive...
by Jof16's
Fri Jan 06, 2012 4:08 am UTC
Forum: Fit Club
Topic: Run 10,000 miles
Replies: 1340
Views: 304964

Re: Run 10,000 miles

4382.8 + 2 = 4384.8

I'm so out of shape that those 2 miles aren't consecutive. It took me 30 damn minutes to get that much (I'm only counting the miles I actually ran and not the ones walked/jogged).
by Jof16's
Wed Dec 07, 2011 10:21 pm UTC
Forum: Coding
Topic: The "IT DOESN'T WORK!" thread
Replies: 1958
Views: 545682

Re: The "IT DOESN'T WORK!" thread

I'm using ' from Game_config import * '

Okay. I'll go try that.

Thank you.


EDIT: Yay! It works!
Thank y'all for the help.
Also, if you would please check out my thread. I've still got some problems that need solving. Thanks in advance. :)
by Jof16's
Wed Dec 07, 2011 10:12 pm UTC
Forum: Coding
Topic: The "IT DOESN'T WORK!" thread
Replies: 1958
Views: 545682

Re: The "IT DOESN'T WORK!" thread

Here's some of the code: def buttonSword(): global weaponDamage global weaponAmmo weaponDamage = 5 text.insert(END, "You have chosen a sword.\n") text.insert(END, "It can do up to " + str(weaponDamage) + " points of damage.\n") text.insert(END, "To change your weap...
by Jof16's
Wed Dec 07, 2011 9:53 pm UTC
Forum: Coding
Topic: The "IT DOESN'T WORK!" thread
Replies: 1958
Views: 545682

Re: The "IT DOESN'T WORK!" thread

Right now, I'm using the ' from x import * ' method. I am using 'global v' inside the function, but it isn't changing the variable.
and yes, you can read the variables without the global declaration (is that the right word?)

Yes, it does.
by Jof16's
Wed Dec 07, 2011 9:32 pm UTC
Forum: Coding
Topic: The "IT DOESN'T WORK!" thread
Replies: 1958
Views: 545682

Re: The "IT DOESN'T WORK!" thread

Python doesn't have true global variables, only module-level variables. "Globals" defined in one module aren't visible in another. If module m defines a "global" v (just with something like v=10 outside of a function), then other modules that import m can refer to it via m.v , b...
by Jof16's
Sun Dec 04, 2011 5:58 am UTC
Forum: Coding
Topic: The "IT DOESN'T WORK!" thread
Replies: 1958
Views: 545682

Re: The "IT DOESN'T WORK!" thread

But the GUI doesn't start until the mainloop() is run. So shouldn't all the global variables already be defined? I only get the error when I press the fight button. Still, that link looks like the better idea. It would make it easier to keep up with the global variables that way. Thanks for the link...
by Jof16's
Sun Dec 04, 2011 2:32 am UTC
Forum: Coding
Topic: The "IT DOESN'T WORK!" thread
Replies: 1958
Views: 545682

Re: The "IT DOESN'T WORK!" thread

I think I understand what you're saying now. I'm rewriting the code now. One more problem. If I define the global variables in the main file before I import the module, shouldn't those global variables be available to use in the module? Because I keep getting a 'global name 'playerHealth' is not def...
by Jof16's
Sat Dec 03, 2011 9:33 pm UTC
Forum: Coding
Topic: The "IT DOESN'T WORK!" thread
Replies: 1958
Views: 545682

Re: The "IT DOESN'T WORK!" thread

Either I'm not understanding or I'm not making myself clear (probably the former). Here's the code for the fight function: while playerHealth and zombieHealth > 0: playerRoll = randint(1,6) zombieRoll = randint(1,6) if weaponAmmo > 0: if playerRoll >= 4: if weaponDamage >= 6: zDamage...
by Jof16's
Sat Dec 03, 2011 7:29 pm UTC
Forum: Coding
Topic: The "IT DOESN'T WORK!" thread
Replies: 1958
Views: 545682

Re: The "IT DOESN'T WORK!" thread

You're right. I need to find a way to slow down the code instead of pausing it. root.after() is close to what I need, but I don't need the rest of the code to run until after the delayed code has run. I was thinking of defining an event (either a keyboard event or a button click) that will change a ...
by Jof16's
Sat Dec 03, 2011 5:40 pm UTC
Forum: Coding
Topic: The "IT DOESN'T WORK!" thread
Replies: 1958
Views: 545682

Re: The "IT DOESN'T WORK!" thread

... Do you mean something like (JS here, because I dunno how tkinter works): function foo() { bar(); settimeout(foo, 5000); baz(); // error from this line } If so, then yes, the rest of the code keeps running after your timeout. Setting a timeout just schedules some later code; it doesn't interfere...
by Jof16's
Sat Dec 03, 2011 12:22 am UTC
Forum: Coding
Topic: The "IT DOESN'T WORK!" thread
Replies: 1958
Views: 545682

Re: The "IT DOESN'T WORK!" thread

You need to do what was described before - refactor your code to use callbacks with delays. Evented programming ends up looking kinda like recursive programming in these circumstances. Instead of a loop, you just check the condition with an if(), do your work, and set yourself as a callback again a...
by Jof16's
Fri Dec 02, 2011 2:01 pm UTC
Forum: Coding
Topic: The "IT DOESN'T WORK!" thread
Replies: 1958
Views: 545682

Re: The "IT DOESN'T WORK!" thread

Also, since when does Windows have an X button in the upper left? :P *Slaps himself* Upper right. I'm stupid. Also, Evan, I kinda understand what you're saying. It only throws up a "this program isn't responding" when I try to click on the close button. The first few times I tried the tim...
by Jof16's
Fri Dec 02, 2011 1:40 pm UTC
Forum: Coding
Topic: The "IT DOESN'T WORK!" thread
Replies: 1958
Views: 545682

Re: The "IT DOESN'T WORK!" thread

The "yield" statement is completely unrelated with what you're trying to do... it's a way of progressively generating a list of numbers, returning them one at a time. Nothing to do with sleeping. I actually found the yield from an example code and it was used to pause the program for a sh...
by Jof16's
Fri Dec 02, 2011 3:54 am UTC
Forum: Coding
Topic: The "IT DOESN'T WORK!" thread
Replies: 1958
Views: 545682

Re: The "IT DOESN'T WORK!" thread

Here's one I haven't yet figured out. In Python, using 'time.sleep()' pauses the program for a certain period of time. But when using GUI (created using Tkinter), it freezes the entire GUI until the code finishes running. Even if you put time.sleep() inside of the function called by a button press, ...
by Jof16's
Fri Dec 02, 2011 2:44 am UTC
Forum: Coding
Topic: Need help with a Python program I'm writing
Replies: 12
Views: 2121

Re: Need help with a Python program I'm writing

Okay, I tried it. It doesn't work. I think my syntax might not be quite correct. Here's the code: def weaponSGCheck(shotgunButton, event): event.weaponButton.state = 'DISABLED' shotgunButton.state = 'ACTIVE' shotgunButton = Button(app, text="Shotgun", state = buttonStateSG(), width = 10, h...
by Jof16's
Thu Dec 01, 2011 11:31 pm UTC
Forum: Coding
Topic: Need help with a Python program I'm writing
Replies: 12
Views: 2121

Re: Need help with a Python program I'm writing

from functools import partial def callback_func(button_to_enable, event): event.widget.state='disabled' button_to_enable.state='active' button1 = Button(<whatever>) button2 = Button(<whatever>) button1.callback = partial(callback_func, button2) button2.callback = partial(callback_func, button1) Wha...
by Jof16's
Thu Dec 01, 2011 6:34 pm UTC
Forum: Coding
Topic: Need help with a Python program I'm writing
Replies: 12
Views: 2121

Re: Need help with a Python program I'm writing

The basis for any GUI is its event loop . This loop typically runs the entire duration of the program. Your program beings when you call the mainloop() method (in Tkinter) and ends when you call the quit() method. The loop responds to events in your program, which are usually user actions, but coul...
by Jof16's
Thu Dec 01, 2011 4:47 pm UTC
Forum: Coding
Topic: Need help with a Python program I'm writing
Replies: 12
Views: 2121

Re: Need help with a Python program I'm writing

Nevermind, I've figured out a slightly different way to do it. I'm going to create two buttons and set their state to disabled unless those conditions are met. However, I need a little help. How do I get state to call a function? I've tried putting the name of the function in 'state = *function_name...
by Jof16's
Thu Nov 24, 2011 1:05 am UTC
Forum: Coding
Topic: Need help with a Python program I'm writing
Replies: 12
Views: 2121

Re: Need help with a Python program I'm writing

I've already tried if/else statements (although not in that particular way). Would I change the command of the button to a function and pass the damage variable into that function? Like this: def commandButton(): global damage if damage == 10: commandButton.text = "Attack" elif damage == 0...
by Jof16's
Thu Nov 24, 2011 12:10 am UTC
Forum: Coding
Topic: Need help with a Python program I'm writing
Replies: 12
Views: 2121

Re: Need help with a Python program I'm writing

How would I bind the buttons command and text to a variable in the program that changes depending on the what button the user presses? For example, if I had a variable name "damage" in the program and I wanted the button to display "attack" when damage == 10 and "defend"...
by Jof16's
Wed Nov 23, 2011 4:18 am UTC
Forum: Coding
Topic: Need help with a Python program I'm writing
Replies: 12
Views: 2121

Need help with a Python program I'm writing

I wrote a program in Python that creates a simple GUI using tkinter. But I'm having a slight problem.

I need one of my buttons to change the text and command under certain conditions. If/else statements didn't work.
Is this possible? If so, how?
by Jof16's
Mon Sep 05, 2011 2:37 pm UTC
Forum: Coding
Topic: Help writing a Python program (Python 3.2 for Windows)
Replies: 21
Views: 3496

Re: Help writing a Python program (Python 3.2 for Windows)

I'm going to make a new post to bump this thread and ask a new question. How do I get the code to restart? I'm writing a validation loop for the entire code. I need to be able to go back to the beginning of the code if a certain set of conditions is not met. Is there any way to do this without using...
by Jof16's
Sun Sep 04, 2011 8:14 pm UTC
Forum: Coding
Topic: Help writing a Python program (Python 3.2 for Windows)
Replies: 21
Views: 3496

Re: Help writing a Python program (Python 3.2 for Windows)

That's fine.

Thank you for the help. :D
by Jof16's
Sun Sep 04, 2011 8:01 pm UTC
Forum: Coding
Topic: Help writing a Python program (Python 3.2 for Windows)
Replies: 21
Views: 3496

Re: Help writing a Python program (Python 3.2 for Windows)

raw_input() doesn't work. It keeps saying "name 'raw_input' is not defined".

However, putting the quotes around Y in the if statement did.
by Jof16's
Sun Sep 04, 2011 7:13 pm UTC
Forum: Coding
Topic: Help writing a Python program (Python 3.2 for Windows)
Replies: 21
Views: 3496

Re: Help writing a Python program (Python 3.2 for Windows)

Decide what you will except as a 'yes' (yes, y, YeS, ... (probably good to ignore case, therefore YeS = yes)) and just look for that in the user's input, everything else is treated as no. I want them to just have to enter a capital Y or capital N. user = input("Do you wish to see your average?...
by Jof16's
Sun Sep 04, 2011 6:51 pm UTC
Forum: Coding
Topic: Help writing a Python program (Python 3.2 for Windows)
Replies: 21
Views: 3496

Re: Help writing a Python program (Python 3.2 for Windows)

Thank you! (And thanks for the link)
It works now.


But what about my second question?
by Jof16's
Sun Sep 04, 2011 5:52 pm UTC
Forum: Coding
Topic: Help writing a Python program (Python 3.2 for Windows)
Replies: 21
Views: 3496

Help writing a Python program (Python 3.2 for Windows)

I'm writing a program in Python that will calculate the users class average for a single class. Right now, it just uses the Python shell to ask for the users input because I haven't yet learned GUI's. When I'm done, it'll ask the user to input the number of tests/quizzes/hw problems for the year and...
by Jof16's
Fri Aug 12, 2011 8:42 pm UTC
Forum: The Help Desk
Topic: Need help deciding on a tablet pc
Replies: 10
Views: 2331

Re: Need help deciding on a tablet pc

The HP TouchPad does not run Windows XP. It runs WebOS. Oh. This is the next one: http://www.newegg.com/Product/Product.aspx?Item=N82E16834246157 I've heard good things about Lenovo products, but the "Re-certified" worries me to no end. I have one of those, and it's pretty great. 3 or 4 y...
by Jof16's
Fri Aug 12, 2011 12:44 am UTC
Forum: The Help Desk
Topic: Need help deciding on a tablet pc
Replies: 10
Views: 2331

Re: Need help deciding on a tablet pc

Actually, I don't care about super nice features. As long as it runs reliably, it doesn't matter. The reason the HP isn't higher is because it runs Win XP Tablet PC edition. I'm not sure if Microsoft Office 2010 is compatible with it and I'd like to be able to use Microsoft OneNote 2010 for the note...
by Jof16's
Thu Aug 11, 2011 10:39 pm UTC
Forum: The Help Desk
Topic: Need help deciding on a tablet pc
Replies: 10
Views: 2331

Need help deciding on a tablet pc

I'm currently trying to decide between 5 different tablet pc's for school. I'll just be using it for light stuff like note-taking in class and internet browsing. I would like any opinions or reviews of the products if you can give them. The one I'm currently leaning towards is this: http://www.neweg...
by Jof16's
Mon Aug 08, 2011 9:57 pm UTC
Forum: Coding
Topic: More resources for learning Python
Replies: 5
Views: 1356

Re: More resources for learning Python

Forgot to mention, it's Python 3.2 for Windows.
by Jof16's
Mon Aug 08, 2011 9:48 pm UTC
Forum: Coding
Topic: More resources for learning Python
Replies: 5
Views: 1356

More resources for learning Python

So, I start back at uni in 8 days. I'm taking a programming class and to prepare, I've been reading the book and doing all of the projects it lists. However, I hit a snag at chapter 3. The projects require me to create a twitter account and send messages to another account. I've decided not to conti...

Go to advanced search