The first train I used has been given by Chris: getting the shape and
the value (in a console, when you don't have a fancy GUI à la Dyalog).
($;]) a
┌─┬─┐
│1│0│
└─┴─┘
But, Daniel, have you looked at the Phrases? You'll find hundreds of
them classified by application type in about fift
You may use 5!:6 to guess an explanation.
5!:6<'f'
and also for g h.
On Jul 19, 2014 6:01 AM, "Linda Alvord" wrote:
> Can you use a single phrase that explains this behavior?
>
>f=:(***)(***)(***)
>g=:***(***)(***)
>h=:(***)(***)***
>
>3 (f-:g) 4
> 0
>
>3 (f-:h) 4
> 1
>
>
There is another j ide written in javascript and python. search
for qjide in jwiki and you may find something useful.
Сб, 19 июл 2014, Jon Hough написал(а):
> Well, my plam, which may be stupid, is to create a pythin, tkinter UI and
> call j from this.
>
> --- Original Message ---
>
> From: "De
putting spacing for fork groups
g is equivalent to
(* * (* (* * *) (* * *)))
From: Don Guinn
To: Programming forum
Sent: Friday, July 18, 2014 10:15:02 PM
Subject: Re: [Jprogramming] trains
In the case of f you have three forks - each (***) which combine
There is a characteristic of J to explain why they differ.
Linda
-Original Message-
From: programming-boun...@forums.jsoftware.com
[mailto:programming-boun...@forums.jsoftware.com] On Behalf Of Don Guinn
Sent: Friday, July 18, 2014 10:15 PM
To: Programming forum
Subject: Re: [Jprogrammin
Well, my plam, which may be stupid, is to create a pythin, tkinter UI and call
j from this.
--- Original Message ---
From: "Devon McCormick"
Sent: July 19, 2014 1:01 PM
To: "J-programming forum"
Subject: Re: [Jprogramming] Calling j.dll from python
For what you want to do, could you do it the
For what you want to do, could you do it the other way around: call Python
from J? Or, alternatively, invoke J on a command-line from Python?
On Fri, Jul 18, 2014 at 10:31 PM, Jon Hough wrote:
> I slightly modified the python script in the link (I removed references to
> odedell, whatever that
I slightly modified the python script in the link (I removed references to
odedell, whatever that is, and I called thecdll.LoadLibrary(...)
Here are my very minor edits:
import operatorfrom ctypes import *
IDEN="jcmd_python"
def mulall(arr):return reduce(operator.mul,arr,1)def run_jcmd( js):
Jon - it's trickier than I thought.
I have a partial implementation working that I can tinker with tomorrow
You need to use WinDLL on windows to get the calling convention right
J = WinDLL("c:/users/jbogner/downloads/j801_win32/bin/j.dll")
jt = J.JInit()
J.JDo(jt, "A=:i.5")
Out[34]: 0
see http
In the case of f you have three forks - each (***) which combine to make a
fork. In the case of g you have the two (***) combined with the last * not
in parens making a fork which then combines with the other two * making a
fork. The outer parens show that middle fork.
On Fri, Jul 18, 2014 at 7:
I'm really looking for an explation for why they are different. A concept
that will explain the difference.
Linda
-Original Message-
From: programming-boun...@forums.jsoftware.com
[mailto:programming-boun...@forums.jsoftware.com] On Behalf Of Don Guinn
Sent: Friday, July 18, 2014 6:08 PM
I am interested in calling J specifically from Python, preferably on Linux and
Windows (and Mac).
As Joe suggested, I've tried playing with jdll.ijs.
I still can't get JGetM to work, but I'll have another bash at it later today.
Thanks!
> From: bbill@gmail.com
> Date: Sat, 19 Jul 2014 07:27:0
Set and get data using j.dll can be quite involving. If you use windows, it is
much easier you to use to ole/com interface, search jwiki for more info. Note
that j8 only support the jdllserver interface.
On 18.07.2014, at 23:05, Jon Hough wrote:
> Thanks,
> My test script, so far, is
>
> fr
g is equivalent to
**(*(***)(***))
On Fri, Jul 18, 2014 at 4:00 PM, Linda Alvord
wrote:
> Can you use a single phrase that explains this behavior?
>
>f=:(***)(***)(***)
>g=:***(***)(***)
>h=:(***)(***)***
>
>3 (f-:g) 4
> 0
>
>3 (f-:h) 4
> 1
>
>3 (g-:h) 4
> 0
>
> Linda
Can you use a single phrase that explains this behavior?
f=:(***)(***)(***)
g=:***(***)(***)
h=:(***)(***)***
3 (f-:g) 4
0
3 (f-:h) 4
1
3 (g-:h) 4
0
Linda
-Original Message-
From: programming-boun...@forums.jsoftware.com
[mailto:programming-boun...@for
Some trains for sets:
NB. Set is a sorted numeric list with no duplicates.
NB. Match -: tests set equality.
set =: [: /:~ ~. NB. Create set
un =: [: set ,NB. Union
sd =: -. un -.~ NB. Symmetric Difference
nt =: un -. sdNB. Intersection
so =: ] -: un NB. Te
What is 10 people are playing bingo. After 15 numbers are drawn and "I win"
is called, can't more than 1 person win?
Linda
-Original Message-
From: programming-boun...@forums.jsoftware.com
[mailto:programming-boun...@forums.jsoftware.com] On Behalf Of Raul Miller
Sent: Friday, July 18
> I am wondering what is the edit-run paradigm in JQt 8.02. In J 602, I select
and run. However, in JQt 802, it seems I have to create a script file and
then run it from the ijs as part of the project.
Thanks for pointing it out. Run selection is now only in Edit, and I'll add
it to Term.
On Fr
Maybe.
Note that http://rosettacode.org/wiki/Universal_Turing_machine#J
assigns 'noun' using =. and if that is using an explicit J verb (such
as 'load' or 'require') that means that that definition is temporary.
In other words it's quite possible that the definition reverts to the
standard defini
I am wondering what is the edit-run paradigm in JQt 8.02. In J 602, I
select and run. However, in JQt 802, it seems I have to create a script
file and then run it from the ijs as part of the project.
Also, when I tried to copy paste the above code and run it in J802, it
hangs as it gets into the e
Here's an example that works with J802/JQt
(mind line wrapping)
".@(('utm=. '),,)@(];._2)@(noun=. ".@('(0 : 0)'"_))_ NB. Fixed tacit
universal Turing machine code...
(((":@:(]&:>)@:(6&({::)) ,: (":@] 9&({::))) ,. ':'"_) ,. 2&({::)
>@:(((48 + ]) { a."_)@[ ; (] $ ' '"_) , '^'"_) 3&({::))@:
Yuvaraj, make sure the definition of noun is being overwritten with the one
given in the Turing machine definition. Type noun in your session, you
should get this:
noun
".@('(0 : 0)'"_)
On Fri, Jul 18, 2014 at 1:26 PM, Thomas Costigliola
wrote:
> 'noun' and 'utm' are defined in the scrip
'noun' and 'utm' are defined in the script given.
On Fri, Jul 18, 2014 at 12:34 PM, Raul Miller wrote:
> What is your definition of "noun"?
>
> Here's what I get in a fresh j802 session:
>
>noun _
> |syntax error
>
> Thanks,
>
> --
> Raul
>
>
> On Fri, Jul 18, 2014 at 1:19 AM, Yuvaraj Athu
Often useful with link:
(#;$;]) i.3 4
+-+---+-+
|3|3 4|0 1 2 3|
| | |4 5 6 7|
| | |8 9 10 11|
+-+---+-+
On Wed, Jul 16, 2014 at 1:26 PM, 'Dan Baronet' via Programming <
programm...@jsoftware.com> wrote:
> I am looking for good examples of use of trains.
> Apart
'Keep' (or 'keep') is nice and short.
I like when the name is shorter than the code.
Thanks,
--
Raul
On Jul 18, 2014 1:15 PM, "Alex Giannakopoulos"
wrote:
> Yes, Linda, sorry for the typo. Should be
> keep =: [-.-.
>
> No, Raul, I expressed myself badly. I was not implying that commutati
Yes, Linda, sorry for the typo. Should be
keep =: [-.-.
No, Raul, I expressed myself badly. I was not implying that commutative
intersection on bags makes sense (or otherwise). What I was _trying_ to
say, is that if the arguments are not sets, then the fork makes more sense
to be called 'keep
I am trying to think of a case where commutative intersect on bags makes sense.
It seems to me that in any case where I want commutativity for that
kind of operation I'd want to be working with either a unique list of
elements.
Do you have any counter-examples?
(Another approach might be somethi
What is your definition of "noun"?
Here's what I get in a fresh j802 session:
noun _
|syntax error
Thanks,
--
Raul
On Fri, Jul 18, 2014 at 1:19 AM, Yuvaraj Athur Raghuvir
wrote:
> Hello,
>
> I was checking the tacit Turing Machine written by Jose Mario Quintana at
> http://rosettacode.or
The clue is here:
JGetM i x *c *x *x *x *x''e p n t r s d'=. cmd cd pJ,(,y);4#<,0
Read up on this: http://www.jsoftware.com/help/user/call_procedure.htm
Try running the jdll.ijs and playing with it (adding smoutput in various
places) to understand what it's doing
The string i x *c *x *x *x *x
Thanks,
My test script, so far, is
from ctypes import *
cdll.LoadLibrary("j801/bin/libj.so")
j = CDLL("j801/bin/libj.so")
jt = j.JInit()
j.JDo(jt, "a =: 1")
a =j.JGetM( "a")
print a
This returns 4, even though I set a to be 1. I'm assuming 4 is the number of
bytes returned (i.e. an int)??(
On Jul 16, 2014 10:49 PM, "Marshall Lochbaum" wrote:
>
> It's weird to ask for an example of a train since forks are such a
> common part of J. If you look at almost any substantial piece of code
> you'll be swimming in them in short order.
>
> Marshall
I had the same reaction. Trains are the def
Joe, thanks. Your suggestion seems to work.
However JGets seems to not exist.How do I then get the variable, once assigned?
I tried to search through the .so/.dll for "get" functions:
nm -g libj.so | grep Get
Although jdll.ijs seems to contain jget, when I tried to call this (in Python)
I get "
Remember, JoJ (Journal Of J) will publish Conference proceedings
in a special August issue !!
In this occasion, we would like to prepare a very special editionin "book"
format.
For this reason send your contributions as soon is possible,after or before
Conference.
The deadline is August-15 and
JGetM is what you need, but I strongly suggest reviewing
http://jsoftware.com/wsvn/addons/trunk/general/misc/jdll.ijs (or your local
version) to get a better understanding of how things work
This part addresses your question:
jget=: 3 : 0
cmd=. libj,' JGetM i x *c *x *x *x *x'
'e p n t r s d'=. c
Please ignore the last sentence from my previous email. Copied and pasted by
accident.
> From: jgho...@outlook.com
> To: programm...@jsoftware.com
> Date: Fri, 18 Jul 2014 15:50:41 +0100
> Subject: Re: [Jprogramming] Calling j.dll from python
>
> Joe, thanks. Your suggestion seems to work.
> How
JInit() returns the instance that you need to invoke against
see addons/general/misc/jdll.ijs
jdo is defined as:
jdo=: 3 : 0
(libj,' JDo i x *c') cd pJ, boxopen y
)
so I suspect you need to be passing that pointer address with python too...
jt = j.JInit()
j.JDo(jt, "x =: 3")
[untested]
Bill, Jon, sorry if that suggestion did not apply. I remembered it was a
common pitfall when calling from C. Maybe that is not the case now.
On Fri, Jul 18, 2014 at 10:29 AM, Jon Hough wrote:
> My previous email was regarding Windows (7 with J801)
> I just tried to do the same in Ubuntu (J801)
Hand typed rather than cut&paste, because reasons. Excuse any typos.
i.16
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
*:i.16
0 1 4 9 16 25 36 49 64 81 100 121 144 169 196 225
7http://www.jsoftware.com/forums.htm
My previous email was regarding Windows (7 with J801)
I just tried to do the same in Ubuntu (J801)
cdll.LoadLibrary("j801/bin/libj.so")
j = CDLL("j801/bin/libj.so")>>> j.JInit()158010848
No idea what the above output means. Is that the pointer address of something?
And then:
>>> j.JDo("x =: 3")Seg
Since [. Is not in the vocabulary list your verb, keep, must be a typo.
Here's my idea:
ht=:'Hello there!'
vowels=:'aeiouAEIOU'
keept2=: 13 :'(x e. y)#x'
ht keep2 vowels
eoee
keep2
e. # [
Linda
-Original Message-
From: programming-boun...@forums.jsoftware.com
>From which resource did you learn that(not python)? It should be very out
dated.
On Jul 18, 2014 6:00 PM, "Jon Hough" wrote:
> I am trying to call jdll.JDo from python but I get the error message,
> access violation.
>
> Here is my python.
>
> Cdll.LoadLibrary(path to j.dll)
> J =CDLL(path to j.
Hi, Jon, are you calling JInit first? You have to make sure you call that
before JDo.
On Fri, Jul 18, 2014 at 6:00 AM, Jon Hough wrote:
> I am trying to call jdll.JDo from python but I get the error message,
> access violation.
>
> Here is my python.
>
> Cdll.LoadLibrary(path to j.dll)
> J =CDL
Works fine for me. J802 /JQt
On 18-07-14 07:19, Yuvaraj Athur Raghuvir wrote:
Hello,
I was checking the tacit Turing Machine written by Jose Mario Quintana at
http://rosettacode.org/wiki/Universal_Turing_machine#J
(also referred in Oct 2013 edition of Journal of J)
When I use J 802 with JQt, t
Just a teeny comment if I may:
The "set intersection" fork posted above ([-.-.) whilst quite valid for
sets is not commutative on 'bags', i.e. collections which may have
repeats. There, it acts more as a "retain" or "keep" verb, the opposite -
so to speak - of "less" (-.)
ht =. 'Hello there!'
First you use a colon, not a semicolon to make an explicit definition.
Second (noun _) is an invalid combination. I tried it in J6 and it failed.
On Thu, Jul 17, 2014 at 11:19 PM, Yuvaraj Athur Raghuvir <
yuvaraj@gmail.com> wrote:
> Hello,
>
> I was checking the tacit Turing Machine written
%:2
1.41421
A=:i.1 4 1 4 2 1
f=: 13 :'i.(1~:$y)#$y'
]B=:f A
0 1
2 3
4 5
6 7
8 9
10 11
12 13
14 15
16 17
18 19
20 21
22 23
24 25
26 27
28 29
30 31
f
[: i. $ #~ 1 ~: $
Linda
-Original Message-
From: programming-boun...@forums.jsoftware.com
[mailto:progr
I am trying to call jdll.JDo from python but I get the error message, access
violation.
Here is my python.
Cdll.LoadLibrary(path to j.dll)
J =CDLL(path to j.dll)
J.JDo("x =: i. 3")
This gives am error. In fact any string gives the error.
J.JGet doesnt seem to give errors, but since I cannot s
Sorry about the +, it slipped away too fast.
no=: 13 :'(0{y)#"1(1{$y)#y'
no i.2 3
1 2 2
1 2 2
1 2 2
4 5 5
4 5 5
4 5 5
z=: 13 :'(1{y)#"1(0{$y)#y'
z i.2 3
0 0 0 1 1 1 1 2 2 2 2 2
0 0 0 1 1 1 1 2 2 2 2 2
3 3 3 4 4 4 4 5 5 5 5 5
3 3 3 4 4 4 4 5 5 5 5 5
z
(1 { ]) #"1 ]
no=: 13 :'(0{y)#"1(1{$y)#y'
+no i.2 3
1 2 2
1 2 2
1 2 2
4 5 5
4 5 5
4 5 5
z=: 13 :'(1{y)#"1(0{$y)#y'
z i.2 3
0 0 0 1 1 1 1 2 2 2 2 2
0 0 0 1 1 1 1 2 2 2 2 2
3 3 3 4 4 4 4 5 5 5 5 5
3 3 3 4 4 4 4 5 5 5 5 5
-Original Message-
From: programming-boun...@forums.
49 matches
Mail list logo