« first day (2159 days earlier)      last day (2788 days later) » 

9:11 PM
Young's Modulus too
 
@R.MartinhoFernandes the full name is 'modulus operandi'
 
Xeo
Aw man, C# has no scanf / formatted read, as far as I can see...
 
gonna be a distinct class of some kind
StreamReader I think
 
StreamReader just reads text.
There is no direct equivalent of "here's a pattern, now read shit"
 
hello so what would cause 2 / 2 to become -572662307?
 
Xeo
9:21 PM
@EtiennedeMartel That makes me kinda sad. Back to regex, I guess.
 
it should be one right?
 
@chewbapoclypse Undefined behavior
That looks like garbage memory.
So there's something you're not telling us
 
yea i think so too
ok one sec
setnum(*num / _gcd);
void fraction::setnum(int numer)
{
if (num != NULL) delete num;
*num = numer;
}
 
gtfo
 
wtf
 
9:24 PM
lol
 
... so yea i am not used to using pointers and all
 
We can see that. :)
 
so i thought * means value @ that memory address....
dereference operator
 
Xeo
and you delete it right before accessing it. well done.
 
Yes, but you are deleting that memory access, allowing it to be allocated by other parts of your program.
 
9:28 PM
hmm... i see the error..sorta but it works for another value just fine which to me is weird
 
It is going to randomly break. What you are doing is undefined behavior.
Depends whatever or not another part of the program writes to that piece of memory.
 
so if i change to
void fraction::setnum(int numer)
{
*num = numer;
}
then there should be no memory leak?
because I should be changing the value at that memory address...
 
If num is allocated correctly, then yes. :P
 
Undefined behavior is like walking on a frozen pond. Sometimes it works sometimes it doesn't.
5
 
@chewbapoclypse Why is num a pointer?
 
9:37 PM
i have to make use of a copy constructor
 
This statement is not an answer to the question I have asked.
 
Let him shoot himself in the foot a few extra hundred times.
 
but i am not sure why to be honest, maybe i am confusing the requirements from a previous assignment
 
Remember: Feet are meant to be shot. C++ is just the tool to help you do that.
 
class gun() { };
class foot() { };
 
9:42 PM
Exactly. Let him experiment. He will learn.
 
There's a reason why lions push their cubs off cliffs.
 
Xeo
lol
@TonyTheLion You're a bad parent!
 
@Mysticial Because they don't want any competition?
 
because they don't want to spend energy raising other lions cubs
they don't kill their own cubs generally
 
That is a great metaphor for the project I have to work on.
 
9:44 PM
what, "Lions don't tend to kill their own cubs"?
 
@Xeo You've seen Fate Kaleid right?
 
Push the other project off the cliff so I can work on my own project.
 
Xeo
@Mysticial Nope. Read the first manga tho
 
I think the males dont give a f*** if its theirs or not
 
@Mysticial is there a way to tell if calling via . is faster than calling via -> when there is no vtable?
 
9:45 PM
@Xeo Did the manga have the scene where Luvia pushes Miyu out of the helicopter so she can learn to fly?
 
yes, but you're quite evidently an abject moron
 
i've asked today and was told to gcc -S but maybe it's known already
 
@iksemyonov . vs. -> is just a syntactic thing for pointers vs. references. They are the same.
 
if only I could reply to more than one person at once with the same message..
 
@Mysticial let me clarify, here . is for an object, not a reference
i.e., a variable of class type, not a ref to class type
 
9:48 PM
@Mysticial @Puppy doesn't work?
 
@iksemyonov I need a program that I type "man command -arg -arg2", and it just tells me what "arg" and "arg2" does. What does -S do?
 
@iksemyonov IOW, the object is on the stack in the local scope?
 
shows disassembly if memory serves
 
-S is for asm
 
Xeo
9:49 PM
@Mysticial Maaaayybe. Can't remember, sorry.
 
@Mysticial decode IOW while i'm searching
 
@iksemyonov what?
 
i mean, i'm not familiar with the acronym IOW
and, the object is meant to be a class member, both if it's a pointer or a class object
 
IOW = in other words
 
oh, ok
so, yeah, it's not exactly on the stack, it's auto
 
9:52 PM
If the entire object is owned by the local scope, the type of the object is known at compile-time regardless of whether it's polymorphic. So the compiler has enough information to skip the vtable indirection. But I can't guarantee that all compilers are able to do that.
Barring shit like conditional placement new onto some local buffer.
 
@sehe This is horrible and I am only 3 minutes in. How TF is it possible that the police does nothing with people on highways?
 
They don't want to start a war
 
@sehe Fuck that. They are established for the purpose of upholding the rules of their country.
If they do not do that, wtf are they good for?
 
Hurr durr. This is why you and me make would make bad cops. I'd get outraged and self righteous too.
 
@Mysticial if i read correctly, you're describing the case when there is a vtable, aren't you?
 
9:56 PM
@iksemyonov Correct.
 
in my case, there is none, it's just a matter of a direct cal vs a pointer call
 
@sehe Hehe, yeah. But if we were cops we would have a training to control ourselves. What I mean is that the officers above the ordinary cops are not doing their job to send units there.
 
but i wonder, if there's any difference in speed, and if gcc 6 can optimize that away, if required to
 
If the compiler knows the type, it doesn't need the vtable. It can just call the function directly. But last time I checked compilers are less than competent at devirtualization.
 
and without a vtable, i shouldn't even bother, right?
 
9:58 PM
The compiler knows the type if it was constructed in the same scope, but not if the object is passed in by pointer or reference. (unless it does global flow control analysis or something)
Without a vtable nothing matters.
 
ok, great
 
@wilx HOWEVER. There's no local solution than gradual escalation of violence. And that will just infuse the refugees with rage - and with some rights - so they'll start minor aggressions, a little arson here and there. That'll just mean the riot police will have to bring in the rubber bullets, but the people have nowhere to go. Out of options, they'll start actually killing, and then it's the end of the line: the police and army should be involved and refugees get killed on a daily basis.
Soon it's a full blown diplomatic crisis. Turkey gets involved. Putin gets involved. Assad grins and says "who's the bad guy now".
 
it means that: class Foo { void bar() {} }; then Foo f; f.bar() and Foo *pf; pf->bar() generate the same assembly?
 
I very much doubt "sending more units" is going to help in the short /or/ the long run. A real solution must be made.
 
@sehe Mohammar would grin too from the other shore together with Assad
 
10:00 PM
@sehe Minor aggression is what I see in the video. However, I agree that escalating too much might end up in a way you describe. But OTOH, if rules are not enforced equally for everyone, what are they good for?
 
Even if it means /peacefully/ deporting the lot.
@wilx They are enforced equally for all. Every person in crowds of desperado's is being treated this way out of lack of options.
 
@sehe If this is how the illegals/migrants want to behave, they should be locked up in a detention/segregation until their matter is dealt with by the bureaucracy.
 
Prisons: Free food and shelter.
 
The camp is that. Poor man's prison. But there's not enough facilities to handle it securely. And if they skimp on the facilities /but/ detain people there will be the diplomatic crisis on the horizon again.
 
@Nican Not prisons, detentions. :)
 
10:03 PM
@wilx The solution simply doesn't scale like the problem does.
 
@sehe Dunno. The problem is obviously, to me anyway, that so many people where let in without a good reason. I want to travel freely between EU countries even though I do that rarely. But I am not sure if it is worth it when I see a video like that. Seeing the video, I can why Brexiters voted for exit when somebody told them they would be better able control their borders (whether that is true or not is beside the point).
 
> "were let in"
Seems you have a rosy view of border control
 
@sehe Nah. Borders are enforceable. It just depends on how much force you want to employ.
 
You're arguing a point that wasn't being debated.
I observed something about your view of border control.
 
Somebody is spamming flags. Since I got the review privilege for chat flags, I have found like one or two justified, only.
 
10:10 PM
I don't see any flags
 
@sehe I got some blue circle notification about somebody saying something with "fuck".
 
Then it was, apparently, dealt with so swiftly that it never reached my browser. That, or it might be they actually put something in place to display flags only to a quorum of 10k+ users to reduce nuisance!
 
Xeo
"^\\({0}=\"(.*?)\",{1}=\"(.*?)\"\\)$"
fucking regex...
 
R"(^\({0}="(.*?)",{1}="(.*?)"\)$)"
 
@sehe Showed up here, but I figured if I ignored it, it might go away, and I was right.
 
Xeo
10:17 PM
C#
 
Weird. What's the string interpolation format doing there
 
Xeo
Ah, I'm formatting that pattern to insert some stuff
 
If that's being used to "format" regexen, you'd better surround it by escape guards
 
Xeo
?
Oh, @"^\({0}=""(.*?)"",{1}=""(.*?)""\)$" is better.
@sehe var Pattern = String.Format(@"^\({0}=""(.*?)"",{1}=""(.*?)""\)$", MapKeyName, MapValueName);
And pass it to a Regex afterwards
 
@Xeo @"^\((?q){0}(?-q)=""(.*?)"",(?q){1}(?-q)=""(.*?)""\)$" see regular-expressions.info/modifiers.html "Modifier Spans"
 
10:24 PM
Does anyone here know what Windows's criteria is for deciding that a file/drive is still in use and can't be ejected? Is it documented somewhere?
 
@sehe: Also, was it 100% men trying to get into the lorries?
 
it's documented in your face
 
@wilx It's actually unclear what the hell they are hoping for IYAM
 
Xeo
@sehe What. Also, I control MapKeyName and MapValueName.
 
Famous last words
 
10:26 PM
@Xeo What @sehe said. :D
 
Xeo
No, really. It's an addition to Unreal's build tool. You pass in what kinda map you're parsing (specifying key and value names). If somebody fucks up there and puts wrong stuff in, eh, their problem. They're also pretty much limited to what C++ allows as variable names.
It's a very narrow use-case.
 
Then why are we using friggin regexen
But ok. Your job, not mine :)
 
Xeo
I don't get the fuss. It seemed saner than manually parsing that stuff.
It's a pretty simple regex even. I just wasn't happy with the escape stuff, until I found how you escape double quotes in verbatim strings.
 
Friends don't let friends concatenate regexen :|
Well. Not with non-constant parts.
 
Xeo
I still don't get the problem, I'm afraid.
 
10:33 PM
If you want to solve a thing with RE, you should be using Perl.
 
@Xeo You do. You just rationalized it away.
5 mins ago, by sehe
But ok. Your job, not mine :)
 
Xeo
welp
 
I'd personally reverse the logic there. I "still don't get" the problem adding mode modifiers. vOv
If .NET didn't support them, that would be a different story.
 
Xeo
No clue what those actually are still. Does it treat everything inbetween as verbatim for matching?
And no idea if C# supports anything like that. I'd wager not, from what I've seen.
 
@Xeo Of course
@Xeo I linked you to the source of my docs. That's ~10 ~20 minutes ago. I'll admit I didn't actually test it.
Because I'm a poor boy and can't afford to install no .NET :)
> Modifier spans are supported by all regex flavors that allow you to use mode modifiers in the middle of the regular expression, and by those flavors only. These include the JGsoft engine, .NET, Java, Perl and PCRE, PHP, Delphi, and R.
 
Xeo
10:43 PM
Yep. Not ?q tho
Those listed there as inline characters seem to be the only supported ones.
 
That's sucky. I'm sorry to hear that. I was quite sure .NET had something. Maybe the Perl-ish syntax (I was actually looking for that: \Q....\E or so)
I think I've used it. Because I didn't grow pedantic overnight :)
@Xeo Well, obviously, "verbatim mode" is never going to be a RegexOption
 
Xeo
There's no other list for stuff like this, AFAICS vOv
 
@Xeo I just checked. You're right. That leaves msdn.microsoft.com/en-us/library/… Which in a way could be nicer with your format arguments
There's this list though msdn.microsoft.com/en-us/library/x044wc7s(v=vs.110).aspx which is more on point, but still confirms the non-existence of the feature
 
Xeo
Btw, here's a usage example: rextester.com/LODI69531
ParseMap is only called from other internal build tool code
And KeyName and ValueName are restricted to what counts as a valid C++ identifier (since that's what gets serialised to the Input)
 
It's ok :) I believe you already told me that. I was basically just vamping on "it doesn't hurt to be safe". But I won't quote my earlier quote again...
 
Xeo
10:57 PM
True, I guess.
 

« first day (2159 days earlier)      last day (2788 days later) »