Search found 810 matches

by Munair
Jan 22, 2019 14:34
Forum: Libraries
Topic: No german umlauts with libcurl
Replies: 23
Views: 504

Re: No german umlauts with libcurl

marcov wrote:(Note that since this April's Windows 10 update, Windows 10 has an option to set the character set to utf8. I haven't tested yet, but long term this could significantly increase Windows compatibility to *nix)

Microsoft finally coming to their senses.
by Munair
Jan 18, 2019 7:58
Forum: Beginners
Topic: A new Unicode & Newbie problem
Replies: 16
Views: 321

Re: A new Unicode & Newbie problem

If you use a normal string data type, the bytes should be preserved.
by Munair
Jan 18, 2019 6:22
Forum: Beginners
Topic: A new Unicode & Newbie problem
Replies: 16
Views: 321

Re: A new Unicode & Newbie problem

There is no such thing as a Unicode string. You would have a string containing a Unicode encoding, either UTF8, UTF16 or UTF32. While Linux and the internet primarily use UTF8, Windows doesn't. So it is the encoding conversion that matters.
by Munair
Jan 12, 2019 16:24
Forum: Beginners
Topic: reading random access files
Replies: 9
Views: 224

Re: reading random access files

As most programming languages these days do not support random access files (fixed length records), I replicated this using a binary stream object several years ago in Real Basic as a means of providing a simple and fast database where fixed records are sufficient. I haven't got around to translatin...
by Munair
Jan 07, 2019 7:40
Forum: General
Topic: const as union
Replies: 8
Views: 200

Re: const as union

You must include the dim statement:

Code: Select all

dim as const abType AB2 = type(1, 1) '<-- allowed
by Munair
Jan 07, 2019 7:37
Forum: General
Topic: const as union
Replies: 8
Views: 200

Re: const as union

retracted
by Munair
Jan 07, 2019 7:32
Forum: General
Topic: const as union
Replies: 8
Views: 200

Re: const as union

retracted
by Munair
Dec 14, 2018 10:20
Forum: General
Topic: Fixed Length String handling
Replies: 39
Views: 752

Re: Fixed Length String handling

dim as string * 10 s s="01234" + chr(0) + "56789" print s dim as string * 10 g=s print g s[5]=0 print s g=s print g sleep output 0123456789 0123456789 01234 6789 01234 Exactly. There is a difference in how assignments are treated. It turns out bad when processing bytes in memory...
by Munair
Dec 11, 2018 20:32
Forum: Tips and Tricks
Topic: Fast Reverse String?
Replies: 89
Views: 1274

Re: Fast Reverse String?

OK, asm output may give some more clues. Joshy's function 18.5 KiB: .file "rev08.c" .intel_syntax noprefix .text .globl STRREV .type STRREV, @function STRREV: push rbp mov rbp, rsp sub rsp, 96 mov QWORD PTR -88[rbp], rdi mov rax, QWORD PTR fs:40 mov QWORD PTR -8[rbp], rax xor eax, eax mov ...
by Munair
Dec 11, 2018 20:25
Forum: Tips and Tricks
Topic: Fast Reverse String?
Replies: 89
Views: 1274

Re: Fast Reverse String?

What I find interesting, is the code size.

Joshy's plain text code is 3.2 kB while my code is just 279 bytes. However, compiled with and without optimizations give 30.0 kB for both.
by Munair
Dec 11, 2018 20:15
Forum: Tips and Tricks
Topic: Fast Reverse String?
Replies: 89
Views: 1274

Re: Fast Reverse String?

srvaldez wrote:I am not sure that it's the FBC version but the OS, more often than not Windows is slower.

Yes, and that's not a FBC thing per se. Software that I developed with FreePascal also runs quite a bit faster on Linux 64 than Windows 64.
by Munair
Dec 11, 2018 19:51
Forum: Tips and Tricks
Topic: Fast Reverse String?
Replies: 89
Views: 1274

Re: Fast Reverse String?

Joshy, can you replace my function in your source code with this new one: function RevStr(byref s as const string) as string static r as string static l as uinteger static n as uinteger r = s l = len(r) - 1 n = 0 while l > n swap r[n], r[l] n += 1 l -= 1 wend return r end Function
by Munair
Dec 11, 2018 19:33
Forum: Tips and Tricks
Topic: Fast Reverse String?
Replies: 89
Views: 1274

Re: Fast Reverse String?

D.J.Peters wrote:can you post your results from this please ?

I already did, but I changed my version slightly and seems a bit faster still:
viewtopic.php?f=7&t=27220&start=60#p255692
by Munair
Dec 11, 2018 19:30
Forum: Tips and Tricks
Topic: Fast Reverse String?
Replies: 89
Views: 1274

Re: Fast Reverse String?

srvaldez wrote:Joshy, that's fast!
macOS, 64-bit, -O2

Code: Select all

 0.2154338359832764         total dodicat
 0.2209370136260986         total MrSwiss
 0.1722171306610107         total Munair
 0.08946728706359863        total Joshy
 

Results on macOS reflect those on Linux.
by Munair
Dec 11, 2018 19:24
Forum: Tips and Tricks
Topic: Fast Reverse String?
Replies: 89
Views: 1274

Re: Fast Reverse String?

@Joshy, I am unable to reproduce your results on 64 bits Linux. My results on average do not come close to yours.

Go to advanced search