« first day (1282 days earlier)      last day (3659 days later) » 

12:00 AM
@BenjaminDangerJohnson Hmmm? Noticed nothing of the sort. Specifics?
 
yeah it's usually the standard work around. Sadly I am a terrible windows programmer (in C++) so I can't give you much more advice than that
@sehe Word of mouth, I do mostly simple stuff so it generally works in my case
 
It just works. std::thread (<thread>) seems pretty well done in my opinion. MSVC 2013 here
 
Thanks for everyone's input.
I have MSVC 2013 as well.
 
@JaredBurrows (a) just use c++11 (b) just use Boost. Do not go down the road of #ifdef-ing. At least not for <thread> support. It's unnecessary, unwieldy, error-prone and that serial killer knows where you live!
@JaredBurrows That future has been for quite a while. What's your beef with std::thread in MSVC?!
 
12:04 AM
@unituniverse I think it matters, because you're confused. — sehe 4 secs ago
@JaredBurrows Yes?
 
@sehe That's the plan. I just wanted people's inputs. I have used #ifdefs for pthreads and win32. I do not have beef with it. I was just asking about the link I posted earlier.
 
@JaredBurrows My question is what is the beef with std::thread? Why would you even use pthreads vs win32?
 
@unituniverse I think it matters, because you're confused. — sehe 1 min ago
Flagged as non-constructive
 
@sehe I do not have a beef lol. Just asking opinions. I mainly develop on Linux.
 
@LightnessRacesinOrbit That's fine. It is constructive. But - have a ball. Also: repost
10 mins ago, by Jared Burrows
@Jefffrey See the link I posted? It is but not fully supported. I was just wanting other people's inputs on support and implementation on future projects.
@JaredBurrows ^ that's just not true (anymore) AFAICT.
 
12:09 AM
@sehe
@sehe Haha. I will say again. Its from the link. I was just asking about it.
 
So if you are "just asking opinions", please try not to poison the well. People here are frequently linux-only devs, so misinformation can go largely unchecked.
 
user1804599
Omg.
 
Not sure why your reaction to people answering your questions is "I was just asking"
 
user1804599
I just wrote some C code and Valgrind reports that it doesn’t leak.
 
@LightnessRacesinOrbit Read the screen. It was answered a while ago.
 
12:10 AM
With misinformation. That got repeated.
 
I read this screen a lot more than you do
fuck it, bed time
night!
 
Cheers
 
Lol...
 
@Jefffrey That's from 2012, he already recovered.
 
12:19 AM
lol
 
What the ACTUAL?!?
Whee - smoking gun of SerComm (manifacturing components for Cisco, Linksys, Netgear) backdooring routers: http://www.synacktiv.com/ressources/TCP32764_backdoor_again.pdf
 
@Jefffrey Funny thing; we have a guy at #osdev who thinks that everyone should program. And that the need to specialize is stupid. :D
 
@Griwes I'd love to listen to this guy's reasons
 
@Jefffrey He also thinks that "higher level programming" and "academia" are all wrong.
(By "academia" he means everybody else who programs, regardless of whether they have CS-related degrees or formal education or not.)
@Jefffrey Oh, and he thinks that the way we program results in "OO puke" and "high level puke no-one understands". :P
 
So his argument is "I am too dumb to program"?
 
12:30 AM
His reasons are generally that he believes some people are not programming just because we have "high level puke" we ourselves do not understand, and that "puke" is the only thing that keeps the majority of people away. And of course he says that every kind of an abstraction only results in less people understanding the code.
 
OO puke, lol
@Griwes I bet he loves C and assembly
 
@R.MartinhoFernandes ...not exactly. His own skills at the level he is stuck aren't bad, and he happens to have most experience and knowledge about x86 in the whole community. :P
@Jefffrey He hates C.
 
too high level?
 
He thinks that only his own languages will ever make sense.
 
@Griwes Yet he needs code to be always in a certain way or he doesn't understand it.
 
12:32 AM
is it rightfold?
 
If it's not that, it's the condescending "they're too dumb".
 
(Languages that, as he thinks, will allow static analysis to catch all bugs.)
 
well, that's p interesting
 
@Jefffrey And, of course, not possible. :P
 
and I like to believe that will be true some day
 
12:33 AM
It is possible.
You just need to make sure there are no bugs in the specification.
 
Ah, the latest funny thing from him - "there is no semantic difference between a struct and an union".
 
@R.MartinhoFernandes he he
 
@R.MartinhoFernandes Yeah, assuming you know all possible inputs. :D
 
user1804599
@Jefffrey hey!
 
:P
@presius > “You are not a beautiful and unique snowflake. You are the same decaying organic matter as everyone else, and we are all part of the same compost pile.” -- Fight Club
 
user1804599
12:53 AM
I want to end up on a compost pile when I die.
 
user1804599
Screw graves.
 
0
Q: C and C++ Tagging

Casper Von BThis is one of my pet peeves, a vast majority of posts are tagged with C and C++ initially rather than , whereas it should have been C or C++. Quite a few of these posts are quickly edited and tagged correctly, but makes me wonder if the tags should be exclusive, if we even have that capability?

 
wow
meta has dramatically changed
 
@rightfold When I die, I want my possessions identified.
 
user1804599
:D
 
user1804599
1:03 AM
Lol, Valgrind sigills when an assertion fails.
 
9
Q: Kid's homework: 4 equations 5 unknowns? Going crazy!

user144198I'm new here, and I'm hoping someone can help out. My 10 year old son has been set a maths problem, which I can't solve. I've got a PhD in neuroscience and do a fair amount of matlab stuff (data analysis, image processing) on a daily basis, but I can't work this out. The problem is expressed i...

lol this is tagged
 
user1804599
e = a - 17 is linear!
 
@rightfold nah, you probably have an older version of it that doesn't support all the instructions that were used in your binary (this happens if you compile with sse4/avx stuff enabled; I used to have this when compiling -march=native until ~1 year ago)
 
1:31 AM
@Rapptz Stackexchange, helping you look smart in front of your kids!
 
1:50 AM
TIL Java and PHP is "old school" but Ruby is "new"
jesus christ
> Books sucks.
 
I think that if you compile with the proper flags, the same might happen with your C++ code. In fact I see AVX instructions in the assembly output for GCC as well as clang++sehe 24 secs ago
@Borgleader No, teach your kids skills to reason and get some backup if you aren't sure
 
@Jefffrey "Fuck" within the opening sentence. Wow
 
I'm in 25 minutes in and the guy is suggesting to go on stackoverflow
 
Gosh. That talk seems boring. He's yadayada taught myself yadaydayda it's not very intuitive yadayada.
 
2:02 AM
yeah, skip to 12-15 minutes in
 
Where's the "So, you all know what you want this for right!" / "Give me a list of all the cool things you are dying to build, if only you already knew the basics?"
 
after 26:00 you can pretty much close the video
twitter was developed in Rails? wtf?
is he on drugs?
actually apparently it really used rails
 
lol
it used to iirc
 
maybe I'm on drugs
 
iirc they switched to scala for backend
@ScarletAmaranth hehe she was kinda cute at the end
@ScarletAmaranth Father, he was forward with me!
lol
 
2:15 AM
Ugh, "teach code_NOUN".
Even "teach to code" would be bad, but this is even worse.
 
@sali which one do you prefer (also, it will be increasingly unlikely that people still need a c++03 version :)) — sehe 5 secs ago
 
Do people use "code" because they're too lazy to type "program"?
 
haha...i guess so.
 
is it shorter or more attractive? iunno
 
How hardcore programmer are you guys
 
2:21 AM
Very
 
2hardcore4u
 
Still here at 4.22am
 
i guess so. I am just beginner
 
@Rapptz please, no reddit/4chan language? You're giving all the wrong impressions. I mean, I know it's a joke... but
 
lighten up, it really was just a joke.
 
2:23 AM
should i start learning qt?
 
@Rapptz ^ and my response was really just my response
 
Learn whatever you want
 
but like isn't going to GUI from totally Console programming like hard?
i mean, if you are hardcore coders, how did you start your GUI coding ?
 
Difficulty is relative, and to be honest at the end of the day it's mostly the same thing.
The logic is the same, just the way to express it is different
 
are you like professional coder?
 
2:25 AM
No
 
so like you code because you love coding?
 
@Jefffrey "There are ten kinds of people in the world: those that understand binary and those that don't" :<
 
@R.MartinhoFernandes lol
 
He doesn't understand binary.
 
haha.. lol
 
2:26 AM
Or English.
Or both.
 
lol
 
@R.MartinhoFernandes The joke kinda relies on ten being written 10 =/
 
I'm much more comfortable assuming that programmers will know how to write a functor in pure c++03, than I am assuming that people will understand the intricacies of Boost Phoenix, or the trade-offs that are hidden in that functor-style version (Xfrm). — sehe 7 secs ago
 
@Borgleader Which is why you don't speak it, or you look like an idiot.
 
Next time your parent ask how your scored in the exam - 100 percent! But it is written in the binary format Q_Q
 
2:32 AM
@telkitty.exe Too late, I'm done school :P
 
congrats
 
> I mean, books suck.
HAHAHAHA
 
haha
 
anyone wanna take a shot at fixing my nub error? :(
it's been two days and I'm thinking of scrapping this if I can't fix it
 
lol
@Jefffrey His machine rebooted.
 
2:36 AM
I'm a quitter okay :(
 
@Rapptz Oh, not laughing at you. Sorry.
 
the SFINAE gods have failed me
 
After all, I came up with another version that doesn't compromise performance /that/ much, yet doesn't require horrific functor types with (eewww) pointers (puke!), by using boost::bind instead. I can live with putting this one in the answer :) — sehe 4 secs ago
 
I was trying to do a variant without a static_visitor thing: gist.github.com/Rapptz/…
 
2:39 AM
It looks like a visitor to me. What's different?
 
> (...) for some reason every computer is different (...)
 
hmm
I see now.
There's nothing wrong with my code. Just something wrong with me.
 
@Rapptz I don't understand how that is supposed to work.
 
do you mean the noise or the general idea
 
You do not have to live with putting something as answer, your answer helped me a lot, both to understand why to seed once and to make noise generation efficient, future references are more likely to be looking for c++11 solution, so do not worry about posting other answers. Your first answer, followed by great explanations are helpful enough. — sali 2 mins ago
lol - he got my drift. Hopefully another convert to c++11
 
2:45 AM
@Rapptz What does the x.apply call do if the variable has a string in it?
 
template<typename T, typename U>
constexpr auto max(T&& t, U&& u) -> CommonType<T,U> {
    return t > u ? std::forward<T>(t) : std::forward<U>(u);
}
this is not stable, right?
 
@R.MartinhoFernandes whatcha mean?
 
test::variant<int, float, const char*> x("foo");
auto i = x.apply([](int l) { return l * 10; });
 
yeah that fails
 
What should it do?
 
2:46 AM
I'd like for it to throw :s
but atm it fails which I guess is fine too
 
@StackedCrooked what do you mean? It looks fine to me (except for the potential cast in the return?)
 
@Rapptz Oh.
That's kinda silly, though, since there's no way the call can ever not throw, so there's no point in having it compile at all.
 
yeah that's currently what it does
I've come to terms that maybe it's for the best
like, 2 minutes ago
 
@sehe typically a max function looks like T max (T a, T b) { return (a<b)?b:a; } in order to get a stable sort
 
it seems fine to me
 
2:50 AM
@StackedCrooked ah, so "when used as a predicate to sort algorithms does it afford stable ordering?"
 
I'm hesitant. You should read the docs to std::stable_sort/stable_partition
 
oh you mean the use of operator< vs operator>
 
Because I think it depends (only) on how they're implemented.
 
yeah I think sort algorithms use operator<
 
2:52 AM
I feel that it cannot depend on the operator here, imagine what happens if you reverse the sort order
@Rapptz ... really o.O
 
yeah if you don't provide a predicate
 
The predicate doesn't matter.
 
it doesn't?
 
The stability is a property of the algorithm itself.
 
it's about avoiding a swap in case an algorithm uses min/max
3
Q: Implementation of std::min

StackedCrookedThe implementation of std::min on cppreference and in the original stl looks like this: return (b < a) ? b : a; But I think this is slightly more readable: return (a < b) ? a : b; Which makes me wonder: are both implementations equivalent? Is there a particular reason why it is implemented ...

 
2:54 AM
It doesn't matter. The two define different orders.
 
Oh I am thinking of something completely different
hence my confusion
> As BoBTFish mentioned, the C11 standard guarantees that both min and max return the left most minimum:
C11?
seems like a typo
 
> I'll repeat the questions so that people can hear them
*proceeds to not repeat a single question*
 
still watching that video?
 
It's playing in the background.
It's funny.
 
3:00 AM
well since there's nothing wrong with the code I should just remove the noise
@StackedCrooked I guess I should fix it.
 
@R.MartinhoFernandes I must have missed it.
 
@Jefffrey That was quite funny. The good thing was that the slide deck resumed exactly where it left off
That appeared to be a natural/automatic thing. Crazy.
 
3:15 AM
My PDF viewer also remembers the last position in a file.
 
wunderbar
 
cool minor change in SE: when you hover over a tag it tells you the number of questions too
 
@feliciaday ramen …burger?!
thats... a thing?
 
yes
 
Dat awkward moment when you find out you said the opposite of what you wanted to say:
Oops. I meant Functors are passed by value earlier, when I said "by reference" :( Sorry for the carelessness. The rest made sense, but that will have been confusing... — sehe 24 secs ago
@R.MartinhoFernandes It appeared that the application itself was relaunched in the first place, and the last file reopened, with no intervention
 
3:20 AM
5
A: What is the best way to simplify/optimize a piece of code that looks at combinations of conditions?

amitFrom my experience - having a series of long if/else statements indicates a similar yet distinguishable behavior. I usually try to introduce an interface and implementing classes that catch this behavior, and invoke a method that will produce the desired outcome. This makes the code much more r...

I find this silly.
Why would I make a class for combination of booleans? Maybe I'm misunderstanding
 
@Rapptz Ah, you will love this solution I made - as a joke/exercise - a while ago:
3
A: How to simplify multiple if-else-if statements in c++

seheBrian's answer tempted me. I had a very hard time calling this "more concise". So I figured, I should be able to arrive at something like: void f(bool a, bool b, bool c, bool d) { switch(combine(a, b, c, d)) { case combine(1,0,1,0): ac(); break; case combine(1,0,0,1): ad(...

See, it does introduce more code, but it's only running at compiletime!
 
That one isn't that bad.
I actually think it's kind of neat
more readable than the silly "just use a bit mask"
Skype on Linux is terrible.
it's the most half-assed software I've used
 
terrible is an understatement putting it mildly
 
This window might be busy and is not responding.
Do you want to terminate the application?
Skype™
speaking of Skype
@Borgleader Yeah it's... incredibly bad abysmal compared to the Windows version (which isn't even good software). It's like they're doing it poorly here on purpose.
 
Its owned by microsoft now, they have no reason to improve the situation
 
3:36 AM
0
A: What is the best way to simplify/optimize a piece of code that looks at combinations of conditions?

seheIf you can use c++11, you can possibly rewrite it based on my work for this earlier answer: How to simplify multiple if-else-if statements in c++: switch(combine(cond1, cond2, cond3, cond4)) { case combine(1,1,1,0): do_something(1); break; case combine(1,1,0,1): do_something(2); break; ...

:)
@Rapptz It is
@Rapptz you haven't used enough software, by far :|
 
by half-assed, I mean in comparison to other platforms.
 
Okay, that's fully granted
 
I should probably make a combined_visitor or something
 
what is that? A binary one? Or one that can visit any variant?
 
something that could let me specify other cases, e.g. x.apply(magic([](int) { /* */ }, [](std::string) { /* */ }));
 
3:43 AM
@Rapptz Hehehe. I made that. Let me see
also, I'd call it a type-switch/matcher
@Rapptz Yup: here it is (under "Update"): stackoverflow.com/a/17776618/85371 However, here I've applied it at large scale in an answer, where the OP had been using the specialized "fast typeswitch" library (by Bjarne c.s.?):
3
A: Too many sections, assembler error, using boost::spirit

seheI've done some hacking here and refactored things a to show the non-runtime-polymorphic style: https://bitbucket.org/sehe/joos2compiler-refactor (based on your 12d01e5 commit). I hope it doesn't increase compile times :) (I haven't actually gotten around to splitting the grammar up, but it g...

Night folks!
 
night
and thanks for the links
@sehe Oh. You used inheritance for it?
 
4:28 AM
if I didn't know any better and judged English Language & Usage through its "Hot questions" alone, I'd think it's 90-100% word requests
 
5:26 AM
SOURCES_C   = $(wildcard *.c)
HEADERS		= $(wildcard *.h)

OBJ_C 		= $(SOURCES_C:   .c=.o)

%.o : %.c ${HEADERS}
	gcc -ffreestanding -c $< -o $@

all: low_level.o

low_level.o: $(OBJ_C)
	ld -r $^ -o $@
Whats wrong in this make file ?
It is using passing .c files to ld instead of passing .o fiiles
ld -r portio.c -o low_level.o
portio.c: file not recognized: File format not recognized
 
 
3 hours later…
user1804599
8:08 AM
@NeelBasu It is a make file.
 
Damn, you broke the ice.
 
user1804599
But isn’t it already broken when there is an ICE?
 
WHAT DID YOU DOOOOOO
 
Phew.
Most Xubuntu problems can be solved by throwing away ~/.config/xfce*.
 
8:29 AM
you... deleted all the default desktop environment files?
I like xfce, it's pretty neat
gave me no issues but I'm on debian not Xubuntu
 
user1804599
i3.
 
i5.
 
user1804599
i7.
 
I'm still using xfwm since I haven't had much reason to switch yet
 
user1804599
Screw hash tables. I’m doing linear search yolo.
 
user1804599
8:42 AM
Huh. Emacs crashed.
 
you only live once and you're gonna spend it waiting for the linear search to complete?
 
my life is multithreaded, I leave the linear search to my computer while I am doing something else
 
user1804599
It’s my code, it won’t run often anyway.
 
user1804599
And arrays are easier to implement than hash tables are.
 
user1804599
Also, FAST ENOUGH. I mean, 4GHz.
 
user1804599
8:47 AM
struct styx_object * (*implementation)(struct styx_vm *vm,
                                       struct styx_object **exception,
                                       struct styx_object **arguments);
 
user1804599
I don’t know where to put the first asterisk. Everything is ugly. :(
 
@StackedCrooked linear search much speed even for ridiculous sizes; much architecture
 
hmph, i'm going to the market and buy food
 
user1804599
Is de Markt geopend met Pasen?
 
9:18 AM
@rightfold lol C fail.
 
@rightfold wtf man? is it like in C ?
 
user1804599
9:41 AM
Yay for VLAs.
 
ur mad
oh btw, in that VLA for C++ proposal, do VLA work with range-based for?
 
user1804599
If they don’t, fuck VLAs.
 
user1804599
Also std::begin and std::end.
 
VLAs for C++ got dropped for a separate TS which I hope never makes it
 
@Rapptz dynarray died as well, right?
 
9:52 AM
they're the same thing
 
not really
dynarray is like VLA but even worse.
 
I wonder if it's going to slip by
 
from what I understand, dynarray would be std::dynarray sort of thing while VLAs would actually accept T a[non-const]; notation?
 
yup
morning
 
10:32 AM
why does nothing interesting ever happen on the Interne
t
on a Sunday.
 
@DeadMG It's easter day?
 
@ScarletAmaranth std::dynarray is the equivalent of std::array for VLAs then
 
@HamZa It's like this every Sunday.
(also fuck Easter really).
 
@Jefffrey yeah I guess
 
the only thing Easter is good for is an excuse to eat tasty food.
 
10:35 AM
and be with your family
 
I'm with them every day.
 
extended family ... for some people
 
I don't celebrate it, maybe I will go workout, nice weather here...
 
I am waiting for the chocolate to go on sales :p
 
so DeadMG, you can't drink while under the influence of your drugs, correct?
 
10:36 AM
not really
I might have a beer tonight and skip taking them
 
I am going diving tomorrow ... sometimes you eat the fishes, sometimes the fishes eat you
 
@telkitty.exe lol exactly
 
@Jefffrey that's not what under the influence of drugs usually means
 
I know :)
 
k 6:40 AM
time to sleep
 
10:40 AM
> Fucking easter stoners....
 
Ez everyone
 
how r u man
 
I sneezed.
more than once.
 
But how many times, exactly?
 
three
 
10:49 AM
takes note
 
You better. It'll be on the final worth 50% of your grade.
 
I am going to have nightmares about virtual function pointers and virtual tables.
 
morning my little nightmares :)
 
user1804599
std::cout << "Hello, Tony!\n";
 
user1804599
Speaking of nightmares.
 
10:59 AM
@rightfold why don't you use endl ?
 
user1804599
I had a dream wherein I told the king he had a horrible job. I liked my dream about Rich Hickey better, though.
 
user1804599
@HamZa because std::endl is fugly as fuck.
 
user1804599
Why would I not not use it?
 
@rightfold lol, just wondering. Since the examples I saw were using it...
 
@HamZa meh, it flushes
also \n is portable enough
those are the common arguments ^
 
11:05 AM
I see, thanks
 
user1804599
Hmm, fuckx.
 
Uurghh.. I've just been woofed awake. Anne has gone out early and left me with furface. My right ear is still ringing and I've gone partially deaf.
I just wanted an extra hour lie down. Now I have to start doing stuff again:(
 
@rightfold dreams really bring out the truth
 
user1804599
lol
 
11:20 AM
@Jefffrey '\n' does not flush. You may witness flushing at a lower level on a line-buffered terminal, but not until the std::cout has flushed.
 
user1804599
He means that std::endl flushes.
 
@LightnessRacesinOrbit yup, exactly
 
I flush too, when I go to the toilet.
 
@rightfold he means that '\n' flushes on all the common platforms. Yes. And not just terminals
 
@sehe Right, so, he's wrong.
 
user1804599
11:21 AM
I flush too, when I went to the toilet.
 
user1804599
@sehe No, he does not.
 
user1804599
He means that std::endl flushes.
 
Wokay. Lets ask
 
user1804599
Learn to read.
 
I agree with rightfold now.
 
user1804599
11:22 AM
> lol, just wondering. Since the examples I saw were using it...
 
He was saying "meh [endl;] it flushes [needlessly]"
 
user1804599
He replied to this, which was about std::endl.
 
Well '\n' does too on most platforms. However, it's not specified in the C++ standard, indeed.
 
@sehe Within IOStreams?
I tried to look this up once but streams semantics are incredibly difficult to piece together in the standard
 
It's all fine and dandy meh. I was jumping into the conversation around
2 mins ago, by Lightness Races in Orbit
@Jefffrey '\n' does not flush. You may witness flushing at a lower level on a line-buffered terminal, but not until the std::cout has flushed.
'\n' may not be required to flush by the standard library, but it still does on most platforms
You need setvbuf/unbuffer on all POSIXly platforms. And then it doesn't change a thing for pipes IIRC
 
user1804599
11:25 AM
I AM WRITING AN INTERPRETER OKAY?!
 
OKAY!
 
user1804599
I wonder how much UB there is in my code.
 
@sehe I find that hard to believe, but I don't reject it outright
 
About 2 pico-lightyear
 
FWIW on Centos5 I've seen unflushed output with intervening '\n' characters plenty of times. I've never witnessed this magical "'\n'-flushes" behaviour.
 
11:26 AM
@LightnessRacesinOrbit I think it's all pretty well hashed out in Scott's "The little endl that couldn't" paper and (IIRC) in one of Kuhl's answers on this site. However, that latter might have been a comment on one of the high-voted answers about the topic
@LightnessRacesinOrbit It's possible that different distros have different defaults, although I kinda remember this being posix-required...? Ah - memory.
 
user1804599
CentOS :(
 
11:40 AM
not biting
 
I love amitriptyline.
 
There's still plenty of contradictory information on that Q&A, though
 
Sometimes it’s just fun to write C code.
@rightfold are you insane?
 
user1804599
Sometimes.
 
Oh wait, scratch that question.
:P
 
11:55 AM
s/sometimes/whenever puppy is on drugs/
 

« first day (1282 days earlier)      last day (3659 days later) »