predator78 22 Junior Poster

Do what rick from rce said before you try anything else. If it's bad ram you will be beating your head agaist the wall with everything else believe me.

predator78 22 Junior Poster

24 possible I lied on a few or wasn't completely honest. I also have an inflated ego so I take alot of pride in creeping up close to physchoticism. Although I don't wanna get caught either so I may attempt to change my story or manipulate anyone sexually or otherwise that tries to punish me for the crime of being a little unstable.

predator78 22 Junior Poster

I was thinking more along the lines of the module usage maybe something like this.

self.playerbmp.playerbitmap = wx.StaticBitmap(self.panel, -1, self.playerbmp, ((positionx,positiony), (width,height)))

Note: The extra brackets around (posx,posy),(width,height)

predator78 22 Junior Poster

I see what your sayin lol. But no that wasn't the case :). Maybe I have a diffrent model not sure about that. I guess it's possible the software was overclocking by default not sure.

predator78 22 Junior Poster

Thank you very much I'm learning very fast why c++ guru's are so precise about every minor detail.

predator78 22 Junior Poster
from random import *
rlist = []
for num in range(1,100):
    rlist.append(randrange(1,1000))

for item in rlist:
    print item
predator78 22 Junior Poster

Check line 36 closely, I don't have wx so I can't really check it further atm.

predator78 22 Junior Poster

Need some help here it seems to compile fine but crashes at runtime. Am I missing something here?

#include <iostream>
#include <string>
using namespace std;

// player class
class Player{
	int *position;
public:
	Player();
	Player(int);
	~Player();
	void print_pos(){
		cout << "player 1 is in position: " << *position << endl;
	}
};

Player::Player(){ // main constructor
	position = new int;
	*position = 0;
}
Player::Player(int pos){  //overloaded constructor
	*position = pos;
}
Player::~Player(){ // destructor
	delete position;
}


int main()
{
	Player one;
	Player two(1);
	one.print_pos();
	two.print_pos();
	return 0;
}
predator78 22 Junior Poster

Actually I wasn't overclocking it's simply an error generated by installing the software. I don't need it just posting that incase anyone has a similar problem.

predator78 22 Junior Poster

Think about the words though. Did you change the tuple? Or did you change the item at index of?

predator78 22 Junior Poster

actually, if he gets to the 'starting windows screen' after the installation, it should boot into safe mode

That's probably the best peice of advice thus far in this thread, to take it just a step further it pretty much throws out the possibility the dvd isn't beind read unless I missed something. How did you get to the windows login if you didn't install from the dvd in the first place?

predator78 22 Junior Poster

Hello all I recently bought a new computer and quite a dandy for the price. I havn't really pushed it hard yet but I'm sure I'll get a chance at some point. Anyway it came with some 3rd party software for overclocking the graphics card, after about a month of frustrations and tweaking I finally uninstalled AMD OverDrive and been goin on a week with no more issues. I havn't researched into it real deep but it could be a bad cd they sent out, although I did also download the drivers and attempt to install them again with the same results. So basically if anybody is having freeze issues and running this software it's definatly worth an uninstall to see if that's where the problem is stemming from then work it out from there if you really wanna run the software. Here's some of my specifications incase it helps anybody with a simialar issue.

Processor: AMD Phenom(tm) II X6 1055T Processor 2.89 GHz
System type: 64-bit Operating System
Graphics: ATI Radeon HD 5700 Series

predator78 22 Junior Poster

I need to locate software

No offence but that sums up what most *nix fans seem to say quite often.

predator78 22 Junior Poster

I see some nice keywords in the question....

I need to make an interactive program in Python that will start by asking the user to enter a list of numbers and then it will display the following menu.

1-Find The Maximum -- seem like some functions
2-Find The Minimum
3-Find The Average
4-Exit
Please Enter Your selection

Your program will accept a number from the user and perform the task corresponding to that number. After performing the required task, the program will continue to ask to perform other tasks and display the menu. This program will end only when the user enters 4.

predator78 22 Junior Poster

Try putting it in the path manually?

predator78 22 Junior Poster

Oh ok that's what I kinda thought of when I thought of stream, but when I thought of memory that's why array seemed locial to. Thanks alot for clearin it up Narue.

predator78 22 Junior Poster

I'm not sure I see the connection. Can you elaborate?

I guess what I was gettin at here was if sstream creates an object of a string in memory which would most likely be an array then would I be correct to think of it as...

"s" "t" "r" "i" "n" "g"
0 1 2 3 4 5

Or something similar to that.

predator78 22 Junior Poster

Well I been studying like a rabid dog foaming at the mouth since I have a higher level language under my belt and my initial failiure at c++ as a first language. Anyway getting near the end of my first little tutorial and have a few more questions.

1. I have hear many opinions that C is not necessary or even prefered if you are going the route of C++. That being said I've been starting to become curious about strings and it seems that some C knowledge may be needed or prefered when it comes to strings. Would this be correct to assume?

2. Another question about strings... I have used sstream in a few small programs in the tutorial and researched it a bit. From what I'm gathering it is a class that creates an object of type string? But it is also refered to as a stream buffer which in my mind tells me it is somewhat of an array stored in memory which makes sence in a way. So before I start rambling in to many circles on this one. Do I need to concern myself with how sstream works inwardly or can I just learn it's funcionality and forget it? I would in either case be interested to know if it basically just allows you to create an array in memory and preform special funcions on that array.

Thanks so much and hopefully most of my future posts in this forum will …

predator78 22 Junior Poster

Yeah not sure how I missed that I didn't type it out I just cliked the reply thing, but ah well.

predator78 22 Junior Poster

I modified this one a bit from a post I made a few days ago so you will need to clean it up but it does what you want.

from random import randrange


def initialize():
    """ create a list of random numbers and sort them and print them out"""
    #creates the list
    tmp = []
    mylist = []
    for num in range(0,15):
        mylist.append(randrange(1,1000))

    #keep sending the list to the sorter always returning the
    #highest number back until initial list is empty
    while mylist != []:
        highest = sorter(mylist)
        tmp.append(highest)
        mylist.remove(highest)
    #print to screen
    #print "high to low\n" , tmp
    print "high", tmp[0]
    tmp.reverse()
    #print "low to high\n" , tmp
    print "low", tmp[0]
    length = len(tmp)
    average = 0
    for item in tmp:
        average += item
    average = average / length
    print "average", average


def sorter(mylist):
    """ find the highest number and return it"""
    highest = 0
    for item in mylist:
        if item > highest:
            highest = item
    return highest

initialize()
predator78 22 Junior Poster

You didn't ask a question, all you did was post the assignment.

predator78 22 Junior Poster

Hi and welcome to my favorite place on earth for the most part. What they are saying is true people are great here and will help you to become great if you want. On the other hand it's not a group of babysitters. The great part about your assignment is it is the english translation of what you already need to do, which is how you should start all your programs. So step one is complete. Now you need to start traslating it to python.

1.write a function - Do I know how to write a function? If not google is my friend.
If I do I know it looks like this.

def function_name(arguments_if_any):
    #statements or in other words things the funtion will do
    #hmmmmmm function should prompt user for how many numbers
    #should be processed when i learned about basic input output
    #and variables I know this should work out ok.
    howmany = input("How many numbers: ") #get user input and store in variable
    print howmany #print works good to see what they entered
    #now i need to ask the user for that many numbers... but how?
    #oh yeah loops work good for that.
    while howmany > 0: #my while loop will loop until it reaches 0
        howmany -= 1
        print howmany #for testing purposes
        
        #now i need to ask for input again and compute the average of
        #the numbers the user enters. then move on to question 2

function_name(None) #test and run my function no …
sneekula commented: nice hints +12
predator78 22 Junior Poster

Kinda funny the poll is 50/50 when I took it cause I think that's how it is. I voted bad bacause I think it's true that bad seems to be quite natural at a young age. But I think for the most part once we are taught to be good we realize it is rewarding and want to be good. I certainly don't like rippin people off cause I believe in karma and have seen it to many times. My step-dad was the type to steal from others, funny part is he was always bitching about gettin ripped off go figure.

predator78 22 Junior Poster

I'm still just a dabbler, I dabble alot lmfao.

3d modleing and animation - Blender
Game engine - pygame,wannamakemyownplayinwithithereandthere.exe
Image Editing - GIMP cause im a gimp and not much of an artist sadly
IDE - python--Idle c++--vs2008

predator78 22 Junior Poster

The entire Matrix set. Great concept pushed the limits of the standards at the time.

X-MEN series, SpiderMan series, IronMan series. Suprizingly great compared to what my expecations would have been.

Arnold best all time action hero has yet to be matched.

Tommy Lee Jones was a nutcase and freakin great in "Under Seige".

predator78 22 Junior Poster

"Even if they find DNA similarities between Earth and Mars it doesn't mean a damn thing because the same DNA similarities could exist between all planets everywhere in the universe."

Sure it is possible but not likely.


You might wanna rethink that one. You kinda contradicted yourself a bit. You say it is possible but not likely. Now calculate the amount of times the similar type of circumstances may occur. It's possible and likely.

predator78 22 Junior Poster

This question is completely determined on the way the individual would define alien. Otherwise it's quite honestly just silly to even ponder. If the definition of aleins is did we come the same raw materials that are floating around just about everywhere else in the universe that may have more than possibly sparked life elsewhere as well. Or even that the materials that have made us may have been part of life in the past. The answer is 100% yes. It's probably one of the few questions science will ever have to doubt in the least.

predator78 22 Junior Poster

I'd rather there were no alien spacecraft visiting us, as the only economically viable reason to travel across interstellar distances is colonisation/expansion.

It takes too long, and is too expensive, for trade. Missionary activity usually leads to military intervention (thus, colonisation) if the natives aren't eager to convert (and I doubt the entire lemur population of the earth would instantly convert to some alien religion, and the aliens would never consider that lemurs aren't the dominant species...).

So if "they" come, it'll be with a fleet of colonists, backed up by heavy weaponry to take care of whatever trouble they might encounter in their colonisation effort (meaning, us...).

That's only if you look at it from the very simplistic mind set of 90% of the mindless species that are "supposed" to be more intellectualy advanced than the common farm animal. We are moving into an age already where "if we are smart about it" things like that will be a thing of the past. Imagine the possibilities already within our grasp in the realm of nano-technology. They are already capable of using a common printer to create new usable organs for transplants. One of these days people might wake up in a world where what we used to think only god himself was capable, is just another overlooked everyday occurance.

predator78 22 Junior Poster

The most amazing UFO I have ever witnessed was exremly large flying at a very suprizing low altitude. It couldn't have been mistaken to be anything from this planet minus some kind of extreme cover up. It was literally a flying city "mothership" of some sort. I would have to estimate it at several miles in length and possibly in width as well although the width is a little fuzzy in my head after all this time. It had to be moving at fairly extreme speed because for the size the actual sighting didn't last long at all. Completely silent, lighting and structures similar to what you might think of a floating type city may have were clearly visible that's how low it was. This sighting was about 2 miles from hill airforce base in layton, city utah. The craft was eerily moving in the direction of the base, I always found that to be a little shady but possibly coincidence. Do I believe in UFO's and further more other intelligent and possibly more advanced civilizations in the universe? If you don't and have never exeprienced the unexplained, go take a serious math class and do some calulations. It is as Smith says in the Matrix inevitable.

predator78 22 Junior Poster

Yeah that's a great point to. Fixing desktops is one thing but why would I spend $200 and up to repair a desktop when I got a brand spanking new one that screams for $800 laptops are definatly a little bit more expensive to just go buy a new one if the one you have isn't do it for ya anymore.

predator78 22 Junior Poster

I would seriously advise against this having done the same thing myself. Not saying it's impossible but possibly impractical. The only way I would do computer repairs is to sell computers I personally hand built set them up on a network and handle all the backups and just reimage the machines on a consistant basis. Even then you would be looking at a monthly charge, but the idiots could have there constant swarm of viruses and malware handled sweetly for them. And wouldn't be calling you every 10 min after you fix it and they let their dogs walk around the tower laying on the ground while the kids are smashing the keyboard and randomly powering it off.

predator78 22 Junior Poster

Here is this to if you are interested in doing an acutal bubble sort. http://www.sorting-algorithms.com/bubble-sort

predator78 22 Junior Poster

Yeah I figured it might not be I havn't really worked with any algorithms in sometime. Just threw that out as a working example working with lists.

predator78 22 Junior Poster

Very inventive of you tonyjv. Here's my simplistic attempt :).

from time import sleep
import os

def lotsofprints():
    print "\n" * 40
    
message = "read me soon because I'm bound to disappear"

print message
sleep(1) # or .xx for milliseconds
#os.system("cls") #uncomment if running on windows from a command line
lotsofprints() #for use in idle maybe somebody cooler than me has better one
e-papa commented: thanks +3
predator78 22 Junior Poster

This is quite interesting would you mind showing the code your using now and possibly your new code if you find another solution?

predator78 22 Junior Poster

Looks like the name of your program you are trying to do a bubblesort not sure if you need to follow a specific format or anyting but this seems to work and may give you some idea of where you are going wrong or give you some ideas.

from random import randrange


def initialize():
    """ create a list of random numbers and sort them and print them out"""
    #creates the list
    tmp = []
    mylist = []
    for num in range(0,15):
        mylist.append(randrange(1,1000))

    #keep sending the list to the sorter always returning the
    #highest number back until initial list is empty
    while mylist != []:
        highest = sorter(mylist)
        tmp.append(highest)
        mylist.remove(highest)
    #print to screen
    print "high to low\n" , tmp
    tmp.reverse()
    print "low to high\n" , tmp


def sorter(mylist):
    """ find the highest number and return it"""
    highest = 0
    for item in mylist:
        if item > highest:
            highest = item
    return highest


initialize()
predator78 22 Junior Poster

Indeed you will have to trace it back because it's not generating it in that module.

predator78 22 Junior Poster

I think you might be correct tonyjv, but in the same sence sometimes it's for educational purposes to. I can only see 2 reasons to want to do this and one is educational the other is malicious. Just remember if you send a file like that to anyone you might be sitting in a cell for a long period of time for a silly little experiment.

predator78 22 Junior Poster

Indeed what has been said don't convert ed to an integer when you are trying to compare it to a string. Try something like this instead.

ed = raw_input("enter stuff: ")
#instead of using lots of "or's" convert it to upper or lower case letters
ed = ed.lower()
if ed == "encrypt":
  #do this stuff and as already pointed out strings are lists already
  message = "this is my message"
  for character in message:
    #preform actions on the letters in message
    #as far as your sytax error i'm not sure what you are trying to accomplish
    #but if you are doin a comparison from what the character is to what should
    #be printed out from the other list try something like
    if char == "t":
      print l1[1]
    #it's already a string so why are you converting it to an int and then back?
predator78 22 Junior Poster

What module is generating the error? Once you know that then you know to change that module to not be recursive if it is exceeding the limit.

predator78 22 Junior Poster

Thank you for the great responses. That certainly clears my thinking up on data structures immensly, and yes I was reffering mainly to data structures in the c++ sence. I really like what you said about my misconseption narue I think that was the pitfall I was in when I posted the thread. And mike thank you for pointing out my wrong choice of words about classes, I do realize what your saying and that it is true, mainly the reason of my bad choice of words came from my hazziness about data structures though not from the fact I don't have a fairly decent grasp on classes.

predator78 22 Junior Poster

I think you are using blit() incorrectly all my code is on another machine atm so I can't check for sure. Anyhow I'm pretty sure you can't just blit without passing in a location in the form of a tuple.

example: screen.blit(ball,(xposition,yposition)) or in other words
screen.blit(ball,(100,100))
screen.blit(ballrect,(myrandomvariable,myrandomvariable))

predator78 22 Junior Poster

Hello I'm learning a bit about data structures for the first time and so far I seem to understand how they work "I think" at this stage. My questions at this point would be.

1. Are data structures essentially classes minus methods which can preform actions
on the memebers that are held inside?

2. In the case that question 1 is true... Why would I then chose to use a data structure over a class as data being stored is usless without being able to preform actions on that data?

3. I realize that classes are basically objects, it seems data structures are givin some of that good old terminology that could be misleading. As in we give the structure a name which can be described as a "new type" or a "new object". Which term might be more correct and suitable for data structures?

4. I guess at this point my final thoughts on data structures is that data structures would be a good way to store data that you may not "at the time" know what you may possibly want to do with later on. Which seems a bit silly to me but possibly understandable, kinda sounds like a project so large that you couldn't possibly see or be planning far enough ahead to know why or what you are storing that data for.

I've done quite a bit of searching on data structures like I said and I'm sure will continue …

predator78 22 Junior Poster

Yes I was thinking something similar to that just because even though I'm able to extract information about events from the builtin event manager it still seems easier to create my own class that will already be processing the events in one centralized location. I guess the added benefit of writing it as my own class that I'm thinking about is that I can keep very close track of the events and be handling them in the manner i see fit from within the class instead of manually from within the loop.

predator78 22 Junior Poster

Hello all!!! It's been a while but glad to have enough time to be back. My question is basically one of design. I'm working on a new project using pygame at the moment, mainly to brush up on and enhance some Object Oriented skills. The project itself is basically going to be somewhat of a foundation of a game engine I was thinking an event manager would be wise however pygame as most of you know already has an event manager of it's own. The problem I'm seein with using the builtin manager is that most of the code would have to be implimented inside the main game loop which could possibly get ugly and less manageable if I decided to build a decent size project. I guess the question is, is my thinking correct on this and should I impliment my own class as an event manager to hide some dirty details in the back ground or would it be just as well to use the builtin one and run the risk of a dirty spew of code in my main loop. I know it seems obvious but I would just like to get some good input from some of you guru's.

Thanks in advance and if any example code would help clarify this I can provide it, but I think the question itself should be pretty straight forward.

predator78 22 Junior Poster

Hello first off I appologize if this is posted in the wrong forum and I'm sure if it is a moderator will kindly move it to the correct location. I did try to find a suitable place and this seemed the most logical choice to me, I did also try and find a place to start a study group on the web but to be honest I want to get a good study group and not a bunch of spyware and spam which was the road that seemed to be headed down.

I am not completely new to programming I would say I am intermidiate level in python but I would like to spread my wings a bit and delve into the realm of a lower level language. While it was a great learning experience and alot of fun to teach myself along with the help of many great people here at daniwebs the python language, I thought it might be fun to try a group senario while learning c++.

I would like to keep it small and simple 3 or 4 members max. Please realize also if you are interested I have had some experience programming so I intend to be realistic in the pace of learning the language while at the same time I realize that there may be diffrences with learning ability and drive in the group that will be things that maybe discussed from within the group. Not to mention I am a hobbiest …

predator78 22 Junior Poster

I guess I forgot to mention to that this is an imported module. I got it from here. http://www.pythonware.com/products/pil/

predator78 22 Junior Poster

Hey guys,
Well I'm onto images now but the tutorial I'm using seems to be good but I can't understand the input process. And I know you guys are great at this stuff so thought you might lend a hand here to get me up and started. The code the guy in the tutorial is using goes like this.

import os, sys
import Image

for infile in sys.argv[1:]:
    f, e = os.path.splitext(infile)
    outfile = f + ".jpg"
    if infile != outfile:
        try:
            Image.open(infile).save(outfile)
        except IOError:
            print "cannot convert", infile

So anyway just started messing around with it and I'm not getting any information into sys.argv[1:] using similar code, I commented out the ones I still wanna learn but won't use for now. It looks like this.

import os, sys
import Image
im = Image.open("D:\\pics\\jennifer.bmp")
#print im.format, im.size, im.mode
#im.show()

for im in sys.argv[1:]:
    f, e = os.path.splitext(im)
    outfile = f + ".jpg"
    if im != outfile:
        try:
            Image.open(im).save(outfile)
        except IOError:
            print "cannot convert", im

I guess its supposed to convert from one file type to another, but don't seem to be getting any information to the sys.argv[1:] module. So I guess my question is how does that work, and how can I get this up and running to test it?

predator78 22 Junior Poster

O.K that makes a lot more sense now, so the -10 is a flag you can set. Didn't quite catch that at first, thanks for the links to that information.

predator78 22 Junior Poster

O.K. I'm understanding that it is used to convert between types, but what is the -10 in %-10s for? Wouldn't you only need to do %s?