Search found 95 matches

by Ledigimate
Tue Mar 12, 2019 10:49 am
Forum: Talking LiveCode
Topic: libURLDownloadToFile making the UI unresponsive
Replies: 12
Views: 6512

Re: libURLDownloadToFile making the UI unresponsive

I've discovered that the UI's unresponsiveness is proportional to the download speed. When I test it using a web server with Gigabit download speeds, the Abort button won't respond to being pressed until after the download completes. When I test it using a web server with slower download speeds, the...
by Ledigimate
Thu Mar 07, 2019 6:28 pm
Forum: Talking LiveCode
Topic: libURLDownloadToFile making the UI unresponsive
Replies: 12
Views: 6512

Re: libURLDownloadToFile making the UI unresponsive

what platform are you experiencing this on?
Windows 10 Pro X64
What version of LC are you using?
version 8.1.10
Do you use the Community or Commercial version?
Community
by Ledigimate
Thu Mar 07, 2019 5:34 pm
Forum: Talking LiveCode
Topic: libURLDownloadToFile making the UI unresponsive
Replies: 12
Views: 6512

libURLDownloadToFile making the UI unresponsive

Hi there If I understand the LC dictionary correctly, libURLDownloadToFile is supposed to be non-blocking, but I get blocking behavior with large files. I created an "Abort download" button to enable the user to cancel the download, but the button won't respond to mouse clicks while the download is ...
by Ledigimate
Thu Dec 20, 2018 3:48 pm
Forum: Talking LiveCode
Topic: Circular shift
Replies: 20
Views: 13643

Re: Circular shift

Sadly do as "javascript" is currently available ONLY for HTML5-standalones (Emscripten). For desktop/mobile we have to use the javascript of libbrowser (accessible via a browser widget). And the browser widget doesn't currently work on most linux flavours. So you have to do a platform switch or use...
by Ledigimate
Thu Dec 20, 2018 1:35 pm
Forum: Talking LiveCode
Topic: baseConvert woes
Replies: 5
Views: 3662

Re: baseConvert woes

What does the number represent? Is it an actual quantity, or a decimal representation of byte values? If the latter, the binaryEncode and binaryDecode functions may help, since they can operate on a series of values in one pass, with lots of conversion options. Kind of both. The number is an actual...
by Ledigimate
Wed Dec 19, 2018 8:40 pm
Forum: Talking LiveCode
Topic: baseConvert woes
Replies: 5
Views: 3662

Re: baseConvert woes

Never mind.

I see the dictionary says baseConvert can only handle numbers between zero and 4,294,967,295 (2^32 - 1).
The number 7909090520 is thus too large for baseConvert to handle. I guess I'll have to write my own function to convert larger numbers!

Gerrie
by Ledigimate
Wed Dec 19, 2018 8:24 pm
Forum: Talking LiveCode
Topic: baseConvert woes
Replies: 5
Views: 3662

baseConvert woes

Dear forum The baseConvert function tells me that the numbers 3614123224 and 7909090520 has the same binary representation! WHY?? put baseConvert("3614123224", 10, 2) is baseConvert("7909090520", 10, 2) -- yields true This has been causing me huge frustration. Can someone explain what's going on her...
by Ledigimate
Tue Dec 18, 2018 12:30 am
Forum: Talking LiveCode
Topic: Circular shift
Replies: 20
Views: 13643

Re: Circular shift

Oh, sorry. No default bash or ksh on Windows. But did you already try do as "vbscript"? if the platform is "Win32" then do "result = 2 << 4" as "vbscript" put the result else ... end if See https://docs.microsoft.com/en-us/dotnet/visual-basic/language-reference/operators/left-shift-operator and htt...
by Ledigimate
Mon Dec 17, 2018 8:07 pm
Forum: Talking LiveCode
Topic: Circular shift
Replies: 20
Views: 13643

Re: Circular shift

[-hh] wrote:
Mon Dec 17, 2018 7:47 pm
Gerrie.

You could also try to use leftshift and rightshift of the shell, for example

Code: Select all

put shell("echo $((2 << 4)); echo $((1024 >> 3))")
There piping is also available.
It gives me "<< was unexpected at this time." on my system (Win 10 Pro).
by Ledigimate
Mon Dec 17, 2018 6:42 pm
Forum: Talking LiveCode
Topic: Circular shift
Replies: 20
Views: 13643

Re: Circular shift

As you are comparing your pure LC Script solution to the 32bit C operators: The browser widget belongs to LC, so we have, besides *2^pPosition and div 2^pPosition, also the following possibility. function rotateBits pN, pP, pD -- 32bit numbers only if pD is "L" then put "<<" into op -- signed left ...
by Ledigimate
Mon Dec 17, 2018 8:54 am
Forum: Talking LiveCode
Topic: Circular shift
Replies: 20
Views: 13643

Re: Circular shift

Here's what I've got working. function rotateBits pNumber, pBitLength, pPositions, pDirection local tBase2, tBase2new, tNumLeadingBits put baseConvert(pNumber, 10, 2) into tBase2 put pBitLength - length(tBase2) into tNumLeadingBits repeat tNumLeadingBits times put "0" before tBase2 end repeat if pDi...
by Ledigimate
Mon Dec 17, 2018 6:22 am
Forum: Talking LiveCode
Topic: Circular shift
Replies: 20
Views: 13643

Re: Circular shift

So typically, does a base 2 rotation ignore "leading" zeros? I don't know, I haven't done it before in any programming language. If I wanted three eggs over easy, I might order "0003" eggs, and if the waiter either had a sense of humor or understood the math I was foisting on him, I would get an ea...
by Ledigimate
Sun Dec 16, 2018 10:54 pm
Forum: Talking LiveCode
Topic: Circular shift
Replies: 20
Views: 13643

Re: Circular shift

Ah. But still not getting it. Rotating the base 2 value of "1234" ("10011010010") gives "00110100101" which in base 10 is 421.Or if you rotate the other way, 617. In order to get 2468 from 1234 (double the value), you must double the base 2 string, which requires that you add a "0" to the right sid...
by Ledigimate
Sun Dec 16, 2018 9:42 pm
Forum: Talking LiveCode
Topic: Circular shift
Replies: 20
Views: 13643

Re: Circular shift

Hi. Hermann will soon jump all over this. But before he does, please explain how you get 4644 from 1234. Changing those values to base 2, and then rotating, does not do that, so i am on the wrong track. Craig Sorry, my bad!! :oops: I used a programmers' calculator to manually do the bit rotation an...
by Ledigimate
Sun Dec 16, 2018 9:33 pm
Forum: Talking LiveCode
Topic: [Solved] md5digest of large files, how reliable is it?
Replies: 21
Views: 11453

Re: [Solved] md5digest of large files, how reliable is it?

Maybe not - did you see Trevor's post on this? By reading the file in chunks and aggregating the checksum you can get a good result without taxing RAM: https://forums.livecode.com/viewtopic.php?f=9&t=31892#p174152 The only downside to that approach would be if you later need to compare the checksum...

Go to advanced search