« first day (1444 days earlier)      last day (3506 days later) » 

12:00 PM
@AndyProwl x is a named r-value but the problem I have with it is that despite it being an r-value reference, I can't pass it to a function that only accepts r-value references.
 
So, what else do you need then?
 
@R.MartinhoFernandes constexpr arguments
 
That's not "else".
 
@Rapptz because the type of x is "rvalue reference", but its category is "lvalue" (because it has a name)
 
12:01 PM
@Rapptz Value category (what is an lvalue or rvalue) is the property of an expression, not of a variable or type.
 
18
Q: An English idiom for "solve a problem that has been solved"?

FeanorIn Polish, and I believe in a number of other European languages, there is an idiomatic expression which translates to "to force a door which is already open". It is used to describe a situation when much effort is spent on solving a problem which has already been solved, or did not exist in the ...

 
@Rapptz PhDing.
:P
 
Xeo
lol
 
@LucDanton gotcha
 
(it's the value category of x that determines whether or not you can bind an rvalue reference to x, not x's type)
 
12:02 PM
you're referenced on cppreference robot
 
@nightcracker At least one of them has to exist as a primitive.
 
@R.MartinhoFernandes I mean you can make T std::log(T base, int exp) and make an overload for T std::log(T base, constexpr int exp)
 
And to be honest, it's not a problem at all, and log(base, n) is perfectly serviceable as is already.
@nightcracker Which you don't need.
QoI
 
But performance~~~~~~~~
 
@R.MartinhoFernandes the implementation for log2 looks vastly different than other log bases
 
12:05 PM
Not a problem.
log(2, n) can fill that role just fine as we are.
 
how?
 
Basic and trivial optimisations.
 
Xeo
if (base == 2) :D
 
PCRE should be an ISO standard
 
oh god no
 
12:08 PM
haha
 
PCRE should die
 
your face should be an ISO standard
 
except that that requires inlining and large functions do not often get inlined (after inlining it can be determined the large function can be made a lot smaller, but that's after it's been decided if it should be inlined)
 
what's wrong with PCRE?
 
it already is
 
12:08 PM
ISO/IEC 1337
 
cat doesn't like it obv
 
It's overblown
DFA regexes <3
 
and every instance where base is not known at compile time now gets another branch in the implementation
 
Django had a DoS issue thanks to regex once
 
12:09 PM
@nightcracker QoI vOv
 
Qo inhibitors (QoI), or Quinone outside inhibitors are a group of fungicides used in agriculture. They represent the most important development made in fungicides by the chemicals industry. QoI are chemical compounds which act at the Quinol outer binding site of the cytochrome bc1 complex. QoI's are the resulting fusion of three fungicides families, the well-known family of strobilurins and two new families, represented by fenamidone and famoxadone. Some strobilurins are azoxystrobin, kresoxim-methyl, picoxystrobin, pyraclostrobin and trifloxystrobin. These fungicides are used on a wide range of...
 
user1804599
@LightnessRacesinOrbit Nothing. It rocks.
 
quality of implementation
 
log is a poor motivating example because it all ends up boiling down to poor implementations.
 
12:11 PM
@nightcracker No need for that either. The mechanisms to avoid all that already exist.
 
PCRE is not regular
@R.MartinhoFernandes But a branch!!
 
bah
my boss asked me to look at a Java-based tool
so much bullshit.
 
@CatPlusPlus No branch is needed.
 
user1804599
@CatPlusPlus That's good.
 
if(__builtin_constant_p(base) && base == 2)
 
12:13 PM
PCRE is great
 
@Puppy so much for that job :/
 
Ell
@puppy what is wrong with that? :S
 
what, of requiring endless bullshit?
 
Puppy is bad at tools
5
 
@nightcracker GCC has all the machinery needed to make log(2, n) work just as you want. If you want to make a proposal, I recommend finding better motivating examples.
 
12:15 PM
@R.MartinhoFernandes sec working on one
 
user1804599
@Puppy Say "no."
 
I doubt he'd appreciate that very much
 
You can start complaining about projects after a year or so
 
user1804599
"Then why did you ask instead of telling me to?"
 
You think that's clever but no
 
user1804599
12:17 PM
:D
 
@CatPlusPlus This seems like a QoI thing.
 
@rightfold He asked him to, not whether.
 
When I said PCRE I meant the syntax and semantics.
 
as opposed to the colour of its hair?
 
user1804599
12:17 PM
Perl is nice.
 
@Rapptz PCRE has features that require a different kind of engine
 
like what?
 
Assertions for one, afair
 
ISTR that PCREs are, in fact, not regular at all.
 
12:19 PM
That's not a problem in itself, though.
@Rapptz Zero-width assertions and lookbehinds tend to mess up everything. (But so useful!)
 
zero-width assertions, lol
 
just reminded me of stuff like zero-width non-breaking spaces
 
. is an assertion of width 1.
 
It means they don't become part of the match, just provide context
 
Ell
12:20 PM
You can just use capturing groups for that though cant you?
 
No.
Can't emulate it, which is why it requires a different implementation.
 
is that 'so useful' thing sarcastic?
 
Ell
Oh. I thought you could just put your "match" as a group
 
cause I use lookbehinds sometimes :(
 
It's sometimes useful
 
12:21 PM
@Rapptz No.
 
sticking to my guns!
std::regex sucks
I want PCRE
 
@Ell Consider q(?!u)v (where q, u, and v are arbitrary regices). Try the same with capturing groups.
 
Ell
Hmm yeah
 
Note that u and v can both apply to the same part of the string.
Actually, the q is not needed for a minimal case.
 
I'm using less and less regii
 
12:24 PM
Yeah me too.
 
user1804599
I'm using more and more of them.
 
Hmm. There's no way to know that a serial port stopped existing if I already opened it :<
@rightfold Probably for the same reason they are using less and less.
 
Whatcha using?
 
you're all committing regexicide
 
user1804599
Somebody has to make up for them!
 
12:26 PM
@Rapptz Boost.
 
user1804599
In fact, I'm going to use regex in my SQL query right now!
 
All the answers lie in Boost
All the problems, too
 
Would need to use the Windows API or something to test that.
 
@rightfold lol
 
Oh. For some reason I was thinking Arduino.
Jesus.
optional braces taken to another level
 
12:29 PM
Python++
 
@Rapptz Nah. Need to get some data through a serial port interface. Thing is, it's actually an USB device that provides a serial port interface, so it can be plugged in and out.
 
Ell
it looks like python
@R.MartinhoFernandes arduino does this too
 
his conditional branches don't even match the indentation
probably goes some way towards explaining his problem
 
Ell
well, my model does
 
@Ell Well, true.
 
Ell
12:30 PM
I think they "fixed" it now
 
He probably uses tabs too
No hope
 
@Ell There's nothing to fix.
That's how it's supposed to work.
 
But this is an in-house device, so I'll just get someone to tune the protocol so I can detect when it's gone.
 
@LightnessRacesinOrbit who uses * for indentation?
 
12:32 PM
regex jokers do
 
@melak47 People even worse at indenting stuff than lrio
 
void frob(int qux) {
****if(qux == 2) {
*********return 0;
****} else {
********return qux*3;
****}
}
 
user1804599
@Rapptz lol
 
user1804599
            if (avg232 >= 70)
                cout << "You have a C.";
        else
 
I still don't understand how anyone can be for space indentation. Not to beat a dead horse or anything, but that just makes zero sense to me. You're idiots.
 
12:33 PM
@R.MartinhoFernandes I expected /**/, /******/ etc :p
 
Tools are broken
Tabs are broken
You're the dead horse
 
Your opinion is broken.
Tools are fine. The only place tabs are a problem are web rendering.
 
tabs are racist
 
Otherwise never had a problem with tab indentation, not even once in 72 years.
 
12:34 PM
Congrats, you're incredibly lucky
 
One \t = one level
So simple and meaningful
 
And you can render it however you like!!
 
two \t = one and a half levels
 
I find gridlocks fascinating for some morbidly obese reason.
 
12:35 PM
@R.MartinhoFernandes Americans are good at driving.
 
@R.MartinhoFernandes the cars are tabs, and the people are spaces? :p
 
morbidly obese!?
 
That's a synonym for 'american'
 
@R.MartinhoFernandes lmao what
what did you mean for obese?
 
12:36 PM
@R.MartinhoFernandes I remember the first time I correctly identified a traffic jam I was in as a deadlock.
 
Dunno.
Just felt like it.
 
Fortunately a fire engine came along and pushed through, creating a wake just large enough to resolve the deadlock. Guess it was like an interrupt, giving implicit priority to the threads it hadn't nudged to the side ;p
 
I was going to say "morbid fascination" at some point but my brain puttied out.
 
obscene maybe
 
12:40 PM
0
Q: Practical examples of good use of classes?

CaridorcI am an intermediate-level hobbyist programmer, and in more than a year of recreational coding I have never felt the need to use a class, functions work just fine, I know what classes are (at a basic level) still I have never encountered a single case where I thought "This would be much simpler a...

 
Ell
@LightnessRacesinOrbit I agree with you
tabs for indent, space for align. Any way
 
@TemplateRex holy fucking fuck
 
Ell
@TemplateRex man they need a roundabout
 
@Ell this one's also funny
 
@Ell "it works fine the way it is; why over-complicate?"
 
12:43 PM
@LightnessRacesinOrbit php, 'nuff said (note my idiomatic use of the apostrophe)
 
@Ell They clearly don't!
 
Ell
@R.MartinhoFernandes yeah haha
 
dat picture
 
@TemplateRex gj
 
user1804599
TemplateRegex
 
12:50 PM
@LightnessRacesinOrbit btw, the Indian traffic had no rules and no accident; here's the Russian version, lot's of rules, lots of ...
 
user1804599
> Be carefull
 
dafuq.
Disk Manager cannot partition this flash drive.
 
@TemplateRex f'ing idiots
 
Gosh, do I have to reboot?
 
user1804599
R.I.P. robor. For a second!
 
12:57 PM
> robor
 
user1804599
Dammit, can't mixin both PackratParsers and RegexParsers. :<
 
user1804599
Well, no left-recursive parser for me! Manual fold it is, then.
 
Why would you want regex if you're already using packrat
 
user1804599
Because """[0-9]+""".r ^^ { _.toInt } is just too easy. :p
 
user1804599
But yeah, might as well rewrite those four parsers without regexen.
 
1:01 PM
It doesn't have a combinator for ints?
lol
 
user1804599
This isn't the full combinator.
 
user1804599
  def integer = lexeme(for {
    base <- (("""[0-9]+""".r ^^ { _.toInt }) <~ "#").? ^^ { _.getOrElse(10) }
    value <- """[0-9A-Z]+""".r ^^ { java.lang.Long.parseLong(_, base) }
  } yield value)
 
Readable
Also lol a-z
Dynamic base literals are v useful
 
Ell
lol my friend has to learn c in his physics degree at some point
 
user1804599
lol C
 
1:05 PM
@Ell why is that so funny?
 
because C is shit
 
Ell
^
 
It's funny because it's cruel
 
so what should they learn
fortran? c++?
 
Python
 
1:06 PM
my physics major friend learned fortran
 
maybe if they teach numpy and stuff
 
Fortran is definitely more popular for science stuff than C
 
but I'd doubt straight up Python would be fast enough for numerical science
 
Ell
@nightcracker python probably
or c++ at least
 
user1804599
@nightcracker Scala.
 
Ell
1:07 PM
why would you ever use c instead of c++?
besides if a compiler isn't available
 
user1804599
BECAUSE IT IS CLOSER TO METAL ERMAHGEERD FASTER
 
@Ell because C is a much simpler language than C++?
 
@Ell Mental illness.
 
Fortran is better than C :v
 
1:08 PM
@CatPlusPlus that's what I said, if they teach numpy
 
user1804599
@nightcracker And much harder to use. Congrats.
 
@rightfold depends, for applications, yes, for simple numerical code?
 
C is a dumb choice
 
simpler doesn't mean more powerful
 
Fuck C and any other language without a string type.
 
1:08 PM
C is very error prone
 
simpler tools aren't necessarily better tools
 
easy to get it wrong
 
I use numpy
 
string theory? hurr
what do physicists need strings for?
 
user1804599
in Java Sucks, Jun 22 at 9:58, by FredOverflow
> you'll master the art of writing error-prone code
 
1:09 PM
lol
 
Matplotlib's plots are the bomb.
 
@rubenvb that I can not deny
 
Also C is hellishly complicated and only looks simple because it's a primitive piece of shit
UB is death
 
But I do use the MKL-linked version, so it's pretty much Matlab with a different frontend language.
 
@rubenvb You design weapons?
 
1:10 PM
@nightcracker Also
@MartinJames I might, I might not. Who will tell?
(hint: I'm quite googleable)
 
:effort:
 
Let's just say my subject is "electron vortex"
 
first google result for Relativistic Quantum Mechanics antwerp phd is Albert Einstein's wiki page
TIL @rubenvb is working on the A-bomb
 
@rubenvb Magnetrons?
 
Does anyone know under which conditions printf("%f") uses region specific settings (ie. does not use "." as decimal sep)?
 
1:12 PM
Battlefield Hardline dev says the game is going to work at launch
what a great achievement
 
Erk! Locale question, (~~shudder~~)
 
what "all"?
 
opposite of none
 
1:16 PM
      #pragma GCC diagnostic ignored "-Wformat"
neat
 
Ell
@floele all conditions
 
I guess I don't get it...just found something though. seems like there is a function setlocale() that can be used to change the behaviour.
 
user1804599
lol, global locales
 
user1804599
Great invention.
 
1:18 PM
absolutely
 
hmmm smartctl -t short is showing a read failure. Should I be worried?
 
Local globals are better.
 
@R.MartinhoFernandes ok, took me a while to make the example in a way that makes sense gist.github.com/orlp/6f723c6dfcb33e29c7bf
@R.MartinhoFernandes probably not bug-free since I can't test it for obvious reasons
 
@MartinJames lolwut?
 
@rubenvb Thread-local storage:)
 
user1804599
1:23 PM
Globals are process-locals!
 
Environment variables are even more global than process-locals, and turn your computer into an unauthorized shell!
 
@floele None. If you want to do localized conversions in C, you use localeconv, to handle the conversion, then print out the resulting string. It's sufficiently ugly and clumsy to make even iostreams seem fairly clean by comparison.
 
You're all loca.
 
@JerryCoffin Unfortunately, I don't want to do it. But it happens. We are currently tring to find out which component (it happens when the "file open" dialog from Windows is called) messes with the settings.
 
1:26 PM
> Reason: Category 'Games' denied by WebBlocker policy 'WebBlocker.1'.
pfft
 
@floele Not sure I follow. You're trying to track down something that's changing your global locale? (globale?)
 
@JerryCoffin sort of. howver, using setlocale(9 during debugging doesn't seem to have any effect so I'm not sure if that is the function I am looking for.
@JerryCoffin OK, got closer. setlocale(LC_NUMERIC, "de") does nothing, setlocale(LC_NUMERIC, "") does. even though my default locale is "de". not sure if I understand that.
 
@LightnessRacesinOrbit lol you still have webblocker software
 
Question for you people.
 
user1804599
 
1:38 PM
@Rapptz Push and pop, please :)
 
I don't like the diagnostic pragmas
too messy :s
esp. with taking clang into account
 
I'm working on a UI to show a list of items. The user needs to be able to sort/group/filtrer them, and there's gonna be upwards of 200,000 items on there.
What's the best way to do it?
I've been thinking about doing it JIRA-style.
 
That was a #pragma GCC directive already though.
 
@EtiennedeMartel Just page 'em
 
1:41 PM
@Mgetz ikr
@EtiennedeMartel how does JIRA do it?
 
There's not much choice besides that so :v
 
user1804599
@EtiennedeMartel Perhaps like the kitchen sink example on this page?
 
user1804599
Though I don't know how you want grouping. :v
 
@EtiennedeMartel The short answer is: don't. Right now, you seem to be thinking in terms of displaying 200,000 items, then filtering out the parts they don't want. With that many items, I'd think in terms of initially showing nothing, and let them specify the subset they want to view.
 
@LucDanton I'm just saying it gets really messy, e.g. coliru.stacked-crooked.com/a/416c80f31dd947df
not fun
 
1:43 PM
"not fun" — Lounge<C++>, 2014
4
 
Morning
 
Bah I have a thing to do and no idea how to do it without it being a terrible hack
Fuck spec changes
 
user1804599
Make it a terrible hack.
 
you're a terrible hack
 
@MartinJames I still vote for the *_l functions everywhere.
 
1:45 PM
it's called 'workaround'
make believe: an elegant workaround
 
clang and gcc should have unified their pragma diagnostic thing
 
@CatPlusPlus There are lots of other choices, and with 200,000 items, paging (by itself) is grossly inadequate.
 
since they try to be compatible
 
user1804599
#pragma gcclang
 
user1804599
Can you not use _Pragma or whatever it's called?
 
1:47 PM
@EtiennedeMartel some categories with checkboxes, a search box which filters out non-matching items, and ability to sort by virtually any property is the only decent way to do it.
Or perhaps a cool fluid-like radial search result thingie like musicmap used to do (still does?)
Yeah, this: music-map.com
 
@rightfold docs don't mention diagnostic being possible
 
good for a limited amount of items.
 
I might be missing something
 
Also shows interrelations between items.
 
user1804599
@Rapptz Try it!
 
Xeo
1:50 PM
@Rapptz _Pragma("GCC diagnostic push") etc
however
can't build up string literals inside of it, AFAICS
Was going to suggest something like this: coliru.stacked-crooked.com/a/898d116c91741c64
 
"compiler name" "diagnostic push" maybe?
 
Xeo
May be workable with some trick
 
does C++ even have _Pragma?
 
@Xeo No need.
Just put tokens next to each other, and then stringize.
 
Xeo
@Rapptz Ye
@R.MartinhoFernandes true
 
1:53 PM
@rubenvb nice. where does the data come from?
 
@LightnessRacesinOrbit gnod.com
It seems like it's crowd-sourced.
 
The music map thingie exists since like, 200something
 
Xeo
@R.MartinhoFernandes Meh, was trying to get rid of that warning
 
1:55 PM
the warning is probably there cause -Wwhatever doesn't exist
@R.MartinhoFernandes neat
 
Xeo
oh, right
 
yeah warning goes away if you use -Wformat
 
@rubenvb 20014
 
1:57 PM
lmao
 
Xeo
heh
 
> kishida kyoudan?
Gnod don't know this one. Is the spelling correct? If so, please confirm it by clicking here.
 

« first day (1444 days earlier)      last day (3506 days later) »