SgtMe 46 Veteran Poster Featured Poster

1.) This is not the python forum...how are python specialists going to find this?
2.) Show effort
3.) We don't know enough about your question to answer.

SgtMe 46 Veteran Poster Featured Poster

633 (how have we ended up on an odd number?!)

SgtMe 46 Veteran Poster Featured Poster
print 'Input n'
n = int(raw_input())
data = []
i = 1
while i <= n:
	data.append(i)
	i+=2

print data
SgtMe 46 Veteran Poster Featured Poster

Probably the main thing would be the large picture in the background and the music player. I would get rid of the music player altogether on this page, as its just a log-in page. Maybe have a smaller image and a dark-ish coloured pattern for the background...maybe something using black and grey?

SgtMe 46 Veteran Poster Featured Poster

I would agree that W3 have a great CSS tutorial. It helped me out when I was creating CSS styles for Windows 7 Sidebar gadgets. Not sure about their HTML tutorial but they seem like a pretty good site.

SgtMe 46 Veteran Poster Featured Poster

Not sure about the constructor thing. Basically, it's just a function that is called when you create an instance of the class. It doesn't really matter much deeper than that. Just use it to initialize all your variables/do other stuff that needs to be done when you create the class instance.
Can you please upvote my above post seeing as it helped you out :) Thanks.

SgtMe 46 Veteran Poster Featured Poster

Furthermore, Piriform make a variety of free programs for windows.
CCleaner cleans out most un-needed things from your PC, and is generally useful.
Defraggler is a defragmenting program, which can work on entire drives or single files.

http://www.piriform.com/ccleaner
http://www.piriform.com/defraggler

SgtMe 46 Veteran Poster Featured Poster

^ Hasn't seen anything up your skirt
< Listening to marilyn manson
V Is increasingly disturbed by the previous posts on this page of the thread.

SgtMe 46 Veteran Poster Featured Poster

The bartender becomes increasingly worried about the current state of the duck and cautiously asks the duck to calm down.

SgtMe 46 Veteran Poster Featured Poster

With the code you have there (which you need to put in code tags next time :) ), is a good example of classes.

class Critter(object):
	def __init__(self):    					#you were missing a close bracket
		print "A new critter is born!"
	def talk(self):
		print "\nHi. I am an instance of class critter."       		#you were missing close quotes

#global scope!!!
crit1 = Critter()
crit2 = Critter()
crit1.talk()      							#"crit" was written incorrectly
crit2.talk()

Basically, the first line of code declares a class named "Critter". The second line is the __init__ function. This is called when you initialize an instance of the class, which will come up in a minute. The next line will just print that sentence to the console. As this is in the __init__ function, it will be printed when you initialize an instance of the class.

The "talk" function is basically a function that you can call that is associated with the class, that can be used with every instance of the class. This will again simply print a sentence to the console.

Now onto the main parts. Obviously, these are in the global scope, not in a main function. The first line in that section creates an instance of the "Critter" class, which is the value of the variable "crit1". This is pretty much the same as the next line. The next line calls the talk function from the instance of "Critter" assigned to the variable "crit1". The last line is pretty much the same, but …

SgtMe 46 Veteran Poster Featured Poster

I guess your not handling objects as such, but for doing accounts and database style things, I guess a struct would be slightly simpler than a class. Just my opinion though :)

SgtMe 46 Veteran Poster Featured Poster

a large statue of a

SgtMe 46 Veteran Poster Featured Poster

You have many errors. Firstly, click the code tags button instead of typing them in (you need a back slash on the close code) You are missing a semi-colon [;] on line 4. Next, you have not included fstream. Also, you need to change the line you say "is giving error". You cannot simply write backwards and forwards. Check out this link:
http://www.cplusplus.com/doc/tutorial/files/
Also, you need to add

using namespace std;

under your includes, as you need to tell the compiler that you are using the standard reference for string.

SgtMe 46 Veteran Poster Featured Poster

I think what you need is structs.
Here is an example:

//usual intro stuff
#include <cstdlib>
#include <iostream>
using namespace std;

//create a struct for our account type
struct account{
        //this is where initialize the data variables for an account
        //acount number
	int number;
	//balance
	float amount;
	} ;

//usual main
int main(){
        //create an array of type "account"
        //size 20, for example
	account acc_list[20];
	//set the number and amount value for the first account
	//remember that account one is at position 0 in the array
	acc_list[0].number = 123456;
	acc_list[0].amount = 312.48;

        //repeat for the second acount (position 1 in the array)
	acc_list[1].number = 98765;
	acc_list[1].amount = 234.22;
	
	//print out to test
	//i only used the dollar sign because the pound sign won't
	//show properly...grrrrrrrr...
	cout<<"Account 1:           $"<<acc_list[0].amount<<endl;
	cout<<"Account 2:           $"<<acc_list[1].amount<<endl;
	
	//pause so we can see the result
	//only for windows/DOS
	system("pause");
	}

And here's a link to a tut an better explanation:
http://www.cplusplus.com/doc/tutorial/structures/

Please upvote/solved if this helped/solved your problem :)

SgtMe 46 Veteran Poster Featured Poster

wind that had

SgtMe 46 Veteran Poster Featured Poster

light -> fire

SgtMe 46 Veteran Poster Featured Poster

because it was infact a

SgtMe 46 Veteran Poster Featured Poster

birthday -> Candles
<anything can happen in a dream...it was a big pigeon :|>

SgtMe 46 Veteran Poster Featured Poster

the greatest structure of all

SgtMe 46 Veteran Poster Featured Poster

a black hole

SgtMe 46 Veteran Poster Featured Poster

I couldn't think of another question that wasn't too stupid :L
Should we have our own forum for these seeing as no-one else posts on them?

PS. I'm going 2 bed :P

SgtMe 46 Veteran Poster Featured Poster

<dream involving pigeon being the grim reaper and taking over the world>
Corn -> Hot dog

SgtMe 46 Veteran Poster Featured Poster

a small fox which began

SgtMe 46 Veteran Poster Featured Poster

a mystical land

SgtMe 46 Veteran Poster Featured Poster

The top line will confuse python. You should have (I think, from seeing another dictionary related post :/):

z = {'a':[1, 2, 3], 'b': 4, 'c': 5)

Not sure as I have barely used dictionaries, but I believe that one of the problems lies in line 4. You want it to tell you that 'a' is associated with 3. Are you sure it works both ways? Isn't it "3 is associated with 'a' ('a' being the 'parent')"? Is it reversable?

Also, KeyError '2', means that you are trying to search for the instance of '2' in the dictionary, which does not exist. It looks as though this lies within a module, but, taking your code as an example, though it is associated with 'a', it is not a dictionary object in itself.

SgtMe 46 Veteran Poster Featured Poster

revenge upon the

SgtMe 46 Veteran Poster Featured Poster

the ground in the park

SgtMe 46 Veteran Poster Featured Poster

Soul Stealer -> Pigeon (don't ask why)

SgtMe 46 Veteran Poster Featured Poster

No I haven't, and though I like heavy metal, I preserve my eardrums also :)
Do you have one especially best friend?

SgtMe 46 Veteran Poster Featured Poster

potato of the north.

SgtMe 46 Veteran Poster Featured Poster

the grim reaper

SgtMe 46 Veteran Poster Featured Poster

Die -> Grim Reaper

SgtMe 46 Veteran Poster Featured Poster

I like to read sometimes in the evenings.
HOW CAN LISTENING TO MUSIC SUCK?!

SgtMe 46 Veteran Poster Featured Poster

Penne pasta in tomato sauce with bacon chunks + salad
Om nom nom nom nom nom etc. etc.

SgtMe 46 Veteran Poster Featured Poster

Penne pasta in tomato sauce with bacon chunks + salad
Om nom nom nom nom nom etc. etc.

SgtMe 46 Veteran Poster Featured Poster

Please use code tags. Could you post the errors your are getting, and edit your first post using code tags. Then we can work through the errors. Once the program works, we can determine whether the logic is correct.

SgtMe 46 Veteran Poster Featured Poster

READ THE RULES!!! NO HELP UNLESS YOU SHOW EFFORt!!!
Besides which, we can't help you anyway, as we don't know your question specification, or what code you have already got, which we would need.

Nandomo commented: :) +1
VernonDozier commented: Yup! +11
tundra010 commented: Well said. +2
SgtMe 46 Veteran Poster Featured Poster

things from the

SgtMe 46 Veteran Poster Featured Poster

I was just taking a look at compacting your code slightly, and I noticed something.

self.n = len(datalist)
data = datalist
length = len(datalist)
...
n = float(self.n)


Therefore

n = length

And then: ...(length/n)
This would be 1.


You can also change the function 'cdf_data' (including the above thing for the moment), to:

def cdf_data(self):   
	data = self.datalist
	plotdata =[]
        
	for i in range(len(data)):
		#got rid of: "n = float(self.n)"
		length = len(data)
		plotdata.append((data[0],length/float(self.n)))            #this line
		data.pop(0)
       
        return plotdata
SgtMe 46 Veteran Poster Featured Poster

Futhermore, why does findNode return none, and why do you need an if statement there to check whether it will return either nothing, or nothing? Therefore, findNode and actorNode will always be none, so your 'ifs' at lines 28 and 31 will always be none.

SgtMe 46 Veteran Poster Featured Poster

which shattered the glass

SgtMe 46 Veteran Poster Featured Poster

I like to drive. I may be fourteen, but I have driven a Mercedes A-Class on a test course and a Mercedes 4x4 on a specialised off-road course. 'Twas very enjoyable.

Do you listen to music alot?

SgtMe 46 Veteran Poster Featured Poster

Emergency Room -> Heart Attack

SgtMe 46 Veteran Poster Featured Poster

"My Dark Place Alone" - Murderdolls

SgtMe 46 Veteran Poster Featured Poster

green -> grass

SgtMe 46 Veteran Poster Featured Poster

which was hospitalised by

SgtMe 46 Veteran Poster Featured Poster

I believe that absolute position is the actual position of an object, whereas relative would mean the position relative to another object.

SgtMe 46 Veteran Poster Featured Poster

Well from having a look, it seems that you haven't defined x and y in all of your functions. I just had a quick look at the last one. You mention both 'x' and 'y', but neither have been declared in the function. You need to be able to pass 'x' and 'y' into other functions. You could do this with global variables (although they are discourage), or you could fit the whole thing in a class.

Global Variables
Classes (2.7 spec)

SgtMe 46 Veteran Poster Featured Poster

What line is the error on?

SgtMe 46 Veteran Poster Featured Poster

Hi all.

There have been several threads where people are asking, "is there any way we can develop iPhone Apps on Windows, or without using Objective-C?" The main reason people ask this is because they either cannot afford a Mac, or cannot afford all the additional costs one has to suffer as a result of using the iPhone SDK.

Several times, I have mentioned a little library called DragonFire SDK. It's a simple little tool, and, though it doesn't give you all the functionality of the iPhone SDK, it uses C/C++ and fits right in with VC/VC++ Express.

You may ask, "is this legal?". Why yes, it is perfectly legal. You simply write your C++ code and test it with the built in iPhone emulator and send the code of to Zimusoft, who made DragonFire SDK. The code is then fiddled with, until it can be compiled on a Mac machine which uses the full iPhone SDK.

The functionality available is easily enough to produce nice 2D applications, with the list of available functions being updated all the time. Worried about getting stuck with the code? There is a full API reference and forum where you can get help with your problems.

Thought there is currently no iPad support, I do believe that this will be implemented in the future, as this is simply too big a market for Zimusoft to miss out on.

And what's the price of this fantastic offer? Very little. …