« first day (598 days earlier)      last day (4351 days later) » 

5:01 PM
Hey, Tony... Amazing link. Ahahah, I'm laughing my ass off, thanks mate.
 
@DomagojPandža It's been posted 9999 times
 
@jonathan it compiles fine for me with -std=c++0x, but it doesn't run fine :)
 
@melak47 -pthread and it'll run
 
@DeadMG First time seeing it, still awesome. :Đ
 
@johnathon indeed
 
5:04 PM
@bamboon just fyi, im doing this via windows
 
@johnathon oh, that's a whole different story
mingw?
 
I have 4.7 on Windows. Lemme try.
 
@bamboon um.. it's a prebuilt package that puts mingw on it with the latest gcc (im installing 4.7 now, ) and it auto hooks stuff up with the windows shell (which is uber nice) and it'll build simple stuff just fine, but im figuring the libstd or something with the experimental branch is botched
 
@bamboon same compiler, if all your going for is compiler messages, it's exactly the same
 
Oh, I get it.
 
5:07 PM
@MooingDuck yuppers, and even more so, iv'e seriously considered switching to gcc as a main compiler.. just cuz
 
MinGW doesn't have the threading stuff in.
 
@RMartinhoFernandes don't make me cry mate by telling me that
 
All the threading stuff is conditionally compiled on _GLIBCXX_HAS_GTHREADS. The headers are there, but the contents are #ifed out.
 
Just finished that stolen-hacker box video... amazing
 
@RMartinhoFernandes which would explain why gcc is complaining about incomplete future types
 
5:10 PM
@RMartinhoFernandes mingw-64 has experimental threading supoprt
 
> Freedom from porn
is that a good thing?
 
@MooingDuck funny because i am using mingw-64 i think
 
I'm using STL's build.
 
@johnathon check the headers then. Maybe it was only ruben's personal builds
 
@MooingDuck sighs lemme dig into them
@MooingDuck funny , i do have the i686-mingw32 bins
@MooingDuck and x86_64-w64-mingw32 bins
@MooingDuck yea, directly calling either one on the cpp gives the same compile errors
 
5:19 PM
Doesn't pthreads work on Windows?
 
@RMartinhoFernandes There are some wrapper libs, afaik
 
I wonder why they didn't just implement it the std thread stuffs on top of it.
 
easier to just use the native Windows API?
 
Yes, because they already have that implementation for non-Windows systems.
Theoretically, it would be a zero-line port.
 
true
 
5:23 PM
@MooingDuck I meant it more in the way of, "it works on linux" -> doesn't mean it has to work on windows mingw out of the box. of course compiler warnings are the same
 
I'd certainly expect a direct WinAPI later sometime, but for now I wouldn't mind just going with pthreads on top.
 
well with ms pushing metro so hard that their excluding a compiler capable of compiling command line c++ applications from both their vs express and their windows 8 SDK c++ on windows for hobbiests and such (open source as well) is dead
 
eh, I doubt it's dead. CLang may step into the void.
 
@DeadMG all i can say is i hope they do , however chandler was begging for developers to help port clang to windows at the last build conference
 
@johnathon Hell, if he wants to offer me a job doing it...
 
5:25 PM
@DeadMG lol, i don't think it pays
 
well, unfortunately, I need moolah to live
 
@DeadMG You'd fill it with extensions!
 
@RMartinhoFernandes I might... introduce some new awesome features... in my spare time? :P
 
@DeadMG yea, we all do, LMAO @RMartinhoFernandes , but still all the same it's annoyed me enough to want gcc over msvc ... and that's a sad sad day for ms
 
oh robot
1
Q: Endianness fun with SHA-2 algorithm

DeadMGI'm trying to write a SHA-2 implementation, but the result keeps coming back incorrect- I've tested on such things as the empty string. I implemented it in two steps, preprocessing and primary body. template<typename T> struct Output { std::array<T, 8> h; }; template<typename ...

help plix, i r teh stuck :(
 
5:28 PM
Oh gawd, wall of text! </joke>
 
ol
 
@DeadMG @RMartinhoFernandes the big deal about the threads though is the library that ms build their threads on top of is an open standard, eveyrone's free to impliment it everywhere.. all the same though i know posix's feeling twards ms, but from a developers standpoint itd be uber nice to have a common underlining api from with which to build from
 
@johnathon Yeah, it's called TBB.
you'd be insane to want pthreads over that
 
@DeadMG 0oh i know. Credit Intel with that one though
 
Microsoft have PPL too, which is also sweet
 
5:30 PM
@DeadMG all the same, what's even funny about that is , intel obviously has free compilers for c++, and their nice.. really nice.. if you run linux.
 
no, I'd never use ICC
 
@DeadMG Debugging hash algorithms is like, impossible.
 
too much "We hate AMD and are going to fuck over all our code on AMD processors".
 
You have absolutely no idea what values are expected.
 
it's like using GNU software- they're so caught up in their petty war that they can't think about the actual users
 
5:31 PM
Users make everything hard.
 
Except me.
 
@DeadMG LOL yea, to the point to which MS is pretty much the only viable option for a half ass reasonably compliant compiler and std lib for the windows platform
 
Not really, no.
GCC is light years ahead of MSVC in compliance.
 
"Half ass"? That's a contestant for overstatement of the year.
 
compliance isn't really the problem, it's about features
 
5:33 PM
And it works fine on Windows.
How about that.
 
I mean, Clang doesn't work on Windows, for one
 
Why the fuck isn't there a "Extract Superclass" feature in VS?
 
@CatPlusPlus compile something with <future> in it with gcc on windows
 
@EtiennedeMartel On R#.
Everything is on R#.
VS sucks without it.
 
@EtiennedeMartel WTF is "Extract Superclass"?
 
5:33 PM
So, one part of stdlib doesn't work, oh my.
Use Boost.Thread.
GCC still wins with MSVC.
Library, not important.
Language features, important.
 
well, I would have to convert all my code using MSVC's SSE intrinsics, and compiler extensions for COM, and the PPL
 
@RMartinhoFernandes Fuuuuck. Eclipse has all kinds of cool refactoring features right out of the box.
 
Yep. VS sucks.
 
@DeadMG Like "Extract Interface", but for super classes.
 
@EtiennedeMartel WTF is "Extract Interface"?
 
5:35 PM
Hello
 
It squeezes the class real hard until all interface comes out.
 
@DeadMG To be honest, the SSE intrinsics shouldn't be to difficult. A simple search and replace should work.
 
@CatPlusPlus With a nice "pop" sound.
 
Intel's SSE intrinsics are in xmmintrin.h.
 
@CatPlusPlus assume im a newbie for a minute. Just learning c++, and i pic up some futuristic book from somone of the likes of scott myers, and i figure out that i cant use the stuff in that book with vc express 2010, so off to go install gcc i go, which is a painless process btw,
however when i go to compile said example from the futuristic book i get a screen full of compile errors because the library the book says is standard and is supposted to ship with ANY STANDARDS COMPLIANT COMPILER is fucked up
 
5:36 PM
You don't even have to replace anything.
 
@johnathon C++11 is rolling out.
You can't expect everything yet.
 
@johnathon And I care about that, because?
 
this basically means "Can use library in commercial software and shit", right?
 
@DeadMG GPL? No.
 
5:37 PM
talking about the Runtime Exception
 
Well, yes, if said software is released as GPL.
 
Yes, using libstdc++ doesn't make you GPL.
 
>As a special exception, you may use this file as part of a *free* software
library without restriction.
 
does that mean "Not GPL but must be free in some description"
 
5:39 PM
The library is free.
 
@DeadMG just means you have to ship the code with it, your free to charge for it, think free as in freedom of speach, not free beer
 
He knows what "free" means.
 
cause, IMO, having the PPL is an excellent reason to stick with Visual C++
 
@CatPlusPlus probably more so than i
 
Anyway, ask a lawyer.
 
5:40 PM
and I wouldn't want to go GCC unless I can grab TBB on the cheap for commercial
 
> Hopefully that text is self-explanatory. If it isn't, you need to speak to your lawyer, or the Free Software Foundation.
Well, it isn't.
 
Anyway, I'm going to sleep. Bye.
 
@CatPlusPlus Seems to me they mean that libstdc++ is a free library, not that your code has to be free
 
But good god do they need a ghost writer
 
5:41 PM
@Collin That's what I said.
 
Don't stay.
 
@CatPlusPlus Sorry, meant to append "I agree" to that one
 
My brain is no longer functioning.
 
I'm going to sleep all day tomorrow.
 
5:42 PM
@CatPlusPlus good night
 
@Collin It's lawyerese. What did you expect?
 
@CatPlusPlus err, day
 
man
I ate badly yesterday#
was not only very sick, but was still painfully sick when I woke up
first time thats happened in a while
 
You ate Pringles?
 
no
too many cookies
 
5:43 PM
@DeadMG Is yesterday# the .net version of yesterday?
 
went through the Pringles without too much issue, actually
 
Wouldn't vegetable stew or something be a better fit for your stomach?
 
I'm leaving. See you later.
 
@RMartinhoFernandes Don't leave us. We can change!
 
@FredOverflow Sure, but that would mean I'd have to cook it.
 
5:45 PM
@DeadMG So you'd rather be lazy and have stomach ache?
 
It's a delicate balance.
 
Laziness is important.
 
Only if it gains you something.
 
one, the longer I stay in the kitchen, the greater chance I will have to interact with my flatmates
 
flatmates in deadmg's flatland
 
5:47 PM
two I have no idea how to cook such things
 
Flatlanders?
 
@DeadMG How many flatmates do you have? What do they do?
 
@FredOverflow two and no idea
 
Suck donkey cock, I presume.
 
How long have you been living with them?
 
5:48 PM
8 months and 5 months
 
So 13 months!
:p
 
while coding libraries, it's hard to balance speed vs exception checks :/
 
exception checks?
 
use policy class /done
 
What is an exception check?
 
5:50 PM
@StackedCrooked in this case I'm transforming between unicode codepoints and utf8, and trying to determine when and where to have if(X) throw exception; I can put it everywhere, but it would probably be very slow.
 
whener possible
 
@DeadMG I'm thinking that's what I'll do, until I profile. I can always remove some later.
 
It's better to remove the walls and pass a little bit slower than ram into a wall at high speed. :Đ
 
You can always go the take the ugly macro route: THROW_IF(Condition);
And make the macro disablable.
 
@StackedCrooked it's not a code pretty thing, it's a over/pre optimization thing
@StackedCrooked oh, that's an interesting idea too. That appeals to me more than it ought. I'll avoid it.
 
5:53 PM
no it isn't
if desperate for customization, use policy class
 
I'm tired of sifting through the log file, I need to rest a bit. Some multilinear algebra exploration will do me good, me thinks.
 
Are you checking for internal programming errors or for corruption in the input data. In the latter case I think you must check it.
I've been messing with policies probably for over a month now.
 
@StackedCrooked I'm intending to check for caller-error
 
Startin to get the hang of it.
 
I never thought about it before, but to get the correct semantics for std::next(std::istream_iterator<int>(std::cin)), that requires the iterator to keep track if it's been dereferenced or not so it knows how to advance correctly.
 
5:58 PM
@MooingDuck Why?
 
@MooingDuck Isn't it an InputIterator not a random access one?
 
@DeadMG lemme think, I might be wrong
@awoodland yes
 
everything gets more clear when one understands it
 
@DeadMG it could do other things instead, but everything I can think of involves more overhead over ++internal_iterator
 
5:59 PM
seems to work fine
 
@DeadMG ah, that would work
 
it's the obvious implementation
 
ah, because the stream stores the "current" position, which doesn't happen in my code.
I'm trying to write a utf8 input iterator, and I can't think of a way to keep operator++ simple. (iterator keeps another iterator internally)
wait, what I currently have doesn't work either
I can't just have the internal iterator for state, I'll have to keep additional information for state to tell if it's been dereferenced or not
 
@EtiennedeMartel You're reminding of this song's lyrics.
 
is there a rule that each input iterator must be dereferenced at least once before incrementing? That would make this easy.
@StackedCrooked I'm imagining "baby elephant walk" in my head :/
@StackedCrooked I can't make out most of the lyrics, but it has a neat sound
 
6:08 PM
why not just use the technique I showed?
 
@MooingDuck But that doesn't have "Shit!" in the lyrics.
 
@DeadMG my utf8 iterator is a class that uses another iterator underneath, your technique only applies to streams. Your technique attempts to dereference pass the end, but since it knows it's at the end, it doesn't do anything. My iterator doesn't know when it's at the end
 
@DeadMG Because it's shit!
 
nor should it, because that's the job of another iterator
1. Store codepoint. operator++: Read UTF8 bytes until you have enough. Store into codepoint. Dereference: give out codepoint. done.
 
@DeadMG That dereferences past the end of an array when iterating over an array
 
6:13 PM
@MooingDuck Yes, dereferencing an end iterator is UB. So?
 
@RMartinhoFernandes so DeadMG is telling me to do that
 
@MooingDuck No, I'm telling you that it's the job of != end() by the user to prevent that.
 
He's telling you to read and store a codepoint on ++, and simply return the stored value on *.
 
@RMartinhoFernandes I've read what he said several times, and I can't think of how that doesn't dereference the end iterator.
oh, yes I see, it's a communication thing, I wasn't clear in how my code works.
 
6:15 PM
@MooingDuck It doesn't, because it's the job of the user to deal with that scenario.
 
@MooingDuck How would it? Can you give an example?
 
template<class char_iterator>
class utf8_iterator {
public:
     codepoint operator*() {????}
     utf8_iterator& operator++() {????}
protected:
     char_iterator p;
};
So "reading in enough chars" would dereference the end of the char_iterator
 
@MooingDuck Caller's problem.
 
@DeadMG not in this case, the caller has no way to prevent it.
 
of course he does
 
6:19 PM
@MooingDuck If the source has bad UTF-8 throw.
 
utf8_iterator<T>(begin()) != utf8_iterator<T>(end()).
 
If ++ reaches the end of a valid UTF-8 stream, make this iterator an end iterator.
 
@RMartinhoFernandes how do I know that char_iterator is a the end without more state?
I still think you two have completely misunderstood me :(
 
You need an end iterator for the source too.
 
you're violating SRP
 
6:21 PM
@DeadMG SRP?
 
you're not just going "I'm taking a UTF-8 source and iterating over it as codepoints"
 
@DeadMG No, he's not.
 
you're also going "I'm taking an arbitrary stream of characters and validating it as UTF-8 and then iterating it"
which is fail
 
No.
It needs the end iterator even without that.
 
one iterator to validate it and stick it in a known range, and another to iterate over it codepoint-wise
@RMartinhoFernandes The validation does. The codepoint iteration doesn't.
 
6:22 PM
@MooingDuck This is one of the commonly given problems of iterators: given a single arbitrary iterator you have no idea if it's usable.
 
@DeadMG I don't see how you could do codepoint iteration without the end iterator
but you guys are right, I do need an end_iterator member. Oh well.
 
@MooingDuck As I just showed. All you need is operator!= to compare the char_iterator.
 
ah Single responsibility principle
 
you will never go past the end because, since the sequence is already validated, you know it contains a round number of codepoints
 
@DeadMG Yes, but you can ++ to the end iterator.
 
6:24 PM
so? you can ++ to the end iterator in most iterators..
in fact, in pretty much all of them
 
Suppose there's only one codepoint. You should be allowed to auto it = begin(); ++it;.
 
@DeadMG you said that ++ should read in the next codepoint earlier.
 
How do you implement operator++ in a way that you don't dereference the underlying end?
The inner iterator is one ahead.
 
ok, so operator* reads in the codepoint begun by the byte currently pointed at by char_iterator.
and operator++ increments it to the next byte after that
 
Ok, so I had a question: stackoverflow.com/q/10900281/868546. But now I can't reproduce the error and no solution was really found.... Should I delete the question, or?
 
6:28 PM
@DeadMG the inner iterator is advanced by the operator* as well, since utf8 is multibyte. So before operator++, the inner iterator may point at the beginning of either the "current" or "next" codepoint, depending on if it was dereferenced.
 
I'd delete it, if still allowed.
@MooingDuck He's suggesting you advance a copy each time.
 
@MooingDuck Why on earth would you do that? Just copy it.
 
oh wait, having an end iterator doesn't solve my problem.
@RMartinhoFernandes can only dereference once for input iterators, that doesn't work
oh wait, does that work?
what the frick? That's strange.
 
The inner iterator is input?
 
can you do that?
 
6:29 PM
No, you can't.
 
@RMartinhoFernandes I'm thinking of input_iterator<int>(std::cin)
 
You can only do that on forward iterators.
 
your algorithm cannot work for input iterators
so what's new?
 
@RMartinhoFernandes I thought so
 
Stream iterators are single pass.
 
6:30 PM
@DeadMG sure it can, I just have to keep track of if it's been dereferenced or not
 
Or use an end iterator.
Ranges are so much better.
 
@RMartinhoFernandes end iterator doesn't solve this problem
 
@RMartinhoFernandes wait, yes it does, I forgot the implementation for a sec
 
Ranges!
I want freaking ranges.
 
6:32 PM
@MooingDuck That's just silly.
it's like saying "I can make bidirectional iterators into RA iterators by just using std::advance."
technically, it might compile, but it's not really going to produce the intended effect
after all, if you're reading from a stream, what guarantee do you even have that it contains valid UTF8?
 
@DeadMG takes less state than using an end iterator and pre-dereferencing the codepoint.
 
whatever you're doing, you need to extract it from the stream first, then validate it, then you can iterate over it
 
@DeadMG I can validate as I go, the bool is just to assure that each cp is "dereferenced" once exactly always
 
@MooingDuck Violates SRP.
 
@DeadMG 99% of the time I'm going to be iterating over the contents of my unicode string's array.
 
6:34 PM
> To fix a dead motherboard, bake it at 200 degrees for 8-10 minutes.
Sure.
 
then why are you making the general case needlessly complex?
 
@MooingDuck Tag dispatching can help.
 
@StackedCrooked Wait, really?
 
just introduce a single function for the input iterator case which validates the stream's contents and returns as a unicode string array.
 
@DeadMG I can't think of a simpler way to do what I'm doing.
 
6:35 PM
then just do normal, sane, bidirectional iteration
 
@StackedCrooked For certain values of dead, that may work
 
@StackedCrooked you can fix some stuff by baking it
 
@MooingDuck So, increment does nothing?
 
@RMartinhoFernandes most of the time yes
 
6:37 PM
That breaks std::advance.
 
i'm watching this, should be fun
lulz
 
@RMartinhoFernandes input_iterator& operator++() {if (!deref) *p; deref=false;}
 
Holy crap.
 
@RMartinhoFernandes Nothing "Holy" about it
 
@StackedCrooked Thats powerful
 
6:40 PM
Lemme try and break that...
 
@RMartinhoFernandes I can't think of any other way to transform from`istream_iterator` (in utf8) to something that produces unicode codepoints
 
A reflow oven is a machine used primarily for reflow soldering of surface mount electronic components to printed circuit boards (PCB). Types of reflow ovens Infrared and convection ovens The oven contains multiple zones, which can be individually controlled for temperature. Generally there are several heating zones followed by one or more cooling zones. The PCB moves through the oven on a conveyor belt, and is therefore subjected to a controlled time-temperature profile. The heat source is normally from ceramic infrared heaters, which transfers the heat to the assemblies by means of ra...
 
@MooingDuck In two stages.
 
It's a poor man's version of that
 
@Collin sounds like. But still awesome.
Worst case, you have a more dead motherboard.
 
6:44 PM
@DeadMG what are the stages?
 
Screw that. Just make istream_unicode_iterators and work directly on the stream.
 
@MooingDuck 1. Take input and validate it, and return it as utf8string. 2. Iterate over known good utf8string's contents.
 
@RMartinhoFernandes and write most of the same code again?
 
Needlessly limits the use cases, IMO.
@MooingDuck istream_iterators are really small.
 
6:46 PM
Shoulder door busting hurts, trust me.
Nobody ever wins.
@RMartinhoFernandes That's what she the compiler said?
 
@RMartinhoFernandes but I have to have the utf->codepoint conversion code again, but written in a different way.
and again for ostream iterators
 
nothing wrong with this
 
@MooingDuck Not really. Write a function that takes a pair of iterators and extracts a codepoint. Use temporary istream_iterators with it.
 
Oh, btw, does Gravatar not work? I haven't been able to get my avatar....
I also never got a reply from support...
 
@DeadMG Runs the codepoint extraction logic more than once!
Caching can help though, and be done with no overhead with an intrusive "optional" that uses the high bits of a char32_t.
 
6:50 PM
no it doesn't
 
@DeadMG for random access, correct
@RMartinhoFernandes not in this case
 
one of them validates and extracts, the other simply reads
 
I saw no extraction there.
 
the first one can take istream_iterators, the second doesn't
 
so what about a company that does a tech test and gives you 3hours to do it?
 
6:51 PM
@RMartinhoFernandes Oh, it's implied.
 
@RMartinhoFernandes I don't think that works, you'd have to advance an istream_iterator to the end of the codepoint you're trying to extract to pass to said function
 
@TonyTheLion That's a long test.
 
for some reason that sounds very wrong, if they need that much time to judge you
 
@MooingDuck ARRGFH, do I need to write it?
@DeadMG Which function does it?
 
they might have just been bitten by candidates in the past who sucked and passed a 1hr test
@RMartinhoFernandes The first one, that returns a utf8string.
 
6:52 PM
lol
 
@DeadMG Oh wait, I didn't notice the function on top.
It's not streamable.
 
You have to load the entire thing eagerly.
 
yes, absolutely you do
welcome to Unicode
 
Lemme fire up vim..
 
6:55 PM
Crippled++ still cracks me up.
 

« first day (598 days earlier)      last day (4351 days later) »