Ken98045 / On-Guard

Adds Artificial Intelligence to almost any security camera that supports HTTP, ONVIF or FTP. It uses DeepStack as the AI engine. It allows the user to easily create areas in a photo that should trigger an action (HTTP/email/MQTT) or ignore activity in that area. It can dramatically reduce the incidents of picture false alarms. It can optionally interact wtih Blue Iris.
43 stars 8 forks source link

Project structure and folder cleanup #8

Open MikeFarrington opened 3 years ago

MikeFarrington commented 3 years ago

@Ken98045 It looks big, with 138 files changed, but only a dozen files were actually changed, the rest were moved into folders and a few were slightly renamed.

This brings the project in line with a more traditional file/folder layout. It's not 100% there, but it's a good start.

MikeFarrington commented 3 years ago

When you merge this, you'll probably want to do a "squash and merge" to keep the commit history a little cleaner. I should have done that myself... I'm still learning how to work on a forked project in GitHub.

Ken98045 commented 3 years ago

I haven’t used GitHub much because previous employers used other tech. I definitely should have branched in prep for a merge, but to date nobody else seemed interested in getting involved. So, if I make dumb GitHub move please let me know.

From: Mike Farrington [mailto:notifications@github.com] Sent: Thursday, January 14, 2021 4:13 PM To: Ken98045/On-Guard Cc: Ken98045; Mention Subject: Re: [Ken98045/On-Guard] Project structure and folder cleanup (#8)

When you merge this, you'll probably want to do a "squash and merge" to keep the commit history a little cleaner. I should have done that myself... I'm still learning how to work on a forked project in GitHub.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Ken98045/On-Guard/pull/8#issuecomment-760557745 , or unsubscribe https://github.com/notifications/unsubscribe-auth/ACSQ24MCHIJKBNJIAQSP5QDSZ6CBVANCNFSM4WDIFRJQ . https://github.com/notifications/beacon/ACSQ24OCAKPMRPEQC25JAMLSZ6CBVA5CNFSM4WDIFRJ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOFVKTBMI.gif

MikeFarrington commented 3 years ago

Git/GitHub definitely has a steep learning curve, that's for sure. I only started using it about 4-5 years ago myself. Before that, it was all systems based on a check-in/check-out model.

Ken98045 commented 3 years ago

The changes I made today were reasonably substantial, and I haven’t even started thinking about a merge. I know, very bad practice but I’ve had the luxury of being lazy up to this point.

The previous use of binary serialized settings files was again, lazy. The use of the registry should allow me to add data members without breaking things as badly. That was a real issue because I hesitated to make needed changes due to breaking other peoples settings every time I needed something else. There are still a few settings in the Settings.Settings file but I didn’t want to get rid of everything at once. I do want to get rid of those ASAP. Maybe I’ll just use the Settings.Settings stuff for defaults or maybe I’ll nuke it completely. In any event, I want to stop saving there at all before making any new releases.

I posted this project originally because I thought I had enough useful personal stuff that I wanted to share it. It was not originally intended to be a long term project, but then came Covid and I got really bored.

BTW, I know that one person had issues installing/running on Windows Server (actually Data Center). If you have any thoughts on that I’d appreciate it. I’m 95% sure it is security settings, but I’m not quite sure what is the specific problem. If you can help me avoid installing a Sever VM it would be appreciated.

From: Mike Farrington [mailto:notifications@github.com] Sent: Thursday, January 14, 2021 4:10 PM To: Ken98045/On-Guard Cc: Ken98045; Mention Subject: Re: [Ken98045/On-Guard] Project structure and folder cleanup (#8)

@Ken98045 https://github.com/Ken98045 It looks big, with 138 files changed, but only a dozen files were actually changed, the rest were moved into folders and a few were slightly renamed.

This brings the project in line with a more traditional file/folder layout. It's not 100% there, but it's a good start.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Ken98045/On-Guard/pull/8#issuecomment-760556809 , or unsubscribe https://github.com/notifications/unsubscribe-auth/ACSQ24MAEUSWYVKA43KY7WDSZ6BXJANCNFSM4WDIFRJQ . https://github.com/notifications/beacon/ACSQ24OFWIANNZP4JOWC4CDSZ6BXJA5CNFSM4WDIFRJ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOFVKS2CI.gif

MikeFarrington commented 3 years ago

I'm running it on Windows Server myself without issue.

I did run into one issue, and maybe it's the same as theirs...

After cloning your repo and grabbing a database to use, I found myself unable to run because the non-configurable connection string specifies a common default instance name of MSSQLLocalDB. I also had SQL LocalDB 2016 installed onto my development machine with that instance name. Thus, SQL 2019 LocalDB could not use it, and SQL 2016 LocalDB (which is what the program was connecting to) wouldn't allow the newer database.

Luckily I knew I had nothing of value that was using SQL 2016 LocalDB, and I went ahead and uninstalled it then changed the SQL 2019 LocalDB instance name to MSSQLLocalDB. Not everyone will have that luxury as they may be using software that needs that instance name.

That is also one of the reasons I wanted to move the project over to WiX Toolset so that the InstanceName could be specified during installation of SQL 2019 LocalDB. I imagine we'd want to use an instance name of OnGuard.

For this reason, the connection string needs to be moved to the registry to allow for modification. That way if someone else runs into this issue, they can create an different instance for 2019, then point the connection string to it.

Lastly, I know SQL Server throws up serious warnings when you attempt to install onto a Windows Server that is acting as a Domain Controller. I don't know if that's the case with the LocalDB edition as well. It could be that the installer failed to install SQL 2019 LocalDB for this reason. In which case, the end-user would need to download and run that installer manually, and tell the installer that they wish to install despite its objections.

MikeFarrington commented 3 years ago

You may not be aware of how git works, but... when it comes to merging in my code, as long as it says there's no conflicts, then there's nothing manual about merging. You don't have to make any decisions or anything, just check the code for quality and bring it in. The "Bird" one is super-simple in that respect.

My bigger PR, this one here, I have "rebased" my changes onto yours. That means I have already sucked in your changes, handled the merge conflicts. What the rebase does is makes it look like ALL of my code was written after your code. It makes for much cleaner repo histories than willy-nilly merging.

So, if you look through the code in this PR, you'll see all of your changes for the registry settings. Don't look at the "changed files", that just shows my changes. Because of the aforementioned rebase, all you see is my changes. However, if you dive down into the branch itself (MikeFarrington:feature/FolderCleanup), not the PR, you'll see that your registry changes are there.

MikeFarrington commented 3 years ago

| but then came Covid and I got really bored.

Yup, that's the only reason I've joined your project. I've never worked on an open-source project before because I've always been too busy with other stuff. Well, after gearing up with a bunch of cameras and building an NVR, I needed something "fun" to make it better. I saw your project, thought it had potential, and dove in.

MikeFarrington commented 3 years ago

No need to squash, I finally learned how to squash locally in git (I've only ever relied on the squash capabilities in GitHub in repositories I control). So now everything is in one clean commit.

Ken98045 commented 3 years ago

Thanks! I’ll need to get serious about learning GitHub.

So, I downloaded the Code zip file and I’m getting errors related the missing SQL files on the Build All.

The rest of the code seems to build fine. However, when I attempt to open any designer file I get hundreds of errors such as:

Severity

Code

Description

Project

File

Line

Suppression State

Error

CS0518

Predefined type 'System.Object' is not defined or imported

AIDisplay

C:\OnGuard-3\On-Guard-master\AddUrlDlialog.cs

31

Active

Error

CS0518

Predefined type 'System.Object' is not defined or imported

AIDisplay

C:\OnGuard-3\On-Guard-master\AddUrlDlialog.cs

31

Active

Error

CS0246

The type or namespace name 'EventArgs' could not be found (are you missing a using directive or an assembly reference?)

AIDisplay

C:\OnGuard-3\On-Guard-master\AddUrlDlialog.cs

31

Active

Error

CS0518

Predefined type 'System.Void' is not defined or imported

AIDisplay

C:\OnGuard-3\On-Guard-master\AddUrlDlialog.cs

49

Active

Error

CS0518

Predefined type 'System.Object' is not defined or imported

AIDisplay

C:\OnGuard-3\On-Guard-master\AddUrlDlialog.cs

49

Active

Error

CS0518

Predefined type 'System.Object' is not defined or imported

AIDisplay

C:\OnGuard-3\On-Guard-master\AddUrlDlialog.cs

49

Active

Error

CS0246

The type or namespace name 'EventArgs' could not be found (are you missing a using directive or an assembly reference?)

AIDisplay

C:\OnGuard-3\On-Guard-master\AddUrlDlialog.cs

49

Active

Error

CS0518

Predefined type 'System.Void' is not defined or imported

AIDisplay

C:\OnGuard-3\On-Guard-master\AddUrlDlialog.cs

54

Active

Error

CS0518

Predefined type 'System.Object' is not defined or imported

AIDisplay

C:\OnGuard-3\On-Guard-master\AddUrlDlialog.cs

54

Active

Error

CS0518

Predefined type 'System.Object' is not defined or imported

AIDisplay

C:\OnGuard-3\On-Guard-master\AddUrlDlialog.cs

54

Active

Error

CS0246

The type or namespace name 'EventArgs' could not be found (are you missing a using directive or an assembly reference?)

AIDisplay

C:\OnGuard-3\On-Guard-master\AddUrlDlialog.cs

54

Active

Error

CS0518

Predefined type 'System.Void' is not defined or imported

AIDisplay

C:\OnGuard-3\On-Guard-master\AddUrlDlialog.cs

59

Active

Error

CS0518

Predefined type 'System.Object' is not defined or imported

AIDisplay

C:\OnGuard-3\On-Guard-master\AddUrlDlialog.cs

59

Active

Error

CS0518

Predefined type 'System.Object' is not defined or imported

AIDisplay

C:\OnGuard-3\On-Guard-master\AddUrlDlialog.cs

59

Active

Error

CS0246

The type or namespace name 'EventArgs' could not be found (are you missing a using directive or an assembly reference?)

AIDisplay

C:\OnGuard-3\On-Guard-master\AddUrlDlialog.cs

59

Active

Error

CS0518

Predefined type 'System.Void' is not defined or imported

AIDisplay

C:\OnGuard-3\On-Guard-master\AddUrlDlialog.cs

64

Active

Error

CS0518

Predefined type 'System.Object' is not defined or imported

AIDisplay

C:\OnGuard-3\On-Guard-master\AddUrlDlialog.cs

64

Active

Error

CS0518

Predefined type 'System.Object' is not defined or imported

AIDisplay

C:\OnGuard-3\On-Guard-master\AddUrlDlialog.cs

64

Active

Error

CS0246

The type or namespace name 'EventArgs' could not be found (are you missing a using directive or an assembly reference?)

AIDisplay

C:\OnGuard-3\On-Guard-master\AddUrlDlialog.cs

64

Active

Basically it doesn’t seem to be finding any of the system types. When I look at references I do see those system files listed. I have not tried to track these down. If you are available and can save me some time that would be great!

From: Mike Farrington [mailto:notifications@github.com] Sent: Saturday, January 16, 2021 6:54 AM To: Ken98045/On-Guard Cc: Ken98045; Mention Subject: Re: [Ken98045/On-Guard] Project structure and folder cleanup (#8)

No need to squash, I finally learned how to squash locally in git (I've only ever relied on the squash capabilities in GitHub in repositories I control). So now everything is in one clean commit.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Ken98045/On-Guard/pull/8#issuecomment-761576301 , or unsubscribe https://github.com/notifications/unsubscribe-auth/ACSQ24J7BBZXKHY3S3D3YL3S2GSBLANCNFSM4WDIFRJQ . https://github.com/notifications/beacon/ACSQ24PYPEMWXOHACCLN74TS2GSBLA5CNFSM4WDIFRJ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOFVSLW3I.gif

Ken98045 commented 3 years ago

OK, the hundreds of errors disappeared on me like magic. I’m not sure what VS is doing, but whatever it was was annoying

From: Ken Koch [mailto:me@aperson.me] Sent: Saturday, January 16, 2021 11:46 AM To: 'Ken98045/On-Guard' Subject: RE: [Ken98045/On-Guard] Project structure and folder cleanup (#8)

Thanks! I’ll need to get serious about learning GitHub.

So, I downloaded the Code zip file and I’m getting errors related the missing SQL files on the Build All.

The rest of the code seems to build fine. However, when I attempt to open any designer file I get hundreds of errors such as:

Severity

Code

Description

Project

File

Line

Suppression State

Error

CS0518

Predefined type 'System.Object' is not defined or imported

AIDisplay

C:\OnGuard-3\On-Guard-master\AddUrlDlialog.cs

31

Active

Error

CS0518

Predefined type 'System.Object' is not defined or imported

AIDisplay

C:\OnGuard-3\On-Guard-master\AddUrlDlialog.cs

31

Active

Error

CS0246

The type or namespace name 'EventArgs' could not be found (are you missing a using directive or an assembly reference?)

AIDisplay

C:\OnGuard-3\On-Guard-master\AddUrlDlialog.cs

31

Active

Error

CS0518

Predefined type 'System.Void' is not defined or imported

AIDisplay

C:\OnGuard-3\On-Guard-master\AddUrlDlialog.cs

49

Active

Error

CS0518

Predefined type 'System.Object' is not defined or imported

AIDisplay

C:\OnGuard-3\On-Guard-master\AddUrlDlialog.cs

49

Active

Error

CS0518

Predefined type 'System.Object' is not defined or imported

AIDisplay

C:\OnGuard-3\On-Guard-master\AddUrlDlialog.cs

49

Active

Error

CS0246

The type or namespace name 'EventArgs' could not be found (are you missing a using directive or an assembly reference?)

AIDisplay

C:\OnGuard-3\On-Guard-master\AddUrlDlialog.cs

49

Active

Error

CS0518

Predefined type 'System.Void' is not defined or imported

AIDisplay

C:\OnGuard-3\On-Guard-master\AddUrlDlialog.cs

54

Active

Error

CS0518

Predefined type 'System.Object' is not defined or imported

AIDisplay

C:\OnGuard-3\On-Guard-master\AddUrlDlialog.cs

54

Active

Error

CS0518

Predefined type 'System.Object' is not defined or imported

AIDisplay

C:\OnGuard-3\On-Guard-master\AddUrlDlialog.cs

54

Active

Error

CS0246

The type or namespace name 'EventArgs' could not be found (are you missing a using directive or an assembly reference?)

AIDisplay

C:\OnGuard-3\On-Guard-master\AddUrlDlialog.cs

54

Active

Error

CS0518

Predefined type 'System.Void' is not defined or imported

AIDisplay

C:\OnGuard-3\On-Guard-master\AddUrlDlialog.cs

59

Active

Error

CS0518

Predefined type 'System.Object' is not defined or imported

AIDisplay

C:\OnGuard-3\On-Guard-master\AddUrlDlialog.cs

59

Active

Error

CS0518

Predefined type 'System.Object' is not defined or imported

AIDisplay

C:\OnGuard-3\On-Guard-master\AddUrlDlialog.cs

59

Active

Error

CS0246

The type or namespace name 'EventArgs' could not be found (are you missing a using directive or an assembly reference?)

AIDisplay

C:\OnGuard-3\On-Guard-master\AddUrlDlialog.cs

59

Active

Error

CS0518

Predefined type 'System.Void' is not defined or imported

AIDisplay

C:\OnGuard-3\On-Guard-master\AddUrlDlialog.cs

64

Active

Error

CS0518

Predefined type 'System.Object' is not defined or imported

AIDisplay

C:\OnGuard-3\On-Guard-master\AddUrlDlialog.cs

64

Active

Error

CS0518

Predefined type 'System.Object' is not defined or imported

AIDisplay

C:\OnGuard-3\On-Guard-master\AddUrlDlialog.cs

64

Active

Error

CS0246

The type or namespace name 'EventArgs' could not be found (are you missing a using directive or an assembly reference?)

AIDisplay

C:\OnGuard-3\On-Guard-master\AddUrlDlialog.cs

64

Active

Basically it doesn’t seem to be finding any of the system types. When I look at references I do see those system files listed. I have not tried to track these down. If you are available and can save me some time that would be great!

From: Mike Farrington [mailto:notifications@github.com] Sent: Saturday, January 16, 2021 6:54 AM To: Ken98045/On-Guard Cc: Ken98045; Mention Subject: Re: [Ken98045/On-Guard] Project structure and folder cleanup (#8)

No need to squash, I finally learned how to squash locally in git (I've only ever relied on the squash capabilities in GitHub in repositories I control). So now everything is in one clean commit.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Ken98045/On-Guard/pull/8#issuecomment-761576301 , or unsubscribe https://github.com/notifications/unsubscribe-auth/ACSQ24J7BBZXKHY3S3D3YL3S2GSBLANCNFSM4WDIFRJQ . https://github.com/notifications/beacon/ACSQ24PYPEMWXOHACCLN74TS2GSBLA5CNFSM4WDIFRJ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOFVSLW3I.gif

Ken98045 commented 3 years ago

And when I attempt to start debugging I get:

After looking at a variety of Google search result I see a lot of “solutions”, but right now nothing is working for me. It seems like maybe the root cause is that you are using an earlier version of Visual Studio? What version are you using. I am at VS Community 2019 build 16.8..4 (which is the latest).

From: Mike Farrington [mailto:notifications@github.com] Sent: Saturday, January 16, 2021 6:54 AM To: Ken98045/On-Guard Cc: Ken98045; Mention Subject: Re: [Ken98045/On-Guard] Project structure and folder cleanup (#8)

No need to squash, I finally learned how to squash locally in git (I've only ever relied on the squash capabilities in GitHub in repositories I control). So now everything is in one clean commit.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Ken98045/On-Guard/pull/8#issuecomment-761576301 , or unsubscribe https://github.com/notifications/unsubscribe-auth/ACSQ24J7BBZXKHY3S3D3YL3S2GSBLANCNFSM4WDIFRJQ . https://github.com/notifications/beacon/ACSQ24PYPEMWXOHACCLN74TS2GSBLA5CNFSM4WDIFRJ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOFVSLW3I.gif

Ken98045 commented 3 years ago

OK, I have to say my Visual Studio is just plain weird! I downloaded your changes. It said it built everything. Then, later it said there were hundreds/thousands of errors, then it settled down and without changing everything it “just worked/built”. Then, the next time I tried to run in Debug mode it threw errors related to NewtonSoft, then I built and it maybe just worked. Then, it stopped working. So, I’m uninstalling the whole Visual Studio and re-installing. I don’t trust Repair to work correctly.

In the mean time….

From: Mike Farrington [mailto:notifications@github.com] Sent: Saturday, January 16, 2021 6:54 AM To: Ken98045/On-Guard Cc: Ken98045; Mention Subject: Re: [Ken98045/On-Guard] Project structure and folder cleanup (#8)

No need to squash, I finally learned how to squash locally in git (I've only ever relied on the squash capabilities in GitHub in repositories I control). So now everything is in one clean commit.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Ken98045/On-Guard/pull/8#issuecomment-761576301 , or unsubscribe https://github.com/notifications/unsubscribe-auth/ACSQ24J7BBZXKHY3S3D3YL3S2GSBLANCNFSM4WDIFRJQ . https://github.com/notifications/beacon/ACSQ24PYPEMWXOHACCLN74TS2GSBLA5CNFSM4WDIFRJ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOFVSLW3I.gif

Ken98045 commented 3 years ago

Yes, I’m seeing them there. I just need to get VS rei-installed and see if that fixes my problems. I was having breaking performance issue. For instance, if I tried to create a new WPF project I wouldn’t see a window for about 10 minutes. NUGet just flat out wouldn’t work for me. A variety of other things going on that I just couldn’t explain. After I downloaded your .zip file things just stopped building or built so slowly everything was misleading.

As soon as I’m able to test your changes I will.

From: Mike Farrington [mailto:notifications@github.com] Sent: Thursday, January 14, 2021 5:10 PM To: Ken98045/On-Guard Cc: Ken98045; Mention Subject: Re: [Ken98045/On-Guard] Project structure and folder cleanup (#8)

You may not be aware of how git works, but... when it comes to merging in my code, as long as it says there's no conflicts, then there's nothing manual about merging. You don't have to make any decisions or anything, just check the code for quality and bring it in. The "Bird" one is super-simple in that respect.

My bigger PR, this one here, I have "rebased" my changes onto yours. That means I have already sucked in your changes, handled the merge conflicts. What the rebase does is makes it look like ALL of my code was written after your code. It makes for much cleaner repo histories than willy-nilly merging.

So, if you look through the code in this PR, you'll see all of your changes for the registry settings. Don't look at the "changed files", that just shows my changes. Because of the aforementioned rebase, all you see is my changes. However, if you dive down into the branch itself (MikeFarrington:feature/FolderCleanup https://github.com/MikeFarrington/On-Guard/tree/feature/FolderCleanup ), not the PR, you'll see that your registry changes are there.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Ken98045/On-Guard/pull/8#issuecomment-760577905 , or unsubscribe https://github.com/notifications/unsubscribe-auth/ACSQ24PFYQWXEYP5UMS3PJLSZ6IX3ANCNFSM4WDIFRJQ . https://github.com/notifications/beacon/ACSQ24IYCTXRYEHKHAIXOLDSZ6IX3A5CNFSM4WDIFRJ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOFVKX64I.gif

Ken98045 commented 3 years ago

OK, I did resolve my Visual Studio issues by re-install. However, I do see a problem with your solution/zip file. The DBMotion files are referenced in the project and in the installer, but they are missing. I suggest that they be put in a new folder src\database.

The other issue I had was that the newtonsoft.json NuGet reference didn’t work for me. I had to uninstall it and re-install it. Then it worked. I do intend to remove the newtonsoft stuff and use System.Text.Json and the serializers. That will remove one less complication. I think I copy/pasted the newtonsoft stuff from some Deepstack sample code.

One of the many things that the VS re-install solved was that I can now use NuGet and actually have it work.

Also, I’m not seeing the changes you referenced regarding bird detection. BTW, I do need to create a User Control with a scrolling panel for the object specification stuff or preferably convert that data to a table for them. It started out very small and grew.

From: Mike Farrington [mailto:notifications@github.com] Sent: Thursday, January 14, 2021 5:10 PM To: Ken98045/On-Guard Cc: Ken98045; Mention Subject: Re: [Ken98045/On-Guard] Project structure and folder cleanup (#8)

You may not be aware of how git works, but... when it comes to merging in my code, as long as it says there's no conflicts, then there's nothing manual about merging. You don't have to make any decisions or anything, just check the code for quality and bring it in. The "Bird" one is super-simple in that respect.

My bigger PR, this one here, I have "rebased" my changes onto yours. That means I have already sucked in your changes, handled the merge conflicts. What the rebase does is makes it look like ALL of my code was written after your code. It makes for much cleaner repo histories than willy-nilly merging.

So, if you look through the code in this PR, you'll see all of your changes for the registry settings. Don't look at the "changed files", that just shows my changes. Because of the aforementioned rebase, all you see is my changes. However, if you dive down into the branch itself (MikeFarrington:feature/FolderCleanup https://github.com/MikeFarrington/On-Guard/tree/feature/FolderCleanup ), not the PR, you'll see that your registry changes are there.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Ken98045/On-Guard/pull/8#issuecomment-760577905 , or unsubscribe https://github.com/notifications/unsubscribe-auth/ACSQ24PFYQWXEYP5UMS3PJLSZ6IX3ANCNFSM4WDIFRJQ . https://github.com/notifications/beacon/ACSQ24IYCTXRYEHKHAIXOLDSZ6IX3A5CNFSM4WDIFRJ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOFVKX64I.gif

Ken98045 commented 3 years ago

Sorry for some duplication with a previous message.

Please see below

From: Mike Farrington [mailto:notifications@github.com] Sent: Thursday, January 14, 2021 5:02 PM To: Ken98045/On-Guard Cc: Ken98045; Mention Subject: Re: [Ken98045/On-Guard] Project structure and folder cleanup (#8)

I'm running it on Windows Server myself without issue.

I did run into one issue, and maybe it's the same as theirs...

After cloning your repo and grabbing a database to use, I found myself unable to run because the non-configurable connection string specifies a common default instance name of MSSQLLocalDB. I also had SQL LocalDB 2016 installed onto my development machine with that instance name. Thus, SQL 2019 LocalDB could not use it, and SQL 2016 LocalDB (which is what the program was connecting to) wouldn't allow the newer database.

The Connection String is in the Settings.Settings file. I did not make that user configurable in a settings dialog because no non-engineer would be able to figure that out. I think that for the typical user the LocalDB install done in the Installer project plus the installation of the DBMotion files at the appropriate location has worked for everyone with a few exception. Probably the person running this on DataCenter (Don’t ask me why anyone using DataCenter is using this project). That said there does need to be some improvement here.

Luckily I knew I had nothing of value that was using SQL 2016 LocalDB, and I went ahead and uninstalled it then changed the SQL 2019 LocalDB instance name to MSSQLLocalDB. Not everyone will have that luxury as they may be using software that needs that instance name.

I don’t know what a good tradeoff is between ease of installation with minimal overhead, not confusing the unsophisticated user, etc. is. I did struggle with this issue when I first decided to use SQL.

That is also one of the reasons I wanted to move the project over to WiX Toolset so that the InstanceName could be specified during installation of SQL 2019 LocalDB. I imagine we'd want to use an instance name of OnGuard.

If you want to take that on please do so.

For this reason, the connection string needs to be moved to the registry to allow for modification. That way if someone else runs into this issue, they can create an different instance for 2019, then point the connection string to it.

Yes, I am planning on moving most or all that stuff to the registry as soon as possible. The plan is to use the app.config for initial settings since that is editable, readable by the app, and can be easily specified as an output file in whatever installer is used. Then things will be written to the registry when confirmed by the user so everything is in one place. Actually, the connection string is already in the app.config file, it just isn’t read right now.

Lastly, I know SQL Server throws up serious warnings when you attempt to install onto a Windows Server that is acting as a Domain Controller. I don't know if that's the case with the LocalDB edition as well. It could be that the installer failed to install SQL 2019 LocalDB for this reason. In which case, the end-user would need to download and run that installer manually, and tell the installer that they wish to install despite its objections.

Again, I’m open to suggestions. If you want to take that on go ahead. For now please leave the Settings.Settings stuff alone because that is next on my list of things to do.

BTW, thanks for the folder re-organization!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Ken98045/On-Guard/pull/8#issuecomment-760575239 , or unsubscribe https://github.com/notifications/unsubscribe-auth/ACSQ24LIW47H2OOEL5AYTWLSZ6H2JANCNFSM4WDIFRJQ . https://github.com/notifications/beacon/ACSQ24MFXEM6ZILEEWOIKQDSZ6H2JA5CNFSM4WDIFRJ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOFVKXKBY.gif

Ken98045 commented 3 years ago

I’ve been thinking about the Settings.Settings stuff. While the stuff in there is mostly harmless defaults (with the exception of the connection string), it probably wouldn’t hurt to use them just as defaults as long as they aren’t written to. While they all could be put in app.config, I don’t think that would solve much.

So, my current plan is

  1. Read the initial value (and probably final) value of the connection string from app.config until/unless your installer project can come up with another solution. The only problem I see there is that I have a minor preference to putting the DB files (if used) someplace other than a VirtualStore directory.

  2. Leave the default values of everything else configurable via UI from the Settings.Settings, but never write to it. Every setting configured will be written to the registry.

  3. Figure out a better solution for installing/not installing localdb. I don’t think SQL Express solves anything. Maybe your setup can just see if there is a usable instance of SQL?

  4. Also, we probably need to give the option to use SQL with an (encrypted) user name/password instead of Windows Authentication for those users who want to do that. I did think about that but I didn’t want to add a setup dialog entry that 95% of the people would have no idea what to do with it.

Let me know what you think. Because you’re in this early your opinion and input really matters. Maybe we can smooth this project out but keep the project fun.

From: Mike Farrington [mailto:notifications@github.com] Sent: Thursday, January 14, 2021 5:02 PM To: Ken98045/On-Guard Cc: Ken98045; Mention Subject: Re: [Ken98045/On-Guard] Project structure and folder cleanup (#8)

I'm running it on Windows Server myself without issue.

I did run into one issue, and maybe it's the same as theirs...

After cloning your repo and grabbing a database to use, I found myself unable to run because the non-configurable connection string specifies a common default instance name of MSSQLLocalDB. I also had SQL LocalDB 2016 installed onto my development machine with that instance name. Thus, SQL 2019 LocalDB could not use it, and SQL 2016 LocalDB (which is what the program was connecting to) wouldn't allow the newer database.

Luckily I knew I had nothing of value that was using SQL 2016 LocalDB, and I went ahead and uninstalled it then changed the SQL 2019 LocalDB instance name to MSSQLLocalDB. Not everyone will have that luxury as they may be using software that needs that instance name.

That is also one of the reasons I wanted to move the project over to WiX Toolset so that the InstanceName could be specified during installation of SQL 2019 LocalDB. I imagine we'd want to use an instance name of OnGuard.

For this reason, the connection string needs to be moved to the registry to allow for modification. That way if someone else runs into this issue, they can create an different instance for 2019, then point the connection string to it.

Lastly, I know SQL Server throws up serious warnings when you attempt to install onto a Windows Server that is acting as a Domain Controller. I don't know if that's the case with the LocalDB edition as well. It could be that the installer failed to install SQL 2019 LocalDB for this reason. In which case, the end-user would need to download and run that installer manually, and tell the installer that they wish to install despite its objections.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Ken98045/On-Guard/pull/8#issuecomment-760575239 , or unsubscribe https://github.com/notifications/unsubscribe-auth/ACSQ24LIW47H2OOEL5AYTWLSZ6H2JANCNFSM4WDIFRJQ . https://github.com/notifications/beacon/ACSQ24MFXEM6ZILEEWOIKQDSZ6H2JA5CNFSM4WDIFRJ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOFVKXKBY.gif

Ken98045 commented 3 years ago

OK, I’ve taken your code base and put them in a new local directory

  1. I fixed the missing DBMotion database files.

  2. Remove all “setting” of Settings.Settings. Everything other than defaults should now come from the registry. This makes it much easier to look at for debugging, and in general is probably safe.

  3. Fixed several bugs related to the registry save/load of settings that I introduced.

  4. Fixed a few other bugs.

My question for you is: What is the “proper” github method for uploading/merging these files? I could just commit them and push them up, but I’m not sure if that screws with the history.

I know you probably have a life (if one constrained by CoVid. So, if I don’t hear from you this afternoon (say by 6:00) I’ll just commit them.

From: Mike Farrington [mailto:notifications@github.com] Sent: Thursday, January 14, 2021 5:10 PM To: Ken98045/On-Guard Cc: Ken98045; Mention Subject: Re: [Ken98045/On-Guard] Project structure and folder cleanup (#8)

You may not be aware of how git works, but... when it comes to merging in my code, as long as it says there's no conflicts, then there's nothing manual about merging. You don't have to make any decisions or anything, just check the code for quality and bring it in. The "Bird" one is super-simple in that respect.

My bigger PR, this one here, I have "rebased" my changes onto yours. That means I have already sucked in your changes, handled the merge conflicts. What the rebase does is makes it look like ALL of my code was written after your code. It makes for much cleaner repo histories than willy-nilly merging.

So, if you look through the code in this PR, you'll see all of your changes for the registry settings. Don't look at the "changed files", that just shows my changes. Because of the aforementioned rebase, all you see is my changes. However, if you dive down into the branch itself (MikeFarrington:feature/FolderCleanup https://github.com/MikeFarrington/On-Guard/tree/feature/FolderCleanup ), not the PR, you'll see that your registry changes are there.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Ken98045/On-Guard/pull/8#issuecomment-760577905 , or unsubscribe https://github.com/notifications/unsubscribe-auth/ACSQ24PFYQWXEYP5UMS3PJLSZ6IX3ANCNFSM4WDIFRJQ . https://github.com/notifications/beacon/ACSQ24IYCTXRYEHKHAIXOLDSZ6IX3A5CNFSM4WDIFRJ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOFVKX64I.gif

MikeFarrington commented 3 years ago

Sorry, I wasn't really online this weekend.

The build errors due to the missing DBMotionFiles is because your .gitignore file has exclusions for SQL .MDF/.LDF files on line 250. It is "bad form" to have large binary files in git. In order for me to start working on the project, I had to go grab these database files from my installation. This was one of the reasons I was talking about looking towards EntityFramework... it'll create the database on project launch.

I am using Visual Studio 16.8.4 (Professional Edition). Here's a Visual Studio tip for you... if things go really wonky like they did for you, you want to clear the visual studio cache for your solution. You need to delete the .VS subfolder in the solution folder (while Visual Studio is closed of course).

You mentioned that you did not see the Bird changes. That is because those are in a different pull request. It is good form to have isolated feature branches / pull requests.

Ken98045 commented 3 years ago

See below.

From: Mike Farrington [mailto:notifications@github.com] Sent: Monday, January 18, 2021 5:04 AM To: Ken98045/On-Guard Cc: Ken98045; Mention Subject: Re: [Ken98045/On-Guard] Project structure and folder cleanup (#8)

Sorry, I wasn't really online this weekend.

The build errors due to the missing DBMotionFiles is because your .gitignore file has exclusions for SQL .MDF/.LDF files on line 250. It is "bad form" to have large binary files in git. In order for me to start working on the project, I had to go grab these database files from my installation. This was one of the reasons I was talking about looking towards EntityFramework... it'll create the database on project launch.

I would be more than happy for you to take on the EF stuff. Right now the database stuff is pretty limited in scope, but I see a future where it could be expanded. I could have created a script for the DB install/create rather than put the binaries there. However, I didn’t want to fight the Installer project to get that to work. If you want to do both the installer and EF go for it!.

I think that the stuff I uploaded last night is stable with respect to settings read/save except for the DB Connection String. I did quite a bit of testing, but there are quite a few changes regarding the settings stuff so it is easy to miss something.

If you want to take that as a base and do the EF and installer that would be great!

The only remaining stuff written to the user’s AppData folder is the log file and (right now) the DB files. I don’t have a good alternative for the log file since I have a dislike for the VirtualStore directories. I should probably get over that and just let the system create the log where it feels like it.

I am using Visual Studio 16.8.4 (Professional Edition). Here's a Visual Studio tip for you... if things go really wonky like they did for you, you want to clear the visual studio cache for your solution. You need to delete the .VS subfolder in the solution folder (while Visual Studio is closed of course).

Yup, I probably should have done that. I am using Community 16.8.4 because I got tired of buying Pro via Microsoft Alumni. For the most part it does what I need. The older Community versions were pretty limited, but the newer ones are pretty good. The VS install I had was hosed was hosed in brand new solutions. For instance, it would take (literally) 10 minutes for a new WPF window to show in designer mode. The whole time it was taking that long VS was using 0.5% CPU and almost no disk activity. Now after the re-install everything just works.

You mentioned that you did not see the Bird changes. That is because those are in a different pull request. It is good form to have isolated feature branches / pull requests.

Well, I missed the Bird stuff in the integration I did. So, put it in when you have the chance.

BTW, the next thing I want to do is to fix all the object selection/specification stuff. I’ll probably put it in a table/List View/User Control/Whateverl so that selecting adding/maintaining stuff is easier. Right now it is very ugly. It started out with people/vehicles and then grew ugly from there.

I think that the DeepStack guy just uploaded a tool to allow for AI training of new object types. I downloaded something, but I haven’t looked at it yet. If that is true and relatively easy I might want to train it to recognize people carrying packages. There are a lot of people out there who use security cameras to combat porch pirates. Personally, I don’t have a problem with that because we are pretty rural. Nevertheless, I think that would be a valuable service. The new object types from that may heighten the need for an easy to use/expand object list.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Ken98045/On-Guard/pull/8#issuecomment-762237934 , or unsubscribe https://github.com/notifications/unsubscribe-auth/ACSQ24O5UHVL63FDIHX5WYDS2QWV3ANCNFSM4WDIFRJQ . https://github.com/notifications/beacon/ACSQ24PNGS6NWW6MOJJNMADS2QWV3A5CNFSM4WDIFRJ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOFVXNH3Q.gif

Ken98045 commented 3 years ago

FYI – I committed a new version 1.5.2. The main change was to allow any DeepStack recognized object to be used for analysis. In addition there are a couple of groups (all vehicles and all mammals). Several bugs were also fixed as a part of the move of settings to the registry.

Let me know if you have a chance to test it. I did a reasonable amount of runtime testing, but not much Github related testing because it is getting too late for that.

From: Mike Farrington [mailto:notifications@github.com] Sent: Monday, January 18, 2021 5:04 AM To: Ken98045/On-Guard Cc: Ken98045; Mention Subject: Re: [Ken98045/On-Guard] Project structure and folder cleanup (#8)

Sorry, I wasn't really online this weekend.

The build errors due to the missing DBMotionFiles is because your .gitignore file has exclusions for SQL .MDF/.LDF files on line 250. It is "bad form" to have large binary files in git. In order for me to start working on the project, I had to go grab these database files from my installation. This was one of the reasons I was talking about looking towards EntityFramework... it'll create the database on project launch.

I am using Visual Studio 16.8.4 (Professional Edition). Here's a Visual Studio tip for you... if things go really wonky like they did for you, you want to clear the visual studio cache for your solution. You need to delete the .VS subfolder in the solution folder (while Visual Studio is closed of course).

You mentioned that you did not see the Bird changes. That is because those are in a different pull request. It is good form to have isolated feature branches / pull requests.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Ken98045/On-Guard/pull/8#issuecomment-762237934 , or unsubscribe https://github.com/notifications/unsubscribe-auth/ACSQ24O5UHVL63FDIHX5WYDS2QWV3ANCNFSM4WDIFRJQ . https://github.com/notifications/beacon/ACSQ24PNGS6NWW6MOJJNMADS2QWV3A5CNFSM4WDIFRJ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOFVXNH3Q.gif

Ken98045 commented 3 years ago

If you are interested in getting back on this project I could really use help in 2 areas.

The first is rather boring, but I need urgent help getting the installer in shape.

The second could prove much more interesting. I would like to provide the feature of creating areas that are something other than rectangles. This could be polygons, it could involve circles too, or even bit, by bit definitions. You could work on this as a completely separate branch with the code all your own. It is a 2 part project itelf. First, a UI for defining areas, and second establishing whether an object overlapps one of these areas.

I know it isn’t Kosher for me to “assign” you parts of the project, but at least the second should be interesting, I can easily keep myself out of these areas, and they would offer significant value.

I am largely working on code cleanup right now. This could take a while since the code grew daily without an overall plan and is a real mess. I will probably offer some low complexity additional features, but should leave the previously described areas alone. Another area I’ll probably work on part time is moving the code to .NET Core.

I do have some stuff ready for a checkin within a few days.

If you are no longer interested in working on it, please let me know that too. I wouldn’t blame you too much because of the code mess. In addition, this is my first Open Source project, and I’ve probably made all kinds of mistakes with organization, procedures, and courtesies.

From: Mike Farrington [mailto:notifications@github.com] Sent: Monday, January 18, 2021 5:04 AM To: Ken98045/On-Guard Cc: Ken98045; Mention Subject: Re: [Ken98045/On-Guard] Project structure and folder cleanup (#8)

Sorry, I wasn't really online this weekend.

The build errors due to the missing DBMotionFiles is because your .gitignore file has exclusions for SQL .MDF/.LDF files on line 250. It is "bad form" to have large binary files in git. In order for me to start working on the project, I had to go grab these database files from my installation. This was one of the reasons I was talking about looking towards EntityFramework... it'll create the database on project launch.

I am using Visual Studio 16.8.4 (Professional Edition). Here's a Visual Studio tip for you... if things go really wonky like they did for you, you want to clear the visual studio cache for your solution. You need to delete the .VS subfolder in the solution folder (while Visual Studio is closed of course).

You mentioned that you did not see the Bird changes. That is because those are in a different pull request. It is good form to have isolated feature branches / pull requests.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Ken98045/On-Guard/pull/8#issuecomment-762237934 , or unsubscribe https://github.com/notifications/unsubscribe-auth/ACSQ24O5UHVL63FDIHX5WYDS2QWV3ANCNFSM4WDIFRJQ . https://github.com/notifications/beacon/ACSQ24PNGS6NWW6MOJJNMADS2QWV3A5CNFSM4WDIFRJ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOFVXNH3Q.gif