Re: [Jgeneral] Running J in Jupyter
Hi Chris, yes, the command you suggest starts the J command line interpreter. I agree that it looks like a Python problem, but: 1. I'd expect the JDemo installation to use its own python interpreter and packages rather than the system-wide one 2. in any case, my python 3.6.9 installation works fine, both from the command line and from my own jupyter install. Maybe a list of required packages would help? Thx, Francesco On Sun, Aug 23, 2020 at 9:00 PM chris burke wrote: > 1. Can you confirm that J does run on your machine, i.e. the following > should load J; > > ../JDemo/J805/bin/jconsole > > 2. Line 19 has "ModuleNotFoundError: No module named 'contextvars'" > > This looks like a Python problem, perhaps a mismatch between the > download and your local copy of python? > > The download is a little old and may need updating. > > On Sat, Aug 22, 2020 at 10:41 AM Francesco Pedulla' > wrote: > > > > Dear all, > > I cannot run J in a Jupyter notebook. > > Following the instructions at > > https://code.jsoftware.com/wiki/Guides/Jupyter, I: > > > >1. downloaded the 64bit compressed tar file for Linux > >2. unpacked it under my home directory on a Ubuntu 18 desktop machine > >3. cd to the new directory (/home/francesco/JDemo) > >4. run the jupyter-notebook.sh script > >5. in the freshly opened browser window (http://localhost:/tree), > >selected New->J > >6. waited while the kernel was starting and jupyter tried to connect > to > >it > >7. give up after jupyter repeatedly failed to connect to the J kernel > >(see attached stderr output). > > > > The error about the NaCl helper process at line 10 shows up also in > another > > installation of jupyter, on the same machine, where both python and > > sagemath run fine. Hence, I believe it should be the reason for the > > failure. > > Error on line 19 looks more promising, but I am not sure how to interpret > > it - even less how to fix it. > > Any hint? > > Thanks in advance, > > > > Francesco > > -- > > For information about J forums see http://www.jsoftware.com/forums.htm > -- > For information about J forums see http://www.jsoftware.com/forums.htm > -- For information about J forums see http://www.jsoftware.com/forums.htm
Re: [Jgeneral] Running J in Jupyter
1. Can you confirm that J does run on your machine, i.e. the following should load J; ../JDemo/J805/bin/jconsole 2. Line 19 has "ModuleNotFoundError: No module named 'contextvars'" This looks like a Python problem, perhaps a mismatch between the download and your local copy of python? The download is a little old and may need updating. On Sat, Aug 22, 2020 at 10:41 AM Francesco Pedulla' wrote: > > Dear all, > I cannot run J in a Jupyter notebook. > Following the instructions at > https://code.jsoftware.com/wiki/Guides/Jupyter, I: > >1. downloaded the 64bit compressed tar file for Linux >2. unpacked it under my home directory on a Ubuntu 18 desktop machine >3. cd to the new directory (/home/francesco/JDemo) >4. run the jupyter-notebook.sh script >5. in the freshly opened browser window (http://localhost:/tree), >selected New->J >6. waited while the kernel was starting and jupyter tried to connect to >it >7. give up after jupyter repeatedly failed to connect to the J kernel >(see attached stderr output). > > The error about the NaCl helper process at line 10 shows up also in another > installation of jupyter, on the same machine, where both python and > sagemath run fine. Hence, I believe it should be the reason for the > failure. > Error on line 19 looks more promising, but I am not sure how to interpret > it - even less how to fix it. > Any hint? > Thanks in advance, > > Francesco > -- > For information about J forums see http://www.jsoftware.com/forums.htm -- For information about J forums see http://www.jsoftware.com/forums.htm
Re: [Jgeneral] Line and Advance for JHS?
Thanks for the feedback on JHS. There is so much more that could be done, but little has been done for the last few years. Effort that previously went to JHS now goes into Jd. I use JHS for all my work. The improvements you suggest are doable and not difficult. But they require an initial investment in learning the quirky JHS environment and digging into the rich, but sometimes nasty, codemirror world. I make extensive use of spx (tour|spx) in JHS. It provides some of what you are asking for and again, it could certainly be improved on. What source script I am working on is always under spx. If not already familiar with spx, take a look. The perhaps we can continue this discussion to get some incremental JHS improvements. On Sun, Aug 23, 2020 at 8:29 AM Julian Fondren wrote: > Howdy, > > I'm really liking JHS as a rich console with its ability to > inline plots and arbitrary HTML elements, where other frontends > would have to use a separate window. > >jhtml'' > > I have some complaints about it though, and the biggest one is > that the editor doesn't have qtide's Run menu with its line > evaluation commands. > > I've worked with ide/jhs/jijs.ijs enough to think that I > can add line evaluation after a fashion. But, has anyone > already done this? > > Nice-to-haves are > > - evaluating the line as interactive input instead of going >through load__ > > - properly evaluating lines that include 0 : > > - updating the /jijx tab, to see the results of evaluation, >without having to hit enter in it first > > Does anyone have any other customizations of JHS like this? > -- > For information about J forums see http://www.jsoftware.com/forums.htm > -- For information about J forums see http://www.jsoftware.com/forums.htm
Re: [Jgeneral] Line and Advance for JHS?
Bob and Julian, When I read Julian's post it made me think of spx (or maybe sp -- I can't remember), so I fired up JHS and tried looking for the relevant help. When I clicked on help inside the jhs `help` menu, I got the dreaded message below at the link: http://localhost:65001/~addons/docs/help/index.htm. get/post request failed response code 409 application did not produce result try browsing to url again additional info in jijx So, next from the `tour` menu, I tried spx and was pleasantly treated to a tour which produce a separate spx.ijs window showing all the tour lines. Although I did not take much of the tour, I found one puzzling result which you can sort of see by typing the following command in the jijx window. Part of the puzzlement is that at one point when I had pressed ctrl+. to advance the tour, a horizontal line spread across the page, but I could not get the horizontal line to appear myself UNTIL when writing this message I entered the first line below. When I did that the horizontal line appeared right below the first line below. spx 37 40 previous line displays as horizontal rule sequential lines starting with NB. display in a single advance To continue, though, I wonder if the tour-producing script might be a model for Julian. But I don't know what or where that script is. The spx.ijs script which is shown for the tour is quite informative, also. JVERSION Engine: j807/j64/darwin Release-c: commercial/2019-02-24T10:50:40 Library: 8.07.26 Platform: Darwin 64 Installer: J807 install InstallPath: /users/brian/j64-807 Contact: www.jsoftware.com -- (B=) -- For information about J forums see http://www.jsoftware.com/forums.htm
Re: [Jgeneral] Line and Advance for JHS?
Hi Julian, I tried about two years ago to drop my jig interface into JHS. Jig develops an SVG file that contains extra information that the user can reveal by hovering over elements of the display. It is an addon for jqt updated and running for version 805 to 902. Brief video intro https://youtu.be/dK1y_V07214 Anyway, since JHS is already HTML, I thought that it should not be too hard to incorporate the SVG display into JHS. What I tried was prepending the input line with a verb that would activate jig and strip the prepended verb off for the line display so that the SVG output displays instead of the usual text. Although, I did get it working after a fashion by making some changes to the input_jhs_ and output_jhs files, I found the process pretty confusing and never really grokked the process well enough that I wanted to make it anything that anyone else would use. I felt I was missing something obvious and if you find it I would be very interested in your results. Here is the input and output alterations that I tried. 'vis' is the verb that was prepended to the original input. Be very careful with your changes as this is affecting the interaction that you have as the program runs. It is a bit like trying to build the airplane in mid-flight. input_jhs_=: 3 : 0 NB. Rewriting of input_jhs_ to allow 'vis ' to be prepended to input to create svg jig result logapp 'jhs input prompt: ',":#y try. if. _1~:SKSERVER do. try. ".'urlresponse_',URL,'_ y' catch. end. end. NB. jijx if. _1~:SKSERVER do. jbad'' end. getdata'' NB. get and parse http request if. 1=NVDEBUG do. smoutput seebox NV end. NB. HNV,NV if. -. ((',jhsexit,'' jfe_jhs_ 0 2!:55[0 end. try. s=. y NB. output string type=. x NB. MTYO type class=. >type{'';'fm';'er';'log';'sys';'';'file' if. (6=type)*.URL-:'jijx' do. t=. jhtmlfroma s if. ''-:_4{.t do. t=. _4}.t end. LOGN=: LOGN,'',t,'' LOG_jhs_=: LOG,LOGN if. -.CHUNKY do. jhrajax_a LOGN else. jhrajax_b LOGN end. LOGN=: '' CHUNKY_jhs_=: 1 elseif. (3~:type)+.-.('jev_'-:4{.dlb s) do. NB. jev_... lines not logged if. (-. JIG_jig_) +: ('jig '-:4{.dlb s)+.('0 jig '-:6{. dlb s)+.(*./' '=s) NB. jig only if JIG flag and not 'jig' command or empty line do. if. 3=type do.'noun visjig'=. 2{. ;: s s=. (2* 'vis'-:visjig )&}. &. ;: s s=. PROMPT, dlb (}.@:(_3&}.))^:(0 ~: ". noun) s end. NB. vis that was prepended in input removed to avoid display on input line else. if. 3=type do. if.('6'-:{.s) do. s=. '' else. s=. PROMPT,dlb s end. end. NB. 6 empty prompt case from input, necessary for when jig is deactivated end. t=. jhtmlfroma s if. ''-:_4{.t do. t=. _4}.t end. LOGN=: LOGN,'',t,'' end. catch. logappx'output' exit'' end. ) Good luck with your project. Cheers, bob > On Aug 23, 2020, at 05:29, Julian Fondren wrote: > > Howdy, > > I'm really liking JHS as a rich console with its ability to > inline plots and arbitrary HTML elements, where other frontends > would have to use a separate window. > > jhtml'' > > I have some complaints about it though, and the biggest one is > that the editor doesn't have qtide's Run menu with its line > evaluation commands. > > I've worked with ide/jhs/jijs.ijs enough to think that I > can add line evaluation after a fashion. But, has anyone > already done this? > > Nice-to-haves are > > - evaluating the line as interactive input instead of going > through load__ > > - properly evaluating lines that include 0 : > > - updating the /jijx tab, to see the results of evaluation, > without having to hit enter in it first > > Does anyone have any other customizations of JHS like this? > -- > For information about J forums see http://www.jsoftware.com/forums.htm -- For information about J forums see http://www.jsoftware.com/forums.htm
[Jgeneral] Line and Advance for JHS?
Howdy, I'm really liking JHS as a rich console with its ability to inline plots and arbitrary HTML elements, where other frontends would have to use a separate window. jhtml'' I have some complaints about it though, and the biggest one is that the editor doesn't have qtide's Run menu with its line evaluation commands. I've worked with ide/jhs/jijs.ijs enough to think that I can add line evaluation after a fashion. But, has anyone already done this? Nice-to-haves are - evaluating the line as interactive input instead of going through load__ - properly evaluating lines that include 0 : - updating the /jijx tab, to see the results of evaluation, without having to hit enter in it first Does anyone have any other customizations of JHS like this? -- For information about J forums see http://www.jsoftware.com/forums.htm