« first day (737 days earlier)      last day (4193 days later) » 

12:00 AM
drafted?
 
The last draft in the United States was during the Vietnam War in the 60s.
 
@DeadMG No, I"m not quite that old -- I volunteered, but realized it was a mistake long before I was done.
 
wouldn't know about how old you'd have to be to be drafted
but we didn't draft since WW2, or maybe even WW1, I think
 
You sign up for it when you're 18.
 
unbelievably young
 
12:09 AM
It's sexist too. Only men sign up, women are exempt. If you fail to sign up for the draft you get jailed and fined. You also lose a lot of your privileges for the government like financial aid.
 
wait, you still have to sign up?
 
You're forced to.
 
that's insane
the more I learn about the US, the more primitive I realize it is
that place must be even worse now than under colonial rule by the British
 
@DeadMG What are you talking about... the american dream... its awesome :P
 
Well, I think once you reach a certain age (40ish.. I think) you're exempt from an actual draft happening.
 
12:12 AM
@DeadMG Not much older than me -- my oldest brother probably would have been drafted if he hadn't gone to college instead (he was signed up, had a draft card, etc.)
 
And since we've haven't had one in so long, it'd be political suicide to initiate one.
 
We have medical tests for military and shit when you turn 18.
 
user406009
I don't think the army is actually going to need to use the draft anytime soon. My fellow students are more than willing to go into ROTC for the money.
 
We had obligatory year of service or something if you weren't in school, too, but fortunately that got canned.
 
South Korea has obligatory military service of two years after you graduate High School, IIRC.
 
12:13 AM
the difference is that South Korea is bordered by North Korea
and Seoul is fucking close to the border, too
 
Yeah and some people wanted to get one of the pro-SC2 players excempt from that xD I read something along those lines somewhere
 
yeah
 
South Korean government actually looks down on gaming.
 
except now the Korean military has a progaming team
@Rapptz Probably because it keeps killing their citizens.
 
user406009
 
user406009
12:15 AM
 
They keep making laws such as a midnight ban on games.
Forced break every hour of gaming, etc.
 
because people keep dying there due to overgaming
or causing their children to die of starvation whilst they binge on gaming
 
The law only applies to those under 16.
 
Idiots, idiots everywhere.
 
The only reason I know this is because I play some S. Korean games.
 
12:17 AM
@Rapptz Which ones?
 
@Rapptz Where have I heard lines like that before? Oh yeah, my friend who subscribed to Playboy "for the interesting articles -- I hardly even notice the pictures!"
 
@Borgleader Some Nexon games.
 
why would anyone pay for pictures of naked women in 2012?
 
I heard Playboy has interesting articles.
 
rofl
 
12:27 AM
@Rapptz "I read it for the articles". XD
 
what, "Increase the size of yuor penis!!!"
 
Well I've actually never read a playboy magazine before.
 
@DeadMG This was probably around 1985 or so.
 
I'd rather get my fix for pornography online since it's easier.
 
oh ok
 
12:28 AM
@CatPlusPlus what?
 
@DeadMG Yes -- the price of being a teenager was much higher back then. Now, the price of being an adult is higher, by about $10/bottle.
 
eh
 
@JerryCoffin I seem to not understand the context of what you've just said.
 
first I'd have to actually ascend from adolescence into adulthood
 
Aren't you over 23?
 
12:33 AM
turned 22 today
 
Oh. Happy Birthday.
I don't read the sidebar
 
Wow formatting fail.
 
Chat doesn't allow you to reply with a blockquote.
 
@Rapptz Aw. Might make a if I give enough of a damn.
 
12:35 AM
@Rapptz I believe they use , which they use quite often. :-P
 
Freudian slip. :(
 
@DeadMG why would anyone be fooled by nigerian scams?
 
fair point
 
@Cheersandhth.-Alf You underestimate how stupid/greedy some people can be
 
that said, i believe, although i haven't tested, that it's difficult for the average person to find nice pictures of naked women
 
12:41 AM
> There's a fool born every minute.
 
@Insilico Back then, you had to pay for porn. Now, a lot more people collect wine, so it's gotten considerably more expensive. Back in the '80s, I bought a case of Petrus for something like $150, which I thought was almost ridiculously expensive at the time. If I still had just one bottle from that case, I could probably sell it for 5 times that much...
 
@JerryCoffin I see.
 
as opposed to dull-witted american barbie dolls, or german animal-sex porn
 
user1182183
0
Q: What are the best WiFi settings for my situation?

Gam ErixI am trying to tweak my WiFi settings on the router and on my laptop so I can enjoy using the WiFi at my attic. For now I only get headaches because I cannot move freely around with my laptop at the attic because at some (further away from the router) spots the connection drops. This is really fr...

 
user1182183
I think I did my best to make it a good question, right?
 
12:43 AM
@GamErix The real question being why the hell do you hang out in your attic. :-P
 
much of the belief is because every year the term "porn" is the most searched for, and when i tried i have only got very ungood things on screen
 
user1182183
@Insilico well it's my room xd
 
(unless it's a nice, finished attic)
 
user1182183
@Insilico yep :]
 
@GamErix If I had no patience and a bit of money I would just go and get a wifi extender
@Cheersandhth.-Alf I don't think "porn" is what people search for, since Rule 34 makes it such that one would get lots of... uh, irrelevant results.
 
user1182183
12:44 AM
@Insilico TV, 14 speakers, Bed, desk, 1 small bedside, 2 wardrobes, and 2 side storage things, whatever it's in english
 
user1182183
@Insilico meh my mother hates lying around devices :/
 
Women aren't as.. "classy" now as they were back then. At least that's the feeling I get when I compare it to modern nude modeling.
 
user1182183
She won't agree to put anything in her room LOL
 
1
Q: How do I randomly shuffle an array WITHOUT using a library to shuffle? C++

user1756669So without using the fisher-yates shuffle. Example: string teams[] = {"Texas,","Ohio,","Alabama,","Penn,","Cali,","Indiana,"}

The OP specifically banned fisher-yates shuffle. — TheBuzzSaw 59 mins ago
^ LOL. Way to be blunt.
 
Stupid question with silly arbitrary restrictions, downvote, move on.
Business as usual.
 
12:48 AM
It went from 1 to -1 lol
 
@Rapptz Oops.
 
Oh, closevote too.
Nobody cares about your shitty homework restrictions, too localised.
 
Eh, flagged I guess.
 
holy titty fucking christ, I'm so sick
 
@DeadMG Presumably you have taken some kind of medication to help with your illness?
Hope you get better, in any case.
 
12:51 AM
no known effective medication
hell, I have no idea what said illness is
must try the doctor... again... soon
 
@DeadMG i hope you get better zoon!
 
22 fucking months is quite long enough
 
user1182183
ah found a repeater for just 12.50 eur. i think I can afford that
 
maybe, i hesitate to suggest this, but ... veggie/vegan diet?
 
is practically what I'm on already
 
12:58 AM
:(
okay i think it's bad enough to stay off sugar
 
typedef int(*addition_ptr)(int,int);
addition_ptr getAdditionFunctor()
{
  return [] (int x, int y) -> int { return x + y; };
}

int main()
{
  auto adder = getAdditionFunctor();
  adder(10,20);
}
Is that UB?
 
no
 
why would it be?
 
No. All you're doing is returning a pointer to a function (in this case, a lambda).
 
1:05 AM
local lambda definition
didn't think so, just wanted to make sure
 
FTR pointers to function cannot become stale.
 
Since lambdas are even allowed to decay to function pointer, I'd think it's ensured that it'll live forever, or be turned into a thunk or something.
Otherwise it's dumb.
Well, no thunks because no garbage collector silly me.
 
@CatPlusPlus Who says that thunks require garbage collection?
IIRC only a certain subset of lambdas can decay to function pointers
 
stateless
no thunks required
but you wouldn't need GC
just an RAII container for the thunk
 
RAII container where?
You get a function pointer.
 
1:11 AM
better is you get implementation-defined object, that can convert to a function pointer
 
Doesn't matter, you get function pointer at some point, and it can never point to nothing.
 
@DeadMG Does C++11 allow for that sort of thing?
 
Well, I guess implementation could just allocate a thunk and say fuck it, it'll get released by OS.
 
@CatPlusPlus No problem with invoking UB if a pointed-to object goes away, and that's no different for thunks than any other memory or data.
 
And since the value of a lambda expression is an implementation-defined object...
 
1:12 AM
But that's not ~C++~.
 
@Insilico Maybe.
 
@DeadMG See example above.
 
Better make that conversion operator lvalue ref qualified!
 
no reason for that to not be UB for a stateful lambda
 
Invoking UB is stupid for starters.
 
1:13 AM
well, I'd rather it be an explicit separate object
but there's nothing wrong with a good dose of UB now and then
 
Given that an object with a conversion to function pointer can be used for calls as a surrogate that means a lambda expression would yield a functor that can be used to create another functor which calls the same thing, except sometimes you get UB. Why introduce the second functor at all?
 
ask me when not horrific stomach pain
 
y u no see doctor?
 
Well this has turned into an interesting discussion! What if the function I posted above was returning an std::function object instead, and the lambda captured a function local variable by value? That's gotta be UB right? Or will it even compile?
 
If the 'safety' is that e.g. the second functor must be obtained via a meaningful name might as well make that meaningful name return the converted function pointer outright.
@Praetorian Only UB by ref. By value is fine.
 
1:17 AM
@Borgleader Tried. He wasn't much help.
 
By value means that the functor gets its own variable. When it's copied/moved inside the std::function that copy also gets its own variable and all is well.
To clarify that 'own' variable is created at the site of the lambda expression, hence it doesn't matter that the source is local.
 
@LucDanton Ok, that makes sense now
 
I wish I could recommend not returning std::function but that one is real tough.
 
@LucDanton Good luck with that if you're using VS2010, they implemented some version of lambdas before the implicit conversion to function pointer stuff was added to the standard. Even for stateless lambdas your only option is to stick it into an std::function
 
wat
What the fuck man
 
1:22 AM
what?
 
It has been fixed in VS2012, just checked
 
Conversion to function pointer is a footnote. I would never recommend 'always convert your lambdas to function pointers if you can get away with it', that's so dumb.
 
No, not always, I was talking about it in the context of returning one from a function
 
Same deal: it only makes 'if you can get away with it' includes your restriction.
 
So your recommendation is to use an std::function to store the lambda in? Or something else?
Speaking of returning lambdas from a function ...
0
Q: Lamda not found when defined in an inline function in G++ 4.7

J.N.I have the following function defined in a header file (the library it is part of aims at being header-only): typedef bool (*FieldComparer)(const std::string&, const std::string&); inline FieldComparer GetComparer(const std::string& query, string& separator) { if (query.find...

 
1:30 AM
Some of the time you can return something build from e.g. std::bind, std::mem_fn or even something elaborate constructed from Boost.Phoenix. The obvious benefit is that you express the same without paying the cost of type-erasure.
So it really depends too much on what you're doing to be an actual recommendation.
 
And speaking of, I should be writing @_@
 
So the question I linked to above, here's the LWS demo. It compiles if you remove inline, otherwise linker error
 
Works if you add internal linkage.
Could be an actual solution since the function doesn't appear to reference any SSD object.
If anyone is trying to answer that I think a good start is to confirm that the closure type of a lambda expression has the linkage of the immediate scope, which would be no linkage in the case of a local lambda. Which means it should 'just work'. Forcing internal linkage to have GCC comply is, I think, a good argument to the case, too.
I don't have time myself to write a complete answer.
 
holy shit terrible stomach pain
 
1:44 AM
Worth investigating is an inline function that odr-uses an SSDO of closure type that is not local to that function, both declared in a header, as used from different TUs.
 
@Praetorian it is a g++ bug. check the bug reports (and please report it if not already there). but, please add that complete example to the question
hm i added it myself
 
Quick Question: What are these brackets (if they show up properly) " 3n/2 – 2 " ?
 
they don't
 
they have no bottom on them?
 
Hi guys, thanks all for all your interest in my question.
 
1:55 AM
they embrace 32/2
3n/2*
  do not equal [ ]
 
Microsoft Word says the first bracket is Unicode F8EE
It says the second is F8F9
 
well no
sorry
not to type it out
what does it literally mean when used in a equation, reading over complexity time
 
they're in the private use area so can be different on different systems
 
my ears are cold
 
mine too
 
1:59 AM
@DeadMG i used to cure myself of that with hot chocolate with honey, and a warm duvet or something, then just relax with some interesting book or something
 
Hmm, honey.
 
Oh hey! Sure hope you'll hang for a while tonight.
 
yes, the secret ingredient
 
@LucDanton What's up? (But... I was planning on just checking out what' going on and then going to sleep :S)
 
ingesting less rather than more would be wise
@R.MartinhoFernandes What's going on is crippling stomach pain
 
2:03 AM
what book by arthur c clarke was that, person growing up on Titan or somewhere, introduction to pentominoes, traveling to earth, tasting honey, delicious but the idea of food produced by small animals or eating meat, very repulsive?
 
@R.MartinhoFernandes Aw. I wrote some actual Haskell yesterday and I forgot what's the usual approach between either leaving a recursion as non-tail or adding an accumulator that needs to be reversed in the base case.
 
if Haskell was meant to do accumulators, y it has no accumulator register?
 
Browsing around I found a post in the Erlang community that recommends profiling (i.e. it doesn't really matter). Looking at some Haskell code today the accumulator is always picked.
 
Imperial Earth is a novel written by Arthur C. Clarke, and published in time for the U.S. bicentennial in 1976 by Ballantine Books. The plot follows the protagonist, Duncan Makenzie, on a trip to Earth from his home on Titan, ostensibly for a diplomatic visit to the U.S. for its 500th birthday, but really in order to have a clone of himself produced. Plot summary Duncan Makenzie is the latest generation of the 'first family' of Titan, a colonised moon of Saturn. Originally settled by his grandfather Malcolm Makenzie in the early 23rd century, Titan's economy has flourished based o...
 
@LucDanton It's hard to take advice that applies to other FP languages, because being lazy changes the game a lot.
Non-tail recursion can overflow the thunk stack.
 
2:09 AM
Ah. I tried reading a bit about 'sharing', but I'm not sure how I should go about avoiding it in my code.
 
I know the first one. It's also not specific to non-strict evaluation, is it?
I mean I always strive for tail recursion. I can't remember if it makes sense when the accumulator needs to be reversed though.
 
Wait, what do you mean "reversed"?
You're accumulating a list and then reversing it?
 
Luc Danton : apparently you made a very helpful suggestion for my bug on inline + lambdas, would you mind posting this as an answer so that I can give you credit ?
 
In this, I'm not: one of the clauses is a cons. To make the function tail-recursive I would add the accumulator, get rid of the cons, reverse at the end.
 
2:15 AM
(many thanks by the way)
 
Reverse, :, reverse better than ++ with one element.
 
holy fucking shit; my stomach, the pain
 
@J.N. Well, you said you weren't interested in workarounds.
 
I should really record this fucking ad. I just hate talking to the mic so much.
 
@CatPlusPlus You mean appending? Don't think that applies.
 
2:16 AM
Want to buy new brain
 
@CatPlusPlus What are you on about?
Why would you record an ad.
 
Let's talk about retarded uni assignments.
 
He's a sellout.
 
@DeadMG in case it's (job) anxiety, keep in mind that we all folks here are pretty sharp and think you're okay
 
I like my version better.
 
2:17 AM
I didn't have one as good ar yours though
 
@Cheersandhth.-Alf I haven't been having job anxiety for nearly two years.
 
@J.N. There are additional caveats to that fix, too. Do you have other inline functions that have the same problem?
 
@LucDanton I am trying to compile the rest of the code, so far no
I do understand the implications on static though (or I think I do ;)
 
Right. SSDO with external linkage that are referenced being problematic. (And SSDO with internal linkage that are reference being problematic some of the time but everybody looks the other way and whistles inconspicuously when that happens.)
 
What does SSDO stand for ?
 
2:24 AM
Super secret DO.
(I can't tell you what DO means. It's secret)
 
Static-storage duration objects. In the context of inline functions in headers, global variables really.
 
Doodad, obviously.
 
Wait, did I get that the wrong way around with linkage. Have to check now.
 
hm, that reminds me of Heinlein's SDS
 
Woops. External linkage SSDO are totally fine. Real difference is internal linkage const vs internal linkage non-const, the latter of which is bad news.
 
2:30 AM
dunno if relevant, but linkage of local class changed with c++11, to support templating
 
@LucDanton Well, I personally don't like accumulators, and I only write code with them when things get bad. Actually, I'm a bit more radical and I don't like explicit recursion, so I tend to hide it in primitives like folds.
 
I really need a new brain
Fuck you, brain
 
You could drink lots of alcool.
 
@R.MartinhoFernandes When we have more time I could show you the code. Not that implementation matters too much, it's a PoC for that thing about finding a permutation.
 
Yeah, I'm sure it won't be noticeable on the recording.
 
2:31 AM
Take lsd nonstop
 
@Cheersandhth.-Alf That doesn't ring a bell. What's the change?
 
now you can use a local class as template argument
 
@R.MartinhoFernandes That second link is better than whatever page I was reading about folds. I was trying to use foldl' some time ago but failed completely at writing a strict function.
@Cheersandhth.-Alf Mmmh, I thought that was because they relaxed the requirement on template arguments, i.e. no more need for external linkage. Is that not the full picture?
 
The function doesn't have to be strict for fold to be strict.
The internal accumulator is strict, that forces the evaluation.
 
I really need to rest. Good night.
 
2:34 AM
Bye
 
@CatPlusPlus Can't you end up strictly accumulating thunks? Sounds dumb, but the link suggests so. Strictness has a depth so to speak, doesn't it?
I.e. sometimes you remove a thunk and end up with the one after that.
 
Which link?
 
Here, towards the end. Fairly sure I wa tupling things as well.
 
Maybe. You could make foldl' with deepseq instead of seq.
 
Yes, I was giving up right before using either deepseq or bang patterns.
 
2:42 AM
@LucDanton appears you're right. at least i find example with local class commented as "no linkage". it's non-normative ok but shows intention.
 
 
2 hours later…
4:51 AM
oki, what's wrong here (note: visual c++ 11.0 instead says "match")
 
GCC doesn't support regex.
 
5:06 AM
ah
it just compiles, but no good
 
What's the difference between return EXIT_SUCCESS and return 0
 
The former requires e.g. #include <cstdlib>.
 
No other difference?
 
That's it.
 
But there's a difference between EXIT_FAILURE and 1?
 
5:11 AM
so, answered yet another question, yay!
0
A: learning c++, outputting variable in structure

Cheers and hth. - AlfIf it's okay with you that it doesn't work with g++ 4.7.1 and earlier (but does work with Visual C++ 11.0 and later), then like … #include <sstream> // std::ostringstream #include <string> // std::string using namespace std; struct Stock { string ticker; do...

 
Interesting. A superficial reading suggests that EXIT_SUCCESS and 0 have the same effect (when passed e.g. to std::exit), but there is no requirement on the actual value of EXIT_SUCCESS.
 
thank @luc, I spotted typo in source code now, fixed 1 -> EXIT_FAILURE
 
@Rapptz I really don't know how to answer that question, sorry.
 
@Rapptz not necessarily <g>
 
I could answer the previous one because you compared return statements. EXIT_FAILURE is a macro and 1 is an int literal, so that makes them not that similar.
 
5:16 AM
Oh, I did mean when they're returned. Sorry for not making that clear.
 
return 1; is implementation-defined in meaning. return EXIT_FAILURE; signals a failure.
 
Ah, I see.
 
 
1 hour later…
6:40 AM
So, std::future<T> has no value_type, element_type, result_type or anything at all. That's convenient.
 
7:11 AM
0
Q: Is possible to include the standard library libstdc++ so I don't need to install it on my target?

tzippyI want to make sure to use the same version of the standard library on my target platform. So is there a way to compile it with my program?

close for dupe
 
"But I am very poorly today and very stupid and hate everybody and everything" - Charles Darwin
3
 
7:29 AM
mornin'
Is it deadMG's birthday?
 
@Cheersandhth.-Alf ಠ_ಠ
@LuchianGrigore yesterday was
morning all
 
7:48 AM
morning
Happy Birthday for yesterday @DeadMG
 
holly shit, Java is so inbred, they have made up a fancy term for passing an object into a classes constructor!?
 
what's that?
 
Dependency injection, I always thought it was something clever. But it's such a basic concept it doesn't even get a name in C++
 
Xeo
@thecoshman It's more about passing the dependencies of the class into it, instead of relying on globals. "dependency injection" exists in C++ too
Think loggers
You either access a global logger, or your class has a pointer-to-logger that it gets passed in its constructor
It's just a concept with a fancy name
 

« first day (737 days earlier)      last day (4193 days later) »