Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - RonB

Pages: [1]
1
InForm Discussion / Re: Please Wait negates ability to have a Cancel Button
« on: February 13, 2019, 08:46:14 pm »
The utility, which I will upload some day (sooner if anyone shows interest), uses several of the Inform tool widgets: Buttons, Labels, Textboxes, Checkboxes, Radiobuttons, Frames, and Progressbars, and hides/displays them (including the main form, itself, at times) depending on what processing is taking place.
The utility's purpose is to compare selected file types (e.g. *.bas, *.cpp, *.txt) between two different Windows folders - including matching sub-folders, if requested, and with options to exclude specific files (using wildcards) or subfolders. Files being compared  that exist in both main, or matching sub-folders, will be compared taking specified options into consideration - e.g. file contents or attributes only; case sensitivity option, column limits option, whitespace options, line terminator options, etc. ). For each matching filename pair, the first difference will be logged, along with the line number and offset at which the mismatch was found. If requested the names of compared files and/or added/deleted files will also be logged.
I use the utility to compare original and work-in-progress version folders to verify that all changed/added/deleted elements have been accounted for. For my purposes, a difference in file dates is not significant (e.g. I could have made, then reversed, a change in the w-i-p  folder).
For a recent run, I compared two versions, each of which contained over 30,000 files, of which only about 7,000 in each met the file filters (included file-types,  excluded folders). The utility ran for about 6 minutes and identified 38 changes, plus a fair number of additions/deletions.
I wanted the "Cancel" button available in the event that  I noticed that the utility was "taking a long time" in a particular subfolder or on a particular file-type that I should have excluded in the filters. since they were not relevant. Without the excluded subfolders the utility would run twice as long (and I run it several times a week).

2
InForm Discussion / Re: Please Wait negates ability to have a Cancel Button
« on: February 12, 2019, 04:58:27 pm »
That does work, but means, in at least one "real world" invocation, over 10,000 calls to the __UI_DoEvents routine (if the app runs to completion), just to support the ability to cancel the program after, say, 5000 iterations of the loop.
And lest you wonder: there are, of course (thanks to Inform), several visual clues as to the application's progress: there is a count-DOWN counter showing how many iterations remain, there is a nice green progress bar, there is a count-UP counter as to how many "hits" have resulted, and there is a display that is constantly updated showing what the application is currently evaluating.
To be honest, though, the extra calls don't slow the process down THAT much. :-)

Ron

3
InForm Discussion / Please Wait negates ability to have a Cancel Button
« on: February 12, 2019, 02:18:03 pm »
I have an Inform Application that runs for quite a while, and would like to have a Cancel Button enabled for the user to stop the process at any time. I have no problem creating and displaying the Cancel Button, but unfortunately it cannot be clicked, because the entire window is darkened and overlaid with a "please wait" message.
Is there some way to either prevent the "please wait" or enable a button in the window whenever it is appropriate?

Thanks

Ron

4
Programs / Re: Binary Search Method
« on: January 30, 2019, 07:48:16 pm »
The absolute fastest TLU is a "direct" lookup - one where the argument IS the entry number (or index) of the entry, itself. For example, if you needed to validate the 5-digit U.S. zip code for 360 million address records, you could first construct a table (ZipCodeTable) in which there is an array entry for every possible zip code, whether valid or not. That's 100000 entries (numbered from zero to 99999). The entry for each VALID zip code will contain the number '1' (for valid). The entry for each INVALID zip code will contain the number '0' (for invalid). This TLU table requires 100000 entries (which, I believe, means that QB64 will generate code to maintain an array index table containing pointers for each of those 100000 entries). Processing is simple (assuming that you have already verified that the RecordZipCode was 5 numeric digits):
     zipcode& = VAL(RecordZipCode)
     IF ZipCodeTable(zipcode&) = '1' THEN process as valid ELSE process as invalid END IF.

Alternatively, you could create a single string of 100000 bytes, with each corresponding byte set to either 1 or 0. This TLU "table" (really a byte-string) requires 100000 bytes (no QB64 generated array index table). Processing is simple:
     zipcode& = VAL(RecordZipCode)
     IF MID$(ZipCodeTable,zipcode&,1) = '1' THEN process as valid ELSE process as invalid END IF.

I'm not sure whether QB64 would support a bitstring of 100000 bits; and while the "table" would take only 12500 bytes, it may take a lot longer to obtain the result.

Always trade offs. Bottom line: pick the TLU method that works best based on THE ACTUAL (or expected) DATA, depending on your requirements - array size, speed, simplicity, reliability, data placement (file, memory, web), etc. One size does NOT fit all.

5
QB64 Discussion / Re: Wiki notation glitch
« on: January 06, 2019, 02:45:53 pm »
Sorry, I can't resist...
The (16-bit) Integer Minimum Value should be -32768 not -32767. Prove it yourself:
a% = -32767
PRINT a% ' will show -32767
a% = a% -1
PRINT a% ' will show -32768
a% = a% -1
PRINT a% ' will show (positive) 32767 as it should

6
QB64 Discussion / Re: How big is yours?
« on: November 20, 2018, 12:00:42 am »
That's a really big program. What was/is it used for?

Pete

It was a program that took in several demographic values and generated rate quotes based on the combination of those values.

7
QB64 Discussion / Re: How big is yours?
« on: November 19, 2018, 10:36:49 pm »
On another note, I once REMOVED around 23K lines of code from a program without affecting any functionality - and it wasn't "dead" code, either. I merely changed thousands and thousands of very "similar" code blocks that used hard-coded values into just couple of dozen subroutines that used variables passed on the Calls instead. Even so, the resulting program still had over 40K lines of code left.

8
Programs / Re: Adaptive LZW packer/unpacker
« on: November 19, 2018, 07:47:33 pm »
I hope it's just me, but when I tried the (newly downloaded) lzwpacker.bm using the (newly downloaded) TestLZW.bas with the input file changed to the Clock1.PNG from the cuckoo clock project (originally obtained from [abandoned, outdated and now likely malicious qb64 dot net website - don’t go there]), I got a  really bad result: Line 37 (in main module), invalid function call. Clock1.PNG is ~95KiB and TestLZW says it compressed the file to 0.00 KiB in 3/100ths of a second, but then blew up on the Unpack phase -'cause the input file was empty.
If you can't find the Clock1.PNG or the Cuckoo Clock zip file, I can upload it in a BASFILE style output .bas restore program, if you'd like to test it yourself

FWIW, I discovered this when attempting to modify the MAKEDATA program (which is outstanding) so that it would take an existing image file (i.e. Clock1.PNG) do a _LOADIMAGE (instead of a GET,,file) then compress the image as stored in memory using LZWPacker to create the output .bm file. Then when the target program ran, the .bm function, instead of recreating the external FILE, would recreate the internal image in memory and return its image handle.

Ron


9
QB64 Discussion / Re: Internals of String swapping
« on: November 15, 2018, 08:25:55 pm »
(Too) many moons ago, in a land far, far away (Burrough's B-263 mainframe with 12K of memory, 1 tape drive, and 1 hard disk) we had a function called RSD - Read Sorted Disk. When the need arose to sort a file, whenever the length of the (combined) sort fields PLUS 6 (2-bytes each for the cylinder#(cc), head#(hh), and record#(rr) address of a record on disk) was less than half the length of the records being sorted (which was true a majority of the time), instead of swapping entire records on disk (memory sorting in 12K wasn't on the menu), we read the file and wrote "key" records containing just the sort field(s) plus the original record's address (cchhrr)). Then we sorted that "key" file on the sort field(s). After sorting, the RSD function would read the "key" records in sequence and use the cchhrr to retrieve/return the "full" records in sorted order.
Perhaps a similar implementation but utilizing memory for each small "phase" of the polyphase sort/merge would speed up the process? If real string swapping is occurring (and I suspect it is), then sorting "shorter" elements in memory would speed up the process of every phase. Admittedly, there IS an extra pass+ to read the original file and build/write the "key" file, and there IS an extra pass+ to read the sorted "key" file and retrieve/write the sorted "original" file. That's why the RSD process was only used if the length of the sort fields (plus 6) was less than half the original record length.

10
InForm Discussion / Re: Inform Beta7 Installation failure
« on: October 25, 2018, 06:48:39 pm »
I try to avoid Program Files (or Program Files (x86)) as much possible. C:\QB64 is where it's at.
And, fwiw, I did try running the install "as administrator" for all the good that did. Wasn't a problem running as a plain old user on my InForm-friendly machine. Also, fwiw, the UNfriendly machine has EndPoint AV, while the Friendly machine doesn't. Perhaps that's why non-InForm QB64 programs DID compile & run. Then again, the ones I compiled successfully did NOT have messagebox function calls. I'll have to have a look at that a little closer. That seems to be a culprit.

11
InForm Discussion / Re: Inform Beta7 Installation failure
« on: October 25, 2018, 05:55:32 pm »
To paraphrase Shakespeare, The fault, Dear Brutus, lies not in our stars, but in our Anti-virus software.
After much ado, I installed the v1.2 QB64 and InForm Beta 7 on a different Windows 7 machine - one that is running different AV software, and InForm installed just fine - the C++ compiles to .EXE's ran without a problem, and the UIEditor came up and looks great. Unfortunately, it means that, once upgraded to InForm Beta 7, my InForm based QB64 programs cannot be maintained on that InForm intolerent machine, but will have to be compiled on machines with kinder, gentler, InForm-friendly AV software.
Curious as to why some AV software doesn't like InForm compilations.

Ron

12
InForm Discussion / Re: Inform Beta7 Installation failure
« on: October 24, 2018, 07:48:46 pm »
Actually, the syntax error was something different, but when the form opened in a separate window, it was flagged on a statement that would have been OK in the grand scheme, just not in a standalone file.
Anyway, The program DOES compile in QB64 v1.1 with the old InForm but fails in QB64 v1.2 with the Beta 7 InForm. The compilation error log shows:
\AppData\Local\Temp\ccmOTGZh.o:qbx.cpp:(.text+0xac436): undefined reference to `MessageBoxA(int, char*, char*, int)'
\AppData\Local\Temp\ccmOTGZh.o:qbx.cpp:(.text+0xac5b5): undefined reference to `MessageBoxA(int, char*, char*, int)'
\AppData\Local\Temp\ccmOTGZh.o:qbx.cpp:(.text+0xac6e8): undefined reference to `MessageBoxA(int, char*, char*, int)'
/qb64/internal/c/c_compiler/bin/../lib/gcc/i686-w64-mingw32/4.7.1/../../../../i686-w64-mingw32/bin/ld.exe: \AppData\Local\Temp\ccmOTGZh.o: bad reloc address 0x10 in section `.data'
/qb64/internal/c/c_compiler/bin/../lib/gcc/i686-w64-mingw32/4.7.1/../../../../i686-w64-mingw32/bin/ld.exe: final link failed: Invalid operation
collect2.exe: error: ld returned 1 exit status

Perhaps that helps? FWIW, the program does invoke a messagebox for errors

13
InForm Discussion / Re: Inform Beta7 Installation failure
« on: October 24, 2018, 06:55:20 pm »
Yes. Non-Inform programs compile OK.
Programs that DO include InForm forms, created with a prior version of InForm, obviously,  get flagged with an "Illegal string-number conversion" error in the SUB __UI_LoadForm Subroutine in the included form. For example, a program including "MyForm.frm" gets flagged on statement:
 __UI_NewID = __UI_NewContro(__UI_Type_Form, "MyForm", 722, 590, 0, 0, 0).

Ron

14
InForm Discussion / Inform Beta7 Installation failure
« on: October 24, 2018, 05:49:25 pm »
Downloaded and installed both QB64 v1.2 (stable) AND QB64 v1.2 (Latest). Then downloaded Inform Beta 7.
When trying to install Inform in either of the v1.2 QB64 folders, the install appears to freeze at the C++ to EXE portion of compiling the UIEditor and I have to cancel the compile and the installation fails.
I tried compiling \inform\UIEditor.bas in the QB64 IDEs (v1.1, 1.2stable, and 1.2Latest) all with the same result - IDE says the .bas is OK, but an attempt to run begins the compilation process but it never finishes, and I have to kill the IDE.
Running on Windows 7 Professional.

Pages: [1]