« first day (648 days earlier)      last day (4316 days later) » 

9:18 AM
EDIT: just looked it up, and nope, that's not how it works :)
 
9:30 AM
ah, how does it work then? :)
 
Just to be clear, I was correcting myself (see the history), not you or anybody else.
 
yeah, but what you said seemed to coincide with how I understood it :)
 
@jalf It just transforms your code into a stack machine.
No craziness going around with stack frames.
@ecatmur Why do you assume generators need their own stack frame?
A generator can be implemented with a regular-ish forward iterator.
You just need a compiler that can do that hard work for you.
 
@jalf Well, in the examples that I looked at, the return type was already IEnumerable<T>, and I'd rather say nothing than to say something that is half true :)
 
@jalf Sorry, I meant "state machine".
 
9:36 AM
@ecatmur Well, you could do it with multiple threads, so the generator has its own call stack:
3
Q: Simplify writing custom iterators in Java

FredOverflowWriting iterators for custom collections in Java is quite complicated, because instead of writing straight-forward code that provides one element after the other, you essentially have to write a state machine: public class CustomCollection<T> implements Iterable<T> { private T[] ...

 
@R.MartinhoFernandes Yeah, remember that one? ;)
 
No.
@FredOverflow I think Java's design of (test, move+get) is very painful to implement. I wrote C# enumerators before yield and (move+test, get) seems a lot easier on the implementer. And C++'s (move, get, test with a pair) isn't very nice :(
 
@ScottW the equivalent would be the base class 'object'
 
@thecoshman No, not really.
 
9:45 AM
@R.MartinhoFernandes I'm talking about implementing a yield statement
 
And other crap. It shouldn't really have all those methods, but well.
 
@R.MartinhoFernandes why not? they both of a way of just having 'data' of no distinct type. Of course with Java you can cast to a 'real' type. I wouldn't recommend doing this, but you can use object as generic type
 
@thecoshman var is not a way of having data of no distinct type.
 
So I'm confused. Does mbrtoc32 (also the c16 version) convert from the implementation-specific encoding of 'narrow' char to UTF-32 or not?
 
@R.MartinhoFernandes what language 'var' are we talknig about here?
 
9:47 AM
Hmm, I answered something by Kerrek on that, I think.
 
11
Q: What does `<cuchar>` provide, and where is it documented?

Kerrek SBThe new C++11 standard mentions a header <cuchar>, presumably in analogy to C99's <uchar.h>. Now, we know that C++11 brings new character types and literals that are specifically designed for UTF16 and UTF32, but I didn't think the language would actually contain functions to conver...

 
@R.MartinhoFernandes I found about it and Google pointed me to that answer.
 
var csharp = new SomeContainer<Foo, Bar>();
SomeContainer<Foo, Bar> java6 = new Somecontainer<Foo, Bar>();
SomeContainer<Foo, Bar> java7 = new Somecontainer<>();
^ C# wins
 
oh, C#
 
9:48 AM
Does that mean that the only way C++11 has to convert from one of the implementation-specific encodings to Unicode are those C11 facilities?
 
@LucDanton And you have to go through the multibyte encoding.
 
@ScottW I think what he was asking was "Do you mean C# var or JavaScript var?"
 
There's no direct conversion from the narrow or wide charset.
@ScottW Hehe, you quickly realize you don't need that explicitness that much.
 
I think many people were afraid of var in C# and auto in C++ because they confused it with dynamic typing.
 
@FredOverflow indeed I was
 
9:52 AM
@R.MartinhoFernandes What are you wishing for right here?
 
@LucDanton As is you need two steps to get from one of those to an Unicode encoding. That's a bit annoying because it means writing yet another of those painful iterators.
 
@R.MartinhoFernandes I thought those were narrow -> UTF-16/UTF-32.
 
so, is var much like auto?
 
@ScottW I think a lot of language process is hindered because people are used to doing it "the old way" and don't see the point. Which is also a good thing, of course; you can't put everything into a language just because it seems cool.
@thecoshman C# var is almost exactly like C++11 auto, except that C++11 allows corner cases like auto a = 1, b = 2; whereas C# doesn't. Also, var was a new keyword, whereas auto was recycled.
 
@FredOverflow exactly like, or just very similar?
 
9:57 AM
@LucDanton I might be confused, but I was under the impression that multibyte != narrow.
 
@FredOverflow how is that a corner case? because it is not exactly clear what type '1' is?
 
@thecoshman Because you could write auto a = 42, b = "hello"; which C++11 does not allow; it only allows the same type to be deduced everywhere. C# never allows multiple variables in one declaration statement.
 
@R.MartinhoFernandes I'm perplexed by the chart at the bottom of this. I think they interpret the C11 text to mean that mbrtoc32 does indeed convert from the narrow encoding. I don't know how to interpret it any other way myself.
 
@FredOverflow ... when using var.
 
@FredOverflow so something like auto a = 1, b = 1.02 is that allowed, presumably deducing a type 'float'
 
10:00 AM
@LucDanton I really, really need to investigate this for ogonek, but it's so messy... :S
 
ogonek?
 
@LucDanton Ah, "An ntbs that contains characters only from the basic execution character set is also an ntmbs. Each multibyte character then consists of a single byte."
(ntbs and ntmbs are "null terminated (multi)byte strings").
 
@thecoshman I don't think it's allowed, let me check.
 
@thecoshman If anything, it'd be a double.
 
error: inconsistent deduction for 'auto': 'int' and then 'double'
 
10:03 AM
@R.MartinhoFernandes Given that the functions are provided in uchar.h which is supposed to give Unicode-related goodies I suppose that table is incorrect and the column is really meant to be 'multibyte'.
 
@R.MartinhoFernandes right
 
Or it seems 'narrow multibyte' seems to mean 'multibyte' with an emphasis that the byte is really stored in char.
 
@jalf Also, gist.io/3166256 if you're really curious.
 
Does anybody actually use the ability to declare multiple variables in one statement for production code?
 
I'm not sure how often you have multibyte arrays of something else than char.
@R.MartinhoFernandes I'd suggest forgetting about the implementation-specific encodings. Maybe bring auto-detection at a later point but requiring the user to be always explicit might be a good start.
That would mean you'd need a big, big warning that any instance of char really means UTF-8.
Since there's no char8_t.
 
10:08 AM
@LucDanton Hmm, but aren't the implementation-specific ones the only ways input comes and output goes?
@LucDanton Oh, there's no implicit encoding/decoding at all.
 
@R.MartinhoFernandes Until you imbue with a different locale, yes.
 
@jalf ogonek sounds like the name of a cute character from LOTR or something.
 
@FredOverflow It's a character!
Meh, doesn't sound as punny as it did in my head.
 
Nothing is ever as good as you imagine.
 
Obj-C is so horrible.
 
10:10 AM
Rubbish name. ;) but sounds like a cool library
 
@LucDanton Hmm. I'm not caring at all for now, anyway.
 
@R.MartinhoFernandes I think I'm starting to get the hang of streams tbh.
 
OMG, you're evil.
 
Your library is called "little tail".
Just FYI
 
10:12 AM
I accidentally fixed a bug today.
2
I still have barely any idea how this app works, but now it does what it was supposed to (well, at least partially0, so whatever.
 
What's funny is that it is used to write Native American languages as well.
 
Speaking of languages, Obj-C is terrible.
 
What's next, you're going to write a cedilla extension to ogonek?
 
wow, bitbucket is shit slow today
 
10:18 AM
Why does @synthesise even exist.
WHYYYY.
 
@Luc Btw, I realized that the interop with legacy APIs doesn't need any doing on my part: first, not all containers can provide a ready made pointer to a null-terminated array of its contents; and second, you can simply basic_string as the underlying container if you need the null-terminated array thing (and I get away with just providing const access to it).
 
@R.MartinhoFernandes I'm not sure I followed the discussion enough to know why this is important.
 
Oh, well, don't mind me then.
 
I would have thought you'd care for ranges in any case, not null-termination.
Oh wait, that would have been the matter of always providing a null terminator for safety right?
 
Right, for passing to Windows APIs or somethings.
So, I made basic_string the default container instead of vector.
Principle of least surprise and all.
 
10:26 AM
And users can use range construction if they want to convert to another container in any case right?
 
@thecoshman bitbucket is always slow. but github doesn't have free private repos
 
@LucDanton Yeah.
 
@bamboon particularly slow then :P
 
bitbucket FTW.
 
GitHub pages and gists are really cool.
 
10:28 AM
hi y'all
does anybody have experience with ffmpeg? I have a question
 
@R.MartinhoFernandes I find it kinda funny that you link on your bitbucket page to your homepage on github^^
 
Are you going with a basic_text, with e.g. native_text, utf8_text, utf16_text, utf32_text aliases as the naming scheme, in the style of std::basic_string?
 
Unless someone knows a better scheme.
 
0
Q: Review of C++ singleton

i_photonOriginally posted on Stack Overflow. So far, I've used this in a few places and it seems solid. This is what I usually do to make a singleton: // Assume x86 for now #ifdef _MSC_VER #include <intrin.h> // for _mm_pause #else #include <xmmintrin.h> // for _mm_pause #endif ...

Another awesome example of truly horrible code
OP goes through the motions and really tries to do everything right. … and does everything wrong in the process
 
10:37 AM
#include <intrin.h> // for _mm_pause
WTF.
 
nope, that’s not the WTF part
 
@KonradRudolph Well, it smacks of "way too much thought put into it".
 
@R.MartinhoFernandes Yes, that describes the code in general. Unfortunately, while certainly too much thought was put into it, on the other hand, too little thought was put into it. So there’s a mis-allocation of thought put into it
 
21 questions tagged 'singleton' on codereview.SE. :(
 
@R.MartinhoFernandes Yes, that’s the real WTF
 
10:48 AM
@KonradRudolph What would you say is the average quality of code you find on codereview.SE?
 
@R.MartinhoFernandes between shit and OH MY GOD
 
@KonradRudolph Read: "...it seems solid. This is what I usually do to make a singleton.." aaaannnnd I stopped reading here.
 
@KonradRudolph That's good, right? Means at least people are not confident in shitty code. says the optimist in me
 
hmm, yes, maybe
it’s just utterly frustrating to provide feedback
it’s a barrel without floor
truth be told, the same would probably true for good code
 
Probably doesn't help that they're trying to do something that can't be solved searching on google.
 
10:50 AM
Good code would make it boring.
 
codereview.SE is a failed experiment in my view
 
It is either something they were too lazy to search for on google or they are trying to do something they really shouldn't
 
I still browse it to see the occasional interesting code, but the ratio of time spent to write an answer / benefit to the community is ridiculous
 
Everything there is too localized.
 
yes, by definition
I do like correcting Python codes because then you can often just refer to the code guideline PEP
 
10:55 AM
I only ever answered one question there. And once more, it was about new+delete.
I'm tired of telling people to stop newing up everything.
C++ programmers learned nothing in 10 years?
 
user784668
@R.MartinhoFernandes Why do you expect retards to successfully learn?
 
lunch
 
@Fanael In my book, everyone starts as a smart person. You need to show me you're dumb for me to assume that.
 
¬_¬ yeah... I think I am going to get me a decent dust mask... stupid lead painted walls
 
user784668
@R.MartinhoFernandes They did by using new+delete.
 
10:59 AM
@KonradRudolph I can't help but notice your use of this idiom.
 
@LucDanton it's quite used in german.
 
What does it mean?
 
@bamboon Also in French.
 
@R.MartinhoFernandes well, imagine how useful a barrel without a floor is. you would have to constantly refill it. -> waste of time and resources
 
@R.MartinhoFernandes 'An exercise in frustration'.
 
11:05 AM
Oh. Thanks.
 
@LucDanton ok, interesting.
 
In Greek mythology, the Daughters of Danaus or Danaids (also Danaides or Danaïdes; ; ) were the fifty daughters of Danaus. They were to marry the fifty sons of Danaus's twin brother Aegyptus, a mythical king of Egypt. In the most common version of the myth, all but one of them kill their husbands on their wedding night, and are condemned to spend eternity carrying water in a sieve or perforated device. In the classical tradition, they come to represent the futility of a repetitive task that can never be completed (see also Sisyphus). Mythology Danaus did not want his daughters to go ahea...
The legend that is referred. (Opening paragraph says right about enough about it.)
 
hi
what's the difference between windows 7 Ultimate N and Windows 7 Ultimate
 
user784668
@techno The letter "N".
 
@LucDanton Oh noes. I can't click that. Wikipedia's greek mythology category is particularly archive binge-y for me.
 
11:07 AM
@techno The N edition (or editions? I forget) have bits removed, regarding the media facilities (so at least Windows Media Player).
As requested by whatever European instance judged on the matter.
 
N edition
 
N lacks WMP, E lacks IE.
There are also some with bits removed for sale in Korea.
 
@techno No, editions. E.g. Windows 7 Ultimate N and Windows 7 Home N (or whatever is the name for that edition.) They all lack WMP, not just the Ultimate one.
 
Do you think I should always perform validation in my encoding classes? Or provide validating and non-validating interfaces? I'm thinking of converting from A to B through codepoint (which is basically how you convert between arbitrary encodings as I have it): codepoint -> B would perform unnecessary validation.
 
@R.MartinhoFernandes don't pay for what you don't use. If I know my data is valid, I don't want to have to pay for validation
is probably the best guideline to follow
 
11:15 AM
@R.MartinhoFernandes can't validation be factored out?
 
@Cheersandhth.-Alf Yes, making validation separate is a third option I forgot to mention.
 
i know, it might seem that an extra pass would be inefficient. but it can be amortized over all subsequent operations
i think the bestest is to collect the knowledge of "has been validated" via the type
hm, good morning! i must have some coffee
 
Yes, I have am writing types that carry those semantics.
 
i have a nice platform-relative unicode code point type if you want
i'll post it
 
Hmm, what do you mean?
I just use using codepoint = char32_t;.
 
11:19 AM
i meant, strongly typed
that's nice for carrying semantics :-)
 
Ah.
Well, looking at more code can only help :)
 
sry
the thing is, it's different size depending on the platform, like a C++ basic type should be he he :-)
 
Ah, so it's for code units.
 
yes. but that posted code is in the middle of edit. it's just the idea, but it does compile/work
 
int i = 1; i /= 0; // YOLO
 
11:24 AM
@DesmondHume many compilers will catch that at compilation time
 
@Cheersandhth.-Alf Doesn't matter, had division by zero.
 
@DesmondHume but do note that on the math side, 1/0 is just impractical, not meaningless (but 0/0 is pretty meaningless)
 
0
Q: advantage of array of enum over constant and macro?

kapildditHow enum will be more useful than #define and const. memory and code visibilty point of view and readability point of view. can I convert (type cast) enum to array of int, If I have taken all value within integer.

Possible duplicate
 
@Cheersandhth.-Alf I think the integer data model used by computers would have some benefits employing the notion of infinity. Like 1/0 = infinity. infinity*var = infinity ..., which would reduce to MAX_INT or MIN_INT (for negative infinity) when passed to devices that are more narrowed in handling integers, like monitors that can't display color components > 255 and etc.
 
user784668
@DesmondHume You're reinventing floating point. Except that you want no point.
 
11:31 AM
There's just no point.
 
user784668
Do not try and float the point. That's impossible.
 
@Cheersandhth.-Alf My current approach has a type to represent an encoding (here scroll down a bit to EncodingForm), and that type dictates what the code unit is. The idea is that users don't deal directly with code units except when interoping or serializing.
It is intended they pass around actual codepoints (i.e. no encoding, or UTF-32 depending on your pedantry level) or ranges of codepoints (which can be lazy ranges, or actual containers). I'll provide one such range of codepoints, with strong validity invariants.
> Polio vaccination campaign is a secret Jewish-US conspiracy to annihilate all Muslims.
In Pakistan.
 
@R.MartinhoFernandes That table needs fixing.
 
@LucDanton What exactly?
 
11:36 AM
@R.MartinhoFernandes "Annihilate" Muslims with anti-Muslims in high energy accelerators?
 
@R.MartinhoFernandes Second entry should contain u32 as the value I suspect. Also third entry leaves me non-plussed. Does the return type agree with the returned value?
 
user784668
lol
 
@LucDanton Oh, right. I should have mentioned I changed that document a lot lately and it might be full of bugs by omission of fixing.
Yes, unmap returns iterators not uints.
 
@R.MartinhoFernandes huh, where did that idea come from? i'm continually astounded about exactly how inane ideas can be sold to the religious public (in US, Israel, Pakistan, Saudi, Iran etc.). not to mention Africa: a recent Nobel price winner thought aids was an American experiment gone awry
 
@LucDanton It just occurred to me that even if it were common in English it would be “barrel without bottom”, not “floor” … shame on me. My English seems to deteriorate of late
 
11:42 AM
ah twitter
 
@R.MartinhoFernandes To be fair, they have a point: they fear infiltration by Western spies and this is exactly what would actually happen, and has happened before (in the preparation of Bin Laden’s assassination)
So it’s strictly the US’ fault
 
@R.MartinhoFernandes And India has nothing to do with it??? Such a shallow thinking..
 
I don't care whose fault it is. It leaves me speechless either way.
 
@DesmondHume it may be that now we have enough bits for that, yes. it's nearly always been that way for floating point
 
11:45 AM
@KonradRudolph I'm pretty sure the annihilation of all muslims has never happened before
 
modulo details
@jalf as part of western culture, we should be ashamed that christians did more destruction than the muslims of the library in alexandria
 
Libraries are not people, silly.
 
it was whacked twice, first by a sort of hobbyist muslim and then more professionally by christian idiot
 
@jalf No, the poster is of course stupid propaganda. But the underlying fear, and the actual reason why the Taliban officially forbid the vaccination campaign is unfortunately sound
 
@Cheersandhth.-Alf It's too late for the transition to integer infinity anyways. Tons of code that rely on the old style bit behavior would have to be rewritten/revisioned ground up.
@Cheersandhth.-Alf The momentum has been lost like back in 90's..
 
11:49 AM
well, you can always use double as integer: with IEEE 754 it has good integer range +/- 0 ... 2^51, IIRC
 
@Cheersandhth.-Alf Oh, that's interesting. Gootta look it up. Gracias
 
^ Cleaned up a little
oh, i got the details wrong about library of alexandria! no matter though
 
AFAIK it was destroyed by earthquakes.
 
@Cheersandhth.-Alf May I ask what your CPP_STATIC_ASSERT roots into depending on the platform?
 
it was partially destroyed four times according to wikipedia
muslims came last
"Omar replies: "If those books are in agreement with the Quran, we have no need of them; and if these are opposed to the Quran, destroy them.""
^ Good argument!
 
11:58 AM
@DesmondHume The Boost one. Or a similar implementation.
 
@DesmondHume just static_assert, but for C++03 it used to translate to a typedef char Blah[(e)? 1 : -1]; with special fixup for the typedef bug of g++
 
Also if you feel clever you make sure to generate a unique identifier for the typedef.
 
thanks
 
@LucDanton yes, that's the special fixup. not needed for standard c++, but needed for tg++
 
Every time I look at the ICU docs, I found another nasty.
Lunch.
 
12:39 PM
I like how every language defines 'truth' slightly differently
 
user784668
@thecoshman Truth is there's no truth.
 
Tarski's is the only useful definition.
 
go on...
 
'P' is true if and only if P.
It's not very useful, admittedly.
> All Germanic languages besides English have introduced a terminological distinction between truth "fidelity" and truth "factuality".
Truth has a variety of meanings, primarily being in accord with fact or reality, fidelity to an original or to a standard or ideal and, in common usage, constancy or sincerity in action or character. The opposite of truth is falsehood, which, correspondingly, can also take on a logical, factual, or ethical meaning. The concept of truth is discussed and debated in several contexts, including philosophy and religion. Many human activities depend upon the concept, which is assumed rather than a subject of discussion, including science, law, and everyday life. Various theories and views o...
 
Hey, why do YOU get to be the president of Tautology Clu-- wait, I can guess.
4
 
hi
is it hard to become a Microsoft Bizspark member?
 
Harder than it is to become a member of Tautology Club.
 
seriously
 
@techno you better ask microsoft bizspark
 
12:59 PM
The only way to become a member of Tautology Club is to become a member of Tautology Club.
 
user784668
@techno It's as hard as becoming a Microsoft Bizspark member.
 
1:21 PM
Without proper kerning, everything on the internet is just a dick away (similar with proper kerning though). h/t to https://twitter.com/jbrownridge/status/228087090246737920
3
 
1:31 PM
@LucDanton I noticed that you commented on a C++ question regarding a suspicious but valid assignment operator. How come it is valid? Shouldn't it return a reference to this after replacing the values of this? stackoverflow.com/questions/11650369/…
 
@ManofOneWay You can write int operator=(double); if it's your fancy.
 
Chat is so quiet today. It's not distracting me from work like normal. I don't know what to do with myself.
 
@SamDeHaan do something crazy, like work
 
1:48 PM
@LucDanton If you disapprove of assignments in expressions, you can even write void operator=(double);!
 
@ecatmur I agree. Let the mysteries of assignment remain at the bottom of the sea with Cthulhu
 
@Jim Be happy, I accepted your answer..
Now I need to waste 2 points, or gain 3. I liked having a "divisible by 5" rep.
 
@ecatmur A BETTER REASON IS JUST TO AVOID NEEDLESS VERBIAGE AND INEFFICIENCY. UNFORTUNATELY IT NO WORK WITH C++11 "delete".
 
@Cheersandhth.-Alf It does work with delete.
It doesn't work with default :(
 
@R.MartinhoFernandes NO, I DON'T THINK SO SRY
 
1:57 PM
Why are you using caps?
 
@R.MartinhoFernandes CAPS LOCK KEY WORKS
 
@Cheersandhth.-Alf I DISLIKE CAPS LOCK.
 
@Drise Y? IT IS big KEY. IT MUST BE IMPORTANT!
 
@Cheersandhth.-Alf sHIFT IS BIGGER!
 
1:58 PM
@Cheersandhth.-Alf Yes, it's important because Escape is too far from the home row. So Caps Lock is important to turn into Escape :P
 

« first day (648 days earlier)      last day (4316 days later) »