cploosh i suppose im a noob but if by state you mean where the pointer is pointing couldnt you store the &var

string

regular string? as oppose dto an irregular string?

So I need to stream the stringstream to an std string/
?*

i don’t know wha tyou are using it for
if you are using teh stringstream to produce a string, then yes obviously you do

to u_char[]? Iterate through the vector, increment i, and do u_char[i] = current-iteration of the vector?

why convert it? you can use &myvector[0]

orbitz, I have to manually construct u_char[] to send as raw packets, will that (&myvector[0]) work with that process or one like it?

linux time

so saying that that casting between types is abusing the concept of inheritance/polymorphism.. why is there RTTI/dynamic_cast ?

of course
there are some sitautison wher eit migh tbe useful

orbitz, mmm. cool. thanks! my life just got easier!

i’ve asked you 3 times to explain what you are tryign to accomplish. Are you actually going to do this or keep on asking pointless questions?

Ok then… ill do my best
ive got a base class “Object”

oh god
already soudns like a terribl start

forget it then!

*shrug* ok, i’m not th eone here askign for help so that’s not much of a threat

lame! If you want to help, then help, but if you’re going to give me un-constructive critizism, i really dont want the help. Its that simple

yo

well jee, it’ sno tliek you gave me any chacne ot be constructive
you immediatly got defensive rather than asking why i would have such a reaction s soon
so if you’re just goign ot cry abotu thigns then i dont’ care

I’m a bit worried my program is using too much memory. It is currently running on a high performance server, and the stats shows it’s currently at 6%. Yesterday it was 5%. Is this a problem? (Note mysqld runs at 1% stable)
Errm, .6%, and .5% not whole numbers.
1.0%

% of memory?

orbitz, Yes.

how long as it been running?

3 days.

1/10 of a percent over one day isn’t a very good indication of a long term trend

how much memory do you have total?

and it was about a day from .5% to go up to 6%.
..6***
Flannel, Let me see if I can find that out for you.

giv eit time, if it gets upto 2% you might ened ot do somw ork

orbitz, What could possibly be the problem? Not deleting old memory properly?

whats the point of having a high performance machine if you only use 2%, go easy on me, I have never done IT/mem managment stuff like that

I find it hilarious that anybody is even trying to humor this question when we have absolutely no information on which to make an assessment of whether or not you are using too much memory

SnakeChomp, My real worry is that the memory is increasing over a period of time.
SnakeChomp, Really. The there is information as to my proporations of mysqld.

by .1%? oooh scary
we dont know anything about mysqld, or about what your program does

SnakeChomp, But there should be no reason why it increased when there are less people using the server.

if your server runs out of memory, then you have a problem. If it doesnt, you don’t have a problem.

SnakeChomp, Therefore I raise my question.

Trent, its just that one to three days is not enough data to indicate a long term trend

jimmygoon, It’s too early to tell. That’s true.

If you want to test for memory leaks you need to do a specific test, ie heavy load testing
or use valgrind

SnakeChomp, No I don’t need to test for that right now. Thanks tho.
SnakeChomp, I guess I was worried that my application is almost #2 in memory usage for the entire server.

you are not even using 1% of ram
seriously

SnakeChomp, It’s a high performance server tho. And 1% on one server could be something else on another.. It’s ratios really.
SnakeChomp, That’s why I said mysqld (the highest) is using 1%

any high performance server has at least 1g of ram and 1% of 1g is 10m, which is nothing
so if your server only has 128m of ram you might in trouble

But there isn’t anything wrong with trying to be efficient?

Hey

one percent
that is all

SnakeChomp, I’ve just been thinking. My application is no where near to as powerful as mysqld.

if you consider mysql to be powerful…
the memory usage of mysql obviously depends on how many people are using mysql on this server
if nobody is really using it, it wont take up much space

Where can I find resources on how things are ’supposed to be done’ in a software development setting?

(C++ noob here) How can I extract the 1st N significant digits from a long double float

SnakeChomp, Very true. Yes, it depends on it’s load.

?

hei guys,lets say i have pointer int *p1, but i want to save the state of pointer..like lets say its pointing to 3… i thought of using a *temp (temp=p1)…But then only i realised its a bad idea as temp will keep pointing to p1…any other solutions

You cannot use mysqld as a memory footprint reference without knowing how mysqld was implemented. it likely uses no memory until someone connects to it and starts running queries, and even then it might allocate that memory in the process doing the quieries

SnakeChomp, Perhaps i’ll just use megabites next time then.
bytes*
..

anyone out there… or is my qn too improperly structured…. appreciate some feedback…thanks ..

look at other people’s code. you really just have to accept that for a few years your code will be sucky until you get a feel for things.

you can take a look at “the cathedral and the bazaar”, but the best way to learn is to read other people’s code, like phrosty said

I feel like I don’t make nearly as much progress as I should, because of how we run things. This isn’t just a c++ topic, but I figured you guys could *point me in the right direction.

cploosh, i suppose im a noob, but if by state you mean where the pointer is pointing, couldnt you store the “&var” and make a new pointer later from that?

I know our group doesn’t perform nearly as well as we could, but I am too young and inexperienced to know the correct way.

there is no ultimate way to do things, only “common” ways

the thing is that in my program i am doing ,,, there is no object…just pointers… so lets say i have a pointer
int *p1=new int(3),*temp;——
temp=p1//here i wanna store the current status of where p1 is pointing…
but later i do (*p1)++… but *temp also gets updated… is there a way so that temp can keep pointing to original p1

(*p1)++ will increment the value p1 points to, not p1.

desu.

ossu

que su?

mmm… quesadilla

anyone here use c++.NET?

incrementing a pointer through memory sounds odd to me in the first place o.0

why would anyone want to use that :/

It doesn’t exists anymore

wouldnt that land you on essentialy random memory?

You mean… c++/CLI?

I guess i’ll be the first to tell you that C++/CLI is offtopic here so noone will help you

what else is there for gui building? 1gb borland? :P

straight win32 (not as evil as people make it out to be), WTL

ah, i see

you lie!

i think… nvm

godling just doesn’t have the mojo

pffft

yeah c++ CLI, compiles to MSIL code, like javas byte code

:P

godling doesn’t use windows. :P

const temp = p1?

godling, is that a james gosling typo?
some people think thats it #include studio.h

Yes, it is. I’m James Gosling.
In a C++ channel.

gosling can code in c++

on irc

he might hang out here

cploosh, const temp = p1? forgot the name-ping thing

is temp a constant pointer

.. right, sry, noobness kicking in..

or is there such a thing in the first place

kicking in?

kicked in, and kicking more

do you have a button nose?

geordi, “no, godling”;

no, godling

seems like that isnt the soln… seems like i have use the objects instead.. thought of doing it with just pointers alone…i was really hoping there was a way where you can store the content of Pointers…without explicitly using objects..
just one last thing…what i am describing above…is that some wrong concept with regards to C++ …

a button nose?
what’s that

a nose
made out of a button

i don’t smell buttons.

the song says you have a button nose

a small nose

i’m fairly positive that’s a negatory

oh, maybe you’re not him
http://community.livejournal.com/problemaday/81205.html

am I lost? ….arghhhh…..

const pointers do exist, yay

i tried that… but *temp kept changing when I changed *p1 …

weird
i just tested that, and i got effectivly two pointers
temp stayed on the old value for me

can pass me that code snippet… i will be pleased…

sure
its kinda um.. full of couts

cout is win

i was thinking python and writing c++
http://cpp.sourceforge.net/?show=39865
forgot my output

lol wtf, that’s a lot of cout’s….

output added
i told ya Walt_ :p

why do you make a new cout every time :/

how do i concentrate again :/

can you do it without using the (int) datatype…

and not cout”i :” i “\n”

You know you can chain couts, right.. ?:p

?

!there we go
i know there was a symbol
couldnt remember it
ill try with another type
a quick object

the catch is that , you got to do it without using any objects …just pointers
cos the library i am using , doesnt let me create objects..just pointers..
U get my predicament now…

if you cant make an object
what is the pointer pointing to?
are you using it as a normal integer?
sorry

I tried doing this… SoSelection obj…
‘SoSelection

*
To prove that you're not a bot, enter this code
Anti-Spam Image

Comments are closed.