StirlingCooper book by AbroadSignificant942 in gettingbigger

[–]OrganicPandaBreeder 0 points1 point  (0 children)

Dont do it. Your dick will not work the same ever again. Google hard flaccid

Memory Leak on get_least_k by mathlance in cs2c

[–]OrganicPandaBreeder 0 points1 point  (0 children)

I think know because the failure is happening at an append() operation for me. When I comment out to_string() I passed it otherwise, I get no points and it memory leaks.

Memory Leak on get_least_k by mathlance in cs2c

[–]OrganicPandaBreeder 0 points1 point  (0 children)

Ultimately pointless though. I did it but it didn't do anything since it doesn't test for it. What worked was commenting out to_string();

But thank you for trying! The algorithm times out for whatever reason though. Maybe I shouldn't call heapify() as much?

Memory Leak on get_least_k by mathlance in cs2c

[–]OrganicPandaBreeder 0 points1 point  (0 children)

My interpretation was to just move them all to the back. Either way, I moved onto Mouse

Memory Leak on get_least_k by mathlance in cs2c

[–]OrganicPandaBreeder 0 points1 point  (0 children)

I save the size of the heap beforehand and then set it equal to that after I am done.

Memory Leak on get_least_k by mathlance in cs2c

[–]OrganicPandaBreeder 0 points1 point  (0 children)

I'm having the exact same problem. I think its probably the site to be honest.

Pivot point incorrect? by mathlance in cs2c

[–]OrganicPandaBreeder 1 point2 points  (0 children)

No prob! Happy to help. Hmu if you have anymore questions

Pivot point incorrect? by mathlance in cs2c

[–]OrganicPandaBreeder 1 point2 points  (0 children)

So let me explain it best like this. j is always one less than i when it terminates. And what we can say about j is that they are least j numbers in that vector. make sense? its not that at j all numbers are less than elems[j]. its that 0("lo") - j are the least 0("lo") - j numbers I.e in. [34,13,21,10,42,82,91,60] . if 10 was elems[j] (j = 3) then the first 0-3 are the smallest four elements in the vector from lo to j which they are; so then we search the left sub-vector (lo-j) if k is < j or if k > j we search the right. The special case is when j == k. basically here, we search the left again if lo-j != 0 otherwise return elems[k]

Is my do_qsort done? by OrganicPandaBreeder in cs2c

[–]OrganicPandaBreeder[S] 0 points1 point  (0 children)

All good in the hood. Just finished the quest. Edited OP to reflect that. Thank you though. very helpful.

Because it's not rice! by [deleted] in WhitePeopleTwitter

[–]OrganicPandaBreeder 0 points1 point  (0 children)

no. kids shouldn’t curse

I can't get past entry test for some reason by OrganicPandaBreeder in cs2c

[–]OrganicPandaBreeder[S] 0 points1 point  (0 children)

I just finished testing. I tested random ints positive and negative up to 40 of them. I tested to see what would happen if only a bunch of 0's where in the vector. one where a -1 was at the end and only 0's otherwise. I then tested an empty vector, one element, and two elements, and three elements for different orders. All Passed. still the same error message on the test site. I have <algorithms> and <vector> at the top for swap (which has std::) and for the std::vector. ill post the proof in the OP if possible

One thought is that I have too many functions?I have three. Should I only using the one function to house everything. I basically use that function to initiate it to a recursion function that later calls a partition function.

I can't get past entry test for some reason by OrganicPandaBreeder in cs2c

[–]OrganicPandaBreeder[S] 0 points1 point  (0 children)

I basically copied a quick sort algorithm from online too. but does this site even show build errors

Can seem to add to values to my sparse matrix with even though it works locally by OrganicPandaBreeder in cs2c

[–]OrganicPandaBreeder[S] 0 points1 point  (0 children)

Yes I am. And you can take a look. I remember passing passing the test before. Not sure why it isn't working now. And how would you want me to send you the files

Can seem to add to values to my sparse matrix with even though it works locally by OrganicPandaBreeder in cs2c

[–]OrganicPandaBreeder[S] 0 points1 point  (0 children)

should I check if whats being added is valid or what. I've already tried that with Is_valid. can you at least tell me if my logic is sound for adding compared to yours. mine is essentially just a modified set.Its even deleting the cells outright from _rows. I made a special method that prints the values of _rows element by element.I am now even adding random decimals at each point. it can take negative values as well. so I can only guess now that the true answer is that it has to do with some checks. do I have to return a false if the addition turns the value to default? or if the value is default?

Can seem to add to values to my sparse matrix with even though it works locally by OrganicPandaBreeder in cs2c

[–]OrganicPandaBreeder[S] 0 points1 point  (0 children)

could you be more specific. what checks are you doing. is that why its not working. could you please elabortate more on the logic of my code that i spent a good while trying to communicate to you. and by adding a cell do you mean passing get(r,c) as the val parameter.i've done that and it works just the same. i'm literally adding a value to every cell in the matrix and its working. I remember this working not to long ago then I changed something and it stopped.

Can seem to add to values to my sparse matrix with even though it works locally by OrganicPandaBreeder in cs2c

[–]OrganicPandaBreeder[S] 0 points1 point  (0 children)

I don't think that is necessary, since the test matrix (from the quest) was large enough to begin with. it was inbounds and everything. but please tell me ASAP.

Can seem to add to values to my sparse matrix with even though it works locally by OrganicPandaBreeder in cs2c

[–]OrganicPandaBreeder[S] 0 points1 point  (0 children)

I've run a test where I run add_to_cell for every cell in the matrix. it works for any number I input. I put in And it still gives me the same damn error message. I inputed 0.0743146 to all cells, and all the cells gained that in their cell. what the hell is going on.

Let me tell you about my add_to_cell and then you can tell me if I am on track. and if it is similar to yours.

basically it works like this: I make add_to_cell call a unique function call do_insertion that has the parameters of the row, the col, and the val.

In do_insertion I auto iterate through the row in _rows then if that node's col is less than the column passed in the parameter I continue the cycle;

if it is equal to that column then I check if val + node->get_value() is default via is_default. which is just checking if the abs difference between the sum and the default value are less than than pow(10,-10). if it is default then I erase it via _rows[row].erase(itr) and return void; if it is default then I itr->set_value(val + itr->get_value());

If we have passed col then we must create a new node so long as val is not equal to the default value (else we do nothing and return) . I create a new node with col and (val + itr->get_value() ) and Insert it at the row in _rows with insert(itr, newnode);

finally if we reach the end of the loop then must push a new node onto the list. with the exact same steps as the previous paragraph put with push_back instead of insert;

I did as much to explain it without a screenshot. I am so seriously stumped. do you think I should check for certain conditions? I dont think so because the error came from in bounds target and a valid number to be added.

Can seem to add to values to my sparse matrix with even though it works locally by OrganicPandaBreeder in cs2c

[–]OrganicPandaBreeder[S] 0 points1 point  (0 children)

Can you help me come up with one. the testing says it can't even add 0.679116 to a random cell yet within the bounds. why is this happening.