« first day (2613 days earlier)      last day (2318 days later) » 

12:12 AM
MFW kids' homework includes a "math puzzle" so tough, we finally wrote a program to solve it. Okay by me! http://coliru.stacked-crooked.com/a/dffbe719501c9f8f
Also: teaching kids to post secret keys on post-its since primary school
 
@sehe a=3, b=2, c=4 ... 20 secs job
bear does maths ...
 
12:32 AM
@sehe Except it happens at run-time unlike regular function composition? More like how is OpenGL you need to attach or detach shaders...
 
@Telkitty well duh. Don't you read?
Also, where's the rest of your solution? There's 10 variables.
 
1:33 AM
I have other stuff to deal with ... & dealing with real life problems that require maths
like why is the insured amount less than last year (because car depreciation), excess stays the same, but premium is going up
 
 
6 hours later…
7:43 AM
hi
 
 
1 hour later…
8:57 AM
Morning
 
Ven
Heyo
 
how was the weekend? :)
 
Ven
9:18 AM
very nice
went to see Jamel Debbouze
 
9:30 AM
oh, I had forgotten that this guy existed, feels strange ^^'
 
Ven
made me feel old
 
I watched all the YouTube Rewinds with my brother yesterday, and it made us feel old too
I find things I know in the 2012 to 2014 videos, then I almost don't know anything after that ^^'
 
Ven
@Morwenn the 2017 rewind was sooooooooooooooooo bad
 
I can't judge, I don't know most of the things in it
I really liked the 2013 one with Macklemore :D
 
 
3 hours later…
12:11 PM
Sup guise!
I've got a C++ wankery question :D
 
Ven
@Rerito what's surprising?
you can define other stuff after that struct
 
Why doesn't the compiler spits about c<T> being an incomplete type in c<T>::s
(like with the non-templated case)
 
Ven
@Rerito probably because when it instantiates it already has the whole definition?
 
So it would be a point of instantiation sublety or something?
(I have a hard time with those)
 
Ven
12:26 PM
maybe
 
We need a language lawyer
 
Ven
where is mike
 
IIRC everything but the type of m_c is known when the template is first parsed due to hte two-phase parsing of templates, but I don't know how it might influence shit exactly
 
1:14 PM
0
A: Read text file line by line in c++ with each line being of different data types?

seheAssuming Fixed File Layout Using some c++14 goodness: Live On Coliru #include <iomanip> #include <iostream> #include <iterator> #include <numeric> #include <sstream> template <typename T> T sum_line(std::string const& line) { std::istringstream iss(line); return std::accumulate(std::i...

You've Been Hit By /
You've Been Struck By /
Friendly OCR Overkill
@Rerito POI
@Morwenn ^
@Rerito Yes. Me too. Most often they do what I want, but then there's partial ordering
 
I'm familiar with partial ordering but this POI thing
I just don't know how it works :S
 
I call BS. Partial ordering is a lot more subtle. POI simply means (in cases like this) that the templates won't be instantiated until the end of the TU. Which means the type is complete.
 
@sehe Yeah I'm aware of some of these subtleties, already been bitten by some :D
 
I love that you (a) actually ask about these things (b) actually read and quote the standard when you do. More peopl should be so diligent.
in [iOS][Android][ChaosOverFlow], 59 mins ago, by iShwar
@BoominadhaPrakashM @DilipTiwari @Erum @GurpreetKaur @Haileapp @iMDroid @IntelliJAmiya @JaiprakashSoni @James @Logic @MichaelDautermann @MakleeLee @moDev @Ninja @PitambarIndoria @ParthaChakraborty @Pushpa @Ramona @RobinHood @RachelDockter @RAGHUNATH @RonakThakkar @SunishaSindhu @Shailesh @seon @ShobhakarTiwari @Telkitty @ALL "Hi Friends, Is any one has worked with Rocket Chat and Jitsi SDKs... Please..."
lolwut
> Is any one has worked with Rocket Chat and Jitsi SDKs...
Oooh. Telkitty is blessed.
 
I don't see any pings in notification
 
1:26 PM
Probably already nuked?
 
can't remember the last time when I was in that chatroom
 
@tobi303 I love that you (probably correctly) assumed it frobnicates the veclocity. Such cromulence. Nom nom nom — sehe 6 secs ago
 
1:40 PM
 
 
2 hours later…
4:03 PM
I finally decided myself to order an oscilloscope
 
4:40 PM
If you are not a white dude and have things to say about JavaScript testing, please submit a talk to Assert(js) https://www.assertjs.com
I'll just leave it here.
 
Hugh, JavaScript.
 
5:28 PM
0
A: Draw Line using c++ without graphics

seheBecause I like a challenge, I made a tiny Canvas class, to be used like: int main() { using Canvas = BasicCanvas<160, 80>; Canvas canvas; canvas.origin = {canvas.cols()/3, canvas.rows()/3}; canvas.axes(); canvas.plot([](double x) { return x; }); canvas.plot([](double ...

4 hours ago, by sehe
You've Been Hit By /
You've Been Struck By /
Friendly OCR Overkill
More overkill
 
 
 
1 hour later…
6:59 PM
@sehe It's so nice. Well done
 
@sehe why are you using the struct keyword instead of class? is there a particular reason?
 
-17
Q: Is our teacher dumb? please check this

Honza Kollárikour teacher showed this code, nothing more for (i = 1; i < 11; i++); { printf ("*"); i++; } and told us, that the asterisk (*) will be printed once, but we (students) think that we will get error message..We're writing test next week and I think that there will be some question lik...

/cc @Mysticial
 
The nerve.
 
Empirical verification is underappreciated in academic CS classes
 
7:27 PM
@Borgleader That ninja semicolon in there... It took more more time than I'm comfortable with to notice it. Stupid students for "thinking" they would get an error message.
 
They must have some quality teaching in there.
Lecturer: This code will print asterisk only once.
Students: No, an error will occur.
Lecturer, while pulling on his jacket and fumbling for car keys: Till the next week!
 
@LoïcFaure-Lacroix They are largely interchangeable at this point in c++
I would say its slightly more kosher to use a struct for plain old data structure, but this is purely stylistic and will not affect the object code at all.
 
@crasic They both get compiled to class, won't they? So why bother?
 
@Horttanainen I don't know what you mean by "compiled to class", they share a common implementation, but a seperate namespace
 
@crasic Always have been.
 
7:38 PM
A few things are mutually guaranteed, like the order of member variables as laid out in memory
 
@crasic I mean that the binary for class and struct is the same.
 
@JerryCoffin You would know better, I assume this was the case, but was not sure.
I am not certain if compiler specific things like __attribute__((__packed__)) work on classes the same way
but I assume so
 
155
A: Why is there not an std::is_struct type trait?

Lightness Races in Orbit It returns true for both classes and structs. I know that in C++ they are almost the same thing, but I'd like to know why there's not a distinction between them in the type trait. Unfortunately this is a common misconception in C++. Sometimes it comes from fundamental misunderstanding, but a...

 
7:53 PM
@Horttanainen Maybe a practical question, would such a union used for low-level register unpacking, be interchangeable if the struct keyword was changed to class? I'm assuming yes.
union {
  struct {
#ifdef PLATFORM_LITTLE_ENDIAN
    uint8_t reserved: 2; // Must Be 0 :(
    uint8_t cread: 1; //Continuous Read
    uint8_t addr: 3; // Register Address
    uint8_t rw: 1; // R/W Flag 1 = READ
    uint8_t wen: 1 ; // Comms Write Enable (required)
#elif defined(PLATFORM_BIG_ENDIAN)
    uint8_t wen: 1 ;
    uint8_t rw: 1;
    uint8_t addr: 3;
    uint8_t cread: 1;
    uint8_t reserved: 2;
#endif
} __attribute__((packed)) s;
uint8_t b;
}
 
@crasic Why do people keep treating me as if I were old? I mean, yes, I do remember when protozoa were evolving into dinosaurs, but that doesn't make me old does it?
@crasic Given the lack of specification of how they work at all, it's hard to be sure some compiler couldn't treat them differently (but I don't know of any such compiler).
 
@JerryCoffin Wait, you don't remember what evolved into the protozoa? You've lost your old creds with me
 
@JerryCoffin I don't assume age, just assume you are more of a c++ ~~dude~~ generic human, I live in the 5th circle of hell where c and c++ object code interacts in an unholy manner in one source base
Aka "c with classes"
the one true c++
 
@crasic I have no idea
I just don't want to c++ anymore
 
@Puppy I did put the first diatoms together, but there was a while there that things were a little crazy, so must have been preoccupied with something else as the protozoa evolved.
@crasic Yes, with the minor detail that (of course) in a class everything defaults to private, so you'd pretty much need to replace struct { with class { public: to get the same effect.
class also defaults to private inheritance, so if you had something like class foo : y you'd convert that to struct foo : private y (but public inheritance is much more common, even with classes).
 
9:02 PM
UP TO 5X FASTER LIBRARIES WITH OPTIMIZATIONS AND HEURISTICS
 
9:53 PM
@Mikhail I always wonder what a statement like that is really attempting to say. As it stands right now, it only seems to say: "we guarantee optimizations and heuristics won't improve the speed by more than 5X", but that doesn't seem like a particularly exciting claim.
 
I think its fucking hilarious that "heuristics" are a feature or even something to advertise
"We don't know what we're doing so add more heuristics"
 
nwp
@JerryCoffin That's why you should go for the ones who claim "up to 5x faster and more!".
 
@nwp Oh yes, now those I can rely upon for some truly solid information...
 
10:20 PM
@LoïcFaure-Lacroix why not? If I know I'm not interested in making many things private, I'll just make it a struct.
Also, e.g. struct Coord is an aggregate, and it's a sign that you can Coord { x, y } or {x,y} without any constructors.
IOW: be concise, reduce noise
PGO are heuristics.
Most HotSpot JIT optimizations are.
Chess grand masters use heuristics all the time. That doesn't mean they "don't know what they're doing". It does means they know "trying to know every possibility on the board is not feasible or statistically effective"
 
Unless you've got Fritz...
 
nwp
@sehe If you make it ∞x faster instead of ∞% I'll buy it.
 
Best to file a feature request.
 
At the end of the day, the alternative to heuristics is knowing what you're doing which is why PGO doesn't have too many success stories. Even auto-tuning libraries lost to a Japanese man named after a BASIC instruction.
 
@Mikhail Is telkitty contagious[...]
 
10:25 PM
Fritz is a German chess program developed by Vasik Rajlich and published by ChessBase. The latest version of the consumer product is Fritz 16, which has been based on Rybka since version 15. This version supports 64-bit hardware and multiprocessing by default. == History == In the early 1990s, the German company ChessBase asked the Dutch chess programmer Frans Morsch to write the Fritz chess programs (called Knightstalker in the USA). In 1995, Fritz 3 won the World Computer Chess Championship in Hong Kong, surprisingly beating a prototype version of Deep Blue. This was the first time a program...
^ When I was 12 I had an amazing ELO on the Microsoft gaming zone...
 
@Mikhail That last sentence is too cryptic
 
In scientific computing, GotoBLAS and GotoBLAS2 are open source implementations of the BLAS (Basic Linear Algebra Subprograms) API with many hand-crafted optimizations for specific processor types. GotoBLAS was developed by Kazushige Goto at the Texas Advanced Computing Center. As of 2003, it was used in seven of the world's ten fastest supercomputers. GotoBLAS remains available, but development ceased with a final version touting optimal performance on Intel's Nehalem architecture (contemporary in 2008). OpenBLAS is an actively maintained fork of GotoBLAS, developed at the Lab of Parallel Software...
 
@Mikhail I was referring to the ellipsis [. . .]
 
Kazushige Goto
 
@Mikhail ah, that one is new for me
@Mikhail and without fail it involves knowing the application, so it's not very applicable to general purpose libraries. Which happens to be exactly the area in which heuristics shine.
(It's easy to shine in areas where darkness is the norm)
 
10:29 PM
@Mikhail When you get down to it, nearly all of "knowing what you're doing" still comes down to some heuristics. For example, the general theory of relativity is basically a collection of heuristics, which might be explained to a greater level of detail by some quantum theory of gravity--but even that's still basically a collection of more detailed heuristics that we can't entirely explain either.
 
@JerryCoffin What? Special relativity was the heuristics one. General reletivity is pretty self contained and can be expressed in a single EFE equation. Problem is not the equation, but weather that equation models reality...
Anyways, when the hardware vendor is bragging about all the "heuristics" in their library, it really asks if they actually know what they are doing!
 
It really just says that they realize they cannot know what YOU are going to be doing with it.
They know what they're doing.
Take prefetch: heuristics drive whether prefetch goes in one direction or the other. Branch prediction is heuristics. Why? Not because they "don't know what they're doing". It's because they can't know what you're doing
 
I wouldn't say speculative execution is heuristics, mostly because its not designed as a bunch of special cases
 
@Mikhail The equation, by itself, is not the theory. The theory is about gravity itself, so your "weather [sic] that equation models reality..." is crucial to the theory itself--and although general relativity describes reality to some degree, we know that at the bottom, it's still heuristics--rules of thumb about how things work.
 
Pretty sure equations are theory, they might not be the experimental evidence, or the way to apply that theory...
 
10:39 PM
@Mikhail Then you don't really understand what "heuristics" means. Whether it is or isn't designed as a bunch of special cases is irrelevant to its being a heuristic.
 
I think you got his intent inverted there
 
yes
Although I think some new ARM chips have a "machine learning" AI powered prefetch
 
@sehe Edited to more clearly state that it's irrelevant.
 
I agree that it's irrelevant :)
 
@Mikhail Both are simply surface metrics, Special Relativity is flat, GR is curved
 
10:43 PM
In computer science, artificial intelligence, and mathematical optimization, a heuristic (from Greek εὑρίσκω "I find, discover") is a technique designed for solving a problem more quickly when classic methods are too slow, or for finding an approximate solution when classic methods fail to find any exact solution. This is achieved by trading optimality, completeness, accuracy, or precision for speed. In a way, it can be considered a shortcut.
 
Whether or not that surface describes reality, well that may be a heuristic theory
 
Yes
 
@Mikhail Equations are basically a language, so they're one possible way of expressing (all or part of) a theory. In the case of a purely mathematical theory, we can sometimes express essentially the entire theory in equations. For almost anything else, there's at least an implication (if not explicit statement) that the theory explains some part of reality.
 
@Mikhail Aka an "empirical formula"
There are many that are quite useful
Nuclear binding energy per nucleon is a well established formula, but is basically a linear interpolation across the periodic table
But in this sense, neither GR nor SR are heuristic
They describe the geometry of an arbitrary (4d) surface, it can be derived from first principles that doesn't require any direct observation. But when we say, this surface is our universe that is based on experimental observations of its validity and can be considered a heuristic theory of the universe
 
@Mikhail This clearly doesn't imply no-one-knows why it works. It implies people may know very well why certain factors can be ignored/simplified
 
10:49 PM
But at the end of the day, the exact solution is better
 
Not if it's NP-hard.
 
Would be nice to have one...
 
And impossible. Again, the hardware manufacturer cannot know all the parameters, so heuristics is all there is.
Knowing things exactly is possible but self-defeating (it involves doing most work twice, once to figure out how best to do it, and once to actually do it optimally. Yay)
 
@Mikhail "Better" is a value judgement. Whether it's true or not depends heavily upon exactly what you value. For one obvious example, consider the graphics in lots of games. Most of them use lots of heuristics. For most people, displaying at 20+ frames per second while looking inaccurate but still at least halfway reasonable is drastically superior to a more accurate display that takes half an hour per frame.
 
11:37 PM
that, of course, is vastly preferable if you're rendering a 30-second part of a 2-hour film
 
What if the exact solution is 42?
 
the question is probably 38+4
 
There are extremely few experimentally derived exact truths (the fine structure constant maybe?).
 
Do you feel bad about using Wikipedia for free?
no, not at all ...
 
I pay yearly now, but I didn't for years
@CaptainGiraffe Here are about 1200 pages of experimentally derived truth
 
11:53 PM
@crasic I have the booklet =) By virtue of being on a related team.
@crasic The key word was exact.
 
Most "searches" for particles involves experimentally determining where exactly they cannot exist
Enough fuzziness in the universe that I would have trouble determining the meaning of exact
 
@crasic You think that's bad, what's the convolution of cos(x) with cos(x)?
 
@crasic That is precisely why I answered with the silly 42. I imagine Adams regarded this in a similar fashion.
 
There is no equation to tell you the mass of an electron, but it is experimentally determined.I just disagree that there is something "more exact" about an analytical result unconfirmed by experiment.
 
>> I just disagree that there is something "more exact" about an analytical result unconfirmed by experiment.
Absolutely. No argument there.
 
11:56 PM
If it is an exact result confirmed by experiment, doesn't that mean you can determine that truth through experiment alone.
 
You would agree that c = 1 though.
 
When convenient ;)
when you take c=1, you can express resistance as units of velocity
pass me a 100km/h resistor
 
As it should be
 
My experimental bias is showing, so take my proclamations as ranting
 
@crasic I was on the WA98 team. I regard my rants as exact truths!
 

« first day (2613 days earlier)      last day (2318 days later) »