|
note: i am using OnPropertyChanging here.
Gerry Schmitz wrote: The binding engine then simply refreshes all bound properties. Source of this ?
Speed is the issue here: preventing runaway recursion is.
«The mind is not a vessel to be filled but a fire to be kindled» Plutarch
|
|
|
|
|
Thanks, Harold,
What does "matrix" mean here ? How can you have "reciprocity" and "invariant."
i'm dense, and, light-headed, these daze
«The mind is not a vessel to be filled but a fire to be kindled» Plutarch
|
|
|
|
|
Your data structure is really a sparse matrix, right? It's a bit hidden behind the domain-specific terminology, but in the end it's a weighted graph represented as a sparse matrix. There's nothing wrong with that, it's a standard way to manipulate weighted (and even unweighted) graphs in both programming and mathematics.
BillWoodruff wrote: How can you have "reciprocity" and "invariant." Well I mean, there is some invariant on this matrix that you are maintaining, right? And it has something to do with the reciprocal edge (you called it that, I'm just going with it). If a weight somewhere is changed, then its "mirror image" (the reverse edge) needs to change in some way to restore that invariant. I didn't really get how it needs to be changed specifically (or what the invariant is that is being maintained by that change), but I suppose that's largely an implementation detail that doesn't need to affect the overall architecture.
So essentially my suggestion is: make the overall matrix responsible for maintaining that invariant, not the edges. And so, the edges would not try to "fix themselves" in response to an event, you would tell the matrix to change an edge weight and it would directly do so in a way that maintains the invariant (by changing the weight of an edge and the corresponding reverse edge), with no events involved (of course you can still raise them, but that wouldn't be the mechanism for maintaining the invariant).
|
|
|
|
|
Thanks, Harold, okay ... for you sparse matrix; for me, node/edge Object graph.harold aptroot wrote: make the overall matrix responsible for maintaining that invariant, not the edges. I'm going to implement that and see how it might work.
i hate the idea of removing and readding event handlers.
more ? in a while
«The mind is not a vessel to be filled but a fire to be kindled» Plutarch
|
|
|
|
|
This is the error I get when I try to run the sample app:
The reference assemblies for .NETFramework,Version=v4.0 were not found. To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework version or retarget your application. You can download .NET Framework Developer Packs at https://aka.ms/msbuild/developerpacks
I have downloaded and run "ndp481-devpack-enu.exe" from "dotnet.microsoft.com/en-us/download/visual-studio-sdks?cid=msbuild-developerpacks".
But I am new to C# so I may have done something wrong.
|
|
|
|
|
If you got the code from an article, then there is a "Add a Comment or Question" button at the bottom of that article, which causes an email to be sent to the author. They are then alerted that you wish to speak to them.
Posting this here relies on them "dropping by" and realising it is for them - we have no idea what "sample app" you are referring to!
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Member 16073627 wrote: The reference assemblies for .NETFramework,Version=v4.0 ...
ndp481-devpack-enu.exe
You have downloaded the developer pack for .NET Framework 4.8.1, whereas your error message says your project targets .NET Framework 4.0.0.
The page you've linked to doesn't provide a download for 4.0.0; this page[^] explains why:
Starting with Visual Studio 2022, Visual Studio no longer includes .NET Framework components for .NET Framework 4.0 - 4.5.1 because these versions are no longer supported. Visual Studio 2022 and later versions can't build apps that target .NET Framework 4.0 through .NET Framework 4.5.1. To continue building these apps, you can use Visual Studio 2019 or an earlier version.
According to this page[^], if you install VS2019 and select the ".NET 4 multi targeting pack" option, then you may be able to build .NET Framework 4.0 applications in VS2022. Otherwise, you'll need to stick with VS2019.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I am searching for a similar solution to the Zkteco project however it's for HikVision Biometrics devices.
Let me know if you are able to do this project we can set up a call to explain more.
|
|
|
|
|
You're in the wrong place. This is not a "for hire" site.
If you want to hire someone for a project, try Freelancer.com, but keep in mind, you get what you pay for.
|
|
|
|
|
|
I'm trying to save my list of numbers with a Zero to the left of the numbers <=9 and it's not having any effect,
I'm using the following code in Insert:
cmd.Parameters.AddWithValue("@_01", número._01.ToString("D2"));
I have the same code on Sql server and it works perfect,
would there be another way to do this in SqLite?
|
|
|
|
|
Displaying leading zeros on a number is usually a UI presentation thing, not a database thing.
Is the SqlLite column a numeric one or is it a text column? If you're not actually verifying this right now, after you read this, you're guessing and that's bad for troubleshooting.
Leading zeros on a value will only work if the column type is NOT numeric. Like I said, this is usually something that should be handled by the UI, not in the database.
|
|
|
|
|
@Dave Kreskowiak, Thank you very much for answering, it helped me a lot, a hug.
Where do I mark as resolved?
|
|
|
|
|
You don't have to - forums here don't have a facility for that as they are discussion based rather than "Question / Answer". We have an area for those that has a "solved" indicator: Quick Answers[^]
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Hello,
in a .csproj file, I create a nuget package with msbuild.
All works, except that I want this package is dependent of another nuget packages.
In a nuspec file, I would write something like :
<dependencies>
<dependency id="otherNugetPackage1" version="2.0.8">
<dependency id="otherNugetPackage2" version="1.0.55">
But how could I do the same thing in the csproj file ? In which section please ?
Thank you
Chris
|
|
|
|
|
Just add a reference to the relevant NuGet packages; they will automatically be included as dependencies.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Thank you for the answer.
I do not despair of having a solution that fits into the csproj.
Chris
|
|
|
|
|
NuGet references are already stored in the csproj file:
<ItemGroup>
<PackageReference Include="otherNugetPackage1" Version="2.0.8" />
<PackageReference Include="otherNugetPackage2" Version="1.0.55" />
</ItemGroup> What's the problem?
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I want to add dependencies to nuget packages who are NOT referenced by the project.
I have missed this precision ...
|
|
|
|
|
Why? If your project doesn't reference them, then they're not dependencies of your project.
If you really want to do it, then there's no problem adding "unused" package dependencies to your project. Unless there's some specific (probably malicious) behaviour when you add such a reference, which you don't want to apply to your project?
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Hello, I don't want to add dependencies to the project, I want to add nuget packages dependencies to the generated nuget package.
Imagine I have a third-party nuget package, containing only static datas. Only the package I try to create needs the datas, and only at runtime, not at compile time.
So : no need and no reason to add the dependant package to the project.
No ?
Chris
|
|
|
|
|
If your code needs the referenced library at runtime, then it's a dependency, and should be added as a reference. It's not going to have any adverse effect on your project, whereas missing the dependency at runtime will lead to runtime crashes.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Hello Colleagues, I would like to take a doubt!
Personal apologies if this is something I could google, but as you know there are a lot of articles with no opinion on the subject, I spent days reading and got nowhere.
I prefer your opinion...
I recently changed my project, disconnected from the database and saved it in a Text file, as it was just a table and nothing confidential, I solved it this way, because I think that when installing it will make the process easier, but a doubt arose in me on how to edit, and delete just one line from the file following the Contest column which is the first column,
-Question: Is it possible to edit only a certain line in a text file with more than two thousand lines?
Is it possible to delete a particular row tabem?
if it is possible: what would be the best way (Indication),
If not, what would be the best way?
database or what other way?
I have a form like in the image where I can type the numbers and save
Exemple image
my Save button and your Save TXT method
private void salvarTXT()
{
if (!string.IsNullOrWhiteSpace(txtConcurso.Text))
{
resultUltimat();
MessageBox.Show("Texto salvo com sucesso!");
}
else
{
MessageBox.Show("Insira um Resultado para salvar no arquivo Texto!", "Informação", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
private void resultUltimat()
{
const string nomeArquivo = @"C:\BoaSorte\Banco\Resultados.txt";
List<string> linhas = File.ReadLines(nomeArquivo).ToList();
if (linhas.IndexOf(txtConcurso.Text + "," + ResultTextBox[0].Text + "," + ResultTextBox[1].Text + "," + ResultTextBox[2].Text + "," + ResultTextBox[3].Text + "," + ResultTextBox[4].Text
+ "," + ResultTextBox[5].Text + "," + ResultTextBox[6].Text + "," + ResultTextBox[7].Text + "," + ResultTextBox[8].Text + "," + ResultTextBox[9].Text
+ "," + ResultTextBox[10].Text + "," + ResultTextBox[11].Text + "," + ResultTextBox[12].Text + "," + ResultTextBox[13].Text + "," + ResultTextBox[14].Text) >= 0);
else
{
linhas.Insert(0, txtConcurso.Text + "," + ResultTextBox[0].Text + "," + ResultTextBox[1].Text + "," + ResultTextBox[2].Text + "," + ResultTextBox[3].Text + "," + ResultTextBox[4].Text
+ "," + ResultTextBox[5].Text + "," + ResultTextBox[6].Text + "," + ResultTextBox[7].Text + "," + ResultTextBox[8].Text + "," + ResultTextBox[9].Text
+ "," + ResultTextBox[10].Text + "," + ResultTextBox[11].Text + "," + ResultTextBox[12].Text + "," + ResultTextBox[13].Text + "," + ResultTextBox[14].Text);
File.WriteAllLines(nomeArquivo, linhas);
}
}
my text file is being saved like this
[Exemple Image]
How I tried the edit method
private void editar()
{
try
{
using (StreamReader lendo = new StreamReader(@"C:\BoaSorte\Banco\Resultados.txt"))
{
while (lendo.Peek() != -1)
{
int linha = File.ReadAllLines(@"C:\BoaSorte\Banco\Resultados.txt").GetLength(0);
for (int i = 1; i <= linha; i++)
{
if (lendo.ReadLine() == txtConcurso.Text)
{
string caminhoArquivo = @"C:\BoaSorte\Banco\Resultados.txt";
string[] arquivo = File.ReadAllLines(caminhoArquivo);
lendo.Close();
System.IO.File.WriteAllLines(caminhoArquivo, arquivo);
}
}
}
}
}
catch (Exception)
{
}
or like this
private void ChangeUser(string currentUser, string newUser, int position)
{
string sourceFile = @"C:\BoaSorte\Banco\Resultados.txt";
string[] lines = File.ReadAllLines(sourceFile);
if (lines.Length == 0)
{
MessageBox.Show("Seu arquivo está vazio!");
return;
}
using (StreamWriter writer = new StreamWriter(sourceFile))
{
for (int i = 0; i < lines.Length; i++)
{
if (i == position && lines[i] == txtConcurso.Text)
{
writer.WriteLine(ResultTextBox[i].Text);
}
else
{
writer.WriteLine(lines[i]);
}
}
}
}
I appreciate any advice, opinion or indication
|
|
|
|
|
Text files don't have lines: they have an "end of line" symbol which is recognised by the application and interpreted as line end marker - for C# apps, that is normally "\n" or occasionally "\r\n" for some systems. They are stored by the operating as binary data that just happens to be "human readable".
That means that you can't "delete", "add", or even "change" a "Line" in a text file: to do any of that, you have to create a new file, copy everything up to the change point over, then write you new line to the output file (insert a line), skip over a line in the input file (delete a line) or do both (change a line), then copy the rest of the file over, close both files, delete the original, and rename the new one to the old file name.
This is considerably more work than using a database, and much more prone to errors! And if this is a multiuser file you are playing with, you are going to have to handle all of the fun-and-games that comes with that yourself as well, and that really isn't trivial at all!
I'd strongly suggest that you don't go down this route: it's a complicated solution to a relatively simple problem ...
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Thank you very much for your suggestion, I've been reading about SqLite, it seems like a good option, my concern would be when installing Sql Server is very complicated, I'll follow your suggestion and I'll iterate on other lighter banks.
a hug and stay with God.
|
|
|
|
|