@# 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 13 14 15 16 17 18 19 20 21



Comments:

<0> the last for loop, this is a ondraw function for my View cl***
<1> and whats the problem ?
<0> well, my program halts when I execute and it doesn't draw the non-client part of the screen
<0> works perfectly without the last for loop
<0> v_size is the vertical distance of one unit, and h_size is the x axis
<1> have you used the debugger ?
<0> no, not for this prob.
<1> dailylab > 0 ?
<0> dailylab is a constant # equal to 200
<0> ahhh got it
<0> I was in debug mode, looking at my for loop item get larger and larger, and decided that it is prolly to big
<0> so I made the max size 1650
<0> works perfectly now
<0> thanks for the advice
<1> wait
<0> I'm just learning to use debugger more and more recently, after never using it during Acc C++ book and my 6 month C++ project



<0> waiting...
<1> in your loop
<1> you should say something like
<1> err
<1> aPoint3 < 1000
<1> this way you ensure that your loop has a bound
<0> why not aPoint <= 1000 ?
<1> you could
<0> oh, so instead of != ?
<1> yes
<1> since you say != 1000 you don't want to iterate when your aPoint3 is 10000
<1> so you just say < 10000
<0> ok
<0> I'll do <= just to make it simple
<0> thanks, good advice Cloud
<1> np
<1> what is the application by the way ?
<1> you doing graphics of some sort ?
<2> CrazyBandit CrEw OwnEz mE!
<3> is there anyone that understands the way the binary search works
<4> At least 10 people.
<4> vawjr, and me.
<3> I'm having a hard time understanding it
<5> nice Solamente
<1> funny guy
<3> so I need a little help
<4> I'm here all week. Tip your ops.
<6> what confuses you about it?
<3> It's good to see that u have a sense of humor :)
<3> well... let's say I have an sorted array 1,2,3,4,5 and I wanna find 2, what numbers will the search visit
<4> Okay, given this series... 1 2 3 4 5 6 7
<3> yeah something like that
<4> You know there are seven elements.
<4> Search for "2"
<3> yep
<4> So, you divide and conquer.
<3> so I go to 4 first right?
<4> Right.
<3> and then I find two
<4> Wait, wait.
<4> 4 isn't a match, but 2 < 4, so you search the bottom half.
<4> Which happens to take you to two.
<4> Try it with 7.
<6> Juvenille, most people use a binary search when they look someone up in the telephone book (to find the right page)
<7> binary searches? coolies... I think there is a C function to do binary searches... *looks*
<6> yes, bsearch()
<3> hm....
<3> well...
<4> Pfft
<1> bs :)
<7> http://www.cppreference.com/stdother/bsearch.html
<4> std::find
<3> after I divide and get to for and then I decide do divide the left side, how can I divide it when it has an even number of elements
<6> it doesn't have to be even, you'll either round up or down
<3> for=4
<6> since you can't have half an eleemnt
<6> pick either convention, both will work fine
<3> hm...
<5> I'm looking for some suggestions on something. I accidently did an ***ignment in such a way that it sort of covered my next ***ignment as well, and so now I'm trying to figure out something better to do, an improvement. The ***ignment is to convert a program which does everything in the main "to a design that uses object oriented abstraction", and here is my code http://www.noidea128.org/sourcefiles/15866.html
<4> If there's a middle element, test against that, and go high or low on a mismatch.
<3> the thing is not using binary search for C++ , it's just understanding it



<6> well, the telephone book analogy is a good one
<4> If there's no middle element, pick whichever is likely to contain what you're looking for by testing either side.
<6> do you follow it?
<3> well... the pI have a question for my exam... and I'm supposed to tell which elements will the binary search visit in a sorted list in order to find a certain element
<6> ah
<3> so that's the whole problem,
<6> well
<3> It's not about c++, I tried looking up pages
<4> Haven't you ever played the "guess a number between 100 and 1" game?
<4> That's a cl***ic binary search.
<3> yeah I know that game
<6> I think what is confusing you is if there are an even number of elements, which do you visit, correct?
<3> yes exactly cn28h
<3> that's my problem
<8> so the whole point is to pick a random number between 1 and 100 :))
<4> Okay...
<8> until you find the right one
<7> vampirical lines 123-125 make it so that no matter how long the command is, the '='s above the text line up with the output of the second line
<4> 1 2 3 4 5 6 7 8
<6> ok, well you need to either round up or round down
<4> Search for 2 again.
<6> now, it doesn't matter which, but you should probably be consistent
<3> ok.... well I choose either 4 or 5 ... I guess 4
<4> 2 is less than 4 and greater than 5, so you pick the lower 4 elements for your next set
<4> Umm...
<4> I mean...
<4> 2 is
<4> You know what I'm saying.
<4> Obviously, I need sleep. You can figure it out from here.
<3> hm... so the search goes to both 4 and 5 and chooses 4 because it's closer to 2
<3> right?
<8> nope
<6> it should pick one or the other
<6> doesn't matter which
<4> Because 2 is below 4 in the sort order.
<4> cn28h: Huh?
<6> why would you test both?
<4> I'm ***uming the list is sorted.
<8> Solamente, he's asking why he compares 4 with 2 instead of comparing 5
<6> well binary search doesn't work on an unsorted list ;P
<5> jsaacmk: heh, thanks for that
<3> yes of course it's sorted
<7> lines 8 and 9, use vector<string> instead of arrays for checks
<8> Juvenille: you simply compare vector [ roundDown(VectorLenght/2) ] with the number you're searching for
<7> possibly make a check cl***
<8> if the number is lower then you'll have a new set of elements
<8> from vector [0] to vector [ roundDown(VectorLenght/2) ]
<5> jsaacmk: ah a check cl***, just the sort of thing I was looking for
<5> :)
<3> hmmmm thanks
<3> this made the things clearer
<8> if it's bigger from vector [ roundDown(VectorLenght/2)+1 ] to vector [ vectorLenght-1 ]
<3> thanks a lot
<8> "That's what we're here for" 6 Victor A. Wagner Jr.
<8> :)))))
<7> also, vampirical, line 130 should be int main()
<8> heh, I've just realised why is so hard for ppl to understand new situations
<9> cause thats how the brains werk?
<8> because we don't separate the problem by the variables
<8> *from
<9> thats normally a good thing, if you can include variables in the thought process
<8> it's like the binary search
<8> if you look at an array of numbers you can't understand how it works
<9> in your mind it is a group of numbers that auto gets cut in half....
<9> actually the mind is much more efficient cause it can jum based on variation
<9> jump too
<3> well yeah
<3> I get that
<8> you simply want to contradict me
<9> So, glance at numbers, determine mentally if sorted, then jump to an arbitrary number based on variance
<8> but I do have a point
<9> I would reword your point in that:
<9> its difficult for a human to describe what and how they are thinking
<10> how do i make an into into an iterator?


Name:

Comments:

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






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

sexigirl
#linux
Niger Noger
#linux
jirgeta
sosexy
#squid
Chicane Ft. Maire Brennan - Saltwater.mp3
#linux
#linuxhelp



Home  |  disclaimer  |  contact  |  submit quotes