« first day (1870 days earlier)      last day (3292 days later) » 

04:00
@MooingDuck lol
I was kidding, but I didn't know that people were so against scanf
@ScottW Also, it's frustrating how easy some are (pizza) compared to others (bubbles)
@ScottW Also most animations are now unskippable :(
@ScottW yes. troll pizza throwing and such used to be skippable
I wished even more was, but now nothing is
@ScottW Yeah, once they finish talking, you click anywhere and the pizza teleports to it's destination and you could immediately spit out the next pizza.
Ell
Ell
I loved zoombinis as a young'un
@Ell the blue characters?
user406009
04:12
Wow, I can't believe I still vaguely remember that game.
user406009
I just remember getting real pissed when I was down to only a few of those people.
hi guys
anyone here?
what is up?
04:34
How do I write this? I think there is a nicer way but can't recall it right now.
while ((helper + 1)->x == left_bottom.x) helper++;
user406009
What is helper?
user406009
Also, you could probably just do helper[1].x
Assume RAI
Instead of '+ 1'->? Not what I am looking for, but thanks. I think I saw this same idiom but nicer in some gnu stuff.
user406009
What exactly are you looking for?
That's what I can't remember. I think there is a much neater way to express that whole loop.
user406009
04:37
I repeat my question, what is the variable declaration of helper?
My mind may be playing trick on me, it's late.
I repeat my answer, assume it is a random access iterator.
user406009
Oh, that's what you meant by random access iterator.
Ell
Ell
@MooingDuck no Linux support :/
@Ell supports Android but not Linux? Wierd.
user406009
@mafagafogigante You can use std::find_if instead of your loop.
user406009
04:39
It looks like you are looking for the first item which has an x which does not equal left_bottom.x?
The last that is.
@mafagafogigante std::find_if_not
wait, no
Yeah, I thought about it when you first mentioned find_if
oops, different guy
@mafagafogigante is at-the-end a concern?
It will depend on input.
More robust is better.
I will end up using an std algorithm, just need to pick the right one.
04:41
yeah. std::prev(std::find_if_not(
ish
gotta have a check between those to make sure you dont' iterate past the beginning
also if the element was not found
but that's the idea
Yeah, problem is, at least to my eyes this is not much cleaner than what I have now.
But is better.
@mafagafogigante yeah. not much
user406009
04:54
The more important part would be writing a comment explaining what the loop does.
Variable names should suffice here. Helper is a temporary one, of course.
Point left_top = *std::prev(std::find_if_not(helper, v.end(), [&left_bottom](It helper){return helper.x == left_bottom.x;}));
Readable as a brick wall.
user406009
I would still say it is more readable than the while loop.
If you are used to Python list comprehension, this is sheer bull shit.
user406009
What would be the "cleaner" Python "equivalent"?
user406009
IIRC, you can do filter and map with Python list comprehensions, but not find like operations.
05:00
I didn't mean an equivalent, just made a comparison.
user406009
Yeah, but Python does tend to have nicer syntax than C++ for most things.
@Lalaland filtering gives you find
user406009
Yes, but at an additional memory cost?
user406009
Actually wait, with Python generators, getting the first item of a filtered list comprehension might actually be OK.
@Lalaland oh sorry I had generator syntax in mind, since well it’s the same
we’re looking at more or less last . head . group but C++ has nothing like group
user406009
05:04
std::partition is probably as close as you can get in the C++ standard library.
there is an itertools.groupby in Python-land
user406009
groupby (or group) is a very nice tool to have. It would be nice to have that in the standard library as well.
I don’t know if all this fuses/meshes well though
collections.deque((x for x in data if x[0] == magic), maxlen=1).pop()
Did not benchmark, would not use. By no means much more readable than what I have in C++ right now.
groupby(x, blahblah key)[0][-1]
user406009
05:06
(x for data if x[0] == magic)[-1]
@Lalaland TypeError: 'generator' object is not subscriptable
good point
IIRC, deque has some arithmetic size-logic stuff that would make my code OK
No idea about @LucDanton perf, never used it for that.
user406009
Anyways, once you start to play these shenanigans, the while loop begins to look better and better.
There is the law of diminishing returns though.
05:09
@Lalaland what’s wrong with last . head . groupBy proj!
ya know maybe head . concat . drop 1 . groupBy proj is the nicely fusing version I was looking for—oh that ends one step too far
select * from data where x == magic order by y desc limit 1; -- I think the syntax is correct
But for declarative, that's pretty shitty.
anyways, head probably kills sharing in the larger picture so if drop 1 does not do it then splitAt 1
user406009
@LucDanton And that demonstrates exactly what I don't like about Haskell. The performance of your code varies widely based on "arbitrary" things.
@Lalaland FUD, doesn’t even apply here
stacking list algos is the same as stacking iterator algos or writing your loops the right way around
i.e. we want to reach the element we care about in n steps don’t we
that won’t happen by itself, you have to be careful
user406009
Eh, it's just that tracking down thunk leaks gets tiresome by about the sixth one.
user406009
05:15
Although to be fair, that was also mostly due to using a 5 year old version of GHC.
Spent so much time here about this little shenanigan that it got its own function. I am not sure about its name, though.
Point left_top = *find_last_that(helper, v.end(), [&left_bottom](It helper){return helper.x == left_bottom.x;});
I’ll keep in mind not to use the word 'sharing' around you so that you don’t shoot off into FUD
I was tracking algorithmic complexity
user406009
@mafagafogigante Do you have them sorted in some way? Isn't there a risk that one of the ones with the same x is farther in the list?
user406009
Sorta like [Good, Good, Bad, Good, Bad, Bad, Bad ...]
I am accepting O(n lg n) for a reason.
user406009
05:21
You might not actually get the last "good" one.
Yes, sorted using (I don't remember what n lg n algorithm gcc uses).
I would guess quick sort
but may be wrong
How does GCC compare to other C++ compilers nowadays?
user406009
I would just note that this might be a good use case for std::partition. Depending on your exact algorithm of course.
if sorted then consider std::equal_range & friends
(make sure it’s sorted correctly against the projection etc.)
equal_range & projections is kinda weird though isn’t it? you have to build a 'dummy' value
I don't think it would add anything now.
std::equal_range(x, end, *x) or something
05:25
After encapsulating the weird stuff into find_last_that I'm happy.
@mafagafogigante std::find_if + std::reverse_iterator?
Sorry?
I don't think the compiler will solve it in runtime.
Image about 10K values.
5 good on each tip.
hey bully
06:00
hi
aw yis i think ive found my next wallpaper
06:28
@ScottW heeeey
@ScottW enjoying life, breaking free of the jigsaw puzzle I worked on for a few hours tonight
@ScottW you?
@ScottW We're all good. Gonna have Thanksgiving dinner tomorrow because my sister needed to spend Thanksgiving elsewhere
@ScottW awh
had this for dinner tonight.
Along with my haircut that's pretty much everything exciting in my life right now
07:04
@ScottW will post pic of removed hair
@ScottW nice!
@ScottW yep
@jaggedSpire oh no your hair, my condolences
@LucDanton but it's so much lower maintenance now! :D
@ScottW all dem SNES games
which is your fav
I never managed to play through that. I should try again at some point
oh god I love smrpg
When I was a kid I had... megaman x, super metroid, street fighter, killer instinct and smw
I might have had a couple of other ones but I don't remember
chrono trigger was a p good rpg
 
1 hour later…
08:37
@ScottW WOOF
09:09
lol
the kind of ads you get when you are browsing $50k land for sale
hi @chmod
What sized fonts do you guys use when programming
09:25
The 2016 Bugatti Vision
@BartekBanachewicz ^
c++ errors are so shit
most of them are only slightly better then "SOMETHING'S WRONG!"
09:48
of course it works with gcc, but not clang. GRRRRRRRRRRRRRRRRRRR
09:59
lol++
That bugatti looks so wicked
We offer pedegrees in dantry.
@Prismatic They mean « Have some insight about what you wrote, lol! » and offer some more.
This is the second clang bug I've filed
@Prismatic I haven't filed one yet. When I had things not compiling with clang++ but g++ was fine, it appeared that clang++ was the right one everytime :/
My last one was a legit bug, either way it'll be nice to find out what the issue is
If anyone wants to comment, here's a minimal repro of the issue:
10:19
Ah, somehow I miss 2007...
Static integer members in a nested class require explicit definitions separate from declarations
But because they are ints I think you should be able to declare and define them inline... gcc allows it
Actually, they don't need the explicit definition if they are only used to define the size of an array for example.
Like, you don't need to explicitly define them as long as you only use them in constant expressions.
essentially you don't need to define const integer statics if you don't need their address
Makes sense.
10:29
The member shall still be defined in a namespace scope if it is odr-used (3.2) in the program and the namespace scope definition shall not contain an initializer.
And of course the definition of odr-used is confusing mess I can't parse
ah well
I rarely read standard to find out what does a term mean. It's too incomprehensible most of the time
@Prismatic Not a bug.
« ODR-used » means « why don't we have modules yet? » in strawman syntax.
make_unique takes its parameters by reference, which means they must have an address.
which means they must be defined.
you can only get away without defining them if (essentially) they are not referenced, only used as values.
IOW passing to make_unique definitely qualifies as odr-used.
So is gcc allowing it a bug then?
10:39
yes.
or possibly just a legit extension.
@Prismatic They'll probably call it a feature and tell you they can't realistically get rid of it without breaking plenty of existing code (if you try to submit a bug report that is).
@Morwenn sounds pretty Microsoft-y
@Prismatic GCC doesn't like to break compatibility when it doesn't really hurt either. Some library features are tweaked to support extreme cases of hackery and they try to maintain that.
user1804599
10:58
Hi, sluts.
Hi, slut.
user1804599
I have this really weird thing.
I always wonder how that guy manages to pull out dance moves that look so awesome while the original moves obviously come from swing, shuffle and Tektonik.
user1804599
When I remove a SECTION from my Catch TEST_CASE, the next section succeeds. When I leave it, the next section fails.
user1804599
And I don't use a any global state.
11:03
UB
user1804599
Is this UB?
user1804599
auto ptr = static_cast<object*>(operator new(sizeof(object) + sizeof(void*) * field_count + auxiliary_data_size));
ptr->gc = this;
possibly.
@milleniumbug Yeah, UB in another unit, called from another thread :)
but there's a reason why Wide doesn't use Catch and it's for inter-process test isolation
user1804599
11:05
object has private fields that are all POD, and no base classes, and no virtual functions, and no public or protected fields.
I feel particularly evil this morning:)
user1804599
Let's try Valgrind.
user1804599
Valgrind found UB!
user1804599
In my garbage collector!
user1804599
==1661== Invalid read of size 8
==1661==    at 0x4EAA680: std::_Rb_tree_increment(std::_Rb_tree_node_base*) (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.20)
==1661==    by 0x409D5E: std::_Rb_tree_iterator<std::pair<confx::object* const, std::unique_ptr<confx::object, confx::gc::operator_delete_de
lete> > >::operator++() (in /vagrant/_build/a.out)
==1661==    by 0x409315: confx::gc::collect() (in /vagrant/_build/a.out)
11:10
I'm surprised that nobody has ever done valgrindcore music.
user1804599
inb4 this is a bug in libstdc++
probably not
user1804599
Let's see.
user1804599
Maybe it's indeed because I delete elements from a map while iterating it @Ven.
maybe you're going out of bounds or sth
@Elyse be careful
user1804599
11:12
> References and iterators to the erased elements are invalidated. Other references and iterators are not affected.
nice, std::map::erase returns an iterator in C++11
user1804599
auto objects_begin = objects.begin();
auto objects_end = objects.end();
for (auto it = objects_begin; it != objects_end; ++it) {
    if (!reachable_objects.count(it->first)) {
        objects.erase(it);
    }
}
yet another reason I'd rather write Java than C++03
user1804599
Valgrind blames the third line in this code.
possible fix: it = objects.erase(it);
user1804599
11:15
Yeah, maybe. :) Let's try that.
user1804599
Oy vey.
user1804599
Vagrant so slow.
this implicitly does ++it, so don't do that twice
user1804599
Isn't there a standard algorithm that takes a predicate and erases elements from a map?
possibly in experimental
user1804599
11:17
auto objects_begin = objects.begin();
auto objects_end = objects.end();
for (auto it = objects_begin; it != objects_end;) {
    if (!reachable_objects.count(it->first)) {
        it = objects.erase(it);
    } else {
        ++it;
    }
}
user1804599
@milleniumbug Thanks.
user1804599
Now gonna test cycle collection.
user1804599
In Rust, objects.erase would take it by value, so the compiler checks it won't be used afterwards. :P
user1804599
11:23
Why never use safer languages: you crave the missing checks when programming in unsafer languages.
@Elyse why do you have auto objects_begin and objects_end
user1804599
Because only having objects_end is ugly.
you're ugly
user1804599
I'm pretty sure I'm less ugly than you.
I mean why not use objects.begin() and objects.end()
user1804599
11:26
Because calling objects.end repeatedly is possibly inefficient.
that's... a pretty terrible reason.
user1804599
who cares. stop bikeshedding.
oh noes, how could I prefer simple, maintainable code over pointless obscuring non-optimization?
@ElimGarak hi
You guys ever work on one thing, but then you have to do something else to continue working on your original problem, but then when you finish that something else you forget what you were working on in the first place
11:31
yes.
it happens all the time at work now
Man it is not a good feeling. Makes me feel really old
To make it worse, I noticed that I actually can barely read anything on my screen at all if my left eye is closed... ugh. IM TOO YOUNG FOR GLASSES
and memory loss
you're never too young for either glasses or memory loss.
@Prismatic my colleague refers to this as "stack unwinding", so he sometimes writes down his call-stack :) (dunno if he has implemented exception handling yet :p)
user1804599
Also proud of my mutator function.
user1804599
void fiber::resume() {
    gc->mutator([this] (auto&& safe_point) {
        ...
    }
}
11:33
@melak47 lol nice. I used to do this, called it my 'train of thought'. Each train compartment was like the different stuff I was working on and how I had gotten there
Too lazy to keep doing it though
@Prismatic Haha, I wear glasses since I'm 4.
// 2015-11-29| IntReader.TryReadInt32("ab  12345", 4, ...) 1 000 000 times 30 ms
// 2015-11-29| int.TryParse(substring: 12345, ...)         1 000 000 times 215 ms
// 2015-11-29| int.TryParse(12345, ...)                    1 000 000 times 180 ms
@sehe I should revert this but I just continue
// 2015-11-29| DoubleReader.TryRead("  123.45", 4, ...)  1 000 000 times 110 ms
// 2015-11-29| double.TryParse(substring, ...)           1 000 000 times 176 ms
// 2015-11-29| double.TryParse("123.45", ...)            1 000 000 times 147 ms
maybe bit shifting can shave off some more :)
user1804599
12:00
Fuck signals.
@jaggedSpire here is some more typical C#. Fiddle does not support C#6 yet so the $"" does not work in the sample.
blech
disgusting
I hope C#7 will get record syntax, will clean up things a lot
user1804599
@JohanLarsson select compiler Roslyn 1.0.0-rc1
12:14
oh, didn't know, I see that I dumbed "," should be ", "
user1804599
src/fiber.hpp:33:19: error: declaration of `confx::gc* confx::fiber::gc' [-fpermissive]
         class gc* gc;
                   ^
user1804599
Thanks, GCC, for your descriptive error message.
user1804599
why the fuck can't you do this
user1804599
fuck types and values being in the same namespace
12:25
Does it work if you pick a different variable name?
user1804599
Yes.
user1804599
But that's fucking ugly.
user1804599
Fuck C++.
if only you had a different naming convention for types
garbage_collector* gc
12:29
^ yeah, gc is a joke as a name for a class like that
Why are you prefixing gc* with class again?
Xeo
Xeo
@Jefery to force class namespace
to compensate for the fact that 2 letter typenames is a terrible idea to begin with :)
and/or variables named like your types
user1804599
12:45
wooo :D
@Xeo Hmm, as opposed to?
Xeo
Xeo
@Jefery all namespaces.
user1804599
Fun-fact: the nop instruction isn't a no-op. It advances the instruction pointer.
10
consider struct stat vs stat()
Xeo
Xeo
12:48
Or similar, I think
wait, that was a bad example
So as opposed to value namespaces?
So in the original example gc * gc could be parsed as multiplication?
lol, these accusations flying left and/or right. Due process not detected.
13:02
@Jefery yep, gives a quad collector
13:15
@Elyse pc++
user1804599
++instruction_pointer()
*instruction_pointer()++
user1804599
13:34
@melak47 why would you increment an instruction
@JohanLarsson lol
user1804599
This isn't Malbolge.
@Nooble very, by being too weak to pick up people
Ell
Ell
@ElimGarak I saw those accusations
@Ell Badlet until proven a Gudlet <3
And given that the entire thing cannot be proven beyond a shadow of a doubt, he's a badlet for all times.
@набиячлэвэлиь Oh well
13:59
are types singletons of type 'type'?
Singletons are evil.
evil_t
@orlp They're of type type const &
const type&
Putting a space there is evil.
14:05
@Nooble You know what else is evil?
<insert badjoke here>
My mother?
That's the obvious answer
I eviluate to true.
Eh~, I'll be late to my rehearsal.
See you later.
14:10
See ya.
@Nooble How's lumiukko goin'?
Didn't know she had a "Satureday" video.
@набиячлэвэлиь not
because unit finals
and need4study
@Nooble How's homework goin'?
14:18
@набиячлэвэлиь horribly
> Node OS Review - Ultra-minimal Linux Distribution With Node.js/JavaScript Userspace
@Prismatic lol
You know I'm actually intrigued. I don't like bash and I never bothered learning it outside when I absolutely had to do something
I think I would like a terminal that supported something ecmascript-ish far better
I have no idea how pipes and stuff would work though
user1804599
@orlp Not all types are singletons.
14:32
for(auto it = week.begin(); it != week.end(); ++it)
Gotta use that range based for.
He's rolling a melee based for
user1804599
@milleniumbug ;
14:56
@Elyse std::this_thread::sleep_for(std::chrono::hours::max());

« first day (1870 days earlier)      last day (3292 days later) »