473,387 Members | 1,344 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Can this task be done a better way?

I have an IQ of a donkey, I'm sure the below code can be done a
different/more intelligent way. It should download headers in chunks
of 5000, rather than all 2 million in one go:

$Newsgroup_Data = $NNTP->selectGroup($Newsgroup_Name);

$First_Article_Number = $Newsgroup_Data["first"];
$Last_Article_Number = $Newsgroup_Data["last"];

$Articles_To_Download = $Last_Article_Number - $First_Article_Number;

while($First_Article_Number <= $Newsgroup_Data["last"])
{
$Last_Article_Number = $First_Article_Number + 4999;
$Articles = $NNTP->getOverview($First_Article_Number,
$Last_Article_Number);
$First_Article_Number = $First_Article_Number + 5000;

// do something with the headers here

unset($Articles);
}

Sep 27 '07 #1
1 1261
qw*******@googlemail.com wrote:
I have an IQ of a donkey, I'm sure the below code can be done a
different/more intelligent way. It should download headers in chunks
of 5000, rather than all 2 million in one go:

$Newsgroup_Data = $NNTP->selectGroup($Newsgroup_Name);

$First_Article_Number = $Newsgroup_Data["first"];
$Last_Article_Number = $Newsgroup_Data["last"];

$Articles_To_Download = $Last_Article_Number - $First_Article_Number;

while($First_Article_Number <= $Newsgroup_Data["last"])
{
$Last_Article_Number = $First_Article_Number + 4999;
$Articles = $NNTP->getOverview($First_Article_Number,
$Last_Article_Number);
$First_Article_Number = $First_Article_Number + 5000;

// do something with the headers here

unset($Articles);
}
What's wrong with what you have?

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Sep 28 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: John Smith | last post by:
Hello, I have a rather odd question. My company is an all java/oracle shop. We do everything is Java... no matter what it is... parsing of text files, messaging, gui you name it. My question...
0
by: mystique | last post by:
I have a strange SQL Server 2000 DTS problem. I have a DTS Package that has three tasks in it. The first task is an Execute SQL Task that writes an entry to a log table, truncates a different table...
7
by: Konrad Viltersten | last post by:
I have a project that resulted eventually in a few tousands of HTML-files on the following form. file name: F1717.HTML ---------------------------- <html> .... <h1>Text to the...
3
by: Carl Johansen | last post by:
I'm not sure of the best way to do what I want. Users of my website want to run reports that take a long time to generate. This is what I would like to happen: 1. User requests aspx page 2....
11
by: Max | last post by:
I'm writing a program that needs to be able to create custom .job files and add them to the scheduled tasks folder. What I'd like to know is, what is the format of a .job file and how do I go about...
8
by: pamelafluente | last post by:
I am reposting hoping better luck :) I can't achieve this simple thing: I have an animated gif in an image control (ImageProgress1). The image visibility is set to false. I want that when the...
3
by: lai_waiman | last post by:
Dear All, I have problems on doing some long lasting job in a web services. Let me first provide some background information first. I have a ASP.NET web page, which will call another Web...
7
by: HMS Surprise | last post by:
Greetings, I have just started a new job and need to develop a routine that accesses the web. I am experienced with assy, c/c++, and tcl/tk, but know almost nothing of HTML. My task is to...
1
by: Anonieko | last post by:
How do you run a long running task in ASP.NET in thread and avoid multiple instances of this task from running? I saw a solution somewhere but do you have a better one? publicvoid...
1
by: ujwalarali85 | last post by:
Site user can start some task by submitting some information. But he don't stay their to complete that task. I have to add the task in queue and done this at back end and after completion of task I...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.