Search found 1037 matches

by jj2007
Feb 20, 2019 2:19
Forum: Tips and Tricks
Topic: Numerical optimizer
Replies: 13
Views: 185

Re: Numerical optimizer

Code: Select all

TmpFb.bas(62) error 57: Type mismatch, at parameter 2
Is this a demo why code should be thoroughly tested for T+T?
by jj2007
Feb 19, 2019 14:09
Forum: Tips and Tricks
Topic: Numerical optimizer
Replies: 13
Views: 185

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...
by jj2007
Feb 19, 2019 13:07
Forum: Tips and Tricks
Topic: Bit duplication
Replies: 17
Views: 391

Re: Bit duplication

Multiplication is costly (and division is much worse).
by jj2007
Feb 19, 2019 12:10
Forum: Tips and Tricks
Topic: Numerical optimizer
Replies: 13
Views: 185

Re: Numerical optimizer

deltarho[1859] wrote:Actually, I did not write that
Sorry, I quoted badly - of course, I support the spirit of your comment.
by jj2007
Feb 19, 2019 8:51
Forum: Tips and Tricks
Topic: Numerical optimizer
Replies: 13
Views: 185

Re: Numerical optimizer

deltarho[1859] wrote:don't post your code without including an explanation
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.
by jj2007
Feb 18, 2019 21:46
Forum: Tips and Tricks
Topic: Bit duplication
Replies: 17
Views: 391

Re: Bit duplication

dodicat wrote:Here is a string variety.
What do you mean with "string variety"? The lookup code? It's blazingly fast, nice idea...
by jj2007
Feb 18, 2019 8:59
Forum: Tips and Tricks
Topic: Bit duplication
Replies: 17
Views: 391

Re: Bit duplication

coderJeff wrote:specify a low optimization level
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.
by jj2007
Feb 17, 2019 23:49
Forum: Tips and Tricks
Topic: Bit duplication
Replies: 17
Views: 391

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+...
by jj2007
Feb 17, 2019 3:13
Forum: Tips and Tricks
Topic: Bit duplication
Replies: 17
Views: 391

Re: Bit duplication

dodicat wrote:You should reset t for Badidea B
Done, thanks.
by jj2007
Feb 17, 2019 1:10
Forum: Tips and Tricks
Topic: Bit duplication
Replies: 17
Views: 391

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...
by jj2007
Feb 16, 2019 3:03
Forum: General
Topic: PCG32II Help file
Replies: 10
Views: 397

Re: PCG32II Help file

deltarho[1859] wrote:nobody is as dumb as me.
So you think you are unique?? No way...
by jj2007
Feb 15, 2019 12:36
Forum: General
Topic: Checking if a computer is ON on the network
Replies: 9
Views: 195

Re: Checking if a computer is ON on the network

dodicat wrote:You want it in FreeBASIC code, then use the freeBASIC website to tell you.
(As a bonus you get an IP address)
Hey, that works much better than IcmpSendEcho, even for my 'TheOtherNotebook'! Thanxalot, dodicat...
by jj2007
Feb 15, 2019 12:16
Forum: General
Topic: Checking if a computer is ON on the network
Replies: 9
Views: 195

Re: Checking if a computer is ON on the network

xbgtc wrote:thanks but I'm aware of ping but wanna see if there's a coding way
There is: IcmpSendEcho
by jj2007
Feb 15, 2019 9:13
Forum: General
Topic: Checking if a computer is ON on the network
Replies: 9
Views: 195

Re: Checking if a computer is ON on the network

Not sure how to do this in FB, but it works:

Code: Select all

  Print Launch$("cmd.exe /C ping -n 1 MyOtherNotebook")
If the "other" notebook is present, it takes milliseconds, otherwise about 3 seconds. There is a thread here, but it doesn't seem to apply to Windows.

Go to advanced search