« first day (1629 days earlier)      last day (3302 days later) » 

user1804599
1:00 PM
 
user1804599
Thank you, GitHub.
 
dickhub
 
can someone dupehammer:
0
Q: Leaving and deleting a critical section

Virus721Deleting a critical section requires to first leave it, i.e do this : LeaveCriticalSection( & cs ); DeleteCriticalSection( & cs ); The problem is that this is not an atomic piece of code. What happens if a thread B enters the critical section between the moment when thread A exits it and the ...

 
By not reacting to the statements made you prevent us from having a fruitful discourse with you. Under these circumstances it is impossible to answer this question. Therefore, I'm closing it now. — usr 5 mins ago
That really doesn't make sense
 
1:06 PM
> a fruitful discourse
 
user1804599
What's a critical section?
 
user1804599
> In concurrent programming, a critical section is a piece of code that accesses a shared resource (data structure or device) that must not be concurrently accessed by more than one thread of execution.
 
user1804599
std::mutex problem solved NEXT
 
@райтфолд that's what I said
 
I don't think there's enough information to judge what is "the correct solution". My answer is the correct solution for the undefined behaviour (and in your case the crash). Nothing else. I think the "region merge" that you talk about in the comments is a different question (don't edit this one) and you need a much better specification/sample to have people help you with that. Just post a new question with a good sample tagged opencvsehe 31 secs ago
Martial arts: divert the attacker's energy
@MomotapaLimpopo flagged as not constructive :)
 
1:11 PM
You know I delete these myself after a few seconds, right?
 
I do. The guy said "I am sorry". Let's pretend we believe him
 
user1804599
sehe is DOT complicated?
 
user1804599
I want to generate DOT
 
2
Q: Is a vtable generated when a virtual function is immediately marked final?

CarltonIn this post: Does final imply override?, one of the answers showed that you can declare a function virtual AND final in the same declaration. An example was given that this prevents derived classes from mistakenly declaring a function with the same signature, so as to avoid confusion about whic...

decent question
is my answer correct?
 
user1804599
for type subtyping relationships
 
1:13 PM
just printf("."); // should generate DOT on stdout
 
@LightningRacisinObrit why so excited
 
the only thing more excited-like would've been Yes!!!
 
@AlexM. y not alix
 
1:15 PM
Welp 30-40 minutes early for my train
 
your exclamation mark pisses me off so much
it has no place
why do you do this
> Edits must be at least 6 characters; is there something else to improve in this post?
fuck you
SO is borked
 
lol
Alex so anger
 
I seriously can't remove that exclamation mark
I have no idea why it annoys me so
 
python for x in range(10) for y in range(10) is that basically giving you a double for loop then? like for(int y=0; y<10;++y){ for(int x=0;x<10;++x){ use(x,y); }}
 
1:23 PM
@thecoshman It's a generator
 
@milleniumbug yeah, which is more or less making a list and iterating over it... which is more or less like a for loop
 
No, generators are lazy.
 
what about 'v[:z] + [0] + v[z:]' that syntax? full line being self.vecs=[v[:z] + [0] + v[z:] for z in xrange(d) for v in vf(d - 1)]
@milleniumbug sure, but end effect is the same
 
@thecoshman Only if you use all elements.
 
@milleniumbug which I'm fairly sure that does...
 
1:24 PM
@thecoshman You haven't given all the context of the python expression.
 
which part is missing?
    def vf(d):
        for i in xrange(2 ** d):
            yield [(i >> n) % 2 * 2 - 1 for n in xrange(d)]
 
in the mac terminal, is it possible to have a window open in vim just as a shell? That sounds weird
 
you mean a terminal automatically start vim?
 
@thecoshman So each individual list is generated eagerly (because of the []), but the yield of the generator makes it return the each list lazily.
 
@milleniumbug :S I'm just trying to port it to C++ is all...
 
1:29 PM
@thecoshman nah, like you can :vsplit open a file in vim, I want to horizontally open a terminal so I can see my process running
 
@thecoshman Direct equivalent in C++ would probably use either iterators or function object. If you don't give a shit about laziness, you can make it a function with a simple nested loop.
 
@milleniumbug the later is what I'm doing
what's the v[:z] and v[z:] nonsense about?
 
Xeo
slices
 
@thecoshman slices are amazing
 
Xeo
why don't you just try to reimplement whatever that algorithm does, instead of trying to port Python code you don't understand?
 
1:31 PM
@thecoshman Slicing. When x = [0, 1, 2, 3, 4];, x[1:3] == [1,2]
 
@Xeo because I understand what it's doing even less :\
@milleniumbug ooh, I think I see what this is trying to do now
 
assymetric ranges
 
nope :\
I need to spend some more time on this really
actually take time to understand wtf is going on
it's not as trivial as I first thought it was going to be
 
@райтфолд it's designed to be simple. And you can use it as such. The C API is a bit ... unpleasant. The format is OK until you get to the HTML subset (avoid it)
 
user1804599
I want to generate SVG with hyperlinks.
 
1:37 PM
By the way, I've not seen "dot" capitalized. Use Graphviz if you think it's not unambiguous enough
@райтфолд Fair game, not very complicated
 
no you don't
 
Why is goto in python implemented as a joke only?
 
Why not?
 
user1804599
@sehe :)
 
1:38 PM
@CatPlusPlus I love that comic
 
@khajvah Because nobody needs or wants it
 
@райтфолд I do suggest generating dot-files, not using the API
 
It is useful sometimes
 
user1804599
OK.
 
user1804599
Tricky with " in identifiers perhaps?
 
user1804599
1:39 PM
If I can use something like \u00000000 for everything then that'll be fine.
 
For deep exits you can use exceptions if you really need, and there's literally nothing else
 
The following fails in C++14:

constexpr std::initializer_list<int> il0 = std::initializer_list<int>{};
 
Times I've needed goto in past 10 years outside of C is zero
 
initializer lists are not constexpr :/
 
@CatPlusPlus You can functions too but it is wordy. goto can make the code short and good looking sometimes
 
1:40 PM
@gnzlbg what is the use? I'm trying hard to think of the case where it matters
 
Nobody cares, nobody wants, that's why it's not there
 
@райтфолд not complicated
 
@CatPlusPlus Nice conclusion.
 
Also using a function involves typing one line more so
 
1:41 PM
@LucDanton it fails with clang trunk :/
 
@CatPlusPlus People have been killed for less
 
Seriously, I never looked at any code and thought 'yes goto would make this better'
 
It works on Coliru Clang.
 
@CatPlusPlus In sense of functionality yes, but it can make the code shorter and better looking.
 
@LucDanton constexpr auto il1 = std::initializer_list<int>{1, 2, 3, 4}; too?
 
1:43 PM
Not in Python, no
 
@gnzlbg Why don’t you try? You have the link.
 
@LucDanton It fails :/
 
@CatPlusPlus The language doesn't really matter, I think
 
It's an extremely low-level primitive
There are better ways to structure the flow
 
Numbers sorted in condescending order: 3 (of course it comes first!) 2 (well, what did you expect?) 1 (seriously, you didn't predict that?)
Digit ordering in en_LRIO.utf8 locale ^
 
1:44 PM
@CatPlusPlus ok, I see what you mean.
 
@gnzlbg In any case std::initializer_list<T> is literal in recent enough C++ (hopefully that means C++14, I don’t remember when that made it in), and the default constructor is constexpr. For other forms of initialization you’ll have to look it up yourself.
 
@LucDanton The default constructor is constexpr and that works in clang and gcc
 
That is what I said, yes.
 
initializing from a braced list i dont know
it is not listed as a constructor in initializer_list
 
What were you expecting, initializer_list(initializer_list list);? :)
 
1:48 PM
@sehe en_LRIO.wtf8
 
mm it's so cool
my GF is going shopping and I can just slaaaaaackk ooooooffff
 
@LucDanton "Otherwise, if T is a specialization of std::initializer_list, a new std::initializer_list prvalue of the same type is constructed and used to direct-initialize or copy-initialize the object of type T, depending on context."
 
maybe I could play some factorio
or whateeeveeeee
 
@LucDanton constexpr auto l = {1, 2, 3, 4}; works with clang lol
 
shitty me for not taking polish power cord tho
 
1:50 PM
We certainly spent productive minutes here, didn’t we?
 
@BartekBanachewicz What would you do if your GF didn't go shopping?
 
dunno I might get up
and go outside
 
@BartekBanachewicz Wait. You're spending your holidays in UK in the Lounge while your GF is shopping?
 
@MomotapaLimpopo yes
 
so:
constexpr std::initializer_list<int> a = {}; // calls std::initializer_list<int>() which is constexpr
constexpr auto b = {1, 2, 3, 4}; // is of type std::initializer_list<int>()
constexpr std::initializer_list<int> c = std::initializer_list<int>{1, 2, 3, 4}; // works on gcc but not clang
 
1:51 PM
everyone's happy that way
 
Why not stay in Polen then?
 
at least you are not working
 
because we're visiting her brother and his SO right now, so she went with her brother
I suppose they might want to talk to each other or something
then we're going to Bath to her mom
 
user1804599
Maybe I shouldn't show Bottom in the type graph.
 
@BartekBanachewicz Why, she can't take one herself?
 
user1804599
1:52 PM
It makes the graph hideous as fuck.
 
note the capitalization
 
Note the pun
 
anyway since noone's home I can work on hate or just relax in blissful silence
it's much quieter here than in Gdańsk
 
@MomotapaLimpopo noted, it was very sharp.
@BartekBanachewicz where you at?
 
Swindon still
 
1:54 PM
@MomotapaLimpopo It's spelt Pooland silly.
@BartekBanachewicz oh, how long?
 
we're moving around 9 I think
 
> spelt
urgh
 
@LucDanton why not? constexpr defaulted copy constructor? It's not in the standard so I can see why it fails in clang. I don't see why it works with gcc tho.
 
@MomotapaLimpopo I know... both are valid English English though :\
 
1:55 PM
@gnzlbg How would the parameter to this constructor be initialized?
 
> English English
 
As opposed to Non-English English
 
constexpr initializer_list(initializer_list const&) = default;
The std just mentions constexpr initializer_list() = default; but that is not enough for copy initialization.
 
Or Polen English
 
and Americanlish
 
1:56 PM
is Maybe an instance of Alternative monad?
how was that called
 
@JohanLarsson The garbage collector is not guaranteed to run when you call Collect(). It simply flags the object for collection. The next time the GC runs it will "collect" the flagged object.
3
Q: Garbage Collection does not reduce current memory usage - in release mode. Why?

Alex YorkI built a quick program that needed to loop through an enormous log file (a couple of million records) and find various bits and pieces from inside. Because the volume of data was so huge, I have been curious to watch my Windows Task Manager performance tab and see how much CPU and memory is bein...

 
(<|>) :: f a -> f a -> f a
mm
 
Xeo
@BartekBanachewicz Yes.
 
@gnzlbg That wasn’t what I was driving at.
Forget it.
 
@AlexM. snack overflow
GC.Collect is documented to force collection, not "flag" anything
 
1:58 PM
> Just 5 <|> Nothing
Just 5
> Nothing <|> Just 5
Just 5
k
 
@AlexM. It always works fo A
 
'xactly what I needed
 
@JohanLarsson it looks like a C#-version of UB to me
 
@LucDanton I know but i was driving to why constexpr init_list a = init_list{ ... }; doesn't work. If the other constructors/assignment were declared constexpr and defaulted that should work, but they are not.
 
user1804599
Like this. :3
 
user1804599
1:59 PM
Bottom [color = blue];
BottomNote [color = gray, fontcolor = gray, label = "(everything)"];
Bottom -> BottomNote;
 
@JohanLarsson It might be race condition, finalizers seem to be executed asynchronously
 
@gnzlbg why?
I honestly wished you stopped pinging me about it.
 
@CatPlusPlus still seems to be the case with this though dotnetfiddle.net/S7brPt
 
Is F# any good?
 
wait
 
2:01 PM
@khajvah define "any good"
 
how do I share my edit
 
@khajvah It looks really nice an everyone who knows it prefers it to C#
 
@JohanLarsson I don't
ironic innit
maybe I don't really know it though
 
@BartekBanachewicz Probably a good alternative to scheme or haskell
 
yes but you don't prefer it because it's not Haskell
 
2:02 PM
you are ironic yes :)
 
@AlexM. Dunno
 
@AlexM. it's closer to Haskell than C# certainly
 
Trying to force GC or relying on lifetimes that way is iffy anyway
 
@AlexM. still alive when I run it.
 
I know
 
2:02 PM
@khajvah If I were to use a mutable language right now, I'd probably learn OCaml
 
user1804599
splines=ortho y u no work
 
@CatPlusPlus I need it in a unit test. Have a complicated thing with lots of subscriptions. Want to assert that it cleans up.
 
F# has entire .NET ecosystem available
@JohanLarsson Don't assert GC behaviour
If you want to check for leaks then check for leaks
 
@BartekBanachewicz I will check it out
 
@CatPlusPlus how?
 
2:04 PM
Run a memory profiler
 
@CatPlusPlus I didn't find using most of the functions particularly fun though
 
I want a test for it.
 
people seem to be forgetting that C ecosystem is actually pretty decent too
not to be confused with C++ ecosystem
 
Anyway it's not freed because it's moved to an older generation
 
2:07 PM
But why, this is the question
 
Because heuristics or who the hell knows
Don't rely on exact GC behaviour
Maybe because two collects are done on short notice and there's no memory pressure GC figures it doesn't have to go through full sweep
 
Window creation failed
Opening Window (4, 5)
lol wtf
I don't think that's the right order
 
Interestingly removing the call to the setter gets the GC to collect the enclosing object
Oh well
 
nice find
 
so the weak reference is in fact an impostor?
 
2:13 PM
@R.MartinhoFernandes yup. I didn't have the copy of latest Unicode drafts handy, thanks
 
@AlexM. how do you mean?
 
@JohanLarsson by setter he means wr.target = b;
right?
 
@AlexM. that looks like the informal version of logic to me
Something being an implementation details doesn't make it UB
 
@sehe I was talking about "GC.Collect()" being a hint for the GC and not an order
yes UB is not exactly the proper word
 
It's not a hint though
It will collect what it can IIRC
 
2:15 PM
It's an order, but that doesn't mean it will do exactly what you want it to do
 
it always collects a
 
Why do you care though
.NET's GC is non deterministic
All reasoning is moot
 
I really want a unit test for that my Observable does not leak
it does a lot of subscribing
 
2:18 PM
It won't be reliable
 
use scotch tape noob
 
Also my CLR collects b too
 
if I was able to fix my shower leak with scotch tape
you can do it too
 
More ThePhDisms!
This time I turned what is obviously a non-static member function into a static function without adding a "this" parameter to it.
 
> HTML GL solves "the slow DOM problem" by creating WebGL representations of DOM elements and hiding actual DOM after.
:facepalm:
 
2:24 PM
@R.MartinhoFernandes by adding the word static?
 
thats very cool
 
No, it's messed up.
The only reason it works is because some of the state of these objects is extrinsic and this function only uses that part of it.
 
wait, C++ doesn't have named params?
wtf
I always thought it had
 
Why would you think it had
 
2:26 PM
because it always looked to me like a basic and useful feature
 
So why would you think C++ has it
 
@AlexM. lol
 
actually if you would have asked me
I'd have said that C# got its inspiration from C++ for it
TIL
 
@AlexM. C# only got named params on v4.
 
2:27 PM
if I have IO (Maybe a) I can't use <|>
 
GNU/C# was heavily inspired from Java except they didn't fuck it up
 
I'd need to lift <|>
uh
 
And named params in Java didn't come until uh
When was it again
 
does it still make sense
 
Java 10
 
2:28 PM
@R.MartinhoFernandes I started using C# right around then
sometime between 2009 and 2010
 
Oh, wait, it never had them.
 
liftA2 (<|>) f g
is this still readable?
 
:thumbsup:
 
maybe I could fold instead
foldr (liftA2 (<|>)) empty [f, g]
mmm
this all seems complicated
also the fold doesn't work damnit
I want to break on first non-empty
choice :: Alternative f => [f a] -> f a
there we go
but that's in Attoparsec :/
 
Bartek Monologuewicz
 
2:32 PM
Hmmm, the light cone of a cell is not completely within the light cone of a cell that contains it.
 
choice = foldr (<|>) empty
ok seems my idea should be ok
damn it no, it evaluates the things it doesn't need
I want it to shortcircuit
 
@R.MartinhoFernandes not technically true, it had them but only for COM interop. Which was completely useless by and large
 
@Mgetz Er, technically true. They were added for COM interop. COM interop looked horrible before that.
 
> Now the parents have acquired a taste for it they could now switch to Carlesberg !!
lol
 
2:36 PM
All that Type.Missing bullshit.
And ref Type.Missing? Ew.
 
I'd need it to be Maybe (IO a) not IO (Maybe a)
damn
 
user1804599
@BartekBanachewicz easy:
 
user1804599
f :: Maybe (IO a) -> IO (Maybe a)
f Nothing = return Nothing
f (Just a) = a >>= \x -> return (Just x)
 
@BartekBanachewicz lolwut
 
@R.MartinhoFernandes yeah I don't want that
choose :: [IO (Maybe a)] -> IO (Maybe a)
choose [] = return Nothing
choose (x:xs) = do
    a <- x
    if isJust a then return a else choose xs
this should work
 
user1804599
2:38 PM
Oh, other way around.
 
ah missing return
 
@BartekBanachewicz msum
 
@R.MartinhoFernandes I knew there's something simpler
 
Android NDK team: "Hey guys wouldn't it be a great idea if we removed a bunch of vital documentation for no reason?
 
um wait
msum :: (Foldable t, MonadPlus m) => t (m a) -> m a
IO isn't MonadPlus
 
2:42 PM
55
A: How can I write a unit test to determine whether an object can be garbage collected?

Paul StovellThis is what I normally do: [Test] public void MyTest() { WeakReference reference; new Action(() => { var service = new Service(); // Do things with service that might cause a memory leak... reference = new WeakReference(service, true); })(); // Se...

no idea why but it ~works
dunno about the build server yet
 
> NB: There are very, very few times where you should call GC.Collect() in a production application. But testing for leaks is one example of where it's appropriate.
I remember this article about some game done with Unity
that was very much helped by the fact that the guys called collect() in key moments
can't remember anything else about it though
 
user1804599
@JohanLarsson nice
 
do you understand why?
 
user1804599
Yes.
 
WGL: Failed to create OpenGL context
Opening Window (4, 5)
Opening Window (3, 3)
it werks
 
2:45 PM
Writing a comment in the code for that one
@райтфолд probably no meaning in trying to explain it to me. Good for you!
 
I have to reorganize it though
to better match the backend tuning
 
@BartekBanachewicz arent you supposed to be on vaycay
 
where is everyone
@Pris he's a nerd
holiday = programming
so sad
 
@LightningRacisinObrit Office.
 
@Pris I finally have time to code!
@LightningRacisinObrit "people who don't spend their free time the way I do are so sad"
 
2:55 PM
@LightningRacisinObrit What do you do on your holidays?
 
@BartekBanachewicz No, specifically, you are sad
@R.MartinhoFernandes I go outside and explore and enjoy the world
and get drunk
inb4 "so sad"
 
@LightningRacisinObrit so sad
 
I don't think this is inelegant at all - it's exactly what XML does. The comment becomes part of the resulting document and it's only by convention that the contents are ignored (XML comments are accessable via the DOM, XPath etc. you can use them to store data if you want. Doing so would be strange but not without precedent - <!--[if IE 7]>) — Joe Gauterin Aug 11 '09 at 12:55
> I don't think this is inelegant at all - it's exactly what XML does
wot
 
@LightningRacisinObrit I couldn't reply that with a straight face since it's what I do.
 
@BartekBanachewicz my point is, you're not doing anything that you couldn't do at home. ergo you are totally wasting the trip
 
2:56 PM
@LightningRacisinObrit Wait, he traveled somewhere and is programming?
 
@R.MartinhoFernandes So it would seem
Four days in the UK with his family and instead of spending time with them and exploring his surroundings, he's working on Haskell
 
is it mandatory to spend every second of your time maximizing the amount of things you can explore
isn't that nerdy
 
no that's the beginnings of a strawman argument
 
who suggested that you mandatorily spend every second of your time maximising the amount of things you can explore?
 
2:58 PM
The whole thing started because you were a dick again
now that I backtrack to it
 
fuck of LRIO and let me have my vacation the way I want to
 
god Bartek you really are a world-class tit
 
sincerely, Bartek
I'd send you a postcard but I'm busy coding so...
 
I hope your family know how lucky they are to have you along for this holiday
I'm sure it was worth the financial expense
 
2:59 PM
yawn
 

« first day (1629 days earlier)      last day (3302 days later) »