« first day (1539 days earlier)      last day (3402 days later) » 

12:01 AM
@StackedCrooked Did you use nonius?
 
Nope. I counted seconds in my head..
Actually the measurement was probably ok.
I think the performance difference is caused by some accidental object code layouting. At least I think that's possible.
or maybe there was accidental false sharing in vtable benchmark
benchmarks at nanosecond resolution is kinda pointless
 
the "C" room is empty.
 
12:18 AM
there's this annoying classmate that used to annoy the shit out of me
he constantly carried his laptop on a cooling pad
even though it was not necessary
now whenever I see cooling pads
I think of him
 
// C API for tagged pointer
void* set_tag(void* ptr, int x); // set the tag on pointer obj
int   get_tag(void* ptr); // get tag data from pointer obj
void* get_ptr(void* ptr); // returns untagged pointer
 
:)
 
I think exemplifies why C sucks.
There's zero type-safety.
Tagged ptr is void*. Untagged ptr is also void*.
 
@StackedCrooked isn't type safety the programmers problem?
 
It is their problem indeed.
 
12:20 AM
nevermind
sorry, I was wrong on that
 
In C++ you'd write smart-ptr like wrapper.
There would be no way to accidentally mix them up.
 
agreed
 
@StackedCrooked Well then, recognize my skill: coliru.stacked-crooked.com/a/5ac2440382438275
Just disregard the leaked memory for now, it's a benign bug in boost::c::s_a_a. It doesn't manifest with boost::c::allocator<T>. But it does manifest with e.g. std::allocator<T> (leaks confirmed by valgrind)
@AlexM. you are so tolerant
 
I see you had some fun :)
 
@StackedCrooked Not really. At least, now you can see how std::scoped_allocator_adaptor fails to deliver
It would be sooooooooo nice if std::pair had a allocator_arg_t constructor, like tuple
 
12:23 AM
I think a thin wrapper around std::map could take care of things.
 
That would make it all much cleaner still
 
@sehe Yeah.
assertion failure?
ah, just a leak
double free would be more worrysome
 
3 mins ago, by sehe
Just disregard the leaked memory for now, it's a benign bug in boost::c::s_a_a. It doesn't manifest with boost::c::allocator<T>. But it does manifest with e.g. std::allocator<T> (leaks confirmed by valgrind)
 
@StackedCrooked If you mean for proper insertion etc. Yes. It'll just hide the costs though. And lookup, you could use equal_range or sumtin
 
12:24 AM
wait, I can't ignore it.
I'm going mad..
 
@StackedCrooked Of course you can't. But you can still read the rest. So you can see my actual points about emplace vs. uses_allocator vs. scoped_allocators?
1 hour ago, by sehe
@StackedCrooked gee. I'm running into bugs in Boost Container as well as GNU libstdc++...
I wasn't lying
The bugs in libstdc++ seem to be far more crippling though.
 
@sehe In practice I've not yet had any use cases where I want to optimize std::map allocation. So it's not a big deal.
 
Ell
I wonder why people laugh at me when I use function_traits
 
@Ell You used function_traits? LOL
 
Because you have funny hair.
 
12:27 AM
@Ell So that you preempt Robot & Xeo
And Luc
 
Ell
@sehe I'm trying to figure out what you mean
Preempt them how?
 
@Ell I once used them to automatically generate a Tcl front-end functions for API functions. For example if I had a an API function void connect_user(int, short) then I wrote WRAP(connect_user) and then the introspection allowed me to generate code for Tcl front-end.
Also automatically implement checks for number of arguments etc.
But I didn't really finish that little project.
 
Either I am a C++ novice, or I don't use many modern C++ features.
*that you have described thus far.
 
Passing by value is modern.
That should not be hard :)
 
Mmm. Dried figs. They look so awful yet taste so fine.
 
12:32 AM
I'm not very fond of them.
 
@Ell Because they would ridicule you
 
Ell
I've had figs before and they're yum
 
could someone join the C room?
 
Ell
@sehe now I'm confused :P
 
@edition No.
 
12:33 AM
@edition what for
 
I think there's this notion that needing to introspect a function means you're doing it wrong.
 
its empty!
 
@edition For a reason.
 
@edition so... let me get this straight. If I find you a few more empty rooms, you'll join them?
 
sure.
 
Ell
12:34 AM
@StackedCrooked really? Why?
Actually I guess I can see it
But its necessary sometimes
 
Wild hypothesis: maybe because the caller of the function determines its required signature. After all the caller is the function's raison d'etre. So the caller demands the signature. A caller that checks the signature before calling is a unworthy caller.
Or maybe it's something else.
 
Hmm, the std::begin() and std::end() functions, am I expected to use them unqualified to get ADL to pick the right one?
 
And if you are in a situation where you are unsure about the signature you can use decltype sfinae.
 
Ell
I need it to store arguments in a tuple
But I need a pack of args to know what the tuple type will be
 
Not sure what you want.
Unpack tuple as function arguments?
Storing arguments in a tuple is super easy. You can just use std::make_tuple(args...);
 
Ell
12:43 AM
Oh wait no I dont
Yeah nvm, I need to store the typeids of the args in a vector
 
@Ell hm...
 
Ell
Of a callable thing passed in
So that's when I've used function traits
I can't see any other way
Because you need the args... from somewhere
Function_traits<FT>::args<N> to the rescue
 
@AlexM. Was it a loud one?
 
@Ell Oh, I wasn't reading
Never mind my concoction.
 
@VáclavZeman Yes.
 
12:58 AM
@StackedCrooked This kind of type-erasure is a fascinating thing. Once you've erased the type of something you can't get it back. However, you can send a probe down the dynamic api. The probe can get to the original object even in I can't.
 
@VáclavZeman depending on your definition of the right one :) But : yes
 
@VáclavZeman I asked this on SO once.
It's probably a good idea to do so.
4
Q: Relying on ADL for std::begin() and std::end()?

StackedCrookedWhen iterating over a standard container, do you think it's a good idea to omit the std:: prefix and rely on ADL to find the definition? Example: std::vector<int> vec = get_vec(); // range-based for loop would be preferred here, but just for the sake of example for (auto it = begin(vec), end = e...

 
@sehe, @StackedCrooked: OK.
 
@milleniumbug Yeah I can ping myself
 
actually my question was dumb
I didn't even consider the using std::begin; using std::end; aspect.
 
1:12 AM
@Nooble it didn't even have fans
 
@AlexM. Then what the hell was it for?
Did the manufacturer just re-purpose a plastic slate?
 
I dunno
but it was annoying
and unnecessary
and he was annoying
ugh I need to sleep
 
Ell
Night folks
 
Is the best way to skip lines while reading data from a text file to just do std::getline(file, var)? I'd run a for loop to skip the proper number of lines.
 
1:28 AM
std::abort();` skips the line
:)
 
@TriHard8 depends. duh. you can. But if all lines have equal/predictable length, why not seek. Etc.
 
The length of each line varies.
 
That may be easiest... but...
...there are better ways:
4
A: How to skip a string when reading a file line by line

Jerry CoffinYou can use std::cin.ignore to ignore input up to some specified delimiter (e.g., a new-line, to skip an entire line). static const int max_line = 65536; std::cin.ignore(max_line, '\n'); While many people recommend specifying a maximum of something like std::numeric_limits<std::streamsize>::m...

 
@TriHard8 just skip it then
 
Depends how long your lines are (worried about how long it'll take to read them into memory, only to be discarded?) and how simple/consistent you want to keep your loop. Depends on what else is going on inside it, I'd imagine.
 
1:38 AM
@LightnessRacesinOrbit thanks for the link. I tried searching a couple things, but came up empty. I'll use ignore. He also had tips for not using while !ifile.eof() which I'll explore as well.
 
user image
4
top kek
 
Google Jessica Michibata. You're welcome.
 
@StackedCrooked anyways: coliru.stacked-crooked.com/a/39de5e36023e1367 manual compression and turd polish applied :)
 
2:15 AM
@sehe very nice :)
GenericLess
the code is so GenericLess :P
lacks recursive inclusion
Btw, TIME FOR PACKET HAS ALREADY PASSED is a silly log message at work from a colleague's code.
Of, course logging it introduces extra delay on the scheduler so it causes even more timeouts.
Which all get logged of course.
 
This gets funnier and funnier each time I watch it. http://redd.it/2r0gdp
Agreed.
 
@Borgleader I didn't notice the mom's face first.
lol
hooliganism shojo
I just thought it was silly that a 30 year old language like C++ doesn't have a standard networking library. Then I remembered we don't even have a file-system library yet.
IOW I don't agree with this sentiment.
 
@StackedCrooked filesystem didnt make it in C++14?
 
dunno
maybe I made a grave mistake
 
guys
GUYS
the best kind of music
 
2:29 AM
> Some of those TS were very close to get into C++14, but didn't make it for various reasons: filesystem, dynamic runtime arrays (VLAs/std::dynarray) and std::optional are just 3 examples.
Sauce, it seems you were correct
 
phew
User-defined literals and units is one feature that I'm not very excited about.
It certainly seems nice to be able to write 100m/s, but I wouldn't mind the more familiar Meter(100)/Seconds(1).
 
same
i would have much preferred filesystem over both of these
 
Also using the literals require using directives/declarations.
Which also isn't fun.
move-capture is probably my most wanted C++14 feature.
> Allow typename in a template template parameter
^ Planned C++17 feature.
lol
 
@StackedCrooked i dont even know what that means
 
template<template<typename> class Container> void foo();
Here class can not be replaced with typename.
Which is kinda odd.
template<template<typename t> class Container, typename T>
void foo(Container<T>&& container); // rvalue-ref (not universal ref)
^ TIL
 
2:41 AM
 
3:11 AM
My code was 158 times slower than I expected. @JamesMcNellis claimed it was by design... then told me how to make it 158 times faster. 😃
wat
waaaaat
 
wut
 
> has to do with printf performance in debug builds, but I’m not sure anyone wants to hear me talk about that. :)
 
If printf is the bottleneck, then something tells me the program isn't very well written.
 
3:26 AM
I figured that out from the 158x speedup ;)
 
@Borgleader Ha, that Patrice Roy that replied was one of my teachers at CÉGEP.
Small world, for sure.
 
@EtiennedeMartel Hahaha srsly? damn...
 
4:01 AM
Hey! I need some inspiration for a programming project. Any ideas?
 
That's vague @Progo. Please provide more details.
 
@DonLarynx Well, it is vague. I am out of ideas for programming projects and at this point I would take almost anything.
 
Snake game is cool!
 
@EtiennedeMartel Thanks!
 
4:06 AM
@EtiennedeMartel the Audio router project for windows could be done
 
@edition that is a project that appealed to me, but I am using a mac... :(
 
Portaudio?
 
@Progo Load Ubuntu on it.
 
So I started looking into scrapy. Its neat.
 
4:34 AM
What's that.
 
> An open source and collaborative framework for extracting the data you need from websites. In a fast, simple, yet extensible way.
 
Ooo that's cool.
 
it turns out that the more you are in touch with your feelings, the easier it is to talk to women.
 
too bad feelings cannot be expressed in C++.
 
unfortunately not @edition. unfortunately not.
 
wait. who writes this garbage... ah, it was me.
 
@edition they are two different skillsets, which is why the stereotype of the ladies' man is almost never portrayed with him in front of a computer programming code - unless he is very smart.
 
5:02 AM
I'm about to lose some rep on SuperUser
 
what should I do for my 18th this year?
 
get really really really drunk
and then go skydiving two weeks later
 
is that what you did, @DonLarynx?
 
correct @edition.
 
 
5:05 AM
haha @DonLarynx, I hate mathematics.
 
@edition Same as you did for your 18th last year
 
I usually have to spend hours solving a problem, a lot more than programming. @edition.
 
@LightnessRacesinOrbit hey!
 
@DonLarynx from a (lazy) programmers perspective, whats the best/easiest way to learn mathematics?
 
5:13 AM
that's too vague. mathematics is comprised of many subjects.
be more specific.
 
@DonLarynx well, calculus (relearn) and eventually pure mathematics...
 
@LightnessRacesinOrbit This page can’t be displayed

•Make sure the web address http://www.writemycodeforme.com is correct.
•Look for the page with your search engine.
 
@LightnessRacesinOrbit Chrome acts buggy on windows 8.
 
Windows 8? Really?
 
5:15 AM
@LightnessRacesinOrbit I liked your old profile picture.
 
@edition Which one? I've had a few.
 
@LightnessRacesinOrbit I had a MBA 11" that ceased to function and wanted to use VS.
 
the self portrait?
 
@edition That is very hard work, coming from someone who "hates mathematics". What is the purpose behind learning pure mathematics?
 
@edition They're all "self-portraits".
 
5:16 AM
@LightnessRacesinOrbit I can't remember.
 
@edition Okay. Well, thanks :)
 
@DonLarynx for example, I attempted to implement the gaussian blur function into my code...
 
isnt gaussian blur just a weighted average?
 
and?
 
well, the implementation process would have been quicker, with a better understanding of mathematics
my inability in higher level mathematics, has prevented me from going to university.
 
thanks, @DonLarynx.
 
Let me know how it goes and good luck.
 
5:57 AM
lol
> template< class T > constexpr T min( std::initializer_list<T> ilist ); (since C++14)
 
so constexpr is in the libraries now?
 
no
that's the point of my lolling
 
everything is broken beyond repair
 
Just noticed I was at 98% disk usage on Coliru.
Apparently my build folders for gcc were talking up most of the space.
 
6:12 AM
is programming apps for windows store a bad idea?
theres more apps for windows and more support, just not enough buyers strangely
 
s/apps for windows store// -> yes
 
android is way better idea isn't it
 
@DonLarynx not really, more customers but more competition also
and as far as developing apps go i much prefer using visual studio and c# than java in some crummy IDE (im looking at you Eclipse)
 
but windows store apps are C# aren't they?
 
I think so yes. I like C#.
 
6:19 AM
oops thought u were Jeffrey lol
 
ಠ_ಠ
 
sry just thought we were alone
 
lol @ std::min(std::initializer_list<int>{}); being a statically well formed call
oh boy
I don't even
You have a language like C++ with full power static capabilities and you still can't prevent this
 
-1
Q: i Accidentally Merge My SE Account to Old Suspended SE Account, how to separate them?

Harish Kumari Accidentally Merge My SE Account to Old Suspended Account? I Accidentally Merge My New Physics & Maths SE Account to Old Physics & Maths Suspended Account by giving old email in preference tab. so how to separate them.?

 
lol
 
6:23 AM
wow that guy was just in the math.SE chat room. strange.
except his name was harish, not hraish. wtf
 
6:49 AM
OH HEAVENS
I spent 50 minutes
Can you spot the error?
 
@MohammadAliBaydoun real_type is that ThePhD's code?
 
@MohammadAliBaydoun
 
^ (you are the error)
 
wtf is it asking me? spent 30 minutes trying to decode the question and I don't get it projecteuler.net/problem=174
 
@MohammadAliBaydoun what kind of error?
 
6:53 AM
@DonLarynx Oh I remember that one. It was an easy implementation, but understanding the question took a bit :P
 
@Jefffrey it's a documented feature
it returns the smallest element
 
@Jefffrey Spelling
 
...
you mean minimum != maximum?
 
num vs mum
mininum
 
LOL
ok, no I didn't spot that
 
6:55 AM
I cried for a brief moment ;_;
@DonLarynx t is type L(n) means that given t tiles, you can make n different lamina
 
@StackedCrooked it returns nothing because it's a runtime error
 
So once you compute the L table for all values of t, computing the N table and finally the sum should be a piece of cake
And the correct answer is between 10^5 and 10^6
 
I recommend Miller's Ale House chicken fingers to anyone and everyone.
 
@DonLarynx projecteuler.net/problem=251 <--- Look at this bad boy right here
 
> operator<(T, T) is not guaranteed to be constexpr either
AHAHAHAHAHA
fuck you c++
I'm done
 
6:59 AM
But that makes sense ;~;
 
@MohammadAliBaydoun thinks about brute forcing it, then realizes it will take until im 50 years old
 
@DonLarynx I brute forced a bit of solutions and I noticed a pattern
A very painful pattern
 
paniniful?
 
Then I realized that the equation posted can be simplified on paper
 
@MohammadAliBaydoun wow. welcome to applied maths.
 
7:01 AM
In the end, my solution took 9 minutes
I had it running on multiple threads too
When I looked at the other posts, it seems I wasn't alone
People took 11 minutes, 5 minutes,
There was ONE person however who found an excellent solution that took him 6 seconds
He solved it on paper first ~
 
That looks curiously similar to the generic root of a polynomial of the form x^3 + b x + c = 0.
 
@MohammadAliBaydoun Haha you got rekt ;)
 
So let's say 80 is type L(2) and 32 is type L(2). would N(2) just be 2?
and there are no other type L(2)
 
that's easy
thx
 
7:07 AM
> Fascinating, Ma'am
this is a secret hat
\o/ /cc @LightnessRacesinOrbit
 
Oh God
Dragon Curve, anyone? ;). It somehow resembles it. I'm trying to think of a way to relate it.
 
@MohammadAliBaydoun beautiful
@MohammadAliBaydoun That one seems easy
 
Well, I can't solve it, so I put it aside and I'm trying to wrap my head around problem 209
 
@MohammadAliBaydoun I reduced the parameterization to (a+1)^2 * (8a-1) = 27b^2 c.
You definitely want to start on paper.
 
So PE is more about becoming good at math than good at programming?
 
7:19 AM
Little bit of both I guess
PE pushed me to learn lots of number theory and some graph algorithms
 
You know that (a+1)^2 * (8a-1) is gonna need to have at least 3 factors of 3. Just like that you can already put some pretty big constraints on what a can be.
I haven't double-checked yet, but I think it's impossible for either side to be an even number. So b and c both need to be odd.
 
(11, 2, 116) is a solution with even b and c
I still have all the generated solutions in a file :P
 
7:47 AM
@MohammadAliBaydoun Oh yeah. (a+1)^2 can provide both factors of 2 and 3. oops
@MohammadAliBaydoun Does the question specify which cube root should be taken? If a - b * sqrt(c) is negative, the resulting cube-root will be complex if roots are done using polar coordinates.
I guess not.
 
@MohammadAliBaydoun Not as simple as I thought
 
8:03 AM
@MohammadAliBaydoun {11, 2, 116} fails the original equation if you use polar coordinate roots. But it works if you use the real root.
lol, they really didn't specify it. And the answer matters.
 
You're very sexually appealing when you speak of mathematics
Tear my clothes
 
wut
 
user1804599
8:20 AM
I think OP can check empty array.Even he did not said what will be the output for empty array.Also I am confused why he asked this simple question. — Shaiful Islam 28 secs ago
 
user1804599
lol
 
user1804599
 
user1804599
Covariance and contravariance are sometimes very confusing.
 
user1804599
It's easy to confuse the two.
 

« first day (1539 days earlier)      last day (3402 days later) »