« first day (3259 days earlier)      last day (1683 days later) » 

3:00 PM
1 message moved to Trash
That's where that belongs
 
I created a new table in the database and added it to the edmx file, but the code isn't recognizing it. This is the first time I've tried adding a new table in this (pre-existing) project.
I cleaned and rebuilt the project, but still nothing.
 
3:20 PM
I just realized it wasn't automatically making Entity classes so I had it make a new one for the table, and now it lost the Entities class.
 
so... if I were to want a linux laptop... do I just buy a windows laptop and dismantle windows from it?
 
buy a laptop
wipe it
install linux
 
anything I have to keep in mind?
 
3:38 PM
hang on
dogs are class man
 
@wietlol not all laptops support Linux
unless you know how to get around the BIOS
 
@Harry some are
some aren't
same with cats i guess
 
3:55 PM
I imagine a Mac laptop would be a safer bet.
brb need to shower after saying that
 
@AlRey and how do I check if it supports linux?
for example, on MSI P75 9SE-474NL
(just random example, not going to buy that... at least... not by myself :D )
MSI P75 9SF-472NL this is more my class
 
4:18 PM
Check me on this, an EDMX file should be in a project all by itself, right?
And anything that accesses it should access it through that project?
 
5:11 PM
when you're struggling with a single thing for hours and then a fix you placed the last minute before lunch actually fixes everything
 
Trying to make a parser for my universities timetable page but I'm having some trouble.
Currently I'm using selenium to log in and then I attempt to parse a single column in the timetable. I can get a column but I can't seem to get anything inside the column
Each column has an ID like "day3" for Tuesday (sunday is 1) and I get a column like this#
                column=driver.FindElement(By.Id("day" + (int)today));
and now I'm trying to get the stuff inside the column. Here's an image of the html source imgur.com/a/pZndy7n
If it's of any help, my university seems to use mytimetable by Eveoh
 
5:34 PM
im trying to get wc-time via classname but it doesn't seem to work
            IWebElement columnInner = column.FindElement(By.ClassName("wc-time"));
it's null no matter what i do
 
 
user47589
6:12 PM
I want one moon please.
 
user47589
Fine, I'll take my moon business elsewhere.
 
Hi all
Can anyone point me to some sample code for Microservices authentication using JWT
I got the code to generate a JWT token but how will other services validate the token?
 
It comes with an owl, package deal.
 
user47589
I don't need an owl. I come from a long line of proud owl exterminators.
 
user10864482
does it come with the scar too?
 
user47589
6:26 PM
A long straight line. No zig zags, and no curving if you ignore 1972s owl crisis.
 
user10864482
https://docs.microsoft.com/en-us/dotnet/architecture/microservices/secure-net-microservices-web-applications/
https://www.red-gate.com/simple-talk/dotnet/net-development/jwt-authentication-microservices-net/
 
user10864482
@SamyS.Rathore
 
user10864482
@Feeds good one hehe
 
Thanks pony
is it possible to do without Identity service or any other services like oAuth or OpenID
??
 
user10864482
@SamyS.Rathore why would you want to do that? Do you already have your own implementation?
 
6:35 PM
@humanpony yes kind of
 
user47589
@SamyS.Rathore security is hard. It's generally suggested that you don't try to roll your own.
 
user10864482
@SamyS.Rathore can't see image, sorry
 
we are going for an architecture like above
 
user10864482
// Add IdentityServer services
services.AddSingleton<IClientStore, CustomClientStore>();
services.AddIdentityServer()
    .AddSigningCredential("CN=sts")
    .AddInMemoryApiResources(MyApiResourceProvider.GetAllResources())
    .AddAspNetIdentity<ApplicationUser>();
 
user10864482
6:36 PM
with the above code you could implement your own custom identity store, sort of
 
I have a service that issues JWTs
I can't figure how the other resource services can validate the token
 
user10864482
well, is it a identity store? because otherwise there is no control. jwt is just a way to express a identifier / password
 
not an identity store, it just validates user creds against a database and issues a token
 
user10864482
 
is there a collection type that allows like a coordinate system, but doesn't require the key to be unique?
 
6:39 PM
@Tiffany I'm sorry I don't quite get what you asked,
 
Add method on List doesn't allow a second argument, Dictionary requires key to be unique
 
user10864482
@SamyS.Rathore as mentionned by Amy, I strongly discourage to implement something that is already proven to work, and more importantly, which was tested
 
user10864482
security IS hard
 
user10864482
@Tiffany then.. a collection?
 
user10864482
List<object[]> ?
 
6:41 PM
...I suppose so
 
user10864482
or even make your own object and put it in a list?
 
user10864482
List<someCustomCoordObject>
 
user10864482
and override ICompare (example; override the stuff you need) to fit your need
 
hmmm
 
user10864482
you could extend a List object with your own custom implementation
 
user47589
6:43 PM
Using Identity makes things a LOT easier
 
I may need to read more of my book before I attempt it. I thought I had enough to write a class to do what I want, but it's seeming like not
 
user47589
Tiffany, you can use a dictionary of lists, so the keys are unique per list but each key can have many items. Or use a Lookup
 
user10864482
@SamyS.Rathore the image in that link you posted is a real example of what would happen if you don't control identity; you create a locking system with no way to track keys
 
user10864482
this is dangerous imo
 
6:46 PM
I understand
will probably go with Identity
 
@Amy to clarify, would I have two dictionaries?
I'm beginning to think I may be better off using a multidimensional array since I will know the size upfront, but arrays aren't as fun
 
user47589
No, one dictionary. The key is a string or whatever, the value type is a list
 
user47589
I'm on mobile, sorry, it is hard to type code
 
no worries
 
user47589
Can you give a basic, simplified example of what you're trying to do? In English, not in code.
 
6:53 PM
I see what you're saying now, dictionary won't work because there is a possibility that the keys will not be unique.
 
user47589
You have a bunch of things you identify by keys, and you want to put them in a data structure that let's you use a key to get all the objects with that key. Is that correct?
 
(1, 3);
(1, 4);
(2, 6);
(3, 5);
(3, 7);
(3, 3);
etc
 
user47589
Dictionary<int, List<something>>
 
user10864482
List<Point>
 
user10864482
6:55 PM
new Point {X = 1, Y = 3}
 
I'm trying to get a database table into my entity framework, but it's not working right. When I update the model from the database to include the table, it goes shows up in the Model Browser under Tables/Views but under Properties it says it's an association. All the other associations in the list are Foreign Keys.
 
user10864482
at that point a struct would probably do the job
 
now this is where naming it a coordinate system is going to bite me in the ass, I'm not planning to make an actual coordinate system, but a collection of two numbers, randomly generated. Does Point work in a situation that isn't graphical?
 
@Tiffany have you looked at the lookup data structure?
 
user10864482
@Tiffany yes, but at that point if you don't need the extra feature, write your Point class with to prop, X & Y
 
user47589
6:58 PM
You can use point to represent an X/Y pair of numbers
 
@cubesnyc a little, yes. I haven't used LINQ yet, so I'm avoiding it unless that's the most efficient way. I'm still very much a beginner with C#.
 
user47589
If that makes you uncomfortable, writing your own such class is pretty straightforward
 
what do you mean youre avoiding it
 
I've only worked through a couple of tutorials which did a lot of handholding, so attempting to write my own class without training wheels is...fun...
 
its just a collection of extension methods
 
7:00 PM
avoiding it until I have a better understanding of how LINQ works
 
user47589
@Tiffany linq has comparable efficiency next to loops. It's simply a more succinct way of expressing the same algorithm. Any performance improvements or degradation results from an alteration of the algorithm
 
I see
I'll read more in my book, there's a chapter on LINQ, so that'll help
 
user47589
Looping over n items using a for loop has the same performance characteristics as a foreach loop, and the same as a linq operation which loops over the collection
 
user47589
LINQ just hides the looping.
 
user47589
But it's still there.
 
7:02 PM
I just really like the Add syntax of List and wish it worked with multiple arguments
 
.AddRange
 
user47589
AddRange accepts a collection
 
user47589
IIRC it doesn't allow params
 
user47589
It's been a while since I used it.
 
yeah, I don't spend much time doing addrange
you could do, like
list.AddRange(new [] { thing, anotherthing, thirdthing}), but
that creates a pointless array
 
7:06 PM
which I'm guessing enables me to write something bad, and I want to avoid that too
but seems like the answer is "read more," so I'll do that
 
What are you actually trying to do here?
 
user47589
Scroll up a bit, I already asked that.
 
I want to randomly generate a list/collection/<insert correct term> of a pair of numbers, the size of the list being passed as an argument
 
var lst = new List<your pair type>([number of things]);
for (int i = 0; i < [number of things]; i++)
{
lst.add(RandomThing())
}
return lst;
or, if you want to get LINQy with it
Enumerable.Range(0, count).Select(_ => MakeRandomPair());
you don't even need a list there, actually, you can just have an array
 
yeah, I was thinking I may only need a multidimensional array, but wanted to explore other possibilities first
 
7:18 PM
I would do a 1D array of some point type (like a tuple or a ValueTuple or one you write yourself) over a 2d array of ints
Save yourself a lot of headaches.
 
alright, thanks for the suggestions, all
 
7:41 PM
I created a simple association table. Two columns, each references a field from two different tables. I didn't realize at first that Entity Framework is smart enough to interpret this as just an association rather than an Entity in its own right. My problem is, how do I assign associations with it?
 
A property I'm setting is a base-class constructor is coming back as null when used in the derived class constructor and I'm completely flummoxed.
Oh thank goodness, I was just being an idiot and shadowing it.
 
@Grace a colleague of mine did that thing today
except... he forgot to use the initial capacity
 
you know me, I love reallocating
 
and it was a collection of 11 million items
 
@Wietlol sorry just now getting back to this...I should be more clear: a lot of motherboards will block MOST versions of Linux -- which need to run on a motherboard "legacy mode." If you can't access legacy mode on your motherboard (like actually try to do it and see if it changes), that means you won't be able to download+install most versions of Linux.
 
7:59 PM
Can anyone help me with this?
 
of course, if you know how many things you have, you probably want an array
or, depending on your use case, you could do a lazy ienumerable generator thing
public IEnumerable<sometype> MakeThings(int n)
{
for (int i = 0; i < n; i++)
yield return NextThing();
}
or the same thing in linq
Enumerable.Range(0, n).Select(_ => NextThing());
 
I assume Range is O(1)
 
it's doing the same thing as the for loop, the algorithm as a whole is o(n), there's no way around that
if you want n things, it's going to be o(n)
 
Is there a way I could change the version of a DLL without recompiling it?
There's some functionality that depends on a DLL version, and I'd like to write tests that can change that version on the fly to test the functionality.
 
it's at a known offset into the file, if you don't mind doing a little parsing and poking yourself docs.microsoft.com/en-us/windows/win32/debug/…
but you'd think there'd be a tool or library for doing this
 
8:14 PM
@Grace but Range() should give you a known set of values
Range().Last() should be O(1)
 
Range itself doesn't really take any time, yeah
 
if Range's implementation is for (int i = start; i < end; i++) yield return i; then it isnt
 
like, last doesn't know anything about range
if you do Enumerable.Range(0, int.MaxValue).Last(), it'll take a while
 
oh yea, they are extension methods
I forgot
 
sometimes you see optimizations
like List provides an optimized .ToList that doesn't do anything
 
8:17 PM
im too used to kotlin's stuff now, I forget how C#'s implementations go
 
Hey All, In my application, I have a DataRow Cell object that is of type nullable Guid, therefore, could someone please tell me if this C# line will work: (Convert.IsDBNull(obj) ? null : (Nullable<Guid>)obj)
?
 
8:40 PM
@crazyTech pastebin.com/n08djN8S looks like it works fine.
 
9:04 PM
@jonathon-chase Thanks for the verification
 

« first day (3259 days earlier)      last day (1683 days later) »