« first day (991 days earlier)      last day (3951 days later) » 

6:00 PM
So, TortoiseSVN crashed in my face when I tried to update, but it still managed to lock my working copy before doing so.
 
@EtiennedeMartel That's how it always rolls.
 
Human body is 75% water. Programmer's body is 75% caffeine and 25% alcohol.
 
user784668
@ThePhD DW2 for IA-32, SEH for AMD64.
 
@EtiennedeMartel TortoiseSVN is not really worth using.
 
JBL
@CatPlusPlus I replaced alcohol by another 25% caffeine. Works pretty well too.
 
6:01 PM
Not after you've seen TortoiseHg.
 
user784668
@CatPlusPlus SVN is not really worth using after you've seen hg
 
If I had to use svn I'd go with git-svn these days.
 
@R.MartinhoFernandes But how does that alone help the user getting the element given the type? (not the index)
 
Psh. TFS is the best.
 
Perhaps I'm just misunderstanding the whole thing
 
6:02 PM
@JBL You're not a real programmer.
 
Ell
I had a madrass last night. Well 2/3 of one
 
Xeo
@AndyProwl Okay, second
 
@Nican ...
 
@AndyProwl Oh, I thought this was the standard tuple get style.
 
@Xeo I'm sure you can work that out, but "I'm looking for an as-simple-as-possible implementation of this."
 
6:03 PM
I have to use TFS at my workplace.
 
@Nican That's great: it means you don't have to use VSS.
There should be some Godwin's law about mentioning VSS in a conversation about VCSes.
 
Touche.
 
Xeo
template<int I, class T> struct element{};
struct X : element<0, int>, element<1, float>, element<2, bool>{};
template<class T>
T get_first(element<0, T> e);
X x;
get_first(x);
 
user784668
@R.MartinhoFernandes WTF is VSS?
 
Visual SourceSafe.
 
Xeo
6:04 PM
Visual SourceGrave
2
 
user784668
Oh fuck, thanks no.
 
@Fanael Visual Source Shredder.
 
As in, your source is safe from being versioned.
 
@Fanael It's an implementation of Russian roulette for source code
8
 
Ell
I have a function which only works on a small set of types. Should I accept an enum in the function and get type from that, or use SFINAE to check it is one of the allowed types?
 
6:06 PM
Don't use an enum.
 
why the fuck would you use an enum
 
Ell
Idk, it was the first way I thought of restricting tyeps :P
 
Xeo
@AndyProwl: Anyways, take a look at the snippet way up there.
 
aaah
another game of Doomed Earth won by annihilating everywhere on the planet except my tiny little corner of it
 
@Xeo I did. I understand that, and if I were to write a tuple class from scratch I'd likely go the indices way. But the OP asked for minimal change and type-based access
 
6:07 PM
@Xeo Erm, what if you don't want the first one? :S
 
Xeo
@R.MartinhoFernandes It was just an example to show how to force the right base
 
Well, can't you add int I and let it be deduced?
 
And perhaps your implementation is even more compact (I wish I were as quick as you at thinking about these things), but the simplest way I thought of to fix the OP's code was just adding SFINAE constraints
 
Xeo
@R.MartinhoFernandes I did that before, but Andy seemed confused :(
@R.MartinhoFernandes Also, whatno, no deduction for I if anything
 
Andy is still confused
 
6:09 PM
@AndyProwl "Quick"? He didn't think this on the spot. He knew the technique from before.
 
JBL
Meh... Lesson of the day : if your mutex.unlock() statement is never reached, you'll have problems. /doh
 
user784668
@JBL lesson of the day: if you don't RAII, you'll have problems
 
Xeo
Lesson of the day: If you have a mutex.unlock(); statement, you'll have problems.
 
pretty much what they said.
 
JBL
@Fanael It's a case where I typically couldn't find a way of doing it with RAII.
Otherwise I do.
 
user784668
6:11 PM
@JBL code or it didn't happen
 
@Xeo So if I have get(element<I, T>&), what should the user pass if it wants to retrieve the double member?
 
@Xeo What I wish is that when you have a variadic pack < typename ...Tn> that you also implicitly got a variadic pack of indices <std::size_t ... I> that went from 0, 1, 2, ..., n, which would make it work for std:: machinery like std::get<I>().
 
Xeo
@AndyProwl What double member? :P
 
Actually, you don't even need I if you only want type access.
 
JBL
Something like
`mutex.lock();
if(my_concurrent_bool){
mutex.unlock();
[...]`
 
6:12 PM
@Xeo Say you have a Tuple<int, double, char>. The user wants to retrieve the double
 
user142019
@JBL NOOOOOOO!
 
Xeo
get<1>(the_tuple);
 
JBL
@rightfold That sucks.
 
@Xeo Suppose the user does not know the index
 
JBL
6:13 PM
I'm bad with threads and mutexes.
 
user142019
That's exception unsafe!
 
Xeo
@R.MartinhoFernandes Sure, typed access can just work.
@AndyProwl Wait, when did we get to that requirement?
Did I misunderstand something?
 
JBL
In most cases though, I'd use a locker.
 
user142019
{
    std::lock_guard<decltype(mutex)> lg(mutex);
    if (my_concurrent_bool) { … }
}
 
@AndyProwl Does he need the index? If no, toss it.
 
user142019
6:13 PM
Problem solved!
 
user784668
@rightfold changes semantics
 
Xeo
In any case, the idea is the same.
As robot showed.
 
@Xeo The OP wants to get the element of the tuple by type
 
Xeo
Oh
Same idea, then
 
@R.MartinhoFernandes What confused me was the get(element<I, T>&)
 
6:14 PM
@CatPlusPlus Work stuff.
 
JBL
@rightfold I was goind to say "Yep, but my if block is pretty long and intensive", but bleh...
 
Xeo
What is VSS? "It's an implementation of Russian roulette for source code" /cc @jalfd (http://chat.stackoverflow.com/transcript/message/10370261#10370261)
Couldn't resist, btw.
 
JBL
I think I shouldn't care about that.
 
@AndyProwl You can also have both: coliru.stacked-crooked.com/…
 
@R.MartinhoFernandes Very nice. I understand now
Thank you
And @Xeo of course
 
Xeo
6:15 PM
Dammit, now he's gonna steal even more of my answers!
 
JBL
And keep the mutex locked for like 0.0001 extra seconds rather than trying to unlock it quickly and ending up with dumb cases.
 
@Xeo lol, no worries, I kind of stopped repwhoring
 
Xeo
Not like I've been answering any questions lately, really.
 
@JBL There's unique_lock.
 
JBL
@R.MartinhoFernandes I'm using Qt mutexes.
(Don't know if it's a good idea or not, but since I use Qt, I thought I'd better use their stuff...)
 
6:18 PM
@JBL As if I care. Write QtUniqueLock. (or maybe Qt mutexes are compatible with the standard mutex concept?)
 
Is jalf married?
 
JBL
@R.MartinhoFernandes Might actually check if there's already an equivalent.
 
@EtiennedeMartel I mean just use command-line svn.
 
@CatPlusPlus Urgh.
 
Or better, import to git/hg. :v:
 
user142019
6:22 PM
I just had a daymare.
 
Why are you eating horses?
 
user142019
I have eaten many horses in my life.
 
user142019
And so did you, probably.
 
Ell
(burger thing?)
Also, I feel like such an idiot, I don't know how to approach this problem
 
@rightfold Also ponies.
 
Ell
6:24 PM
Of restricting a function to a few types
 
@Ell Uh?
What do you mean by "restricting"?
 
user142019
@EtiennedeMartel I ATE FLUTTERSHY
 
@rightfold Probably not.
 
Ell
Well, it's a function which calls a callback giving you a buffer of data - you get to specify the type of the buffer elements by passing in a type (or enum? I don't know :S) but only certain types are supported by the PortAudio library. I don't want the user to be able to use a double for example
I guess I could write an overload for each
 
Overloads?
 
6:26 PM
WH
glikehakrygr
WTF
grliktehearh
 
HAR HAR HAR
 
Ell
What just happened.
Robot said something, it got binned and it turned into etienne saying the same thing o.O
 
Etienne binned my reply and replaced it with his.
 
Nah, the overload thing was totally my idea.
 
lollll
 
6:28 PM
I should go and have dinner.
 
Robot god reply-blocked
 
I'll probably have some typical Berliner cuisine, i.e. Döner.
 
@Borgleader To be fair, I recall seeing him doing the same thing to somebody else.
 
Irrelevant!
 
"But officer, he shot a guy so I shot him too" what kind of argument is that ;)
 
6:31 PM
I'm the only one allowed to abuse owner powers.
 
JBL
@EtiennedeMartel What was that ?
I'm curious.
 
4 mins ago, by R. Martinho Fernandes
Etienne binned my reply and replaced it with his.
 
@R.MartinhoFernandes Meh, we're BFFs anyway.
 
JBL
Oh, I thought about the actual content...
 
Xeo
@R.MartinhoFernandes Nice
 
JBL
6:31 PM
Meh, nvm
 
Ell
Should I change a pointer + length for some other type?
I can't see any advantages o.O
oh wait.
 
@R.MartinhoFernandes Pff.
 
user142019
0
Q: char to char* issues

Bhavik Pateli am able to covert char to char* using below function char* char_to_chars(char ch) { char ch2[10]; ch2[0] = ch; char *ch3 = &ch2[0]; return ch3; } and i am calling above function here it gives what i want but still there some problem and i don't know what's wrong with it char...

 
user142019
Hahahahahahahahahahahahaha.
 
JBL
Depressed
 
6:39 PM
@R.MartinhoFernandes the second comment seems oddly out of place. Did you imply an 'else' or a 'return' from the true-branch that contains the unlock?
 
i am not able to understand what you saying — Bhavik Patel 1 min ago
ABORT!
 
@Xeo lol
@EtiennedeMartel Wut? Can't handle honesty?
 
user142019
@EtiennedeMartel But abortion is bad!
 
user142019
Woohoo 19991 rep.
 
user142019
One more upboat on my latest answer and I'm rich!
 
6:44 PM
you suck
 
Awwww yeah 2.5k rep I can create tag synonyms. My life is now complete!!!
>.>
 
user142019
I'm rich!
 
I know, I'm the one who upboated you :P (the +57 question on your profile)
 
user142019
Haha.
 
user142019
That question is a GIMME TEH CODEZ question, lel.
 
6:48 PM
Look at my most upvoted answer: stackoverflow.com/questions/12376339/…
 
user142019
Haha nice.
 
Pretty sure I got a badge for that
 
user142019
Let's see what I can do now.
 
user142019
Cool I can delete answers more easily.
 
Anybody else noticing the total SO question counter rapidly dropping? I might need to go on meta about this. This never happened before
 
6:51 PM
@rightfold grats on the 20k!
 
user142019
I also visited Stack Overflow for almost a thousand days.
 
@rightfold (in the voice of Nostradamus for full effect)
 
@rightfold looks like an XY problem...
 
Ell
@rightfold does chat count?
 
user142019
@Ell I think not.
 
6:51 PM
It does now:
one
 
@MonadNewb Looks like an "i dont know wtf im doing" problem
 
@Ell sure, you have to log in.
 
two
 
user142019
@MonadNewb Looks like a cplusplus.com problem.
 
@MonadNewb Nope, SO main site is separate, IIRC
 
6:52 PM
three
 
@Ell See it workses!
@rightfold That's lethal in the majority of documented cases
 
user142019
And legal.
 
Ell
@not-sehe hah took me a second :P
 
@Borgleader lol, that too
 
user142019
@Ell My avatar wants sex with yours.
 
6:53 PM
@Ell Hehehe
@rightfold You dig table cloth?
 
user142019
@not-sehe Sehehe
 
Ell
@rightfold tell it I will if you write some code with me
 
@not-sehe can you log in from chat.stackoverflow.com. I usually go to www.stackoverflow.com, log in, and then click on chat.
 
@rightfold Not-se-not-he-not-he-not-he
 
user142019
@Ell Okay, I'll write some code and you'll finish it. int main() { puts("Hello, world!.
 
6:53 PM
@MonadNewb I usually do ^T, ^L, cha<CR>, bam logged in. OpenId is powerful shit
 
Ell
@rightfold ");}
 
user142019
All say hey to sehe!
 
user142019
@Ell Well done.
 
@Borgleader That's one of the best SO answers I have every seen, if only for the Highlander reference.
 
The haydays of sehe hey-saying heists
 
6:55 PM
But I say nay to such heinous ways!
 
@rightfold Real britts would have major problems, seeing that the interpunction belongs outside the quotation marks!
 
@not-sehe I click on the OpenId link...guess I'm not the power user I like to think I am since I don't even know what those keyboard shortcuts do...
@not-sehe What browser do you use?
 
@MonadNewb New tab, address bar, "cha", enter?
@MonadNewb Whichever. Works in all: Opera, Chrome, Firefox aaaaand IE
But I use Opera
 
user142019
I like the "aaaaand" instead of "and" before IE. :)
 
@not-sehe I usually visit SO from a public computer, so I can't safely keep my logins in the browsers cache/cookies.
 
6:57 PM
@rightfold Yeah, it's totally unexpected: something works in IE. Well, actually, for me it usually doesn't work. This is because IE manages to take seconds to load a new tab and it has focus-races due to the unresponsive UI
 
Ew, public computers.
 
lol, I just noticed your avatar, @sehe
 
@MonadNewb Same deal. Google logsmein - on a public computer that would involve 1 login + mobile verification code.
 
@CatPlusPlus yah, tell me about it.
 
@MonadNewb There was a story to that:
@GoldenMedal Cough. I gently remind you of my warning: "it looks like you're trying to implement an expression parser. I'd strongly advise you to either..." - caveat emptor! But good luck on your journey :) — not-sehe Jun 23 at 19:17
 
user142019
6:59 PM
 
@not-sehe I don't use the mobile verification, although I probably should.
 
user142019
What do those funny brackets above the sigma mean?
 
@rightfold Floor
 
I got the reversal badge !!
 
user142019
6:59 PM
Ah, thanks.
 
@rightfold They mean that whoever clipped that formula didn't pay attention?
@LightnessRacesinOrbit lol. or that
 
In mathematics and computer science, the floor and ceiling functions map a real number to the largest previous or the smallest following integer, respectively. More precisely, floor(x) = \lfloor x\rfloor is the largest integer not greater than x and ceiling(x) = \lceil x \rceil is the smallest integer not less than x. Notation Carl Friedrich Gauss introduced the square bracket notation [ x] for the floor function in his third proof of quadratic reciprocity (1808). This remained the standard in mathematics until Kenneth E. Iverson introduced the names "floor" and "ceiling" and the cor...
 

« first day (991 days earlier)      last day (3951 days later) »