Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
XML
data.xmlanalysis
mappoint.webservice
msf
msxml-webrelease
netmyservices.sdk
passport.sdk
soap
soapsdk
uddi.general
uddi.programming
uddi.specification
xml
xmlsqlwebrelease
xsl
  
 
date: Thu, 12 Jun 2008 04:20:08 +0800,    group: microsoft.public.xml        back       


algorithm to get xml update   
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 04:20:08 +0800   author:   Elliot

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   
Elliot wrote:
> I will access the xml file on the Internet.
> ...

Then make sure that the HTTP server sends Last-Modified and ETag
headers, and make the GET request conditional
(<http://greenbytes.de/tech/webdav/rfc2616.html#rfc.section.14.26>, for
instance).

BR, Julian
date: Thu, 12 Jun 2008 16:12:49 +0200   author:   Julian F. Reschke

Re: algorithm to get xml update   
Elliot wrote:
> I will access the xml file on the Internet.
> ...

Then make sure that the HTTP server sends Last-Modified and ETag
headers, and make the GET request conditional
(<http://greenbytes.de/tech/webdav/rfc2616.html#rfc.section.14.26>, for
instance).

BR, Julian
date: Thu, 12 Jun 2008 16:13:08 +0200   author:   Julian F. Reschke

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

Re: algorithm to get xml update   
Any coding example to understand more?


"Julian F. Reschke"  wrote in message 
news:eOSUzZJzIHA.4772@TK2MSFTNGP03.phx.gbl...
> Elliot wrote:
>> I will access the xml file on the Internet.
>> ...
>
> Then make sure that the HTTP server sends Last-Modified and ETag
> headers, and make the GET request conditional
> (<http://greenbytes.de/tech/webdav/rfc2616.html#rfc.section.14.26>, for
> instance).
>
> BR, Julian
date: Fri, 13 Jun 2008 02:52:42 +0800   author:   Elliot

Re: algorithm to get xml update   
Elliot wrote:
> Any coding example to understand more?

Protocol examples are for instance in <http://www.w3.org/1999/04/Editing/>.
date: Fri, 13 Jun 2008 18:41:20 +0200   author:   Julian F. Reschke

Re: algorithm to get xml update   
no API in C# to obtain the last modified date?


"Julian F. Reschke"  wrote in message 
news:eExdRRXzIHA.5832@TK2MSFTNGP02.phx.gbl...
> Elliot wrote:
>> Any coding example to understand more?
>
> Protocol examples are for instance in 
> <http://www.w3.org/1999/04/Editing/>.
date: Tue, 17 Jun 2008 01:33:02 +0800   author:   Elliot

Re: algorithm to get xml update   
There was a time in the recent past when the internet was not available for 
the majority of people in the world. People now take it for granted.  I hope 
you appreciate the powerful resources you have available.

As I have indicated previously, there are enough articles and samples to 
make it possible for you to find what you need for this. The ability to 
search the internet and search other resources will be useful for this 
project and for many more you encounter in the future.


"Elliot"  wrote in message 
news:3FAD5B13-239F-4A81-903E-7AA891D53494@microsoft.com...
> no API in C# to obtain the last modified date?
>
>
> "Julian F. Reschke"  wrote in message 
> news:eExdRRXzIHA.5832@TK2MSFTNGP02.phx.gbl...
>> Elliot wrote:
>>> Any coding example to understand more?
>>
>> Protocol examples are for instance in 
>> <http://www.w3.org/1999/04/Editing/>.
date: Mon, 16 Jun 2008 20:35:24 -0700   author:   Sam Hobbs _change_social_to_socal

Re: algorithm to get xml update   
Not easy.


"Sam Hobbs" <samuel@social.rr.com_change_social_to_socal> wrote in message 
news:Og5jwsC0IHA.2188@TK2MSFTNGP04.phx.gbl...
> There was a time in the recent past when the internet was not available 
> for the majority of people in the world. People now take it for granted. 
> I hope you appreciate the powerful resources you have available.
>
> As I have indicated previously, there are enough articles and samples to 
> make it possible for you to find what you need for this. The ability to 
> search the internet and search other resources will be useful for this 
> project and for many more you encounter in the future.
>
>
> "Elliot"  wrote in message 
> news:3FAD5B13-239F-4A81-903E-7AA891D53494@microsoft.com...
>> no API in C# to obtain the last modified date?
>>
>>
>> "Julian F. Reschke"  wrote in 
>> message news:eExdRRXzIHA.5832@TK2MSFTNGP02.phx.gbl...
>>> Elliot wrote:
>>>> Any coding example to understand more?
>>>
>>> Protocol examples are for instance in 
>>> <http://www.w3.org/1999/04/Editing/>.
>
>
>
date: Fri, 20 Jun 2008 22:52:47 +0800   author:   Elliot

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us