« first day (797 days earlier)      last day (4148 days later) » 

11:00 AM
(There is one big not-at-all-false sense of security you missed: if you get bombarded with the error messages, it means the compiler prevented you from making a mistake. If you get a successful compilation instead you will only find that during testing, or later in case you are unlucky/have poor tests)
 
Except the templates can easily allow error code due to duck typing. Especially with templated conversion operators and constructors.
 
@thecoshman you got some work done?
 
If you mean bad code is bad, yes.
 
Well, you tell me how to write strongly typed integers then. It's a pain in the ass.
 
How's that related to the iteration bits?
 
11:03 AM
@Alfred: Sometimes I have people of varying sizes in my car so I just took out the seats. — Lightness Races in Orbit 17 mins ago
lol
 
@RolandSams Yeah, odbc may be the simpliest answer, alternatively if you need to only make some simple queries, you could implement super small subset of pgsql protocol or make kind of proxy which would be GPL but your program would only connect to it
Actually why not use a dll?
 
@R.MartinhoFernandes It's just another thing I was having trouble with. Templates to add type safety are still the problem.
 
@yetihehe Hmm, I think can get OTL working... Thanks for the reply I will try ODBC if this doesn't work
 
@KonradRudolph random noise
 
@Pubby Well, sometimes you have to pick between the strongest solution and the one that does not have a super complex implementation. Tradeoffs, tradeoffs everywhere :P
 
11:08 AM
@sehe Random noise doesn’t downvote unless it flips just the right bits in the database
 
This week I ran into two situations where I would really like to have iterators, but that would mean implementing recursive iterators, so I just wrote a function that takes a lambda and does the recursion itself.
 
@R.MartinhoFernandes Yeah, I agree. Anyway, maybe Boost.Units is what I need, never really looked too see if it has user-defined units, probably should have!
 
@KonradRudolph Are you saying you never got a random downvote out of the blue before?
 
@TonyTheLion huh? what ever gave you that idea?
 
@R.MartinhoFernandes Sure, but rarely, and it always annoys me ruins my day
 
11:09 AM
lol
 
@R.MartinhoFernandes I think I ended up doing the same thing for most cases. Have a function call a lambda for each iteration rather than use iterators.
 
Konrad remembers every single rep point of his 160K
 
incidentally, have you finally got rid of Cicada / Nolwenn? I haven’t seen her in here in quite a while …
 
But I know I would really benefit from the iterators in the future, so I may end up enduring the pain and writing them :S
 
...unless you declare extern int a[]; in which case a really is an array and not a pointer. — FredOverflow 9 secs ago
 
11:11 AM
Fred sows confusion
 
extern can go in function parameters?
 
Of course not, just debunking the "and everywhere that you see int[] as a "type" is merely syntactic sugar for something else" claim.
 
Oh, now I see.
 
@KonradRudolph drama queen :)
 
C++ is wonderful. You can spend days, weeks, months and even years figuring out every weird corner case of the language without writing any useful programs.
8
 
11:15 AM
@FredOverflow And that's what you do, while watching Bjarne videos?
 
@FredOverflow aka, the lounge<c++>
 
fucking stupid laptop turning the brightness down just because I unplugged it (╯°□°)╯︵ ┻━┻
 
@R.MartinhoFernandes No, I also like to watch other videos :)
 
@Fred Thank you :)
 
11:17 AM
@R.MartinhoFernandes Moreover, by spewing 10k lines of template error messages, the compiler will also have prevented you from coding any more bugs for around the following 30 minutes
@FredOverflow Sooo... You like to watch, then?
 
@sehe I also like to play Hearts and Solitaire.
 
@FredOverflow I bet you like to take long walks on the beach too
 
aah, this post reminds me how long it’s been since I’ve programmed anything fun
1
Q: crafting a real interpreter using c# from AST

gsscoderI know that there are other question about compiler/interpreter technology and also very good code to study like IronPython to Jurassic. To me is quite clear how to build an AST (Abstract Syntax Tree) from source, writing a top-descent parser (for the moment I prefer writing than using code-gener...

 
user142019
Meh bcrypt in unit tests. Slow as fuck.
 
@Pubby We don't have beaches here. And no, I hate them.
 
11:22 AM
How can you hate them if you don't have them around?
 
@FredOverflow True hatred grows from familiarity.
 
Note the turn-on und turn-off :)
@R.MartinhoFernandes It's not like I've never walked on a beach.
 
user142019
In Ruby, && and and are the same except for their precedence. ~_~
 
How much do they differ? What operands are in between?
 
11:27 AM
online shopping has ruined google maps. it's so damn hard to find crap that actually has physical stores you an go to and buy things :p
 
@Zoidberg'-- Like Perl & PHP …
 
Ruby has too many Perlisms for my taste.
 
@R.MartinhoFernandes Word!
 
user142019
I like Ruby.
 
room topic changed to Lounge<C++>: Happy solstice! [c++] [c++11] [c++-faq]
 
11:30 AM
Can we see the specialization of std::hash for PlayerPtr? Also, why are you using a boost::shared_ptr instead of a std::shared_ptr? — FredOverflow 40 secs ago
How is his code even compiling without a hash specialization?
 
if I run chsh... to change the login shell... will that change the shell that is used when I connect via ssh?
or does that not count as a login shell?
 
I think so.
 
I hate codeplex with a fiery passion. How can a single website from a technology giant suck so much?
 
@FredOverflow you don't need to specialize std::hash, std::hash will call operator() by default which has to fulfill some properties.
 
@KonradRudolph because of the technology giant in question?
 
11:33 AM
I am thinking of making the default user I ssh into use rbash by default... then I would su to my main account if needs be
 
I mean, have you never looked at msdn or connect?
Microsoft has a very special talent, when it comes to websites
 
@bamboon boost::shared_ptr overloads operator()?
 
though I guess... if they have logged with the ppkp there is not much use in doing much else :P
 
anyway, let’s give Michael Stipe some money
 
@FredOverflow never claimed that ;)
 
11:36 AM
@thecoshman What do you mean "main account"?
 
@FredOverflow but it could be that it gets converted to T* for which std::hash is defined?
 
@FredOverflow There is a hash specialization for shared_ptrs.
 
@bamboon I don't think there is an implicit conversion from shared_ptr<T> to T*.
@R.MartinhoFernandes Even in Boost?
 
@R.MartinhoFernandes ssh into 'gate way account' which can't do much at all, su to another account that I actually use
 
@FredOverflow Why not?
 
11:40 AM
might not be the best of ideas though :S
 
I don't know, Boos seems to be lacking behind in terms of C++11 support.
 
@thecoshman That "gate way account" can su into the other account.
 
@R.MartinhoFernandes it can.... but I figure if I can lock down the gateway account such that you can not see what other accounts there are... though not too hard to brute force it, but I can always look at giving them a masked version of su that logs attempts...
this seems to be a good guide on locking down an account with rbash
 
Iiit's the end of the wooorld as we know it~
 
@thecoshman If you are not giving access to anyone, I don't see the point of making life harder on you.
 
11:46 AM
well, I might want to give access at some stage, so figure may as well play around for the now
any hoops, time to logoff for xmas :P
find me a valid use case for singletons, whilst your at it, I'll a perpetual motion machine too — thecoshman 9 secs ago
typos fixed, so shut up
any hoops
I'll do my best to keep on line, have fun y'all
 
lol
@thecoshman Have fun.
 
TIL There's always a relevant xkcd
 
When writing an input iterator, if *it is a prvalue, how do you implement operator->?
 
We should make a list of all C++ corner cases
 
@TonyTheLion Even chuck norris can't list all C++ corner cases
 
user142019
11:55 AM
@TonyTheLion But not on paper; that would require all the wood on Borneo!
 
    struct proxy {
        pointer operator->() { return &value; }
        value_type value;
    };
This looks fine, right?
 
Xeo
yeah
 
Oh, right.
 
I can never decide whether const is evil or cool.
 
11:58 AM
struct proxy {
    pointer operator->() { return &value; }
    reference value;
};
More generic, I think.
 
user142019
@FredOverflow Why not both? Like the devil.
 
Xeo
Hm... operator-> for input iterators is weird
 
Xeo
If *it yields an rvalue, so should it->m.
 
Xeo
11:59 AM
Because it's equivalent to (*it).m
 
Xeo
Lemme rethink that.
 
Who says (*it).m is an rvalue? :)
 
user142019
@FredOverflow Xeo.
 
Xeo
12:02 PM
 
Need to restart for updates. Oh well, guess it's time for lunch.
 
Xeo
So I remembered right.
 
@Xeo Visual Studio does not complain, but I guess that's because of its "ability" to bind lvalue references to temporaries. Yup, fails to compile with /Za.
 
Xeo
@R.MartinhoFernandes D'uh, for pointers, *p is always an lvalue.
@FredOverflow I guess so.
 
12:06 PM
Well, I'll just note this as one more place where I don't give a fuck about crazy iterator requirements.
 
Iterators have feelings, too!
 
user142019
Hurray Java class.
 
Xeo
In other news, my external HDD had a near-death experience earlier today. :(
Or maybe the HDD is fine at it's all the fault of that one cable I'm using.
 
@Zoidberg'-- abstract class java {}
 
user142019
@TonyTheLion this class is about abstract classes. :P
 
Xeo
12:11 PM
@Zoidberg'-- So, why are you even there?
 
user142019
@Xeo do I know.
 
user142019
Maybe Java has weird things I don't yet know.
 
cause he like abstract shit?
 
user142019
 
user142019
^ abstract shit
 
12:12 PM
Java surely has stuff you don't know, like ProxyBeanFactoryAbstractSingletonInterfaceObjectBuzzwordClasses
@Zoidberg'-- lol
 
user142019
@TonyTheLion lol Buzzword.
 
Xeo
@TonyTheLion But does it also have stuff I want to know?
 
user142019
AbstractSingletonProxyFactoryBean
 
user142019
@Xeo Everything because I want to pass the exam.
 
@Zoidberg'-- by value or by reference?
 
user142019
12:16 PM
@FredOverflow by global.
 
> Dave's the guy who invented Eclipse and was once a flag bearer for object oriented programming (he's since shied away from the "objects always, everywhere" philosophy.
 
user142019
 
not my fault :)
 
user142019
I like functions.
 
What should I get myself for Christmas, That 70s Show or Married With Children?
 
user142019
12:21 PM
// spawn a bus
spawn(new Bus());
 
user142019
Gotta love the comments in the sample code.
 
user142019
Oh how wonderful.
 
The parenthesis and the semicolons also need comments, I don't understand them.
 
user142019
// spawn a bus
spawn(new Ambulance());
 
Also, a meta-comment explaining the strange // signs would be nice.
 
12:23 PM
@Zoidberg'-- How on earth do you spawn a bus?
 
@Collin There's a typo in there, it should be spawn(new Bust());
 
user142019
@Collin Cheat codes.
 
Mix up some yellow paint, throw in some wires, some metal, and a few kids and just let it congeal?
 
user142019
Teacher y u mix Dutch and English identifiers.
 
auto main() -> decltype(main())
error: ‘main’ was not declared in this scope
 
user142019
12:25 PM
Just use only English already!
 
user142019
@FredOverflow uh
 
user142019
Are you surprised that that doesn't work?
 
No, I just find it funny :)
 
user142019
lol
 
user142019
12:25 PM
I want this:
 
Also, I wouldn't be surprised if it did work, because we all know the return type of main is int, right? :)
 
user142019
auto foo() {
    return 42;
}
static_assert(std::is_same<decltype(foo()), int>::value, "");
 
Oooh, that would be nice. I think the committee is considering it!
 
user142019
@FredOverflow not when in a namespace!
 
Xeo
@Zoidberg'-- It's most likely reality for C++14
 
user142019
12:26 PM
@FredOverflow all we can do is auto foo = [] { return 42; };!
 
user142019
@Xeo I hope so. Using auto foo() -> decltype(expr) { return expr; } is annoying.
 
Xeo
Indeed is.
And full inference allows cooler stuff.
 
user142019
The only problem is that the definition will need to be inline, but oh well.
 
user142019
Also MODULES.
 
Xeo
Like an extremely easy and efficient operator->*
@Zoidberg'-- C++17 most likely. :(
 
user142019
12:28 PM
I can wait four years for that. I'll just do C, Haskell, Erlang, CoffeeScript, Python and Ruby in the meantime.
 
@Xeo Can the function have a more complicated body? Or just one return statement?
 
user142019
@FredOverflow if all return statements have the same return type, it should not be a problem.
 
awesome
 
Xeo
@FredOverflow Not just one return statement.
Lambdas get that too.
 
Woo :) 1.5 weeks holiday after today
 
Xeo
12:30 PM
auto foo() will work as long as there's atleast one return statement from which the return type can be inferred.
 
user142019
@TonyTheLion Woo :) birthday after the day after today
 
@Xeo link to N paper?
 
user142019
@Xeo can't it be void if there are no return statements?
 
Xeo
@Zoidberg'-- Oh, yeah, sure.
 
@Zoidberg'-- Why would you prefer auto to void? :)
 
user142019
@FredOverflow Less typing! Oh wait...
 
Xeo
@FredOverflow consistency!
 
user142019
What will happen if you do auto main() {}?
 
user142019
int or void? :P
 
How about implicit auto? Like foo() { return 3.14; }? :)
 
Xeo
12:31 PM
@Zoidberg'-- no idea, but my bet's on error. :)
@FredOverflow lol, not gonna happen.
 
user142019
@FredOverflow lol looks like C.
 
user142019
main() {}
 
@Zoidberg'-- given that int is only being considered because it is the only correct return type, I think the answer is obvious. ;)
 
user142019
> auto h() { return h(); } // error, return type of h is unknown
 
user142019
Isn't that UB?
 
12:32 PM
I think we need more ternary operators, like a : b ) c, the smiley face operator.
 
@Zoidberg'-- unknown behavior?
 
user142019
We need extern "Python" and extern "Haskell".
 
user142019
@FredOverflow We need std::fred() which returns a random joke.
 
Uniformly distributed? Or Gaussian?
 
user142019
@FredOverflow Fred-defined.
 
user142019
@TonyTheLion if course it works.
 
Oh, we definitely need more behavior categories!
 
user142019
Apocalyptic behaviour on 21sts.
 
@Zoidberg'-- if course?
 
12:36 PM
like ill-defined except on Windows ("Bill-defined")
 
user142019
@TonyTheLion My fingers were off course while I was typing that message.
 
ahahaha
 
user142019
I want haskell, like asm, but for inline Haskell.
 
user142019
Also, typename<char... Cs> operator "" for string literals. :<
 
user142019
12:38 PM
If you can do that, you can write a Haskell compiler as a TMP.
 
You don't need that.
 
I want nicer meta-function invokation syntax, like @R.MartinhoFernandes always uses AddPointer<T> instead of typename add_pointer<T>::type.
 
I never use AddPoiner<T>.
 
Ell
@FredOverflow that just needs template aliases doesn't it?
 
Damn, I typoed the typo.
 
12:39 PM
dat spelling mistake.
 
user142019
I use T*. :^)
 
@R.MartinhoFernandes lol
 
@Zoidberg'-- That's broken for some stuffs.
 
Xeo
i.e., references.
 
#define self (*this)
 
I guess you haven't pin-pointed that problem eh? — Tony The Lion 7 secs ago
 
user142019
@TonyTheLion Dat pun.
 
@Collin You are kinda late to the party, right?
 
@R.MartinhoFernandes You guys wake up 6 hours before me
 
I think I'm always late to the party :(
 
@Collin This has been running for days now.
 
Oh, I see you're winning
 
Like, I have the hat for "post or vote on Dec 16".
Today is Dec 21 or Dec 22.
I need to post moar answers, but I am too picky.
 
Yeah, I'm not getting Monarch by Right
Pretty sure I've never rep-capped
 
12:46 PM
@Collin How about Monad by Right?
 
float absolutevalue(float x)
{
    if (x < 0)
        x = -x;

    return x;
}
dafuq?
 
@FredOverflow I should really learn haskell
 
@TonyTheLion What about it? Looks fine to me.
 
user142019
@TonyTheLion eww if with statement on new line without braces.
 
@Zoidberg'-- it's nature
 
user142019
12:47 PM
float abs(float x) {
    return x < 0 ? -x : x;
}
 
Ell
yes.
 
float abs(float x) { return std::abs(x); }
 
wasn't sure about the signedness of float
 
user142019
float is always signed, silly.
 
well, silly here, wasn't sure
 
user142019
12:49 PM
You cannot have unsigned floating point numbers in C++.
 
user142019
At least not without UDTs.
 
float very_slow_abs(float f)
{
    union { float f; unsigned u; } x;
    x.f = f;
    x.u &= 0x7fffffff;
    return x.f;
}
 
@R.MartinhoFernandes Ah, I thought 250 was the cap, but that's cool
 
Xeo
@R.MartinhoFernandes That one guy who "proposes" to allow @e + 2 as a lambda body and leaving the argument list out doesn't realize that, as soon as you have two arguments, that syntax is fucked, does he?
 
12:51 PM
I'm thinking this is UB somewhere?
 
@Xeo Everyone in that thread seems crazy after some point.
 
Xeo
Yeah
 
@TonyTheLion Nothing to see there.
 
@TonyTheLion 4892 File size limit exceeded(core dumped) lol
@R.MartinhoFernandes You have to be patient. Or did you mean "nothing to see here" like a police officer? :)
 
Xeo
(2) the parameter-list. If the full lambda expression is correctly
identified, then all implicit arguments are found and generating the
parameter list is trivial:

   @a + @b * @c  -> ( auto a, auto b, auto c)
ahahaha
 
12:53 PM
exactly what I mean
 
@Xeo lolol
Someone should post "You all crazy".
 
Xeo
Seriously, what a fool.
 
I answered a C++/CLI question. I feel dirty.
 
Xeo
I mean, does he really not see the problem with parameter order in that?
The bleach is over there in the corner.
 
@TonyTheLion Why is your square root function called square? :)
@Xeo a before b before c? :)
 
12:54 PM
@FredOverflow because it's not my code
 
Okay, let me ask you a different question: Why are you reading other people's homework?
 
because I have no life
 
user142019
Call your square root function squirt.
 
Xeo
Question: How do you guys pronounce sqrt? :)
 
14 secs ago, by Zoidberg'--
Feb 25 '11 at 12:13, by FredOverflow
@jalf What a dirty function, I always pronunce sqrt as "squirt" :-)
 
user142019
12:55 PM
squirt
 
Xeo
@Zoidberg'-- Aw, c'mon!
 
square root
 
user142019
Feb 25 '11 at 12:13, by FredOverflow
@jalf What a dirty function, I always pronunce sqrt as "squirt" :-)
 
user142019
Come on! I wasn't even in this room back then!
 
pronunce? lol
 
12:56 PM
you nunce
 
produnce?
 
user142019
Java y u only dynamic_cast.
 
user142019
I want static_cast and if I do it wrong it's my own fault if I use the result.
 
user142019
And thus UB.
 
@Xeo "square root". How the fuck else would you pronounce it?
Pootter root?
 
user142019
12:59 PM
3 mins ago, by FredOverflow
14 secs ago, by Zoidberg'--
Feb 25 '11 at 12:13, by FredOverflow
@jalf What a dirty function, I always pronunce sqrt as "squirt" :-)
 
Xeo
3 mins ago, by Zoidberg'--
squirt
 
@Xeo I posted a reply and refrained from calling everyone crazy.
 
// What I have to write in C++11
std::sort(persons.begin(), persons.end(), [](const Person& a, const Person& b) { return a.age() < b.age(); });

// What I want to be able to write in C++14
std::sort_by(persons, &Person::age);
 

« first day (797 days earlier)      last day (4148 days later) »