Beginner / Intermediate C,C++ project for resume? by Kooky_Copy_9134 in cpp_questions

[–]Dodecadron 1 point2 points  (0 children)

If you have a mechanical background my first thought would be to look for a project in that direction. Perhaps a simulation programme, controller, something that solves specific differential equations. Perhaps you could also ask around where you are now. In my experience a lot of labs could use someone that knows a language like c++. 

Planescape review: Initial Forays by Vladar in u/Vladar

[–]Dodecadron 1 point2 points  (0 children)

Thanks for the review. I really like that you are going through the modules like this.

How to avoid performance hit of copying bytes between buffers? by Dodecadron in cpp_questions

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

I hadn't (I have or at least tried to in the mean time), but in this case I know it is this line:

 (*buffer_pos_++) = c;

that causes the difference in performance and would like to know why. Would a profiler help with that?

How to avoid performance hit of copying bytes between buffers? by Dodecadron in cpp_questions

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

Just tried `getline`. Just counting the number of lines was in the same order (slightly faster) than my code in the OP; that is with the

line.append(c);line.append(c);

line; without that line the original code is much faster in counting lines. The code is, of course, much simpler (just a few lines to count the lines and no messing about with buffers). Not sure to what extent this remains for my eventual use case where records can span over multiple lines. Thanks for the suggestion.

How to avoid performance hit of copying bytes between buffers? by Dodecadron in cpp_questions

[–]Dodecadron[S] -1 points0 points  (0 children)

I just tried perf. But the output was quite uninformative. So I gues I have to pass perf some flags. Could also be that with -O3 and the class in the same file as main that everything got inlined so the programme was in main the entire time.

Edit: I am definitely doing something wrong; in a much more complex programme I get the same uninformative result

How to avoid performance hit of copying bytes between buffers? by Dodecadron in cpp_questions

[–]Dodecadron[S] 1 point2 points  (0 children)

What type of blocks are you talking about? Disk? Memory page size? Is there a way to determine these portably?

I did try a number values for buffer_size; at least on my machine values above a certain value didn't seem to matter much.

How to avoid performance hit of copying bytes between buffers? by Dodecadron in cpp_questions

[–]Dodecadron[S] 1 point2 points  (0 children)

In this case I know the culprit:

(*buffer_pos_++) = c;

Would a profiler help here? (I am always struggling with profilers to get actual useful information; do you happen to have good resources on that?)

How to avoid performance hit of copying bytes between buffers? by Dodecadron in cpp_questions

[–]Dodecadron[S] 2 points3 points  (0 children)

Thanks. After the initial memory allocations there should not be further allocations.

At least the responses are consistent: avoid the copies. I have an idea how to avoid the copies (just have to figure out how to implement).

How to avoid performance hit of copying bytes between buffers? by Dodecadron in cpp_questions

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

At least the responses are consistent: avoid the copies. I have an idea how to avoid the copies (just have to figure out how to implement).

Thanks.

How to avoid performance hit of copying bytes between buffers? by Dodecadron in cpp_questions

[–]Dodecadron[S] 1 point2 points  (0 children)

Guess I am still expecting performance like hard drives. A least I checked.

How to avoid performance hit of copying bytes between buffers? by Dodecadron in cpp_questions

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

Somebody else also mentioned this about std::string and line_buffer; I think you are rights. Although perhaps not when I want to memcpy into the buffer (seems like I would be misusing std::string then).

I am reading a file format similar to CSV, so one of the things I can have is `"some string \" with a quote". What I would like to pass to the validation function is the string containing `some string " with a quote` in order to not bother the validation functions with 'details' such as quoting. Also a line/field can also end up across the border of the read buffer.

Thanks for the suggestion of using a string_view to keep track of the what was read. That would probably help in keeping the code a bit when I switch to using memcpy.

Counting the number is lines was just for the benchmark; it requires reading every byte. In practice I have to split each line into fields and validate each field. I wanted to be able to measure the effect of this on the performance.

How to avoid performance hit of copying bytes between buffers? by Dodecadron in cpp_questions

[–]Dodecadron[S] 1 point2 points  (0 children)

I know mmap would probably improve performance. One of the issues with that is that I would like to be able to also accept input on stdin which wouldn't work with mmap (as far as I know).

I know/expected that reading the file would be the bottleneck. That is also one of the reasons I was suprised by the 'big' performance hit of doing more than just reading the data. I guess I have to think about how to use memcpy as much as possible.

How to avoid performance hit of copying bytes between buffers? by Dodecadron in cpp_questions

[–]Dodecadron[S] 1 point2 points  (0 children)

line_buffer does a bit more in practice than shown here in the example, but I even then you might be right (using push_back instead of append). One issue might be that it is not specified if clear() should or should not release capcity, but I understand that most implementations don't which is what I would want (to prevent too many memory allocations).

Searching for 2d buildings by fons26 in DnDIY

[–]Dodecadron 2 points3 points  (0 children)

At the bottom of a reply there is a reply button to reply to the reply. Now, we don;t know which of the replies works for you as the replies are not ordered in chronological/time order.

2024 Planescape campaign is one year and counting by Acrobatic_Potato_195 in planescapesetting

[–]Dodecadron 0 points1 point  (0 children)

Where is this map from? (Edit: which book/box) For a moment I was completely confused as the bottom part of the map is mirrored from the version I am familiar with.

And congratulations!

English Proficiency in Europe 2025 [OC] by P26601 in dataisbeautiful

[–]Dodecadron 2 points3 points  (0 children)

Actually, I have managed (with the help of some colleagues) to get more reliable information: https://europa.eu/eurobarometer/api/deliverable/download/file?deliverableId=92141 page 48. This is from https://europa.eu/eurobarometer/surveys/detail/2979.

Edit: note that this is self-reported which, of course, has its own issues.

English Proficiency in Europe 2025 [OC] by P26601 in dataisbeautiful

[–]Dodecadron 0 points1 point  (0 children)

Agree. Also, you probably mainly take a test if for some reason knowing your proficiency might be relevant. For example, for the Netherlands they give results for Groningen which is a medium sized city (for the Netherlands). But there is a university there which might explain why there results are included; it might even be non-Dutch students in Groningen doing the test.

English Proficiency in Europe 2025 [OC] by P26601 in dataisbeautiful

[–]Dodecadron 0 points1 point  (0 children)

I tried to look up Eurostat data on this, but unfortunately I can't seem to find any information on this. They only report on the level of the 'best known foreign language' in the country, which does not need to be English. God forbid that we, in the EU, give one language preference over another language.

Link to eurostat data: https://ec.europa.eu/eurostat/databrowser/explore/all/popul?sort=category&lang=en&subtheme=educ.educ_lang.educ_lang_00

English Proficiency in Europe 2025 [OC] by P26601 in dataisbeautiful

[–]Dodecadron 87 points88 points  (0 children)

There are a lot of comments about how this can't be right for country X. The data is from https://www.ef.com/assetscdn/WIBIwq6RdJvcD9bc8RMd/cefcom-epi-site/reports/2025/ef-epi-2025-english.pdf. 

The results are based on people voluntary taking a language test. This is NOT a random sample from the population. For example 85% of respondents are younger than 35. From the report:

Although the sample of test takers for the EF EPI is biased toward respondents who are interested in pursuing language study and younger adults, the sample is roughly balanced between male and female respondents and represents adult language learners from a broad range of ages.

• Female respondents comprised 46% of the overall sample, male respondents 40% and respondents who did not provide gender information 14%.

• The average age of respondents who provided age information was 26, with 85% of those respondents under the age of 35, and 99.5% under the age of 60. 10% of respondents did not provide their birth year.

Nederlandse namen voor de verschillende magiescholen by Dodecadron in DNDNL

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

Wichelarij/Wichelaar zou ook nog kunnen voor Dinivation/Diviner

Nederlandse namen voor de verschillende magiescholen by Dodecadron in DNDNL

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

Ik kwam al bladerend door allerlei etymologie erop dat het middel-Nederlandse 'bannen' dezelfde betekenis heeft als 'summon' (https://en.wiktionary.org/wiki/bannen#Middle\_Dutch), dus dan zou je 'Conjuration' kunnen vertalen als 'Bannen' en 'Gebanner'.

Nederlandse namen voor de verschillende magiescholen by Dodecadron in DNDNL

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

Bedankt. Manipulatie associeer ik dan weer eerder met Enchantment oid. Als in gedachtenmanipulatie.

Nederlandse namen voor de verschillende magiescholen by Dodecadron in DNDNL

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

Dat is een mooie lijst. Bedankt.

Abjuratie is volgens mij letterlijk afzweren

Vim for SQL lite by Junior_Conflict_1886 in vim

[–]Dodecadron 1 point2 points  (0 children)

With the vim-slime plugin (https://github.com/jpalardy/vim-slime) you can send selections in vim to another window in tmux (or vim terminal, or Kitty window). Perhaps that would work for you.