« first day (1657 days earlier)      last day (3297 days later) » 

5:01 PM
Hey, is it legal to drink beer on the streets in the Netherlands?
 
@R.MartinhoFernandes yes/no
no, they can confiscate public alcohol
 
yes, it never is enforced unless you are causing trouble in public places
 
user1804599
@R.MartinhoFernandes No idea. Certainly not if you're not 18+.
 
5:03 PM
you won't get locked up
they'll just confiscate
but as long as you're not being icnredibly drunk and causing people trouble don't worry about it
@R.MartinhoFernandes en.wikipedia.org/wiki/Kapsalon
not sure if they have those in berlin
if not you should eat one for dinner
 
user1804599
Apparently it's municipality-specific.
 
user1804599
But yeah I can't imagine anybody giving a shit.
 
just like smoking weed
in theory it's not allowed, and they can confiscate
but in reality it's not enforced and no one gives a shit
 
user1804599
Max 5 grams of beer!
 
well if you have a 0.5L can
at 5% alcohol
 
user1804599
5:07 PM
5l can.
 
that's about 0.05 * 0.5L * 4/5 volume-to-alcohol weight = 20 grams of alcohol
 
user1804599
@fredoverflow Who?
 
so I guess you can have a 125cl beer if you're allowed 5 grams of alcohol
@rightfold co creator of haskell
dick
 
user1804599
I see.
 
5:08 PM
:P
 
user1804599
Well, time to take a shower.
 
> the pothole was fixed in less than 48 hours
lolwut call this "fixed"?!
 
lol
 
covered by something opaque is the definition of fix by many
 
management?
 
not sure a newspaper should finish an article with "What a time to be alive", though.
 
Human has an amazing ability to recognize faces and genitalia.
4
 
@JerryCoffin oops seems I mixed the "first place" adjective. I blame the fact that I was dictating to my phone at the time
 
5:13 PM
@Nican what about feces?
I always confuse faces and feces.
 
I see that you are not a people person.
 
@Nican I'm a people.
 
/cc @MartinJames
 
lol
random item name generation
 
@Nican how could this be unstarred?
 
Did not even notice it was starred.
Woo!
 
aphorism of they day imo.
 
@LightningRacisinObrit The EmDrive is all kinds of spooky
 
@LightningRacisinObrit FTL travel? Sounds cool. Unfortunately it seems unlikely.
 
however it's not faster-than-light travel
The Alcubierre drive or Alcubierre metric (referring to metric tensor) is a speculative idea based on a solution of Einstein's field equations in general relativity as proposed by theoretical physicist Miguel Alcubierre, by which a spacecraft could achieve faster-than-light travel if a configurable energy-density field lower than that of vacuum (i.e. negative mass) could be created. Rather than exceeding the speed of light within a local reference frame, a spacecraft would traverse distances by contracting space in front of it and expanding space behind it, resulting in effective faster-than-light...
It's basically compressing space in front of you, and expanding it behind you
 
5:20 PM
@Ven we don't want the static_assert to fire (ie. display the diagnostic)
 
actually
I guess you could call it faster-than-light travel
just not faster-than-light speed
 
@LightningRacisinObrit There was also that time that scientists found faster than light particles, only to find out nobody really understands NTP.
 
yeah ;p
@orlp It effectively is.
@orlp right
It's all relative ;p
 
"Any sufficiently advanced technology is indistinguishable from magic."
I really want to believe that what the EmDrive does is real
but it's hard to seperate pseudoscience from real science if you're not an expert
so I don't know how much truth there is in it
 
how does that get upvoted O.o stackoverflow.com/questions/29974025/…
 
5:25 PM
this two day old answer is about to become my top voted answer, lel
134
A: Why is this code vulnerable to buffer overflow attacks?

orlpOn most compilers the maximum value of an unsigned short is 65535. Any value above that gets wrapped around, so 65536 becomes 0, and 65600 becomes 65. This means that long strings of the right length (e.g. 65600) will pass the check, and overflow the buffer. Use size_t to store the result of...

 
Can anybody enlighten me what a diabolical wild free is lol
 
@orlp wtf happened there
 
actually
 
@orlp if you ask nicely we can downvote :p
 
5:28 PM
I think my code in that answer was bugged as well
topkek
 
hi guys :)
 
@deW1 It's free-range evil that has eaten only organic electrons.
 
nah, the code isn't bugged
or wait
yep
the code is bugged
 
@JerryCoffin makes sense
 
TOP LEL
@LightningRacisinObrit can you spot the bug in my answer?
or anyone else
it's pretty subtle and pretty terrible
in fact
it's incredibly incredibly broken
 
5:32 PM
The fix is: "don't use str* functions"
 
no but seriously
 
They're incredibly broken.
Yes, seriously.
 
try and find the bug mentally - see if you can find it
 
you should really all switch to nim
 
5:33 PM
@orlp Not putting '\0' at the end when len == 100?
 
@milleniumbug incorrect
 
@milleniumbug Some are more broken than others--strncpy is pretty much the most broken of all. It's nearly impossible to use it in a way that's not broken.
 
the string is never null-terminated
that's how terribly broken my code was
 
Oh wait, I don't remember how strncpy works.
 
who the fuck does?
I clearly didn't
std::strncpy(buf, "hello", std::strlen("hello")); only writes 5 bytes, "hello"
 
5:35 PM
@milleniumbug Nobody knows how it works. That's because it doesn't really work (at least for any reasonable definition of "works").
 
@orlp hmm really?
 
@JerryCoffin It's confusing, because it's disguised as a string function, when it isn't.
Hmmm, I wonder what would I do if I were writing in C...
Use memcpy all the time?
Meh, better not to think about it.
 
Oh, you just fixed it
I was like, wha that looks fine
lol
 
at first my code was strncpy(buffer, str, len);
10000 views, 130+ upvotes
no one bats an eye
 
5:38 PM
@milleniumbug One that actually works pretty well is sscanf, amazingly enough (if you use it with sufficient care).
 
strncpy is somewhat clearer, y'know
so I'd probably go with manual null-termination after-the-fact
 
@LightningRacisinObrit memcpy is probably correct in this case, seeing as we already found the length of the source string
 
doesn't really matter I suppose
 
for purrformance it does :P
 
@orlp suppose
@orlp fine
 
The best thing about string manipulation in C is that half of the function include '\0', and the other half doesn't. So you get 100% off-by-one errors.
 
@orlp We should set up an auto-lint on all and answers. Not that I'm going to do it, but it would be a good thing (and with it, add a flag for "contains obviously broken code").
 
oic, strncpy is null-aware
stupid legacy crap
@milleniumbug it's so bad
One last comment: since the copy always stops short of the NUL, strncpy(buffer, str, len) could be replaced with the equivalent but generally faster memcpy(buffer, str, len). — Jim Balter 2 days ago
fail
 
@JerryCoffin I don't think so, not on arbitrary inputs.
 
I like how you have two downvotes
 
5:42 PM
int r; sscanf("123456789123456789123456789", "%d", &r); // UB
 
@LightningRacisinObrit I do? bastards
 
repcap boom
not bad eh
 
I now know how it feels to be @Mysticial stackoverflow.com/users/565635/orlp?tab=reputation
dat broken link
 
@milleniumbug We were talking about using it to copy strings, with the length limited to the size of the target buffer, and assuring that the result is NUL-terminated (to which your example is 100% UNrelated).
 
@JerryCoffin Oh, I see. Yeah, sscanf could work there.
 
user1804599
5:46 PM
hi
 
inb4 someone discovers another Heartbleed made by someone who copied the orlp's code from SO.
 
you're proper close to python gold
 
@LightningRacisinObrit IKR
 
firsty
 
@milleniumbug that would be hilarious
@milleniumbug though not entirely impossible
I am maintainer of a small-time crypto library
 
5:49 PM
there should be no such thing
 
22 hours ago, by orlp
50 more upvotes on Python answers and I have a Python gold badge!
@Puppy the crypto code isn't mine - it's by the original author
djb
 
yes that's right only a magical select few should ever write crypto algorithms. of course we know we can trust them
what could possibly go wrong
 
@orlp It was actually pointed out a couple of days ago:
2
A: Why is this code vulnerable to buffer overflow attacks?

FriedrichThe answer with the wrapping is right. But there is a problem I think was not mentioned if(len >= 100) Well if Len would be 100 we'd copy 100 elements an we'd not have trailing \0. That clearly would mean any other function depending on proper ended string would walk way beyond the original arr...

 
@JerryCoffin nope
that's a double swing and a miss
firstly, it doesn't mention that the string never gets null-terminated
 
Is it allowed for an apache 2.0 licensed software to have an appendix at the end saying the software "may not be distributed". Isn't the point of an open source license like apache to prevent someone from adding an appendix like this?
 
5:51 PM
second, it only mention the case where len == 100, which is caught
 
user1804599
@JDiMatteo ask your lawyer.
 
@JDiMatteo Read the Apache 2.0 licence and find out?
FWIW, IANAL but I think you're wrong. That clause is fine. Merely using Apache does not prohibit it.
 
@orlp He clearly states: "we'd not have trailing \0." His phrasing of the circumstances was poor (and incomplete) but he was clearly pointing you in the right direction anyway.
 
@JerryCoffin no, he was clearly mentioning a different bug
where size of the string == size of the buffer, so the null character wouldn't fit
that bug wasn't relevant to the code
in fact
that scenario, unlike literally every other scenario, wasn't bugged :P
 
Spotify playlist has 1,974 songs on web player. Same playlist has just 1,898 on desktop player. WTF?
 
5:55 PM
@JerryCoffin he managed to spot a 'bug' in literally the only working part of the code :P
 
@LightningRacisinObrit : ah yes, thanks, this part of point 4 "may provide additional or different license terms and conditions for use, reproduction" ... seems to defeat the spirit of the license though
 
@JDiMatteo I don't see how
Not every open source is shitty restrictive GPL or whatever
Some people actually have common sense
 
@orlp He was pointing toward lack of NUL-termination, which was exactly the bug you had. He just failed to correctly specify the precise circumstances under which it happened.
 
If it were the way you propose, pretty much no software ever would be closed-source and you'd never be able to make a cent off software
 
I think GPL makes perfect sense, depending on the scenario
 
5:56 PM
Think about business, infrastructure, commercial, security use
 
I don't think GPL is the right choice for libraries
 
The world is bigger than a few hobbyist projects on github
 
but for community-driven applications I think it makes perfect sense
for example, I wouldn't mind Vim being GPL
 
@orlp The only scenario where the GPL applies is where your code is null.
 
@orlp isn't it gpl?
 
5:58 PM
@MarcoA. no
 
@orlp but it is gpl-compatible, right?
 
@MarcoA. yes
 
pfft desktop client is terrible anyway
so unresponsive lately
no idea how it's built, except "badly"
 
@LightningRacisinObrit ?
 
7 mins ago, by Lightning Racis in Obrit
Spotify playlist has 1,974 songs on web player. Same playlist has just 1,898 on desktop player. WTF?
 
6:02 PM
toplel
 
well
I got to be the Pragmiral.
mostly for bad reasons.
 
user1804599
@fredoverflow eq is redundant! x eq y is the same as x.isInstanceOf[y.type]!
 
@LightningRacisinObrit extra DRM?
 
bah
my food went off in the fridge.
 
6:13 PM
lol and backup from SpotMyBackup gives one more track than the web player wtf
 
I guess that there's a limit as to how long even a giant pile of very well cooked vegetables can last.
 
breaking news
0
Q: How to extract string within a string in a vector string

Santhosh KumarImagine a code like this: vector<string> lsLineNumbers; lsLineNumbers.push_back("9, 0xbaadf00d, 3, 4"); lsLineNumbers.push_back("0xcoffee99, 4, 7, 1, 3, 5, 0xdeadbeef, 78"); When you look in the debugger it looks like string array lsLineNumbers[0] = "9, 0xbaadf00d, 3, 4" and lsLineNumb...

dat title
 
inb4 yo dawg joke
 
yo dawg, your food went off?
 
your plonks are showing
 
6:27 PM
what a qtie
Guys, do you think it's a reasonable assumption to make that if I have a floating point value f bigger than 1 of type F then (f / std::numeric_limits<F>::radix()) * std::numeric_limits<F>::radix() == f? Or is it even guaranteed by the standard?
 
user1804599
Time to make some software!!!!!
 
@orlp dunno
C++ doesn't really define this kinda stuff. The floating-point impl does
I'm trying really hard not to steal your question for SO :P
 
go ahead
 
time for me to grump
 
@LightningRacisinObrit all of this is still for this question: stackoverflow.com/questions/29886360/…
we're close to a solution
 
6:32 PM
oh no wait, time for me to call up those fuckfaces and ask them to explain clearly why they make such a terrible website.
 
but not quite yet
 
@Puppy I'm sure that'll have a good outcome.
Top notch personal skills
 
Hello!
What have I missed?
 
@R.MartinhoFernandes how do you like dutchland so far
 
@R.MartinhoFernandes nothing
 
6:35 PM
@orlp lol Cheers is being unhelpful, as usual.
 
user1804599
@R.MartinhoFernandes Room got frozen by Gordon again.
 
@rightfold Did it?
 
@milleniumbug I think my question was pretty clear
 
@milleniumbug You should link him to this
 
the fact that the answer is most likely "no, there is no standard way" doesn't mean the question was bad
 
6:36 PM
yarp
 
@R.MartinhoFernandes nothing, ever.
 
@orlp seems nice.
 
user1804599
He sure does.
 
Everyone's been super friendly so far.
 
@orlp is great
 
user1804599
6:38 PM
s/friendly/high/
 
wait, did you meet orlp
 
nope
 
ok I get it now lol
mobile chatting ftl
 
Yeah, any of you Dutch folks anywhere near Amsterdam?
 
I'm in Leiden
 
6:39 PM
meet rightfold and take a photo and genetic sample
 
user1804599
Depends on your definition of "near".
 
but if you'd come to Leiden you'd ask me to show you around or show you interesting stuff :P
and I'd have to disappoint you
 
user1804599
I'm in Roosendaal almost every day.
 
I barely know where I live, that's how little I go outside :P
 
user1804599
I wouldn't say it's particularly near Amsterdam.
 
user1804599
Traveling from here to Amsterdam by train is more expensive than by plane from Amsterdam to Warsaw.
 
Not looking for tourist guides. Just checking if it would be feasible to meet any of you.
 
user1804599
sehe is nearest of all I think.
 
s/feasible/wise/
 
user1804599
6:41 PM
Nah, Leiden is nearer.
 
Leiden doesn't seem too far, yeah.
 
user1804599
Take pics of Adam.
 
who the fuck is Adam
 
Amsterdam.
 
A'dam
 
6:43 PM
Hmm. 9 euros, 40 minutes by train.
 
user1804599
Only 9? I'm surprised.
 
prob. not a retour :P
 
ns.nl, right?
 
user1804599
Yes.
 
user1804599
6:44 PM
See 9292ov.nl for fastest route.
 
ooh, gamedevs can now VAC ban people from their game
i.e. if a gamedev asks valve to ban you they do it
(from their game)
 
Is that for like MMOs?
 
isn't VAC ban global?
like, linked to your steam account?
 
some VACs are per games
 
user1804599
What is VAC?
 
6:47 PM
a VAC in TF2 will ban you from CS GO too
a VAC in CoD won't ban you from TF2 and CS GO
@R.MartinhoFernandes for any game that uses Valve's anti cheat (VAC)
 
user1804599
Oh, I see.
 
it seems a ban in TF2 won't ban you from other Valve titles
 
Bye, rightfold.
 
so it's probably per game there too
 
6:49 PM
Any horror movies fan here? xD
 
Why is profanity considered offensive?
THIS FUCKING FLAGGING SYSTEM
 
@orlp This is not the school playground. There are loads of places where writing "vagina anal cunt" is considered inappropriate/offensive. It should not come as a great shock that this could be one of them.
 
inappropriate, sure
but why offensive?
 
> Do you want to flag this message as spam, inappropriate or offensive?
Doesn't need to be offensive.
> This user has been automatically suspended for posting inappropriate content and cannot chat for 29 minutes.
The boy never learns.
 
doesn't say that when you get the popup
the popup in the bottomleft just says offensive/spam
 
6:50 PM
@orlp It says it when you click the 'flag this message' icon.
 
I understand that
 
It's also basic common sense.
 
just wasn't aware of it
 
ok
labelling bug in the validation popup I guess
 
Was rightfold suspended?
 
6:51 PM
yep
 
How surprising.
 
poor pantoona
 
1 min ago, by Lightning Racis in Obrit
> This user has been automatically suspended for posting inappropriate content and cannot chat for 29 minutes.
@R.MartinhoFernandes lol
 
I've been suspended once I think
 
6:51 PM
Haven't seen you since ages. How's it going?
 
for making some edgy jews joke or something
 
Why joke about edgy jews?
 
See, nobody cares about the clowns!
...
 
They're sharp :)
 
someone's just edited an answer I posted 2 years ago - wtf?
 
6:51 PM
So is C.
 
@PolymorphicPotato I've aged ages.
 
@ScarletAmaranth Why does its age matter?
 
@ScarletAmaranth So?
 
I've seen you ageing.
 
if your answer could be improved, why not?
 
6:52 PM
No.
 
TIL
actually
 
> ageing |ˈeɪdʒɪŋ | (also aging) noun [ mass noun ]
the process of growing old: the external signs of ageing.
 
it depends on whether you're writing american/british english
> (also aging)
 
What's happening tomorrow that all the hostel rooms are in the order of ~€100?
 
welp
I sent the Government an angry complaint detailing their inadequacies.
I'm sure that nobody will actually address any of them, but hey.
 
6:54 PM
Tonight: €10. Tomorrow: €100.
 
@R.MartinhoFernandes day of work (at least here in Slovakia) - ah, also Ice hockey
 
@R.MartinhoFernandes I don't know
@R.MartinhoFernandes friday night in amsterdam?
 
@orlp um writing what now
@ScarletAmaranth Sokovia*
 
@LightningRacisinObrit I don't get it :P
 
@orlp Friday and Saturday.
 
6:56 PM
@R.MartinhoFernandes you could check hostel prices in Leiden
 
@ScarletAmaranth Avengers referenece nm ;p
I'm hungry.
 
You're already broke when you look at them.
 
@LightningRacisinObrit I love 60's spider man comics if they contain avengers stuff
^ the best
 
yes that looks totally legit 60s Spider Man comic
 

« first day (1657 days earlier)      last day (3297 days later) »