Search found 5882 matches

by albert
Sep 12, 2020 21:37
Forum: General
Topic: Data Compression
Replies: 53
Views: 1212

Re: Data Compression

It doesn't compress.. ( sometimes compresses 1 to 4 bits , depending on the left input val and how many zeros are in the string.. ) But i got it working with any base from 2 to 256.. screen 19 Function halfer( fl As String ) As String dim as ushort carry = 0 dim as string s = fl dim as string ans = ...
by albert
Sep 12, 2020 20:43
Forum: General
Topic: Data Compression
Replies: 53
Views: 1212

Re: Data Compression

@StoneMonkey..

Thanks.

So: With base 256
To divide by 2 , you use 128 ( 1/2 the base ) and multiply it , by the lower bit of the input byte..
To divide by 4 , you use 64 ( 1/4 the base ) and multply it , by the 2 lower bits of the input byte..
by albert
Sep 12, 2020 19:58
Forum: General
Topic: Data Compression
Replies: 53
Views: 1212

Re: Data Compression

So , the div2 , carry to the right is :

wirh base 10 , div 2 = carry is 5
with base 16 , div 2 = carry is 8
with base 256 , div 2 = carry is 128
with base 65536 , div 2 = carry is 32768

The carry is 1/2 the base

With base 256. If you divide by 4 would the carry be 1/4 the base = 64??
by albert
Sep 12, 2020 19:16
Forum: General
Topic: Data Compression
Replies: 53
Views: 1212

Halfer

@Dodicat @CoderJeff I did it on my own... I figured it out... I got a halfer and doubler working with hexadecimal... It doesn't compress... ( sometimes a few bits. ) If the left input hex digit , is less than "F" then it compresses a bit or two or three.. I figured out , that in hex , the ...
by albert
Sep 11, 2020 18:01
Forum: General
Topic: Data Compression
Replies: 53
Views: 1212

Re: Data Compression

@Dodicat @CoderJeff I got the "Halfer" and "Adder" working together on strings of chr( rnd * 10 ) ) Now to make it work on strings of chr( ( rnd * 100 ) ) Here's the 10's 'Dodicats Halfer ( modified to do chr() division )... screen 19 Function halfer( fl As String ) As String Dim...
by albert
Sep 11, 2020 17:02
Forum: General
Topic: Data Compression
Replies: 53
Views: 1212

Re: Data Compression

Hi CoderJeff You did a Halfer and Doubler , for me under the "Number Trick" Topic.. My above Halfer.. Gets the right Half values... You can press the esc key while it's halfing and stop it prematurely.. And then check that the next up output is double the one below it.. It halfs good.. The...
by albert
Sep 11, 2020 4:02
Forum: General
Topic: Number Trick
Replies: 126
Views: 3174

Re: Number Trick

@CoderJeff Your code works... And it also sometimes compresses a few bits.. With 10 bytes input , it sometimes outputs 9.35 to 9.75 bytes... But the important part is , the output matches the input... screen 19 '' source string is a sequence of characters, each 0 to 255 '' we can optionally pass in ...
by albert
Sep 11, 2020 3:53
Forum: General
Topic: Number Trick
Replies: 126
Views: 3174

Re: Number Trick

@CoderJeff

Your the GOD!!

Thanks for the code , i got it working..

I'll post the multiplier tomorrow... Time for bed... it's 9 o-clock..
by albert
Sep 11, 2020 2:44
Forum: General
Topic: Number Trick
Replies: 126
Views: 3174

Re: Number Trick

@CoderJeff I'm working on character strings , each character being ASCII 0 to 255.. So: If you have chr( 255 ) + chr( 255 ) and divide by 2 , you get chr( 127 ) + chr( 132 ) How do you double the chr( 127 ) + chr( 132 ) , to get chr( 255 ) + chr( 255 ) back ?? Your above code is so cryptic , i can't...
by albert
Sep 11, 2020 1:49
Forum: General
Topic: Star Wars "Light Saber"
Replies: 15
Views: 291

Re: Star Wars "Light Saber"

@badidea The individual protons and neutrons have orbitals in various elevations of orbits around each proton and neutron.. If the size of the nucleus exceeds the innermost orbits of those orbitals. The orbitals will strike against the protons and neutrons and maybe force them out of the nucleus.. (...
by albert
Sep 11, 2020 0:36
Forum: General
Topic: Data Compression
Replies: 53
Views: 1212

Re: Data Compression

@Dodicat I got the adder / "Doubler" working on digits... Now to make it work on characters... ( Not bad for an autistic mental patient.... ) screen 19 Function adder( n as string ) as string dim as string ans = "" dim as string point_5 = n dim as ubyte v1 , carry for a as longin...
by albert
Sep 10, 2020 23:37
Forum: General
Topic: Data Compression
Replies: 53
Views: 1212

Re: Data Compression

@Dodicat Can you help me on the "Doubler" / "Adder" ?? I'm getting bad outputs... screen 19 Function adder( n as string ) as string dim as string ans = "0" dim as string point_5 = n dim as ubyte v1 , v2 , carry = 0 for a as longint = len( point_5 ) to 1 step - 1 v2 = va...
by albert
Sep 10, 2020 22:24
Forum: General
Topic: INSTR()
Replies: 7
Views: 134

Re: INSTR()

@StoneMonkey

I'm working on strings of ASCII chrs()

I need to skip over all the leading chr( 0 )'s..

The string might be a megabyte.. and as it divides by 2 , new chr( 0 )'s crop up in front..
by albert
Sep 10, 2020 21:43
Forum: General
Topic: Data Compression
Replies: 53
Views: 1212

Re: Data Compression

I made it to show the data.. While I'm debugging it.. It's too slow as is to do large numbers yet. mostly because of the leading chr( 0 )'s I'll start playing with a "Doubler"...To see if i can do it on my own.. 'Dodicats Halfer ( modified to do chr() division )... screen 19 Function halfe...
by albert
Sep 10, 2020 21:14
Forum: General
Topic: INSTR()
Replies: 7
Views: 134

Re: INSTR()

@jj2007 Can't you do something like instr( 1 , ANY ? ) How would you use the ANY function?? Is it possible.. There has to be a faster way , than looping to find the first non-zero place , or to skip over the leading zeros.. I need to do something like: string = "0000023567" place = instr( ...

Go to advanced search