forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Another Bug in Dreadnet.dll
Goto page 1, 2  Next
 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
Hippo
Contributor
Contributor


Joined: 08 Feb 2005
Posts: 53

PostPosted: Fri Feb 25, 2005 11:59 am    Post subject: Another Bug in Dreadnet.dll Reply with quote

Hi again dread, it seems I have found another bug in your dll

Using the following code:
Code:

%%value = @dnet(genstats,inbytes)


Works fine until you hit about 2GB of downloaded data then starts reporting a minus value. I havent checked outbytes as well, uploading more than 2GB is a bit of a chore Smile infmat works ok, but I changed my program to work with bytes rather than the formatted value and came across this bug.

Hippo
Back to top
View user's profile Send private message
Dr. Dread
Professional Member
Professional Member


Joined: 03 Aug 2001
Posts: 1065
Location: Copenhagen, Denmark

PostPosted: Fri Feb 25, 2005 1:10 pm    Post subject: Reply with quote

Could make sense. As far as I remember the function works with values that are 32-bit integers.

The equivalent in bytes of 2GB is exactly the upper limit of this type of integer. I will see if I can change into
a 64-bit integer instead.

Greetz
Dread

_________________
~~ Alcohol and calculus don't mix... Don't drink and derive! ~~

String.DLL * advanced string processing
Back to top
View user's profile Send private message
Dr. Dread
Professional Member
Professional Member


Joined: 03 Aug 2001
Posts: 1065
Location: Copenhagen, Denmark

PostPosted: Fri Feb 25, 2005 1:12 pm    Post subject: Reply with quote

BTW, you're downloading way too much Shocked

go get some fresh air Laughing

Greetz
Dread

_________________
~~ Alcohol and calculus don't mix... Don't drink and derive! ~~

String.DLL * advanced string processing
Back to top
View user's profile Send private message
Dr. Dread
Professional Member
Professional Member


Joined: 03 Aug 2001
Posts: 1065
Location: Copenhagen, Denmark

PostPosted: Fri Feb 25, 2005 2:03 pm    Post subject: Reply with quote

Have checked the code - kinda bad news. It was not integers but cardinals. That basically means that
I probably cannot squeeze it past 4294967295 bytes = 4 GB. I will do that of course.

Greetz
Dread

_________________
~~ Alcohol and calculus don't mix... Don't drink and derive! ~~

String.DLL * advanced string processing
Back to top
View user's profile Send private message
Hippo
Contributor
Contributor


Joined: 08 Feb 2005
Posts: 53

PostPosted: Fri Feb 25, 2005 2:17 pm    Post subject: Reply with quote

Thanks for having a look at it dread. You wouldnt believe how many different distros of linux I have on my machine now from testing this out!

4 gigabyte limit is bad news for me Im afraid Sad I started using the inbytes and outbytes since I needed to perform some mathematical calculations on the totals. Its possible that people could download hundreds of gigabytes of data in one session.

A possible way to solve this would be to have a similar command to infmat/outfmat but with the information returned Value|Suffix i.e 100|GB. That way you would parse it, run mathematical calculations on it, whilst knowing the wether it was KB/MB/GB.

Unfortunatly that would still involve me re-writing huge chunks of code, but I should have realised this would have been a problem.
Back to top
View user's profile Send private message
Hippo
Contributor
Contributor


Joined: 08 Feb 2005
Posts: 53

PostPosted: Fri Feb 25, 2005 3:20 pm    Post subject: Reply with quote

I've realised that I can do in the VDS script what I suggested for the DLL, but its a lot of code when a simple call to the DLL would be easier.
Code:

  %%value = @dnet(genstats,infmat)
  %%position = @POS(.,@dnet(genstats,infmat))
  %%value2 = @strdel(%%value,@fadd(%%position,3),@fadd(%%position,3))
  %%formatted = @strins(%%value2,@fadd(%%position,3),|)
  parse "%%number;%%suffix",%%formatted
Back to top
View user's profile Send private message
Hippo
Contributor
Contributor


Joined: 08 Feb 2005
Posts: 53

PostPosted: Fri Feb 25, 2005 6:09 pm    Post subject: Reply with quote

One other thing while I've got your attention dread Smile

Is it possible to add an adapter parameter to @Dnet(MacAddr) so it will return the Mac Address of one of the adapters found using @Dnet(Adapters) ?
Back to top
View user's profile Send private message
Hippo
Contributor
Contributor


Joined: 08 Feb 2005
Posts: 53

PostPosted: Fri Feb 25, 2005 8:56 pm    Post subject: Reply with quote

Well I've just looked at my code and I've come to a standstill.

My Program needs to calculate several values including:

Bytes Download during the Current Program Session
Bytes Downloaded Today
Bytes Downloaded Overall

I have realised that I can only do this using the value in bytes since I need to check things such as how many bytes have been downloaded since the program started etc. I cant do this calculations using infmat since I can then only report the downloaded amount in the current multiple (MB/GB etc).

If there is nothing you can do regarding the reporting of inbytes then my program looses 90% of its functionality and I may as well drop the project Sad

The only thing I can suggest as a work around is maybe having a function that returns the number of kilobytes downloaded instead of bytes. I will then be able to do my calculations on this value and the upper limit will be 1024 times greater than the current limit. This should make it 4048GB which is a much better value. Is this feasible?
Back to top
View user's profile Send private message
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Fri Feb 25, 2005 11:23 pm    Post subject: Reply with quote

Unless things have change in VDS5, I think the largest
number VDS can handle (math-wise) is approx 2 gigs.

It's actually a 4 gig range, but half are negative numbers. Wink

Cheers, Mac Smile

_________________
VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
Back to top
View user's profile Send private message Send e-mail
Hippo
Contributor
Contributor


Joined: 08 Feb 2005
Posts: 53

PostPosted: Sat Feb 26, 2005 12:19 am    Post subject: Reply with quote

VDS 5 Is fine with handling big numbers,
Code:

%%answer = @fadd(2147483648000,5368709120000)


That is the equivalent,in bytes, of adding 2000 GB to 5000 GB
Back to top
View user's profile Send private message
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Sat Feb 26, 2005 12:22 am    Post subject: Reply with quote

Good to know - thanks. Wink

Cheers, Mac Smile

_________________
VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
Back to top
View user's profile Send private message Send e-mail
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Sat Feb 26, 2005 12:42 am    Post subject: Reply with quote

Hmmm... Confused

Apparently it was something specific I hit a 2 gig
limit on - VDS 3 does the big numbers too. Embarassed

Cheers, Mac Smile

_________________
VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
Back to top
View user's profile Send private message Send e-mail
jules
Professional Member
Professional Member


Joined: 14 Sep 2001
Posts: 1043
Location: Cumbria, UK

PostPosted: Sat Feb 26, 2005 9:49 am    Post subject: Reply with quote

Hippo wrote:
VDS 5 Is fine with handling big numbers,
Code:

%%answer = @fadd(2147483648000,5368709120000)


That is the equivalent,in bytes, of adding 2000 GB to 5000 GB


That's because you're using floating point numbers. If you tried it with @sum() it wouldn't work.

_________________
The Tech Pro
www.tech-pro.net
Back to top
View user's profile Send private message Visit poster's website
Dr. Dread
Professional Member
Professional Member


Joined: 03 Aug 2001
Posts: 1065
Location: Copenhagen, Denmark

PostPosted: Sat Feb 26, 2005 11:49 am    Post subject: Reply with quote

Hi again!

When I was talking about the 4GB limit, this limit is not within my DLL as such coz then I could probably fix it fairly
easily - the limit is imposed by the Win MIB structure which is working with cardinals.

Greetz
Dread

_________________
~~ Alcohol and calculus don't mix... Don't drink and derive! ~~

String.DLL * advanced string processing
Back to top
View user's profile Send private message
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Sat Feb 26, 2005 11:52 am    Post subject: Reply with quote

Maybe it is possible to "reset" the value which the structure returns to your DLL, after which you let add your DLL the old value plus the new one? Rolling Eyes
_________________
[ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group