Re: [Jprogramming] Problem working with data loaded from a file

2012-03-29 Thread Dan Bron
In J, a string is represented as a _box- containing a vector of characters. Because makes an atom of its argument, the = operation works as you'd expect. For example: Please excuse typos; composed on a handheld device. -Original Message- From: PackRat pack...@anet.com Sender:

Re: [Jprogramming] why=: 13 :'y*y*y'

2012-03-19 Thread Dan Bron
Though not my usual position on J development, I'd support decommissioning 13 : . I see its function as more appropriate to a standard library than a primitive. For one thing, libraries are easier to change than primitives, and therefore more amenable to user feedback. For another, I see

Re: [Jprogramming] Sequential Machine

2012-02-25 Thread Dan Bron
Why would matrix inversion be the jewel in the crown of APL? -Dan On Feb 25, 2012, at 5:58 PM, Ian Clark earthspo...@gmail.com wrote: I'd say any publicity for practical uses of (;:) is good. Even if only because it's Alan Turing's 100th anniversary (celebrated this week by Nature

Re: [Jprogramming] Challenge 7 March Bad Mess

2012-02-22 Thread Dan Bron
The Wiki has a long memory: http://www.jsoftware.com/jwiki/Scripts/Fixargs . (Fortunately for we tacit weirdos, this has never been an issue. Now, if we changed the spelling of @ ) -Dan -Original Message- From: programming-boun...@jsoftware.com

Re: [Jprogramming] Challenge 7 March Bad Mess

2012-02-22 Thread Dan Bron
...@jsoftware.com [mailto:programming-boun...@jsoftware.com] On Behalf Of Raul Miller Sent: Wednesday, February 22, 2012 10:08 AM To: Programming forum Subject: Re: [Jprogramming] Challenge 7 March Bad Mess Or [. -- Raul On Wed, Feb 22, 2012 at 9:56 AM, Dan Bron j...@bron.us wrote: The Wiki has a long

Re: [Jprogramming] tacit adverb

2012-02-22 Thread Dan Bron
a proper linear representation.  This might be a really hard challenge because that bug has proven to be very resistant. From: programming-boun...@jsoftware.com [programming-boun...@jsoftware.com] on behalf of Dan Bron [j...@bron.us] Sent

Re: [Jprogramming] tacit adverb

2012-02-22 Thread Dan Bron
excuse typos; composed on a handheld device. -Original Message- From: Dan Bron j...@bron.us Sender: programming-boun...@jsoftware.com Date: Thu, 23 Feb 2012 04:51:03 To: J Programmingprogramming@jsoftware.com Reply-To: Programming forum programming@jsoftware.com Subject: Re: [Jprogramming

Re: [Jprogramming] tacit adverb

2012-02-21 Thread Dan Bron
[mailto:programming-boun...@jsoftware.com] On Behalf Of Dan Bron Sent: Monday, February 20, 2012 8:03 PM To: 'Programming forum' Subject: Re: [Jprogramming] tacit adverb Oh, and would it be valuable if the domain were extended to nouns, in particular literal vectors or boxed strings which represent J names

Re: [Jprogramming] tacit adverb

2012-02-20 Thread Dan Bron
A=: 1 : '0(;@:u) :: empty' Can be expressed tacitly as B=: 0(;@:) (:: empty) . In general, tacit adverbs are trains of adverbial clauses, so if you want to add another, you only need to wrap it in parens and tack it on the end. Though your phrasing 0(;@:) is very appealing; it seems to

Re: [Jprogramming] tacit adverb

2012-02-20 Thread Dan Bron
but quite more difficult (as far as I can see). From: programming-boun...@jsoftware.com [programming-boun...@jsoftware.com] on behalf of Dan Bron [j...@bron.us] Sent: Monday, February 20, 2012 11:02 AM To: 'Programming forum' Subject: Re: [Jprogramming] tacit

Re: [Jprogramming] tacit adverb

2012-02-20 Thread Dan Bron
Oh, and would it be valuable if the domain were extended to nouns, in particular literal vectors or boxed strings which represent J names, potentially pro-adverbs or pro-conjunctions? -Dan -Original Message- From: Dan Bron [mailto:j...@bron.us] Sent: Monday, February 20, 2012 8:01 PM

Re: [Jprogramming] Verb display in function tables

2012-02-18 Thread Dan Bron
Because in many contexts, a scalar is more convenient than a 1-element vector, I make a habit of tacking on a {. as in {.u`'' . -Dan On Feb 18, 2012, at 9:32 AM, Raul Miller rauldmil...@gmail.com wrote: I would use u`'' avg 1 :'u`' +---+ |avg| +---+ avg |value error:

Re: [Jprogramming] Verb display in function tables

2012-02-18 Thread Dan Bron
was also generating a 1 element vector, so I decided that a 1-element vector was an appropriate result. -- Raul On Sat, Feb 18, 2012 at 9:48 AM, Dan Bron j...@bron.us wrote: Because in many contexts, a scalar is more convenient than a 1-element vector, I make a habit of tacking

Re: [Jprogramming] Verb display in function tables

2012-02-18 Thread Dan Bron
with primitives that handle gerunds, we are getting into undocumented territory. -- Raul On Sat, Feb 18, 2012 at 11:18 AM, Dan Bron j...@bron.us wrote: That makes sense. My personal impression was that the original vector-ness was an (unintentional) side-effect of the method used to remove

Re: [Jprogramming] Verb display in function tables

2012-02-18 Thread Dan Bron
display in function tables I think Dan has it right. A gerund is an atomic representation of a verb. Could be a scalar (I use them that way a lot). Henry Rich On 2/18/2012 1:10 PM, Dan Bron wrote: I'm not sure gerunds are defined anywhere. But if they were, the phrasing might be arrays

Re: [Jprogramming] Verb display in function tables

2012-02-18 Thread Dan Bron
.htm You might argue that the definition is informal -- like most of J -- but I do not think it's fair to say that they are not defined anywhere. -- Raul On Sat, Feb 18, 2012 at 1:10 PM, Dan Bron j...@bron.us wrote: I'm not sure gerunds are defined anywhere. But if they were, the phrasing

Re: [Jprogramming] Verb display in function tables

2012-02-18 Thread Dan Bron
for gerund: http://www.jsoftware.com/docs/help701/learning/14.htm You might argue that the definition is informal -- like most of J -- but I do not think it's fair to say that they are not defined anywhere. -- Raul On Sat, Feb 18, 2012 at 1:10 PM, Dan Bron j...@bron.us wrote: I'm not sure

Re: [Jprogramming] serialization, in J

2012-02-18 Thread Dan Bron
Neat application! What behavior of 5!:5 do you use here, that is undocumented? The question of whether the behavior you observed in `:6 here, hinges on the definition of gerund, and the fact that you can do just this is one reason why I defined it as I did. Moreover, this behavior is

Re: [Jprogramming] 2!:1 hangs session in JHS until forked process terminated

2012-02-16 Thread Dan Bron
I haven't been following this thread, but instead of C routines, could you make use of the several file-handle related foreigns in the 1!: family? http://www.jsoftware.com/help/dictionary/dx001.htm 1!:20 y File Numbers and Names. A 2-column table of the open file numbers and

Re: [Jprogramming] Challenge 6 Many Many Cherry Trees

2012-02-15 Thread Dan Bron
Linda wrote: Design a function with no restrictions on style or specific functions. I'm glad the constraints on style and presentation were lifted. Linda wrote: PLEASE DO NOT RESPOND UNTIL 2/22/2012 Raul responded: Please send again when we can respond -- I will read it then. I

Re: [Jprogramming] Challenge 6 Many Many Cherry Trees

2012-02-15 Thread Dan Bron
Marc Simpson wrote: One thing though-the original problem stated that: Each row is a successive scramble of the character string above it with one added symbol Ah, I must've glossed over this part. Thanks for the tip. Here's another take: **SPOILER AFTER 15 BLANK LINES**

Re: [Jprogramming] Challenge 6 Many Many Cherry Trees

2012-02-15 Thread Dan Bron
**SPOILER AFTER 15 BLANK LINES** I wrote: I've always liked i..- though. It's cute. I guess I should explicitly point out that an alternative to i..-@# is -@#\. which is shorter and rhymes with the original expression, but loses the cuteness of . . -Dan

Re: [Jprogramming] Another early morning exercise

2012-02-12 Thread Dan Bron
Linda wrote: Cap |domain error Yes, as I noted in my original message, there is a bug in the display family (5!:) that prevents the definition of Cap from being displayed. It boils down to this: ((:0)`) |domain error Which has been known for a while. If this clause

Re: [Jprogramming] Another early morning exercise

2012-02-12 Thread Dan Bron
: [Jprogramming] Another early morning exercise What is the definition of Cap being used here? If Cap is defined as Cap=:[: it works fine. 5!:5'Cap' [: 1 2([: *: +)3 4 16 36 1 2(Cap *: +)3 4 16 36 On Sun, Feb 12, 2012 at 10:30 AM, Dan Bron j...@bron.us wrote: Linda wrote: Cap

Re: [Jprogramming] Another early morning exercise

2012-02-12 Thread Dan Bron
Raul wrote: My impression was that she was looking for something to transform ([: U V)V to use @ instead of [: Ah, ok, hence UnCap. This wouldn't be difficult to do; most of the tools needed were developed to produce Cap, and are available in [1]. But, reading your comments in another

Re: [Jprogramming] quote problem

2012-02-11 Thread Dan Bron
Unlike C, where \ introduces an escape sequence within string liberals, in J, the only special character in a literal is ' (single quote). So, to embed quotes in strings, double them up: a. i. '(`''3' . Of course, recursively embedded quotes need quadrupling, octupling, etc (eg 'he said

Re: [Jprogramming] quote problem

2012-02-11 Thread Dan Bron
and the trouble is with parsing them using ;: (instead of evaluating them in the immex session), then you could try something along the lines of (#~ 2 * = ]) y (i.e. double singleton quotes). -Dan Please excuse typos; composed on a handheld device. -Original Message- From: Dan

Re: [Jprogramming] Another early morning exercise

2012-02-10 Thread Dan Bron
Linda wrote: I was trying to find a situation where you have to use @ instead ( of [: ). I think Raul pointed out that u@v = ([: u v)v so that you never /have/ to use @ . You can mechanically convert from one formulation to the other. So I figured I'd provide you a tool to do just

Re: [Jprogramming] Another early morning exercise

2012-02-05 Thread Dan Bron
Linda, Boyko's not the first to express this sentiment to you. Don't you wonder what the mysterious appeal of @ is? If so, maybe a more rewarding (and commensurately challenging) exercise for you this morning is: translate from expressions without @ to ones with it For example, you

Re: [Jprogramming] Demise of @ and [: debate

2012-02-03 Thread Dan Bron
Hmm. I could do a basic intro to J course at one of the NYC JUGs. If we broadcast record it, we could then post it on youtube. The question is: who is the audience? What do they already know about J? What do they want to know? -Dan -Original Message- From:

Re: [Jprogramming] Challenge 5 Super Bowl Supposition

2012-02-01 Thread Dan Bron
I asked: Why should we avoid @ ? Linda responded: It encourages and fosters thinking from applying functions from left to right. Raul followed-up: *: -: 8 *:@-: 8 I am not seeing a big left-to-right vs. right-to-left difference, here. I'm with Raul. My sense is the aversion

Re: [Jprogramming] Challenge 5 Super Bowl Supposition

2012-01-31 Thread Dan Bron
Linda Alvord wrote: please do not use @ I know this has been asked before, and I may have missed the answer (forgive me if so). Why should we avoid @ ? That's like posting a Unix shell-scripting challenge, and saying avoid | (use file redirects instead). -Dan

Re: [Jprogramming] Boxes of different lengths

2012-01-10 Thread Dan Bron
/./ matrix -Dan Please excuse typos; composed on a handheld device. -Original Message- From: Ben Gorte - LR b.g.h.go...@tudelft.nl Sender: programming-boun...@jsoftware.com Date: Tue, 10 Jan 2012 14:40:41 To: Programming forum (programming@jsoftware.com)programming@jsoftware.com

Re: [Jprogramming] Indexed assignment must be slow?

2012-01-06 Thread Dan Bron
J has copy-by-value semantics. By default, all outputs occupy separate memory spaces from their corresponding inputs. It's a safety net, which, given that a lot of J programming is exploration, is very nice to have. Put another way, this is one of the design decisions that contributes to J's

Re: [Jprogramming] Indexed assignment must be slow?

2012-01-06 Thread Dan Bron
, Jan 6, 2012 at 10:39 AM, Dan Bron j...@bron.us wrote: J has copy-by-value semantics.  By default, all outputs occupy separate memory spaces from their corresponding inputs.  It's a safety net, which, given that a lot of J programming is exploration, is very nice to have.  Put another way

Re: [Jprogramming] Need APL - J cheat sheet

2012-01-06 Thread Dan Bron
Two resources occur to me. The first is probably closest to what you're asking for: http://www.jsoftware.com/jwiki/APL2JPhraseBook credit to Ian Clark on that one. The second is a horse of a different color: http://rosettacode.org/wiki/J Much like the Rosetta Stone helped

Re: [Jprogramming] Asking Are you still alive?

2012-01-03 Thread Dan Bron
Thank you for the generous present! I notice it has my name in the lead :) I'll review it soon and send any notes I may have. Have a happy and prosperous new year! -Dan -Original Message- From: programming-boun...@jsoftware.com [mailto:programming-boun...@jsoftware.com] On Behalf Of

Re: [Jprogramming] Asking Are you still alive?

2012-01-03 Thread Dan Bron
Oops, sorry guys! I hit reply to the wrong message; this was supposed to go to R.E. off-line. But, of course, a happy and prosperous new year to you all, as well! -Dan -Original Message- From: programming-boun...@jsoftware.com [mailto:programming-boun...@jsoftware.com] On Behalf Of Dan

Re: [Jprogramming] Problem with }

2011-12-14 Thread Dan Bron
The issue is that } is an adverb. So, even though V0 } V1 looks like a verb train, it's actually a hook, parsed as (V0}) V1 , which doesn't do what you want. You're looking for (OLD=)`(,:NEW) } . This is one of my very favorite J phrases. -Dan Please excuse typos; composed on a handheld

Re: [Jprogramming] How #: should have been designed

2011-12-13 Thread Dan Bron
PM, Dan Bron j...@bron.us wrote: Marshall wrote: (negative MSB) version is mathematically more well-founded I am personally not qualified to assess the mathematical virtues of the different formulations. And I see (more than) enough mathematical horsepower on these Forums to be confident

Re: [Jprogramming] How #: should have been designed

2011-12-13 Thread Dan Bron
It might be that in retrospect, an LSB-approach to #: would have been more in the spirit of J. It would have allowed us to give the monad #: its proper rank of zero, for example. .. that said, it works against the grain of most important information first, as expressed in our usual left-to-right

Re: [Jprogramming] How #: should have been designed

2011-12-12 Thread Dan Bron
I think we need use-cases for #: with negative arguments. I've probably hit some, over the years, but I can't recall any at the moment. Anyone else? -Dan -Original Message- From: programming-boun...@jsoftware.com [mailto:programming-boun...@jsoftware.com] On Behalf Of Raul Miller

Re: [Jprogramming] How #: should have been designed

2011-12-12 Thread Dan Bron
Maybe we should explore a different track. Forget all about the history of computing hardware, and the advantages of one representation over another when designing circuits. In purely mathematical terms, what are the decimal digits of the base-10 number -123 ? Working backwards: _123

Re: [Jprogramming] How #: should have been designed

2011-12-12 Thread Dan Bron
1 1 0 1 0 0 0 1 0 1 #. base i:5 _5 _4 _3 _2 _1 0 1 2 3 4 5 Marshall On Mon, Dec 12, 2011 at 2:09 PM, Dan Bron j...@bron.us wrote: Maybe we should explore a different track. Forget all about the history of computing hardware, and the advantages of one representation over another

Re: [Jprogramming] How #: should have been designed

2011-12-12 Thread Dan Bron
#: should have been designed And (* * #:@:|) achieves this result. #. (* * #:@:|) i: 3 _3 _2 _1 0 1 2 3 That's probably good enough for now. -- Raul On Mon, Dec 12, 2011 at 4:34 PM, Dan Bron j...@bron.us wrote: I don't think there's a violation of a uniqueness constraint. Consider

Re: [Jprogramming] How #: should have been designed

2011-12-12 Thread Dan Bron
Marshall wrote: (negative MSB) version is mathematically more well-founded I am personally not qualified to assess the mathematical virtues of the different formulations. And I see (more than) enough mathematical horsepower on these Forums to be confident that a sensible conclusion will be

Re: [Jprogramming] Oblique Road to Success!

2011-12-09 Thread Dan Bron
I can't speak for Raul, obviously, but: - J is a (programming) language - It is used to express (and sometimes execute) ideas, using a vocabulary So, asking where did you get this? of the sentence (,+/i./ 2{.1 1,~$y) u key ,/y is not very different than asking it of the

Re: [Jprogramming] multiple boxing

2011-11-28 Thread Dan Bron
~:/\ ]={. ). Thanks for jumping in when you are needed. R.E. Boss -Oorspronkelijk bericht- Van: programming-boun...@jsoftware.com [mailto:programming-boun...@jsoftware.com] Namens Dan Bron Verzonden: vrijdag 25 november 2011 4:43 Aan: 'Programming forum' Onderwerp: Re: [Jprogramming

Re: [Jprogramming] multiple boxing

2011-11-24 Thread Dan Bron
This looks similar to boxing a recursively nested parenthesized expression (or XML, or whatever). So, we can use recursion: foo =: ] `(@$:);.1~ 1 , 2 ~:/\ ]={. foo 1 1 2 2 3 3 4 2 3 4 4 1 2 2 2 1 +---+---+-+---+-+ |1

Re: [Jprogramming] multiple boxing

2011-11-24 Thread Dan Bron
Raul Miller wrote: foo=: ^:{./.~ [: +/\ 0,2 ~:/\ ] REB asked for a foo such that: foo 1 1 2 2 3 3 4 2 3 4 4 1 2 2 2 1 +---+---+-+---+-+ |1 1|+---+-+-+-+|1|+-+|1| | ||2 2|+---+---+|2|+-+-+|| ||2 2 2|| |

Re: [Jprogramming] Power

2011-11-20 Thread Dan Bron
Yes, you want x=._ (infinity). Thus, f^:(_) y or you can use the convenient shorthand form, f^:a: y . -Dan On Nov 20, 2011, at 5:36 AM, David Vaughan purpleblue...@googlemail.com wrote: If I'm doing f^:(x) y, can I write an expression so that f is repeatedly applied to y until the result

Re: [Jprogramming] table challenge in simple J

2011-11-14 Thread Dan Bron
How about a more difficult challenge? It's related. No embargo period on this one. Write a 13 : '' for Simple J. In particular, write an adverb which, given an anonymous tacit verb as an argument, derives a functionally identical verb (in terms of I/O), but all instances of f@:g are

Re: [Jprogramming] [Jbeta] conditionals

2011-10-31 Thread Dan Bron
Don't try to fit J into any pre-existing mental models you may have. Create a clean, empty category for it in your mind, and enter J as the first member of the population. You can call the category array-oriented languages, if you like. Other potential members are APL and K. -Dan PS:

Re: [Jprogramming] Multiple verb arguments

2011-10-30 Thread Dan Bron
0 Please excuse typos; composed on a handheld device. -Original Message- From: Henry Rich henryhr...@nc.rr.com Sender: programming-boun...@jsoftware.com Date: Sun, 30 Oct 2011 09:18:46 To: Programming forumprogramming@jsoftware.com Reply-To: Programming forum programming@jsoftware.com

Re: [Jprogramming] 32- 64-bit PRNGs

2011-10-29 Thread Dan Bron
Please excuse typos; composed on a handheld device. -Original Message- From: Linda Alvord lindaalv...@verizon.net Sender: programming-boun...@jsoftware.com Date: Sat, 29 Oct 2011 12:05:37 To: 'Programming forum'programming@jsoftware.com Reply-To: Programming forum

Re: [Jprogramming] slice and dice operators

2011-10-21 Thread Dan Bron
Composition vs application? Please excuse typos; composed on a handheld device. -Original Message- From: Roger Hui rogerhui.can...@gmail.com Sender: programming-boun...@jsoftware.com Date: Fri, 21 Oct 2011 15:05:17 To: Programming forumprogramming@jsoftware.com Reply-To: Programming

Re: [Jprogramming] Script spelling error

2011-10-20 Thread Dan Bron
I haven't been following the Forums closely, but there has been traffic recently regarding invisible Unicode whitespace chars giving J a hard time (spelling errors). Browsers introduce non-breaking spaces or something during copy/paste. Think Raul or Roger posted some tool to identify the

Re: [Jprogramming] {. y produces an array.

2011-10-20 Thread Dan Bron
Raul wrote: {.^:(#@$) i.-5 4 3 2 119 {., i.-5 4 3 2 119 Henry said: Point of nomenclature: every noun has a shape. All shapes are lists. The shape of an atom is an empty list. So Henry's given us a big hint here: '' ($,) i.-5 4 3 2 119 And, if you

Re: [Jprogramming] Remove part of rank-2 array

2011-10-13 Thread Dan Bron
Anything you can write in the browser window (IJX) or an explicit verb, or anywhere else in J, can be written tacitly. The only restriction on tacit code is it is stateless (no use of =: =. ). So, yes, you can use e. tacitly. The issue you're having is due to [: . That verb (it is a verb,

Re: [Jprogramming] Remove part of rank-2 array

2011-10-13 Thread Dan Bron
not sure what d is. ([: d e.~ ]) 2 Linda -Original Message- From: programming-boun...@jsoftware.com [mailto:programming-boun...@jsoftware.com] On Behalf Of Dan Bron Sent: Thursday, October 13, 2011 10:40 AM To: 'Programming forum' Subject: Re: [Jprogramming] Remove part of rank-2 array

Re: [Jprogramming] detecting name-clash in _z_

2011-10-09 Thread Dan Bron
Couple of points. You can detect name changes with 4!:5 [1] and the names returned will be fully qualified, meaning you'll be able to identify what locale the changed name is in. I'm not in front of an interpreter right now, but it's something along the lines of: 4!:5.i.2 NB. Top of

Re: [Jprogramming] Permutations

2011-10-01 Thread Dan Bron
his panic imp art the rapist -Original Message- From: programming-boun...@jsoftware.com [mailto:programming-boun...@jsoftware.com] On Behalf Of Raul Miller Sent: Thursday, September 29, 2011 6:13 AM To: Programming forum Subject: Re: [Jprogramming] Permutations

Re: [Jprogramming] Announcement. Journal of J. Call of papers

2011-09-27 Thread Dan Bron
Cool. Are general J papers welcome? That is, papers on the subject of J, rather than applications of J to science? -Dan -Original Message- From: programming-boun...@jsoftware.com [mailto:programming-boun...@jsoftware.com] On Behalf Of mikel paternain Sent: Tuesday, September 27, 2011

Re: [Jprogramming] New Project - New J User - Need Assist

2011-09-26 Thread Dan Bron
IMO, this piece of code is getting more attention than it merits. It's a simple utility, written long ago, and mostly used interactively in the REPL while debugging or just exploring (i.e. in throwaway contexts). If you want different behavior than nl et al provide, it's easy enough to write

Re: [Jprogramming] Permutations

2011-09-22 Thread Dan Bron
If speed is a big concern, then I imagine (haven't tested) that : would be faster than 10#.^:_1 . I used to have an intellectual distaste for choosing : to get the digits of the number (because I'm dealing with numbers, not strings, right?) but someone recently pointed out that to even say

Re: [Jprogramming] Tacit adverbs and conjunctions?

2011-09-19 Thread Dan Bron
Conjunctions: no (at least officially, though I have my suspicions) Adverbs, yes: www.jsoftware.com/pipermail/programming/2010-November/021172.html Relevant documentation is II.E (parse table) and II.F (trains, including the adverb train rule). -Dan Please excuse typos; composed on a

Re: [Jprogramming] Unboxing

2011-08-23 Thread Dan Bron
_ . boxed Please excuse typos; composed on a handheld device. -Original Message- From: james wafula jbukos...@yahoo.com Sender: programming-boun...@jsoftware.com Date: Tue, 23 Aug 2011 06:07:58 To: programming@jsoftware.comprogramming@jsoftware.com Reply-To: Programming forum

Re: [Jprogramming] indexOf for arrays

2011-08-18 Thread Dan Bron
Just as an example, here's how indexOf in J works: 'ABCDEFGHIJKLMNABC' i. 'ADKz' 0 3 10 17 A few notes: - The universe of all things (i.e. the source) is on the left, the target is on the right - You can look up multiple things simultaneously

Re: [Jprogramming] Subject: monadic rank of roll and deal

2011-08-08 Thread Dan Bron
I think the more puzzling behavior here isn't that ?. is different from ? but that ?. is giving a manifestly incorrect result wrt its definition. Whatever rank ?. is, each element of its result should be strictly less than the corresponding atom of its argument. Also an output of _ is just

Re: [Jprogramming] Subject: monadic rank of roll and deal

2011-08-08 Thread Dan Bron
forumprogramming@jsoftware.com Reply-To: Programming forum programming@jsoftware.com Subject: Re: [Jprogramming] Subject: monadic rank of roll and deal _ was not an output, it was part of the rank. -- Raul On Mon, Aug 8, 2011 at 10:48 AM, Dan Bron j...@bron.us wrote: I think the more puzzling behavior here

Re: [Jprogramming] value error

2011-08-07 Thread Dan Bron
Just a typo. You need an assingment like this compress =: 4 : 0 ) Please excuse typos; composed on a handheld device. -Original Message- From: nykkyo Kane nyk...@ymail.com Sender: programming-boun...@jsoftware.com Date: Sun, 7 Aug 2011 19:56:33 To:

Re: [Jprogramming] Ragged Length Array Addition

2011-08-02 Thread Dan Bron
The J Forum is the most useful part of the documentation. J without the Forum would be like J without the immediate execution window. It would be like trying to code C while sober. -Dan -Original Message- From: programming-boun...@jsoftware.com

Re: [Jprogramming] Puzzling behaviour of u} (verb-ammend)

2011-07-15 Thread Dan Bron
Verbal amend is under-documented and rarely used, due to the property you've discovered. In fact, verbal amend is only ever used when that property is desired. Otherwise, one would use the noun or gerundial form. The property is that in x f} y the verb f addresses indices into the

Re: [Jprogramming] Checking permutations

2011-07-08 Thread Dan Bron
The sum of the digits 0-9 is 45 and 4+5 is 9 so any number containing the digits 0-9 exactly once is going to be divisible by 9, and hence will not be prime. You're going to have to look for pandigital numbers containing repeated digits, that is N 9876543210 . So you can skip the permutation

Re: [Jprogramming] Sparse arrays with 13 dimensions

2011-07-04 Thread Dan Bron
Please excuse typos; composed on a handheld device. -Original Message- From: david alis david.a...@gmail.com Sender: programming-boun...@jsoftware.com Date: Sun, 3 Jul 2011 15:34:18 To: Programming forumprogramming@jsoftware.com Reply-To: Programming forum programming@jsoftware.com

Re: [Jprogramming] Tacit @ or @: ??

2011-06-25 Thread Dan Bron
I haven't read the responses to this yet but I'm sure someone has explained the difference. In short, @ is an assembly line, items being passed between workers one at a time, and @: is a hopper, all items being passed between workers in a batch. Quick'n easy ruke of thumb: always use @: except

Re: [Jprogramming] One word description of J

2011-06-10 Thread Dan Bron
Why is the description restricted to one word? Why are haikus restricted to 17 syllables? Anyway, the contemporary version of the elevator pitch is a tweet. Can you capture J in 140 characters, or less? -Dan -Original Message- From: programming-boun...@jsoftware.com

Re: [Jprogramming] One word description of J

2011-06-10 Thread Dan Bron
To: Programming forum Subject: Re: [Jprogramming] One word description of J jtweet=: 0 : 0 J is a programming language that works with arrays, verbs, and adverbs. For example, +/x computes the sum of array x and /:~x sorts it. ) # jtweet 138 - Original Message - From: Dan Bron j

Re: [Jprogramming] Suggested addtion to addons/math/misc/trig.ijs

2011-06-03 Thread Dan Bron
Since this is a fairly industry-specific format, and the verbs consequently are use-case-specific, it might be cleaner (and easier) to create a JAL addon for these related surveying utilities. -Dan -Original Message- From: programming-boun...@jsoftware.com

Re: [Jprogramming] decoupling assignments to mapped files

2011-05-29 Thread Dan Bron
assignments to mapped files Thanks, Dan. Works nicely, and is slightly faster than: $ $ , Ian On Sat, May 28, 2011 at 12:52 AM, Dan Bron j...@bron.us wrote: Ian asked:  Can you think of a low-overhead verb which  will force J to allocate sav its own separate  space in memory? Try

[Jprogramming] Weighted random selection

2011-05-27 Thread Dan Bron
What's a clear, short verb to select random items in a weighted fashion? Something like ? only: #0 Ranks 1 0 1 #1 y=.vector of weights (proportional to their total) #2 x=.number of trials #3 the monad is the dyad with a fixed left arg of 1, i.e. 1$: : ( ... )

Re: [Jprogramming] Weighted random selection

2011-05-27 Thread Dan Bron
?@$ 0 2 3 2 3 2 2 3 3 3 1 3 2 1 3 3 3 1 0 1 2 - Original Message - From: Dan Bron j...@bron.us Date: Friday, May 27, 2011 9:39 Subject: [Jprogramming] Weighted random selection To: 'Programming forum' programming@jsoftware.com What's a clear, short verb to select random items

Re: [Jprogramming] Weighted random selection

2011-05-27 Thread Dan Bron
500276 The coin seems pretty fair to me. - Original Message - From: Dan Bron j...@bron.us Date: Friday, May 27, 2011 10:08 Subject: Re: [Jprogramming] Weighted random selection To: J Programming programming@jsoftware.com At first blush, that seems like it would favor higher indices

Re: [Jprogramming] Weighted random selection

2011-05-27 Thread Dan Bron
Devon wrote: We must be on the same wavelength lately I came up with pickFrom=: ] {~ [ ?@$ [: # ] Devon, we're on the same wavelength but in a different phase. Your code picks a random item from a list (and could leverage a hook if you like: pickFrom=: ] {~ (?@$ #) ). My code does

Re: [Jprogramming] Weighted random selection

2011-05-27 Thread Dan Bron
Brian wrote: Does the filter (%+./) solve the big and fractional weights issue? It definitely solves the fractional weights issue, by normalizing everything to integers. I'll have to remember that, that's a neat tool. However, it doesn't solve the big weights issue, as e.g. one of the

Re: [Jprogramming] J arrays

2011-05-25 Thread Dan Bron
Which is to say: exactly as much as your machine can handle (note the formula below also defines the limits of memory pointers on modern architectures). Which should also tell you that the max number of items depends on the size (in memory) of 1 item. The smallest J item is one byte (a

Re: [Jprogramming] Programming Digest, Vol 68, Issue 43 - array limit

2011-05-25 Thread Dan Bron
. Re: Sorting (Pablo Landherr) 5. Re: Sorting (bill lam) 6. Re: Sorting (R.E. Boss) 7. Re: Sorting (bill lam) 8. Re: J arrays (Dan Bron) 9. Re: Sorting (Devon McCormick) -- Message: 1 Date: Wed, 25 May 2011 05:23:23

Re: [Jprogramming] String to number conversion

2011-05-18 Thread Dan Bron
You're using the monad . , Do, which executes valid J sentences (i.e. just like the things you can type into the IJX window). 1e+2 is not a valid J sentence. What you want is the dyad . , Numbers, which provides the leeway you quoted: _ . '1e+2' 100 -Dan -Original

Re: [Jprogramming] (no subject)

2011-05-06 Thread Dan Bron
The links posted in this thread (excised) are pretty clearly spam and very likely exploit sites. Can the list moderators please remove Denis Samson? (I suspect Denis himself is blameless but it looks like his email account has been compromised.) -Dan -Original Message- From:

Re: [Jprogramming] (no subject)

2011-05-06 Thread Dan Bron
. R.E. Boss -Oorspronkelijk bericht- Van: programming-boun...@jsoftware.com [mailto:programming- boun...@jsoftware.com] Namens Dan Bron Verzonden: vrijdag 6 mei 2011 14:49 Aan: 'Programming forum' Onderwerp: Re: [Jprogramming] (no subject) The links posted in this thread (excised

Re: [Jprogramming] A permutation of i.y

2011-05-01 Thread Dan Bron
Steven Taylor asked: btw: why is this useful? R.E. Boss responded: why is this useful? Like poetry is useful. An applaudable analogy. In fact, I applaud. -Dan PS: The J phrase (poem), too. Please excuse typos; composed on a handheld device. -Original Message- From: R.E. Boss

Re: [Jprogramming] A permutation of i.y

2011-04-29 Thread Dan Bron
foo =: @(0,[) C. i.@] (Untested) -Dan Please excuse typos; composed on a handheld device. -Original Message- From: Ian Clark earthspo...@gmail.com Sender: programming-boun...@jsoftware.com Date: Fri, 29 Apr 2011 13:03:55 To: Programming forumprogramming@jsoftware.com Reply-To:

Re: [Jprogramming] A permutation of i.y

2011-04-29 Thread Dan Bron
Sorry, I didn't read your output carefully so I mistinterpreted your question (thought you wanted to swap posn 0 with posn x). -Dan Please excuse typos; composed on a handheld device. -Original Message- From: Dan Bron j...@bron.us Date: Fri, 29 Apr 2011 12:07:53 To: J

Re: [Jprogramming] A permutation of i.y

2011-04-29 Thread Dan Bron
Cool, elegant approach. I think we could trim off the merge using A., but I do not have an interpreter in front of me, and Oleg's brinkster interpreter has gone away :( Anyway if you apply monad A. to Henry's output, or the output of the original foo, you'll find out what the LHA to dyad A.

Re: [Jprogramming] A permutation of i.y

2011-04-29 Thread Dan Bron
Apply the monad C. to the output of foo to discover the LHA required by the dyad C. to permute i. to foo . Similarly for A. -Dan Please excuse typos; composed on a handheld device. -Original Message- From: Ian Clark earthspo...@gmail.com Sender: programming-boun...@jsoftware.com

Re: [Jprogramming] Deal

2011-03-15 Thread Dan Bron
Depends on which argument is data (calculated, changes frequently) and which is control (fixed, or changes infrequently wrt the data). In other words, if you wanted to make a reusable verb, which is more likely in your context: deal =: 3? or deal =: ?10 ? If the former (which

Re: [Jprogramming] Recursive algorithm

2011-03-14 Thread Dan Bron
Nobody optimizes any more; premature abstraction is the new evil - @stuartsierra Stuart Sierra http://twitter.com/#!/stuartsierra/status/34967735423205376 -Dan -Original Message- From: programming-boun...@jsoftware.com [mailto:programming-boun...@jsoftware.com] On Behalf Of Devon

Re: [Jprogramming] Newbie question about repetition...

2011-03-10 Thread Dan Bron
For equal-length arguments, you can say repeats ;@:(#.) values . For equal- or unequal-length arguments, you can say repeats ;@:(#.) /@:(./.:@:,:$ $. ,) values . There might be a cleaner way to force agreement in shape by filling cylically; I'm just throwing this out there. -Dan

Re: [Jprogramming] timing doesn't scale to large problem size.

2011-02-28 Thread Dan Bron
The current implementation [of M.] retains results only for arguments that are small non-negative integer atoms. If it helps, any argument can be turned into a small non-negative integer with 6 s: s:@:(3!:1)@: . If you want an M.-like adverb that applies this transformation first,

Re: [Jprogramming] timing doesn't scale to large problem size.

2011-02-28 Thread Dan Bron
-Original Message- From: Raul Miller [mailto:rauldmil...@gmail.com] Sent: Monday, February 28, 2011 12:34 PM To: Programming forum Cc: Dan Bron; David Ward Lambert Subject: Re: [Jprogramming] timing doesn't scale to large problem size. On Mon, Feb 28, 2011 at 11:48 AM, Dan Bron j

  1   2   3   4   5   6   7   8   9   10   >