Re: [basex-talk] Crash when starting basexgui

2023-11-20 Thread Joe Wicentowski
Thanks, Michael, Christian, and Johan, for your help and ideas!

I finally had the chance to dive in. I couldn't just install temurin (Java
21), since I already had used Homebrew to install temurin@8 (which I need
for eXist). Whenever I've previously needed to switch between two versions
of Java I would use homebrew to uninstall one and install the other. This
takes time, so it wasn't ideal. I would like to run eXist and BaseX
whenever I need them, without this hassle. So this gave me a chance to try
out jenv. I followed a few tutorials. The best one I found was
https://www.baeldung.com/jenv-multiple-jdk.

Hopefully the underlying bug causing the weird error on macOS will be
solved, but in the meantime, this will do the trick.

Below are some of the commands I used, in the hope that this might help
others who need to run multiple versions of Java.

Thanks again!
Joe


# install jenv - and follow the installer's hints to add lines to your
.zshrc or .profile
brew install jenv

# install the versions of java you need
brew install temurin temurin@8

# register these versions
jenv add /Library/Java/JavaVirtualMachines/temurin-8.jdk/Contents/Home
jenv add /Library/Java/JavaVirtualMachines/temurin-21.jdk/Contents/Home

# set the global java to 8 - a good default for me
jenv global 1.8

# set the current shell to 21 - so I can start basexgui in this terminal
without affecting other places
jenv shell 21.0

# check current shell version
jenv versions
  system
  1.8
  1.8.0.392
* 21.0 (set by JENV_VERSION environment variable)
  21.0.1
  temurin64-1.8.0.392
  temurin64-21.0.1

On Wed, Oct 25, 2023 at 9:19 AM Johan Mörén  wrote:
>
> Thanks for the workaround Michael!
>
> It worked for me as well but I installed temurin via homebrew.
> brew install temurin
>
> Regards,
> Johan
>
> On Wed, Oct 25, 2023 at 3:03 PM Johan Mörén  wrote:
>>
>> Hi Michael, my setting for "Allow Applications Downloaded from…" is “App
Store and identified developers”.
>>
>> It's controlled by a central company profile so I can't change it.
>>
>> Thanks for pointing out that the warning is not the cause. I managed to
see the same error report as you posted when i choose "report to apple"
>>
>> Regards,
>> Johan
>>
>> On Wed, Oct 25, 2023 at 2:21 PM Michael Seiferle  wrote:
>>>
>>> Hi Johan,
>>>
>>>
>>>
>>> it works (well worked… see below) on my machine with the very same
setup (basex@10.7 & openjdk@21 via brew, see my previous email), so I am
sure it is an issue for certain setups.
>>>
>>>
>>>
>>> what’s your security settings? Apple Menu -> Privacy & Security ->
Allow Applications Downloaded from… mine is set to “App Store and
identified developers”.
>>> Now if I set it to “App Store” BaseX will not start with the following
error:
>>>
>>>
>>>
>>> BUT: now it won’t start again even if I set it back :-{
>>>
>>> So my motivation to find a fix or workaround is considerably higher now
I will report once I found something.
>>>
>>>
>>>
>>> The warning that is dumped to your console — something something
NSApplicationDelegate.applicationSupportsSecureRestorableState — doesn’t
cause BaseX to crash, as I could see this warning as well.
>>>
>>> Background:
>>>
>>>
https://stackoverflow.com/questions/77283578/sonoma-and-nsapplicationdelegate-applicationsupportssecurerestorablestate
>>>
>>>
>>>
>>> Best
>>>
>>> Michael
>>>
>>>
>>>
>>>
>>>
>>> Von: Christian Grün 
>>> Datum: Mittwoch, 25. Oktober 2023 um 13:09
>>> An: Johan Mörén 
>>> Cc: Michael Seiferle , BaseX <
basex-talk@mailman.uni-konstanz.de>
>>> Betreff: Re: [basex-talk] Crash when starting basexgui
>>>
>>> Thanks. It seems we have to wait for Apple to fix this. Unfortunately,
their bug tracker doesn’t seem to be public [2].
>>>
>>>
>>>
>>> [1]
https://github.com/Homebrew/homebrew-core/issues/150824#issuecomment-1776139189
>>>
>>>
>>>
>>>
>>>
>>> On Wed, Oct 25, 2023 at 1:01 PM Johan Mörén 
wrote:
>>>
>>> Running MacOS Sonoma Apple Silicon M2 processor and ran into the same
problem when homebrew updated my JDK to 21.0.1 today.
>>>
>>>
>>>
>>> According to this article it seems like applications like jmeter and
IntelliJ needs to fix this by implementing a specific interface. I guess
this applies to Basexgui as well?
>>>
>>>
>>>
>>>
https://stackoverflow.com/questions/77283578/sonoma-and-nsapplicationdelegate-applicationsupportssecurerestorablestate
>>>
>>>
>>>
>>> Regards,
>>>
>>> Johan
>>>
>>>

>


[basex-talk] Bug in fn:fold-right?

2023-11-20 Thread Thompson, Timothy
Greetings,

I noticed that there seems to be an issue with fn:fold-right in BaseX (10.8 
beta). When I pass it a sequence of elements, they do not get 
atomized/accumulated. Example:

let $data := 
  a
  b
  c

return
  {
fold-right(
  $data/*,
  "",
  concat(?, ".", ?)
)
  }

returns: 

The same query in Saxon-HE 11.4 returns: a.b.c.

Best regards,
Tim


--
Tim A. Thompson (he, him)
Librarian for Applied Metadata Research
Yale University Library




[basex-talk] BaseX 10.7 and util:if

2023-11-20 Thread Andy Bunce
Hi,
The documentation for the utility module [1] says certain functions will be
removed in version 11 because they will be in XPath 4.0.
However, util:if has been removed from the documentation and I think there
is no equivalent function in this case.
util:if is an alternative  syntax for the BaseX Ternary operator  [2].

( I have used it because it was easier than trying to get my XQuery parser
EBNF to accept  $ok ?? 1 !! 0 etc)

Is util:if to be removed?

/Andy
[1] https://docs.basex.org/wiki/Utility_Module#util:if
[2] https://docs.basex.org/wiki/XQuery_Extensions#Ternary_If


[basex-talk] The duration of a cached job

2023-11-20 Thread Andy Bunce
Hi,

Back in the winter of 2017, BaseX 8.6 , I reported an issue with job
duration [1]

A question about jobs:list-details[2]
I had expected the attribute duration: evaluation time (for running and
cached jobs) to be frozen once the job is cached.


Using BaseX 10.7 it seems this issue is back
```
 job:eval("42",(),map{"cache":true()})
job24

   job:list-details("job24")
42

   job:list-details("job24")
42
```
/Andy

[1]
https://www.mail-archive.com/basex-talk@mailman.uni-konstanz.de/msg09036.html
[2] https://docs.basex.org/wiki/Job_Module#job:list-details