BinaryByter
just write the whole chunk instead of flushing after every byte
Anonymous
just write the whole chunk instead of flushing after every byte
Yeah, that. I was asking that what could be the optimal chunk size for fastest writing? Will it be machine dependent?
BinaryByter
no
BinaryByter
just write the whole file and then flush
BinaryByter
everytime you flush you lose time
Anonymous
i think 4096 bytes is a good choice but depends on you
Anonymous
I don't know what are you doing but you may write the entire buffer and just then flushing or closing the file if you don't need it anymore
Anonymous
so I don't know what is better for you
Anonymous
Most of the people i know are saying to learn Data structures and algorithms but none of them couldn't explain what i will be doing with that? So if i learn concepts such as Linked lists, stacks, queue, searching, sorting , hashing, trees , dynamic programming etc what sort of work would i do ? What type of companies would be interested based only on DS and algorithms? And if possible could u suggest some useful resources to master these concepts?
Jonathan
How do i fix this issue?
Jonathan
数学の恋人
Hello everyone!
数学の恋人
#include <bits/stdc++.h> int matrixElementsSum(std::vector<std::vector<int>> matrix) { int count = 0; for (int j=0; j<matrix[0].size(); j++) { for (int i=0;i<matrix.size();i++) { if (matrix[i][j]==0) break; count += matrix[i][j]; } } return count; } int main() { std::vector<std::vector<int>> matrix; int row, column; std::cin>>row>>column; std::cin.ignore(); for(int i=0; i<row; i++) { for(int j = 0; j < column; j++) { std::cin>>matrix[i][j]; } } std::cout<<matrixElementsSum(matrix); return 0; }
BinaryByter
klimi
@redhackthings i thought youre going to sleep but you just segfaulted xD
数学の恋人
lol
klimi
xD
数学の恋人
google what segmentation faults are
I know what segfaults are but my question is why???
BinaryByter
I know what segfaults are but my question is why???
I can't tell, I don't look at ugly code unless it's part of my projects
olli
Most of the people i know are saying to learn Data structures and algorithms but none of them couldn't explain what i will be doing with that? So if i learn concepts such as Linked lists, stacks, queue, searching, sorting , hashing, trees , dynamic programming etc what sort of work would i do ? What type of companies would be interested based only on DS and algorithms? And if possible could u suggest some useful resources to master these concepts?
While you most likely never need to implement the basic data structures you named in production, since they are implemented either by your compiler or library vendor, it is quite important to know them. Imagine yourself being asked to implement a tasking system comparable to the ones used by your operating system. With fundamental datastructure knowledge you could decide which and why to use a certain data structure to store the tasks. The same applies for algorithm, if you need to sort a nearly sorted array of elements, which algorithm would you prefer? And why? Knowing such things imho helps you to understand the problems and solve them efficiently.
klimi
xd
BinaryByter
well I hope that my code is halfway acceptable
BinaryByter
@OxFFFFFFFF told me that i'm the best coder he knows :D
数学の恋人
I can't tell, I don't look at ugly code unless it's part of my projects
You are saying that my code is ugly, well that's rude
BinaryByter
he didn't
klimi
my code is even more uhly
Marie
You are saying that my code is ugly, well that's rude
You are saying that my code is ugly, well that's true
BinaryByter
what aobout qneko
I was just joking :D
klimi
i think he was too
Ибраги́м
BinaryByter
Worst sarcasm in the whole of EU
given that memes are forbidden, it's not that hard to be bad sarcasm
klimi
s/true/rude
cannot reply to bot message bot itself
数学の恋人
cannot reply to bot message bot itself
oh that's why it didn't work, didn't know that
数学の恋人
K I'll try to figure out
klimi
i like python
olli
1) indent correctly 2) make your functiosn smaller 3) for the love of god, don't abuse the main fucntion like that 4) foreach loops are a thing 5) dafaq is bits/stdc++? 6) pass vectors by reference 7) ALWAYS ITERATE OVER VECTOR SIZES IF YOU DON'T WANT TO DIE
bits/stdc++ is like the whole STL in a single header provided by libstdc++. Convenient for competition where time is limited and you don't want to include multiple headers :D
MS
really?
数学の恋人
who. the. fuck. thought. that. that's. a. good. idea?
People who are intelligent than you, maybe
olli
who. the. fuck. thought. that. that's. a. good. idea?
For time constraint events it's really convenient. bits/stdc++ is like a list of includes :D
BinaryByter
People who are intelligent than you, maybe
peopl ewho are intelligent like to waste resources?
数学の恋人
No obviously not
BinaryByter
What do you mean by 3)
THE MAIN FUNCTION DOESNT WANT TO BE RAPED BY 10 LINES OF FUCKING CODE
olli
Linux GCC 4.8.0 /bits/stdc++.h header definition. https://gist.github.com/eduarc/6022859
数学の恋人
BinaryByter
So I should make it smaller, right?
you should only use it to call a few functions
BinaryByter
it's just an entry point
BinaryByter
not the local dumpster
数学の恋人
Don't be rude I'm just asking you a question
BinaryByter
i'm not rude
数学の恋人
Okay I'll do that
数学の恋人
Thanks for the advice
BinaryByter
sure
数学の恋人
Now tell about segfault.
BinaryByter
start by solving all of my points
Ибраги́м
BinaryByter
then you have already solved your segfault
BinaryByter
Ba D for Matt ing kills
do you need to throw up or anything?
数学の恋人
Maksym
hi there! i'm trying to implement my own program like paint, but i can't make Bucket function. I'm using MFC C++ Here my function code
Maksym
i'm trying to test it on area filled with black color but it doesn't work(
Maksym
google "flood fill"
i googled it, but why ExtFloodFill doesn't word? I think it must done it
Shubham
👍🏻👍🏻
Shubham
Does this group discuss about google summer of code?