« first day (3995 days earlier)      last day (936 days later) » 
02:00 - 12:0012:00 - 23:00

12:01 PM
Pretty sure what you need to do is pass identity data from the client to the server.
Which you could use a JWT for.
 
@Squirrelkiller it's right
 
Or like, a guid and roll authentication/authorization yourself
 
@mr5 yes
 
mr5
@Squirrelkiller oic
 
I built an application with this architecture too and I just...create a guid on each login and the client uses that to ID themselves.
 
12:03 PM
oh
@Squirrelkiller should application be built with this architecture?
 
It is one possibility, it's usually done like this because it lets you separate things from each other (for example, the business layer and repository don't have to know what HTTP is. Business just does business, repo just does DB, controller just does HTTP).
Look at the WebAPI project, for example at the AccountController. Its method ChangeRank checks the token first.
The service behind that doesn't know where the token comes from
 
so i'm doing good?
 
if you wanna help me to develop it i'd appreciate it even if it's complete you could be added to my github project
for the record now i'm fighting with vs2019 it often freezes and not respond forcing me to kill the its task and reopen it
 
Thanks but I've got enough on my plate, third semester is about to start :)
 
12:08 PM
it's frustrating
 
mr5
orrr
use IdentityServer
 
Damn
Nah IdentityServer is about to become paid software
 
mr5
they have separated it on their new company though
Duendo?
oh Duende
IS have templates for auth + login page
 
Separated into what?
 
mr5
I think IS is still free?
 
12:12 PM
Ah so separated into free IdentityServer and paid Duende?
 
mr5
yeah
 
mr5
with the current size developers that is relying on IS, they have decided to create a separate fork and monetize it. Make sense since they are the ones who maintains it for free.
 
Definitely
 
mr5
gdi. I'm always missing some words in my sentence
 
12:18 PM
Why many words when few words work
 
mr5
 
ehm @Squirrelkiller
i'm using this using
 
mr5
tbh, it took me months to partially understand how IdentityServer works
 
using System.Web.HttpContext.Current;
 
@mr5 I still don't get it, that's why I rolled my own lol
@Riccardo I didn't know that is something that works
 
12:19 PM
in my mvc controller and the error says the type name current does not exist in httpcontext
i need it to assign the userid to the current userid
 
Current isn't a namespace I think
You have to figure it out using postman first
 
mr5
@Squirrelkiller yeah I was about to resort to that approach as well, but since I have no work yet at that time, I persisted on learning that shit :D
 
Nice
Would you kindly make an example project with a Blazor WASM client and WebAPI backend that just pulls the same weatherforecast stuff as the minimal example by microsoft, but also includes IDserv so I can learn? Cuz I don't know how else I'm gonna learn that shit.
 
@Squirrelkiller it works on postman
it doesn't here
EntryUserId = HttpContext.Current.User.Identity.GetUserId()
in mvc controller it says current is not defined
i tried this using
 
mr5
@Squirrelkiller too much abstraction :D
 
12:24 PM
using System.Web;
using Microsoft.AspNet.Identity;
 
How does postman transmit identity data to the application?
Where does the user id come from in that case?
 
i authorized and authenticated the web api using jwt
generating a token in web api project
 
So Postman sends a JWT to the WebAPI?
 
yes but i disabled it to test the other auth on ui
 
mr5
@Squirrelkiller one thing I think that is overdone by IDserv is their login page. I would say, you can skip that part and just focus on making the auth server. I also realize you can just use an existing auth server for your app since they are all functioning the same way and it's pretty much standardized.
 
12:29 PM
i don't wanna confuse you here i enabled the jwt only to see if it worked on postman
i'm not using jwt client side but another authentication
using identity
 
As authorization header like Bearer {{token}}?
Because then your client has to set that header in the httpclient
Like client.DefaultHeaders.Authorization = new AuthorizationHeaderValue("Bearer" token); or something
 
yeah but i'm not using jwt c
 
Then how do you want to transmit identity information to the backend?
The identity information needs to be somewhere in the Http request
 
i do it this way
 
There is less magic in dotnet than you think
That is why I told you to get it working in postman
If it works in postman with a JWT, you have to use JWT
 
12:33 PM
AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie
 
If you want to do it without JWT, you have to make it work in postman without JWT
 
client side i'm using asp net identity to auth the user but not the api
 
The API doesn't know that
The API only knows what you send within the http request
 
in fact authentication happesn client side
 
You...are 100% sure you can trust your users?
 
12:34 PM
in order to access admin controller you must be auth and authorized
this task is currently happening client side
for the sake of my simplicity
 
Because you can just transmit the user id directly, but then I can do that too and just send your user id and pretend I'm you.
 
i will use jwt in the future i tested something and it worked
you can't do what you say
you have to intercept my userid i'm using https
well forget about this for a minute
 
I'll just start at 0 and count up
:D
 
i send the userid to the server using http current context getuserid and set this to the userid of the model property
 
Anyway, if you're sure it works this way, just set a header value like "x-userid": user_id
 
12:36 PM
we are in mvc controller
EntryUserId = HttpContext.Current.User.Identity.GetUserId()
where entryuserid is a property of the object edit viewmodel
if i remove current the error is gone
will it work without current?
 
mr5
oh boi
 
No idea how your client works, so I don't know whether or not that is the correct way of retrieving the user id.
 
my client relies on cookie authentication
 
@mr5 Let him, maybe he wants to do opendata :D
 
mr5
if you want to avoid temporarily the complexity of this auth, maybe you can roll your own simple login mechanism where the token is generated on the server.
 
12:39 PM
AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
 
mr5
that way, the squirrels wouldn't be able to breach in your security :D
at least for now
 
@Squirrelkiller this is how i use the auth client side
i have a file called startupauth.cs where i defined that
and to get the userid i need to use httpcontext.current.user.identity.getuserid()
 
mr5
@Riccardo how do you fill up the current user?
 
@mr5 this way
EntryUserId = HttpContext.Current.User.Identity.GetUserId()
where entryuserid is a property of the object editviewmodel of the frontend
 
mr5
but from what I understood, you are saying that HttpContext.Current can be null
 
12:42 PM
then i'd like to call the api passing the entryuserid value to api controller
@mr5 i get another error in my mvc controller if i try to use current it says httpcontext base does not have a definition for current
for fuck sake
i'm angry with vs
 
So...how about that threading in the client
 
@Squirrelkiller what if i remove current
 
No idea
 
mr5
xD
 
and just httpcontext.user.identity.getuserid
 
mr5
12:44 PM
I think HttpContext would exist only for the current request
@Riccardo check if both classes inherited from the same base class
 
how can i do that?
 
mr5
ctrl + click the HttpContext.Current
see where it is define
 
Or F12
 
i had to use it this way!!!
System.Web.HttpContext.Current.User.Identity.GetUserId()
this ways it works in the mvc controller
 
mr5
on the one where Current doesn't exist, ctrl + click the HttpContext
 
12:47 PM
there had to be a conflict with something else
 
mr5
iirc, it is not a static function?
oh Current is
 
You call the context instance of your controller though
Explains the conflict lol
Without full qualification, the field was called instead of the class.
 
you're trying to reproduce my error?
what a honour
 
mr5
I happen to have a similar project :)
but I'm using IS in this case though so I haven't touched the auth + login part
 
12:52 PM
can i add you to my github project?
i would be honored
 
mr5
nah
 
thanks a lot ahah
 
mr5
I'm too demotivated to code
 
lol damn mr5, new job got to you?
 
mr5
I'm still on my turnover period. New work will start at Oct 11 :)
my current situation rn makes me very demotivated
 
12:54 PM
Ah I see. 11th Oct is also the first day of my third semester :)
 
mr5
oh
 
Shouldn't your current situation be something like "finish this up do all the documentation tell the colleagues what fuck up to expect and then run away without looking back"?
 
mr5
a trimester school
 
where are you guys from?
i'm from Roma Italia
 
Nah standard bachelors that runs for 7 semesters, started last year.
 
mr5
12:55 PM
@Squirrelkiller nah, my current situation is "fix this shit ASAP"
 
I'm from germany :)
@mr5 Will it be your problem after 11th Oct?
 
mr5
I'm from somewhere shithole country :)
 
@mr5 huh? that is?
 
mr5
@Squirrelkiller I'm not too sure. Hopefully not lol.
 
Pretty sure it's still a beautiful country, although I have to admit I have never been there :)
 
mr5
12:57 PM
@Riccardo ph
 
@mr5 ???
 
mr5
it's the country code lol
 
@Squirrelkiller funny thing i was testing out the front end app without removing the exception for the null context ahah
 
Haha lol
 
@mr5 don't know such country code i'm sorry
@Squirrelkiller it was always the damn context and i was more and more angry
 
mr5
12:59 PM
izz ok. nothing to worry not knowing what that shithole is :D
punch the monitor now
 
Only if someone else pays for the punched monitor though
 
i won't you guys fixed my working day
thank you so much
if i were the boss of my company i would hire you immediately
 
Or like, pay a Filipino 200$ a month to do your job so you don't need the monitor
 
mr5
btw, how did you end up with this mess with your login though? A simple diagram before code would make this easier to grasp.
 
what do you mean?
 
1:01 PM
Haha thanks, this would indeed be a whole new level of recruiter contact :D
 
mr5
@Squirrelkiller this ^
 
You guys should petition the international community to spell your country with F, it just makes more sense that way
 
mr5
wut
 
The F is because of the original spelling, isn't it?
So why is it ph in the country name
 
mr5
it's the "americanized" spelling, yeah
It's actually Philippines
 
1:03 PM
1 min ago, by Squirrelkiller
You guys should petition the international community to spell your country with F, it just makes more sense that way
 
mr5
Filipino is what we call ourselves
I hate being one too
In our native vocab, F doesn't exist
 
But the people are called Filipinos everywhere. Just because we're another country, we don't call you Philipinos.
 
mr5
ohh
 
i work at ibm i'd hire you now
only if i could
plus i'm working from home now wearing my pyjama
 
mr5
yeah
 
1:05 PM
Lol nice
 
mr5
every dev I know is working from home too
it's like the standard nowadays
 
it's the heaven nowadays
 
mr5
but I'm way less productive now
This would be a good alternative to the project for my next company
 
I'm more productive I think, as my way to the coffee maker is way shorter now and I don't randomly talk to colleagues on the way^^
 
mr5
I would be in charge of maintaining/managing the iOS/Android with webviews on it.
 
1:09 PM
i hope this remote working or smart working or whatever will last the longer it can
 
I think it will
Employees realized how great it is, that knowledge isn't easy to overpower by companies now.
 
i'm scared our public agencies minister is against the remote or smart working here in italy
 
mr5
why though
why would they meddle with it
 
Because there are also people who exploit it
 
because italy is an old ass country
and brunetta should resign immediately after his awful statement
@mr5 @Squirrelkiller i'm going to have a lunch see you here later have a nice dinner or lunch depending on the time zone you squirrel are german so have a nice lunch and tell me your city i'm curious by the way thanks for everything see you later here
 
1:18 PM
I'm in Hamburg, no Idea how you can have lunch so late but have a nice lunch :D
 
[Hans1984] why not
[Hans1984] im having lunch at 5 to 6pm and dinner at 10pm
[Hans1984] breakfast around 11am
 
Because as developers we don't usually are shift workers :P
 
[Hans1984] 😉
[Hans1984] well it used te be different back when I wasnt freelancing at home
 
mr5
1:34 PM
you guys have lunch?
 
Every hour
 
mr5
lol
it seems a lot of Germans here are doing the same
So tell me, @Squirrel.98, are you also a German?
 
Definitely not doing the same lol, I fell like Hans could lift me with one arm^^
 
mr5
who is bigger, Hans or SiT?
 
@mr5 Latvian
Speak Ruski
& English
 
1:39 PM
@mr5 That is really hard to say as SiT is a pretty big guy and I can confirm he can lift me with one arm :D
 
mr5
@Squirrel.98 Ruski? Russian?
 
mr5
@Squirrelkiller then we really need a sumo match :D
@Squirrel.98 my account in dotka is named cykachu :D
 
So, not only have I now received any close votes on my SO question, it was also ignored completely lol
 
1:42 PM
Maybe I should edit in some spelling mistake or something
 
Anyone know how to do this in SQL: Select Where time is after 13:00
 
>
Ah like, time on any date?
a SQL datetime is comparable
 
mr5
include also the timezone
 
Any date yes
 
Fuck timezones just use UTC
 
1:45 PM
British Summer Time? :D
 
The fucking audacity
 
bro that's what it says on google
 
They already have UTC+0, just be happy with that :D
 
Think it's UTC
:D
 
mr5
I would guess British TZ is UTC +0100
 
1:47 PM
Any date, just any time after 13:00
 
I mean, the G in GMT stands for Greenwich, which is in London
 
London*
Greenwich*
Capital letters for places
;)
 
mr5
Greenwich Pizza
 
Only if Pizza is a name though
 
1:48 PM
Meat Feast
Pizza
Got it
WHERE HOUR(time) = 13;
 
mr5
I think you can use the >= operator
and I also think you need to include the tz
oh nvm
if you assume the parser already handles the datetime normalization, then no need to include tz
 
No I don't need to :)
 
datetimes in databases are a nightmare once you add timezones
and most databases dont give you full support for all the requirements
 
mr5
then make it a string
and delegate the interpretation in the parser :D
 
strings are even worse
 
mr5
2:00 PM
yeah for comparison
thankfully, there is LINQ
 
even ISO doesnt give you the full support
 
mr5
so there is no need to write raw string queries
 
considering you need to have Instant, ZonedDateTime and OffsetDateTime
and often, Instant is just considered OffsetDateTime on UTC and people forget about ZonedDateTime
 
mr5
miss me with that Java shit
 
@mr5 except that my linq queries can not generate the sql query like 25% of the time
not even mentioning the duplication everywhere
 
mr5
2:02 PM
You would spend a ridiculous amount of time learning about date&time in Java
 
not really
I spent a day
 
mr5
cuz you know Kotlin already
 
I got the general gist and can work with it perfectly fine
 
mr5
Jun 2 at 10:49, by mr5
LocalDate
LocalDateTime
ZonedDateTime
Instant
Calendar
GregorianCalendar
Date
 
iirc, I learned java.time api before kotlin
ew, "Date" and "Calendar"
 
mr5
2:03 PM
they overcomplicate it imo
 
not really
you overcomplicate it
generally speaking, you are fine when you use Instant in many cases
 
Never expected you to say that lol
 
why so?
 
0
Q: Database scheme for re-testing records

Squirrel.98Goal Monitor records of temperatures for each room, daily. What I have created so far Firstly, this table shows the rooms and their minimum & maximum values of the temperatures they should meet. CREATE TABLE `Rooms` ( Id INT NOT NULL PRIMARY KEY auto_increment, RoomDescription VARCHAR(30)...

 
mr5
I think only Java (Kotlin) and C++ has this overly abstracted date & time built in their framework
 
2:05 PM
If anybody can help, would appreciate it.
 
there is NodaTime
:)
 
mr5
right
I'm just exaggerating cuz I don't deal with date & time too much xD
So how is Duration any better / different than TimeSpan?
 
its fine
Duration is like the equivalent
Period is where the magic starts :D
 
2:57 PM
@Squirrel.98 effectively i had lunch very late ahah
 
3:12 PM
:)
2
 
 
1 hour later…
4:13 PM
how does this make sense?
 
4:32 PM
How bad is subscribing to an event in infinite timer (every minute), how to measure or benchmark this, should I watch RAM, processor..?
 
5:21 PM
@SebastianL why wouldnt' you do [0] instead of ElementAt? I have never used that for an index search
 
5:41 PM
@juanvan it's an IEnumerable, but that shouldn't matter, or should it?
 
6:32 PM
@SebastianL what does your object look like? is it a string? or a T?
If it's a T is T not Null?
 
[Captain Obvious] I like how you're both in the discord because the bot is tagging you both every time
[juanvan] I did tag him in 2 posts, just to let him know I was there since it's been so long
 
7:07 PM
[SebastianL] 😄
[SebastianL] it's an IEnumerable<T> where T is not null, but even if it where null, it shouldn't throw an ArgumentOutOfRangeException. Anyway I think this is because the IEnumerable<T> is being modified in two different thread at the exact same time
 
 
4 hours later…
user16826598
10:52 PM
Is it possible to display notifications in C# on a Chromebook?
 
user16826598
using something like dotnetfiddle.net or something
 
02:00 - 12:0012:00 - 23:00

« first day (3995 days earlier)      last day (936 days later) »