Search found 724 matches

by jj2007
Sep 20, 2018 14:00
Forum: General
Topic: Where have I gone wrong
Replies: 10
Views: 229

Re: Where have I gone wrong

Hi Gablea,

It would help if you posted (in code tags):
a) complete code ready for compiling (not bits and pieces here and there)
b) a short sample, e.g. 20 lines, of the file you want to read in
c) a short description or example of the expected result.

And please, don't feed the troll.
by jj2007
Sep 19, 2018 15:56
Forum: Community Discussion
Topic: Feature request: instrisic Defines for console / gui mode
Replies: 60
Views: 1555

Re: Feature request: instrisic Defines for console / gui mode

MrSwiss wrote:

Code: Select all

#Ifdef __FB_GUI__
...
#Else
...
#EndIf
Yep, that's a lot simpler than

Code: Select all

#if fbgui
   print "it's GUI"
#else
   print "it's Console"
#endif
by jj2007
Sep 16, 2018 23:11
Forum: General
Topic: FreeBASIC's PRNG #2
Replies: 263
Views: 3691

Re: FreeBASIC's PRNG #2

An unpredictable sequence would be non-reversible But if you encrypt a file, you want the sequence used to be reversible, otherwise it's just garbage, right? Some years ago I coded this Simple Encryption Algorithm , using a PRNG that passes ENT but not PractRand. All it does is xor'ing the sequence...
by jj2007
Sep 16, 2018 21:00
Forum: General
Topic: FreeBASIC's PRNG #2
Replies: 263
Views: 3691

Re: FreeBASIC's PRNG #2

Many uses of a PRNG require predictability. For example, if you encrypt a text, you will wish one day to decrypt it. In that moment, you need to know a) which algo and b) the starting point of the sequence.
by jj2007
Sep 15, 2018 8:05
Forum: Linux
Topic: Qemu on win7?
Replies: 13
Views: 256

Re: Qemu on win7?

If it were me I'd just use VirtualBox and be done with it. It's completely free, and it's faster than Correct, VBox is pretty fast, more or less like native Windows. The main problem here is that you still need a valid Windows license of the guest OS, e.g. for the 32-bit version of Windows 7. To be...
by jj2007
Sep 15, 2018 2:22
Forum: General
Topic: FreeBASIC's PRNG #2
Replies: 263
Views: 3691

Re: FreeBASIC's PRNG #2

no anomalies between x86 and 64 here w/ -O 3 Can you post your 32-bit vs 64-bit timings with the code above? I am curious, since I get that factor 8 difference even with -O3 (GAS). With Gcc, it's 1.6 times slower in 32-bit. And a quick look under the hood reveals that gcc has never heard of the exi...
by jj2007
Sep 15, 2018 1:34
Forum: General
Topic: FreeBASIC's PRNG #2
Replies: 263
Views: 3691

Re: FreeBASIC's PRNG #2

Compliments, auguri, Glückwunsch, félicitations! #include "Windows.bi" Dim shared As ULongInt m_x, m_weilSeq, randomNumber, sum function MsWs() as ulong m_x *= m_x : m_weilSeq += &Hfedc65a1ce2d9587 : m_x += m_weilSeq m_x = ( m_x shr 32 ) or ( m_x shl 32 ) return( m_x ) end function Fun...
by jj2007
Sep 14, 2018 9:34
Forum: General
Topic: FreeBASIC's PRNG #2
Replies: 263
Views: 3691

Re: FreeBASIC's PRNG #2

All the asm is doing is to map a 64-bit number into a Double [0,1). Here is some code which uses two functions to do just that: BASIC: TwoUlongsToDouble ASM: TwoUlongsToDoubleASM The asm is that used in CRyptoRndII. I managed to shorten and speed it up a bit: *** Comparing SIMD vs FPU-based methods...
by jj2007
Sep 13, 2018 20:39
Forum: General
Topic: FreeBASIC's PRNG #2
Replies: 263
Views: 3691

Re: FreeBASIC's PRNG #2

Northern English, hmmm. When UK citizens get enrolled by the European Commission, they start their career with a compulsory language course: Continental English ;-)
by jj2007
Sep 13, 2018 20:08
Forum: General
Topic: FreeBASIC's PRNG #2
Replies: 263
Views: 3691

Re: FreeBASIC's PRNG #2

Yes. The mid point of &HFFFFFFFFFFFFFFFF would map into 0.5 In my understanding, there should be two midpoints at &H7FFFFFFFFFFFFFFFh and &H8000000000000000h. ptrBuffer dq 0FFFFFFFFFFFFFFFFh '1.0 ptrBuffer dq 8000000000000000h ' 0.5 ptrBuffer dq 7FFFFFFFFFFFFFFFh ' 0.5 ptrBuffer dq 0 ' ...
by jj2007
Sep 13, 2018 19:10
Forum: General
Topic: FreeBASIC's PRNG #2
Replies: 263
Views: 3691

Re: FreeBASIC's PRNG #2

Excuse my ignorance: What does "map two unsigned longs to one double" mean? For example, with... print TwoUlongsToDouble( 12345, 0) ... I would expect to see 12345.0 because the second, high DWORD is not set. But that code produces 2.8743e-006 EDIT: Got it. The "mapping" means &q...
by jj2007
Sep 13, 2018 17:31
Forum: General
Topic: FreeBASIC's PRNG #2
Replies: 263
Views: 3691

Re: FreeBASIC's PRNG #2

From CryptoRNDII I've tried to examine what this code does; IMHO it makes the result less random than before: mov eax, offset ptrBuffer movd xmm0, dword ptr [eax] ; ' first 32-bit random number movd xmm1, dword ptr [eax + 4] ; ' second 32-bit random number deb 4, "before", x:xmm0, x:xmm1 ...
by jj2007
Sep 13, 2018 16:37
Forum: Community Discussion
Topic: Feature request: instrisic Defines for console / gui mode
Replies: 60
Views: 1555

Re: Feature request: instrisic Defines for console / gui mode

i apologize if my formulation did hurt you, my intention was not to "insult" any people. OK, no harm done. Why do simple questions so often trigger subtle insults here? I fail to see where the insult is (again). However, I do see that you're unable to grasp the difference between an intri...
by jj2007
Sep 13, 2018 12:39
Forum: Community Discussion
Topic: Feature request: instrisic Defines for console / gui mode
Replies: 60
Views: 1555

Re: Feature request: instrisic Defines for console / gui mode

@jj2007 sure you can do #define _FB_CONSOLE_ 1... but the beauty of intrinsic define is : it is done by the compiler itself... The #define is a one-liner, and the explicit declaration makes the code easier to read. I do such things in Masm all the time; what strikes me here is that FB doesn't allow...
by jj2007
Sep 13, 2018 9:50
Forum: Linux
Topic: Qemu on win7?
Replies: 13
Views: 256

Re: Qemu on win7?

Hi Aurel,
Googling "qemu" windows 7 yields lots of results but it seems most of them treat it the other way round: Win7 on Qemu. What are your intentions here?

Go to advanced search