« first day (919 days earlier)      last day (4024 days later) » 

12:00 AM
Something I've always been a bit curious about is the wording sometimes used to describe the relationship between parent classes and inheriting classes -- subclasses and superclasses, child and parent respectively. From the point of sheer functionality, the inheriting class is "superior" to its parent class. I guess it's just the imagined tree hierarchy of one being "above" the other.
 
@Zoidberg ._. two projects coming up, both likely to be using java "Because we know you all know java"
 
user142019
@DeadMG Delivered by the Shitty Company of Crap Oracle.
 
@DomagojPandža I always view the base class as the superior one.
 
@DeadMG Well, yeah, you can control "minions" through it without knowing your minions, emotionally separating yourself from them.
 
man, I'm voting to lynch a guy called "HITLER WAS OKAY"
@DomagojPandža I was more thinking about how specific implementations are disposable and replacable, and how the base class dictates what can and cannot happen.
 
12:02 AM
@DeadMG and the subclasses submit to the superclass? :p
 
True, true. I tried Google-fuing the etymology, no luck.
 
yeah, they dominate them :P
 
Ell
I wonder if bartek has ever used pango with opengl
 
whips, chains, the works
 
user142019
Do I hear BDSM?
 
12:03 AM
@Ell No, he's a wuss.
 
if by "hear" you mean "read a joke about", then yes
 
@Zoidberg BiDirectional Surface... Parse failure.
 
@Zoidberg Unless it's an older Java, in which case it is (or at least soon will be) delivered by Red Hat (yeah, huge improvement!)
 
user142019
Oracle is terrible.
 
user142019
12:04 AM
You know what time it is?
 
user142019
That's right, it's time to sleep.
 
Is sleeping non-blocking?
 
@Zoidberg Getting close to dinner time here. Unfortunately, my stomach has been trying to imitate the Puppy's all week, so I probably won't be having any.
 
Ell
@rmartinho a wuss? Is pango & opengl a challenge?
 
most implementations block briefly with a spinlock in case the revive condition triggers soon; then they block with a waiting block.
 
12:06 AM
@Ell No. That's why he's a wuss.
 
@Ell No.
 
Ell
Well that's nice
 
@DeadMG so void set_encoding(encoding) recodes the string?
 
@R.MartinhoFernandes Or the implementation keeps two encodings around.
think of it as a hint- "I will be requiring this for interoperation lots soon".
 
Hmm, that's weird... What happens if I set_encoding and then insert?
 
12:10 AM
well, the implementation pretty much has to insert into the new encoding.
 
I think I'm missing something, but I don't see an easy way to construct an encoded_string with UTF-8 data.
 
there isn't, I cut that part of the design for a moment
 
I think that is an important bit, because UTF-8 is super common.
 
yes
but a real improvement in UTF-8 support comes from fixing UTF-8 literals, not a Unicode library feature.
I can add a simple static type tag to say "Hey, UTF-8 here" trivially
 
Yeah, sure.
 
Ell
12:15 AM
I wonder how difficult a pango opengl renderer would be
 
Looks fine, the previously mentioned dislike for this approach notwithstanding.
@Ell Not much.
 
Hey, someone responded to my job application
 
@R.MartinhoFernandes It's a bit between. I'm hoping to kind of appease both camps, because one has the single string type they were looking for, and the other gets some control over it.
 
Ell
@rmartinho either my Google fu is failing me or there must some reason someone already hasn't created an opengl renderer and published it?
I k ow you can do it with Cairo, but its not fully hardware accelerated
 
@Ell Depends on what you mean by a "pango opengl renderer"
@Ell You cannot have hardware accelerated font rendering.
 
Ell
12:18 AM
Why not?
 
Unless you want to implement the hinting VMs on the GPU.
 
Ell
Or is it a matter of it being g pointless?
 
(Also, is there really a gain from it? I doubt it; the CPU is perfectly capable)
 
Ell
Well no, the layout engine would be cpu
Ie pango. but the drawing of glyphs would be hardware accelerated
 
@Ell One of flat-out impossible, or requiring tremendous effort, or with totally unacceptable performance; and pointless on top, yes.
@Ell You think the GPU is faster than the CPU at doing fills?
 
Ell
12:20 AM
Yeah :3
I'm guessing I'm wrong.
 
The costly bits of the operation are elsewhere.
 
Ell
Right
 
@Ell Point is, you cannot draw the glyphs without running the hinting programs. Well, you can, but then you might as well use bitmap fonts and get better results.
 
Ell
So just using pango to render to a texture is the way?
 
I don't see why not.
 
12:24 AM
why am I here so much I'm not even good at C++
 
Ell
@crowz nor am i
 
AFAIU glyph rendering it goes like this: get outlines for glyph (non-parallelisable); rasterize the outlines (uses hinting program); draw the rasterised result. Which part of that would benefit from a GPU?
 
hmm, uzbl-tabbed is giving me a hard time when going back and forth from cmd into insert mode
 
only "Draw the rasterised result"
 
(mostly in here, haven't ran into any trouble elsewhere)
 
Ell
12:29 AM
@rmartinho I was thinking of instead of rasterising on the CPU, convert the outlines to primitives and render them with opengl
 
@Ell Unless you plan on drawing gigantic letters, it will suck.
 
Ell
Okay haha
 
That's what the hinters are for.
 
Ell
Right
 
FWIW, there is work being done on that field, but only time will tell if it will be worth it.
Hinting is the major stumbling block: you can do path rendering on the GPU, but path rendering is only half the task.
 
Ell
12:33 AM
Yeah, I saw a video on nvidias path acceleration gl extension
 
@R.MartinhoFernandes Interesting times.
 
For large sizes, say, around 20pt (depends on font anyway, but I think 20pt is a safe bet for most if not all), you can forego hinting and get nice results. But for most common sizes are 11pt, you do need hinting.
 
Ell
What is hinting? I think I might be thinking of... Kerning?
Otherwise, why does the size matter?
 
No. It's what makes sure all the details that make your text readable are still there and distinct at those small sizes: I think you can think of it as context-sensitive anti-aliasing.
 
@Ell A full-blown Turing-Complete virtual machine.
 
Ell
12:36 AM
Oh right
 
@Ell Because at large sizes the details don't run the risk of being lost.
 
Ell
I understand now, I think
 
@DeadMG Might be relevant:
1
Q: my post does not meet your quality standards, can you tell me why?

hguserThis is my post which I tried to post at stackoverflow.com at first, but when I tried to submit it, I got the message this post does not meet our quality standards. I have checked it for 10 minutes, but I can not find if I am wrong. But I can post it at gis.stackexchange.com Why???

Check out the question that got blocked.
 
room topic changed to Lounge<C++>: C++ is 100% hotter than Java. [c++] [c++11] [coliru] [no-helpdesk]
@Mysticial I don't see the link
 
@sehe That means it's only twice a hot as Java.
@sehe 4th word in the meta post is the link.
 
Ell
12:43 AM
In a terminal, is the blinking box cursor a character? Or just a drawing (if you can understand me? Its pretty early :o)
 
OP's an idiot
"Welp my question is not accepted on SO better post it at gis.se which is totally unrelated"
 
@Mysticial Depends. It is "fully" more hot (for the full 100%), it doesn't necessarily talk about how much hotter :)
 
@Ell A nice example I've seen before (sorry, couldn't find the link :|) was with the letter "m", in a monospace font like Consolas (sample here upload.wikimedia.org/wikipedia/commons/c/cc/Consolas_sample.svg). It is absolutely essential that the three legs are clearly separated. At small sizes, a dumb anti-aliasing algorithm can easily blur the space between them and make the text uglier/harder to read.
 
Ell
Ohhh right yeah I see now
I understand the need for hinting
 
So a hinter is a program that knows it must demarcate the legs when anti-aliasing.
 
Ell
12:45 AM
Its done with bytecode stored in the font file, isn't it?
 
@sbi sorry ^ it happened again - the shame
 
user1357851
But is hotter better?
 
user1357851
I wouldn't want my CPU to be 100% hotter in summer when running C++
 
I wish I could sleep asynchronously.
 
Ell
12:48 AM
Oh gosh, I think I just damaged my ear
 
I would put half my threads to sleep.
The other half would dow ork.
That way I'll never need to fully sleep unless I accumulate too much work.
 
user1357851
sometimes people dream up a solution :p
 
@Borgleader THREAD POOL STATUS REPORT? D:<
 
I gotta a shitty prototype
but its a start
 
Elaborate.
Also, in order to keep my thread pool as clean as possible, I'm implementing the first one on Coliru. :D
I also think I need my own thread class entirely.
 
12:50 AM
@DeadMG Turns out the OP had to capitalize the first letter of the title...
dafuq
 
lol
 
Quality.
 
People should learn to type
 
What is boost::optional for?
 
12:52 AM
Optional values
 
Hokay.
Yeah, I'm gonna write a wrapper around std::thread
 
@ThePhD std::optional as of yesterday.
 
@DeadMG Who's implemented it/
Not being able to tell when the std::thread has died without doing a join is silly.
 
@Borgleader Erm, you need a blocking queue.
 
joinable doesn't help either.
 
12:55 AM
@R.MartinhoFernandes how is that different than queue + mutex?
 
@Borgleader As is, unless work comes in always at the right rate, your threads will just spin around locking and unlocking the mutex for fun.
 
> if(threadpool.stop) break;
unsynchronized access to thread-shared variable -> data race -> UB
 
@DeadMG What happened to "i dont plan to read your code"
 
Oh, yeah, and make stop atomic.
 
but thanks :)
 
12:56 AM
std::atomic<bool>
 
also no lock guard on the queue.
 
I learned about Atomics while making my FileSystemMonitor/Watcher
They're really handy.
I forgot what header they come from.
 
the amazingly surprising <atomic>
 
@Borgleader With a blocking queue your threads will block until there is work available, instead of spinning and playing with the mutex.
 
@DeadMG Whoooooa how consistent!
@R.MartinhoFernandes WaitEvent <3
 
12:57 AM
inorite
it's the shockings
 
@R.MartinhoFernandes Yes you wrote that a little earlier :P
Thanks for the feedback.
 
I should go to sleep now.
Good night.
 
do blocking queues still require mutexes?
 
Goodbye.
 
@R.MartinhoFernandes 'night
 
12:59 AM
@Rapptz <3 I love you Rapptz-kuuun~
 
I love you too.
 
!!!! <333
Hm. Guise.
 
Ell
Goodnight
 
I need to store a variable amount of shit inside of a type-erased, uh. Thing.
Anyone got any ideas?
 
boost::variant?
 
1:01 AM
uh, boost::variant<std::vector<shit>, other_stuff>
 
Ell
Boost::any?
 
Um. ... What if I don't know the, uh.
The types at a later date?
Like. I have to store arguments.
And then use those arguments later.
 
Ell
What is your goal?
 
Like, way later.
 
@Ell isnt it std::any == boost::variant? if not whats the difference between boost::any and boost::variant?
 
1:02 AM
When the type information is gone.
 
@Borgleader No
 
@Borgleader No. any and variant are quite distinct.
 
Ell
Boost::variant allows a set of types, any allows any (I think?)
Ask the clever dudes :P
 
Any can store quite literally anything, variant allows a set number of types like Ell said and allows you to apply visitors to them.
 
Don't use Boost.Any.
 
1:03 AM
Ohhh I see
@LucDanton y not?
 
@LucDanton Unfortunately, std::any got kicked.
 
Why?
 
I don't quite remember
some problems with the allocators, I believe
 
Last time I asked it was something regarding stream ops. Which doesn't make sense.
 
lmao
 
1:05 AM
let me check the LEWG notes
 
maybe it'll make a comeback in C++77
 
std::any would be the wrong thing to promote, right. It would be a bit too much rope for the average C++ programmer :| - It's not so much rope to kill the programmer with, but more like enough to murder APIs with
 
@LucDanton When I was trying to make an Any class I was actually wondering how to do it and then after thinking about it I realised it didn't make sense.
 
What would the benefit of habing std::any over boost::any be?
 
Basically, what I'm trying to do is wrap std::thread so that I can also attach a std::atomic<bool> inside of it saying "this thread has finished completing the function you gave it to work with".
 
1:06 AM
@sehe Standardization?
 
yeah, so what was the benefit?
 
You don't have to do linking or including a third party library if you want to use it
 
The way I can do this is saving the function parameters and passing a wrapped function to the std::thread member of my wrapped-up-class ?
 
It's.. easier.
On the user.
 
there were three main concerns about std::any
 
1:07 AM
@sehe I really don't know how to solve that problem. I really, really like all of the type-erasing stuff is within reach in my toolbelt. But it's really hard to describe why they shouldn't be used unless type-erasure is exactly the feature you want.
 
Not everyone uses boost.
 
the first is the allocators, the second is the fact that it's really complementary to variant which was not available, and the third is a few issues with the any_cast interface not correctly respecting constness and lvalueness
 
inb4 "People should be using boost" or "Those who would use any would be using boost anyway" :|
 
@LucDanton Which, to me, is plenty reason to keep it in boost.
 
@DeadMG The last one sounds like the proposal was sloppy :| I don't remember noticing any obvious flaw though.
 
1:08 AM
@LucDanton You could const any x = 5; any_cast<int&>(x); and it would compile.
 
@LucDanton hehe "any obvious flaws"
 
@sehe In the case of any that's okay, but variant and optional could benefit greatly from a C++11 relift. Which is not happening in Boost.
 
similarly, no overload for any&&.
 
@DeadMG Make it throw bad_cast?
 
@Rapptz Not really an acceptable substitute.
 
1:09 AM
@Rapptz That's not how Any works.
 
firstly, you're turning a compile-time error into a run-time error, which is bad.
 
@DeadMG Sloppy indeed.
 
and secondly, decltype(any_cast<int&>(x)) would be broken.
 
@LucDanton Last time I stumbled across variant headers in boost I think I saw some conditionally compiled move-business.
 
@LucDanton optional made it (barely).
variant wasn't even proposed, unfortunately.
 
1:10 AM
Oooff...
This work is going far beyond the scope of my knowledge.
 
any will likely make it into TS at the next meeting, I think
 
I need to learn more.
To the docs!
 
but it might get held back if the allocators don't come through
 
Ell
What is the allocator issue?
 
1:11 AM
basically, the existing type-erased allocators can't really deal with data that is also type-erased.
it comes up in some subtle uses of std::function and a couple of other cases
 
I don't have a variant just for the hell of it. There really aren't enough features in Boost.Variant for me.
 
@LucDanton That's a harsh assert message :)
 
shared_ptr escapes because it doesn't need it's allocator to allocate anything new.
 
(Haha that sounds almost credible!)
 
@ThePhD An atomic bool? Why? What is going to inspect the bool, and when?
 
1:12 AM
the guys from Bloomberg proposed polymorphic allocators to solve the problem but they were not deemed ready
 
Ya know that's a very good reason to shelve any, too.
 
@MartinJames It's read / written from 2 or more threads. It must be threadsafe. Thus, atomic.
 
@LucDanton Which is one of the major reasons why it was shelved.
 
It won't be returned as atomic, however.
Just a regular boolean.
 
@ThePhD What is going to read it?
 
1:13 AM
Although there could have been a preliminary Any with a very std::shared_ptr-like interface tbh.
 
@MartinJames Other people. That are not the Thread class.
 
could have been but it would have been bad to have a suck Any in C++14 and then replace it with a decent Any
 
Extend.
Not replace.
 
frankly
 
I.e. emplaceable/uses-allocator any.
 
1:15 AM
you'd have to take so much out of the interface that it would not be worth using.
 
@ThePhD OK, when are the other people going to read it? If a thread has finished with some work item, it should be signaling something, not setting bools.
 
@DeadMG Uh, it's the same interface.
 
@LucDanton ABI breakage, just to start with.
 
@MartinJames if ( Thread.Done() ) { /* .... */ }
 
You prohibit the convenient a = 5;, leaving out only something a.emplace(5) where it uses std::allocator.
@DeadMG No...
'Rebinding' the allocator only comes up if you want to assign an any value with a non-any value, and you want to reuse the previous allocator.
 
1:17 AM
@ThePhD That looks uncomfortably like thread micro-management.
 
@MartinJames Which is what I should be doing, considering I'm making a Thread Pool.
 
the paper authors did argue that it could be fixed post-hoc.
 
It's okay because I don't trust someone that can't make a const-correct any_cast to get that right in the timeframe.
 
Ell
Shouldn't the worker thread ask for more work? Instead of waiting to be given it?
 
@ThePhD No, not if you can possibly avoid it.
 
1:18 AM
but the simple fact is that since we don't actually know what the polymorphic allocator final interface will look like
it's hard to guarantee their compatibility
 
Yeah there's the open question of whether something like that is at all possible.
 
@MartinJames I need to know whether or not a thread has finished executing. If I have, then I need to kill it. std::thread has no such member. Therefore, I wrap it up with my own.
 
and even if you take the allocator issue off the table, there's still any_cast and general unhappiness at not having variant left to stumble over.
 
But then you can just allow a = 5 to mean 'ditch previous block, use new std::allocator'!
Can't lose.
 
@LucDanton N3525 is pretty encouraging, but the work is all Bloomberg internal until a couple of months from now when it will be public. Nobody else has any implementation experience with it.
and there were a few uncertainties about the interface
 
1:20 AM
Yeah I think it's going to suck. I remember the type-erasure discussions on the Boost lists.
 
@ThePhD Why would your thread finish executing, if it's in a pool? It should just be waiting forever for more work.
 
Ell
I'm off to bed now chaps, nighty night
 
well, I saw the presentations on it (both of them) and I think it seemed practical.
 
For one polyallocators can't have something like the construct member of allocators.
 
they had a viable plan for backwards compatibility and what seemed like plenty of experience
@LucDanton Yep, it's just allocate and deallocate.
 
1:22 AM
@MartinJames No, in many cases some of the spawned threads will be killed if they receive no work for a very long time.
 
but most allocators realistically do not need to deal with screwing with the pointer typedefs (e.g. shared memory allocators) or overriding construct.
 
'Suck' was a short-hand here. I do think this is worth pursuing (very good fit for C++, too). There will be a lot of pain though.
 
@ThePhD Well, then they can wait on their work input-queue with a timeout. If the wait times out, they can kill themselves. No need for any 'manager'.
 
yes
the Bloomberg guys seemed to know what they were talking about to me. I think a couple of revisions from now, it will probably become Standard- there's nothing else in the pipeline to address this.
frankly, I'm more concerned about Unicode.
the direction from the LEWG was surprising and, well, I think damaging for many if not most users.
 
..or at least, they could kill themselves if some atomic 'MinThreads' value is not reached. If it is reached, the threads can carry on waiting for more work.
 
1:26 AM
Mmkay.
Question. Does std::move( std::get( my_variadic_tuple ) )... look remotely okay?
 
uh, no
you need indices if you want that to work.
they are Standard C++14 but not 11.
 
Mmm. Time to look up the indices trick...
... There's a lot of posts on the indices trick.
 
yup
 
What would that code do?
 
there's a reason why it's Standard now unless something very surprising happens
 
1:38 AM
... Hm.
How do you get the return type out of something that could be either a lambda, a std::function, or a function pointer / member function pointer?
 
2
Q: When is uint8_t ≠ unsigned char?

MehrdadAccording to C and C++, CHAR_BIT >= 8. But whenever CHAR_BIT > 8, uint8_t can't even be represented as 8 bits. It must be larger, because CHAR_BIT is the minimum number of bits for any data type on the system. On what kind of a system can uint8_t be legally defined to be a type other than unsign...

^^ interesting
 
Note that <cstdint> is conditionally supported(?).
 
Welp, I got stuck. =/
 
The C++ standard lists it as optional. typedef signed integer type int8_t; // optionalRapptz 16 secs ago
?
 
1:51 AM
Same for uint8_t
 
@Rapptz I think he's assuming that when it exists, is it ever not equal to unsigned char?
 
@Rapptz Which is odd, because I don't recall that being alongside such thing as conditional support.
Ah well. That would make full implementations, conditionally supported things, and optional things I suppose?
Yup. Doesn't appear in terms and definitions.
 
What if char was 4 bits.
 
@Mysticial Oh btw 'all bits must participate in the value representation' or some such.
 
Would int8_t be allowed to be equal to 2 chars?
 
1:56 AM
@LucDanton So the 8 actually means the size of the data, and not the size of the number?
 
> For unsigned character types, all possible bit patterns of the value representation represent numbers.
 
(I couldn't find where CHAR_BIT has to be equal or greater than 8)
 
I wonder if it's legal to have a char with only 7 real bits and 1 padding bit. — Mysticial 9 mins ago
Referring to that.
So I suppose yes it's fine, as long as char is signed? I answered nothing!
 
I don't have the C standard handy on me..
 
> For character types, all bits of the object representation participate in the value representation. For unsigned character types, all possible bit patterns of the value representation represent numbers.
Da fuck.
 
1:58 AM
wut
 
So no, can't have padding. But you can have trap representations?
 
Fuck the standard.
2
 
tl;dr do only binary stuff on unsigned thingies
 

« first day (919 days earlier)      last day (4024 days later) »