« first day (978 days earlier)      last day (3970 days later) » 

7:07 AM
@R.MartinhoFernandes For a drink or hot steamy summer sex?
 
Xeo
Does one necessarily exclude the other?
 
@Yakk To clarify one thing: There can be very good reasons for extracting argument types from a function passed as template argument. One example is static_assert type checks for whether the function meets certain restrictions. Since concepts are not quite available yet, this can be part of a strategy to get readable error messages early on when unsuitable functions are passed. — jogojapan 6 hours ago
@Rakkun I don't want to make a choice now.
 
Xeo
@R.MartinhoFernandes If auto could be a real (polymorphic) type instead of just a placeholder that is allowed in some places...
 
haha, good luck.
 
Xeo
:<
Good luck because "screw the standards committee" or "try to make that work with C++'s type system"?
 
7:18 AM
A bit of both.
 
Xeo
I guess part of the question is when auto would be reduced to a monomorphic type.
like, auto x = 5; // what is 'decltype(x)'? int? auto?
It would have to be int I guess, to not break code
Maybe it's time to investigate my next "I should just write Haskell" proposal.
 
Even more rain today.
 
haha Nevin just ragequit on the sequence thingy.
 
Xeo
lol
 
Is padding ever useful for a binary format?
 
Xeo
7:31 AM
Can has sane-std-proposals? :|
Like, the one with class D : B("hi"){ ... } might seem a bit nutty at first, but makes sense (not necessarily the syntax, but the idea).
As opposed to all the 'std-proposals-Mikhail'-crap...
Anyways, off to work
 
@Mikhail You just got dissed!
 
Xeo
:(
 
@Xeo He's been quiet for a while. These days it's a justin carlson that insists empty sequences are the devil.
 
... still?
 
He's stubborn.
 
7:34 AM
@MarkGarcia o_0 what is that 'make_test' doing though? isn't that just being passed the bind and then returning it?
and could you just replace the call to 'make_test' with a lambda?
 
@thecoshman Yes. But it deduces the type of what's returned by std::bind which is quite bizarre.
@thecoshman Sure. But, well, it's my style. :)
 
oh, and yo miss understood what I was after.
style_a(int variable);
style_b(int constant, int* variable);
see, in style_b I need the int to be passed as a pointer to it, rather than just passing the int by value as in style_a
 
44 mins ago, by Mark Garcia
I don't know if that's what you really need though.
:P
@thecoshman OK. I'll try to modify it.
 
yeah, you have the functions style_a and style_b defined right, but it's how you are doing the std::function for style_b that is wrong
 
@thecoshman That's what I'll try to achieve. And I have nothing of importance to do now. And I feel like having more template errors. :)
 
7:38 AM
based on the two function you have defined there, the out put should be akin to
style_a(1234)
style_b(69, 1234)
@MarkGarcia thanks man :D
oooh, I have more rep
 
Anyone used Boost.CRC before? I'm looking at the 'stock' CRC it provides and I'm not sure how I should decide which to pick.
 
@thecoshman Not yet.
 
@BartekBanachewicz no no, i actually want to learn. but "modern" rendering stuff not the old ones :w
 
@Rakkun I think this chaps repository (and accompanying set of tutorials) is a nice place to start. at least for the basic stuff. I think you are like me... know OpenGl, but mostly old OpenGL
@MarkGarcia well, chop chop :P
 
7:41 AM
> According to list of CRCs in wiki, this polynomial (aka AUTODIN II polynomial ) is one of the most used.
Thank you random person on SO.
 
hello folks
 
@thecoshman but i want to do deferred rendering and stuff!
 
@Rakkun yeah, but how are you going to deferred rendering until you have something rendering in the first place?
though, to be fair...
14 hours ago, by Bartek Banachewicz
@Rakkun it's a poor attempt to get me into lenghty explanations and then make fun of me, right?
@MarkGarcia oh, I was thinking, I might actually template this :P
so that the function that is called is a template parameter
I think the invariance I get form that would be a lot better
 
has anyone here worked with the Qt API before ?
 
Xeo
> Everyone knows (TVTROPE WARNING) that heroes don't kill villains.
lol
 
8:00 AM
@MarkGarcia I think I want something more like this... where a 'holder' class templated with one function is a different type to a holder templated based on a different function
but my TMP powers are poor :(
 
@H.J_Rios yes why?
 
@thecoshman Store a 'whatever', under the assumption that the whatever is callable with int. Then the client can use make_holder + std::bind to bridge any mismatch in parameters if needed.
That assumes you can afford to have holders of differing types.
 
@thecoshman sigh
 
Does anybody know the motivation behind why OpenGL has texture units as featured in glActiveTexture?
 
@LucDanton but that will then only pass the address of a copy of the int, not the init itself
 
8:07 AM
Gosh, I'm tired.
 
@R.MartinhoFernandes too much rubber?
 
@thecoshman What address?
 
@Mikh..well I'm another dirty beginner and I have this application that I just cannot finish its a small one..about 400 lines but I'm at a place where I don't know how to proceed
 
...
 
Hey @Martin can you e-mail me that picture you took of me when you were in Berlin?
 
8:13 AM
@Mikhail I'm at the point of begging for help since I cannot post the whole code to SO and I do not know how to narrow down things to make it easily answered
 
@Rakkun what?
@LucDanton style_a just wants to get an int, style be wants to get that int via an int*
 
@thecoshman That's fucked up.
 
@R.MartinhoFernandes you know he will still have copy
 
@thecoshman What?
 
@LucDanton that's openGL :P
 
8:15 AM
We love dirty beginners ... they are so much closer to our taste. I remember once we had a clean beginner here for like 90 seconds. The shemale stormed out accusing us for not politely helping him for free.
 
lol
 
Oh wait. The other parameter is unrelated then right?
 
@R.MartinhoFernandes if he sends you a picture... he will still have a copy
 
@thecoshman What function?
@thecoshman Not that I care.
 
It's not meant to be called as foo(i, &i) right?
 
8:16 AM
@thecoshman I don't have a copy. That's the problem that needs solving here.
 
2 hours ago, by Xeo
@thecoshman Yeah, just std::bind(fun, the_constant, _1) for style_B
^ do some adjusting to do the int& -> int* dance but that's the general advice.
 
Xeo
std::bind(bar, std::bind([]std::addressof, _1)); :D
 
@Xeo std::ptr!
 
Xeo
haha
 
@thecoshman Maybe you're doing too much at a time? You could first try writing the holder, then try to figure out the bind expression (or whatever tool) to make use of it with those particular function signatures.
 
Xeo
8:19 AM
[]std::addressof <compose> []bar :>
 
There are so many way to solve this problem, for example, posting your picture here, so not only you and him has a copy, but everyone else here too.
 
Wrong order :v Which is weird, because you did get it right for the nested binds.
 
BTW Mysticial so not what imaged him to be, I thought him to be this pale skinny Asian kid.
How wrong I was ...
He looked darker and older, lolz
 
@R.MartinhoFernandes the gl delete functions. some are glDelete(int) others are gldelete(1, int*)
@Xeo o_0 for real?
 
[]std::addressof is syntax that his pet proposal would provide.
 
Xeo
8:24 AM
@LucDanton Gah!
@LucDanton I originally wrote <then> but eh
 
More practically, std::bind([](int i, int& j) { foo(i, &j); }, bound, _1) is one way to do the dance.
 
plus I do want to have the function that is called templated into the type, so you have something like holder<glDeleteText>() as a distinct type from holder<glDeletebuffers>()
 
[bound](int& i) { foo(bound, &i); } is yet another, which dispenses with std::bind altogether.
Point being that holder itself doesn't care, it's for the clients to pick.
 
Xeo
Scott Meyers has given a talk about std::bind vs lambdas in C++11 and C++14 in Oslo last week
I hope they upload it somewhere :/
 
this is roughly what I am trying to do... well, I am trying to get this sort of thing to work...
 
Xeo
8:27 AM
lambdas are expressions, not types~
 
vOv
 
@thecoshman See previous advice to have one make_holder.
 
@LucDanton you mean what @mark gave me?
 
Xeo
8:29 AM
^
Oh, there was a make_holder already?
 
54 mins ago, by Mark Garcia
@thecoshman Yes. But it deduces the type of what's returned by std::bind which is quite bizarre.
Type of a lambda expression is also bizarre.
 
@Xeo but when I try to use it for all styles it fails :(
 
Xeo
@thecoshman Guess whose responsibilty it is to convert int -> int*.
 
@thecoshman yo
 
but that will convert a copy of the int to an int*
 
Xeo
8:32 AM
Then take an int& in the lambda
 
Sorry that came out wrong.
 
@LucDanton oooh, that's the magic :D
@LucDanton I am listening, just not understanding
now that I have seen what works, I can start to understand how it works :D
thanks guys XD
 
@thecoshman Right. You put the 'I am not understanding' better by showing the code you had problem with rather than with words. Because you had been repeating yourself for a while.
 
@LucDanton lol, had I?
 
As I've said, trying to write the holder and trying to use it, via lambda exprs or whatnot, is understandably a lot in one go. The frustrating part in trying to help you is that I had no idea what part you were stuck on.
@thecoshman All I could think of to help you was to repeat some previous advice. Bit of a loop here.
 
8:36 AM
and to state the obvious (to some) those four 'holder' instances are all distinct types are they not.
 
Yup.
 
@LucDanton yeah, I was trying to explain what exactly I was trying to do, but it's hard to explain the problem when you don't know the correct terms.
 
Xeo
0
Q: using std::get<>() in std::for_each

CaribouI have a map which is being iterated over in a std::for_each loop. I am using a nested bind and simple helper functions to get to the element of the pair I require. This has to be usable from pre c++11 code. typedef std::map<int, Foo> MapType; std::for_each( testMap.begin() , testMap....

Ahaha. std::bind([].myIncredibleFunction, std::bind([]std::get<1>, _1))~
 
Though... when I try to actually make use of this... am sure there is going to be another round of head bang against wall
 
@Xeo Some proposal writers have in fact mentioned 'typical', recurring questions on SO to substantiate how some feature would help the average programmer.
hint hint
 
Xeo
8:39 AM
Yeah, I plan to gather them
 
@thecoshman I tend to fare better if I make the problems small rather than by trying to make too many things work at once.
 
@Mikhail do you think you could join me here squadedit.com/share/035a9c561 and have a quick look
 
@LucDanton yeah, I just couldn't see the point at which you could split it.
now I just need to work out how this class fits into my use case :P
 
Leaving a hole in the holder type ('here, put something that eats an int') and figuring out how to fill that hole 'match that argument here and that one here, while doing that' is typical functional programming btw.
 
now, obviously struct uses_holder_for_style_a_x{ holder held_value; }; is not going to work... but I need/want that sort of thing, as I want to be able to set the hled_value.hold_this during the constructor for my using class...
more like this:
struct uses_holder_for_style_a_x{
    uses_holder_for_style_a_x():
        held_value(101){
    }
    holder held_value;
};
 
Xeo
8:48 AM
Nvm, no need for std::function here.
 
@thecoshman I don't follow what is the 'that sort of thing' you need/want.
 
@LucDanton hang on, let me try to make a bit of a example... might be easier then me trying to explain it
 
Damn I'm beat all of a sudden.
 
this is what I am roughly trying to do...
@LucDanton sorry :P
 
Not your doing.
 
Xeo
8:52 AM
24 mins ago, by Xeo
lambdas are expressions, not types~
 
@Xeo yeah, I didn't think I would be able to do it :P
but do you see what I am wanting to happen?
 
Yes.
 
phew
 
I've sometimes used aliases for that, but that doesn't really work when/if functions are involved.
 
Xeo
holder<decltype(&style_a_x)> held; and : held{&style_a_x, 101} (or an appropriate constructor for holder that can take the deleter argument)
 
8:54 AM
The core idea though, is that the operation that does the remapping must be 'utterable' as a type, so to speak.
Typical things that aren't utterable are lambda expressions. Bind expressions and hand-written functors are though.
 
I think what you'd expect a typical holder client to be is to put a using remapper = /* utterable */; somewhere, perhaps in a detail namespace, and then proceed to use holder<remapper>. Or call it a disposer or whatever.
 
that is exactly what I want! and is surprisingly clean (in my opinion)
 
@thecoshman It has implications on code generated by the compiler. But ya know, premature etc.
 
@LucDanton what sort of implications?
 
8:58 AM
At any point during its lifetime you can do the_real_magic.held_value.call_on_delete = /* point somewhere else */;.
It's the cost of a function pointer indirection.
If call_on_delete is a (stateless) functor with class type though its actual value doesn't matter; if you reassign it to whatever it's still going to call the same function (via its operator()). Does that make sense to you?
 
@LucDanton yeah, but In practice, both 'held_value' and 'call_on_delete' would be private, I'm just using struct for the sake of it
 
Xeo
@LucDanton I wonder if one should make the deleter const, so that can't happen.
 
And this is where we come back to Xeo's proposal, which would allow to effortlessly go from function->unique functor type via []style_b_x :)
 
Xeo
@thecoshman You can still change them inside the holder
 
@Xeo Assignment yo.
 
Xeo
9:01 AM
@LucDanton Assignment on a const value?
 
@Xeo but that is something you would have to modify the holder class to do, no?
 
@Xeo When used via composition.
 
Xeo
@thecoshman Ya, but the compiler doesn't care.
@LucDanton You lost me. :(
@LucDanton Still struggling with decltype([]foo) :(
 
@Xeo What you want to forbid is to 'untie' a deleter value from the value it takes care of, but not assignment altogether: it's fine to replace a (resource, deleter) pair by another such pair.
 
Xeo
@LucDanton Ah
I was thinking function composition.
 
9:04 AM
+89+
Damn keyboard.
:|
 
@thecoshman Any address is fine for those...
It's not an out parameter.
 
anyone good at math :S
 
[](int x) { glDeleteX(1, &x); } does fine.
 
@R.MartinhoFernandes Wow!
 
I have a vector [0, 100, 0, 100] and I want to score it based on its closeness to [100, 100, 100, 100], atm I just sum() but [0, 100, 100, 100] is a worse score than [70, 70, 70, 70], so how could I ... code that :S
 
9:07 AM
@LucDanton It's a pointer to the start of an array, and the first argument is its length.
 
The OpenGL API is quirky.
 
@Daniel Just get the length of the vector between them.
 
eh, that's probably sanish.
 
Hence why I asked which function before trying to ascertain the semantics from the signature.
@Daniel Why should [70, 70, 70, 70] score better than [0, 100, 100, 100]?
 
9:10 AM
cause that is what I need :S
haha
I need [100, 100, 100, 100]
ideally
 
(That's rhetorical. I don't care about the answer. You do. The answer to that question, which only you can answer, is the answer to your original question)
 
I'm just trying to think of a way to score a fitness function
 
Have you studied norms and distances?
 
But score how?
 
Xeo
Question: Why is [100, 100, 100, 100] the goal?
 
9:11 AM
You already have one way of doing so, but for undisclosed reasons it is not good enough.
 
sigh Luc Danton: I don't know why every time I stop thinking about this as vector math, I go dud... cheers >_>
 
4 x 30^2 < 100^2 ?
 
dunno if it's applicable to fitness functions tbh
 
yeah... still thinking about it
 
larger standard deviation?
 
9:13 AM
Something similar to entropy is maybe a way, too.
 
so my results of evaluation ideally would be top across all 4 tests conducted, but 0 in any one of them is terrible (obvious overfit)
so if I wanted to put that to a 1D scalar... where less overfit would get a higher score... even if its only like 50,50,50,50
maybe i'm just going blank, but it doesn't seem straightforward haha
 
@LucDanton He's using a norm!
 
@R.MartinhoFernandes That wouldn't answer my question.
 
@Daniel You need a function that scores low values much lower and high values much higher. The Euclidean norm fits for the examples you provided, so maybe you want to try that.
(You have been using the Manhattan norm)
 
fuck yeah
just the straight product
x*x*x*x, where each x is max(1, value)
after 6hrs of fiddling, gets 100% on the function :D
(in really short time too :S)
euclidean norm did shit all
wasn't appropriate, gave too low a score for a close enough value
that is, [100, 100, 100, 0] is only 100 units off
and now for the why.... I was screwing around with temporal encoding of a synaptic neural network :S
uh spiking neural network*
 
Xeo
9:50 AM
Why am I wishing for let or where bindings so often lately...
 
If you override op new, how do you call the default op new?
 
Xeo
::operator new?
 
@Rakkun well sure
 
Oh right, that :: is magical, not really the global namespace scope selector.
 
Well it kinda is.
By default did you mean the one you replace? I don't think you can access it.
 
10:00 AM
Right.
 
Yea, it's indeed inaccesible after replacement.
 
Hmm.
Then ::new serves to pick global op new over class op new?
 
Xeo
mhm
 
Meh, I'll use malloc then.
 
Xeo
wut
 
10:15 AM
How do you override global op new if you cannot call the original?
 
Xeo
::operator new calls the language-provided one, if that's what you want.
 
I was just told otherwise!
 
@R.MartinhoFernandes ouch
 
Xeo
I think they meant that if global op new is overriden, and you override it with again with class op new, you can't get the overriden global op new anymore.
 
@Xeo No.
 
10:18 AM
More thunder now.
 
::operator new is just a function name. C++ library provides a default implementation for you, but you can define your own and it will replace it.
There is no way to resolve to the original. ::operator new will just go to your replacement.
I would assume compiler's provide a non-standard extension to get the original.
 
@R.MartinhoFernandes Ye, malloc is typical I think.
 
Like, std::operator_new_default(...), and they just defined ::operator new to be a minimal wrapper to call that.
But I've never tried, like Luc says typically just call malloc.
 
Xeo
Hm...
 
10:20 AM
@BartekBanachewicz Why ouch? malloc and the simple op new have the same behaviour except for throwing.
 
@R.MartinhoFernandes it comes from C, i am automatically sceptical
 
@R.MartinhoFernandes And op new has a new handler that everyone always forgets about. ;)
 
Xeo
@GManNickG I must be badly misremembering then. Sorry for the noise.
 
Adobe uses Perforce.
 
10:30 AM
hey guys I have some good news
if you ever forget your email login details, rest assured the NSA can still enjoy reading your email
 
I don't have a Stack Overflow password.
 
@Raindrop they can't if I don't want them to
 
@BartekBanachewicz You mean like by not having any e-mail login details?
 
@R.MartinhoFernandes i was rather thinking encryption
also my gmail account is protected by a token auth vOv
 
How to prevent the NSA from reading your email gigaom.com/2013/06/15/…
 
10:35 AM
@BartekBanachewicz They can get SMSes too. And they can get their own Authenticator synced as well.
 
@Raindrop just fucking encrypt it
oh yep the very first paragraph
 
understood
 
@R.MartinhoFernandes and they can put electrodes in your head?
 
I rationed that, since I am an unimportant person, they will not read my emails
I always want to join an elite hacker organization, but none of them would want to recruit me
 
@Telkitty猫咪咪 rationed?
 
reasoned*
 
@Xeo was posted yesterday
 
Xeo
Hi Márton ;) At a first glance I would guess it's merely because it hasn't been updated for C++11 yet, like many other boost libraries. Sad state of affairs :( — R. Martinho Fernandes 18 mins ago
@R.MartinhoFernandes ^ cow-worker of yours?
Also, I remember that Boost.Asio relies on compiler-generated move operations, so it just doesn't work on MSVC
 
@Xeo they work.
in VC++11 at least
 
Xeo
Oh wait, that was for Asio-internal stuff
 
10:54 AM
also IIRC asio has normal move ctors, not compiler-generated
 
#if defined(BOOST_ASIO_HAS_MOVE)
  /// Move constructor.
  BOOST_ASIO_DECL address(address&& other);
#endif // defined(BOOST_ASIO_HAS_MOVE)
// ^ boost.org/doc/libs/1_53_0/boost/asio/ip/address.hpp
 
Xeo
@Abyx Hm, I dug into the internals quite a few versions back (1.47?), so maybe that has changed.
 
1
Q: Wrong value of char array copy

Bartek MaciągEverything works, No problems with compilation #include <iostream> #include <conio.h> using namespace std; void main(){ char chArray[30]; char chArray2[] = "this is working"; *chArray = *chArray2; cout << chArray; getch(); } But...result is and I don't know what I d...

Gosh so many strcpy answers.
 
11:16 AM
lol Martinho Fernandes
C++
And not 1 std::string :S
or std::copy
 
Just use std::string and never learn basic stuff about arrays?
 
meh nothing good for lunch today
and i have to go to last PE classes I've forgotten about
 
@BartekBanachewicz started using OpenGL 4.0 Its like OpenGL 2.0 with 2x the crap
 
@Mikhail you are doing it wrong then
 
-2
Q: Going through their profile on another profile

Berat ŞenSample issue is as follows; Login doing. But if my profile as someone else's profile oluyor.Sorun that profile is gone?

Sample issue is as follows; Login doing.
 
11:28 AM
I should probably see the sopranos.
 
Thanks for help I need this body ;D — Bartek Maciąg 20 mins ago
@StackedCrooked too late - the main one's dead
so you can't see it any more
cos that's how it works
 
Dammit!
However, I use piracy.
 
@R.MartinhoFernandes I've added string answer
 
Afternoon chaps
 
11:45 AM
How do people with long hair make it through summer?
 
They die a little inside and carry on
 
My hair is only longer than ever, i.e. not that long and it's killing me already.
 
@R.MartinhoFernandes it's a tad annoying, but bearable
but I should cut my hair too :/
 
@R.MartinhoFernandes My hair seems to be damp all the time.
 
aren't fungi growing in your hair?
 
11:47 AM
I hope not.
 
Not Mi-Go.
 
@R.MartinhoFernandes hairbands
@StackedCrooked that's gross
 
It's only since the last few days with the hot weather.
 
@LightnessRacesinOrbit Hmm, that's too radical a change.
 
I don't really understand why.
 
11:49 AM
@R.MartinhoFernandes Not as radical as turning yourself into a Robot, methinks.
 
Go bald, problem solved
 
@R.MartinhoFernandes They cut it.
 
I always use a hairband.
 
@TonyTheLion bald
 
@TonyTheLion Too soon.
 
11:50 AM
My hair is going gray
 
@DeadMG But that would ruin my plans of letting it grow!
 
I'm getting old
 
I had short hair in my twenties and starting to grow long hair in my thirties. I'm so nonconformist :)
 
Thirties? OMG you're old.
 
:(
33 soon
 
11:52 AM
lol
I'm turning 27 on Sunday
 
When "you need to update the unit tests" is interpreted to mean "please fix the unit test compilation errors" rather than "please fix the unit test compilation errors by removing obsolete broken tests and then adding twenty new ones to cover the significant functionality you just added". Grr.
 
30 is coming closer
 
I'm terrible at judging people's ages.
 
@TonyTheLion I've never heard of the age "27 Sunday"
is it like some sort of crazy cultish thing
 
Xeo
@R.MartinhoFernandes I ruined my own plan on Saturday by cutting mine
 
11:54 AM
@TonyTheLion Oooh, throwing a party?
 
I long gave up on the plan to grow long hair, at a certain stage it just tickles too much in my face
@R.MartinhoFernandes I'm seeing some friends, so maybe a small party
 
My last birthday plans were a total failure, haha. Fuck you universe.
 
@R.MartinhoFernandes only because you didn't invite me
 
I plan to be alllll alone for my next birthday in a couple of months time
 
@LightnessRacesinOrbit Had I invited you, you would probably have fallen and broken a leg or something and be unable to come, as everyone else.
 
11:56 AM
I want to spend a b'day all by myself - it would be awesome
 
@Telkitty猫咪咪 I've done that, it was sad, and I wept.
 
@R.MartinhoFernandes haha. they all "broke a leg" huh
 
@LightnessRacesinOrbit "or something"
 
@R.MartinhoFernandes mm
I wonder where the other party was
 
11:57 AM
There were hospitals involved for some, actually.
 
oh gawd
 
@TonyTheLion but I am not you, I will be fine - except my family & friends would't allow me to do that ... not that I have too many close friends :p
@TonyTheLion should have came over and go hiking with me
 

« first day (978 days earlier)      last day (3970 days later) »