Re: [Jprogramming] Y Combinator -- "the J way"

2012-06-12 Thread Steven Taylor
thanks for the post. I have wondered about recursion in J before. I'd like to dig into your example a little more. Could you elaborate on *f'' gives us a gerund that can handle one more level of recursion * Why the double single quote? thanks, -Steven ---

Re: [Jprogramming] take

2012-06-02 Thread Steven Taylor
... and just as an exercise: f=:evenlink=:13 : 'x;>(y=a:){(y;http://www.jsoftware.com/forums.htm

Re: [Jprogramming] take

2012-06-02 Thread Steven Taylor
>From http://www.jsoftware.com/help/dictionary/d330.htm x;y is (y) NB. box x , box open y examples: a:;a:;http://www.jsoftware.com/forums.htm

Re: [Jprogramming] 'a b c' =. 1;2;3 unboxes?

2012-06-02 Thread Steven Taylor
'`plus minus' =. +`- on the r.h.s backtick means gerund. On the l.h.s, backtick looks to be optional. (names) =. 1 2 Doesn't seem to be doing anything? -Steven -- For information about J forums see http://www.jsoftware.com/

Re: [Jprogramming] take

2012-06-01 Thread Steven Taylor
"Oh, that's the asymmetry of ; again!" I should have realised! Oops. I was pleased to find that a: worked when I tried it. Didn't see that in any of the documentation that I looked at. thanks, -Steven On 1 June 2012 12:55, Brian Schott wrote: > Bob (and Henry, of course), > > That is a terr

Re: [Jprogramming] take

2012-05-31 Thread Steven Taylor
nt selection methods. > The best explanation I have seen is Henry Rich's "J for C Programmers - > Chapter 17" > http://www.jsoftware.com/help/jforc/more_verbs_for_boxes.htm#_Toc191734399 > > Hope this helps. > > Cheers, bob > > On 2012-05-31, at 9:57 PM, St

[Jprogramming] take

2012-05-31 Thread Steven Taylor
This code gets everything except the 4th item at index 3. (<<<3){i. 10 0 1 2 4 5 6 7 8 9 Why is '3' boxed three times thought? Also interesting / puzzling (the trend is that more dimensions mean less boxing is valid): (<<<3){i.10 10 Vs (<<3){i.10 10 ... and (<3){i. 10 10 10 ... and (???){

[Jprogramming] 'a b c' =. 1;2;3 unboxes?

2012-05-31 Thread Steven Taylor
Hi, just looking for a definition of this quoted variable assignment behaviour that I leaned about on this forum. What's it called in J parlance? 'a b c' =. 1;2;3 'a2 b2 c2' =. 1 2 3 Also, it looks like we get an unbox for free (a2=a),(b2=b),(c2=c) 1 1 1 thanks, -Steven

Re: [Jprogramming] |nounce error I. s:

2012-05-31 Thread Steven Taylor
> A "nonce error" means that you have found an instance where the implementation has been left unfinished. > It looks like I. has not been implemented for symbols. ... > > (Hypothetically speaking: this error is probably telling you that J > internally treats symbols as unordered data -- it's pr

[Jprogramming] |nounce error I. s:

2012-05-31 Thread Steven Taylor
s I.~A [s=.1[A=.0 1 2 3 1 (s:'`b')I.~A[s=.(s:'`b')[A=.(s:'`a`b`c') |nonce error | (s:'`b')I.~A[s=.(s:'`b')[A=.(s:'`a`b`c') What is a nounce error? I was thinking that the answer shoould also be 1. I remember now that s: is not fully supported with all verbs... but... any thoughts

Re: [Jprogramming] boxed + indexing

2012-05-25 Thread Steven Taylor
3 4;<(4 5,(<(2;<(3 4;4 5;<<(1 2 3 d1=d2 NB. yes d1=d3 NB. no d2=d3 NB. no On 25 May 2012 05:18, bill lam wrote: > if ; were symmetric, then the result of > > 1;2;3;4;5 > > will be quite unexpected. try display > > 1;<2;<3;<4;<5 > > П

Re: [Jprogramming] boxed + indexing

2012-05-24 Thread Steven Taylor
Strange. Even though I know the rule, I keep expecting ; to to be symetric for nesting. One of those things I guess. thanks for the (,< suggestion. -Steven -- For information about J forums see http://www.jsoftware.com/forums.ht

[Jprogramming] boxed + indexing

2012-05-23 Thread Steven Taylor
it's always puzzled me why it is necessary to box the last item in order to make the structure at index 1 the same as that at 0 ((1;(1 2)));<(2;(3 4)) Is this by design? thanks, -Steven -- For information about J forums see http

Re: [Jprogramming] CS Jokes

2012-04-05 Thread Steven Taylor
even in humble much maligned vb this could be expressed better. A recursive definition would be better. You do find lots of horrible examples in the scripty type languages. re: interpreted V's compiled: APL isn't as reliant on compilation because it doesn't have to interpret very often (i.e. who

Re: [Jprogramming] Sequential Machine

2012-02-28 Thread Steven Taylor
just checking, is there a way to generate additional inputs (or internal state) when the machine enters certain states? When I last looked at the sequential machine, I figured that it only responded to static input + planned to come back to it. -Steven

Re: [Jprogramming] multiline verb def with COM interface

2011-12-19 Thread Steven Taylor
found this example which works: PosDiff =: 4 : ('la =. x >. y', LF, 'sm =. x <. y', LF, 'la - sm') was trying to build a string externally with a linefeed though. On 19 December 2011 17:20, Steven Taylor wrote: > Hi, > > On 602 under windows, i

[Jprogramming] multiline verb def with COM interface

2011-12-19 Thread Steven Taylor
Hi, On 602 under windows, in the script window you can highlight several lines and then hit Ctrl+R. So how do we achieve the same thing over the COM interface? Is there a new line character defined that allows J to execue something like a multiline verb define via the COM .Do() method? thanks,

Re: [Jprogramming] The word for arrays of rank > 2

2011-10-24 Thread Steven Taylor
n- be it a reference to rank or dimension works fine. Can't see an alternative but to get used to a few synonyms. Is the variation a hard thing for a newcommer to get used to? Maybe it isn't. Give the authority and insight that is in the j language, it seems a little odd at first to accept that

Re: [Jprogramming] The word for arrays of rank > 2

2011-10-24 Thread Steven Taylor
I like vector, list, list of, or table of. Cube, and brick work too. A "cube of" sounds a bit weird, but it works. A "brick of"... not sure. Not so sure about report. Combinations of up to 3 dimensional surfaces have made it easier to grasp in the past. In that vein, report helped conceptually,

Re: [Jprogramming] error handling for long verb trains

2011-09-08 Thread Steven Taylor
On 8 September 2011 20:52, Devon McCormick wrote: > I just did this - minutes ago - something like: > > RCvsAT=: 'Cash';'Equity';'Bond';'AssetTypeNotRecognized' > > It seems like a good practice to put a guard value at the end of your > selected-from list to take advantage of "index of"'s behav

Re: [Jprogramming] error handling for long verb trains

2011-09-08 Thread Steven Taylor
thanks for explaining. I forgot about Adverse. Such a rich set of instructions. iFailed=: 4 : 0 fail=:1 ) iFailed=: 13 : 'fail=:1' -- For information about J forums see http://www.jsoftware.com/forums.htm

Re: [Jprogramming] error handling for long verb trains

2011-09-08 Thread Steven Taylor
Devon: sel=: (_&[`{) @. ([ < [: # ]) quite slick. Maybe it gets easier with time to trace something all the way through a train in a complete way. Append a special value to the list we are selecting from might work too I suppose. Raul: 4 train ::iFailed i.4 it took me a while to see the s

[Jprogramming] error handling for long verb trains

2011-09-08 Thread Steven Taylor
Hi, say I've got a verb train, that I like as a verb train... and I don't want to break it up. Is there a way to check for an error condition? 3 (]{~ [ I.~]) i. 4 3 4 (]{~ [ I.~]) i. 4 |index error | 4(]{~[I.~])i.4 |[-0] I could set an initial value like this... fail=.0 [ret=.

[Jprogramming] all indicies of a shape

2011-09-05 Thread Steven Taylor
I got curious about producing all elements of an array of the shape S. This is what I came up with: [S=.2 4 2 [prd=.1,}:*/\ S [c=.(*/S) S|"(0 1) prd ([:<.%~)"(0 1) i. c Which is kind of similar to: { (i.2);(i.4);(i.2) ... hmm... but how do you raise those results into 3x1 lists? Background:C#

Re: [Jprogramming] resize a mmf?

2011-08-29 Thread Steven Taylor
Thanks Raul. Much appreciated. I think I read somewhere that the header has variable size, so I might stay away from doing that. If the length value was closer to the start, probably not a bad option to modify it directly. Good point on maintenance. Perhaps there will be consequences for not h

Re: [Jprogramming] resize a mmf?

2011-08-29 Thread Steven Taylor
"So J has to have a description of that structure contained in the file." so you'd suggest recreating? I had a hunch that if the file size was increased, that there'd just be some empty space on the end and then the ammend syntax (which is by-reference) would be able to continue doing its work...

[Jprogramming] binary search

2011-08-29 Thread Steven Taylor
I was looking for an example of power being used for a binary search. Is there an example of this in a wiki or a list post? So far I've ended up with the below, which works well, but originally I was aiming at doing a binary search using symbols. Probably there is a crossover point where one out

[Jprogramming] resize a mmf?

2011-08-28 Thread Steven Taylor
I tried a quick experiment where I thought I would create a mapped file, allocate maximum, close the file, expand the file, and then reoppen it. My assumption was that when the file was reopenned that I'd be able to allocate two more values (each value takes 8 bytes). However, instead I get an 'b

Re: [Jprogramming] Finding numbers with _distinct_ digits

2011-08-17 Thread Steven Taylor
> > Indeed, and one can always ask the interpreter: > > #: b. _1 > #. > #. b. 0 > 1 1 1 > (#:^:_1)b. 0 > _ _ _ > Interesting. Thanks. ... and since I played around with the examples a little: (#:^:_1)"1 b. 0 1 1 1 -- For inf

Re: [Jprogramming] Finding numbers with _distinct_ digits

2011-08-17 Thread Steven Taylor
or f=:#=#@:~. f 1 2 3 1 0 f 1 2 3 4 1 -- For information about J forums see http://www.jsoftware.com/forums.htm

Re: [Jprogramming] Finding numbers with _distinct_ digits

2011-08-17 Thread Steven Taylor
(#=#@:~.) 1 2 3 4 1 (#=#@:~.) 1 2 3 1 0 -- For information about J forums see http://www.jsoftware.com/forums.htm

Re: [Jprogramming] Several questions about j

2011-08-16 Thread Steven Taylor
> > That surprises me, given what I understand about how KDB's syntax works. > > Do you know when this would have been? > > -- > Raul I need to take that comment back. Normally my conversation better than this. It turns out I merged a conversation from 3 years ago about J / KDB with other langu

Re: [Jprogramming] Several questions about j

2011-08-15 Thread Steven Taylor
just a quick note on the J to KDB+ comparison, I'm told that KDB had hooks and forks for a while, but then in later implementations they removed this feature because not enough customers were using them. -Steven -- For information

Re: [Jprogramming] Materials for NYCJUG meeting today - Tuesday 8/9 at Empire State Building

2011-08-09 Thread Steven Taylor
seems like you picked a some good common ground to assist the curious catch a glimpse. Things like "map reduce" are quite topical. -- For information about J forums see http://www.jsoftware.com/forums.htm

Re: [Jprogramming] value error

2011-08-07 Thread Steven Taylor
Just following up on Devon's post. compress2=.# i.e. copy each element n times. With this usage, the zeros and ones in a act as a filter . -- For information about J forums see http://www.jsoftware.com/forums.htm

Re: [Jprogramming] Ragged Length Array Addition

2011-08-03 Thread Steven Taylor
Hi Martin, please point me to that "flatten" link. I haven't come across this yet. > That "f." you were referring to as "flatten" is an adverb, BTW. ... and functionally an adverb that doesn't change the meaning of the verb at that. is it still then an adverb? ;-) when I used the word flatten

Re: [Jprogramming] Ragged Length Array Addition

2011-08-03 Thread Steven Taylor
just showing how Devon's approach might work with some helper verbs. Sometimes getting a result first and then going to documentation is a better way to learn. Use both approaches. A=. 1 2; 1 2 3 [ P =. (2 _2) f=. 13 : 'x+6*y' P f each A v=. f each P v A NB. same result To find out wha

Re: [Jprogramming] Mapped Files

2011-08-01 Thread Steven Taylor
http://www.jsoftware.com/papers/mmf.htm looks good. ty! http://www.jsoftware.com/jwiki/Studio/Mapped%20Files fyi: this is where I thought (after testing it out), "that was a little too easy"... maybe I should check in with the J forum first before taking this any further. ---

Re: [Jprogramming] Mapped Files

2011-08-01 Thread Steven Taylor
"You usually have only about half of your 4 GB available to your application" great. That should be plenty. I need about 1-1.5 GB I think. -- For information about J forums see http://www.jsoftware.com/forums.htm

Re: [Jprogramming] Mapped Files

2011-08-01 Thread Steven Taylor
Hi Bill, so in J does the OS still manage pulling parts of the file in / out of memory? optimistic case: Does 'size of viewport' mean that J takes x amount of the addressable memory, yet the OS only loads in parts relevant to the current operation? i.e. so long as you stay away from some safe thr

[Jprogramming] Mapped Files

2011-08-01 Thread Steven Taylor
I was just playing around with mapped files (see: http://www.jsoftware.com/jwiki/Studio/Mapped%20Files#jmfUtilities). So, then I got to wondering what the overhead for having a mappped file open was... and if there is a limit to how many you should have in a single J Session (2, .., 5, .., 20, ..

Re: [Jprogramming] I'll give a talk on J programming. Any ideas?

2011-07-30 Thread Steven Taylor
there are functional languages that run on top of the Java virtual machine such as Scala. Just saying that people are looking for elegance and conciseness. Try to find some common ground. What do these programmers do on day to day basis? Will there be some maths types in the crowd, or more busi

Re: [Jprogramming] bug in 13 : ?

2011-07-28 Thread Steven Taylor
the workaround isn't too bad. f=: 13 : 'n*n*n[n=.y' f 2 8 -- For information about J forums see http://www.jsoftware.com/forums.htm

Re: [Jprogramming] "Poisoned" arrays which cause plot to crash

2011-07-21 Thread Steven Taylor
a flippant, tangental remark due to the strength of the word poison (sorry). http://www.jsoftware.com/forums.htm

Re: [Jprogramming] One word description of J

2011-06-09 Thread Steven Taylor
this is another thread... but this comment below sparked a thought. I really like this reaching / naming / linguistic / mathmatical thing that Mr Iverson did. Also, just because it doesn't fit into English now, it doesn't mean that it shouldn't in the future. On 9 June 2011 09:32, Boyko Bantch

Re: [Jprogramming] Continuing struggle to get OLE to work so J can run Excel

2011-05-08 Thread Steven Taylor
Hi, I'm curious to see if you can get this running. OLE based automation was a little flakey with MS based languages even when this was in vogue. Fingers crossed. Typically in the past it was better to flick these switches before running before kicking off any type of process: Application.

Re: [Jprogramming] Solved [was More Excel/OLE difficulties]

2011-05-05 Thread Steven Taylor
"Choose 'Switch To' to activate the busy program and correct the problem." the other approach is to ignore the "Switch To" message as it is still working in the background. That "Switch To" message looks serious though... and it flashes and stuff. Pretty distracting. Another solution I saw was

Re: [Jprogramming] A permutation of i.y

2011-05-01 Thread Steven Taylor
oops. Read through the thread and realised just after posting that Ian had already come up with something similar to floatzero=:13 : '(>:i.<:x),0,x+i.(#y)-x' -Steven On 1 May 2011 22:51, Steven Taylor wrote: > Like poetry is useful. >> > > I get that part. Ju

Re: [Jprogramming] A permutation of i.y

2011-05-01 Thread Steven Taylor
> > Like poetry is useful. > I get that part. Just curious about the why behind the original request. Here's my boring version. floatzero=:13 : '(>:i.<:x),0,x+i.(#y)-x' [a=.4 floatzero i.10 -Steven -- For information about J

Re: [Jprogramming] A permutation of i.y

2011-04-30 Thread Steven Taylor
3 /:@:(([,-.~) i.) 10 neat. I liked Henry's sneaky version: 3 /:@(0} i.) 9 I need to catch up with the thread and think through the C. and A. approaches a little more. btw: why is this useful? -Steven On 30 April 2011 23:49, Marshall Lochbaum wrote: > Probably not very fast, but this one is

Re: [Jprogramming] Symbol s: usage

2011-04-12 Thread Steven Taylor
RM> Perhaps s:'`abc' would look better? that'll do it. I'm happy with that. Once you are used to seeing it, it doesn't matter so much. For some reason I never went near symbols in J. M> {. to get a scalar symbol will do. Didn't realise it was a scalar vector. Thanks for pointing that out. A

[Jprogramming] Symbol s: usage

2011-04-11 Thread Steven Taylor
Hi, what follows is a list of simple uses for Symbol (defined as s: in J). I get that using symbols is a bit like an enum, and that searching for a number is faster than searching for a string. Perhaps there's also a btree or something similar in the background as well for string to symbol mappi

[Jprogramming] 1 : n adverb

2011-04-11 Thread Steven Taylor
ref: http://www.jsoftware.com/help/dictionary/d310n.htm Hi, I had a little look around for usage / examples of 1 : n adverb definition. Do any http:// links come to mind? thanks, -Steven -- For information about J forums see htt

[Jprogramming] forms of ammend

2011-04-09 Thread Steven Taylor
f=:13 : '1 (x)}y$0' 3 5 7 f 10$0 0 0 0 1 0 1 0 1 0 0 (correct) but f2=:1([)}0$~] 3 5 7 f2 10 0 1 0 0 0 0 0 0 0 0 I can see that there are some challenges from the boxed notation returned for f2... but wondered if there was a way to achieve this tacitly. I'm guessing, but f looks like it

Re: [Jprogramming] strings

2011-04-09 Thread Steven Taylor
> > like2 =: 0:`([: *./ = +. '?' E. ])@.(=&#) ahh the gerund. Thought for a minute I was looking at the mysterious `: (dislexic subsitition from :` which means nothing on its own), but then remembered 0: is the constant zero. btw: I started appreciating _1|.!.1 and 1|.!.1 in the context of

[Jprogramming] strings

2011-04-09 Thread Steven Taylor
Hi, as an exercise, I decided to make a simple "like" operator like=:([:*./([=])+.('?'E.])) NB. in english: get membership flags where '?' is in the set y NB. OR that with the comparison flags NB. *./ insert-AND to get the result the problem with this "like" operator is that x and y portions mus

Re: [Jprogramming] Inverting Programs

2011-02-27 Thread Steven Taylor
Henry Rich: "There was an Adaytum Software that had as its CTO one Eric Iverson" gee that's intereing! Hey Ian, just remembered Stephen Taylor who is the editor for vector magazine (www.vector.org.uk) is working on something called a formulator. It might be worth

Re: [Jprogramming] Programming Digest, Vol 65, Issue 54

2011-02-27 Thread Steven Taylor
Hi Ian, (just catching up on email) thanks for the back-story on inversion. Sometimes I wish the smaller players could somehow stay indigeneous... I knew about Cognos, but not that IBM now owns them as well. Sounds like there could be quite a few takes on inversion + quite a lot of hidden valu

Re: [Jprogramming] Inverting Programs

2011-02-22 Thread Steven Taylor
> From: David Mitchell > >> Subject: Re: [Jprogramming] J embedded in Excel > >> To: Programming forum > >> Message-ID:<4d62889a.7000...@att.net> > >> Content-Type: text/plain; charset=ISO-8859-1; format=flowed > >> > >> One

[Jprogramming] Inverting Programs

2011-02-20 Thread Steven Taylor
Hi, Just sharing a thought. I was flicking through this old text book "The Science Of Programming" by David Gries (1981), while thinking that it was one of the few I remembered -- it made an impression on me. Here's a quote: "Wouldn't it be nice to be able to run a program backwards or, better y

Re: [Jprogramming] Elegance and the evolution of J

2011-02-17 Thread Steven Taylor
catching up with this thread, so maybe someone has suggested this already. We could begin some test projects whereby we load the verb, try to produce expected results, and then report on variations. This might help when the guys try to roll out v8 of J... although that's probably quite a way off.

Re: [Jprogramming] Intro and Question

2011-01-26 Thread Steven Taylor
"Do you know about Phillipe Mougin's paper on OO array programing in F-Script?" "" integrating APL with OO sounds like it'd be good from an elegance point of view, but bad from a performance point of view. Objects are just so slow (construct / decons

Re: [Jprogramming] jread / 1!:1 y / x 1!:2 y

2010-12-24 Thread Steven Taylor
0 5 > > (tobin A) (1!:2) <'c:\temp\A.dat' > frombin (1!:1) <'c:\temp\A.dat' > > (tobin A) write <'c:\temp\A.dat' > frombin read <'c:\temp\A.dat' > > On 23 December 2010 19:55, Steven Taylor wrote: > >> For a long ti

Re: [Jprogramming] jread / 1!:1 y / x 1!:2 y

2010-12-23 Thread Steven Taylor
#x27; (tobin A) write <'c:\temp\A.dat' frombin read <'c:\temp\A.dat' On 23 December 2010 19:55, Steven Taylor wrote: > For a long time I didn't go past vocabulary. Just starting to dig into the > script libraries now. Thanks for the sanity check. >

[Jprogramming] jread / 1!:1 y / x 1!:2 y

2010-12-23 Thread Steven Taylor
For a long time I didn't go past vocabulary. Just starting to dig into the script libraries now. Thanks for the sanity check. Looks like I need: [x] 3!:1 y and, 3!:2 y -Steven -- For information about J forums see

[Jprogramming] jread / 1!:1 y / x 1!:2 y

2010-12-23 Thread Steven Taylor
Hi, I'm having a few challenges reading / writing files. I seem to be able to write them okay, but reading one back in gives me a string (do I need a cast?). I have been using some of Devon's definitions (haven't worked out how to use "load 'jfiles'" yet. Also, examples from http://www.jsoftware

Re: [Jprogramming] auto fill with something other than zero?

2010-12-12 Thread Steven Taylor
Hi Raul, I really like your approach with the dyadic use of &., and the sneaky subtract and then re-add (very neat), but unfortunately _. doesn't work. [B=:>:&.>(i.1);(i.3);(i.5) open=:4 :'x+>y-&.>x' _. open B so back to this (I'll make a verb out of it). max=.>./#&> B max&(

Re: [Jprogramming] auto fill with something other than zero?

2010-12-11 Thread Steven Taylor
gt;programming-ow...@jsoftware.com > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Programming digest..." > > > Today's Topics: > > 1. Sudoku solution query (Robert Goudie) > 2. Re: Sudoku soluti

Re: [Jprogramming] auto fill with something other than zero?

2010-12-11 Thread Steven Taylor
. B=:(1; 1 2 3; 1 2 3 4 5) max=:>./ > # each B ((1$~,_.$~max-)#) each B |domain error almost. But 1$~,_. on its own works. -Steven On 11 December 2010 09:12, Steven Taylor wrote: > Hi, > > I like the way ,:!.f works. It's quite neat. > > What would be even bet

[Jprogramming] auto fill with something other than zero?

2010-12-11 Thread Steven Taylor
Hi, I like the way ,:!.f works. It's quite neat. What would be even better is if > open behaved a little like ,: does with it's fill conjunction. e.g. f=:_. [A=:(i.3),:!.f(i.5) 0 1 2 _. _. 0 1 2 3 4 we can extend that further with [A=:A,!.f(i.7) (but I suppose we've got a fu

Re: [Jprogramming] Generic operations on verbs

2010-12-03 Thread Steven Taylor
Thanks for those examples Roger + the original question Alex. Forks, obverse, and the Iversonian idea of open, operate, close are holding together a bit more strongly for me now. sin=:1&o. cos=:2&o. tan=:3&o. f=:* a=:1 2 3 b=:4 5 6 a >@(f&.>/)@(sin;cos;tan) b 0.57275 0.919536 0.078073 _1.2439

Re: [Jprogramming] J-ODBC to MySQL problems

2010-09-25 Thread Steven Taylor
Hi, for me the problem turned to be that the vendor didn't have a ver 3 ODBC driver (which J odbc scripts are set up for). There's a beta version of it available, but I haven't got around to giving it another try yet. Thanks go to Bill Lam for restoring my sanity through helping me interpret col

Re: [Jprogramming] Kelly Criterion

2010-09-16 Thread Steven Taylor
Raul: "The trick, of course, lies in determining the probability of success." Once upon a time, I saw Kelly give a trader too much confidence ;-) -Steven -- For information about J forums see http://www.jsoftware.com/forums.htm

Re: [Jprogramming] ODBC Error

2010-09-06 Thread Steven Taylor
> Is the H1.RYN a mssql, oracle? or xtrive!?" The database is Intersystems Cache. I was just trying to stay on topic. > Anyways I suggest use ddcol to examine the column type of the stockprice table. Current dd does not handle all odbc types. Thanks! Using ddcol, details on the offending column

[Jprogramming] ODBC Error

2010-09-05 Thread Steven Taylor
Hi Jers, I decided to use J for some tests... I tried to pull some data in from a non standard btrieve style database (to be retired), so probably this isn't a J problem, but just wondered if anyone had seen this. It's my first time using J's ODBC drivers. This error occurs when pulling a date col

Re: [Jprogramming] Why `3:

2010-08-31 Thread Steven Taylor
Bo wrote: > I wonder why the 'insert' / is replaced with > 'evoke gerund'`3: Roger responded: > Because that is how it's represented internally. > You may not think that that is a good reason > but it's the immediate reason. Raul followed-up: > The alternative is more concise. Dan Obse

Re: [Jprogramming] Creating a matrix (some polish required)

2010-08-24 Thread Steven Taylor
([:#:2^|@i.) minor alterations shouldn't be counted right? -- For information about J forums see http://www.jsoftware.com/forums.htm

Re: [Jprogramming] index origin 0

2010-07-25 Thread Steven Taylor
Thanks for the link to Dijkstra did[0]. I was about to say that I had done several years as 1 origin inclined, and several as zero + that solutions using zero "seemed" to be more elegant and less fragile, but did[0] (even if APL opposed) said it better so I wont. These days I like not having a cho

Re: [Jprogramming] C++ and Java "too complex"

2010-07-24 Thread Steven Taylor
Hi Devon, thanks for that. The comments underneath the story quite revealing as far as attitudes and motivations are concerned. -Steven -- For information about J forums see http://www.jsoftware.com/forums.htm

[Jprogramming] The way we think

2009-08-21 Thread Steven Taylor
I had to share this. Using J I was recently able to solve an n-dimensional mapping problem using a J array with a shape vector. The solution needed 4 operations. Moving this back to the C / C# world the other developer couldn't see that it was a complete solution. Instead he is now busy recreat

Re: [Jprogramming] +/ slower than (+/ % #)/

2009-05-20 Thread Steven Taylor
thanks for clarifying. This makes sense. I was more curious than anything. about integers... I had considered using int because I thought it might be faster where not requiring a huge amount of precision. i.e. a decimal with some kind of multiplier. J is quite fast as it is so not a big deal.

[Jprogramming] +/ slower than (+/ % #)/

2009-05-20 Thread Steven Taylor
Hi, while doing some profiling, I was recently surprised that +/ a was slower than (+/ % #) a. I expected to find the opposite. --Steven a =: ? 1 $ 100 6!:2 'b=.+/ a' 0.240794 6!:2 'b % #a' 4.92455e_6 NB. vs 6!:2 '(+/ % #) a' 0.13628 --

[Jprogramming] why must the last boxed item be boxed for symetry?

2009-04-15 Thread Steven Taylor
Hi, Skip to the last abc for the question. NB. a sequence of gerund, noun works a=.(+/%#)`+`%;12 b=.>{.a c=.>}.a NB. but noun, gerund doesn't a=.12;(+/%#)`+`% b=.>{.a c=.>}.a |domain error NB. oh okay, it's that last item of a boxed list must boxed for symmetry thing again. I don't quite get

[Jprogramming] i. and not found

2009-03-24 Thread Steven Taylor
Hi, 3 i. (i. 5) index is useful. I wondered where the convention came from of having not found equal the # count of items (since all valid indexes are zero to n-1) came from? Is this because it is more efficient to use a unsigned integer in the C code that constitutes J since we are making bette

Re: [Jprogramming] using the exotic form of ammend } (from J For C Ch. 42)

2009-03-17 Thread Steven Taylor
[d=:4 + (i. 3 3) v =. 13 : 'x (|:@:])`({.@:])`(_.$~([, {.@:$@:]))} y' 20 v d Small celebration... I got the exotic form to work. My apologies for posting incorrect code. It was a copy and paste error on my part from smaller atomic examples. Also, the J IDE is more helpful than I previously thou

Re: [Jprogramming] every box, take and ammend

2009-03-17 Thread Steven Taylor
So instead of x (* + %@:]) y <-> x * y + x % y we get x (* + %@:]) y <-> x * y + % x ] y So in a sense, when ] is rightmost it steals the chance to fork, and % is locked to monad due to the verb verb combination? BTW: this was exactly the sort of thing I was looking for... 3 (* + [: % ]

Re: [Jprogramming] every box, take and ammend

2009-03-17 Thread Steven Taylor
Roger: "If this was a question, note the last part of the Dictionary listing for Explicit Definition oh yes... thanks, I checked that. I think I understand the explict definition form okay. -- For information about J forums see h

Re: [Jprogramming] every box, take and ammend

2009-03-17 Thread Steven Taylor
Very good Dan r3 =: % : ~. :) Roger: "If this was a question, note the last part of the Dictionary listing for Explicit Definition Yes I'm afraid it was a vague question. What I was trying to get at was where a term is defined for both dyadic and monadic cases, how do I 'select' the monadic cas

[Jprogramming] using the exotic form of ammend } (from J For C Ch. 42)

2009-03-16 Thread Steven Taylor
[d=:i. 3 3 [e=:(_.$~(20, {.@:$@:])) d [f=:({.@:]) d [g=:(|:@:]) d ( g f } e) d g f } e NB. ok 20 ( g f } (_.$~([, {.@:$@:]))) d NB. ok NB. substituting g or f will fail 20 ( g ({.@:]) } (_.$~([, {.@:$@:]))) d NB. finally I re-found that entry I remember reading on amend NB. so it isn't p

Re: [Jprogramming] every box, take and ammend pattern

2009-03-15 Thread Steven Taylor
thanks. As usual J proves to be far more flexible than hoped. Kip's last example was what I was looking for, but I will need Dan's examples for some other problems. During my trials, I had it locked in my head that '[: is a suicide verb... so how do I force a verb to be monadic'. NB. replace any

[Jprogramming] every box, take and ammend pattern.

2009-03-15 Thread Steven Taylor
Hi, I'm trying to add the contents of a boxed scalar to the the first row of every corresponding boxed table. I think where I'm having trouble is the [ and ] verbs, and having trouble with juxtaposing take with amend. a=:(1;2;3) [ b=:(i.3 3);(4+(i. 3 3)); (7+(i. 3 3)) lajea=: (([@:+@:,@: {.,@:}.@:

Re: [Jprogramming] filter based on rank

2009-03-13 Thread Steven Taylor
Also, for the first row whether rank one or two: ({:@${.,) i. 3 3 0 1 2 ({:@${.,) i. 3 0 1 2 NB. select first n items from the ravelled array, where n is the last item in the arrays shape NB. which is a column (rank 2) or the length of a single row (rank 1) Nothing earth shattering, but h

Re: [Jprogramming] filter based on rank

2009-03-13 Thread Steven Taylor
0 : 0 I'd like to get would like to get the same result for each pair of cases i. & ii., a) & b) AIM: same result regardless of rank 1 or rank 2. >= rank 3 is not defined. ) NB. i) 0 _1&{ (1 2 3 4 5) 1 5 NB. ii) 0 _1&{ (1 2 3 4 5,: 6 7 8 9 10) 1 2 3 4 5 6 7 8 9 10 NB. a) ({.L:0) (

[Jprogramming] filter based on rank

2009-03-12 Thread Steven Taylor
a=:1 2 3; 4 5 6; 7 8 9 b=:(1 + i. 3 3);(4 + i. 3 3);(7 + i. 3 3) NB. take first and last of each ordered list, return min & max of all mnxbox=:(<./,>./)@:(,)@:(({.,{:)@:>) mnxbox a 1 9 NB. but when a boxed list of tables, only apply to first row in each NB. is there a simple way to filter by thi

Re: [Jprogramming] BOXING & UNBOXING

2009-03-12 Thread Steven Taylor
Perfect. So 'curry', unbox, operate, and then box the result. Now I'm going to wonder where else this technique can be used. Probably in lots of places. thanks, --Steven -- For information about J forums see http://www.jsoftwar

[Jprogramming] BOXING & UNBOXING

2009-03-12 Thread Steven Taylor
I'm now at the point where I'm thinking, 'no actually, boxing could be quite useful'. Is there a way to multiply corresponding boxed items from two lists together? non complete examples produced in trying to solve this question. a=:1 2 3; 4 5 6; 7 8 9 c=:10;13;14 |: (<@:{.@>)\(1&) a NB.

Re: [Jprogramming] +/"2 vs

2009-02-21 Thread Steven Taylor
I did notice the different ranks were different and thought to try something like this... <"_"2 a -- For information about J forums see http://www.jsoftware.com/forums.htm

[Jprogramming] +/"2 vs

2009-02-21 Thread Steven Taylor
Hi, It looks like <"1 and +/"1 match, but <"2 and +/"2 don't seem to. Is there something in the parsing rules that I'm missing? Steven a=:i. 3 3 0 1 2 3 4 5 6 7 8 <"1 a +-+-+-+ |0 1 2|3 4 5|6 7 8| +-+-+-+ +/"1 a 3 12 21 <"2 a +-+ |0 1 2| |3 4 5| |6 7 8

Re: [Jprogramming] Histogram

2009-02-21 Thread Steven Taylor
histogram=: <: @ (#/.~) @ (i...@#@[ , I.) NB. histogram verb from http://www.jsoftware.com/help/dictionary/dicapdot.htm. a =:(_20 + (i.9)*5) NB. intervals from minus -20 to 20 in steps of 5 b=:(+/\ 5 - ?. (20 $ 10)) NB. a simple

[Jprogramming] Histogram

2009-02-20 Thread Steven Taylor
So <: still takes the x operand? Doesn't that mean it is dyadic, but it's right operand is the result of verb immediately to the right? If <: still gets the x operand, I'm still puzzled. -- For information about J forums see http

  1   2   >