I am using J 8.02 under 64-bit Linux (Mint)
Whenever I try to write a file, even just a simple line or two of text,
I get a file full of illegible binary.
This happens regardless of whether I use the 'jfile' system, or the
foreigns 1 !: 21 etc
Are there any known problems in this area, or am
Ah, OK, Joe, I think I see what the problem is.
If I simply write a quoted string to the file it works fine. E.g.
1!:21 <'testfile'
30029424
'hello' 1!:2 (30029424)
However I was trying to dump non-string variables, viz. tables, which is
what it didn't like. E.g.
f1 =.1!:21
Thanks, that's brilliant.
Funnily enough, I'd read the relevant page on /: and had tried
something very similar, but for some reason, it didn't work.
Can't remember exactly what.
Anyway it's good to see that I wasn't too many miles off the track,
appreciated!
(Works identically with boxed
Just a teeny thing, but if you are going to have both the monadic and the
dyadic definitions for ^. then shouldn't you have the same for ^ ?
Less confusion that way, plus a better insight into the way J uses dyads.
On 2 September 2014 22:14, Henry Rich henryhr...@nc.rr.com wrote:
What I
Does anyone know what the current state of play is with regard to SQLite
support?
The documentation under jwiki/Addons/data/sqlite is not valid anymore, and
PacMan only offers a data/ddsqlite, which however does not seed to be
documented anywhere.
rant_mode
I have to say that one of my greatest
rauldmil...@gmail.com wrote:
On Thu, Aug 28, 2014 at 7:23 AM, Alex Giannakopoulos
aeg...@blueyonder.co.uk wrote:
I have to say that one of my greatest frustrations with J is that a lot
of
good work of the past seems to get lost in the process of updates.
E.g. I was really looking forward
On 28 August 2014 13:26, Raul Miller rauldmil...@gmail.com wrote:
Something that works out of the box and linux is unlikely given
the current state of things.
Too true, too often...
Hope everything turns out OK.
--
For
Many thanks for that Bill!
On 28 August 2014 14:09, bill lam bbill@gmail.com wrote:
Please elaborate how the shader demo in qt demo of j802 failed.
It didn't! I have just seen it and it seems to work fine, Pleased about
that - at least I've got something to go on now.
opengl 1.x had
My apologies if I've missed it, but has anyone posted how long the vector
approach takes to find the longest chain under 100 and the highest
number in that chain?
The answers are - longest chain: 837799 ; steps: 524 ; biggest number in
chain: 2974984576
I am also not completely clear on the
In other words, it (M.) does seem to be working. But it can only do so
much.
Thanks for that Raul. Obliged, as ever.
I suppose if one wanted total reliability in this respect, it would be best
to write one's own memoization routine (probably still an adverb, though).
OK, back to re-installing
I used the following memoized code,
nextcol =: 3 : 0
if. 0=2|y do. -: y
else. : 3*y
end.
)
colchain =: 3 : 0 M.
if. y=2 do. 1,2
else. chain=. colchain nextcol y
(:0{chain),x:y.1{chain
end.
)
but it took forever to generate the following I aborted it.
colchain0 (2}.i.101)
I
Hm, interesting approach, that of Roger's, I still haven't digested it all,
but sometimes it would be nice to be able to tackle these problems the same
as everybody else in the world...
On 4 August 2014 20:12, Alex Giannakopoulos aeg...@blueyonder.co.uk wrote:
I used the following memoized
On the subject of memoizing, I'd be curious to know why the colchain verb I
tried above (post 20h12) does not seem to work with M. whereas, say, the
fib example given in the Voc does. I have copied the syntax almost
identically.
Raul said:
It probably would be nice to have something like an ML-flavored compiler
for some subset of J.
Getting a bit off-topic now and into the realms of Chat, but I totally
agree that we (well, I certainly do) need some fusion of the twain.
Something ML-stylee to do the recursive stuff
On 4 August 2014 23:52, Raul Miller rauldmil...@gmail.com wrote:
Do you mean
Yes, I do :)
colchain =: 3 : 0 M.
if. y=2 do. 1,2
else. chain=. colchain nextcol y
(:0{chain),x:y.1{chain
end.
)
If so, that is an incomplete definition - x is a global variable in
colchain.
Is it?
Basically, in case it's not obvious, colchain is returning a vector of two
values, 1) the number of steps that particular sequence takes and 2) the
largest nuber present in that sequence (hence the x:).
On 5 August 2014 00:11, Alex Giannakopoulos aeg...@blueyonder.co.uk wrote:
On 4 August 2014
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!'
that kind of thing commutative.)
Anyways, for commutativity with bags, I think I'd add ~. to the expression.
Thanks,
--
Raul
On Fri, Jul 18, 2014 at 8:38 AM, Alex Giannakopoulos
aeg...@blueyonder.co.uk wrote:
Just a teeny comment if I may:
The set intersection fork posted above
I suppose the most useful, from a beginner's point of view, is the cap
fork, e.g.
[: *: sin
which allows composition, and is equivalent to
*: @ sin
Some people prefer this former notation as clearer than the latter.
So,
sin =: 1o.
cos =: 2o.
(([: *: sin) + [: *: cos) 9876543210
1
way. IOW one dyadic and one monadic verb.
(+!) 4NB. i.e. 4 + !4
28
If the hook is dyadic then we combine the result of the right verb on the
right argument with the left argument, rather than with itself:
3 (+!) 4NB. i.e. 3 + !4
27
On 16 July 2014 22:12, Alex Giannakopoulos aeg
Skip, I am glad you mentioned this. I've been suffering too. (It's not
just Samsung, BTW, all Android devices have some sort of smart keyboard
that interferes, even if they (the keyboards) are not always the same. My
pet bugbear is reversion from the numerical to the non-numerical keyboard
if
Which of these two is the more efficient (if there's any difference) and is
there any way way mere mortals can tell?
log10 =: 10 %^.~ ]
logb10 =: 10^inv
Further, if I only wanted to find the order of a given +ve integer
would it be better to do . @ log10 (or . @ logb10)
or something like:
Thanks Kip, as usual trying everything but the most obvious...
On 10 June 2014 13:48, Kip Murray thekipmur...@gmail.com wrote:
Have you tried 10^. ? See
http://www.jsoftware.com/docs/help801/dictionary/d201.htm
On Tuesday, June 10, 2014, Alex Giannakopoulos aeg...@blueyonder.co.uk
wrote
timespacex '(10^inv) ? 1000 $ 900'
0.000245056 26304
timespacex
6!:2 , 7!:2@]
time foreign conjunctions -
http://www.jsoftware.com/help/dictionary/dx006.htm
space foreign conjunctions -
http://www.jsoftware.com/help/dictionary/dx007.htm
Cheers, bob
On Jun 10, 2014, at 3:42 AM, Alex
Hm, nice that, especially the intersection feature
(2 1;1 3) { i. 4 4 NB. Select rows 21, columns 13
9 11
5 7
Maybe it's time that NewVoc was linked to the Help page in place of Voc.
Certainly would have saved me a lot of time on more than one occasion.
Will certainly be checking that
{:: i. 4 4
7 9
On May 29, 2014 8:18 AM, Alex Giannakopoulos aeg...@blueyonder.co.uk
wrote:
Hm, nice that, especially the intersection feature
(2 1;1 3) { i. 4 4 NB. Select rows 21, columns 13
9 11
5 7
Maybe it's time that NewVoc was linked to the Help page in place of Voc
:13, Alex Giannakopoulos aeg...@blueyonder.co.uk wrote:
Ah, that's cool Michael, so that
{::
is a shorthand or special code or something for
] {~ [: [
is it?
Handy... should be added to Voc/NewVoc
On 29 May 2014 13:38, Michael Dykman mdyk...@gmail.com wrote:
For the sake
easily throw a newcomer. I.e. if the newcomer is still with us...
On 3 May 2014 14:22, Alex Giannakopoulos aeg...@blueyonder.co.uk wrote:
Hi R.E. - I don't know if that was meant to be an answer to me, but if it
was, I don't see how it covers it... sorry, maybe I'm being obtuse.
The form of what
2014 18:13, Alex Giannakopoulos aeg...@blueyonder.co.uk wrote:
@Joe: Thanks, I use the same notation for m,n,u,v,x and y (I'd have
thought it was obvious. So many other things seem to be around here...)
BTW, you are right it is confusing.
@R.E.Boss: thanks for the link, and even repeating
.
(x was now the initial y, and y was gx) then all was clear.
Just FYI.
I thought you might like the insight into the workings of the mind of a
noob, since you went to all that trouble to help...
On 3 May 2014 18:27, Alex Giannakopoulos aeg...@blueyonder.co.uk wrote:
Yup, got it now.
((mv)(nu))y
Simple when you know how...
On 3 May 2014 18:32, Alex Giannakopoulos aeg...@blueyonder.co.uk wrote:
Thanks again, Joe. No I wasn't missing the picture in the box. Have
pored over it many times.
I just hadn't seen how the OP's initial formulation of a MONADIC verb as a
hook was being
Here's a crude stab that I think does what you want.
Thanks for the opportunity to dig into the plotting a bit!
load 'plot'
A=:steps _2 2 8
V=:j./~ A
H=:|:|. V
P=: 2 . *:
'pensize 0; color 50 255 255' plot V,H
pd 'pensize 2;color BLUE'
pd (]+0j1*P) steps _2 2 32
On 25 April 2014
used instead of i:2j32.
(I am avoiding the use of the definition of 'do' for generating the X
values, because J already supplies a definition for 'do' which does
something different.)
Thanks,
--
Raul
On Fri, Apr 25, 2014 at 1:43 AM, Alex Giannakopoulos
aeg...@blueyonder.co.uk wrote
Clarification:
Hm, actually it showed automatically the first time, but then needed a pd
'show' for subsequent reruns, unless the plot window was closed.
On 25 April 2014 07:20, Alex Giannakopoulos aeg...@blueyonder.co.uk wrote:
Yup, interesting.
I would add, though, that in the simple
And yes, a way to set the vertical limits, without resorting to background
grids would be good.
Surely it must be hidden there somewhere?
On 25 April 2014 07:34, Alex Giannakopoulos aeg...@blueyonder.co.uk wrote:
Clarification:
Hm, actually it showed automatically the first time
... contd
Using (]+0j1*P) or similar
Also I think the intervals must be the same on one plot. If you try to mix
an 8-interval with a 32-interval matrix, the 8-matrix will get padded with
0s or 0j0s, rendering a nice spider's web in the latter case. You will
need to pad the 8-matrix with the
Otherwise (having just looked in the Labs) I think the pd verb may allow
you to plot different size data on the same plot. I haven't used it yet,
I'll check it out now, but it may be what you need.
On 25 April 2014 06:36, Alex Giannakopoulos aeg...@blueyonder.co.uk wrote:
... contd
Using
Hit the nail on the head.
Pattern matching is more useful in languages with logic variables, or at
least lisp-style lists with heads and tails. I assume (hope anyway) that
WL has such, else why even bother.
Although I like the style of programming which supports such pattern
matching, I have
On 20 September 2013 13:02, Henry Rich henryhr...@nc.rr.com wrote:
g@[0
It looks brilliant!
But how on earth do you parse that?? Sure beats me.
I'm happy with Ric's g@]^:[
--
For information about J forums see
-. (twice!)) expression that I use a
lot for getting just the digits from a string -
digits=: -.(a.-.'0123456789')
digits : 23 45 6
23456
On 2013/09/08 19:54 , Alex Giannakopoulos wrote:
That 'less' verb is very useful, I'd never had occasion to use it until
now!
It could
Thanks for pointing that out, Dan!
On 15 September 2013 15:42, Dan Bron j...@bron.us wrote:
Now, while these two sentences are theoretically fungible, and .: is cute,
in reality :^:_1 is monad . , which is dangerous (:^:_1 '1!:55 ...'
for
example).
So, if I were going to apply this code
Hi - I need to join up a list of integers (presented as a rank-1 array)
into a single number.
At the moment I am using the following,
;@ cut . :
which works, but I wonder if there is something better, not using the
supplied 'cut' verb, which seems like overkill.
Any suggestions hints pointers
.
On Sep 8, 2013, at 10:07 PM, Alex Giannakopoulos aeg...@blueyonder.co.uk
wrote:
Hi - I need to join up a list of integers (presented as a rank-1 array)
into a single number.
At the moment I am using the following,
;@ cut . :
which works, but I wonder if there is something better
happening is that is forcing the ' ' as the right argument. When you
supply your right argument it moves to the left side of -. and then the ' '
(empty spaces) are removed.
Hope this helps, bob
On 2013-09-08, at 7:27 PM, Alex Giannakopoulos wrote:
Great, thanks very much!
How does
Thanks Henry!
17 24 35 +0 1 i. 5
I can see that from the second example you provide that it was daft trying
to change the rank of i, since it is actually + that needs this
treatment.
I.e. I could have made a verb r0addr1 =: +0 1 and done (17 24 35
r0addr1 i.5). Cool.
17 24
Ric wrote:
Table (Dyadic insert) can also be useful here:
17 24 35 +/ i. 5
Crazy stuff, I like it! Ther'e always another way in J, isn't there?
@ *Björn : That looks interesting, but I'm going to need /several/
whiskeys, before I even attempt to see what's happening there!*
Thanks Henry, I was hobbling in that general direction...
Amazing how simple it is when one gets it, but I'd never had occasion to
change rank of left argument before.
--
For information about J forums see
I saw these operators, 0: and 2: in some code, and I can't quite make
out what they do, nor can I find any documentation.
Any suggestions?
--
For information about J forums see http://www.jsoftware.com/forums.htm
://www.jsoftware.com/help/**dictionary/dconsf.htmhttp://www.jsoftware.com/help/dictionary/dconsf.htm
... peter
On 03/14/13 18:40, Alex Giannakopoulos wrote:
I saw these operators, 0: and 2: in some code, and I can't quite make
out what they do, nor can I find any documentation
Checked the ellipses, turns out the maximum area is a circle after all,
provided the wall is at least 200/π m.
The area would be ±= 1591.549 m², unless anyone else knows better.
--
For information about J forums see
Marshall Lochbaum wrote:
[this version of]
af uses a bit refactoring to avoid having to write the case where y is
empty...
Marshall I almost missed your post, just read it...
I really like the way you use ^: as a replacement for recursion, but I had
NO IDEA that the syntax you have used was
Don Guinn wrote:
Also, the x and y in explicit definitions are local names so are unique
from x and y of a calling explicit definition. That includes recursion.
Yes, I am aware of that, but what if I have a nested function, that is
local to another, enclosing function?
Is that even possible in
Big thanks to everybody that answered!
I seem to have interleaved two quite different questions into one.
1) For those that answered how to find number of divisors without using
recursion (esp. Aarie), much obliged.
I was looking for that formula all over the place!
2) For those that answered
Raul:
After reading this, and finally noticing the comment about remel in
the original post, I am uncomfortable with this treatment of remel.
[...]
But the original code is not using an alist, as near as I can tell --
No, just a regular list as you correctly observed
or if
that's because
Lambda considered harmful? LOL
No, sigma considered harmful.
and
Infinite series (products, etc.) best done by having infinite vectors.
See [...]
Thanks Roger,
Always a pleasure to read your take on things!
--
For
Contemplating the use of J at elementary mathematical level, I was curious
as to what the accepted approach for the sigma notation might be...
After all, this is even present on calculators these days, and students
expect something like it to be available.
A site search - surprisingly - does not
Very nice, Linda, thanks.
That's just the example I needed.
I think I'm beginning to get the 'geist' of it now!
(Lambda considered harmful? LOL)
--
For information about J forums see http://www.jsoftware.com/forums.htm
Is there a better way (rhetorical question) to promote an n-element vector,
i.e. of of shape N to a single row matrix of shape (1 N) ?
The best I have come up with so far is:
v2m =. ] $~ 1,$
I have read up on mn in the Dictionary, but can't make much sense of it.
On 3 December 2012 15:59, Raul Miller rauldmil...@gmail.com wrote:
That said, when I want to translate J into a language other people
understand, Javascript is usually my first choice.
Why does that not surprise me? :-)
Incidentally, and if you have nothing better to do, how would you code
Thanks Stefano, that's what I meant, viz. how can you access a structure
within a variable, whether its a box or whatever, by a variable that is
only defined within the context of the main variable, i.e. not an index,
but a structure name. Same as you'd do with a struct in C. A property,
or
Would be amazing, and really useful for educational purposes too, if we
could change between modes on the fly.
On 2 December 2012 06:00, Alex Giannakopoulos aeg...@blueyonder.co.ukwrote:
Thanks Ric,
I'd been looking all over the config files, but somehow I missed it.
The Tree view is great
On 30 November 2012 16:17, Bo Jacoby bojac...@yahoo.dk wrote:
J is a rich language, and it might be a good idea to define an elementary
subset for beginners.
Couldn't agree more.
A simple startup configuration file. Define verbs for trig functions so
they don't look stupidly arbitrary.
Some
Incidentally, does Jsoftware have an individual responsible for
presentation, marketing, outreach, holy-rolling etc?
If, say, I wanted to contribute something, who would coordinate? Or does
it all just get (somehow) vetted through the community here?
[: as the dyadic case, and [; rejects
every argument with a domain error.
Kip Murray
Sent from my iPad
On Nov 30, 2012, at 10:14 PM, Alex Giannakopoulos aeg...@blueyonder.co.uk
wrote:
On 30 November 2012 16:17, Bo Jacoby bojac...@yahoo.dk wrote:
J is a rich language, and it might be a good idea
Ctrl-Alt-T will open the regular terminal on most Ubuntu desktop distros.
As for =12.04, the less said the better. Everyone wants to morph their
desktop into a mobile nowadays...
Sheesh.
With Ubuntus = 12.04 you can specify a normal, traditional startup -
instead of the hideous Unity - at the
Sorry, I meant Ctrl-Alt-t in the above, won't work if you hold the Shift
as well.
I have never found a graphical Ubntu where Ctrl-Alt-t won't give a terminal.
--
For information about J forums see
Don't see why not, though you can already install Linux on Netbooks, so I'm
not sure what you'd be gaining.
However, since Chromebook in its original form, is meant to be some kind of
Web-based, always-connected thingy (don't you love this ever-progressive
dumbing down of consumer computing?) you
Yeah, that's a brilliant idea. Looking at doing the same.
I know Oracle's VM runs well, I've tried Solaris on it.
I've got *OLD* windows software that I need to use on occasion, which won't
run on modern systems.
On 21 November 2012 18:32, Don Guinn dongu...@gmail.com wrote:
Thanks for all the
|: _2 ]\ ]) i. 6 3
Note that this is almost identical to Roger Hui's suggestion.
--
Raul
On Wed, Nov 21, 2012 at 1:12 PM, Alex Giannakopoulos
aeg...@blueyonder.co.uk wrote:
Well, I'm having a bit of trouble getting my head around key, I'll keep
at it though...
However I was inspired
OK, here is a simplified example of what I'm trying to do:
I want to split a matrix into two, so that the result is composed of the
odd rows and even rows of the matrix respectively
e.g.
oddevenrows i. 6
0 1 2
6 7 8
12 13 14
3 4 5
9 10 11
15 16 17
I'm thinking, should I use
Both solutions most appreciated!
Rest at last!:)
--
For information about J forums see http://www.jsoftware.com/forums.htm
On 20 November 2012 19:42, Raul Miller rauldmil...@gmail.com wrote:
I do not see what i.6 has to do with this.
Absolutely nothing.
It's just a matrix to test against.
--
For information about J forums see
To add a bit of information:
I tried a Radeon HD2400 card in place of the GeForce 8600 in my 64-bit
Linux system. This time the system did not even get a chance to announce
that it could not obtain a context, it crashed J(gtk) and closed all its
windows as soon as the demo OpenGL program was
I venture to say that q2 would concern the difference between @: and @
On 16 November 2012 10:22, Alex Giannakopoulos aeg...@blueyonder.co.ukwrote:
If we made a FAQ, this would probably be q1
--
For information about J
Wow, you mean there *is* actually a FAQ?
Why does the link not appear on the Jsoftware home page?
Hold on, maybe it's under Help Ooops, not here either.
Maybe under Getting Started?... No, not, here.
Perhaps the Getting started Wiki? Nope.
Ah, here it is, top page of Guides. Well, maybe I
November 2012 15:49, Raul Miller rauldmil...@gmail.com wrote:
On Thu, Nov 15, 2012 at 7:06 PM, Alex Giannakopoulos
aeg...@blueyonder.co.uk
Nice torus-pad ([:|:{:,]{.)^:2
Or, more generally:
(0 |:{:,],{.)^:(#@$)
Also, here's a general fill pad:
((_1 [0 $) |. ({.~ 2 +$))
That said
Oh, yes!
Typing it into the the main page search box is not much better either.
Is there a thread where this is being discussed, so I don't clutter the
space here?
There is some real irrelevant stuff in the Wiki FAQs too, which could
desperately use a tidying.
I mean, using x. and y. ?
Thanks Bill
That seems to narrow the problem down to Nvidia GeForce cards on 64-bit
hardware.
I'll keep you posted on anything else I notice.
On 15 November 2012 01:29, bill lam bbill@gmail.com wrote:
I use 64-bit debian, on-board ati graphics with radeon driver from
x.org
Linux debian
Sorry, don't think I can help at the moment, I link against freeglut when I
write in C, however I'll keep an eye out for code that accesses the
x.orgNVidia driver directly (when I figure out how it's all plumbed).
On 15 November 2012 14:30, bill lam bbill@gmail.com wrote:
The hardest part
it successfully on a 64-bit Linux system
(of any description) please do let me know your specs!
Regards
On 15 October 2012 07:26, Alex Giannakopoulos aeg...@blueyonder.co.ukwrote:
Well, I edited all the options you suggested, Bill, and also the
occurrence in the file glx.ijs, with every possible
OK, I'm trying to do some work with matrices that involves transformations
based on local properties of a matrix (neighbouring elements).
This is the sort of thing you may find in image-processing
edge-detection, etc, or in some cellular automata of the type of Conway's
Life.
In other words, I
On 15 October 2012 06:37, Linda Alvord lindaalv...@verizon.net wrote:
Sometimes you get the double of the reciprocal and other times the
reciprocal of the double.
Erm, not quite, Linda.
You will see that the hook (%+:) will always return 0.5, no matter what
the input.
Remember, (fg)y
not installed any proprietary video driver to test, so there
may be some issues there.
Пнд, 15 Окт 2012, Alex Giannakopoulos писал(а):
My system is Ubuntu Lucid 64 (LTS)
I installed all J addons via pacman, right from the start!
When I try to run something like:
load '~addons/demos
Thanks for that Bill
I got the latest (*.64) base library and de-installed the freeglut stuff.
locate libOSMesa is reporting
/usr/lib/libOSMesa.so
/usr/lib/libOSMesa.so.6
/usr/lib/libOSMesa.so.6.5.3
So that seems fine.
It is still not working though.
The opengl simple demos open blank
My system is Ubuntu Lucid 64 (LTS)
I installed all J addons via pacman, right from the start!
When I try to run something like:
load '~addons/demos/opengl/simple/gldemos.ijs' or
load '~addons/demos/opengl/demo/gldemo.ijs'
the GTK windows open properly, but nothing is rendered, the message
Right OK, a bit of an update:
I additionally installed the freeglut dev kit, and the first reported
proplem has gone away.
Now the dialog box with the 'Demos' opens, and what's more, most of the
demos seem to run OK.
However, there is still a problem with the OpenGL ones:
If I click on the
I asked this question almost three years ago, when I was first starting.
Almost the same people answered it, and quite at length, too!
If you want some explanations on the options of composing using the 'cap'
([:) or the compose (@) you can look here:
87 matches
Mail list logo