|
|
|
date: Thu, 12 Jun 2008 04:20:08 +0800,
group: microsoft.public.xml
back
Re: algorithm to get xml update
Elliot wrote:
> I propose to write a C# program to get the content of a xml file.
> However, that file may be modified after 10 seconds, 10 minutes or 10
> hours.
> I think the algorithm of getting the content every 10 seconds to check
> whether it was chaged is too stupid, assuming there are 50,000 users
> running the program(cause a heavy workload for the web server, worse
> still it is unable to handle).
> Certainly, less than 10-second delay is acceptable if real-time is
> impossible.
> Please advise me a better algorithm.
> Any idea would be appreciated.
Do you need to know *what* was changed, or merely the fact that it *was*
changed?
If it's only the latter, and the file is a disk file, then a simple
script to monitor the file status or last-written date would be much
faster than a program that read and re-read the whole file.
///Peter
date: Wed, 11 Jun 2008 22:59:53 +0100
author: Peter Flynn
Re: algorithm to get xml update
I assume you must do this over the internet; that you do not have local
access to the file, but it will help to know that for sure.
If you can access the file locally, then Windows has a few functions that
will help.
If you cannot access the file locally and must query over the internet, then
it is possible to query the last modified date and time of a file. If you do
that, then you don't need to read all the data just to determine if it has
changed. I forget how to do it; it is something I wanted to do a couple of
weeks ago but I can't find any of the samples I have of doing it. I thought
the data was part of the HTTP headers but I don't find it there. Getting the
last update time of a file over the internet is a very common thing to do
and I am sure we could find the answer easily if that will help you. I just
did not pursue it further when I was looking a couple of weeks ago but I
know I have samples somewhere in my system.
"Elliot" wrote in message
news:223B8966-8D9E-46FE-89BD-C408E1741988@microsoft.com...
>I propose to write a C# program to get the content of a xml file.
> However, that file may be modified after 10 seconds, 10 minutes or 10
> hours.
> I think the algorithm of getting the content every 10 seconds to check
> whether it was chaged is too stupid, assuming there are 50,000 users
> running the program(cause a heavy workload for the web server, worse still
> it is unable to handle).
> Certainly, less than 10-second delay is acceptable if real-time is
> impossible.
> Please advise me a better algorithm.
> Any idea would be appreciated.
>
date: Wed, 11 Jun 2008 15:59:08 -0700
author: Sam Hobbs _change_social_to_socal
Re: algorithm to get xml update
I have to know whether the xml file was changed first.
Another problem is that, when there are many users are doing that(get the
last modified date of the xml file every 10 seconds), will bring out the
issue of server bandwidth and memory. Is there anything in C# just like
real-time in Java? Either real-time or get the date every 10 seconds is
better you think?
"Peter Flynn" wrote in message
news:6bb06pF39a037U2@mid.individual.net...
> Elliot wrote:
>> I propose to write a C# program to get the content of a xml file.
>> However, that file may be modified after 10 seconds, 10 minutes or 10
>> hours.
>> I think the algorithm of getting the content every 10 seconds to check
>> whether it was chaged is too stupid, assuming there are 50,000 users
>> running the program(cause a heavy workload for the web server, worse
>> still it is unable to handle).
>> Certainly, less than 10-second delay is acceptable if real-time is
>> impossible.
>> Please advise me a better algorithm.
>> Any idea would be appreciated.
>
> Do you need to know *what* was changed, or merely the fact that it *was*
> changed?
>
> If it's only the latter, and the file is a disk file, then a simple
> script to monitor the file status or last-written date would be much
> faster than a program that read and re-read the whole file.
>
> ///Peter
date: Thu, 12 Jun 2008 16:22:06 +0800
author: Elliot
Re: algorithm to get xml update
I will access the xml file on the Internet.
I found one but have not tried yet. How do you feel the idea from otaku?
http://www.dynamicdrive.com/forums/archive/index.php/t-9510.html
"Sam Hobbs" <samuel@social.rr.com_change_social_to_socal> wrote in message
news:OFhL6aBzIHA.3884@TK2MSFTNGP05.phx.gbl...
> I assume you must do this over the internet; that you do not have local
> access to the file, but it will help to know that for sure.
>
> If you can access the file locally, then Windows has a few functions that
> will help.
>
> If you cannot access the file locally and must query over the internet,
> then it is possible to query the last modified date and time of a file. If
> you do that, then you don't need to read all the data just to determine if
> it has changed. I forget how to do it; it is something I wanted to do a
> couple of weeks ago but I can't find any of the samples I have of doing
> it. I thought the data was part of the HTTP headers but I don't find it
> there. Getting the last update time of a file over the internet is a very
> common thing to do and I am sure we could find the answer easily if that
> will help you. I just did not pursue it further when I was looking a
> couple of weeks ago but I know I have samples somewhere in my system.
>
>
> "Elliot" wrote in message
> news:223B8966-8D9E-46FE-89BD-C408E1741988@microsoft.com...
>>I propose to write a C# program to get the content of a xml file.
>> However, that file may be modified after 10 seconds, 10 minutes or 10
>> hours.
>> I think the algorithm of getting the content every 10 seconds to check
>> whether it was chaged is too stupid, assuming there are 50,000 users
>> running the program(cause a heavy workload for the web server, worse
>> still it is unable to handle).
>> Certainly, less than 10-second delay is acceptable if real-time is
>> impossible.
>> Please advise me a better algorithm.
>> Any idea would be appreciated.
>>
>
>
>
date: Thu, 12 Jun 2008 16:22:21 +0800
author: Elliot
Re: algorithm to get xml update
There is a lot of discussion in that discussion but I think it won't help
you. I did not read all of it but all the sample code in that discussion
seems to be using ASP from the system that the file is in.
"Elliot" wrote in message
news:BE0EC094-14B4-4609-917A-096725974745@microsoft.com...
>I will access the xml file on the Internet.
> I found one but have not tried yet. How do you feel the idea from otaku?
> http://www.dynamicdrive.com/forums/archive/index.php/t-9510.html
>
>
> "Sam Hobbs" <samuel@social.rr.com_change_social_to_socal> wrote in message
> news:OFhL6aBzIHA.3884@TK2MSFTNGP05.phx.gbl...
>> I assume you must do this over the internet; that you do not have local
>> access to the file, but it will help to know that for sure.
>>
>> If you can access the file locally, then Windows has a few functions that
>> will help.
>>
>> If you cannot access the file locally and must query over the internet,
>> then it is possible to query the last modified date and time of a file.
>> If you do that, then you don't need to read all the data just to
>> determine if it has changed. I forget how to do it; it is something I
>> wanted to do a couple of weeks ago but I can't find any of the samples I
>> have of doing it. I thought the data was part of the HTTP headers but I
>> don't find it there. Getting the last update time of a file over the
>> internet is a very common thing to do and I am sure we could find the
>> answer easily if that will help you. I just did not pursue it further
>> when I was looking a couple of weeks ago but I know I have samples
>> somewhere in my system.
>>
>>
>> "Elliot" wrote in message
>> news:223B8966-8D9E-46FE-89BD-C408E1741988@microsoft.com...
>>>I propose to write a C# program to get the content of a xml file.
>>> However, that file may be modified after 10 seconds, 10 minutes or 10
>>> hours.
>>> I think the algorithm of getting the content every 10 seconds to check
>>> whether it was chaged is too stupid, assuming there are 50,000 users
>>> running the program(cause a heavy workload for the web server, worse
>>> still it is unable to handle).
>>> Certainly, less than 10-second delay is acceptable if real-time is
>>> impossible.
>>> Please advise me a better algorithm.
>>> Any idea would be appreciated.
>>>
>>
>>
>>
>
date: Thu, 12 Jun 2008 03:15:13 -0700
author: Sam Hobbs _change_social_to_socal
Re: algorithm to get xml update
Oh, it is. It is ASP.NET, unuseful for C# application program.
"Sam Hobbs" <samuel@social.rr.com_change_social_to_socal> wrote in message
news:eu5f0UHzIHA.3884@TK2MSFTNGP05.phx.gbl...
> There is a lot of discussion in that discussion but I think it won't help
> you. I did not read all of it but all the sample code in that discussion
> seems to be using ASP from the system that the file is in.
>
>
> "Elliot" wrote in message
> news:BE0EC094-14B4-4609-917A-096725974745@microsoft.com...
>>I will access the xml file on the Internet.
>> I found one but have not tried yet. How do you feel the idea from otaku?
>> http://www.dynamicdrive.com/forums/archive/index.php/t-9510.html
>>
>>
>> "Sam Hobbs" <samuel@social.rr.com_change_social_to_socal> wrote in
>> message news:OFhL6aBzIHA.3884@TK2MSFTNGP05.phx.gbl...
>>> I assume you must do this over the internet; that you do not have local
>>> access to the file, but it will help to know that for sure.
>>>
>>> If you can access the file locally, then Windows has a few functions
>>> that will help.
>>>
>>> If you cannot access the file locally and must query over the internet,
>>> then it is possible to query the last modified date and time of a file.
>>> If you do that, then you don't need to read all the data just to
>>> determine if it has changed. I forget how to do it; it is something I
>>> wanted to do a couple of weeks ago but I can't find any of the samples I
>>> have of doing it. I thought the data was part of the HTTP headers but I
>>> don't find it there. Getting the last update time of a file over the
>>> internet is a very common thing to do and I am sure we could find the
>>> answer easily if that will help you. I just did not pursue it further
>>> when I was looking a couple of weeks ago but I know I have samples
>>> somewhere in my system.
>>>
>>>
>>> "Elliot" wrote in message
>>> news:223B8966-8D9E-46FE-89BD-C408E1741988@microsoft.com...
>>>>I propose to write a C# program to get the content of a xml file.
>>>> However, that file may be modified after 10 seconds, 10 minutes or 10
>>>> hours.
>>>> I think the algorithm of getting the content every 10 seconds to check
>>>> whether it was chaged is too stupid, assuming there are 50,000 users
>>>> running the program(cause a heavy workload for the web server, worse
>>>> still it is unable to handle).
>>>> Certainly, less than 10-second delay is acceptable if real-time is
>>>> impossible.
>>>> Please advise me a better algorithm.
>>>> Any idea would be appreciated.
>>>>
>>>
>>>
>>>
>>
>
>
>
date: Fri, 13 Jun 2008 02:50:55 +0800
author: Elliot
|
|