« first day (893 days earlier)      last day (4281 days later) » 

user1357851
04:00
I believe the kid at heart @JerryCoffin is American too
user1357851
Maybe he's kind who goes to bed at 9pm and gets up at 5am
@ScottW Right -- when I stay up late, it's usually because I have work I need to get done.
@Telkitty On my own, I'd generally work 'til ~2-3 AM, get up around 10-11 AM. Now that I have kids who have to go to school, I get up around 6:30-7:00 AM, and try to get to be early enough to be at least somewhat rested by then.
yeah, went to bed at 6 AM yesterday
now it's 5 AM and I'm not sleepy, and still so much stuff I wanna do
I don't wanna go to sleep because then it'll be tomorrow like, instantly, and I'll have to get up, shower, breakfast...I hate morning routines..
on the other hand, it would make that hard disk wipe go a lot quicker :p
@melak47 In linux we have the watch -n command for making things go faster
@Mikhail how does that make it go faster? :p
04:08
makes it go faster by a factor of a where a is less then 1
Does xkcd really have to be posted by Feeds here
user142019
lol
Also emergency rations: I'm eating rice with rice and spaghetti sauce
user142019
Monadic parsers are wonderful.
user1357851
04:20
I always eat rice with rice
user1357851
rice noodles?
user1357851
I feed the wild birds rice sometimes
user1357851
but mainly feeding them meat
@EtiennedeMartel Well, I can now rotate and look at the Pony and all that fun stuff.
So now, I am going to destroy it.
@CatPlusPlus You mentioned something a long time ago when we were discussing the merits of converting to and from stuff,
that there should be something called tagged values used everywhere
04:43
@ThePhD so what was wrong with the matrices?
@melak47 Everything.
transpose? :p
No, that was actually correct (it is built into the ShaderParameter framework to transpose matrices, 3x3 and 4x4, by default)
The winding order of my models was wrong. CullNone was not being properly set. etc.etc.etc.etc., the list goes on.
Nothing was set to work with a Right-Handed Matrix system.
And when I used Left-Handed, it only sort of worked (but not really because {Reasons})
DON'T LAUGH AT ME ;~;
04:51
Does anyone know any good resources for learning Dynamic arrays, dynamically allocated arrays and dynamic memory allocation? Basically I want to understand how Vectors in C++ STL work. Anything such as internet articles, name of books etc would be helpful.
Anywhos, my rendition of tagged values @CatPlusPlus
Implicit conversions defeat the point
Now I just need to write tagged_cast<typename tag_to, typename tag_from, typename TTo, typenameTFrom = TTo>
Oh, they do?
user142019
05:16
I'm just about to sleep, since sunrise will be in ten minutes.
Goood niiiiiight.
sleep(600)
05:28
@ChosenTorture Good may be open to question, but I wrote something about it a while back: coderscentral.blogspot.com/2012/08/c-dynamic-arrays.html
user1357851
sleep(600) = sleep for 10 mins? That's more of a nap isn't it?
user1357851
05:55
@JerryCoffin Thanks for the link. Something else?
@ChosenTorture Not that I can think of right now.
user1357851
I saw at this:
user1357851
user1357851
... and I thought of Cat Plus Plus
06:17
Cashing in another commit...
That should be good enough to stop on.
Things appear so shiny...
@ThePhD You don't need to implement copy and move operators. One forwarding constructor will do.
I just helped a friend of mine debug his WinAPI code only to find out it had undefined behaviour
:(
Using a template <typename Arg...> TaggedValue ( Arg&&... args ) : val( args... ) ?
Also I would use 'obj' or 'data' instead of 'val'.
Will the implicit conversion always return a const T& even if the object itself isn't const?
06:23
Yes.
Oh.
I guess that'd be a feature, not really a drawback or limitation...
You can add more methods for getting or setting the value.
What about operator = ?
Is that template <typename Args...>-able ?
Or do we just let the compiler take care of that by itself?
operator= for setting the value?
Yeah.
... Though, operator= is a single value, so variadic args wouldn't make much sense...
06:28
It might defeat your purpsose. If you provide operators for setting and for getting the value then it will behave just like T itself.
Well I kind of want it to behave like T except in certain usage cases...
like with tagged_cast and things
Really I only envision using it in tagged_cast ...
And like, as a compile-time gauruntee for certain value's meaning at compile-time
I forgot you should made the constructor explicit.
@ThePhD You can add operator=(T) if you want.
Also check boost strong typedef which servers a similar purpose.
I sometimes use this strong typedef.
Oooh.
Shiny. :O
You can use it like this.
It creates a copy at construction time. A forwarding constructor would probably be better.
06:49
@StackedCrooked I'm failing to do partial template specializations for some of the casting stuff, apparently: coliru.stacked-crooked.com/…
That's a good thing! (you finding it)
Let me guess: uninitialized data in parameters?
He was using an std::string with WinAPI and he used a const cast to convert it to char* but it modified the string so it went bonkers.
and that one too..
o_O
Lol, const_cast.
Blarrggghhh.
Goddamn template specializations.
07:04
Goddamn graphs
@DogPlusPlus Horribly, of course. :D
Oh.
I can't partial-specialize function templates.
Well, that's just a shame.
Xeo
Xeo
07:31
You can overload though, and emulate partial specialization that way.
Morning
Huh
GCC is ignoring one of my partial template specializations
But MSVC isn't...
Maybe I'm just writing it wrong for GCC...
Xeo
Xeo
Maybe you're just writing it wong in general. :>
But it's working in MSVC. ;~;
Xeo
Xeo
@ThePhD That's a bad measure of what is right or wrong.
Also, narrow the code down
That is all the code.
Like, that's hte Minimum Complete Compiliable Example
...or.. Minimum Small whatever something THINGYMAHDOODLE
That's all the barebones. :c
The problem is that it's not recognizing the double-template parameter tagged_caster struct.
It's a specialization.
Of the original three-parameter one.
It's for when two tag types are equivalent (returns itself).
07:43
But seriously why do you bother with this if you have implicit conversions in both ways
I could mark it as explicit?
I mean, doing that would make it more safe.
The point of tagging values is to not be able to accidentally pass T1 as T2 even though they have the same backing type
Xeo
Xeo
@ThePhD: You suck. :)
the static_assert in the unspecialized template doesn't depend on anything, so it's always fired.
o.o
Really?
I thought it would only fire if no specializations were matched...
Xeo
Xeo
It's a non-dependent thing, it has to be fully parsed when it is encountered.
Blame MSVC's bad two-phase lookup.
07:49
Also fuck graphs and fuck reports forever
I'm probably gonna get 0 points or some shit and all this effort will be pointless
Xeo
Xeo
@ThePhD ^ after removing your broken assignment operators
And I don't even care
Well, MSVC is producing the desired effect...
07:49
Shoot me
Xeo
Xeo
1 min ago, by Xeo
Blame MSVC's bad two-phase lookup.
Hint MSVC is bad
Xeo
Xeo
 o                              \O_ Arrgh!!
<\==-   -   - -   -  -  - --- __/
/ \                             \
Lolwut.
Can I keep the assignment operators? >_>
user1357851
               )\._.,--....,'``.
 .b--.        /;   _.. \   _\  (`._ ,.
`=,-,-'~~~   `----(,_..'--(,_..'`-.;.'
07:52
<_<
Keeps the assignment operators ~~
Though, praytell, why are they "broken" ?
Xeo
Xeo
@ThePhD They return nothing.
... Oh.
That.
Xeo
Xeo
And they're broken in some other way I forgot
I imported smallish CSV few times to Excel and now it takes 2GB of RAM
user1357851
malware
user1357851
07:57
vb script - mother of all viruses
You're malware
6
> Nsight Visual Studio 2012 support will come with the next version that is scheduled for Q2'13.
Damn you nvidia
gDebugger still wins
Yikes.
template <typename T> stuff ( T && ) violently steals overload priority from everything else.
Universal references 2 stronk. @___@
Xeo
Xeo
Never have an overload set with an unrestricted universal reference.
Yeah...
TIL a lot about overload resolution.
The scariest part is... .... this is barely even the tip of the template overload wankery meta meta that can happen.
Okay.
So rendering problems fixed.
And tagged value casting done.
08:36
morning all
Xeo
Xeo
> Note: I cannot use C++11, nor Boost.
Fffffff
Ell
Ell
Morning
can someone tell the northern hemisphere it is supposed to be warming up
I have no Boost and I must C++
08:38
rehashedjokes dot com
@thecoshman it's sunny here
Ell
Ell
It's snowing today
It's -3
"Feels like -9" Internet says
Ell
Ell
Ive never known it to snow so late
In UK
@CatPlusPlus oh sure, the sun is out, but it's still fucking sub zero!
08:39
Mawning Fellas
I see the Cat is having a bad hair day
Xeo
Xeo
I'd like to have a good reason, but I've none, apart that current project cannot use it. — Didier Trosset 1 min ago
Poor sod.
Copy parts of boost into your project. Problem solved. And if the whoever is responsible objects, s/boost/potato/. — Bartek Banachewicz 13 secs ago
I sense great future for Potato C++ Libraries
ahaha nothing like great start of the day
I have an hour to write one, anyway.
Xeo
Xeo
"Ask if in-house libraries are ok. If yes, copy Boost. All problems in IT, even management ones, can be solved with another level of indirection." -- Somebody who's name I unfortunately can't remember. — Xeo 6 secs ago
09:08
oho, my MergeSort worked at second try, I had to fix off-by-one
Mar 11 at 1:50, by sehe
@CaptainGiraffe you'll see now, that it doesn't scale: http://ideone.com/3Jqwpc
uni assignments are not meant to scale
Oh sorry I forgot
> 'std::thread::thread' : no overloaded function takes 2 arguments
hmm...
template< class Function, class... Args >
explicit thread( Function&& f, Args&&... args );
that doesn't really seem right
Agreed. Post it ?
09:14
@sehe I am probably using thread in some wrong way
yeah, like, in C++
@BartekBanachewicz Certainly. Also, MergeSort is an unresolved overload set
that 2nd part sounds more scary
@BartekBanachewicz Just type MergeSort<T> (...)
could not deduce template argument for 'const std::vector<T> &' from 'std::thread'
wat.
09:18
Also, how would you expect the compiler to handle merge( thread&, thread&)
I need higher abstraction
packadged_task?
It's really quite basic. It is known as "don't dream up how the API functions", a.k.a. "RTFM"
how long should I stay in the corner?
@BartekBanachewicz Nah.. async or future. Why don't you... look at that link I just posted?...
@BartekBanachewicz Heheh
#include <future>
    auto aaa = std::async(MergeSort<T>, std::vector<T>(data.begin(), split));
    auto bbb = std::async(MergeSort<T>, std::vector<T>(split, data.end()));
    return merge( aaa.get(), bbb.get() );
Xeo
Xeo
@sehe kekeke, if only my proposal was already in the language. :)
09:22
However, all the copying is certainly going to flush performance down the drain. Use inplace_merge and ranges
 std::future<std::vector<T>> rA = std::async(std::launch::async, MergeSort<T>, std::vector<T>(data.begin(), split));
 std::future<std::vector<T>> rB = std::async(std::launch::async, MergeSort<T>, std::vector<T>(split, data.end()));

return merge(rA.get(), rB.get());
38 mins ago, by Bartek Banachewicz
I have an hour to write one, anyway.
@BartekBanachewicz only 2 minutes later
I don't care about performance at all.
@BartekBanachewicz Less copying is less code to write. CERTAINLY with fixed number of threads.
@sehe I believe the guy wants us to spawn a thread for each merging instance
09:24
@BartekBanachewicz Really? I'd say the copying renders the implementation broken. Because then it is wrong to parallelize this :)
It. Is. Only. An. Assignment.
To show you know how to use threads, not to show you can mergesort.
Also, it was supposed to use WinAPI threads
I am going to try to defend this one.
@BartekBanachewicz Well. Do have a look at that code I posted, if only just for ideas. Here's one generalized for N chunks (N = 2^n):
@BartekBanachewicz Good! I like that
Defend it buy pointing at the price tag for windows. Or: say that you were sadly locked out of your @live.com account because a hacker took control of it
ahaha.
The guy who will grade that gave me A last time just because I've shown him code in vim.
(That was on linux fork() assignment)
@BartekBanachewicz You're gonna be fine
@sehe Yea, I also really don't care about the grades, I want to just pass.
Anyway, just to clarify, to avoid copy, instead of passing a copied subvector, I should pass a reference to the original vector and an operating range, correct?
09:31
@BartekBanachewicz Yup
you could of course weasel with std::vector<T>(std::make_move_iterator(begin(v)), std::make_move_iterator(end())) but that would net no gain for intrinsics, really
I think I'll just write my own SubRange class for that
or wait, hmm, pair.
See my sample :) std::pair<It,It> would do nicely. If you want rangebased for, you'd want to ADL supply begin/end
@sehe the only link you posted uses std::sort. Are you talking about that one or...?
@BartekBanachewicz meh. drop in your sort:
9 mins ago, by Bartek Banachewicz
To show you know how to use threads, not to show you can mergesort.
@BartekBanachewicz (you aren't asking me to adapt your code now, are you?)
no, no, of course
I just misunderstood at first
09:35
:) I like inversing logic. I did understand you meant more like "I can't use your sample because XYZ" (but in reality, looking at it is "free")
I have a deja vu
I believe in parallel universe I've already said that I don't know how inplace_merge works.
@BartekBanachewicz not to me
user1357851
In real life, 99% of the times a single threaded bubble sort is enough performance wise
@BartekBanachewicz It merges two adjacent, individually sorted, subranges into 1 sorted range. [first, middle), [middle, end) -> [first, end)
so does pretty much what my merge does, just better
09:37
@BartekBanachewicz I dunno. I haven't read your merge :)
@sehe thank god.
I'm not in the business of hurting myself. Wait. I am, but that's a different matter.
Also, most people do
Tagged Values...
... what was I doing..?
@ThePhD hurting yourself
tee hee
Right.
Running into a wall.
09:46
1
Q: Is there an equivalent of XSD2Code in native c++?

Patrice PezillierIn C#, I use XSD2Code in order to: generate automatically entities from XSD generate methods which serialize/deserialize XML stream in these entities Does it exist in the native C++ world?

user1357851
I just saw one of the colleagues code
DWORD WINAPI mergeSort(void *ptr) {
    vector<int> *tab = (vector<int> *)ptr;
THE GOGGLES
put them on
vector<int> *polowaA = new vector<int>();
vector<int> *polowaB = new vector<int>();
I have no mercy.
user1357851
09:53
@kbok this is why that dragon looked so weird in the wiki entry: coolest-homemade-costumes.com/images/…
The @Cat even terminated his connection in panic
@BartekBanachewicz ah but you guys learn polish too. That's not easy
user1357851
@sehe did I miss half of the conversation again?
writing code in polish is so retarded I can't even comprehend it.
That's Java brain damage
@kbok Nah. I wager it's copy/paste mentality (let's mimic the declarations in windows.h)
09:57
@sehe There's this kind of stuff in windows.h?
4 mins ago, by Bartek Banachewicz
DWORD WINAPI mergeSort(void *ptr) {
    vector<int> *tab = (vector<int> *)ptr;
^ where else?
@kbok there's evil there
Ah yeah, DWORD WINAPI. Sorry I went blind when I saw the void * to vector<int> * C-cast.
@Ben: I don't buy that. Depending on Boost is like depending on your own project, since you can just copy it in. — Xeo 49 mins ago
^ needs more upvotes

« first day (893 days earlier)      last day (4281 days later) »