Search found 1539 matches

by angros47
Mar 28, 2020 16:17
Forum: Community Discussion
Topic: Multiplatform coroutines in C and also in FreeBasic
Replies: 5
Views: 109

Re: Multiplatform coroutines in C and also in FreeBasic

I would like if it could be integrated in the language. I can already see an use for OpenGL programs (since OpenGL is not thread safe, and it can be accessed only by the thread that created the context). The keyword "fork" should not be used for that, anyway, since it would create confusio...
by angros47
Mar 28, 2020 14:53
Forum: Community Discussion
Topic: Multiplatform coroutines in C and also in FreeBasic
Replies: 5
Views: 109

Re: Multiplatform coroutines in C and also in FreeBasic

Ok, it works in FreeBasic, too. First of all, you need to download the files, and compile the library with: gcc -c libco.c You should get the file libco.o (it can be done in DOS, in Windows and in Linux) Then, the header for FreeBasic (that must be saved as "libco.bi") is: ' libco v20 (201...
by angros47
Mar 28, 2020 1:00
Forum: Community Discussion
Topic: Multiplatform coroutines in C and also in FreeBasic
Replies: 5
Views: 109

Multiplatform coroutines in C and also in FreeBasic

I found this:
https://byuu.org/projects/libco

I guess it can be ported to FreeBasic. Or perhaps it can be integrated in the runtime and compiler? (in the past I remember someone wanted to add coroutine support in FB)
by angros47
Mar 17, 2020 23:50
Forum: General
Topic: Squares
Replies: 7670
Views: 468180

Re: Squares

Albert, are you competing for the Hutter Prize? http://prize.hutter1.net/ https://en.wikipedia.org/wiki/Hutter_Prize For everyone else, I'll also share this link: https://www.quora.com/What-is-the-most-compressed-file-ever-In-percent-decrease-Post-the-original-size-and-the-output-size-Also-include-t...
by angros47
Mar 03, 2020 17:33
Forum: Community Discussion
Topic: Very different result
Replies: 22
Views: 706

Re: Very different result

nov79 wrote:I'm using Linux. Terminal is XFCE4-Terminal.


Try running your program from xterm, and see if the speed changes
by angros47
Mar 02, 2020 17:03
Forum: Community Discussion
Topic: Very different result
Replies: 22
Views: 706

Re: Very different result

Not needed. I diagnosed the problem. The problem is in the print to screen part, not the calculating of the sequence. Free Basic's Print is much slower than crt's printf. You are not the first to mention this, actually: https://freebasic.net/forum/viewtopic.php?f=3&t=26204 Are you using Linux o...
by angros47
Feb 15, 2020 9:31
Forum: General
Topic: Squares
Replies: 7670
Views: 468180

Re: Yah-Zip ( 4 bit )

albert wrote:Just let me know , if it can't be decompressed... I got the decompression started...


It can't be decompressed, because there are some duplicates. And I know for sure that there are duplicates, because of the pigeongole principle: https://en.wikipedia.org/wiki/Pigeonhole_principle
by angros47
Jan 31, 2020 1:00
Forum: General
Topic: Squares
Replies: 7670
Views: 468180

Re: Squares

I'd recommend you to read this: https://en.wikipedia.org/wiki/Lossless_compression#Limitations, to figure why your algorithm can't work
by angros47
Jan 30, 2020 1:16
Forum: General
Topic: Squares
Replies: 7670
Views: 468180

Re: Squares

It compresses, but it also creates duplicates so it can't be decompressed. Check it
by angros47
Jan 18, 2020 13:47
Forum: General
Topic: Squares
Replies: 7670
Views: 468180

Re: Squares

Albert, a simple formula could be to discard the leftmost bit, so you can use only 7 bits instead of 8: most ASCII texts, in fact, never use that bit, and it is always set to 0. In the few cases that bit is used, you can alert the decompressor, by sending a sequence of seven 1 before the byte that n...
by angros47
Jan 14, 2020 0:07
Forum: General
Topic: Squares
Replies: 7670
Views: 468180

Re: Squares

@albert

Try your concept of altered binaries on number from 0 to 15 (all the numbers than can be expressed with one nibble). Then, write here the numbers, and the altered binary representation, so we can see if it would work or not
by angros47
Jan 13, 2020 0:18
Forum: General
Topic: Squares
Replies: 7670
Views: 468180

Re: Squares

Albert, I would recommend you to try a simple thing: write all numbers from 0 to 15 (since each of them can represent a different nibble, and they represent all possible nibbles). Then, , write all the possible combinations of three bits, and count them. Then, try to match every three bit sequence t...
by angros47
Jan 07, 2020 19:00
Forum: General
Topic: Squares
Replies: 7670
Views: 468180

Re: Squares

Two conflicts, at least: if n1 = "0000" then n2 = "0111" if n1 = "1111" then n2 = "0011" <---- if n1 = "0001" then n2 = "1000" if n1 = "0010" then n2 = "1001" if n1 = "0100" then n2 = "1010" if n1 = &...
by angros47
Jan 07, 2020 18:19
Forum: General
Topic: Squares
Replies: 7670
Views: 468180

Re: Squares

@angros47 Could you look over it to see if there's duplicates... You seem to have a better mind than me at finding the duplicates... I don't have a better mind. I just know for sure that duplicates are inevitable , for the reason I already told you if n1 = "0000" then n2 = "0110"...
by angros47
Jan 06, 2020 22:06
Forum: General
Topic: Squares
Replies: 7670
Views: 468180

Re: Squares

*sigh* You wrote: I fixed the duplicate problem.. by making the 4th bit "01" instead of "0" So now , there's no duplicates... There is a duplicate, instead: Nibbles 0100 and 1000 : they produce 100 and 10 Nibble 0101: it produces 10010 When I have to decompress, if I find the seq...

Go to advanced search