Search found 2269 matches
- Feb 22, 2019 14:07
- Forum: Beginners
- Topic: Random numbers not the same
- Replies: 26
- Views: 4379
Re: Random numbers not the same
How can you print 200 unique numbers between 0 and 99?! Difficult indeed, especially with integers! Another little problem: Dim MyInt() As DWORD ; tested pseudo code For_ ct=0 To 999 ; load a unique random number between 1000 and 1999 into the array Rand(1000, 2000, MyInt(ct), unique) Next ArraySor...
- Feb 20, 2019 10:56
- Forum: General
- Topic: Checking if a computer is ON on the network
- Replies: 11
- Views: 1910
Re: Checking if a computer is ON on the network
(if you know that it is local, you can reduce the timeout with -w <ms>) Thanks. I had tested that before and saw no effect. Now I retried, and got it to work (no idea what was different...). Interesting: - without any wait interval (no "-w"), the answer is "host cannot be reached&quo...
- Feb 20, 2019 2:19
- Forum: Sources, Examples, Tips and Tricks
- Topic: Numerical optimizer
- Replies: 25
- Views: 5449
Re: Numerical optimizer
Code: Select all
TmpFb.bas(62) error 57: Type mismatch, at parameter 2
- Feb 19, 2019 14:09
- Forum: Sources, Examples, Tips and Tricks
- Topic: Numerical optimizer
- Replies: 25
- Views: 5449
Re: Numerical optimizer
You can't expect people to maintain 2 systems and two compilers before they post some code. You can expect people who post here in the Tips & Tricks section that they compile their code at least with standard Gas, Gcc32 and Gcc64. It's only a mouseclick or a keystroke away, right? People who co...
- Feb 19, 2019 13:07
- Forum: Sources, Examples, Tips and Tricks
- Topic: Bit duplication
- Replies: 17
- Views: 3085
Re: Bit duplication
Multiplication is costly (and division is much worse).
- Feb 19, 2019 12:10
- Forum: Sources, Examples, Tips and Tricks
- Topic: Numerical optimizer
- Replies: 25
- Views: 5449
Re: Numerical optimizer
Sorry, I quoted badly - of course, I support the spirit of your comment.deltarho[1859] wrote:Actually, I did not write that
- Feb 19, 2019 8:51
- Forum: Sources, Examples, Tips and Tricks
- Topic: Numerical optimizer
- Replies: 25
- Views: 5449
Re: Numerical optimizer
Exactly. And don't post code that isn't thoroughly tested. This code compiles in 32-bit land but then throws exceptions, definitely no good for the Tips & Tricks section.deltarho[1859] wrote:don't post your code without including an explanation
- Feb 18, 2019 21:46
- Forum: Sources, Examples, Tips and Tricks
- Topic: Bit duplication
- Replies: 17
- Views: 3085
Re: Bit duplication
What do you mean with "string variety"? The lookup code? It's blazingly fast, nice idea...dodicat wrote:Here is a string variety.
- Feb 18, 2019 8:59
- Forum: Sources, Examples, Tips and Tricks
- Topic: Bit duplication
- Replies: 17
- Views: 3085
Re: Bit duplication
That distorts the result in favour of the "naked" assembly routines. What often works instead is to fake an interest in the results generated in the loop by adding them up and displaying the sum after the loop has finished.coderJeff wrote:specify a low optimization level
- Feb 17, 2019 23:49
- Forum: Sources, Examples, Tips and Tricks
- Topic: Bit duplication
- Replies: 17
- Views: 3085
Re: Bit duplication
Assembly version, it's pretty fast. That's an understatement, it's almost three times as fast as mine ;-) function dup8bits naked cdecl ( byval x as ulong ) as ulong 'CoderJeff asm #ifdef __FB_64BIT__ .align 16 #ifdef __FB_LINUX__ mov rax, rdi #else mov rax, rcx #endif #else .align 4 mov eax, [esp+...
- Feb 17, 2019 3:13
- Forum: Sources, Examples, Tips and Tricks
- Topic: Bit duplication
- Replies: 17
- Views: 3085
Re: Bit duplication
Done, thanks.dodicat wrote:You should reset t for Badidea B
- Feb 17, 2019 1:10
- Forum: Sources, Examples, Tips and Tricks
- Topic: Bit duplication
- Replies: 17
- Views: 3085
Re: Bit duplication
Duplicate bits 0->00, 1->11. Example: 1001 0001 -> 11000011 00000011 What's wrong with assembly? You want it fast, right? function duplicate naked cdecl (byval inbyte as long) as integer asm .align 4 mov edx, [esp+4] xor eax, eax mov ecx, -1073741824 L0: rol ecx, 2 shr edx, 1 je L1 jnc L0 or eax, e...
- Feb 16, 2019 3:03
- Forum: General
- Topic: PCG32II Help file
- Replies: 36
- Views: 4518
Re: PCG32II Help file
So you think you are unique?? No way...deltarho[1859] wrote:nobody is as dumb as me.
- Feb 15, 2019 12:36
- Forum: General
- Topic: Checking if a computer is ON on the network
- Replies: 11
- Views: 1910
Re: Checking if a computer is ON on the network
Hey, that works much better than IcmpSendEcho, even for my 'TheOtherNotebook'! Thanxalot, dodicat...dodicat wrote:You want it in FreeBASIC code, then use the freeBASIC website to tell you.
(As a bonus you get an IP address)
- Feb 15, 2019 12:16
- Forum: General
- Topic: Checking if a computer is ON on the network
- Replies: 11
- Views: 1910
Re: Checking if a computer is ON on the network
There is: IcmpSendEchoxbgtc wrote:thanks but I'm aware of ping but wanna see if there's a coding way