« first day (948 days earlier)      last day (4001 days later) » 

5:00 PM
Think that I cannot get convex hulls working for days is a bad sign?
 
@R.MartinhoFernandes streaming from a wide stream to a wide string with the utf-16 codecvt will create a string of truncated codepoints rather than utf-16.
 
@MooingDuck No.
Asking a function to convert to UCS-2 a string that cannot be represented as UCS-2 is a bug in the calling code, not the implementation.
codecvt_utf16 converts between UTF-16 and UCS-2 or between UTF-16 and UCS-4. You can complain about the name, but don't let it fool you.
 
@R.MartinhoFernandes Maybe I should have read more context, but does anybody ever intentionally use UCS-2 any more? Why would you support it at all?
 
A wchar_t stream is either UCS-2 or UCS-4. It's not UTF-16.
@JerryCoffin Standard sucks... :(
 
@R.MartinhoFernandes the whole context was to have utf16stream >> utf16string; work, but I (and others) can't figure out how to do it. stackoverflow.com/questions/14167611/…
@R.MartinhoFernandes oh
 
5:05 PM
1 min ago, by R. Martinho Fernandes
@JerryCoffin Standard sucks... :(
@MooingDuck What's a utf16stream, btw?
 
@R.MartinhoFernandes a std::wistream on Windows.
 
@MooingDuck Not gonna work.
codecvt_utf16 converts between (char16_t as UCS-2, char32_t as UCS-4, wchar_t as UCS-2 or UCS-4) and (char as UTF-16, UTF-16LE, or UTF-16BE).
Note how one of the types is invariably char.
 
wtf spec.
 
posted on May 21, 2013 by Eric Battalio

Image processing is a computational task that lends itself very well to GPU compute scenarios. In many cases the most commonly used algorithms are inherently massively parallel, with each pixel in the image being processed independently from the others. As a result, image processing toolkits have been early adopters of the new GPGPU programming model. Many of these mass-market toolkits, however

 
@MooingDuck Also note how the UTF-16 parts are always on the char side, and even char16_t is used as UCS-2, never UTF-16.
If you want to say "what a pile of crap" now, yes.
 
5:12 PM
C# (or C++) with .NET is probably my primary choice for Windows-specific development.
 
I have no idea how this kind of thing got spec'ed, to be honest.
 
Huh.. I told Anne: "I'm off to Berlin for a couple days next month for a concert and maybe a couple beers with net friends". Immediate response: "Don't tell them, else they'll put the wall back up". Hmmph..
 
@MartinJames haha.
@MooingDuck I think this might be possible to do without implementing any actual decoding/encoding yourself if you write your own codecvt.
You can combine UTF-16 -> UCS-4 with UCS-4 -> UTF-8 and then with UTF-8 -> UTF-16. lol
UTF-8 -> UTF-16 is the only way to get UTF-16 that doesn't come in chars.
 
So, today I realized that the opposite of "giving up" is "taking down".
 
Can't test this on coliru.
> fatal error: codecvt: No such file or directory
 
5:21 PM
I want to talk about something
 
Oct 24 '12 at 1:13, by R. Martinho Fernandes
@LucDanton Combine UTF-16 <-> UTF-8 <-> UCS-2.
Oct 24 '12 at 1:17, by Luc Danton
@R.MartinhoFernandes Ya I was wondering about that. Conversions are biased to and from multibyte UTF-8, aren't they?
 
Let's talk about something utopistic: the SO mobile app
 
@LucDanton Yeah, I remember discussing this sometime ago :)
 
In years past.
 
Oct 24 '12 at 0:36, by R. Martinho Fernandes
What's codecvt_utf8_utf16 for if we have codecvt<char16_t, char, mbstate_t>?
Also this one.
You know, I really wanted to implement and test this :S
 
5:30 PM
Is this about implementation-specific <-> Unicode?
 
"Xbox One" is such a weird name.
 
@LucDanton This case was just about UTF-16 file -> UTF-16 string (std::u16string or std::wstring on Windows).
 
@EtiennedeMartel "All your entertainment in One place" :|
 
It would make a magnificent Q&A! Q: "How do I extract a std::u16string from a UTF-16 file with the components provided by the standard?" A: "UTF-16 -> UCS-4 -> UTF-8 -> UTF-16"
 
@Rapptz Oh, right.
 
5:32 PM
@R.MartinhoFernandes lol
 
@EtiennedeMartel It's not that bad.
 
Well, it's understandable that they make a media center, because consoles are dying anyway.
 
If only I could test it...
 
If anything Xbox 360 is the lame name.
 
@R.MartinhoFernandes "Readers who are working with the the GNU C++ library will find that as of v4.7.2 it does not yet provide the <codecvt> standard header. "
 
5:32 PM
Let's try clang.
@MooingDuck Not 4.8 either.
 
@R.MartinhoFernandes can't go straight from utf16 to utf8?
 
@EtiennedeMartel Well, it might have made sense for the original Xbox, but not so much for the third...
 
@LucDanton MSVC std::iwstream >> std::wstring (where both are utf16)
 
Not you!
 
2 mins ago, by Rapptz
@EtiennedeMartel "All your entertainment in One place" :|
 
5:34 PM
@MooingDuck No, because the start is "UTF-16, the encoding scheme", i.e. "UTF-16 as sequence of char", and the end is "UTF-16, the encoding form", i.e., "UTF-16 as sequence of 16-bit code units".
 
@R.MartinhoFernandes ah, I see
 
And codecvt_utf8_utf16 is always char <-> char16_t/wchar_t with char always being UTF-8.
 
no wait, I still don't see it, I don't understand anything involving codecvt. (I'm also no longer paying much attention)
 
lol
@MooingDuck I don't understand much either, which is why I would like to test before posting such a silly Q&A.
 
@MooingDuck There are two things that happen: char <-> not_char, and 'an encoding' <-> 'another encoding'.
Sometimes it's the same encoding though.
@R.MartinhoFernandes So std::basic_stream<char16_t>/std::wstream is a desired endpoint then?
 
5:37 PM
@LucDanton The start, yes.
 
Um I thought the start is the actual file.
 
What a mess. I'll test stuff with clang and brb.
 
'physical' bytes as char, with some encoding <--codecvt--> std::basic_ifstream<pick_your_poison>, with some encoding
And I doubt that every pair is possible of course. Would be too easy.
std::wbuffer_convert might be something to bolt on top of that to go further to an std::basic_streambuf<other_poison> via another codecvt but truth be told I haven't figured that out.
Problem is that when I try to figure out which part to connect to which it no compute.
 
@MooingDuck To be honest, I'm pretty sure nobody entirely understands codecvt -- including the people who designed it. It has a couple of problems: first that some encoding schemes (e.g., Shift-JIS) are pretty complex. The second is that I've become convinced people really had (at least) two separate kinds of conversion in mind when they designed it, and the result doesn't really work very well for either (or for much of anything, really).
 
std::ofstream("text.txt") << "\x7a\x00\x34\x6c\x34\xd8\x0b\xdd"; // UTF-16LE
Spot the problem.
 
5:43 PM
\x is implementation defined?
 
No.
It's always exactly what I put in.
 
@R.MartinhoFernandes null termination
 
I wouldn't have noticed if you hadn't told me something was wrong
 
Yeah. I ran the program first, and it only wrote the first byte.
 
5:44 PM
That's an idiocy due to the stream interface and/or std::char_traits though no?
 
Was obvious when I looked at it.
 
@R.MartinhoFernandes Well, I'm game to try to figure that out anytime. (And I'm just as out of an implementation as you are.)
 
I'm trying things out right now. My clang+libc++ install works.
 
Damn. I'm eating between vidya gaems. Choices, choices...
 
Soooo. As I expected, imbuing codecvt_utf8_utf16 only allows you to read UTF-8, never UTF-16.
 
5:48 PM
Right.
(char, E) <-- codecvt<Wide> --> (std::basic_ifstream<Wide>, F)
^ does that help?
 
What's E/F?
 
Encodings. codecvt<Wide> is not literally an std::codecvt<Wide>, think CRTP base.
 
@R.MartinhoFernandes Does <locale> have std::wbuffer_convert? If so, I might just reboot and give it a try.
 
Just to make sure I don't shoot myself later, I want to make sure that GCC already supports std::to_wstring() from C++11. Is that true?
 
5:53 PM
@LucDanton Not on GCC.
 
@R.MartinhoFernandes Of course not.
 
libc++ has it.
 
Yay
 
If I have an amount.
And I want to have one something per five amount.
How could I calculate that?
 
@Mysticial I believe so.
 
5:54 PM
@Mysticial it's trivial to write yourself if it's missing
 
where some of the amounts become somethings
 
@Pawnguy7 divide by twenty?
 
@LucDanton Though you can only use codecvt_utf8_utf16 and codecvt_utf8 with it.
Not sure if that works.
 
@MooingDuck True. Just wanted to see if I could avoid it.
 
@MooingDuck What?
 
5:56 PM
Ok. Let's say we are having a tag game. We have twenty players. We want one "it" for every five real players, where real players turn into "its".
 
Divide by five?
Round up or down appropriately.
 
@R.MartinhoFernandes wtf brain. 1:5 != 5%
 
but then we have 4 "its" for 16 players.
 
@Pawnguy7 not if you found down
 
@R.MartinhoFernandes What? I thought it used a codecvt facet through the, well, codecvt interface?
 
5:57 PM
@LucDanton That would be too easy, no?
 
Should I just accept that it will be a bit off?
 
Are you saying someone thought 'huh, I can't write the primary template and code against any codecvt; I know! I'll just partially specialize for those two codevt thingies!'?
 
@LucDanton Wait, maybe cppreference is wrong.
Codecvt<Elem, char, std::mbstate_t>
So codecvt_utf16 seems fine...
Weird.
 
What incantation to build libc++ again?
 
@Pawnguy7 if you're going to keep ignoring everyone telling you how to fix it, then yes, do it a bit off.
 
6:01 PM
@LucDanton No idea.
I emerge it.
 
@MooingDuck what fix? You wouldn't round at all...
 
Curse you!
 
@Pawnguy7 16 divided by 5 isn't 4.
 
no, 20/5
 
6:02 PM
@Pawnguy7 why 20? What?
 
6 mins ago, by Pawnguy7
Ok. Let's say we are having a tag game. We have twenty players. We want one "it" for every five real players, where real players turn into "its".
20
 
@Pawnguy7 16/5 = 3.2
 
@Pawnguy7 20/5 = 4, so yes, four its.
 
Are you saying divide, then divide the remaining players?
 
6:03 PM
So what's the problem?
 
no, wait... I see
 
@Pawnguy7 No, I have no idea what your problem is.
 
@R.MartinhoFernandes We want one "it" for every five real players
 
@MooingDuck So divide the number of real players by five...
 
@Pawnguy7 we misunderstood. Divide by six.
 
6:03 PM
@MooingDuck Wat.
 
> rm -f libc++.so
 
What's a "real player"?
 
Why is that a step in the building process?
 
@R.MartinhoFernandes divide players into groups of six. One of them is it, the rest of them are "real players" (not it)
 
one that isn't "it" I think he meant
 
The lounge description always make me smile a little bit
 
@Pawnguy7 I was quoting you, you tell us what it means
 
Oh.
I see.
 
8 mins ago, by Pawnguy7
Ok. Let's say we are having a tag game. We have twenty players. We want one "it" for every five real players, where real players turn into "its".
 
@R.MartinhoFernandes I remember that from my Nokia
 
6:05 PM
in which case 20/6 = 3.3333 its. Round up or down as you desire.
 
Ok. So we have tag. 20 initial people. Now, there are two types: those who are it, and tho who are not. I am trying to get one person who is it for every 5 that are not it, taking into account that, at the end, I want that to be for how many not its there are then, after some of them became its.
 
@Pawnguy7 divide by six
 
Oh.
 
@Luc the problem with wbuffer_convert is that you can only wrap streams of char, though. Meaning you need the right codecvt anyway, which doesn't exist.
 
Sigh.
I should have thought of that.
 
6:07 PM
Oh yeah.
 
Just as a reminder, the codecvt needed here is one from UTF-16 encoding scheme to UTF-16 encoding form.
Kinda easy to implement, actually.
 
I thought we was going with the 'standard facilities helpfully provided by C++'?
 
@LucDanton Yeah, sure, I was just pointing that out to make the sillyness even more obvious.
I can't seem to find a codecvt chaining facility though.
 
@R.MartinhoFernandes std::ifstream >> std::stringstream >> std::utf32stringstream >> std::wstringstream?
 
@MooingDuck Hmm, I was thinking of composing the codecvts, so you could just imbue something and them keep your original intended syntax.
BUT FUCK IF C++ PROVIDES ANYTHING THAT IS FUCKING COMPOSABLE
11
TOO USABLE TO BE MATHY I GUESS
 
Ell
6:12 PM
ahhh robot is shouting I'm scared :(
2
 
</rant>
Ugh, gonna need a bunch of temp buffers.
 
Can dynamic languages get the call stack, usually?
 
Ell
I don't see why not
 
I don't, either, I was just wondering if anybody knows of a language where this is implimented.
 
@Pawnguy7 what do you mean "get the call stack"?
via a few quick google searches, just printing the call stack like for debugging and exceptions is doable in Perl, Python, Lua, and Javascript at least.
 
6:22 PM
I guess I should have been more specific, because, for example, you could throw and catch and exception to get the call stack as a string. I mean in terms of usable information that you could use to tell what method called it. I was thinking how everybody says a disadvantage of global variables is that they can be changed from anywhere, so I was wondering if you could track what changed it.
 
@Pawnguy7 reading the callstack wouldn't tell you who changed a global.
 
Okay, got libc++ running, probably.
 
Imagine the variable is encapsulated. Couldn't you get the call stack when the setter is called?
 
        std::codecvt_base::result out(std::mbstate_t& state,
                   const Elem* from, const Elem* from_end, const Elem*& from_next,
                   char* to, char* to_end, char*& to_next) const override {
            std::vector<char> u8(2*(from_end - from));
            char* last_u8 = u8.data() + u8.size();
            step3.out(state, from, from_end, from_next, u8.data(), last_u8, last_u8);

            std::vector<char32_t> u4(2*(last_u8 - u8.data()));
            char* last_u4 = u4.data() + u4.size();
This is an implementation of out... :(
 
@Pawnguy7 Oh - it's a singleton now, is it :)
 
6:25 PM
Ooops, should be do_out, maybe.
WTF, out is virtual too?
 
I would think most global variable containers would be.
 
What is this? Virtual non-virtual interface?
 
@Pawnguy7 oh, yeah you could do that
@MartinJames globals and singletons are differnet.
@R.MartinhoFernandes for speed!
 
@R.MartinhoFernandes I remember this being brought up a few days ago, but don't recall where. Isocpp group, perhaps.
Okay, so trying to write a test program using std::istream_iterator/std::ostream_iterator: bad idea.
Oh, that's not it. @R.MartinhoFernandes std::basic_ifstream<char16_t> don't work I think.
Fine, std::wifstream then.
 
every time I see that I see wifistream
 
6:31 PM
lol
 
Fuck it, I hope unshift is not needed.
 
lol
it no linky
 
@LucDanton Ugh.
Needs ctype crap?
But I can't test this with wchar_t because sizeof(wchar_t) == 4...
 
@R.MartinhoFernandes Ye.
@R.MartinhoFernandes Why is that a problem?
 
Fuck this enterprise.
@LucDanton Because it doesn't test what I want to test :/
Though I could always test reading a UTF-32 file to a std::u32string instead.
No, wait, not gonna work!
No way to read UTF-32 from a file.
HAHAAHAHAHAHA
This is sooooooooooooooo fucked up.
Yeah, I'm jumping ship.
Dinner is more important.
Later.
 
6:43 PM
@R.MartinhoFernandes std::basic_ifstream<char32_t>?
 
@R.MartinhoFernandes Pretend the extra bits are not here?
Yay, got my 'toolchain' up: clang++ -std=c++11 -stdlib=libc++ -L/usr/local/lib -Wall -pedantic main.cpp -lsupc++ is easy to remember right?
 
Ell
@BartekBanachewicz do I need a vertex buffer to make a VAO? I'm confused as to whether it's part of the VAO's state or not. I'm reading this: opengl.org/wiki/Vertex_Array_Objects#Vertex_Array_Object
 
@LucDanton I made a button. I clicks the button.
 
@Ell vbo binding is
 
@MooingDuck wat does butan do
 
6:49 PM
@Ell wrt triangles and identity, yes
@Ell gDebugger has a new version somewhere
 
@LucDanton compiles and links all .cpp files in the cwd.
 
with most of those same settings
it works for 90% of what I'm doing, for the rest I can copy-paste and modify.
because I can't remember commands.
 
related: I do bad on linux.
 
6:52 PM
@MooingDuck I use build systems.
 
Ell
@BartekBanachewicz Right. Do I have to include it in the state?
Meh. I'm not sure of what I'm trying to do
@MooingDuck linux is easy :P
 
@melak47 pres butan
So, where do I get my hands on some tasty UTF-16 data?
 
@Ell what do you mean? it's a part of the state. If no buffer is bound to vao, binding a vao should unbind the current one. You should check that in spec
 
I guess I can fetch something non-BMP and iconv it.
Let's google some viking runes!
 
@LucDanton notepad
 
6:54 PM
@MooingDuck Wow that's just evil.
Uh how much is outside the BMP?
 
hey guys I saw this while(scanf("%d",&t)==1) somewhere ,what does 1 mean
 
0xFFFF right? Those runes seem perfectly cromulent then.
 
@LucDanton anything U+0x10000 or higher?
 
@Ell well...
 
@user2371549 the number of inputs correctly read
 
6:57 PM
@LucDanton Fictional fantasy languages?
 
@MooingDuck Oh yeah, misread that.
Damn, won't render Linear B.
 
Ell
@BartekBanachewicz At the minute I want to just avoid having to do glVertexAttribPointer
 
thanks mooing
 
@Ell that one will certainly be saved
i am not sure about vbos tho
 
what if I write >=1 @MooingDuck
 
6:59 PM
No bananas either? Aw.
 

« first day (948 days earlier)      last day (4001 days later) »