« first day (837 days earlier)      last day (4097 days later) » 

11:00 AM
@ereOn that's bullshit
 
@StackedCrooked Oh yes. I've used const_cast<> exactly once, and it was to work around some crappily-written library.
 
Xeo
@StackedCrooked reinterpret_cast must involve references or pointers, yeah.
 
@StackedCrooked reinterpret_cast is actually the most restricted of all casts.
@Xeo Or identity conversions :P
 
Xeo
@R.MartinhoFernandes I ignore that.
 
11:01 AM
References are bad, we already covered that.
 
Always use pointers!
And always use new.
 
And don't ever use exceptions.
 
And never call delete, the OS takes care of it.
 
I prefer old
Use null pointers and prefer UB
 
Now that's the way to go.
 
11:03 AM
@Insilico Yeah, they make your program fail. Why on earth would you do that!? Dumb language designers.
 
At least you know "what is happening", because with references, you never know the voodoo that occurs underneath.
 
@StackedCrooked And use strcpy and friends to handle strings.
 
Xeo
Any noob joining in right now will be scarred for life.
 
@Insilico memcpy ftw!
 
room topic changed to Lounge<C++>: Noobs will be scarred for life. [c++] [c++11] [c++-faq] [get-out] [no-questions] [no-singletons]
 
11:04 AM
Would he ? He probably wouldn't understand the failed-logic
 
He would assume it as truth and build his carreer on it.
And teach his underlings how to program.
 
If he's writing C++ he's already scarred for life
 
That would result in a new world, for sure.
 
@ereOn Java has already done that, so much more than C++ ever did.
 
Using UB allows you to bypass the nasty dumb restrictions.
It's what real programmers do.
 
11:07 AM
auto begin() -> decltype(_data.begin()) { return _data.begin(); } <- is this legit?
 
@StackedCrooked Psh. Real programmers flip the magnetic polarities of individual bits on the hard disk to write their programs.
 
user142019
@CatPlusPlus Dankesch\"{o}n. Will take a look at it.
 
@Insilico Been there done that. Had to reinstall my os though..
 
@BartekBanachewicz Yup
 
UB is just a way of saying : "I'm too dumb to understand the complex logic behind ++i = ++i + ++i"
 
11:07 AM
@BartekBanachewicz Yes, why not?
 
Just checking. :)
 
Are there any "soft errors" that are not substitution failures?
 
@R.MartinhoFernandes I assume we're talking about C++11? IIRC it broadens the scope of what's considered a substitution failure compared to C++03.
 
How come your name is shortened to just "R.". Is it because of the period?
 
@Insilico Yes.
 
11:09 AM
@R.MartinhoFernandes you mean doing function_A(value_A, function_B( function_C))) rather then function_C(function_B(function_A(value_A)))?
 
@StackedCrooked No, it's because your browser window is not wide enough to handle the awesomeness that is Lounge<C++>.
 
@thecoshman Not really
It's complicated
 
Yeah, CPS is like girlfriends.
 
You turn them inside out?
Are you a psychopath?
 
oh, is it more about how a compiler compiles the code rather than a programming style?
 
11:12 AM
No
It's a programming style
It's also used mostly by compilers
 
I see...
 
so my holidays finally got approved for my Berlin trip next week :)
 
It's like SSA, an intermediate form
 
Wikipedia has some examples.
 
yeah... they make little sense :S
 
11:14 AM
They're written in Lisp which doesn't help
 
user142019
Java test in an hour or so. :D
 
Seriously writing examples in one of the most unreadable languages ever
 
user142019
lol
 
@CatPlusPlus provide alternate examples then
 
I'm not writing CPS are you mad
 
11:15 AM
It seems JavaScript is the most common programming language that uses CPS.
 
@thecoshman This has some small examples in C# blogs.msdn.com/b/wesdyer/archive/2007/12/22/…
 
@SomethingDifferent hi
 
@SomethingDifferent Good noon.
 
@StackedCrooked You're inaccurate by 16 minutes
You should say, good afternoon
 
11:16 AM
@StackedCrooked Yeah, unsuitable asynchronous interfaces can easily lead to CPS code.
It's why I don't like Boost.Asio much.
 
Or say good noon when it is precisely 12:00:00
 
@R.MartinhoFernandes probably not much more help :P
 
@thecoshman It's Java with lambdas.
 
@StackedCrooked It was more of a programming joke than anything else
like 0.0 == floatVar
 
11:18 AM
I don't see the joke...
 
Xeo
That's pretty far-fetched.
 
I know that 0.0 == floatVar is not a good thing to do.
 
Right, now I remember why i don't come in here anymore
 
@Neil Because of me? :(
 
11:19 AM
@StackedCrooked No, of course not
 
I'm thinking of emailing Scott Meyers later about passing shared_ptrs Herb-style.
 
@R.MartinhoFernandes What's Herb-style?
 
"Prefer by-const-ref to by-value"
 
Kos
Hello there
 
If I can also convince the ape that Herb-style is bad, that might be nice too.
 
11:21 AM
I wonder if I can replace the guts out of this PC I bought in 2006 in order to make it a modern computer. I would like to retain the case and insert a new motherboard and CPU.
 
Kos
Need some help
Somebody is wrong on the internet :-)
 
But I don't know how things have evolved. Is a PC case from 2006 still going to be able to contain a motherboard from 2012?
 
@R.MartinhoFernandes Why's Herb-style bad?
 
@Kos what? downvote that?
 
11:23 AM
@StackedCrooked Depends on the form factor of the case.
 
Kos
I believe the OP got misguided by one of the answers. I don't want to sound like a jerk and keep shouting "you are wrong, see my answer"; but a third opinion might work
 
Fortunately the form factor is somewhat standardized.
 
@Insilico It's pretty ..conventional. I think.
 
: For computers form factors both larger and smaller than desktop personal computers, see list of computer size categories. In computing, the form factor is the specification of a motherboard - the dimensions, power supply type, location of mounting holes, number of ports on the back panel, etc. Specifically, in the IBM PC compatible industry, standard form factors ensure that parts are interchangeable across competing vendors and generations of technology, while in enterprise computing, form factors ensure that server modules fit into existing rackmount systems. Traditionally, the most s...
 
Kos
Just want to convince the OP to read up and rethink. It's just feels wrong for a misguiding answer to stay accepted and keep misguiding people later
 
11:24 AM
@Insilico It defaults to the wrong option. I have an answer covering this in detail. Sec.
43
A: Passing shared pointers as arguments

R. Martinho Fernandes I want to pass a shared pointer to a function. Tell me how to do that. I can only think of two reasons to take a shared_ptr argument: The function wants to share ownership of the object; The function does some operation that works specifically on shared_ptrs. Which one are you interested...

 
@StackedCrooked Unfortunately it's another one of those "someone-saw-14-standards-and-decided-to-make-a-15th-standard" kind of things.
 
@StackedCrooked Assuming it's a fairly convention case, yes. Depending on the original motherboard, you might also need to replace the power supply. A stock 2006 power supply will often be pretty limiting, especially in terms of the graphics card you can use (might easily be a 350-400 watt power supply, where a current medium to high-end graphics card may require 600 watts or more).
 
Then again ATX was invented literally in the last millenium (1995) so you may be able to make your motherboard upgrade work, if we're just talking about the physical installing of the board.
 
It's coated to reduce noise. Let me check the power.
 
user142019
Meh.
 
11:30 AM
@Kos ohai. Not seeing you much here.
 
user142019
Erlang's crypto user guide is very useful. All it contains is a copy of the OpenSSL license.
 
@StackedCrooked You have a 430 watt power supply.
 
And that's not enough I assume?
 
@StackedCrooked Depends. If all you're installing is components for a nettop, then it's plenty.
 
11:40 AM
It's supposed to be an upgrade you know :)
 
@StackedCrooked 430 watts total. If you're using integrated graphics or a low-end card, that will probably be adequate, but if you want to do much gaming (and such) you'll want a higher-end graphics card than it can support.
 
I'm mostly interested in fast C++ compilation and a SSD hard drive.
The big jump in power usage between now and a few years ago surprises me though.
 
@StackedCrooked A power supply for a computer outputs different voltages. Each voltage supply has its own maximum wattage.
Notice that the sum of the first 4 wattage ratings are greater than 430 watts.
 
Yeah, they miscounted!
Damn Chinese.
 
So you can't pull 430 watts from only the +5 volt channel.
 
11:42 AM
0
Q: How to use sfinae for selecting constructors?

WalterIn template meta programming, one can use SFINAE on the return type to choose a certain template member function, i.e. template<int N> struct A { int sum() const noexcept { return _sum<N-1>(); } private: int _data[N]; template<int I> typename std::enable_if< I,int>...

 
SSD's dont seem to get particularly warm, so they would seem to be low power, (haven't looked it up, though).
 
what?
 
@MartinJames AFAIK the are more energy friendly than the spinning HDs.
No moving parts.
 
@StackedCrooked As long as you don't care much about graphics, you're probably fine -- high end graphics cards are the main place power usage has gone up dramatically.
 
@StackedCrooked Isn't that just because of increased processing power of our computers?
 
11:44 AM
I see, that's good then.
 
My Samsung SSD is significantly cooler than the 450G HD in the next bay.
 
It might be the case that the typical watt/computing power went down in the last few years.
 
@Insilico Yeah, but on the other hand the Eniac did not have much processing power and yet it consumed lots of energy.
@MartinJames SSD's are really cool. I love them!
 
@StackedCrooked Heh - and the temperature is lower, too.
 
@StackedCrooked Right, over the last few decades the watts consumed per computing power unit (DMIPS?) went down pretty drastically.
 
11:47 AM
Yet, my power unit won't support modern graphics card :)
 
Unfortunately, the fan size per graphics card, (FSPGC), has gone up even more.
 
@MartinJames I have a microcontroller that consumes only 200 microamps at 1 MHz and 2 volts or something. And said chip had way more computing power than ENIAC did. And ran at room temperature. :-P
 
ENIAC ran at room temperature, but then again, it owned the room.
 
@MartinJames It's steady-state operating temperature was definitely higher than room temperature. :-P
 
ENIAC was also in a room.
 
11:56 AM
I need more storage. I'll go with a networked file server box, (ie. one with its own power supply).
 
user142019
Email is terrible.
 
user142019
@TonyTheLion that news is so old.
 
user142019
It's in an answer on Stack Overflow about security fails.
 
user142019
11:59 AM
From like, before the great removal.
 
@Mysticial Oh, you mean the Bjarne book thing? :)
 
user142019
I want summer. D:
 
user142019
@FredOverflow it's awesome.
 
I did something awesome? Gonna celebrate by eating noodles :)
 
user142019
Gimme noodles too. :(
 
12:01 PM
Wow, 55 upvotes for my last question.
 
user142019
No Fred, "-" means "negative".
 
What minus?
 
user142019
I'm joking, you fool.
 
user142019
Also, <pedant-mode>55 upvotes doesn't necessarily mean the post has a positive score</pedant-mode>.
 
> Now i compiling my app
 
user142019
12:05 PM
C++ code is often comPILE OF SHITd.
 
You're kidding, right?
 
user142019
As always.
 
user142019
The Java test will most certainly contain a question about how encapsulation is done, and the "correct" answer will be "with getters and setters."
 
user142019
I can't wait. I'm gonna laugh my ass off while writing a page full of why this is complete nonsense.
 
Zoidberg { set; get; lol; }
2
@Zoidberg and get a lame mark
 
user142019
12:08 PM
@BartekBanachewicz As if I care.
 
Wanna hear a story about uni "correctness"? :)
 
user142019
I don't really care about uni correctness.
 
user142019
I want correct correctness.
 
user142019
No matter what.
 
Did they force you to worship Design Patterns yet? :)
 
user142019
12:10 PM
Except for getters and setters for every fucking member, nope.
 
user142019
But the teacher did write a singleton logger!
 
@Zoidberg That's not a Design Pattern.
 
user142019
Ah whatever. :P
 
user142019
It's moronism. Close enough.
 
user142019
It was hilarious.
 
12:12 PM
Your teacher only teaches one Design Pattern, and he choses the Singleton? Maybe the set of Design Patterns he knows is also a singleton? :)
 
user142019
Teacher wrote a lazy (as in, getInstance has if null crap) singleton logger and got confused because it was so complicated; he forgot to use getInstance and instead used the static data member (don't know nor care about the correct Java terminology for that) directly and ended up with null pointer exceptions all over the place.
 
You get lazy initialization for free anyway thanks to the dynamic behavior of the class loader. No need to do it explicitly.
 
When did he do it?
 
user142019
@FredOverflow lol
 
user142019
@BartekBanachewicz in class, when he wanted to show an example of static member functions.
 
user142019
12:13 PM
 
Of course I wouldn't suspect your teacher to know what a "class loader" might be :)
 
what a fucktard
 
user142019
@FredOverflow heh. :P
 
user142019
I'm gonna tell him!
 
But let's not get off-topic here. Singletons suck, and we should never forget it!
@Zoidberg Write a test first to see if that's actually true ;)
 
user142019
12:15 PM
Objective-C has +[NSObject initialize], which is a class method called for every class exactly once before the first message is sent to that class.
 
user142019
@FredOverflow okay. :P
 
user142019
Hey Fred wait.
 
user142019
It was about this:
 
user142019
class MyShittySingletonLogger {
    private static MyShittySingletonLogger inst;

    public MyShittySingletonLogger getInstance() {
        if (inst == null) inst = new MyShittySingletonLogger();
        return inst;
    }
}
 
user142019
Does that even work with class loader? inst will be null before it's first assigned.
 
user142019
12:16 PM
Or do you mean private static MyShittySingletonLogger inst = new MyShittySingletonLogger();?
 
user142019
lol
 
user142019
I like how Erlang does hot code swapping. It's based on recursion and message passing. :)
 
I like how I don't know Erlang
look at all the fucks I don't give, they're falling from the sky
 
12:19 PM
@Zoidberg Yes. Or just make it public and final.
 
user142019
foo() ->
    receive
        {do_something, Foo} -> io:format("~s~n", [Foo]), foo();
        {swap, Fun} -> Fun() %% swap code :3
    end.
 
user142019
@FredOverflow BUT public IS BAD DON'T USE IT EXCEPT FOR METHODS AND FOR GETTERS AND SETTERS.
 
@TonyTheLion We should have exactly one question in , and it should be about how Singletons suck.
 
@FredOverflow yes :)
 
@Zoidberg public static final is fine. What would you gain from a getter here? Nothing.
 
user142019
12:20 PM
> ENCAPSULATION
 
@FredOverflow he means his teacher would insist on it. Smile and wave, just don't go too close to the bars.
 
lol right
 
user142019
Also, singletons are great.
 
user142019
singleton x = [x] :3
 
I remember being very confused when I saw const and singleton in Haskell for the first time :)
 
user142019
12:22 PM
In the beginning I was confused by class.
 
user142019
And later by curry and uncurry.
 
I think ignore or something would make more sense that const.
const x _ = x
^ right?
 
user142019
The documentation of const is so weird.
 
user142019
> Constant function.
 
user142019
@FredOverflow I'd say x and _, but yes.
 
12:23 PM
@Zoidberg the seasoning?
 
It's pretty constant.
 
user142019
-- | Constant function.
const                   :: a -> b -> a
const x _               =  x
 
user142019
Well, I can see the reasoning behind the name const when you pass it as an argument to a HOF.
 
I remember needing const once, but I cannot remember what it was.
What is the typical use case for it?
 
user142019
Passing it as arguments to HOFs.
 
user142019
12:25 PM
Otherwise it's pretty pointless. xD
 
user142019
Maybe point-free style.
 
She makes it seem so simple. But I'm clueless about where I could obtain the tools she is using.
 
answerAllTheQuestions = map (const 42)
^ How about that? :)
 
user142019
Something like that.
 
user142019
(.) f g = \x -> f (g x) ugh.
 
user142019
12:26 PM
HASKELL Y U NO (.) f g x = f $ g x.
 
@StackedCrooked simple? FFS she is sucking the glass off!
 
Even I am not capable of sucking like she does.
I mean because I don't have the tools she is using.
 
Sep 10 '11 at 15:14, by FredOverflow
Prelude Control.Monad> let subsets = filterM (const [True, False])
Prelude Control.Monad> subsets [1,2,3]
[[1,2,3],[1,2],[1,3],[1],[2,3],[2],[3],[]]
Stretching the meaning of 'need', of course.
 
Xeo
@Zoidberg Why not... first?!
 
@LucDanton Ah yes, quite sexy.
 
user142019
12:30 PM
@Xeo Because it's named after the way it's most often used.
 
@Xeo We already have a first function in Haskell. It's called fst :)
 
user142019
To have a "constant function"; one that always returns the same value.
 
user142019
And all functions in Haskell take only one argument.
 
Right, now it makes more sense.
 
@FredOverflow I prefer const x to express 'constant function yielding x' over \_ -> x. There's no one particular situation where you need constant functions, but they do come up now and then (strictly IME).
 
user142019
12:31 PM
So const 42 is a function that returns 42 no matter the argument given.
 
Xeo
mhm
 
@FredOverflow There's Control.Arrow.first, also second.
 
Xeo
Right, I forgot automatic partial application
 
user142019
@LucDanton But those operate on arrows, right?
 
@Xeo There is no need for partial function application in Haskell, because no function has more than one argument.
 
Xeo
12:32 PM
@FredOverflow auto-currying and binding then, if you will.
Whatever
I'm confusing currying and partial application all the time anyways.
 
user142019
foo a b c d = ... is the same as foo a = \b -> \c -> \d -> .... :P
 
What would \_->x look like in C++? I have a gut feeling it would require more than 5 characters? ;)
 
There's no manual currying, so just call it 'currying'. 'Closing over' is what you want to say for the second, too.
 
user142019
@FredOverflow [=] <typename T /* assuming possible */> (T) { return x; }.
 
Xeo
@FredOverflow [&](auto) x; in C++Next
 
12:34 PM
@Xeo So concise? I'm gonna weep!
 
(Well, there is curry.)
 
Xeo
(If I remember the proposal correctly.)
 
@LucDanton Right, but almost no function in Haskell takes pairs :)
 
user142019
Not that it really matters; everything is immutable anyway.
 
user142019
@Xeo I'd say =.
 
user142019
12:35 PM
With the exception of IORef and STRef, of course. But those are special cases. :P
 
Xeo
@FredOverflow [&](auto&&) x; actually, since you don't want a copy.
@Zoidberg Hm, maybe
Doesn't change the characters needed, though.
 
user142019
Maybe monad in C++!
 
@FredOverflow That's a bold statement.
 
@FredOverflow yup. You're only required to supply an expression (hopefully)
 
Xeo
@Zoidberg std::optional?
 
user142019
12:36 PM
With dingus. >>= overloaded. xD
 
@Zoidberg Somehow I find the looks of that operator quite appealing. I have no idea why :)
 
Xeo
@Zoidberg Wrong associativity.
 
@FredOverflow it resembles your av ;p
 
user142019
@Xeo more parens!
 
user142019
Anyway, time to fix a Java test. brb
 
12:37 PM
@BartekBanachewicz Dang, I wanted to keep it a secret ;)
@Zoidberg Good luck, and tell us how it went!
@LucDanton No, this is a bold statement ;)
 
@Xeo >>= isn't that useful for clients anyway.
 
> Ceci n'est pas une statemente bolde.
 
Jan 17 at 15:13, by R. Martinho Fernandes
I prefer do-notation, fmap, <$>, and/or <^/ ^>.
 
@R.MartinhoFernandes <$> is too capitalist for my taste.
 
12:40 PM
I prefer sleep
 
@FredOverflow You haven't used arrows much, I see.
 
I haven't used anything besides lists and functions ;)
 
@FredOverflow Are you a secret lisper?
 
I hate Lisp with a passion.
 
The programming language or the speech disorder?
 
12:48 PM
lol
 
I found Clojure to be rather interesting though.
 
@StackedCrooked Funny, watching a video on Clojure right now.
 
So, are you hating it with a passion? :)
 
What, Clojure? Never tried it. I just like watching/hearing Rich Hickey talk :)
 
He is a bit of a guru.
But I don't think he's speaking nonsense.
@FredOverflow Is that a political statement about the united states?
 
12:53 PM
Funny how that word means two completely different things in English. We have "Zustand" and "Staat" for that.
 
Xeo
@FredOverflow Yeah, but we have our own "Teekesselchen". :)
 
In Dutch we have status and toestand which mean more or less the same. And staat which means a nation or territory considered as an organized political community under one government.
 

« first day (837 days earlier)      last day (4097 days later) »