« first day (3988 days earlier)      last day (943 days later) » 

12:32 AM
 
 
4 hours later…
Ben
5:02 AM
Ok, call me stupid, but I'm dealing with an error in one of the projects I downloaded. The feedback is "Try to use the actual project and not the DLL. It will give you better visibility to the issues than the DLL."
And that doesn't make sense to me.
 
mr5
It seems you are trying to run a library instead of the executable
 
Ben
and how do i
1. confirm that
2. change that
Is it that the project that is the .dll is being built as a .dll? I just need to change the build format from Class library to "Windows App"?
 
mr5
How many projects do you have in the solution?
 
Ben
Uhhh... a lot
10
I did change it over to Windows app, and only 2 of the projects complained
 
mr5
Eh
You don't want to randomly change the project target
You need identify if it's a library or an executable
 
Ben
5:13 AM
Yeah, i changed it back, so now I just have a useless exe lol
 
mr5
Then you have to set a single active project when trying to hit the debug button
Solution > Properties > Configuration
This will decide if the project you are debugging is "executable"
 
Ben
Ok, all are "Build", none are "Deploy", and that column is not enabled
 
mr5
If the "executable" is Desktop specific, I think there is a more straightforward way to declare it.
try also Project > Properties > Find the "executable" word somewhere
 
Ben
Yeah, that's what I changed originally - the "Output Type" is either "Class Library", which builds a .dll file; or "Windows App", which makes an .exe
@mr5 And yes, this is entirely a desktop app
 
 
1 hour later…
6:47 AM
Good morning
Why so complicated mr5
That option tells VS what to start when you start
 
mr5
7:17 AM
but that's for setting the project as active
 
That's for telling VS which project to start when you press F5 or the play button.
(Or ctrl+F5 and whatever else there might be to start the thing)
 
mr5
I think we're saying the same thing here though
 
@Ben "project instead of library" usually means your project references another project, but instead of a project reference it uses a direct reference to the DLL so now you can't easily debug into that other project.
 
mr5
his question is more like, how to change the project output type or determine if it's a lib or an executable
 
Ah ok, seems I misunderstood that^^
Too much text for a morning without coffee :D
 
7:22 AM
[Squirrel in Training] HeyHo HeyHo
 
mr5
but it's afternoon already 😶
 
Even worse!
 
mr5
@nerdintraining are you going to TI?
 
8:21 AM
[Captain Obvious] Oh come on @mr5, surely you know this place runs in UTC+1 +- an hour or two
[Squirrel in Training] no mark, marc, marciel?
[Squirrel in Training] I am not it's to far away :<
[Squirrel in Training] If it where in Sweden i'd be going 200%
[Squirrel in Training] Just imagine all them swedish gurls
 
mr5
I would have gone too even it's too far away but covid :<
But I thought they relocated the venue now to Rome
Izz afternoon. Y'all living in simulation.
 
[Squirrel in Training] should be bukarest
[Captain Obvious] mr5 you should come to workspace
 
mr5
Google workspace? Amazon workspace?
 
[Captain Obvious] No the company I'm wortking for. I posted on linkedin for @default_noob_network in here and our CEO sent me a message being like "wtf what about us"
[Captain Obvious] I posted it in General last night
[Squirrel in Training] I don't follow
[Captain Obvious] What don';t you follow
[Captain Obvious] Daustin's looking for a job, I posted on linkedin, then the CEO of my current company sent me a message saying "Is that not a good hire for Workspace 365?"
[Captain Obvious] Which was then followed up a bit later with "we always have place for talented people"
 
8:39 AM
Is...your CEO on the C# discord?
 
[Captain Obvious] what no
[Squirrel in Training] I still don't follow
 
mr5
oh
 
[Squirrel in Training] Oh now i follo
 
mr5
I thought that 365 is a Microsoft docs or something
 
\[**[Squirrel in Training](https://discord.gg/PNMq3pBSUe)**] LinkdIn === Facebook for buisness
So you can post crud as well
[Captain Obvious] WEait you didn't know about linkedin
[Captain Obvious] Oh I'm sorry for introducing you
 
mr5
8:42 AM
you post memes on linkedin sir
 
 
1 hour later…
user7858150
10:11 AM
Is

`PrincipalContext clientDomain = new PrincipalContext(ContextType.Domain);`

domain agnostic? I need to be able to identify users across multiple clients, but I'm slightly concerned about security.
 
10:27 AM
Fells like you want some OAuth but I don't know enough to explain that feeling
 
user7858150
OAuth would be an option, but in reality I want this to be a bit easier to administrate. Access type is partly based on AD profiles, meaning I need to pull an identifier that can be used to poll an LDAP machine at the client site.
 
user7858150
There's a few other things involved with AD too, including hard assets with an OU, which make this a bit of a nicer approach
 
mr5
hmm active directory
luckily I never been involve in that shit
 
user7858150
I worked with it once years ago, in this context at least. For the life of me I can't remember what I did to get it working, but I do know I never got the time to get SSO going
 
mr5
shouldn't that thing a responsibility of IT or DevOps
I'm not sure why it's still needed to be coded
 
user7858150
10:38 AM
It is, but having LDAP available to query it simplifies a hell of a lot of stuff. It's aso nice to have in terms of user management, from both a sysadmin and dev side. It makes determining process flow so much easier
 
user7858150
10:52 AM
Ugh, I can't remember how I got the SAM account name from the browser last time I did this. Or even if that's the way I got it.
 
11:21 AM
[Captain Obvious] Wait are you using Windows auth?
[Captain Obvious] Because I think the HttpContext.User is an IPrincipal of some decription which has the name property containing the SAM account name
 
11:45 AM
[Squirrel in Training] i only knwo xing
 
user7858150
@Botler I'm doing some more reading and apparently it depends on whether or not you're inside the domain. Since I'm outside of the domain (see here: stackoverflow.com/questions/69207437/…), I need to find something else.
 
12:50 PM
[DAustin] I'll get onto Workspace today I promise xoxox
 
1:05 PM
[Captain Obvious] Live captions in MS teams makes meetings much more interesting
 
1:21 PM
\[**[Squirrel in Training](https://discord.gg/PNMq3pBSUe)**] 😂😂
I can imagine
 
 
1 hour later…
2:47 PM
// Show required Sections, from selected employee job title
var byJobTitle = SectionRequiredByJobTitles.Where(x => x.PositionId.Id == SelectedEmployee.JobTitleId).ToList();

// In main list of sections, filter down to required sections
var result = Sections.Where(x => byJobTitle.Any(y => y.SectionId.Id == x.Id)).ToList();

foreach (var section in result)
{
    // Grab the section object by id
    var item = Sections.Where(x => x.Id == section.Id).FirstOrDefault();

    if(byJobTitle.Any(x => x.SectionId.Id == item.Id))
My logic is incorrect.. not sure where I am wrong.
ah
got it
 
[DAustin] can we get the definition for Sections and SectionRequiredByJobTitles?
 
 SectionRequiredByJobTitles is a observable collection of:

    public class TrainingRequiredByJobTitle
    {
        public int Id { get; set; }
        public JobTitleModel PositionId { get; set; }
        public SectionModel SectionId { get; set; }
    }
 
ew
 
    public class SectionModel : ViewModelBase
    {
        public int Id { get; set; }
        public int Number { get; set; }
        public string Title { get; set; }

        private bool _required;

        public bool Required
        {
            get { return _required; }
            set
            {
                _required = value;
                RaisePropertyChanged(nameof(Required));
            }
        }
    }
 
FirstOrDefault() followed by a non-null assumption
 
2:53 PM
I know :)
 
also, you might want to try to replace Any() calls with Contains() calls
 
The whole logic wrong anyway... because the foreach... only iterates through result, whereas it should iterating through all of the Sections.
And I think I tried that, it didn't work in my case. Let me find out why that was the case
Cannot convert lambda expression to type SectionsRequiredByJobTitle because it is not a delegate type
 
3:09 PM
                // Show required Sections, from selected employee job title
                var byJobTitle = SectionRequiredByJobTitles.Where(x => x.PositionId.Id == SelectedEmployee.JobTitleId).ToList();

                // In main list of sections, filter down to required sections
                var result = Sections.Where(x => byJobTitle.Any(y => y.SectionId.Id == x.Id)).ToList();

                foreach (var section in Sections)
                {
                    if (result.Contains(section))
That's better
 
meh
 
meh?
 
meh.
 
:/
How would you do it?
 
not use the list
 
3:12 PM
which one
 
simply use the where from your result list rather than a contains on the result list
 
why?
 
because that is what you want
 
hahaha
Is this what you mean?
foreach (var section in Sections)
{
    var found = result.Where(x => x.Id == section.Id);
    if (found.Any())
    {
        section.Required = true;
    }
    else
    {
        section.Required = false;
    }
}
 
nope
if (byJobTitle.Any(it => it.SectionId.Id == section.Id))
remove the result list
 
3:21 PM
Makes sense
Thanks
 
then you can change it to
if (sectionsWithJobs.Contains(section.Id))
and get a ISet<Id> sectionsWithJobs (whatever type Id is)
that way, you avoid nested loops
considering a HashSet's Contains is O(1) unlike an Any operation, which is O(n)
 
n for null?
 
n for count
O(1) means constant time
it wont get slower if you add more jobs/sections
O(n) is linear
it will get slower if you add more jobs/sections
 
interesting..
 
if you have double the jobs, it will take twice as long
 
3:26 PM
But it depends how much data you work with?
 
then it does, yes
 
Small amount of data is probably unnoticeable
 
well... not always
sometimes, even with small data, you still do things that are certainly noticeable
 
So at what point would you consider Any over Contains
 
Any is usually used for more complex lookups
or lookups that you only do once
 
Rob
3:28 PM
Contains means contains, Any is a predicate
@Wietlol Yes, but also no. O(N) is actually O(N) + c
 
btw this doesn't work if(byJobTitle.Contains(section.Id)) because what I really need to do is.. if(byJobTitle.Contains(x => x.SectionId == section.Id))
 
@Rob yes, but actually no
 
What is the + c?
 
it would be O(n + 1)
but n is the greatest growth so everything else is ignored
 
Rob
The + c is the constant time
Everything else is ignored in O(N) notation, yes, but it doesn't mean that 2N is half as fast as N
Which is why there is the +c
 
3:32 PM
same for O(2^n * n) which is the same as O(2^n)
@Rob true
 
Rob
@Squirrel.98 Because you're passing a predicate. You should use .Any(). Or better yet, as hash/dictionary
 
it isnt always faster, just grows slower
@Rob meh
the function he uses is Any, but the operation from the function and the argument is identical to Contains
 
Rob
The snippet you pasted isn't identical at all
Unless somehow a jobByTitle.SectionId == jobByTitle
 
collection.Any(it => it == x) == collection.Contains(x)
for the case where you access a property from it, you just need to collect the properties instead of the objects
 
Rob
That's also a yes but also no
Because == doesn't "==" .Equal
 
3:35 PM
var sectionsWithJobs = byJobTitle.Select(it => it.SectionId.Id).ToSet();
 
Rob
But that's pedantic. What you wrote was if(byJobTitle.Contains(x => x.SectionId == section.Id))
 
@Rob not really, the difference was between
if (byJobTitle.Any(it => it.SectionId.Id == section.Id))
if (sectionsWithJobs.Contains(section.Id))
 
Rob
Those two collections are different
 
true
> and get a ISet<Id> sectionsWithJobs (whatever type Id is)
 
Rob
Any is also different to Contains because I'm pretty sure some collections override that to optimise the query
Don't quote me on that, though
Been a while since I've used c#
 
3:38 PM
the behavior should be consistent though
the performance should always be on the Contains side though
 
Rob
Yes
 
contains is a form of any
 
Rob
Hence... use a dictionary/hash/set
 
one that some collections (usually sets) can optimize a lot
anyway, it is time for me to leave
 
[Captain Obvious] Why would you leave
[Captain Obvious] You were having so much fun
 
 
1 hour later…
4:47 PM
[DAustin] ikr I always enjoy Wiet's pedantry
 
 
7 hours later…
Ben
11:45 PM
Ok so to recap, the response I got from the originator is "Use the project, not the dll". I know it is using the dll, since that's the output of the project in question. I changed it to exe output, which caused some complaints, but I don't know how to fix the reference to look at an exe, not a dll
Which is what I'm assuming is the end goal.
 

« first day (3988 days earlier)      last day (943 days later) »