« first day (3083 days earlier)      last day (1848 days later) » 

12:44 AM
One study found that if ants were prevented from removing the dead bodies, they were more likely to die. However, Indian jumping ants have a slightly different method – their nests include a "rubbish" chamber which is filled with dead ants, left over prey and faecal matter. These chambers are staffed by a "sewage crew" of maggots that eat the refuse and prevent the chamber getting clogged.
Almost 100% of rubbish generated by animals are bio-degradable.
 
1:04 AM
California will be officially assimilated in 2040-something.
 
You need to investigating things you were investigating in 3D instead. There are a few methods for doing that. Camera can not capture real world in 1 shot.
 
2:04 AM
@TelKitty people with only 1 eye seem to do just fine.
also, 56 degrees today! t-shirt weather is here!
 
2:16 AM
People with no eyes will do fine as well.
@ABuckau Sounds like pet fur shedding season.
 
3:15 AM
You have a twisted definition of fine.
 
There seems to be too many definition for the word 'fine'.
A fine or mulct is money that a court of law or other authority decides has to be paid as punishment for a crime or other offence. The amount of a fine can be determined case by case, but it is often announced in advance. The most usual use of the term is for financial punishments for the commission of crimes, especially minor crimes, or as the settlement of a claim. A synonym, typically used in civil law actions, is mulct. One common example of a fine is money paid for violations of traffic laws. Currently in English common law, relatively small fines are used either in place of or alongside...
So yes fine can be twisted ...
^ I can not seem to figure out what this is ...
Head of a horse, body of a dog.
 
4:12 AM
A horse, according to the news story.
@TelKitty Seems fine to me!
 
@JerryCoffin Compared to the leaves and grasses nearby, it seems to be a very small horse :x
 
5:12 AM
@TelKitty Yeah, my guess would be closer to pony than horse.
 
5:54 AM
@JerryCoffin Yes, more like a pony - longer fur
But I guess it's more sensational to use the word 'Horse' - :
Fire crews rescue horse from ditch
vs
Fire crews rescue pony from ditch
 
 
1 hour later…
7:08 AM
@TelKitty wth are you reading dude
 
7:51 AM
@A.H. One of those random places on the internet ...
 
hard at procrastination ?
 
8:34 AM
Hello
I asked a question here a while ago
Sun 21:12
No idea how to provide a link to the message
Since there was no answer here I decided to ask it on the stackoverflow main website
Any help would be appreciated
 
9:04 AM
@JerryCoffin It doesn't look very alive.
Oh wait, now I see its face.
 
 
1 hour later…
10:09 AM
hi
I was reading the code at solarianprogrammer.com/2014/08/21/cpp-14-auto-tutorial in specific auto& add_one(std::vector<int>& v) {//...}
Why would someone want to return a value by reference? Is it faster when returning an object? I don't see much of a difference?
 
@northerner returning a pointer to some data vs making a copy of data.
 
it's the same scheme you see in the std stream operator << overloads, you return one of the parameters by ref so you can chain the calls,
 
So generally an object should be returned by reference instead of a copy. Isn't that right? It seems like it would be a waste to make it, copy it, then destroy original instead of just returning the one made/mutated.
 
depends on a few factors
if it is a local variable then return by value, copy elision will happen to eliminate the copy you would need.
if you return a field then it depends on whether you want the caller to have access to a view of the field or always give it its own copy
for returning parameters if the parameter is by value then return by value, if by ref you can return by ref
 
10:45 AM
thanks
 
 
2 hours later…
12:45 PM
@A.H. Learning is hardly of waste of time. You can hardly have too much knowledge.
 
1:41 PM
ok, I gotta ask. How mad would you be if someone made a proposal to allow nested structural binding? so if pair<int,pair<int,int>> func(); could be used like auto [a,[b,c]] = func(); :P
 
@StackedCrooked Is this for real??
@PeterT (laughs in Clojure) That's just run-of-the-mill destructuring!
 
@fredoverflow I know that nested destructuring works that way in many more dynamic languages. Works that way in python too
But for C++ that would mean a change in the syntax.
You can always do it in multiple steps or with `std::tie` but there's some limited use-cases where doing it in one line might be neat
 
@PeterT Sure, go ahead and propose!
 
I imagine you can always discuss if auto [a, auto&& [b,c] ] should be supported too while touching it, hehe
 
nwp
Better do some research first. Figure out if the original paper has a reasoning why it's not allowed. Figure out if there are failed proposals in that direction and the reasons for failing. And then it turns into work and you don't want to do it anymore :D
 
2:01 PM
@nwp Did you just divide a numerator by a denominator? 'cause that sounds way too rational...
 
nwp
You can always just eat some pi and just do it.
 
Well p0144r2 says
`We think the answer should be “not yet.” This could be a future extension, following experience with the basic feature and in languages like Python.`

Also, I never said *I* wanted to propose it :P . I believe there's also a bunch of pattern matching proposals that people are working on
maybe one of those will essentially allow that
 
@PeterT You could propose a one-liner on April 1st :)
 
nwp
When someone comes asking why C++20 and C++23 still don't have destructoring I will show them this conversation.
 
@nwp Is the typo part of the joke? :)
 
nwp
2:11 PM
No, I'm just bad. Yes, yes. Ha ha.
 
 
1 hour later…
3:15 PM
Hi Ronny
 
nwp
3:39 PM
Why am I forced to use __debugbreak(); instead of breakpoints?
Why can't debuggers just work?
 
@nwp wat
 
nwp
Can't put a breakpoint in a lambda because that's too complicated. I end up breaking at a completely different place. __debugbreak(); breaks at the right place, but requires recompiling.
I probably should not be using MinGW.
 
@nwp VS2017? In release mode?
 
nwp
No, MinGW gcc 7.3 in debug mode.
 
odd... that should work, it shouldn't inline the lambda until release mode
 
nwp
3:47 PM
It's supposed to work with inlining too, especially when the lambda is only called in one place.
 
GDB?
tbf I'm honestly horrible with GDB
 
nwp
Yes. The Qt maintenance-tool one.
GDB is not so bad when you have an IDE frontend. At least when it works.
I wouldn't be able to use CDB either, but with VS it's easy enough.
 
try adding -ggdb to your compile options
it should increase the debug info
 
nwp
It's actually compiling at -O1 because it hits some limit otherwise. Let's try it again though, maybe it fixed itself.
C:/Qt/Tools/mingw730_64/bin/../lib/gcc/x86_64-w64-mingw32/7.3.0/../../../../x86_64-w64-mingw32/bin/as.exe: debug\scriptsetup.o: too many sections (52944)
C:\Users\tr\AppData\Local\Temp\ccEpBBwQ.s: Assembler messages:
C:\Users\tr\AppData\Local\Temp\ccEpBBwQ.s: Fatal error: can't write 120 bytes to section .text of debug\scriptsetup.o: 'File too big'
C:/Qt/Tools/mingw730_64/bin/../lib/gcc/x86_64-w64-mingw32/7.3.0/../../../../x86_64-w64-mingw32/bin/as.exe: debug\scriptsetup.o: too many sections (52944)
Does not seem fixed.
 
4:12 PM
are there any golfie ways to check if an index exists in a vector?
 
nwp
-Wa,-mbig-obj fixes the build error and then breakpoints actually work. And it "only" added another 30s or 5ish % build time.
 
@nwp how did you get "Too many sections"!?
Try adding -mbig-obj
 
nwp
I could blame sol2 and lambdas, but I'm gonna blame the compiler instead.
 
37
A: Object file has too many sections

David GraysonThe solution is to add the option -Wa,-mbig-obj if your version of GCC supports that option. You probably only need it during the compilation step, not the linker step. If your compiler does not support that option, you should look into using mingw-w64 and MSYS2.

 
nwp
You seem to have missed this.
 
4:24 PM
@nwp and?
 
nwp
And it already includes your suggestion and the suggestion in the link and the result. So I'm confused why you suggest things that have already been tried successfully.
 
@nwp didn't seem you were using it?
 
@Rick umm size?
 
nwp
And I fucked my git repository.
I'm gonna cry.
 
4:39 PM
@nwp did you delete .git?
otherwise it should be recoverable
 
nwp
No. I wanted to switch branches from dev to bugged so I can commit my changes without hindering others. I stashed, switched, popped. Seemed reasonable at the time. Except bugged was not up to date with dev so I just got a mishmash of code and I'm afraid my stash is gone.
Apparently you can just stash pop twice.
 
4:59 PM
@A.H. I was hoping for something like vec.push_back(null) vec[i] == null
 
vec.push_back(null), vec[vec.size() -1] == null ?
 
5:33 PM
@StackedCrooked Queue the Monty Python "I'm not dead yet" skit...
@Rick A vector enforces contiguity, so all indices from 0 through size()-1 are always valid. If you want a sparse array (where some in-range indices may be invalid) you might want [unordered_]map<size_t, whatever>.
 
@JerryCoffin I think the map might be more appropriate
 
@Rick Certainly can be, especially if you want to be able to easily iterate from some arbitrary point A to another arbitrary point B.
 
5:49 PM
@JerryCoffin how does the underlying heap order the map? is it insertion order
 
Or if you wanted to badly enough, you could build it with knowledge of the contained objects, and try to keep them in sorted order (at least chunks in sorted order).
@Rick I'm not sure what you're asking. Are you asking about the order of the elements in physical memory? If so, there's no real answer. std::map uses an Allocator object to allocate nodes in the tree. It's up to the allocator object to choose addresses for nodes. You can, however, create an allocator object that at least tries to allocate nodes in insertion order, if that's what you want.
If you don't specify otherwise, it'll use std::allocator<T>, which just uses operator new to allocate memory--and in that case, the addresses you get aren't specified.
 
nwp
6:06 PM
I think the answer to what he means is that elements are essentially ordered by < when iterating, unless you specified a different comparison function.
 
@JerryCoffin is there some sort of typecasting in a map. When I use a std::map<char, int> and I use strings ints as keys they are ordered and If as I add a letter it's always last. This seems to be consistent with other languages and their implementation of the map.
 
@Rick std::map is ordered by key. What exactly do you mean by "strings ints as keys"?
 
@fredoverflow *string ints
 
that's just lexicographical ordering on strings which works out with ints though it may differ with leading zeros
 
6:21 PM
You can't use "string ints" (whatever that's supposed to mean) as keys in a std::map<char, int>, only chars.
 
@fredoverflow *char ints
 
You mean like '0' to '9'?
 
6:45 PM
@fredoverflow correct
 
Those will be ordered "numerically" in a std::map.
 
@fredoverflow and if you use 'a' and 'b' as keys those are ordered by?
 
'a' is 97 and 'b' is 98 in most character encodings, so 'a' will come before 'b'.
ASCII ( (listen) ASS-kee), abbreviated from American Standard Code for Information Interchange, is a character encoding standard for electronic communication. ASCII codes represent text in computers, telecommunications equipment, and other devices. Most modern character-encoding schemes are based on ASCII, although they support many additional characters. ASCII is the traditional name for the encoding system; the Internet Assigned Numbers Authority (IANA) prefers the updated name US-ASCII, which clarifies that this system was developed in the US and based on the typographical symbols predominantly...
 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~
^ That's how your chars are most likely going to be ordered, unless you run on a very weird system using EBCDIC or something.
 
7:12 PM
i@rick
if they are string ints, why not just ints?
 
7:37 PM
In a makefile I see #if defined(EXERCISM_RUN_ALL_TESTS) which prevents some stuff from running
How can I get that stuff to run without editing the makefile
I tried make EXERCISM_RUN_ALL_TESTS=1 but that didn't work
Pardon me, that's in a .cpp rather than the makefile
 
you mean #ifdef ?
 
#if defined(EXERCISM_RUN_ALL_TESTS) ... #endif
 
you need to pass to (assuming gcc) -DEXERCISM_RUN_ALL_TESTS, do you still mean without editing the makefile or without editing the cpp file
 
8:01 PM
@fredoverflow if you use map keys string as int's, they are ordered. it's just that they are ordered by their char in the string. for example keys '1',-> '11' ,-> '12' ,-> '2' ,-> '21' ->'22' . it builds the tree by the order of the chars, I think. so 1 is the parent of all strings which begin with 1 and so on
I think it's an red balck tree
*a Red black tree
in my personal opinion, they should use a b-tree
and upgrade from the antiquated deficit inducing rb tree.
 
8:27 PM
@Rick B-trees do have advantages, especially for large collections. If you want them, you can get collection classes based on B-trees. They do have a few disadvantages though, such as potentially invalidating iterators that would remain valid with an RB-tree implementation.
I do have to agree with the basic idea though. They're nearly always faster and use less memory, which is usually more important than ever so slightly stronger guarantees about iterator invalidation.
 
rust uses b-trees and they have iterators
https://doc.rust-lang.org/std/iter/trait.Iterator.html#method.map
 
@fredoverflow is using @ to refer to 'HEAD' a normal git thing, or some magic you've added locally?
Also, what is you lol alias?
 
9:01 PM
@Rick it also panics if you look at it wrong
 
@Mgetz O_o
 
9:38 PM
@Rick Sure. The problem isn't just B-trees with iterators. It's just that there are situations where iterators can remain valid with an RBtree, but will be invalidated with a B-tree. For the most part, a B-tree based version potentially invalidates all iterators on any insertion, about like a vector. But, most people have no problem with vector doing that either.
 

« first day (3083 days earlier)      last day (1848 days later) »