@# Quotes DB     useful, funny, interesting





Google
 
Web www.quotesdb.info
Undernet  |  EFnet  |  Quakenet  |  Freenode  |  Dalnet  |  Ircnet  |  Galaxynet
Page: 1 2 3 4 5 6 7



Comments:

<0> :)
<1> is it good to make objects static?
<2> the static keyword has several different meanings in c++
<3> good is subjective...depends on what you want to achieve
<2> which use of static are you referring to?
<1> well...i have my cl*** which loads a texture....but now i have several ob jects of this cl*** and still need to load the texture once
<2> static cl*** member?
<1> yes
<2> i'd delegate the loading a the texture to an other cl***
<2> i'd avoid static members
<2> they put a constraint on your design
<1> yea but how will i p*** this texture object to the cl*** i need?
<3> a static member is shared among all instances of the cl***
<1> i realize that but i cant find an alternative
<1> bealtine thats why i need it
<3> so do it:)



<2> give every instance a reference or pointer to the object handling the texture
<2> that's what i would do
<1> but if i choose a different way of doing it like loading the texture in another cl*** how will i p*** the texture to the cl*** i need it
<1> ah
<1> so load it elsewhere and create a pointer to this object in the cl*** i need to use it and p*** that pointer?
<2> yes
<1> yes i can do that
<2> if you use a static member, your design is limited to one texture
<2> unless you add another static member
<1> cause its ok to use static ints or floats but i dont feel comfortable doin it for big objects
<2> i always try to avoid them
<1> yes thats not the point....i feel its bad design
<2> what's not the point?
<2> ah ok
<1> ahm...
<1> ok :)
<2> :)
<1> is it ok to use it for ints or booleans though?
<2> static members are like globals
<1> so if u need it do it...
<2> meaning: try to avoid it :)
<2> it puts constraints on your design
<1> we say the same thing...do it only if necessary
<1> iv heard of an alternative way of doing for loops by using only two parameters
<1> is it true?
<1> is it good?
<2> only two parameters? i don't understand
<3> whats wrong with for loops anyway?
<1> something with using an extra temp variable....was in a book with c++ tips
<3> ummm
<1> nah....just using a paramater less...so its more efficient...anyways
<4> I have an array and want to find duplicates. What is the most effecient way to do it?
<2> easiest: sort first
<4> most effecient
<4> is that more effecient than taking each element and looking at the whole array for a duplicate?
<2> well
<2> sort can be n log n
<2> your method is n*n
<2> so yes, it's more efficient than what you say
<5> http://www.richmangame.com/
<6> I'm new to COM objects. I wanna control MapPoint so I used CoCreateInstance. th eproblem I'm having is if the user actually shuts Mappoint while my program is using it... is there a way to know if program is still running so I know when i need to redo cocreateinstance?
<7> http://mediax.mucho****o.com/movies/discrimination-02-06-06.mp4 lol
<8> _!_
<7> that was fun
<9> anyone ever used strongly typed DataSets or Bindingsources? if so what are you comments about it?
<9> oh sorry
<6> .
<6> ee
<4> aight what the **** is a callback function?
<10> a function you p*** that it called when "something" occurs
<10> i.e. "Call me back on this function when you're done"
<4> oh like dont return the the calling function, use another function that I specify?
<4> Asriel?
<10> Yes?
<4> am I right?
<10> Erm, no, not really
<10> it will still return to the calling function eventually
<10> (***uming exceptions don't get in the way)
<10> callback functions are often stored to give a notification of some other operation thats just finished
<10> i.e. you say "Go download this file, then call me back"
<10> your code keeps executing, and the library works in the background, and executes that function when it's done



<4> like creating a new thread?
<10> often, yes
<10> or possibly even before it's returned to the caller (though it will still get back to the caller)
<10> or on the same thread, via message pumps, or other weird methods
<10> a nice example is WinAPI's "SetTimer"
<0> somefunction(CalbackFunc cf) { do something; cf(); do something else; return; }
<10> the concepts "kinda" been superceeded by functors in C++, but is still pretty prevalent
<11> http://www.overlawyered.com/2006/06/constitution_going_to_the_dogs.html
<4> how can you have pointers to functions?
<4> do functions have specific memory locations like declared variables?
<10> yup
<10> the syntax is a little obtuse, but you can take the address of a function without any trouble
<4> can you p*** it arguments knowing only its pointer also?
<0> yes
<12> boost::function
<12> void foo(int x, int y); boost::function<void(int, int)> func = &foo; func(10, 20);
<4> ok
<4> what happens if the arguments dont match, and is polymorphism possible in this case?
<12> if you say func(10); you mean? you'll get a compile error
<4> yea
<4> ok
<4> is polymorphis pissible?
<12> yes
<12> using boost::bind, you can bind to member functions
<11> http://today.reuters.com/news/newsarticle.aspx?type=internetNews&storyid=2006-06-02T165045Z_01_N02222830_RTRUKOC_0_US-TELECOMS-WIRELESS-AUCTION.xml&src=rss&rpc=22
<11> I still say that's BS
<11> that you can't use your cell phone while flying.
<11> ok, what am I hungry for?
<11> binding to member functions is lame
<11> so are function pointers
<11> God gave us perfectly good virtual functions for this purpose.
<12> hmm
<11> ok
<11> now
<12> that doesn't solve a signals & slots design where I should be able to register any function as a 'callback', without needing to derive from some silly base
<11> what am I hungry for?
<12> wendys
<11> pfft
<11> deriving is much cooler.
<12> pfft
<11> then everything is a nice object
<11> and shows up in a nice graph when you use doxygen with graphviz
<11> so you know all of the derived objects that can be used in that slot
<11> if you're just using function pointers
<12> that means i need to modify the base whenever I add a new event that can be registered
<11> you have to KNOW which ones work.
<11> lame.
<11> It depends
<12> eh
<11> most of the time you'd create a new base.
<11> I'd say
<12> the 'slot' just needs to follow a signature
<11> different functionality == different base.
<11> wendys isn't good for lunch
<11> too greasy
<12> yea i don't care for it
<12> thought maybe you would
<11> hmmmm
<11> I could go get a gyro
<11> but that's a lot of food.
<11> subway?
<11> that's a little too quick
<11> I don't like eating at my desk anymore
<11> when I can avoid it.
<12> subway is good
<12> eat at the place
<11> too small and crowded.
<11> oh, baja fresh
<11> that would work
<4> what is a delegate?
<11> someone you choose to do something.
<11> delegate ( P ) Pronunciation Key (dl-gt, -gt)
<13> C# name for method pointer
<11> n.


Name:

Comments:

Please enter the result of the sum 63 + 46 (to avoid spam):






Return to #c++
or
Go to some related logs:

make a killing origin
#linux
hamrun cam
#AllNiteCafe
acie deucie rules
#chatzone
iironnick
mysql skip grants
#linuxhelp
12WHAT IS THE FAMOUS CAVE ON THE ISLAND OF STAFFA?



Home  |  disclaimer  |  contact  |  submit quotes