Glenn BarnasAdministrator
(KiX Supporter)
2020-07-04 01:04 AM
UDF Library

It's been a while, but my UDF and apps library is back online - www.barnas.us/programming.
Items that are available include:
  • Intro to Programming Guide
  • KGen Function Linker / Script Generator
  • Entire KixLib as a single Zip file
  • The KixLib in browsable HTML format
  • The Cipher UDF - Tokenized
  • Universal Login Script
The site is a little bland - I just wanted to get the components back online first. The UDF library has been maintained and updated, and there are several new UDFs, including a URL function that supports PUT,GET,POST,PATCH, and DELETE, and can download text and binary files over HTTP or HTTPS protocols. Another new function that we use extensively for debugging is DispResult(thing) Feed it a "thing" and it figures out what it is (var, array, complex array), then reports the type of data and displays the contents. The Excel library (Lib-XL) has been updated with Save-As and Export to PDF/XPS functionality.

I have additional libraries available under license that interface with REST APIs of various products, including QuickBooks, Zen Support/Sell, and others.

Enjoy!

Glenn


Arend_
(MM club member)
2020-07-07 11:07 AM
Re: UDF Library

Nice Glenn!!

NTDOCAdministrator
(KiX Master)
2020-07-24 10:09 PM
Re: UDF Library

Thanks for keeping up and sharing for everyone Glenn

Hope you're doing well during these trying times


Glenn BarnasAdministrator
(KiX Supporter)
2020-07-28 01:43 PM
Re: UDF Library

Thanks! Hope you and family are good as well.

Took a long time to find the time and energy to put a site back up, but we've been busy and I'm trying to force myself to have some down-time, even if it's tech in a different form. Spending time in the shop on weekends (when it's not 90+ degrees) and finally prepping the basement for a train layout.

Lots of updates in the library, and we've built some cool (but private) libraries for interfacing with APIs, including QuickBooks (thanks to Allen for pitching in!)

Glenn


Henriques
(Fresh Scripter)
2020-08-06 11:57 PM
Re: UDF Library

Talking about the Excel-Library, there's an error in xlRangeSort() namely in line 1203 there's a variable _ExRv which is no longer dimmed and I think not even necessary in that line since it's nowhere filled.

Glenn BarnasAdministrator
(KiX Supporter)
2020-08-07 12:42 AM
(NA) Re: UDF Library

The command run by the Execute statement is $_ExRv = $_ID.Worksheets...
In effect, it's an un-dimmed variable used to catch the return code of the Execute statement. Dimming it in the function is unnecessary because it isn't used, and execute isn't subject to the Explicit declaration, but a var is required in the Execute to handle the result or it will pop out somewhere.

At least that's how I remember it from some 15 or so years ago when it was first written. ;\)

I don't recall ever using that function - I'll give it a try and see what I get.

Glenn


Henriques
(Fresh Scripter)
2020-08-07 12:59 AM
(NA) Re: UDF Library

When looking in version 1.1 you'll see that there is a dim of $_ExRv.

Glenn BarnasAdministrator
(KiX Supporter)
2020-08-07 05:52 PM
(NA) Re: UDF Library

Verified that it must be dim'd. Also found a bug in xlRangeValue that fails to return data when requesting a single column. Single Row and multi-row/col work. Bug is fixed, but after a power failure this week my site is down. Unsure at this time if the firewall reverted to a prior config or the fiber router is blocking ports, but I have no inbound web or email at this time. Updates are posted and will be available once I figure out the traffic issue sometime this weekend.

Glenn


Glenn BarnasAdministrator
(KiX Supporter)
2020-08-08 08:48 PM
(NA) Re: UDF Library

OK - overthinking the problem - Dynamic IP changed, Dyn-DNS update failed because the provider changed their URL. All good now, and added several new and updated UDFs, as well as fixing the Lib-XL library issue that Henriques mentioned.

Glenn


Glenn BarnasAdministrator
(KiX Supporter)
2020-08-09 11:40 PM
(NA) Re: UDF Library

Updated popular UDFs with current download links, posted a few new UDFs as well.

AllenAdministrator
(KiX Supporter)
2020-08-10 05:09 AM
Re: (NA) Re: UDF Library

Thanks for all those. I need to review what changed especially in INIArray.

Glenn BarnasAdministrator
(KiX Supporter)
2020-08-10 11:52 PM
Re: (NA) Re: UDF Library

IniArray added EnumIniArray(), which I found worked slightly differently than EnumIni(). There was an extra newline coming from ReadProfileString that wasn't in EnumIniArray() that caused some wonkiness. The other SIGNIFICANT change is that you can pass an array of INI-format data instead of a filename for IniArray to process. Here's a cool trick we're using:
 Code:
$aGlobal = FileIO('GlobalConfig.ini', 'R')        ; read the GLOBAL config settings.
$aTask   = FileIO('TaskConfig.ini', 'R')          ; read the Task-Specific config settings.
$aGlobal = ArrayJoin($aGlobal, $aTask)            ; combine the two INI files
$aConfig = IniArray($aGlobal)                     ; "read" the complete ini file
This allows us to maintain one config file with the common settings, and then have one or more "task" files that list what needs to be done. FileIO loads each INI file into an array, then ArrayJoin puts the two arrays together, which gets passed to IniArray as if it had read one complete config file. This allows having many task configs but only one file with the common information instead of duplicating it in each file (and later having to update each file when something changes).

ArrayJoin() is new, as is Edit(). While we have lots of INI files for configs, many have features disabled that need to be enabled by removing the comment. Edit allows us to do that through automation. There's a few more actions coming on that one...

You should look at DispResult(), which has been a great tool for development troubleshooting, pass it anything - var, array, or 2-dim array and it will identify it and then display all the data.
 Code:
$Result = SomeFunc()
DispResult($Result) ?
You don't need to worry about the var type, so when you get back an array while expecting a variant, well - there it is!

ListCompare() (obviously) compares 2 delimited lists and returns an array of arrays listing what's missing from one file relative to the other. We were doing a lot of data logging/mining and looking for missing items during dev made me want to poke my eyes out. Comparing what we generated to what we knew was in the data allowed us to pinpoint a logic issue when one element consistently came up missing.

Also new are GetTimeNTP(), IntlDate(), and StandardizedTime(), which help with displaying times/dates internationally.

We've been busy, and there are some 25 additional non-public UDFs added to our library in the past year besides the ones I published or updated yesterday.

Some really cool things afoot -
We have a Kix service that runs on a server, using Sockets to listen for work requests. It monitors a folder for job requests. Requests are processed and added to a queue using IniArray (for speed) that writes an INI file copy of the memory array every few minutes (for recoverability). We have up to 8 thin clients that each run a service. They use Sockets to check in with the server every minute. If there's a job in the queue, the job is sent to the first available client for processing. The client logs into a web app and using Selenium, performs updates and customization tasks. Normally 1 T-C system is running, but we can start more when we do mass updates to client systems, completing almost 80 update an hour - about the time it took for one engineer to update just 2-3 systems. The Kix service drives a Python-Selenium EXE, and the service can run multiple Kix or "PyLenium" apps to complete the overall job. The deployment service communicates status to the management service, waits on failures, and can be commanded by the management service to retry, skip, or terminate.

And you thought Kix was a login script processor, eh? \:\)


NTDOCAdministrator
(KiX Master)
2020-08-28 12:43 AM
Re: (NA) Re: UDF Library

Thank you again Glenn

Though not much active scripting for me these days I do apprecitat your continued efforts in helping others


BradV
(Seasoned Scripter)
2020-10-09 04:09 PM
Re: (NA) Re: UDF Library

Thanks Glenn!

Henriques
(Fresh Scripter)
2020-10-10 07:06 PM
Re: (NA) Re: UDF Library

Glenn on the 2020-08-07 you wrote about a bug in the XLRangeValue function in the Lib-XL.kxf script, I've been looking but I didn't find any difference with the old function.