« first day (3405 days earlier)      last day (1526 days later) » 

mr5
1:07 AM
121
A: Why does the difference between 30 March and 1 March 2020 erroneously give 28 days instead of 29?

AndreasThe problem is that because of Daylight Saving Time shift (on Sunday, March 8, 2020), there are 28 days and 23 hours between those dates. TimeUnit.DAYS.convert(...) truncates the result to 28 days. To see the problem (I'm in US Eastern time zone): SimpleDateFormat fmt = new SimpleDateFormat("dd...

Wtf is this
 
2:04 AM
Stupid Windows throttles network speed whenever video or audio is playing...
Set HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile\NetworkThrottlingIndex to ffffffff solved the stupid issue.
 
2:21 AM
Forgot to mention, even a notification sound can trigger network throttling...
 
mr5
3:05 AM
Regedit is a mess
 
3:21 AM
registry database corrupted
 
 
1 hour later…
mr5
4:29 AM
o/
> Contains text fields for email, password, first name, last name; and a Submit button.
Is this the right way to use semi colon?
 
@mr5 Wish i hadn't seen it.
 
Rob
5:12 AM
@mr5 No
 
0
Q: merge two lists of same type in c#

Ram SinghI have two lists with same type as below: public class ParentTutorCountModel { /// <summary> /// Gets or sets Location /// </summary> public string Location { get; set; } /// <summary> /// Gets or sets Location /// </summary> public int ParentCount { get; set; } ...

 
mr5
@Rob I would like the "text field" property to be applied on email, password, first name, and last name without breaking the list. But since Submit is a button, it should not apply to it. Does that make sense? :D
 
Rob
If you remove the semi colon it makes sense already
Sure, there can be ambiguity that there's a text field for a submit button, but that's nonsensical, and 99% of people will understand it without problem
 
@Rob, could you please provide some code how you are thinking?
 
Rob
Something like... ParentCountResult.Concat(TutorCountResult).GroupBy(r => r.Location).Select(r => new { Location = r.Key, TutorCount = r.Sum(rr => rr.TutorCount), ParentCount = r.Sum(rr => rr.ParentCount) })
 
mr5
5:22 AM
@Rob it's amazing how our brain interpret it removing the non-sensical details. If I would make a program to parse this sentence, it will surely fail.
 
user12870752
Hello all, can someone please guide me about my Linq query?
 
@Rob thanks it worked.
could you please post this as answer so that i can accept it as correct answer
 
Rob
Haven't really got the time to craft a proper answer; you're welcome to self-answer it with your final solution (and also add an explanation, if you can) using the above code
 
sure
 
user12870752
Hi Rob, can you please help me with a Linq query? I'll be very greatful.
 
Rob
5:28 AM
Just ask the question, if someone's around they may help
I'm at work so I can't guarantee an answer
 
user12870752
Ok, thanks...
 
mr5
lol @Rob now that you flex your knowledge with Queries, people here will remember you from now on =P
 
Rob
Happy to answer questions here when I can, but I can't promise to do so :D
Hence the suggestion just to ask here anyway, I might have time, and if not someone else might
 
user12870752
I want to get students who fulfill the following criteria in a WPF application-

1) Are "passed" the examination

2) If a group-

a) Contains both failed + passed students- I should get *all* the "passed" students in that group;

b) Contains only "passed" students- In this case, I should get all "passed" students except first "passed" student in that group

3) If a group contains only one "passed" student, that student should be omitted (Example: Group 2)

Original grouping should be preserved
 
5:38 AM
yo yo yo
 
Rob
students
	.GroupBy(s => s.GroupId)
	.Select(g => new {
		Students = g,
		NumPassed = g.Count(gg => gg.Status == "Passed"),
		NumFailed = g.Count(gg => gg.Status == "Failed"),
	})
	.SelectMany(g =>
		g.Students.Where(gg => gg.Status == "Passed")
		.Skip(g.NumFailed == 0 || g.NumPassed == 1 ? 1 : 0)
	);
@YoKidYo
Very strange requirement however..
 
beautiful
 
Ben Popper on February 11, 2020
Sara returns from Miami. The crew chats about Monoliths vs microservices and the lessons we’ve learned as manager and ICs.
 
10 mins ago, by mr5
lol @Rob now that you flex your knowledge with Queries, people here will remember you from now on =P
55 secs ago, by CupOfJava
beautiful
ceh
 
user12870752
Thank you so much Rob... Lemme try and execute this query
 
5:41 AM
other peoples are helping too, but people dont thank you at those people, because not a moderator
 
I agree with Rob requirement B is pretty weird but I'm sure you have a reason for it
 
please remember, thanks at who helps you too, no matter he is moderator
 
wait why is it A), B), 3)
lol
 
Rob
Hmm, I'm not sure what "Original grouping should be preserved" means, but if that means original order, my query isn't guaranteed to do that. You'll need to add an extra .Select()at the very start to grab the indexes, then a OrderBy() at the end to sort it on that index
 
user12870752
Sure
 
Rob
5:46 AM
students
	.Select((s, i) => new { Student = s, Index = i})
	.GroupBy(s => s.Student.GroupId)
	.Select(g => new {
		Students = g,
		NumPassed = g.Count(gg => gg.Student.Status == "Passed"),
		NumFailed = g.Count(gg => gg.Student.Status == "Failed"),
	})
	.SelectMany(g =>
		g.Students.Where(gg => gg.Student.Status == "Passed")
		.Skip(g.NumFailed == 0 || g.NumPassed == 1 ? 1 : 0)
	)
	.OrderBy(g => g.Index)
	.Select(g => g.Student);
Preserves the original order, but super ugly
Oh well
 
user12870752
Ok, lemme try
 
user12870752
Thanks a ton! It's working
 
Rob
No problem
 
6:02 AM
@Rob Hey can you help me out. I have this whole project, the problem is that it hasn't been started yet. It's meant to predict what price a stock will be tomorrow. So we can meet up in like a week when you've solved it. Thanks.
XD
 
Rob
@CupOfJava const stockPriceTomorrow = () => { price: '$5.28', confidenceLevel: 0 }
 
Wow, that's so cool, your "project" and I share the same confidence level.
 
1488867 messages/s
1494220 messages/s
1502107 messages/s
1500861 messages/s
1494531 messages/s
1482230 messages/s
Still too slow for me...
Seems like userspace networking is required to make this thing go faster, like DPDK
 
6:57 AM
0
Q: how to render a partial view from controller in asp.net core

Ram SinghI've action in controller to load data for Partial view as below: public async Task<IActionResult> ParentTutorCountByLocation() { var result = await this.dashboardService.GetParentTutorCountPerLocation(); return this.PartialView("Dashboard/ParentTutorCountByLocation", result)...

 
7:20 AM
yo
 
!~>()=>{
return WonderWillLocalMethodAllowedInLambda();
string WonderWillLocalMethodAllowedInLambda()=>"IronMan";
}
!=>"IronMan"
 
that doesn't make sense, why are you returning something that evaluates later
 
hmm? well it make sense. sometime local method is useful
wait. nothing is evaluates later
 
you return before declaring the string method
 
7:30 AM
thats it, because it was local method..
 
Find local methods in your area!
 
mr5
=P
 
404
 
mr5
I think there's no deferred evaluation there.
 
actually I only used few times, and just because Im lazy to refactoring nested lambda
 
mr5
7:32 AM
so which one is the real hector now
 
C# looks more and more like JS every day
You can do all kinds of wicket shit, and that's scary
 
mr5
I use a lot of those
 
Hector with named Hector with signboard is real Hector
Hector with green lion is depressed one
 
and me, not being able to load the avatar icons is just stuck with not knowing which is which
 
7:36 AM
Java sucks
does that answer your question?
 
what are your feelings on Kotlin?
 
Fuck Kotlin
 
And if you happened to have a language of your own, say, Wietlang..
 
Are you trying to give me a stroke or something?
 
sounds like something Wietlol would say..
 
7:43 AM
why your avatar did not load
 
work proxy has some lame filtering strategy
it doesn't like images from certain image hosting sites
 
*.imgur.com blocked?
that make sense
 
well definitely i.stack.imgur.com
but it'll let through some oddly enough
like your avatar won't load for me
 
mr5
ugh
This Xcode is making my life hard
 
How romantic
 
7:52 AM
$("img").each(function(ignore, e) {
    var $e = $(e);
    if ($e.attr("src") && $e.attr("src").startsWith("https://i.stack.imgur")) {
        $e.attr("src", "https://web.archive.org/web/" + $e.attr("src"));
    }
});
paste this into page's console, did it worked?
 
nope
 
mr5
 
nice try though
strangely the web.archive.org site loads for me
 
> var $e = $(e);
Thanks JAWWASKREET
 
hehe
 
mr5
7:56 AM
> var jQuerized = jQuery(e);
 
I don't get why jQuery attempts to wrap everything in a jQuery object, and then in such calls like .each, it doesn't
if I'm going to use jQuery, I'm definitely using it 100%
 
mr5
Any idea why my app crashed?
Hint: Xcode sucks
 
GoOoOoOoOoOoOoOoOoOoOoOd Mornin' pleberinos!
 
It's not that good.
That's like good mythical morning level good, and I'm not at that level.
 
mr5
erratum: it's not my app =P
I won't even try creating apps in Xcode anymore since I discover Xamarin.iOS
@Squirrelintraining what about those neglecterrorinos?
!!kieran 2
Sep 17 '18 at 10:46, by Squirrel in training
GoOoOoOoOoOoOoOoOoOoOoOd Mornin' neglecterinos!
Jack, kieran 2
 
8:05 AM
....Come Again?
 
mr5
Jack, kieran
 
Feb 27 '17 at 16:02, by Kieran
Thank you for confirming im an idiot c:
 
@mr5 Xamarin.iOS uses XCode tooling to build and debug apps, so you're still using XCode in a way ;-P
 
mr5
@RoelvanUden yeah but what I hate the most is the interface builder
 
@mr5 why isthere a spae between kieran and 2?
@mr5 they pop in every now and then
 
mr5
8:09 AM
bekos
 
@mr5 Well, XCode is a horror.
 
mr5
iz very horror
 
Jack, kieran2
 
@nyconing nyconnig know the shit
 
8:31 AM
I smell JavaScripto...
 
hey
TempData.Keep["reftoken"] = reftoken;
        TempData["reftoken"] = reftoken;
 
mr5
why do you guys still using short names?
name it refreshToken
 
referral token
I am passing value from Controller in TempData["reftoken"] = reftoken; to view
but it gets lost when i page reload
 
Why you no use a model?
 
@markharringson That's... what happens with TempData.
 
8:35 AM
@RoelvanUden whats is the best way in my case
 
@markharringson Good question. What is your case? What are you trying to do?
 
I am using aspnet core mvc
 
mr5
@markharringson see? it gets confusing when you use short names.
anyway, that's just nitpicking. don't mind me
 
 public async Task OnGetAsync(string reftoken, string returnUrl = null)
        {

            ReturnUrl = returnUrl;
            TempData["reftoken"] = reftoken;
           // HttpContext.Session.SetString("reftoken", reftoken);
            ExternalLogins = (await _signInManager.GetExternalAuthenticationSchemesAsync()).ToList();
        }
 
@mr5 refactorToken
or refineryToken
 
8:37 AM
In my View I have
 
mr5
@HéctorÁlvarez why not refrigeratorToken?
 
  <input asp-for="Input.RefToken" class="form-control" value="@TempData["reftoken"]" />


            <button type="submit" class="btn btn-primary">Register </button>
 
@mr5 reflectionToken
 
@markharringson Don't show your code. Tell us what it is you're trying to achieve. What is your goal?
 
mr5
@HéctorÁlvarez resurrectionToken
 
8:39 AM
@RoelvanUden I am trying to pass some temporary value view
 
mr5
now it sounds interesting
 
so it wont get lost when i reload the view again
 
@markharringson I assume you want to persist this value, so maybe you are interested in localStorage or sessionStorage.
@mr5 You win
 
reflowToken
 
Yes exaclty
 
8:40 AM
@markharringson That makes no sense. When you're passing data from an action to a view, you can use a view model for that. Then the view renders it, and it's done. Why and where do you expect this value to still exist?
 
mr5
@HéctorÁlvarez ha! loser!
 
@RoelvanUden I think he wants to make a token that lasts X time, and that's all.
like jwt for example
 
<input asp-for=
 
but referral
 
Yeah I don't get the 're-load' bit what's that about, why you reloading the view????
 
8:41 AM
If so, set a cookie.
 
@RoelvanUden That value i am passing is from URL to register page with referrall code genrated by registered user
 
cookies get stale
 
mr5
cookies are sessions right?
 
No, cookies are stored in the browser and are sent on each page hit.
 
cookies are so 2005
 
8:42 AM
They have no expiration unless you want them to.
 
he needs some milk
 
mr5
@RoelvanUden yes, that is session
 
how to use session
 
ye cookies are persistent storage from the age of brontosaurus.
 
My class inhertits from pagemodel and i cant use session
 
8:43 AM
@mr5 Incorrect. Session values are stored on the server and are deleted after a certain amount of time to preserve memory/disk space. A session is just identified by a cookie. It's a different mechanism than using a cookie to authenticate on each page hit.
@HéctorÁlvarez You have no idea how the internet works do you? :-D
 
let the client handle the token IMO
 
Use Redis, it is not so 2005 :D
 
is someone talking here from office chair
:-D
 
I am in office chair, yes
 
RIP cookies, RIP all of those
 
8:45 AM
why dont u Get back to work M.Doe :-D
@HéctorÁlvarez Why u hate cookies
 
my work is searching things on stack overflow
I am working
 
Cookies make you fat
 
What is the salary of jr .NEt core developer?
 
@markharringson Ok, let's do that.
 
yo yo good morning all ! o/
 
8:46 AM
@markharringson Depends on your region, negotiation skills, and technical skills.
 
@RoelvanUden Yes lets hit
 
DOn't tell him Roel
you should be working now
 
Oh yes you're right
Thank you for reminding me
I can't answer your questions; I should be working.
6
 
@RoelvanUden Help
@RoelvanUden what are u working on?
 
@markharringson they need server backup. Usually this kind of stuff can be handled by the client 100% and the only server-side operation you need can be performed on registration by checking the referral
anyway referral tokens are usually passed by GET
because literally nobody cares about what referral ID you got, it's not a bank account
 
8:48 AM
@markharringson He's an Agent of Secret Stuff
So he aint telling ya!
 
Uhm
Why would the client handle that
 
@HéctorÁlvarez JEZUS CHRIST MAN
What the fuck hector
 
that's a big no no
 
Don't ever design systems I use
 
Your authentication should be handled server side
 
8:49 AM
YES
I am using IDENITY
 
for example using a jwt token that you then save in a cookie / localstorage
 
I never said anything about authentication
 
Too make thing looks modern, we should use storage API, WebSocket, Redis for token exchange...
 
Also yeah I usually store cookies in localStorage, or sessionStorage
 
8:50 AM
just run ur string through DES, and do it on the client at runtime
that'll do it
 
The JWT token is cryptographic signed by the server and stored as either a cookie for traditional webpages (request/response) or in local storage for SPAs (sent as Token header on APIs). Each page hit the server decrypts and validates the token, and uses that user context. The server is not aware of sessions or anything.
 
but you never request to the server until you want to log in. At most some async call to validate fields
 
Cool kid says: never do authentication shit client side
Listen to cool kid
 
Nobody said anything about auth client side
 
HECTOR
 
8:51 AM
YES
 
I won't have u talking BACK to me young man
 
Also, never ever ever ever send sensitive info in the http path
 
Just accept the truth
 
@RoelvanUden a referral code is not sensitive information
 
you can initiated a coveration from my problem and no one is giving shit
 
8:52 AM
Mark
 
what would happen if your referral code is shown on the URL, someone will edit it to... avoid giving their friend a bonus?
 
Noone is obliged to
 
Why make things so complicated? just use http://username@password@domain.com for authentication :D
 
please read the rules
 
@HéctorÁlvarez Depends on the type of referral code. Might have been a referral of an external system auth ;-D
 
@RoelvanUden good point.
 
localhost:5001/identity/account/register?reftoken=6ddfd6c2-247b-44bf-9560-c6988e365072
 
@markharringson what kind of referral token are we talking about
 
mark
 
this is my ref token
 
8:54 AM
did you just post a url to your localhost
 
right, but what does reftoken mean for your app
 
GUID/UUID again
 
is it to have a friend score a referral point?
 
8:54 AM
yes
 
or is it a secret that must be kept from people
 
its like refer and earn
 
ok then that's completely fine
 
Hey the real hector is back
 
no its not secret
 
8:55 AM
What if somebody change the token value manually?
 
doesn't matter at all because all that should do is fill in a field in a form
 
if someone change that no reward point for the one who shared ref code
yes that is loaded in form the reftoken vALUE
but it gets lost after page reload
 
well if you pass it by get and reload the page it should be there
however if you redirect somewhere else, it will be lost
redirect != reload
 
I'm the kind of user who remove referral code all the time :P
 
mr5
@RoelvanUden no
 
8:57 AM
@mr5 No?
 
mr5
yes
 
@HéctorÁlvarez : the value is same if i reload the page
but after server side validation if some inputs are invalid it gets lost
 
that's becuase you redirected
your new action points to a different URL
one without the reftoken part
 
yes exactly
 
right so you have to read the token, and plug it again at the end
 
8:59 AM
@HéctorÁlvarez : How can
 
Simple solution, use JS to add token to cookies
 

« first day (3405 days earlier)      last day (1526 days later) »