Hi Skip,
Try this:
lz=: 3 : 0
,' '([,.~ -.~"1) ":10#.^:_1 y
)
lz 1 20 300 4000 5
1 00020 00300 04000 5
Good Luck,
Dave
On 2/3/2019 2:15 PM, 'Skip Cave' via Programming wrote:
Paolo and Devon provided the named dyadic verbs Fill and lead0s that
perform the function I spe
I am glad somebody is taking this on. This one is one of my favorites and
I was close to updating it myself.
I don't mind helping people test it out.
Good luck
On Sun, Feb 3, 2019 at 4:08 PM David Mitchell wrote:
> Here is a screen shot:
>
> http://honeoyeincolor.biz/graphviz.png
>
> On 2/3/2
Here is a screen shot:
http://honeoyeincolor.biz/graphviz.png
On 2/3/2019 17:57, David Mitchell wrote:
Chris,
I am updating graphiz for JQT. I downloaded the current support programs, which
work fine, and updating the 602 code to 807 should not take much time.
I am about 1/2 done.
David M
Chris,
I am updating graphiz for JQT. I downloaded the current support programs, which
work fine, and updating the 602 code to 807 should not take much time.
I am about 1/2 done.
David Mitchell
On 2/3/2019 17:15, chris burke wrote:
Could you get the 602 addon and just make whatever changes
Could you get the 602 addon and just make whatever changes are needed for
the code to run in 807? You should use a recent version of graphviz.
Once you have that, I can update the addon.
On Mon, Feb 4, 2019 at 12:45 AM R.E. Boss wrote:
> An addon which I used with much fun during J602 was graph
Paolo and Devon provided the named dyadic verbs Fill and lead0s that
perform the function I specified. Devon's verb has some extra bells and
whistles which I like.
Roger pointed out that the built-in format function 8!:2 allows a fill
option, but with my limited J expertise I wasn't able to turn Ro
I have this utility I've used for a while:
lead0s=: [: ]`>@.(1 = [: # ,) ('r<0>' , '.0' ,~ [: ": [) 8!:0 [: | [:
".`]@.(0 = [: {. 0 # ]) ]
3 lead0s i. 3
+---+---+---+
|000|001|002|
+---+---+---+
3 lead0s 10^i. 4
+---+---+---+---+
|001|010|100|***|
+---+---+---+---+
Since it uses format, it
An addon which I used with much fun during J602 was graphviz
(https://code.jsoftware.com/wiki/Addons/graphics/graphviz), from Oleg Kobchenko
(which I also miss dearly).
Since I don't know anything how to construct, maintain or transfer an addon, my
question is: is there someone who has the time
I think this was the only suggestion which didn’t require specifying the
number of digits in some way...
—
Raul
On Sunday, February 3, 2019, R.E. Boss wrote:
>,' '([,.~ -.~"1) ":10#.^:_1 a
> 0001 0002 0003 0004 0005 0010 0020 0030 0040 0050 0100 0200 0300 0400 0500
> 1000 2000 3000 4000 500
I discovered that the "not trusted" message only appears if I use the Jupyter
Notebook icon from the Anaconda install to run the labs. If I run the labs from
the Anaconda Prompt, the "not trusted" message does not appear.
David
On 2/3/2019 11:02, John Baker wrote:
Thanks for plowing through
Thanks for plowing through the configuration hurdles. The “not trusted” message
is probably some os/browser thing.
You are right about the steps being executed in order. This is how j labs work
so I unconsciously “ass”unmed it was unnecessary to mention it. I will edit the
notebooks to make thi
I ran JOD Best Practices Lab.ipynb. On the whole, it ran well.
I found two places in the lab where I had to go to JQT to run setup options. I
had to use JQT to setup the JOD User Defined folders. I also had to use JQT to
set the PDFReader in base.cfg.
In both cases, I had to restart the la
After installing Anaconda, configuring the J kernel and downloading the ipynb
files, I am getting this error loading JOD Best Practices Lab.ipynb JOD Best
Practices Lab.ipynb :
[W 08:41:11.077 NotebookApp] Notebook
Downloads/jod-master/jod-master/jodnotebooks/JOD Best Practices Lab.ipynb is no
SC> What's the best way to add leading zeros to a set of integers.
The compatible way, going back to J Version 5, 1992:
Over-take from the end with {. and Fit !. it to specify the fill
element:
_4 {.!.'0' 'ab'
00ab
Apply the usual extra stuff to have that work on your numeric list:
_4&
I didn't look very hard/hard enough!
M
On 03/02/2019 13:45, Roger Hui wrote:
1) I couldn't see that the format foreigns, 8!:0 - 8!:2, cater for
optional leading zeros
a =: 1 2 3 4 5 10 20 30 40 50 100 200 300 400 500 1000 2000 3000 4000
5000
,' ',.'r<0>4.' 8!:2 ,.a
0001 0002 0003
> 1) I couldn't see that the format foreigns, 8!:0 - 8!:2, cater for
optional leading zeros
a =: 1 2 3 4 5 10 20 30 40 50 100 200 300 400 500 1000 2000 3000 4000
5000
,' ',.'r<0>4.' 8!:2 ,.a
0001 0002 0003 0004 0005 0010 0020 0030 0040 0050 0100 0200 0300 0400 0500
1000 2000 3000 4000 500
pad=: [ ($&'0'@:(- #@:]) , ]) ":@:]
4 g"0 0 a
0001
0002
0003
0004
0005
0010
0020
0030
...
On Sun, 2/3/19, 'Skip Cave' via Programming wrote:
Subject: [Jprogramming] Adding leading zeros
To: "programm...@jsoftware.com"
Date: Sunday, February 3, 20
This may not be the best solution.
f=.[:,[:|:' ',[:}.[:|:5":[:,.1&+
f ,|:1 2 3 4 5*/10^0 1 2 3
0001 0002 0003 0004 0005 0010 0020 0030 0040 0050 0100 0200 0300 0400 0500
1000 2000 3000 4000 5000
Thank you.
Bo.
Den søndag den 3. februar 2019 12.27.59 CET skrev R.E. Boss
:
,' '([,.~ -.~"1) ":10#.^:_1 a
0001 0002 0003 0004 0005 0010 0020 0030 0040 0050 0100 0200 0300 0400 0500 1000
2000 3000 4000 5000
R.E. Boss
> -Oorspronkelijk bericht-
> Van: Programming
> Namens 'Mike Day' via Programming
> Verzonden: zondag 3 februari 2019 10:55
> Aan: programm...
Paolo has just beaten me to it, but I'll post this anyway.
b NB. shorter than a, just to avoid line-wrapping
1 10 100 1000 2 20 200 2000 3 30 300 3000
Monadic, with 4 and '000' embedded:
(,@:((' ',~_4{.'000',":)"0)) b
0001 0010 0100 1000 0002 0020 0200 2000 0003 0030 0300 3000
Dyad
Fill =: verb define
:
|. x $ |. (x$'0'), ": y
)
5 Fill "0 a
Transform item of a to string
Add max number of patter in this case '0', x function parameter holds the
max length
Revert the string ex
take the max length (x)
Revert again the string
Example
Call Fill with 5 max length
And "0 needed
What's the best way to add leading zeros to a set of integers. How to
design a verb f, that does the following:
a =. 1 2 3 4 5 10 20 30 40 50 100 200 300 400 500 1000 2000 3000 4000
5000
4 f a NB. make each integer a total of 4 digits using leading zeros.
0001 0002 0003 0004 0005 0010 0020 003
22 matches
Mail list logo