dC++Lv

Know of something that might be useful to the DC community? Post it here! (Still, no advertising)

Moderator: Moderators

Locked
mai9
Posts: 111
Joined: 2003-04-16 23:02

dC++Lv

Post by mai9 » 2003-04-16 23:20

hi, I made this little proggie to parse upload.log and download.log and write some CSV files with the info.

If you want to take a look, it's here:

http://sf.net/projects/dcpplv

before you say it, it has a bug with kB

BSOD2600
Forum Moderator
Posts: 503
Joined: 2003-01-27 18:47
Location: USA
Contact:

Post by BSOD2600 » 2003-04-18 01:20

Sounds like a useful tool.....too bad I couldnt get it working. I let it run for 7 min on a P3, 1 ghz on 1.5MB download/upload logs with no results. It just sat there with "users found: " Was using 0.6

mai9
Posts: 111
Joined: 2003-04-16 23:02

mmm....

Post by mai9 » 2003-04-18 10:58

It didn't report any user, just that dummy line "users found:"?

Maybe it's a log format problem. This is the one I used (It was the default for DC++)

Code: Select all

for downloads:
%Y-%m-%d %H:%M: %[target] downloaded from %[user], %[size] (%[chunksize]), %[speed], %[time]

for uploads:
%Y-%m-%d %H:%M: %[source] uploaded to %[user], %[size] (%[chunksize]), %[speed], %[time]
According to my calculations it should take less than a microsecond to find the first user, since it will be in the first line :wink:

Try saving this line:

Code: Select all

2002-10-02 04:41: D:\Downloading\Edith Piaf - 20 `French' Hit Singles\Edith Piaf - 20 `French' Hit Singles - 20 - A quoi ca sert l'amour.mp3 downloaded from imp3ler, 3713573 (3713573), 2.11 kB/s, 0:28:37
into "Downloads.log" and run dC++Lv on it.

BSOD2600
Forum Moderator
Posts: 503
Joined: 2003-01-27 18:47
Location: USA
Contact:

Post by BSOD2600 » 2003-04-19 15:11

Hmm, must be the old DC++ log format messing it up....
Download log
OLD: 2002-04-06 18:07: E:\My Music\DC Temp\Sublime - 40oz to Freedom\01 - Sublime - Waiting For My Ruca.mp3 downloaded from [HM]Bleach, 2288872 b, : 81.88 kB/s, 0:00:00
New: 2003-04-17 09:39: D:\Program Files\DCPlusPlus\FileLists\[RU]nzmngr.DcLst downloaded from [RU]nzmngr, 213944 (213944), 23.74 kB/s, 0:00:08
Upload log
OLD: 2002-04-07 11:08: warez\Adobe\Adobe Premiere 6.0 - Self-Extracting.exe uploaded to [HM]Obby, 71724544 b, : 10.68 kB/s, 0:00:00
New: 2003-04-10 19:14: kk hub\winamp_playlist.html uploaded to [RU]Lady_Death, 548524 (548524), 4.47 kB/s, 0:01:59
Maybe in future versions, you can have it parse older logs or just ignore older log formats and inform the user.

mai9
Posts: 111
Joined: 2003-04-16 23:02

Post by mai9 » 2003-04-19 18:01

Yes, there's the problem. Starting from the end of line, this program searches for the "(" character, then the "," and finally for a space to get the size and the username.

Anyway, How old is this format?


There are two paths for implementing it:

1- short path, would take some time when running the utility.

2- long path, would take some very long time to implement, and no time when running.


But I am not sure if I want to implement it, you know...

Another path is to make a special version for old formats. Or (another one), to use search and replace for those logs, and move to the new format.

Search and replace is very easy:
Search: " b, " <- has two spaces
Replace: " (" <- has one space


I think this last 'path' is the simplest :D

BSOD2600
Forum Moderator
Posts: 503
Joined: 2003-01-27 18:47
Location: USA
Contact:

Post by BSOD2600 » 2003-04-20 11:02

Those old logs are from 2002-04-06.....yup, thats right, I've kept them around for over a year!

For the implementation....couldn't you just incorperate both log formats? For example, if it doesnt find the "(" , then the older log format must be in use (assuming default format is followed). Then to parse the username, you tell it to use the text between "downloaded from" / "uploaded to" and before the first comma "," which should be the username. Then it should be pretty simple to go from there enumerating the other fields recorded.

mai9
Posts: 111
Joined: 2003-04-16 23:02

ok, ok...

Post by mai9 » 2003-04-21 01:39

Ok, I'll build a special version for you :roll:

I don't think much people use that old format, but what I'll do is put a warning if the program can't find a thing in the first line. I will put the log format I got in mind when making the program, and encourage everyone to switch to it :wink:


You will find that special build in the same download page of the project with some distinctive name like "Old Log Format" or "BSOD2600 very special version" :P


It's not that I don't want to implement that different format into the program. The problem is NSIS, that is designed to build installers, not entire programs. So its possibilities are very very limited when it comes to programing. Why did I use that? Because I am not a real programmer, and NSIS is easy, cute and does the job. What amazes me the most is the tiny size of the executable.

Locked