Re: [Jprogramming] Jx 1.1 Release

2017-10-05 Thread Thomas Costigliola
Hi Mike, it all depends on how much work you want to do. The simplest solution to have 2 instances running simultaneously is to have 2 copies of the J installation with one of them using the Jx j.dll in place of the official j.dll. On Windows you can possibly use symbolic links to point the Jx i

Re: [Jprogramming] "n-volume" of an "n-sphere"

2017-08-16 Thread Thomas Costigliola
On Tuesday, August 15, 2017 4:27:20 PM EDT Raul Miller wrote: > It loses accuracy somewhere between n=150 and n=200. > > Keep in mind though that the dimensions of these "volumes" are not > comparable. That's a good point. Observing alone that the volumes of the spheres increase and then decrease

Re: [Jprogramming] Jx version 1.0 release

2017-08-02 Thread Thomas Costigliola
code. I think m"n was wrongly defined and that this is the correct definition. My opinion is not universally shared so I haven't acted on it. Henry Rich On Wed, Aug 2, 2017 at 5:03 PM, Thomas Costigliola wrote: You can try removing the conditional statement enclosing that line, but

Re: [Jprogramming] Jx version 1.0 release

2017-08-02 Thread Thomas Costigliola
, bill lam wrote: Yes, I use Clang and have -Werror -Wextra in CFLAGS. Sometimes vs2013 is much less tolerant. Ср, 02 авг 2017, Thomas Costigliola написал(а): That looks like Henry's code taken from cr.c at some older version. It compiles fine for me in GCC and Visual Studio 2013.

Re: [Jprogramming] Jx version 1.0 release

2017-08-02 Thread Thomas Costigliola
That looks like Henry's code taken from cr.c at some older version. It compiles fine for me in GCC and Visual Studio 2013. It is in the implementation of "::, which seems to be working in my tests, so that code never gets hit. Are you using Clang? It's much less tolerant of code like that. Re

[Jprogramming] Unbox v0.2-rc1 Release

2016-03-23 Thread Thomas Costigliola
A new version of Unbox is available which includes support for Unicode characters in names (contributed by Marshall Lochbaum). A fuller change log will be available in the final v0.2 release. https://github.com/iocane/unbox/releases/tag/v0.2-rc1

Re: [Jprogramming] Tail recursion (bug hijack)

2016-03-22 Thread Thomas Costigliola
What kind of possibilities where you thinking of? Things not related to $: as well? On 03/21/2016 07:19 PM, Henry Rich wrote: Would it make sense for O. to be a conjunction where v is a bitmask indicating the type of optimization requested? There might be many possibilities. Henry Rich On

Re: [Jprogramming] Help, please - crash after suspension in J64

2016-03-21 Thread Thomas Costigliola
Hi Henry, You didn't mention if Bill's test was on Windows or Linux. Does it happen on both platforms? Mac? On 03/21/2016 03:11 PM, Henry Rich wrote: I have a reproducible crash on J64 when I run a large script after debug has been active, even if it no longer active. This appears to be in

Re: [Jprogramming] Unbox request for requests

2016-03-15 Thread Thomas Costigliola
This is getting off course, but I will try to clarify. Here are the current parsing rules: EDGE VERB NOUNANY 0 Monad EDGE+AVN VERB VERBNOUN 1 Monad EDGE+AVN NOUN VERBNOUN 2 Dyad EDGE+AVN VERB+NOUNADV ANY

Re: [Jprogramming] Unbox request for requests

2016-03-15 Thread Thomas Costigliola
I said: "there is no 'Train parsing rule'", to be more clear it should be: there is no "Adverb train application rule". On 03/15/2016 04:28 PM, Thomas Costigliola wrote: I am not quite sure what you mean by "when an adverb is applied to an adverb" Onc

Re: [Jprogramming] Unbox request for requests

2016-03-15 Thread Thomas Costigliola
I am not quite sure what you mean by "when an adverb is applied to an adverb" Once (a0 a1) is parsed it becomes an adverb. It is a new adverb and it is its own self contained object. Once we apply X to it, there is no more parsing to be done, there is only the result of applying the adverb to

Re: [Jprogramming] Unbox request for requests

2016-03-15 Thread Thomas Costigliola
X (a0 a1) is fully parsed once the application of the adverb train to X happens, so no further parsing is done and the parsing rules will not help us resolve what to do next. I don't think the language specifies what happens when an adverb is applied to an adverb, or even acknowledges that it c

Re: [Jprogramming] Unbox request for requests

2016-03-15 Thread Thomas Costigliola
nd data volumes get large. It's good to see people experimenting with forks. Cheers On Thu, Mar 10, 2016 at 9:35 AM, Thomas Costigliola wrote: Great list Joe, I'll respond to each below... On Mar 9, 2016 7:26 AM, Joe Bogner wrote: Some wishlist ideas (some are likely controversial)

Re: [Jprogramming] Unbox request for requests

2016-03-15 Thread Thomas Costigliola
I believe this is what Pascal is trying to demonstrate (correct me if I am wrong): 0 (1 : '/') \ /\ 0 ((1 : '/') \) |syntax error | 0((1 :'/')\) A sequence of adverb applications when the first application returns an adverb is okay (it produces the adverb train), however, applied

Re: [Jprogramming] Unbox request for requests

2016-03-10 Thread Thomas Costigliola
ess of current J instance: http://www.jsoftware.com/pipermail/source/2014-May/000581.html 2. Method of cleaning up instance memory on linux: http://www.jsoftware.com/pipermail/source/2015-February/000663.html On Tue, Mar 8, 2016 at 7:32 AM, Thomas Costigliola wrote: > > > So far Unbo

Re: [Jprogramming] Unbox request for requests

2016-03-10 Thread Thomas Costigliola
ter is treated as an alphabetic, and invalid UTF-8 gives a spelling error.    ]π2 =. 1p2 9.8696    %: π2 3.14159 Do you want this in unbox's master branch? If so I'll send a pull request. The code is at https://github.com/mlochbaum/unbox/tree/unicode. Marshall On Tue, Mar 08, 2016 at 07:32:

[Jprogramming] Unbox request for requests

2016-03-08 Thread Thomas Costigliola
So far Unbox has a couple of bug fixes and build system changes not in the standard source release. I have begun working on a re-implementation of gerunds that should fix some bugs and allow some new features. This is working out to be a somewhat long term project and I'd like to keep thin

Re: [Jprogramming] When a <. _ is less than a

2016-02-03 Thread Thomas Costigliola
I see, you were referring to the "no notion of infinity" statement, not the statement about conversion. You are correct extended and rational have special values to represent infinity but they are different from the floating point standard so you can't just do "a < b" in C for a rational a and

Re: [Jprogramming] When a <. _ is less than a

2016-02-03 Thread Thomas Costigliola
There is no arithmetic being done. On 02/03/2016 04:06 PM, Raul Miller wrote: If that's the case, how does this happen? 3!:0 x:_ 128 -- For information about J forums see http://www.jsoftware.com/forums.htm

Re: [Jprogramming] When a <. _ is less than a

2016-02-03 Thread Thomas Costigliola
Infinity is a feature of double; extended integers and rationals have no notion of infinity so normally arithmetic gets done in double. So if your array has numbers that are too large for machine integers the easy way out is to convert the extended precision. You could test for special cases, e

Re: [Jprogramming] A Different Less?

2016-01-21 Thread Thomas Costigliola
There could, theoretically, be special code triggered from inside other adverbs and conjunctions that inspect their arguments. If you can image some construction with @: or [:, which by itself has no special code but in some larger context, seen later by the parser, has an optimization.  T

[Jprogramming] Unbox - Active, Community Maintained, GPL J

2016-01-15 Thread Thomas Costigliola
This post is to announce "Unbox" a new project which aims to be an actively maintained GPL release of J. I am committed to contributing my time and energy to incorporate community ideas, enhancements and bug-fixes. Currently, the focus is on the core engine which intends to be a drop in replace

Re: [Jprogramming] advent of code - day 2

2015-12-03 Thread Thomas Costigliola
Here's my solution to part 1. I=. /:~@:(do;._1)@:('x'&,);._2 ] 0 : 0 3x11x24 13x5x19 1x9x27 24x8x21 6x8x17 ... ) M=. 7 3 $ 1 1 0 1 0 1 0 1 1 I +/@(+/@:(*/) . ^) |:M 1588178 On Thu, Dec 3, 2015 at 6:47 AM, Ryan Eckbo wrote: > And mine: > > # part 1 > Presents=. do each ('x'&cut);._

Re: [Jprogramming] 'Tis the Season...

2015-12-01 Thread Thomas Costigliola
Yes, it was! I'm hopping it gets harder. On Tue, Dec 1, 2015 at 2:26 PM, Joe Bogner wrote: > fun! day 1 was easily solved with J > > On Tue, Dec 1, 2015 at 2:02 PM, Thomas Costigliola > wrote: > > &g

[Jprogramming] 'Tis the Season...

2015-12-01 Thread Thomas Costigliola
http://adventofcode.com/ -- For information about J forums see http://www.jsoftware.com/forums.htm

[Jprogramming] Executing Locked Scripts from Nouns

2015-10-22 Thread Thomas Costigliola
Attempting to run a locked script from a noun doesn't work: 0!:1]3!:6 'sum=:+/' � |spelling error | � I understand there might not have been an apparent use case for this, but is there a technical or security reason for the restriction? I need to read the contents of a locked script into a

[Jprogramming] Jd reference to empty table

2015-01-14 Thread Thomas Costigliola
I wasn't expecting this error on a join to an empty table but rather an empty result. Was this the intended behavior? jdadminx'test' etc=: 0 : 0 name byte 12 depid int ) a=: 12{."1>;:'Rafferty Jones Steinberg Robinson Smith John Rafferty' b=: 31 33 33 34 34 36 33 jd'createtable';'et';etc

Re: [Jprogramming] J803 Qt IDE Regex Bug

2015-01-08 Thread Thomas Costigliola
regexec + i *x *c x *i i'&(15!:0) 'H'rxmatch'Hello' ... _1 0 _1 0 _1 0 _1 0 ... I was able to work around this by symlinking libjpcre to my system's pcre library. But I am curious to see if anyone can reproduce this. On Wed, Jan 7, 2015 at 6:40 PM, bil

[Jprogramming] J803 Qt IDE Regex Bug

2015-01-07 Thread Thomas Costigliola
I am getting strange behavior from the regex library in J803 when using the Qt IDE. Even stranger is that it does not happen under jconsole JVERSION Engine: j803/2014-10-19-11:11:11 Library: 8.03.10 Qt IDE: 1.3.1/4.8.6 Platform: Linux 64 Installer: J803 install InstallPath: /home/thoma

Re: [Jprogramming] Replace one item of a list

2014-09-11 Thread Thomas Costigliola
On Thu, Sep 11, 2014 at 1:50 PM, Dan Bron wrote: > Pepe wrote: > > My only question is: Does the Dictionary support this behavior? > > Raul responded: > > Yes, it does. > > I am intrigued. Can you elaborate? > I assumed that by not mentioning it, the implementation is free to do what it chooses

Re: [Jprogramming] Replace one item of a list

2014-09-11 Thread Thomas Costigliola
What I would expect to happen with u/ Y where 1=#Y is: if the neutral element (E) is known then E u Y otherwise a domain error, with the ability to specify E through (!.). I think my mindset is a bit more pure where as the implementation is a bit more practical, albeit, as Pepe said, arbitrary. On

Re: [Jprogramming] Ragged Array Shapes are Trees

2014-09-10 Thread Thomas Costigliola
Bo, would you say that ordinal fractions are equivalent to "left lists" from the paper "From Trees Into Boxes"? If so, then J already addresses the nodes of a tree in that manner through {::, with the slight modification that data in a node can be an array of arbitrary shape so each step down the t

Re: [Jprogramming] Ragged Array Shapes are Trees

2014-09-09 Thread Thomas Costigliola
It appears adding a new data type had been explored and rejected: "...However, subsequent discussions with Iverson and Hui [Iv92] about this interpreter led to the decision to set this work (which introduced the tree as a new data type) aside and replace it with aninterpreter in which trees

Re: [Jprogramming] Ragged Array Shapes are Trees

2014-09-09 Thread Thomas Costigliola
On Mon, Sep 8, 2014 at 11:56 AM, Dan Bron wrote: > I do think trees, if we did it right (that is, treated as first class > citizens in their own right, as opposed to a subtype or a different > perspective on "arrays"), would be a powerful extension to the language. > That would take some serious

Re: [Jprogramming] Ragged Array Shapes are Trees

2014-09-08 Thread Thomas Costigliola
Array representations and "pointer" representations of trees both have their uses. In the end it depends on what problem you are trying to solve. As Devon demonstrated, for his purpose, array representation was not a hindrance at all. But, as Dan mentions, trees are also used to implement abstract

Re: [Jprogramming] fit conjunction - quicksort recursion

2014-09-03 Thread Thomas Costigliola
get I chance. I also want to try O. on the tail recursive version of quicksort. Ultimately, my wish for O., though, would be to demonstrate it on problems where it can be shown to have some advantage over existing solutions. > > > - Original Message - > From: Thomas Costigliol

Re: [Jprogramming] fit conjunction

2014-08-28 Thread Thomas Costigliola
Henry, out of sheer curiosity, if you have a story of such evil follies I would be delighted to hear it. More seriously, do you have a tacit tail recursive verb for quicksort to share ? This is related to this post http://www.jsoftware.com/pipermail/programming/2014-August/039023.html On Thu, Au

Re: [Jprogramming] Trampolining (was Adler-32)

2014-08-27 Thread Thomas Costigliola
compiled to: > >fib > [: {: (<:@{. , {:@}. , +/@}.)^:(0 < {.)^:_ > > but for clarity: >Guard > 2 : 'u ^:v^:_' >Cleanup > 2 : '[: v u' > > >fib 1 0 1x > 544383731135652813387342609937503801353891845546959670262477158412... > >timespacex 'fib 10000 0 1x&#

Re: [Jprogramming] Announcement: Graphical sentence debugger for J

2014-08-08 Thread Thomas Costigliola
I am having a problem using this... JVERSION Engine: j701/2012-12-06/12:20/x Library: 8.02.11 Qt IDE: 1.1.5/5.3.1 Platform: Win 64 Installer: J802 install InstallPath: c:/program files/j64-802 load'debug/dissect' dissect '1+1' |domain error: calcallestheights__resultroot | nloc ([:v(

Re: [Jprogramming] finding matching sets

2014-07-25 Thread Thomas Costigliola
Sorry, I hit send too early. My complete answer is: t=. ;: ;._2 ( 0 : 0 ) c1 p1 0.25 c1 p2 0.35 c2 p1 0.25 c2 p2 0.35 c3 p1 0.25 c3 p2 0.35 c3 p3 0.45 c4 p1 0.25 ) ]key=. (}."1 wrote: > You could key the first column on the values. > > (}."1 On Jul 25, 2014 7:07 AM, "Joe Bogner" wr

Re: [Jprogramming] finding matching sets

2014-07-25 Thread Thomas Costigliola
You could key the first column on the values. (}."1 wrote: > Given the following data: > > t =: ;: ;._2 (0 : 0) > c1 p1 0.25 > c1 p2 0.35 > c2 p1 0.25 > c2 p2 0.35 > c3 p1 0.25 > c3 p2 0.35 > c3 p3 0.45 > ) > > > c1 has two rows (p1 0.25) and (p2 0.35) > c2 has two rows (p1 0.25) and (p2 0.35) >

Re: [Jprogramming] Error executing Rossetta Code for Turing Machine in J802

2014-07-18 Thread Thomas Costigliola
Yuvaraj, make sure the definition of noun is being overwritten with the one given in the Turing machine definition. Type noun in your session, you should get this: noun ".@('(0 : 0)'"_) On Fri, Jul 18, 2014 at 1:26 PM, Thomas Costigliola wrote: > 'noun&#

Re: [Jprogramming] Error executing Rossetta Code for Turing Machine in J802

2014-07-18 Thread Thomas Costigliola
'noun' and 'utm' are defined in the script given. On Fri, Jul 18, 2014 at 12:34 PM, Raul Miller wrote: > What is your definition of "noun"? > > Here's what I get in a fresh j802 session: > >noun _ > |syntax error > > Thanks, > > -- > Raul > > > On Fri, Jul 18, 2014 at 1:19 AM, Yuvaraj Athu

Re: [Jprogramming] Calling j.dll from python

2014-07-18 Thread Thomas Costigliola
Bill, Jon, sorry if that suggestion did not apply. I remembered it was a common pitfall when calling from C. Maybe that is not the case now. On Fri, Jul 18, 2014 at 10:29 AM, Jon Hough wrote: > My previous email was regarding Windows (7 with J801) > I just tried to do the same in Ubuntu (J801)

Re: [Jprogramming] Calling j.dll from python

2014-07-18 Thread Thomas Costigliola
Hi, Jon, are you calling JInit first? You have to make sure you call that before JDo. On Fri, Jul 18, 2014 at 6:00 AM, Jon Hough wrote: > I am trying to call jdll.JDo from python but I get the error message, > access violation. > > Here is my python. > > Cdll.LoadLibrary(path to j.dll) > J =CDL

Re: [Jprogramming] J source code

2014-04-01 Thread Thomas Costigliola
>From the J701b source package: F1(jtversq){ASSERTMTV(w); R cstr("j701/2011-02-23/15:25");} >From the latest install of J8 downloaded from the website today: 9!:14'' j701/2011-01-10/11:25 Looks like the source package is ahead of the current binary by over a month :) On Tue, Apr 1, 2014 at

Re: [Jprogramming] J as an interviewing tool

2014-03-27 Thread Thomas Costigliola
(*/@{/~<@<@<"0@i.@#) 4 3 2 8 48 64 96 24 On Thu, Mar 27, 2014 at 4:10 PM, Dan Bron wrote: > Oh, I like this game! > >(*/ % ]) 4 3 2 8 > 48 64 96 24 > >(*/@#~1-=@i.) 4 3 2 8 > 48 64 96 24 > > -Dan > > - Original Message --- > > Subject

Re: [Jprogramming] J on Kindle Paperwhite?

2014-03-19 Thread Thomas Costigliola
n them with the > > Kindle plugged into my Windows machine. > > > > > > On Wed, Mar 19, 2014 at 11:37 AM, Thomas Costigliola > >wrote: > > > > > Devon, my first steps would be to ssh into a terminal. Have you done > that > > > yet? > > > > &g

Re: [Jprogramming] J on Kindle Paperwhite?

2014-03-19 Thread Thomas Costigliola
Devon, my first steps would be to ssh into a terminal. Have you done that yet? On Wed, Mar 19, 2014 at 11:24 AM, Devon McCormick wrote: > The kindle fire is Android; the Paperwhite is Linux. I've gotten as far as > jailbreaking it but have little idea what to do next. It seems most people > ju

Re: [Jprogramming] J Extensions

2014-03-18 Thread Thomas Costigliola
The (a v) train was an idea from Viktor Cerovski that I believe was mainly motivated by the desire for a tacit "dynamic rank". See http://www.jsoftware.com/pipermail/programming/2010-November/021108.htmlfor the discussion. Pascal is correct, the parsing rules can get "unintuitive" although the rul

Re: [Jprogramming] J Extensions

2014-03-17 Thread Thomas Costigliola
The only thing I can think of is monad=: $: dyad =: $: ambi =: $: Any other ideas? On Mon, Mar 17, 2014 at 2:22 PM, Thomas Costigliola wrote: > Perhaps > >s=. $: >ss=. $: 103!:0 > >>:@s f. > >:@($: (103!:0)) > >>:@ss f. > >:@($:

Re: [Jprogramming] J Extensions

2014-03-17 Thread Thomas Costigliola
y just telling ourselves that the feature is turned on. On Mon, Mar 17, 2014 at 1:33 PM, Thomas Costigliola wrote: > They will fail and should actually be removed instead of commented out. > Those tests were just checking that verbs containing $: that are fixed are > being properly wrappe

Re: [Jprogramming] J Extensions

2014-03-17 Thread Thomas Costigliola
eq (dyad >: ) > (s/ ) eq (dyad / ) > (s/. ) eq (monad/.) > (s\ ) eq (monad\ ) > (s\. ) eq (monad\.) > > ( s`!`+@.] ) eq ( ambi `!`+@.] ) > ( ^`!`+@.s ) eq ( ^ `!`+@.ambi ) >

Re: [Jprogramming] J Extensions

2014-03-17 Thread Thomas Costigliola
Raul, are you referring to the fact that it says "UNTESTED" next to the downloads? They should pass the standard test suite. If I have time I will try to confirm that. If anyone else can confirm, that would be nice too. That was put there more for an extra disclaimer so that when your computer exp

Re: [Jprogramming] a good bar bet!

2014-03-05 Thread Thomas Costigliola
On Mar 5, 2014 6:09 PM, "Roger Hui" wrote: > > > It begs the question why the bounds check is inside the loop. > > Can't you check against shape? > > There is no alternative. In g{x where g is a vector and ** it doesn't know > that g is the grade of x **, it has to check every element of g for in

Re: [Jprogramming] a good bar bet!

2014-03-05 Thread Thomas Costigliola
My lazy answer is: You can do some bit twiddling to remove the comparison. On Wed, Mar 5, 2014 at 5:26 PM, Roger Hui wrote: > > min=-32768; > > for(i=0;i*x)min=*x; ++x;} > > Typo: I mean min=32767;, of course. > > > > > On Wed, Mar 5, 2014 at 2:19 PM, Roger Hui > wrote: > > > Good answers.

Re: [Jprogramming] a good bar bet!

2014-03-05 Thread Thomas Costigliola
I twiddle my thumbs a bit while waiting for someone to post the code :-) On Wed, Mar 5, 2014 at 5:29 PM, Roger Hui wrote: > Please explain the technical term "twiddling". :-) > > > > On Wed, Mar 5, 2014 at 2:28 PM, Thomas Costigliola >wrote: > > > M

Re: [Jprogramming] a good bar bet!

2014-03-05 Thread Thomas Costigliola
Is /:~ on characters using a radix sort? Even so, both sort and from I would think is O(N). What is all the overhead in from? On Wed, Mar 5, 2014 at 4:45 PM, Raul Miller wrote: > The rascal! > > -- > Raul > > > On Wed, Mar 5, 2014 at 4:38 PM, Joe Bogner wrote: > > > hey hey - I posted my first

Re: [Jprogramming] Tacit recursion without $:

2014-02-24 Thread Thomas Costigliola
Dan, If someone can provide me with a clean compiling 64 bit windows GPL source package, I would be happy to apply the patches and host the binary at http://www.2bestsystems.com/foundation/j/ On Mon, Feb 24, 2014 at 1:23 PM, Dan Bron wrote: > This is tailor-made Dan-bait. I need some time to

Re: [Jprogramming] a: is not <$0

2014-02-19 Thread Thomas Costigliola
Very interesting Henry. This seems to be a coincidental side effect of the fact that the integer flag for booleans is less than the flag for literals as specified here: http://www.jsoftware.com/docs/help701/dictionary/dx003.htm Now, I wonder if forcing the boolean to stay numeric would wreak havoc

Re: [Jprogramming] On benchmarking results from J programming styles

2014-01-15 Thread Thomas Costigliola
GCC 4.8 results posted to source forum: http://www.jsoftware.com/pipermail/source/2014-January/000527.html On Wed, Jan 15, 2014 at 8:49 AM, Thomas Costigliola wrote: > Also, I'm pretty sure I tried with all optimizations turned off. > > > On Wed, Jan 15, 2014 at 8:45 AM, T

Re: [Jprogramming] On benchmarking results from J programming styles

2014-01-15 Thread Thomas Costigliola
Also, I'm pretty sure I tried with all optimizations turned off. On Wed, Jan 15, 2014 at 8:45 AM, Thomas Costigliola wrote: > Off the top of my head g000i.ijs is one. There are others, when I get some > time I will retry with your suggestion and post the results. > > > On We

Re: [Jprogramming] On benchmarking results from J programming styles

2014-01-15 Thread Thomas Costigliola
on that may break ar.c, you may try disable it with a > CFLAG switch. > > 15.01.2014, в 20:38, Thomas Costigliola написал(а): > > > Hi Bill, did you run the test suite after compiling? I have been having > > problems with gcc 4.8. I haven't been able to get a passing l

Re: [Jprogramming] On benchmarking results from J programming styles

2014-01-15 Thread Thomas Costigliola
Hi Bill, did you run the test suite after compiling? I have been having problems with gcc 4.8. I haven't been able to get a passing libj, I have tried a few distros' gcc with different optimizations. It seems to always be overoptimizing some things. Gcc 4.7 doesn't have the issue. On Jan 14, 2014

Re: [Jprogramming] Data from kaggle competition: packing Santa's sleigh

2013-12-11 Thread Thomas Costigliola
Don, that will still count duplicate values of b not in a, the count will just be off by one. You can just ignore those afterwards though: count1=. (#@[ {. <:@#/.~@,) Or you can filter before counting: count2=. ([:<:[:#/.~,#~[e.~,) ts=: 6!:2,7!:2@] NB. time & space a=: >: i.10 b=: ?100

[Jprogramming] Ragged Multiplot with Grouped Axis

2013-10-25 Thread Thomas Costigliola
This works pd'reset' pd'multi 2 3' pd'ygroup 0' pd a:,.6 1$<;~i.10 pd'show' but if there are not enough plots to fill the grid there is an error when trying to group the axes. pd'reset' pd'multi 2 3' pd'ygroup 0' pd a:,.5 1$<;~i.10 pd'show' |index error: getxgroup | dat=.(getxgroup1 ind{

Re: [Jprogramming] datetime utc and portability

2013-10-22 Thread Thomas Costigliola
The timestamp function for unix is jtts defined in xt.c. It uses the linux function called localtime. The localtime man 3 page also describes gmtime (for UTC) and mktime (for handling DST). I am not sure of the correct equivalents for mac though. On Sun, Oct 20, 2013 at 12:53 PM, Pascal Jasmin w

Re: [Jprogramming] deoptim package

2013-10-16 Thread Thomas Costigliola
n. > > Alternatively if you felt so inclined you could look at adding similar > bounds checking to the main DE loop as occurs in the initial population > generation. If the performance if fine then we could update the addon. > > > > > On Fri, Oct 11, 2013 at 7:37 AM, Tho

[Jprogramming] deoptim package

2013-10-10 Thread Thomas Costigliola
When using deoptim I am getting solutions outside of the bounds I am providing. >From looking at the code it looks like new populations are generated within the bounds but the evolution step doesn't ensure the boundary conditions. Is that the intended behavior?

Re: [Jprogramming] Applyintree question

2013-08-29 Thread Thomas Costigliola
I myself was wondering about this dyadic hook (,~ >.) in the dyadic case when calculating the rank for the recursive call. I'm not sure why ceiling is necessary here or perhaps it is a typo and max was meant? On Thu, Aug 29, 2013 at 4:55 PM, Jose Mario Quintana < jose.mario.quint...@gmail.com> w

Re: [Jprogramming] A puzzle

2013-06-10 Thread Thomas Costigliola
Yes, I meant, as in the original problem stated by Henry, v to have no side effects. I am thinking I have a reason it is not impossible but I should double check my logic before posting for once. On Mon, Jun 10, 2013 at 3:11 PM, Raul Miller wrote: > On Mon, Jun 10, 2013 at 2:12 PM, Tho

Re: [Jprogramming] A puzzle

2013-06-10 Thread Thomas Costigliola
necessarily have to be i.2 3. Obviously, as I messed up earlier, v and ]&v have to be called monadically or you would not expect them to be the same. Note that a monadic version of ]@v should be equivalent. On Mon, Jun 10, 2013 at 1:48 PM, Thomas Costigliola wrote: > Gosh, sorry for all the noise o

Re: [Jprogramming] A puzzle

2013-06-10 Thread Thomas Costigliola
Gosh, sorry for all the noise on this thread. The previous example was not what it was meant to be. On Mon, Jun 10, 2013 at 1:44 PM, Thomas Costigliola wrote: > Sorry, the last message was incomplete... > >1 2 v 1 2 ,: 3 4 > 2 3 > 3 4 > > 4 5 > 5 6 >1 2

Re: [Jprogramming] A puzzle

2013-06-10 Thread Thomas Costigliola
There are other follies to be had... On Sat, Jun 8, 2013 at 1:03 PM, Jose Mario Quintana < jose.mario.quint...@gmail.com> wrote: > On Fri, Jun 7, 2013 at 8:58 PM, Thomas Costigliola >wrote: > By the way, is there a convention on this forum for hiding spoilers in > posts?

Re: [Jprogramming] A puzzle

2013-06-10 Thread Thomas Costigliola
Sorry, the last message was incomplete... 1 2 v 1 2 ,: 3 4 2 3 3 4 4 5 5 6 1 2 ]&v 1 2 ,: 3 4 1 2 3 4 On Mon, Jun 10, 2013 at 1:43 PM, Thomas Costigliola wrote: > There are other follies to be had... > > > On Sat, Jun 8, 2013 at 1:03 PM, Jose Mario Quintana <

Re: [Jprogramming] A puzzle

2013-06-07 Thread Thomas Costigliola
By the way, is there a convention on this forum for hiding spoilers in posts? On Fri, Jun 7, 2013 at 8:55 PM, Thomas Costigliola wrote: > Got it now. But I still need some rest to really understand it. > > Here is more weirdness: > >1 2 ]@v 1 2 3 > 2 3 > 3 4 > 4 5 &g

Re: [Jprogramming] A puzzle

2013-06-07 Thread Thomas Costigliola
Got it now. But I still need some rest to really understand it. Here is more weirdness: 1 2 ]@v 1 2 3 2 3 3 4 4 5 1 2 v 1 2 3 |length error: v | 1 2 v 1 2 3 On Fri, Jun 7, 2013 at 6:52 PM, Henry Rich wrote: > yes. > > It's not a special-code trick. v is a verb. ] could be any

Re: [Jprogramming] A puzzle

2013-06-07 Thread Thomas Costigliola
I better get some rest. On Fri, Jun 7, 2013 at 4:50 PM, Thomas Costigliola wrote: > Oops. That was wrong. > > > On Fri, Jun 7, 2013 at 4:50 PM, Thomas Costigliola wrote: > >> I would hardly think of ]@v and v as the same because of the resulting >> verb's r

Re: [Jprogramming] A puzzle

2013-06-07 Thread Thomas Costigliola
Oops. That was wrong. On Fri, Jun 7, 2013 at 4:50 PM, Thomas Costigliola wrote: > I would hardly think of ]@v and v as the same because of the resulting > verb's rank. It is subtle though. Anyw

Re: [Jprogramming] A puzzle

2013-06-07 Thread Thomas Costigliola
I would hardly think of ]@v and v as the same because of the resulting verb's rank. It is subtle though. Anyway, spoiler ]@(+"0 1) On Fri, Jun 7, 2013 at 4:39 PM, Henry Rich wrote: > 1 yes; 2 no; 3

Re: [Jprogramming] About J701 patches

2013-06-05 Thread Thomas Costigliola
Hi Aai, That is very peculiar. There is nothing in the patches that would speed up either of those two factorials. Can you tell us more information. What was the original and patched OS and cpu architecture? What was the compiler and flags used for the patched version? If you compile yourself wi

Re: [Jprogramming] rosettacode

2013-05-16 Thread Thomas Costigliola
gine, I > think, how differences can arise in such a thing as special code > recognition and thence in performance. > > > > > On Thu, May 16, 2013 at 6:02 AM, Thomas Costigliola >wrote: > > > On Tue, May 14, 2013 at 2:49 PM, km wrote: > > > > >

Re: [Jprogramming] rosettacode

2013-05-16 Thread Thomas Costigliola
On Tue, May 14, 2013 at 2:49 PM, km wrote: > Roger provides a motivation for capped fork in his Wiki essay Capped Fork: > > > http://www.jsoftware.com/jwiki/Essays/Capped%20Fork?highlight=%28completeness%29 > > He says, "When [: g h is interpreted as g@:h , it means that > "everything" can be ex

Re: [Jprogramming] key

2013-04-25 Thread Thomas Costigliola
In my experience I find that it is useful that the nub, self classify and key cell orderings are the same. On Thu, Apr 25, 2013 at 12:56 AM, Joey K Tuttle wrote: > I share this opinion (and the later caveats for use in APL... :) > > > On 2013/04/24 13:35 , Dan Bron wrote: > >> Occurrence in x.

Re: [Jprogramming] J to C/C++

2013-04-09 Thread Thomas Costigliola
You could try to approach it from the other side. If it is not too difficult to describe your function yourself in C, you could write a small piece of C code, run your AD algorithm on it and then call that C code from J. Calling C code and passing arrays between J and C from J is very easy using th

Re: [Jprogramming] J functional programming extensions

2013-03-09 Thread Thomas Costigliola
Not a problem, but most likely not until Monday. On Mar 9, 2013 11:07 AM, "Dan Bron" wrote: > Thank you! I don't want to ask too much, but is it possible to compile a > 64-bit version? > > -Dan > > Please excuse typos; composed on a handheld device. > &

Re: [Jprogramming] J functional programming extensions

2013-03-09 Thread Thomas Costigliola
For those interested in trying out the extensions there is now a 32 bit windows j.dll available. PLEASE NOTE that the original links have changed. The patches and binary can now be found at http://www.2bestsystems.com/foundation/j These are provided under the GPLv3, AS IS with NO WARRANTY. Use a

Re: [Jprogramming] Recursive programming (and scoping therein)

2013-02-21 Thread Thomas Costigliola
On Wed, Feb 20, 2013 at 5:27 PM, William Tanksley, Jr wrote: > Raul Miller wrote: > > How is treating the "purely functional" case as having an element of > > unreality the same as the idea that closures (in a stateful context) > > are purely functional? > > If your definitions have "an element

Re: [Jprogramming] sax addon problem

2013-02-15 Thread Thomas Costigliola
dcb 2) > SetCharacterDataHandler^:(-.IF64) PARSER;cdcb 3 NB. crash in linux64 > ) > > > > Date: Fri, 15 Feb 2013 10:27:22 -0500 > > From: Thomas Costigliola > > To: J Programming Forum > > Subject: [Jprogramming] sax addon problem > > Message-ID: > &g

Re: [Jprogramming] applying >1 gerunds to a set of items

2013-01-23 Thread Thomas Costigliola
to see, when you think you have a solution > :) > > How about this: > ><"0@|:@(+:`*:`%/.) 3 4 5 > +-+--+---+ > |6|16|0.2| > +-+--+---+ > > or if no boxing required: > >|:@(+:`*:`%/.) 3 4 5 > 6 16 0.2 > > I agree that it is not quite as clean a

Re: [Jprogramming] applying >1 gerunds to a set of items

2013-01-23 Thread Thomas Costigliola
uting a verb across a gerund except by hand. (+:e)`(*:e)`(%e)/. 1 2 3 ┌┐ │2 │ ├┤ │4 │ ├┤ │0.33│ └┘ Cheers, bob > > On 2013-01-23, at 12:51 PM, Thomas Costigliola wrote: > > > <@(+:`*:`%)/. 3 4 5 > > --

Re: [Jprogramming] applying >1 gerunds to a set of items

2013-01-23 Thread Thomas Costigliola
I use /. (Oblique-Key ) with a gerund for this since the obliques of rank 1 arrays are the items. wrote: > This sounds sensible, but if you tested your code, you should notice two > things: > > First, 3 :'x,y' gives a domain error or a value error (depending on > context). To fix this you have

Re: [Jprogramming] JHS meets MathJax

2012-11-25 Thread Thomas Costigliola
Hi John, I liked your article. I am interested in replacing some GTK based applications with browser based ones. I have no experience with web programming though so I am eagerly awaiting your next post. Just to get a head start though could you be kind enough to point us to some useful libraries a

[Jprogramming] J user directory

2012-09-08 Thread Thomas Costigliola
The default J installation makes a separate J user folder for 32 and 64 bits. Is there a technical reason for this? I use both bitsyness' for different reasons and would like to set the same user folder. Is it safe? -- For informat

Re: [Jprogramming] Determining an 'alternating' binary array

2012-07-31 Thread Thomas Costigliola
Here is a recursive solution, it stops processing when the alternating invariant becomes false. It is similar in principal to the sequential machine solution but uses $: to implement the machine. NB. assuming that the right list contains the first one, there are four cases NB. 0 0 -> true,