« first day (507 days earlier)      last day (4424 days later) » 

5:00 PM
Hmm, I think I like typedef int fun(double); more than using fun = int(double);.
 
I don't.
 
@CatPlusPlus Just to be clear, even when casting via char*, such code would still violate strict aliasing, right? And there is no way around this.
 
@sbi Well, with mods around there's no need for owners.
@KonradRudolph memcpy.
The way around strict aliasing is no aliasing :P
 
@RMartinhoFernandes Of course.
 
5:04 PM
Pointers to char types are allowed to alias.
 
@LucDanton Yes but we are only casting via char*.
 
2
Q: Redefining for loops with the preprocessor

mdkessI am looking to do something somewhat evil. I want to redefine for loops to modify the conditional. Is there any way to do this? From the GCC documentation, redefining keywords is supported: http://gcc.gnu.org/onlinedocs/cpp/Macros.html What I'm trying to do is make a "probabilistic" wrapper fo...

 
@KonradRudolph Ah I see. I think C++11 rules are clearer on the matter and in fact some cases are fine as Johannes once pointed out to me. I don't know much more however.
I'm confident enough in doing return reinterpret_cast<T&>(storage); where storage has type e.g. typename std::aligned_storage<foo, bar>::type but that's as low-level as I get.
 
@LucDanton But that gives you no safety checks whatsoever. My bitwise_cast tests for equal byte size for instance. Come to think of it, checking for compatible alignment might also be a good idea – but that should be implied.
 
Is this worth an FAQ btw?
@KonradRudolph This is done in a member and usually the storage type is computed from T to be suitable for it.
 
sbi
5:12 PM
I like how the same mods that harvest our room's transcript for offensive stuff remind themselves:
in The Assembly on The Stack Exchange Network Chat, 2 days ago, by Ivo Flipse
Please note that anything you say is this room can and will be used against you in any Meta discussion
That one is pinned and has 13 stars.
:)
 
damnit
I promised myself I'd get to grips with my 3D renderer today
now it's 5pm and I've hardly looked at it
 
Sounds normal.
 
well, my day doesn't really end till midnight so I guess it's no big deal
 
@LucDanton I think a comprehensive answer to this matter would bring benefit. It does crop up occasionally.
@DeadMG Wanna bet?
 
> there hands
 
Oh, this picture has typos.
 
sbi
@CatPlusPlus "modrators"
 
Also > who has
@sbi modraters.
 
sbi
5:20 PM
And what about showing and ape, but calling it a monkey?!
@CatPlusPlus Oh well.
 
@sbi You put a typo in your transcription of a typo. Great.
 
sbi
@RMartinhoFernandes A meta-typo. How fitting. :D
in The Assembly on The Stack Exchange Network Chat, 18 hours ago, by Tom Wijsman
With the recent reputation changes and deletions and all that, look at the spike on QuantCast for Meta.SO.
That's indeed impressive.
 
Holy...
I wonder why it has a regular low peak on Sundays and Mondays.
 
> After minutes of hard work, here is a Look of Disapproval extension for Chrome! Click on the extension's icon to quickly access the Look of Disapproval for easier posting.
 
@RMartinhoFernandes What, that my day won't end till midnight?
 
5:26 PM
@DeadMG That you won't do much more work until then.
 
Meh, I have a damn UI to get done.
 
yeah, I'm not gonna take that one
 
:)
Shit. Half the children in my fort have rotten hearts. What frakking disease is this?
 
I wonder how someone ended up in my blog by searching for "Hacking into my hubby's mind"... weird search engine terms.
 
And after 3 hours I just remembered what the hell was I really looking for on that extension page.
 
5:30 PM
@sbi Don't forget - we had a system message on SO and every other meta linking to the recalc post.
 
@RMartinhoFernandes all the children in my school have rotten brains. there's no cure for stupidity.
 
sbi
@Shog9 Still.
 
Hey guys. :) -- If you would write a HTTP server, and you would only write the server part, how would the interface of your preferred HTTP parser look like?
 
@IntermediateHacker Does that include you?
 
@RMartinhoFernandes oh, sorry. no, I'm not a child.
 
5:32 PM
2 mins ago, by IntermediateHacker
@RMartinhoFernandes all the children in my school have rotten brains. there's no cure for stupidity.
@IntermediateHacker What kind of school are you on, if there are children around?
 
@RMartinhoFernandes vampirism? Zombism?
 
@RMartinhoFernandes That's a syndrome, evil weather can do that.
 
sbi
@RMartinhoFernandes In Germany there's schools you visit at the age from 12-19 years.
 
@MooingDuck Ah.... and how would the interface look?^^
 
@CatPlusPlus I'm not on evil lands. I suspect a FB that is roaming around in a cavern. I thought sealing it in was enough. I guess I'll have to just fill the damn thing with lava.
 
5:38 PM
I wouldn't make HTTP parser as a separate library. Expose HTTP-enabled socket.
 
@sbi Oh, I see.
 
@CatPlusPlus Can't really follow your thoughts.. a HTTP-enabled socket?^^
 
sbi
Damn, talking in two rooms at the same time seems to be over my brain capacity.
 
As in socket that speaks HTTP, so it can augment sent data with headers and parse headers on receive.
 
5:43 PM
@cooky451 I would give the parser a stream, and expect a tree/node structure in return.
(Not that I have much experience with mixing HTML and C++)
 
yay teh hypercrafts!
 
@MooingDuck HTTP and HTML are two different things, besides that HTTP doesn't seem to have a node/tree like structure..^^
 
@CatPlusPlus Hm.. seems to be a interesting idea.. but how would one access the header?
 
sbi
Ok, guys, I will now pack and leave for home, where I will have to pack in order to leave for London tomorrow morning. (7am, bloody hell!) I might not drop in much during the next week. Or I might, if London is boring and I have a WLAN somewhere. :)
See you!
 
5:45 PM
@CatPlusPlus Great, seems like necrosis is not problematic if it didn't target the brain, lungs, or eyes. Saved by a bug, I think :P
 
@sbi have fun in London :)
 
^ Undo what, exactly? The "redo" is even more mysterious. How to do a move again?
 
have fun on the Lunderground
 
@sbi London is not boring. Have fun. :D
 
nice and close to Cambridge ;)
 
5:46 PM
never boring- always Tube cockups
 
@cooky451 oops, failed to read what you said. I thought we were talking about HTML. Ignore me
 
@cooky451 If you want inspiration, you can use this: cpp-netlib.github.com/0.9.1/index.html.
 
void send(headers, stream);
std::tuple<headers, stream> recv();
Or something to that effect.
 
@CheersandhthAlf you moved it, then clicked undo. A redo will "re do" the un-did move
 
@CatPlusPlus And for what is the stream?^^
 
5:49 PM
Well, you might not want to read entire body at once.
It could be 10GB file or whatnot.
 
@RMartinhoFernandes Thanks, I'll take a look at that.
 
I'm not thinking too hard about that, that's just a general idea.
Though using already written thing is the best way of action.
 
It's just a leisure project, so using a library isn't the way to go for me. ^^
 
fuck
I can't use {} initializers on a struct I created :(
 
@cooky451 stream should be the source of the data, probably std::basic_istream<char, char_traits<char>>
 
5:53 PM
@DeadMG Buy a better compiler.
 
lol
if a function takes a const T(&arr)[N], I can't use {} for that either?
the fuck is this shit
@RMartinhoFernandes Taking a break from writing a better compiler
 
@DeadMG That can't bind to lvalue refs, can it?
 
no idea
 
Can't.
 
but I sure didn't get a const error
 
5:59 PM
Speaking about compilers.. I'd like to use Clang, but it doesn't seem to make sense using that on windows at this stage, does it?
 
GCC accepts {} if it's the parameter is ref to const. Unless it's a lambda, then it segfaults lol.
 
You need to jump through some hoops to use Clang on Windows.
But since the other options right now are crappy MinGW and MSVC with their poor C++11 support...
Oh, new DF.
> stopped ghosts from maintaining secret identities
 
@cooky451 no exceptions, no love.
@CatPlusPlus what hoops? just downoad my builds...
@CatPlusPlus WTF is crappy about GCC's C++11 support?
 
@rubenvb yeah, heard about that exception problem. ^^
 
@rubenvb MSVC. Read properly, eh.
 
6:13 PM
@CatPlusPlus I read "crappy 'MinGW and MSVC' with their poor C++11 support".
 
It can't be soo hard to implement variadic templates.. they should've just let me implement it. muahaha^^
 
@cooky451 Depends on how shitty your existing codebase was, doesn't it?
 
Also your MinGW builds makes my larger app crash inside string operations inside Boost.Filesystem.
 
@DeadMG You think MSVC codebase is that bad?
 
6:14 PM
hahaha
no, I think it's likely much worse
 
@CatPlusPlus test case appreciated.
and versions tried
 
@DeadMG There's got to be a reason for WONTFIXing so many bugs.
 
@RMartinhoFernandes ignorance
 
breaking old code which depends on those bugs to be operational?
that's the reason given for not fixing SFINAE, by the way
 
that too
 
6:18 PM
@DeadMG They can always add one more compatibility flag.
 
true true
 
@RMartinhoFernandes and replicate a bunch of code? Makes fixing other bugs a living hell
 
@rubenvb No, because the compatibility code doesn't need fixing any bugs. In it the bugs are the features.
 
lol
 
It was not meant to be funny. The whole point of adding compatibility flags is to please users that don't want those bugs fixed.
 
6:21 PM
What's the usual heuristic when packing members again? From largest to smallest?
 
wtf
 
but if some headers need the bugs a compatibility flag is out of the question.
 
GLM's 3D vector has 9 data members?
@rubenvb #pragma?
 
@DeadMG There's a lot of unioning in it.
 
oh, ok
 
6:22 PM
At the end of day it's three floats big.
 
so v.x += 1, for example, will still have the intended effect?
 
Yeah.
@LucDanton To minimize padding? Yes.
 
right
now all I have to do is write one routine to render one crappy-looking per-vertex-colour no-dynamic-lighting ship
then I can move on from there
 
Thanks.
 
Ok, now all I need is power for the pumps and I can drown the damn lizard of the deadly dust in magma before its dust affects any of my legendaries.
 
oh, nice, boost inclusive :) Thanks
 
I didn't include headers, though, so it doesn't get 40MB big.
 
the screenshot looks like a user error though. It crashes inside msvcrt...
or msvcrt bug of course
 
Well, I can try with newer msvcrt, didn't think about that.
 
try with a different compiler at least.
or a different platform if possible
 
6:39 PM
Well, it doesn't crash with MSVC.
Nor GCC on Linux, though the FindXXX are bit different.
 
ok. I'll download boost now and see.
 
Nor GCC on OSX.
 
OK.
 
Shit, I broke confinement! The lizard beast is loose in the fortress. Oh noes!
 
Good job, hero.
 
6:43 PM
Hey does anyone know why someone would do: char *name = malloc(1024*1024); I'm confused about the 1024*1024 part
 
@oorosco arbitrary magic number?
 
@oorosco It's clearer than 1048576?
 
@rubenvb I read online that it's supposed to be the size... is it just being multiplied just cause?
or is it some sort of syntax
 
@CatPlusPlus Time to get the masons working on coffins and memorial slabs...
 
34 secs ago, by R. Martinho Fernandes
@oorosco It's clearer than 1048576?
 
6:46 PM
1024*1024 is clearly "one megabyte". 1048576 isn't.
 
@CatPlusPlus ok built, how do I make it crash?
 
Run it?
 
GDB gives me this:
warning: Invalid parameter passed to C runtime function.

warning: Invalid parameter passed to C runtime function.
 
Yeah, I've traced it before, but that didn't really help to find the issue.
 
Remember MinGW targets msvcrt, which is like VC++03 IIRC. Some functions changed from MSVS2005 onwards.
 
6:50 PM
It's Boost, it should work. Or tell me how to make it target msvcr10.
Without recompiling the damn thing.
 
hmm, it should work, that's a fact
Did you try MinGW.org?
instead of MinGW-w64?
wow gdb sucks.
Or I suck at gdb
@CatPlusPlus I can honestly say I've never had such an error before. Did you modify the boost files in any way?
 
Woot! Dorfs won! No casualties!
 
@CatPlusPlus did you step through yur program to see where it causes this error? My GDB-fu sucks, so ...
 
@rubenvb No.
 
I mostly get Qt related Google hits.
 
7:00 PM
37          fs::exists(someFile); // but here, kaboom
(gdb) s
exists (p=...) at C:/dev/code/boost_1_48_0/boost/filesystem/v3/operations.hpp:220
220       bool exists(const path& p)           {return exists(detail::status(p));}
(gdb) s
boost::filesystem3::detail::status (p=..., ec=0x0) at C:\dev\code\sandbox\gcc-crash\boost\libs\filesystem\operations.cpp:1519
1519        DWORD attr(::GetFileAttributesW(p.c_str()));
(gdb) s
warning: Invalid parameter passed to C runtime function.

warning: Invalid parameter passed to C runtime function.
 
@CatPlusPlus what's someFile (ie the const path& p passed through to ::GetFileAttributes?
 
execDir / "foo"
 
and why is ec=0x0?
 
That's pointer to error_code, it can be null.
 
@CatPlusPlus in the debugger.
 
7:05 PM
Is installing Ubunto on hard drive faster or slower than booting from USB stick?
 
(gdb) p someFile
$1 = {m_pathname = {static npos = <optimized out>, _M_dataplus = {<std::allocator<wchar_t>> = {<__gnu_cxx::new_allocator<wchar_t>> = {<No data fields>}, <No data fields>},
      _M_p = 0x34123c L"c:\\dev\\code\\sandbox\\gcc-crash\\_build\\dist\\foo"}}}
 
I can't even output the result of execDir / "foo" with std::cerr.
 
AFAICT, std::wstring is borked.
Somehow.
 
huh. The path seems to be right though: L"c:\\dev\\code\\sandbox\\gcc-crash\\_build\\dist\\foo"
 
@FredOverflow Max read speed from USB2.0 is around 30MB/s in practice (60 MB/s in theory). I think hard drive is faster.
 
7:07 PM
@StackedCrooked a USB stick is miles slower than a HDD...
 
@rubenvb You see my problem.
 
But hard drives have much slower seek times, right?
 
Yeah.
 
Don't compare installing to booting, though.
 
What do you mean?
 
7:09 PM
If you want to compare speed of an operation, don't compare between two different operations.
 
lol
Of course I meant booting from hard drive or booting from USB, sorry.
 
I think you want a SSD hard drive :)
 
USB always means slower.
Even if it is a hard drive on the other end.
And you want eSATA.
 
@sbi Yeah, I created it. Twas Ivo and nhinkle's idea, but I pushed the buttons and made the room. The rubbish name is therefore also my fault. Being an owner is a bit redundant when you've got mod powers, so I removed myself, which was also probably redundant, but hey.
 
@CatPlusPlus I'm guessing these out-of-bounds are nothing important:
windows_file_codecvt::do_in (this=0x724cc0, from=0x724be8 "foo", from_end=0x724beb "", from_next=@0x22fa28: 0x722610 "àCr", to=0x22fb00 L"", to_end=0x22fd00 L"\x5138", <incomplete sequence \162>,
to_next=@0x22fa30: 0x29 <Address 0x29 out of bounds>) at M:\Development\Source\gcc-crash\boost\libs\filesystem\windows_file_codecvt.cpp:51
51 {
 
7:18 PM
Dunno. Boost.Filesystem insist on using wstring on Windows, so it has to convert back and forth. It works everywhere except on MinGW, though.
 
I wonder why they convert using mbstate though
 
For reentrancy?
Still crashes when using std::wstring instead of std::string in main.cpp.
 
man
I was doing so well, and then my brother linked me to some more Starcraft 2 :P
 
it's not the call to GetFileAttributesW at least.
 
Yeah, one of the most basic WinAPI functions didn't suddenly break.
 
7:29 PM
it borks on BOOST_FILESYSTEM_THROW:
(gdb) s
_M_rep (this=0x726300) at m:/development/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.6.4/../../../../include/c++/4.6.4/bits/basic_string.tcc:252
252               _M_rep()->_M_dispose(__a);
(gdb) s
_M_data (this=0x726300) at m:/development/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.6.4/../../../../include/c++/4.6.4/bits/basic_string.h:288
288           { return  _M_dataplus._M_p; }
(gdb) s
std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::assign (this=0x726300, __str=...)
 
@CatPlusPlus That reminds me of an anecdote my instructor told me once...
He claimed during the initial releases of MS Word, certain system calls were written to intentionally and randomly fail -- but only when called by Wordperfect
 
This is a Boost bug.
 
It works on GCC 4.6 on Linux.
It works on MSVC.
I doubt it's a bug in Boost.
 
no shit, the Boost code is different. MSVC is probably a lucky fbugeature
there's no difference between linux/MinGW wstring, only the type AFAIK
how do you print all variables in current scope in gdb?
or show more context?
the rest of BOOST_FILESYSTEM_THROW is on the next source line, which isn't shown.
 
Try list +. Or just open it in an editor.
 
7:45 PM
ugh... can't get anything useful, sorry
I'm gonna try 1.49 now
 
@rubenvb locals
Apparently I just invented that command, I'm not sure what I was thinking of.
 
Hello all. Anyone already used the FANN library? (leenissen.dk/fann/wp)
 
Oh right, it's info locals.
 
ok, Boost 1.49 gave the crash more momentum: it's crashing in libstdc++
bullocks
can be anything
@CatPlusPlus I'm going to try GCC 4.5 and 4.4.
 
Hey can someone link me to a video/tutorial on ptrhead and what "lock" is on threads...
 
8:08 PM
Locks are used to prevent more than one thread from entering a code block.
 
@LucDanton lol
 
It's so weird, I use GDB semi-regularly but it's all muscle memory, it takes me a lot of effort to actually remember commands I am familiar with.
 
anyone know an efficient way to create this: {0,1,2} into this: {0,0,1,1,2,2} thanks for response
i was thinking checking for even numbers
but then that mean creating another array and appending to it
 
@LucDanton I tried info lolcats couldn't really find anything useful to the subject.
 
std::vector<int> xs { 0, 1, 2 };
std::vector<int> ys;
ys.reserve(xs.size() * 2);
std::for_each(xs.begin(), xs.end(), [&ys](int x) { ys.push_back(x); ys.push_back(x); });
 
8:15 PM
@CatPlusPlus Needs to push_back twice.
 
Right. Derp.
 
hmmmm
 
@CatPlusPlus That should serve John right: an <algorithm> and a lambda.
 
So?
Try to write in fewer than 4 lines.
 
Cat's suggestion is to create an array / vector twice as large, then write each element twice to the new array / vector.
Your solution is very nice and quite elegant.
 
8:21 PM
Well, I thought the code is self-explanatory.
 
@CatPlusPlus It is, thats why I felt the need to explain it :/
 
its nice
 
Just curious, does anyone here use Linux, even though its creator hates C++? :)
 
@FredOverflow Linux != OS, "using" a kernel is kind of hard really... It all happens so far under the hood ;-)
 
Yes, I have a few phones, and come to think of it, the rest of my machines too
 
8:32 PM
@rubenvb pedant :)
 
@CatPlusPlus GCC 4.4 does not crash your app
 
@FredOverflow I don't think it's really practical to avoid software written by people who hate C++
 
GCC is written in C
for now
mostly
 
@jalf Yes especially since it does in no way exclude C++ coders.
 
@CatPlusPlus Neither does GCC 4.5
I'd file a bug report with GCC and add [4.6/4.7 Regression].
 
8:38 PM
Does any of you have any experience with an OpenBSD hackathon?
We are considering hosting one. openbsd.org/hackathons.html
 
It's a libstdc++ error IMHO.
 
Good thing I've kept the codebase C++11 usage down on 4.5 level.
 
lucky for you indeed
Let me try clang for fun :)
 
Well, if you have Clang build with lambdas then gimme.
 
@CatPlusPlus I used to have that (and it mostly worked too). For the last several days, I've been unable to build it from svn though :/
 
8:42 PM
remember, no exceptions, no fun.
 
that's on mac though. Dunno if it works better under linux or something :)
 
Well, I imagine OSX is their primary platform, what with all the Apple investment in it.
 
CLang also crashes in libstdc++ of GCC 4.7, so it's a libstdc++ issue.
@CatPlusPlus here's my latest: sourceforge.net/projects/mingw-w64/files/…
 
Does libc++ build under Windows?
 
8:46 PM
Change the Win64 to Win32 for 32-bit.
 
it's also possible I just did something to muck up my system :)
 
@CatPlusPlus half-kind-of-hackyness yes
I've run the test suite and it nly has ~11% failures.
 
Kinda like PHP.
With that difference that they don't really do those tests.
 
the linking is ugly though. And you have to link to msvcr10/9/8, which sometimes needs manifest file crap (although I swear at one point I know it didn't)
 
It doesn't need manifest if you put the DLL in the application folder.
Manifests are for accessing SxS versions.
 
8:49 PM
I hope that doesn't mean msvcr 10, 9 and 8 :|
 
You can't link to more than one.
Well, I think you can manage to do that, but it ends up in instant Fun.
MSVC once decided it needed to link my app to both debug and release CRT at the same time.
Let me just say it's not something you want to happen.
 
@CatPlusPlus sure you can. You just have to be really careful, and prepared for some pain
well, being careful is optional, the pain isn't. But if you're careful, you can do it slightly less painfully
we link to both msvcr10 and 7.1 from our code at work. Sucks, but right now it's impractical to change
since we link to a library which uses 7.1
an evil, despicable library, and it using an old msvcr version is probably the least o fits sins
 
I meant one, yes, and I think I used fancy msvcr10 stuff to make it easy on myself.
the patches were quite ugly sometimes though.
 
@jalf Ah, you mean DLLs using different CRTs.
Yeah, that's much more likely to happen. But it's also OK, if they don't share CRT objects.
 
yeah
 
8:56 PM
Woe is you if you try to use 10.0 FILE in 7.0.
 
:)
 

« first day (507 days earlier)      last day (4424 days later) »