@# 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 8 9 10 11 12



Comments:

<0> the data in question is an int
<1> its some scalor quantity, double or float, doesn't matter
<1> what matters is complexity.. i am sorting 100% of the data to use only the top 5%, so time is wasted on sorting elements i don't need
<2> :o nice here
<3> I think you can derive from priority_queue and access 'c' to trim the bottom.
<1> what's c?
<2> :>
<3> protected:
<3> Container c;
<4> grr
<2> Run is busy:(
<1> ah
<1> someone's got to have done this before already. don't want to reinvent the wheel
<2> Run busy?;)
<4> i don't think vim and splitvt mix very well
<5> dextre once you use the top 5% then what?



<5> do you use the top 5% and then throw the whole thing away and start fresh by creating an ew one?
<5> or do you keep tha ttop 5%, let more data come, and sort it, and then trim back to that 5% again
<1> i am implementing K Nearest Neighbor
<1> and i have a list of distances
<1> and i wanted like.. the top 5 near elements
<1> and there's a lot of far elements the KNN doesn't care about
<1> can some1 suggest me a container?
<5> but I'm confused... if you have a priority queue
<1> because what i'm currently doing feels stupid
<5> and you pop the top 5, don't you ahve what you want?
<1> that works, but every insertion is going to cost a lot
<0> ok..
<5> why because it's going to sort it on inserT?
<1> i would like to just maintain 5 elements in the queue is that possible?
<5> oh, I see...
<0> if i have Collision c; where collision is a struct, and i say.. c = getSomeStruct(); - why does that not copy?
<1> i don't know.. if u use a priority queue and pop the top 5, isn't that the same as aggregating it all into a vector and then running a sort? and then truncating after the first 5 entries?
<5> dextre I didn't realize you only wanted to ever keep 5 elements
<1> i need the top 5 for KNN where K=5
<1> 5 nearest neighbors
<5> yes, I realize what you're saying now... I ***umed you wanted to keep all values until you were ready for the top K elements
<1> and currently i am sorting like 100 neighbors, just to get the top 5
<1> if it's the top 2 or top 3, i can write an O(n) loop to collect them
<3> I think you best write your own cl*** for that.
<1> but then K might vary.. might be 20, might be 10
<4> hmm, where's impatient: http://blogs.msdn.com/federaldev/archive/2006/05/23/604675.aspx
<5> hrmmm, sounds like a double ended priority queue, but I also think you might be best off writing your own container
<4> would help if p***port wasn't fubar'd right now
<5> peterhu well that's what you get for going to 3rd world countries to have *** with pre-teen boys
<1> lol
<4> microsoft p***port you freak
<3> Nah, don't like them black boys
<5> ooooh, _that_ p***port
<6> Is there anyway to p*** a multidimensional array to a function if you don't know the size of the array at run time?
<3> renx99: That is called a vector.
<6> hmmm...obvioiusly i need too look at the STL more....
<3> if you don't know the size of the array at run time: if you use C++ you shouldn't have that problem.
<3> A two dimensional array would be a vector<vector<> >, but personally I think that code that uses multi-dimensional arrays is badly written.
<3> At the very least, you should hide it in a cl*** - and then the implementation of that cl*** could use a one dimensional array anyway.
<0> what gets copied over in a struct if i say StructName c = someFunctionThatReturnsAStruct(); ?
<6> what alternative would you suggest then?
<0> because i seem to be losing an int somewhere
<3> thekeit: nothing that constructs the StructName c inplace, inside the function (***uming it returns by-value)
<3> nothing, (comma)
<6> you know Run, using a cl*** is so obvious, I feel like an idiot..duh.. god i've rusty
<0> so.. can you offer any explanation as to why in someFunctionThatReturnsAStruct(), struct.intval is CLEARLY being set to 1, while back in the function that declares StructName s = someFunc...(), i NEVER get struct.intval == 0?
<5> you mean you NEVER get struct.intval = 1; ?
<5> ==*
<0> yeah, NEVER
<5> paste your code somewhere
<5> let's have a look
<0> k, gimme a sec
<3> "the function that declares StructName s = someFunc...()" makes no sense.
<3> Hmm, ok I get it.
<0> ok, http://rafb.net/paste/results/UKc3T796.html
<7> thanks for the advise Run
<0> there's bits from three .cpp files in there
<5> k
<3> thekeit: what line number does the call?
<0> 16 is the creation of it



<3> Well, this doesn't compile
<3> Collision is not defined anywhere.
<5> of course it doesn't, he said itcomes from 3 different files
<5> yes it's defined in line 54
<3> Oh, smart order
<0> 108 is where .outline gets set - and i've confirmed it does
<3> And where is RenderObject defined?
<5> thekeit set a breakpoint on return c;, line 115
<0> elsewhere
<5> and tell me if c.outline is 1
<3> thekeit: This is the most horrible thing I've seen in a long time... how long have you been coding "C++"?
<0> 3 days?
<3> right... well, the typedef struct is a C thing.
<3> Change line 55 into:
<3> struct Collision {
<3> and lines 61 and 62 into one line:
<3> };
<8> last night he said that the problem was that on line 16, r is 0
<5> Run that isn't his problem though
<8> there's no need for that C cast on line 12, either
<3> That is syntactical though - you are not coding OO at all. Members of a cl*** should be private.
<8> (you shouldnt be using C casts at all - learn C++!!)
<3> [m]aniac: I'm not here to help people debugging their code, I'm here to be a mentor type of thing (IF I feel like it). So, I talk about is the worst thing in his code; not only about whatever causes his _current_ problem.
<4> i'm here mostly to riddicule
<3> We know
<8> hu hu hu
<3> And paste blogs
<5> Run well I would suggest offering solutions to his current problem on top of "mentoring" the rest of his code, not the other way around
<5> I mean, we're side stepping his issue
<0> xcode is having serious issues setting breakpoints on that line :/
<8> i just give out this link: http://www.rudbek.com/books.html
<5> rdragon lol yea that's about all Is ee you say ;)
<8> ;)
<4> pfft
<3> I will if he fixes the things I already said and then paste code that actually compiles. I can't inspect the call on line 16 without seeing how RenderObject is defined.
<4> i wish irssi re-ran my post-login commands after a disconnect and reconnect
<3> It could do ANYTHING, maybe it isn't even calling the function he thinks it is.
<4> i'm too lazy to login to X manually
<4> i'll just restart irssi heh
<5> hehe
<5> khan, that lazy bitch
<8> mirc does, problem is usually the old connection is still around so i can't re-authenticate
<3> peterhu: I'm writing a program that will do that for you (it goes between the client and server). Needs to run on linux though.
<4> 11:25 Linux mercury 2.6.15-gentoo-r1 #6 SMP PREEMPT Wed Mar 1 14:09:24 EST 2006 i686 Intel(R) Pentium(R) M processor 1600MHz GNU/Linux
<4> w00t
<8> weak
<3> Ok, it will take a while until I finished it though... I'm at 7000 lines of code now.
<8> 7000 lines to re-authenticate you on disconnect?
<3> No, it will do more :)
<9> Morning..
<8> 'afternoon
<9> ..right...
<3> Hmm
<3> /usr/src/ircproxy/ircproxy/src>for i in `s`; do echo -n "$i " | sed -e 's%.*/%'; cat $i | wc --lines; done | sed -e 's/\(.*\) \([0-9]*\)/\2 \1/' | sort -n | tail -n 5
<3> 270 debug.cc
<3> 306 debug_ostream_operators.cc
<3> 335 table_gen.cc
<3> 362 PersistXML.h
<3> 920 Expression.h
<3> Most lines are from Expression.h :)
<9> C spot Run
<3> That's the file that allows me to construct expressions of 'Watched<>' variables that will do a call back as soon as the expression turns true.
<3> PersistXML.h is a file for keeping an XML backup of it's internal state (whatever is relevant anyway).
<0> thats weird
<0> i have a breakpoint on the return c; line in ddd, but it's NEVER stopping there
<3> thekeit: Add debug output then.
<0> im compiling with -g3... i think
<0> better check that
<3> [MeDeea]!*@* added to ignore list.
<9> hehe
<0> Woah.
<0> on the line printf("%d ", c.outline);, ddd takes me to SceneObject::getRefractiveIndex();


Name:

Comments:

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






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

soliss
#linux
#linuxhelp
#java
#MissKitten
#AllNiteCafe
#javascript
12 yo lols bbs
go to longmovs
turn on gssftp



Home  |  disclaimer  |  contact  |  submit quotes