|
You're using a WebRequest; not sure if it would work, but for a normal webserver I'd set the LastModified[^] and see if it returns a HTTP304.
That's how I keep my host-file up to date
Kevin Marois wrote: How can I tell weather or not a file has changed since the last download? If files are only modified over FTP, then the upload is the last change, isn't it?
For the host-file, I "remember" locally when I fetched my version, and send that datetime when requesting the new version. Only http-headers are sent back, so not much traffic
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Problem definition is fuzzy.
If you are sending files to a client PC then you can manage the files on your server completely.
For example
1. You have a landing directory, on your server, where files arrive
2. You MOVE files from that directory to your processing directory and update a processing log file.
3. You keep track of the files that were successfully sent to each client and correlate it with the file in 2 to insure what new files need to be sent. You send files from the processing directory, not the landing directory.
|
|
|
|
|
Dear Community. I'm not professional developer, but I have constant need for some small specific applications. Usually I can't find free and adequate solutions for these purposes and finally decided to learn how to write my own. But I can't find suitable development solution.
1. I know C# (more or less) since I'm learning Unity coding and was studying this language at University. I don't want to learn something else at this point.
2. I need to create applications that run on Windows and Linux (since I use both OS) without re-writing front-end (or the whole application) from scratch for each platform.
3. I need rich GUI like in JavaFX or desktop-web applications (like Electron-based) which will be looking the same way on each platform. I DO NOT need native look/feel. Two purposes for that: 1) I need to implement some graphical data visualization (bars, diagrams, etc.) and 2) I'm a designer and I love nice looking applications.
4. I need free solution. I'm not planning some kind of distribution or selling my apps, they're just for me for now, but if one day I decide to do this, I don't want something that will stop me or force me to open my code somehow (through GPL, for example).
5. Ideally I need solution with WYSIWYG-editor (like with WPF or JavaFX).
Is there something that fits these conditions?
* I think GTK is not suitable for me because of its orientation to native looking. And GTK apps look just odd on Windows. And as far as I can say there's not much visual capabilities here.
* I think Qt is also not suitable because of its license. Most of Qt libraries are GPL, while some of them LGPL. And the whole license theme here is unclear for me (and not only for me, there's a lot of topics on forums about it).
* I don't want to use Electron because, well – wrapping relatively small application with the whole Chromium engine? Really? I've used some of Electron application and they're slow, big (in term of disk space) and eating lot of memory.
* JavaFX is looking really great, but it is the new programming language for me. I get the point that C# and Java are relatively similar, but I really don't want to dive deeper into some new language. And besides I'm still not sure about performance and dependency from JRE.
* Xamarin doesn't have compiling ability to Linux.
* There's also JUCE Framework, but as far as I can say it needs C++ and hasn't truly free license.
* I heard about AvaloniaUI, but as far as I get it – it's not mature enough for production needs.
For now I ended up learning Sciter (didn't hear anything about it before and I'm sure that many people didn't). It's like Electron but without Chromium and with lightweighted engine instead. And it can use C# for back-end. But there's very few tutorials on the web, absolutely nothing on YouTube, small community. And I found creating UI just with bare HTML/CSS/JS without some kind of WYSIWYG-editor is pain in my ass. And, well, I almost don't know JS, so it takes time to make something.
I understand that I probably want too much. But maybe I missed something? Thanks in advance!
|
|
|
|
|
There is one truly obvious option that you have neglected that would actually fit your needs, and that's a WCF (or other web host) based application interface that provides a UI like a web app. An OWIN server is pretty much trivial in terms of resource usage, and I can't imagine that the ASP.NET Core web server is that different based on what I've read about it.
It works, there's tones of references that you can follow for running an integral server, and it's honestly the only real free cross-platform solution I've seen that will not take a mountain of custom code to achieve. The minus is that you need a foundation in JavaScript and web apps to work with it.
"There are three kinds of lies: lies, damned lies and statistics."
- Benjamin Disraeli
|
|
|
|
|
I'm using simple and plain old WinForms, on both Ubuntu/Mono and Windows/Net. Works like advertised.
You can use VS (the free version) to "draw" your forms.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Guys,
Is it possible to synch 4 databases in mysql? I mean there are 4 servers on different location and databases on server will be in Auto Synch mode. If any one goes down rest of the three gets sync automatically and it goes UP, all 4 gets synch automatically.
Please reply...!
|
|
|
|
|
You're talking about sharding, replication, and load balancing, which is great, but unless you're writing software that will perform this task, this is the wrong forum for it. I'd suggest the System Administrator or Database forums.
"There are three kinds of lies: lies, damned lies and statistics."
- Benjamin Disraeli
|
|
|
|
|
I'm working on a C/WPF/SQL Server app.
My SQL tables all have the following columns:
CreatedById INT NOT NULL FOREIGN KEY REFERENCES Users(UserId),
CreatedDt DATETIME NOT NULL,
LastModifiedById INT NULL FOREIGN KEY REFERENCES Users(UserId),
LastModifiedDT DATETIME NULL,
DeletedById INT NULL FOREIGN KEY REFERENCES Users(UserId),
DeletedDt DATETIME NULL
When the user logs into the app the login function returns a User object which is stored on the MainWindowViewModel.
The question is this: What's the righ way to get the ID of he logged in user into the DAL?
I could simply pass the use Id into every DAL function, but I'd like to hear other suggestions.
Thanks
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.
|
|
|
|
|
The "right" way is entirely contingent on what you want to achieve.
If you're trying to provide a security layer, it could be parsed through an authorization provider with full transactional change tracking posted to a completely different database. This would, by necessity, have the transaction and user info passed to an authorization (or even AAA) provider, which would pass the results of the authorization to the DAL on success in an object that should contain the UserId regardless.
If you're looking for basic audit trails, a simple M-M mapping table that triggers off of update events would be just fine (user, table, item id, SQL query OR enumeration describing transaction). You could also create multiple M-M tables for each data table to provide robust relational support. Using this method, the context information, including the UserId, can be passed through an event handler rather than as a parameter.
If you just want the UserId as a creator, you can just pass the value or have it available in a context that is passed to the DAL on construction.
And there are, of course, other approaches ad nauseum.
"There are three kinds of lies: lies, damned lies and statistics."
- Benjamin Disraeli
|
|
|
|
|
Kevin Marois wrote:
I could simply pass the use Id into every DAL function, but I'd like to hear other suggestions. Compared to what alternative?
Fetching the entire table and doing the lookup in memory?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Eddy Vluggen wrote: Fetching the entire table and doing the lookup in memory?
Explain this. Fetching WHAT table??
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.
|
|
|
|
|
Kevin Marois wrote: Explain this. Fetching WHAT table?? Ah. The "SQL tables" that you were referring to;
Kevin Marois wrote: My SQL tables all have the following columns:
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Why would I ever need to "fetch" the tables? I'm doing an Insert/Delete/Update.
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.
|
|
|
|
|
Kevin Marois wrote: Why would I ever need to "fetch" the tables? I'm doing an Insert/Delete/Update. Most things that are written are read at some point. Let me rephrase then, what alternative would there be compared to passing the userId when you insert/delete/update?
How about Functions That Return User Names and User IDs[^]?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Your question is phrased in such a way that it is confusing.
Summary of the actual problem.
1. You have a number of tables which you want to update with information specific to the user that initiated the action.
2. You want to know how to get the user information, automatically, to the point to where it is used.
First problems with this architecture.
1. You said "all". Generally a bad idea. Often tables represent structure that has nothing to do with users and keeping data specific to the user every where is pointless.
2. It is better to track what a user did in the business sense and not in the data sense. This leads to several requirements that you often want to know what general action initiated the action, you want to keep the entire history (more than one user) and you need to deal with what happens when a user is deleted from the system.
3. Automated processes can be required to update a system. They have not user.
4. Some systems allow for one user to act on the behalf of another user. Single data collection points do not allow for that action to be captured.
Solution to your specific problem is as follows.
1. A user action is either initiated as a request (thread level) or a message (not thread level.)
2. As a request you can use the class ThreadLocal to store the user and then many layers later you retrieve the user from the ThreadLocal for use in your DAL.
3. A message has no way to transport that information except via a specific attribute. But the message should have originated as a request (real people must always start with real UI actions) so one uses 2 at the point where the message is created to add the user to the message. Then end that processes the message (again in a thread) extracts the user and puts it into the ThreadLocal that is processing now.
I suggest that you insure at and request origination point that you should, for all exit points, including exceptions, clear the user.
I suggest that you test the usage of the user at all usage points to insure that it does in fact exist, before attempting to use it. That insures no null pointers.
I suggest creating a user proxy object, do NOT use the original DAL user object, to contain the information about the user. That proxy object must be exposed to ALL layers whereas the DAL user object should not be.
|
|
|
|
|
Blockchain!
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|
|
if u solved can u give the code...
|
|
|
|
|
I have solved it but I can't give it to you as you aren't a level 8 wizard.
This space for rent
|
|
|
|
|
What about a level 9 cleric?
Natch it is never usable by a barbarian regardless of level.
|
|
|
|
|
I have an old Silverlight application that I would like to convert for demonstration purposes. Converting to WPF is relatively trivial.
Does the hive mind know if it is possible to:
Deploy SQL Server to Azure - Yes
Deploy a WCF to Azure
Use clickonce deployment via Azure
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
|
I feel like a ditz, I found both of them after I posted.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
The back end is C# / MVC / Knockout
I've been trying to figure this out for a while with no luck. I can get it to partially work but the session is never passed back to the end user.
What I'm trying to figure out is how to add a single signon (non SAML/oAuth; that's already working) to authenticate a user to a remote site using a username / password combination. Most sites are HTML so from the server I can issue a login and it works. If I try to do this through the browser I get cross-site scripting errors (which I would expect). I know other people are doing this successfully. I need to do this device / browser independent. Outside of writing either a plugin for each browser, how is this accomplished?
|
|
|
|
|
I have these options =
A. Store more data into one single JSON document
Or
B. Distribute them as multiple documents
Storing data in one single doc, gives a neat solution, but I'm not sure how big is too big for a JSON document. What if it runs to 40-50 MB? Parsing docs of this size feels insane?
UPDATED:
This document works like an accumulator. For example, lets assume a requirement like this :
I need to store all the users taking part in discussions in CodeProject.
So, I need to capture the User ID & have a counter against each of them.
{User:1332,
PostCount:23, (incremented every time he posts a reply)
},
{User:1124,
PostCount:56,
},
{User:2323
PostCount:34
}
The document keeps growing as and when new users start posting in CP.
The document gets updated for the count, when old users make another post.
The document is read when the user metrics are needed to be shown on reports.
Now I have the option to maintain it- Yearly, Monthly or weekly OR just Keep it as a single document. Where all the users activities would be recorded in a single doc.
If you are dividing the document as Yearly, Monthly,weekly etc, The document size would be reasonable- Somewhere around <4-5MB (Monthly), but the no. of document would be more in the collection. You'll have to run an aggregate function to collect all the data & calculate the Count that's spread across documents for every user and produce the metrics. As I just said, Here the individual documents size would be reasonable as it can't go on increasing. It just bound by the start & end date.
And Single document means, Keeping everything in single file and keep updating it.
For calcs, Load the whole data in memory, run the aggregate function to parse through the document and produce the metrics.
(Single Document sounds like a Big-Fat approach. I think I'd rather keep them as monthly chunks and make it handy to handle the documents.)
Starting to think people post kid pics in their profiles because that was the last time they were cute - Jeremy Falcon.
modified 1-Dec-17 5:28am.
|
|
|
|
|
At that size it is no longer an exchange-format, but used as a data-store. In that case SQLite would probably be a better option.
Once wrote an application that used XML as a datastore; every edit means rewriting the entire file.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|