Karim Belabas on Mon, 01 Jan 2024 21:45:35 +0100


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: gp_oeis_search (Search integer sequence specified by short PARI/GP script on oeis.org)


* hermann@stamm-wilbrandt.de [2024-01-01 19:59]:
> On 2024-01-01 19:46, Karim Belabas wrote:
> > * hermann@stamm-wilbrandt.de [2024-01-01 19:41]:
> > > The behavior is different based on whether firefox is already
> > > running or
> > > not.
> > > If running, a new tab is opened with search page, and GP prompt
> > > appears on
> > > x86_64+aarch64.
> > > If firefox is not already running, x86_64+aarch64 hang after starting
> > > firefox, no GP prompt.
> > 
> > Ah, yes. If the browser is not already running, we mustRun the browser
> > as a background job, otherwise system() will wait for the command to
> > complete. Here's the (hopefully) final version:
> > 
> >   oeis(v)=
> >   { my(s = ""); for (i=1, #v, s = concat(s, Str(v[i]",")));
> >     system(Str("$BROWSER https://oeis.org/search?q=";, s, "&"))
> >   }
> > 
> > Cheers,
> > 
> >     K.B.
> > 
> Thanks, that works, browser gets started in background.
> Only quirk is the GP prompt occurs before the warning messages.
> But either pressing ENTER, or just entering next GP command as below is
> fine.
> 
> pi@raspberrypi5:~ $ BROWSER=firefox gp -q oeis.gp
> ? [GFX1-]: glxtest: DRM render node not clearly detectable. Falling back to
> using the only one that was found.
> [GFX1-]: vaapitest: ERROR
> [GFX1-]: vaapitest: VA-API test failed: failed to initialise VAAPI
> connection.

A final (brutal) possibility is to get rid of standard output and error:

  oeis(v)=
  { my(s = ""); for (i=1, #v, s = concat(s, Str(v[i]",")));
    system(Str("$BROWSER https://oeis.org/search?q=";, s, ">/dev/null 2>&1 &"))
  }

Cheers,

    K.B.
-- 
Pr. Karim Belabas, U. Bordeaux, Vice-président en charge du Numérique
Institut de Mathématiques de Bordeaux UMR 5251 - (+33) 05 40 00 29 77
http://www.math.u-bordeaux.fr/~kbelabas/