Re: [Jprogramming] strange difference between }. and {:

2013-10-01 Thread bob therriault
Hey Pascal, You may be looking for symmetry where there is none. The following shows these monadic verbs are acting as the dictionary suggests. $ > 2; < 2 4 $ i.8 2 2 4 > 2; < 2 4 $ i.8 2 0 0 0 0 0 0 0 0 1 2 3 4 5 6 7 >@}. 2; < 2 4 $ i.8 NB. }. drops first item of argument, resulting

Re: [Jprogramming] using socket on iOS

2013-09-24 Thread bob therriault
On my non jail broken 3gs I get 0;15 On the 3gs I am running iOS 5.1.1 :) Cheers, bob On 2013-09-23, at 11:25 PM, Joey K Tuttle wrote: > On my iPad2 (not jb) it works and returns 0;18 > > I get the same result in my not jb iPhone4, i.e. 0;18 > > Both are running iOS7 > > > On 2013/09/23 2

Re: [Jprogramming] JHS update

2013-09-23 Thread bob therriault
uld exceed one's grasp. :) Cheers, bob On 2013-09-23, at 6:10 PM, Eric Iverson wrote: > The release builds will always be out of date. You need to do a JAL > update to get the latest. Does this explain things, or am I missing > your point. > > On Mon, Sep 23, 2013 at 8:57 PM,

Re: [Jprogramming] JHS update

2013-09-23 Thread bob therriault
Hey Eric Old version of J32 701a for Mac Intel (Jan 3, 2011) still seems to be loading from the Download site on Jsoftware for both Safari and Chrome. Is it just me? Have you successfully downloaded from that link? I tried J801 as well but it seemed to be only from June, 2013. Cheers, bob On

Re: [Jprogramming] smoutput gotcha

2013-09-16 Thread bob therriault
Thanks for that Raul, It made me reconsider the effects that smoutput has when dropped into a J sentence. It is not quite inert. :) smoutput ┌───┬─┬──┐ │0 0│$│┌┬─┬─┐│ │ │ ││┌─┬──┬─┐│&│2││ │ │ │││1│!:│2││ │ ││ │ │ ││└─┴──┴─┘│ │ ││ │ │ │└┴─┴─┘│ └───┴─┴───

Re: [Jprogramming] pattern matching in J

2013-09-13 Thread bob therriault
is the language for computing in science in > general). i love them both and am definitely not trying to pit one against > the other. > > > On Fri, Sep 13, 2013 at 1:14 PM, bob therriault wrote: > >> Hi Richard, >> >> When I read through the background o

Re: [Jprogramming] pattern matching in J

2013-09-13 Thread bob therriault
Hi Richard, When I read through the background of the link, I found that a comparison with J was done and the programmer, Jon McLoone, posted the results as a response to a comment: " I quickly ran the code on J and got ratios of lines:0.5, characters: 0.74, tokens:0.5, over 432 comparisons i.

Re: [Jprogramming] Joining up a rank-1 array of integers

2013-09-08 Thread bob therriault
Well Dan usually comes up with the really insightful answers, but what I see happening is that & is forcing the ' ' as the right argument. When you supply your right argument it moves to the left side of -. and then the ' ' (empty spaces) are removed. Hope this helps, bob On 2013-09-08, at 7:

Re: [Jprogramming] Joining up a rank-1 array of integers

2013-09-08 Thread bob therriault
On second thought this would work for single integers into a number, but if you wanted to stay with a string, Dan's solution is the better way to go. Cheers, bob On 2013-09-08, at 7:15 PM, bob therriault wrote: > Hi Alex, > > For base 10 this might work. > > t=: 3 4 5

Re: [Jprogramming] Joining up a rank-1 array of integers

2013-09-08 Thread bob therriault
Hi Alex, For base 10 this might work. t=: 3 4 5 6 10 #. t 3456 Cheers, bob On 2013-09-08, at 7:07 PM, Alex Giannakopoulos wrote: > Hi - I need to join up a list of integers (presented as a rank-1 array) > into a single number. > > At the moment I am using the following, > > ;@ cut &. "

Re: [Jprogramming] verb that reads from mathematical notation?

2013-08-01 Thread bob therriault
d I don't want to > have to read huge expressions just to parenthesise them correctly. > > > On Thu, Aug 1, 2013 at 7:31 PM, bob therriault wrote: > >> Hi Eelvex, >> >> I think that the monadic primitive Do (".) may be the answer, although you >> w

Re: [Jprogramming] verb that reads from mathematical notation?

2013-08-01 Thread bob therriault
Hi Eelvex, I think that the monadic primitive Do (".) may be the answer, although you would need to use parenthesis to get the order of execution that you would like. a=.2 b=.3 ".'a*b+b*a' 18 ".'(a*b)+b*a' 12 Cheers, bob On 2013-08-01, at 9:22 AM, EelVex wrote: > Is there a verb i

Re: [Jprogramming] Code golf: approximate pi

2013-07-23 Thread bob therriault
I'm almost embarrassed to suggest this to such an elegant solution, but we can get down to 42 if can leave it in boxed form. c=:({&' *';2*+/@,%#*#)@:>_2{.\|@j./~@i:@<: c 8 ┌───┬─┐ │***│3.125│ │ * │ │ │***│ │ │***│

Re: [Jprogramming] Tie entry on J iOS ?

2013-06-26 Thread bob therriault
It's actually pretty easy, although like most touch gui's not as obvious as you might like. Hold your finger on the quote key (') and a range of similar options shows up. On my phone the left most is ` Cheers, bob On 2013-06-26, at 8:49 AM, Eric Iverson wrote: > I can't find ` on the iPhone o

Re: [Jprogramming] plot for parametric surfaces?

2013-06-05 Thread bob therriault
Hi Raul, It looks to me as if the wiki version is providing an array of shape 100 100 and it is plotting the z values for each position (x,y) within the array. You would just need to pick your parameter so that it corresponds to integer positions that would map on to the array and then insert t

Re: [Jprogramming] Request for a tool: noun explorer

2013-06-05 Thread bob therriault
(< 5;6);(<4;<7;8); 2 2$ 8;9 > 4 ; (< 5;6);(<4;(<7;8)); 2 2$ 8;9 > 3; 4 ; (< 5;6);(<4;(<7;8)); 2 2$ 8;9 > 2 3 2 $ 3; 4 ; (< 5;6);(<4;(<7;8)); 2 2$ 8;9 > > Linda > > -Original Message- > From: programming-boun...@forums.jsoftware.

Re: [Jprogramming] Request for a tool: noun explorer

2013-06-04 Thread bob therriault
Hi Henry, I have spent a fair amount of time thinking about how to represent multidimensional arrays visually. It is a bit tricky especially when it comes to 0's within the shape. I think that I have worked out most of that here: http://bobtherriault.wordpress.com/2012/03/30/augmented-view-of-a

Re: [Jprogramming] Nested looping for a newbie in J

2013-05-24 Thread bob therriault
Hi Rob, As a hint, I would think about creating all the triples in an array and then count the rows. I think (but have not jumped in to do a solution) that J has some tools that allow you to create the rows without needing loops. Hope this helps. Cheers, bob On 2013-05-24, at 9:28 AM, Robert

Re: [Jprogramming] J on Julia benchmark

2013-05-07 Thread bob therriault
Hmm, not sure why this is so difficult, but it may be a matter of terminology more than numeracy. To convert one unit to another you multiply by a conversion factor which is a ratio of the two measurements. As an additional benefit you can treat the units of measurement as factors and cancel th

Re: [Jprogramming] J and APL symbols

2013-04-10 Thread bob therriault
Hi everyone, The 2D view of the language was something that I played around with a few years ago. Here is a blog post that includes a screencast attempting to explain the '~" adverb that also incorporated that view. The visual representation is predominant in the second half of the video. Thin

Re: [Jprogramming] Obtaining the file path of an ijs file

2013-04-04 Thread bob therriault
Nice to have the new voices on the message board. :) I usually use erase [: 4!:55 ;: ::] The argument is the name of the variable that you want to erase and the response is 1 for each variable erased. t=: 'test' r= "gone" erase 't r' 1 1 t |value error: t cheers, bob On 2013-04-

Re: [Jprogramming] Querying Home from an app

2013-04-04 Thread bob therriault
Hey Ian, I am way over my head on this, but within J, I think that you may want to take a look at jpath_j_ and SYSTEMFOLDERS_j_ It looks to me as if SYSTEMFOLDERS, USERFOLDERS is set during the boot.ijs process. Perhaps you can override the default with a startup script? In J602 you can change

Re: [Jprogramming] Newbie-halfway 1st language.

2013-04-02 Thread bob therriault
Hi Frank and welcome, If you are working with J 602 try out the studio>demo menus. There are many examples done with the gl2 commands. This approach looks as if it will be picked up again in the qt version of J 801 (but I have not yet started playing with that). Between those two versions was J

Re: [Jprogramming] Hermitian from triangular

2013-03-03 Thread bob therriault
Comparison Tolerance? From Henry Rich's J for C Programmers - http://www.jsoftware.com/help/jforc/odds_and_ends.htm#_Toc191734562 Cheers, bob On 2013-03-03, at 1:37 PM, Linda Alvord wrote: > Match worked already so your expression worked, too. > > ((f 3 4)-:g 3 4) > 1 > > A-:*&.+.B >

Re: [Jprogramming] Ike and Mike

2013-02-25 Thread bob therriault
(2 i.~ >: % <:) i. 10 3 cheers, bob On 2013-02-25, at 9:34 AM, km wrote: > Here is a two-minute puzzle. Ike and Mike have the same number of pennies, > but if Ike gives Mike one penny, Mike will have twice as many as Ike. How > many pennies does each have? > > When I was learning algebr

Re: [Jprogramming] inverse oblique

2013-02-02 Thread bob therriault
If it were written it might be written as a series of guidelines rather than specific rules. As an example, I would suggest that a guideline from the original Elements of Style by Strunk, fits J even closer than English. Vigorous writing is concise. A sentence should contain no unnecessary wor

Re: [Jprogramming] How best to Port MatLab structure to J

2013-02-01 Thread bob therriault
Dave, Have you looked at the Locales lab under the Studio menu? It gives a pretty good overview of the conceptual aspects of this language feature. It also takes it a step further with an Object Oriented Programming lab, but I think that the first one will give you some concepts. Hope this hel

Re: [Jprogramming] (u:232)=: 0

2013-01-24 Thread bob therriault
(u:232)=: 0 |ill-formed name: � | (u:232)=:0 9!:14 '' j701/2011-01-10/11:25 NB. JHS and same result in j602/2008-03-03/16:45 on a Mac running OSX 10.7.5 Cheers, bob On 2013-01-24, at 1:40 PM, Raul Miller wrote: > Interesting. > > I'm on a mac at the moment. > > -- > Raul > > O

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

2013-01-23 Thread bob therriault
ers, bob On 2013-01-23, at 1:29 PM, Thomas Costigliola wrote: > On Wed, Jan 23, 2013 at 4:05 PM, bob therriault wrote: > >> Nice Thomas, >> >> I had not thought of oblique. >> >> You can still do this, although it is clunkier: >> >>

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

2013-01-23 Thread bob therriault
Nice Thomas, I had not thought of oblique. You can still do this, although it is clunkier: <@(+:`*:`%/.) 3 4 5 +---+ | 6| | 16| |0.2| +---+ <@(+:`*:`%/."0) 3 4 5 +-+-+--+ |6|8|10| +-+-+--+ or better, +:`*:`%/. each 3 4 5 NB. each is &.> +-+-+--+ |6|8|10| +-+-+--+ Cheers, bob On 201

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

2013-01-23 Thread bob therriault
Do you mean matching the gerunds to the corresponding items? My initial take would be to apply m `:0 to atoms using rank "0 and then take the diagonal of the result. (<0 1)&|:@:(+`*`|`:0"0) 2 3 4 2 1 4 Cheers, bob On 2013-01-23, at 9:29 AM, R.E. Boss wrote: > In

Re: [Jprogramming] [Jprogrammingou Hermitian from triangular

2013-01-21 Thread bob therriault
nk 0, so each item in the list is processed separately. Hope this helps (and I also hope that I have this right :) ) Cheers, bob On 2013-01-21, at 10:32 PM, bob therriault wrote: > Hi LInda, > > Looks like your second expression is a fork and unless you change the rank it > woul

Re: [Jprogramming] [Jprogrammingou Hermitian from triangular

2013-01-21 Thread bob therriault
Hi LInda, Looks like your second expression is a fork and unless you change the rank it would have infinite rank by default. 1j2 0j2 would be unboxed and then applied to ic-:ic2 which is also a fork and would also have infinite rank. Cheers, bob On 2013-01-21, at 10:28 PM, Linda Alvord wrote:

Re: [Jprogramming] Hermitian from triangular

2013-01-17 Thread bob therriault
Last tweak (I promise) Because the rank of | is 0 0 0 we don't need to specify the rank in the definition of la. la =: [`]@.(<&|) (la +@|:) A 1 2j3 2j_3 4 Though we do need the parenthesis to separate < from the @. conjunction. Cheers, bob On 2013-01-17, at 12:29 PM,

Re: [Jprogramming] Hermitian from triangular

2013-01-17 Thread bob therriault
Hi Kip, Just a rephrasing of lav (cherubic rather than angelic?) la =: [`]@.(<&|)"0 (la +@|:) A 1 2j3 2j_3 4 Cheers, bob On 2013-01-17, at 12:03 PM, km wrote: > lav =: [`]@.(|@[ < |@])"0 NB. larger absolute value --

Re: [Jprogramming] Programming Literacy - gaps

2013-01-14 Thread bob therriault
Hmm, my thoughts follow... On 2013-01-14, at 1:32 PM, Raul Miller wrote: > For example, instead of having just an x axis (at "0 degrees") and a y > axis (at "90 degrees") we could have the y axis at 45 degrees and a z > axis at 90 degrees. Actually that seems to be close to what we do when we pr

Re: [Jprogramming] Programming Literacy - gaps

2013-01-14 Thread bob therriault
Hi Raul, Yeah, I wondered about that, which is why I put orthogonal in quotes. So what did you mean by an non-orthogonal presentation? I am intrigued. Cheers, bob On 2013-01-14, at 10:28 AM, Raul Miller wrote: >>> We can use a non-othogonal presentation of dimensions. >>> >> I think that thi

Re: [Jprogramming] Programming Literacy - gaps

2013-01-14 Thread bob therriault
Thanks for the reply Raul, I will respond point by point based on my experience. On 2013-01-13, at 9:16 AM, Raul Miller wrote: > I would represent 0 dimensional arrays by including a grid (or an > axis) for each dimension, showing which dimensions you are using. > Yep that is pretty much a given

Re: [Jprogramming] Programming Literacy - gaps

2013-01-13 Thread bob therriault
Hi Raul, I spent some time exploring the visual representation of different arrays last year and found it quite challenging. Especially when trying to create visual distinctions between empty arrays of different shapes. Also, a challenge is how to represent higher dimension arrays in ways that

Re: [Jprogramming] Programming Literacy - gaps

2013-01-13 Thread bob therriault
Just to add some grist to the mill, I wonder if Bret Victor's demo is not so much about visual programming but more about responsive programming. When he manipulates the java script code and the graphics on the other side of the page change he is not working visually, he is working textually an

Re: [Jprogramming] Is there a standard graphics library for J7?

2012-12-31 Thread bob therriault
Kip, The iPad version runs on the iPhone down to the 3GS level (although a little slower than on the iPad). Henry, Once you have a server running the J engine, JHS just requires a modern browser and JavaScript to be available. The graphics available for interfaces or other displays are whate

Re: [Jprogramming] Announcing: dissect, the 2-D J sentence analyzer; and request for a collaborator

2012-12-30 Thread bob therriault
t; b >>>> f=: 13 :'x&(+./@E.)&>y' >>>> f >>>> 'is a' f b >>>> 'not a' f b >>>> g=: 13 :'+./"1 x E."1 > y' >>>> g >>>> 'is a' g b >>>&

Re: [Jprogramming] Announcing: dissect, the 2-D J sentence analyzer; and request for a collaborator

2012-12-29 Thread bob therriault
Hi Henry, It fails in JHS on a Mac but I am guessing that you were referring to J 7 in GTK. Very impressive that you were able to move it into GTK so quickly. 9!:14 '' j701/2011-01-10/11:25 ds '20 5 0(*`%/"2@(,: (%:@* -.))@((,: , 1"1) % +/@[))10' |value error: wd | wd DISSECT Ch

Re: [Jprogramming] Announcing: dissect, the 2-D J sentence analyzer; and request for a collaborator

2012-12-28 Thread bob therriault
Hey Henry, I agree that the representation of J sentences could make a big difference to beginner understanding. I have been playing around with some of the 'boxes and arrows' for a while and would be interested in helping out. I posted some videos two years ago that show the direction that I w

Re: [Jprogramming] Residue without 0 remainder

2012-12-24 Thread bob therriault
I think you taught me this approach in chapter 16 of JforC Programmers, Henry :) modPlus=: |+[*0=| 12 modPlus 9 + i. 7 9 10 11 12 1 2 3 Cheers, bob On 2012-12-24, at 12:54 PM, Henry Rich wrote: > I don't get what your 'offset' field is, but |&.<: might be useful: > > 12 | 9+i. 7 > 9

Re: [Jprogramming] A Tree Question

2012-12-21 Thread bob therriault
Hi LInda, Since forks result in verbs of infinite rank (unless changed by the rank conjunction), #@# is not actually equivalent to ([:##), although #@:# is. Watch what happens when I swap @: for @ g=: 13 :'(=x) #@# y' a=:0 0 1 0 1 5 b=:0 1 1 3 2 3 a g b 3 2 1 g1=:13 :'(=x) #@:#

Re: [Jprogramming] Deduction, Induction, and Prediction.

2012-12-21 Thread bob therriault
Hi Bo, (,: , 1"1) is a fork in the (V V V) form and both 1"1 and 1: make the noun 1 into a constant verb with the same result and so are interchangeable. t=: 1"1 s=: 1: r=: 1 4!:0 <'t' 3 4!:0 <'s' 3 4!:0 <'r' 0 The other alternative would be to turn this into a (N V V) fork b

Re: [Jprogramming] access camera on handheld devices

2012-12-19 Thread bob therriault
none } div[name='),each CATCLASS ,each(<'] .on {width:70%; display:inline } div[name=core] {width:70%; display:inline-block }') PARASTYLE=:'p { display:none; }' CSS=:' ',CATSTYLE,GROUPSTYLE,BUTTONSTYLE,PARASTYLE,' ' CATBUTTONS=: ;('',,&'&#x

Re: [Jprogramming] Hugs and Kisses

2012-12-19 Thread bob therriault
ing of '()X' of a certain length and I was letting the original shape get in the way. Cheers, bob On 2012-12-18, at 11:22 PM, bob therriault wrote: > Hi Linda, > > Using your definitions for Hugs and Kisses I came up with this. > > HANDK =: 3 : 0 > h=.

Re: [Jprogramming] Hugs and Kisses

2012-12-18 Thread bob therriault
Hi Linda, Using your definitions for Hugs and Kisses I came up with this. HANDK =: 3 : 0 h=. ('()'$~}:,2*{:) y k=. y $ 'X' h ,@((_2]\,@[),.|:@,@]) k ) HANDK 2 2 3 ()X()X()X()X()X()X()X()X()X()X()X()X Cheers, bob On 2012-12-18, at 7:48 PM, Linda Alvord wrote: > H=: 13 :'((}:y),2*{:y)

Re: [Jprogramming] access camera on handheld devices

2012-12-14 Thread bob therriault
Hi Brian, When you click on the category buttons, the different lab buttons associated with the category should appear, and when you click on the lab button, an alert should pop up that tells you what number should be used as an argument to jx. Eric replied in an earlier post in this thread, "

Re: [Jprogramming] access camera on handheld devices

2012-12-14 Thread bob therriault
Yep, Javascript works in view on iPad I have been playing around with a different way to view labs (but we still don't have a way to call J from hview yet, do we? :) ) Here is the script for what I have done so far. Apologies to anyone who actually knows how to code. :) cocurrent 'uxjlab' requ

Re: [Jprogramming] Promoting a vector to a matrix (changing rank)

2012-12-11 Thread bob therriault
Hi Alex, I think that the Itemize (,:) primitive is what you are looking for: r=. i.4 $ r 4 $ ,: r 1 4 Also works in higher dimensions r=. i.2 3 4 $ r 2 3 4 $ ,: r 1 2 3 4 Cheers, bob On 2012-12-11, at 9:20 AM, Alex Giannakopoulos wrote: > v2m =. ] $~ 1,$ --

Re: [Jprogramming] Just for fun, verb cross

2012-12-10 Thread bob therriault
2012-12-10, at 10:21 AM, Roger Hui wrote: > The expression fails if the argument has duplicate items. e.g. > > ((+.|.)@={"0 1 ' '&,.)'aabbb' > |length error > | ((+.|.)@={"0 1' '&,.)'aabbb' > > > >

Re: [Jprogramming] Just for fun, verb cross

2012-12-10 Thread bob therriault
That is lovely Arie, It is that kind of elegance that I was chasing with my rougher attempts. Using the (+.|.) hook simplifies (|.+.]) precisely and the {" 0 1 combined with ' '&,. means that the selection of the string becomes a choice in each row of displaying either the corresponding eleme

Re: [Jprogramming] Just for fun, verb cross

2012-12-09 Thread bob therriault
Second draft is a little cleaner since rank 1 reverse is not required as the matrix is still boolean at this point. t=: (>:@i.@# * (|.+.])@:=){' ',] t 'ab' aa bb t 'abcde' a a b b c d d e e Cheers, bob On 2012-12-09, at 8:01 PM, bob therr

Re: [Jprogramming] Just for fun, verb cross

2012-12-09 Thread bob therriault
First draft looks like this. (((>.|."1)@(*=)@:>:@i.@#){ ' ',])'abcde' a a b b c d d e e (((>.|."1)@(*=)@:>:@i.@#){ ' ',])'ab' aa bb One of the things that I like about J is the way it lets you build and test your ideas as you go. I look forward to more elegant solutions. Cheers,

Re: [Jprogramming] indirect assignment and rank question

2012-12-07 Thread bob therriault
Good question Linda, My preference, if you did not need to assign variables, would be to just use the N V V train and so the verb test becomes t=:((2 0 1|:])-:(0 1|:]))@:? and you could apply it to any noun you would like. t 3 2 4$5 1 The right inner brackets are not necessary, but I th

Re: [Jprogramming] Getting more than one value back from "From" or alternative approach

2012-12-03 Thread bob therriault
> 1j1&#"1 (e3 e."1 f)} (5 5$'.'),:'@' > . @ . . . > . @ @ . . > . @ . @ . > . @ . . . > . . . . @ > > > > > > On Tue, Dec 4, 2012 at 6:13 PM, bob therriault wrote: > >> Harvey, >> >> Is there a reason that you would not be able to add the spaces at the end >> using iji # ? >&

Re: [Jprogramming] Getting more than one value back from "From" or alternative approach

2012-12-03 Thread bob therriault
Harvey, Is there a reason that you would not be able to add the spaces at the end using iji # ? e3=. 12 13 14 15 16 11 2 3 4 17 10 1 0 5 18 9 8 7 6 19 24 23 22 21 20 e3 12 13 14 15 16 11 2 3 4 17 10 1 0 5 18 9 8 7 6 19 24 23 22 21 20 sqdata=. 'X@@.@..@@...@….' NB. Spaces remo

Re: [Jprogramming] @: and capped fork

2012-12-03 Thread bob therriault
make good sense. My only gripe > is that having been a Pascal programmer, and a Makefile writer, and a > Mathematica user, I often write noSpace:= causing spelling error that > gives me a devil of a time to spot. > >> From: bob therriault >> To: programm...@jso

Re: [Jprogramming] @: and capped fork

2012-12-03 Thread bob therriault
Alex, I think I would point them towards first the 'Locales" lab and then the "Object Oriented Programming" lab. I think that these two labs would give object oriented people lots of information about how J can be used as an object oriented language. Cheers, bob On 2012-12-03, at 11:29 AM, Al

Re: [Jprogramming] @: and capped fork

2012-12-01 Thread bob therriault
Hi Alex, Oleg, Ric, Bill, Brian, Don and I collaborated on this script 3 years ago. If it is of use to you feel free to use it. It runs on J602 and uses radio buttons to select the viewing style on a wd form. It was never picked up since it is generally quicker to just change the display as you

Re: [Jprogramming] Documentation in J REPL

2012-11-29 Thread bob therriault
Have you used either Find or Find in Files… under the Edit menu? If you want to use wild cards such as * this becomes a little more difficult since they could be a valid part of the string. Hope this helps. Cheers, bob On 2012-11-29, at 11:54 AM, Y-01 wrote: > New questions about documentatio

Re: [Jprogramming] @: and capped fork

2012-11-29 Thread bob therriault
Thinking it through, I guess that this example is really (v a) where v is +:@:+, and the a is / , although it might look like u is +: and v is + to my (untrained) human eye. Cheers, bob On 2012-11-29, at 9:00 AM, bob therriault wrote: > HI Ian, > > If your v includes an adverb such

Re: [Jprogramming] @: and capped fork

2012-11-29 Thread bob therriault
HI Ian, If your v includes an adverb such as / the long left reach of conjunctions could get you into trouble. That would be part of the parsing rules for verbs vs conjunctions. (+:@:+/) 3 4 5 42 ([:+:+/) 3 4 5 24 Cheers, bob On 2012-11-29, at 8:49 AM, Ian Clark wrote: > Department of Sud

Re: [Jprogramming] Documentation in J REPL

2012-11-28 Thread bob therriault
One way to solve the change mode issue to access help is to already be in a browser and you can do that by running JHS 701 (which itself runs in a browser). Demo 9 (I think) within JHS shows a multiwindow display that might be bent into a shape to accommodate your needs. That's all I got :) Ch

Re: [Jprogramming] Verb definition + inadvertent train formation.

2012-11-20 Thread bob therriault
: > I think you need to take more care in doing benchmarks. What I got just > now: > > 10 timer 'idMate1 9000' > 0.110233 > 10 timer 'idMatt1 9000' > 0.125659 > 10 timer 'idMatt2 9000' > 0.106581 > 10 timer 'idMatt3 9000'

Re: [Jprogramming] Verb definition + inadvertent train formation.

2012-11-20 Thread bob therriault
ter > idMat2=: ,~ $ >: {. 1: > > (10) 6!:2 'idMat0 &.> 36000 38000 4 42000 44000 46000 48000 5' > 21.7756 > (10) 6!:2 'idMat1 &.> 36000 38000 4 42000 44000 46000 48000 5' > 9.55495 > (10) 6!:2 'idMat2 &.>

Re: [Jprogramming] Verb definition + inadvertent train formation.

2012-11-20 Thread bob therriault
Devon, I like that, or another tacit option idMat1=: ,~ $ >: {. 1: idMat1 6 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 Cheers, bob On 2012-11-20, at 1:33 PM, Devon McCormick wrote: > I used to have a named verb "idMat" in my own utilities library that was > def

Re: [Jprogramming] Verb definition + inadvertent train formation.

2012-11-20 Thread bob therriault
t;> Since this will (of necessity) be within a loop and each time both >>>>> the list and matrix will be modified (except for size), I have come >>>>> to the conclusion that I should make a single unit matrix outside >>>>> the iteration and use this

Re: [Jprogramming] access camera on handheld devices

2012-11-19 Thread bob therriault
I think that this is most likely a question for Eric, In the iPad version of J is there a way to have an html event in hview trigger a J response? Say a button in hview that could trigger the start of a lab? Would this best be done through jevents such as hbutton does, or a javascript function

Re: [Jprogramming] Verb definition + inadvertent train formation.

2012-11-18 Thread bob therriault
Hi Don, Are you looking for y=:5 c=:(*=)&i. c y 0 0 0 0 0 0 1 0 0 0 0 0 2 0 0 0 0 0 3 0 0 0 0 0 4 Cheers, bob On 2012-11-18, at 7:13 PM, Don & Cathy Kelly wrote: > OOPs' I meant y=:i.5 5 > > Don > On 18/11/2012 7:04 PM, Don & Cathy Kelly wrote: >> That gives the diagonal nicely but the

Re: [Jprogramming] Verb definition + inadvertent train formation.

2012-11-15 Thread bob therriault
Hey Vijay, Nothing wrong with a novice question, especially when it is so clearly phrased. Take a look at these examples and see if this gives you some ideas. fact1=: */@:>:@:i. fact1 5 120 fact2=: [:*/>:@:i. fact2 5 120 fact3=: [:*/[:>:i. fact3 5 120 You want to have the verbs a

Re: [Jprogramming] danish blueberry porridge

2012-10-30 Thread bob therriault
ortant? > > If not then: > >ttt=:[: <;._2 ' ' ,~ ] > (ttt k)-:t k > 1 > > Linda > > -----Original Message- > From: programming-boun...@forums.jsoftware.com > [mailto:programming-boun...@forums.jsoftware.com] On Behalf Of bob therri

Re: [Jprogramming] danish blueberry porridge

2012-10-19 Thread bob therriault
What about using cut? (;.) k=.'blåbærgrød' k blåbærgrød t=: (a:-.~<;._2)@,&' ' NB. removing a: to clean up multiple spaces t k +-+ |blåbærgrød| +-+ k=.'blåbærgrød blåbærgrød' t k +-+-+ |blåbærgrød|blåbærgrød| +-+-

Re: [Jprogramming] addon format/zulu

2012-09-18 Thread bob therriault
argue for PREPARE *not* to be migrated to j701 in its present > form, and for the facility to be "detoxified" in j602. I don't say > "withdrawn", because that would break a lot of fine Labs. May I > suggest that a PREPARE-block *never* conceals its content from IJX

Re: [Jprogramming] addon format/zulu

2012-09-18 Thread bob therriault
Hey everybody, In J602 there was a markup Instruction used in labs called PREPARE that would bracket J commands to allow you to do things behind the scenes when running a lab file .ijt I wonder if this would be an option to have scripts load without having the learner aware of it. I think t

Re: [Jprogramming] keyboard question - missing backtick

2012-09-14 Thread bob therriault
Hi David, I am not sure how you reconfigure the apple keyboard, but there is another workaround. Go back to the numeric keypad in '123' mode and touch and hold the quote key. After about a second other options of the quote will appear, one of which is the back tick, just slide your finger alo

Re: [Jprogramming] path variable in loop

2012-09-11 Thread bob therriault
Hi Pascha, If you haven't looked at Henry Rich's 'J for C Programmers', specifically Chapter 5 http://www.jsoftware.com/help/jforc/declarations.htm#_Toc191734319 and Chapter 6 http://www.jsoftware.com/help/jforc/loopless_code_i_verbs_have_r.htm#_Toc191734331 I think that is an excellent start

Re: [Jprogramming] Print Custom Alphabet

2012-09-06 Thread bob therriault
t; I just added an explanation of the code that's only slightly > incomplete - I didn't explain how the "dot" gives a matrix and I'm not > up on the nuances of Unicode so I didn't explain the "2#" on the table > of numbers. > > On Thu, Sep 6, 2

Re: [Jprogramming] Print Custom Alphabet

2012-09-06 Thread bob therriault
ays, I will on behalf of > "J. BossCerovskiCyrHuiLambertMillerSchottSherlockTherriault" - > publicity never hurts. > > On Tue, Aug 28, 2012 at 9:03 AM, Raul Miller wrote: >> On Mon, Aug 27, 2012 at 9:29 PM, bob therriault >> wrote: >>> Raul, you sho

Re: [Jprogramming] emulating e. with +/ and =/

2012-08-30 Thread bob therriault
Hi June, The simplest way I can think of is to make both arguments lists using =/&, . That way if you do get an atom you make it a list and it seems to work. +/ 'cd' =/ 'abcd' 0 0 1 1 +/ 'cd' =/&, 'abcd' 0 0 1 1 +/ 'c' =/&, 'abcd' 0 0 1 0 +/ 'b' =/&, 'abcd' 0 1 0 0 Or if you would

Re: [Jprogramming] Print Custom Alphabet

2012-08-30 Thread bob therriault
Actually I think the shortest is still 43 |:1j1#(25{.(u:,2#65 97+/i.26)(>:@i.}.[)])"0 's' t u v w x y z a b c d e f g h i j k l m n o p q r |:1j1#(25{.(u:,2#65 97+/i.26)(>:@i.}.[)])"0 's.' t u v w x y z a b c d e f g h i j k l m n

Re: [Jprogramming] JHS - 'line1line2' 1!:2(2)

2012-08-30 Thread bob therriault
Hi david, It's been a while since I dug around JHS but I think what you are looking for is in utilh.ijs. The definition that twigged my memory was: NB. output starting with jmarka and ending with jmarkz,LF NB. is assumed to be html and is not touched jhtmlfroma=: 3 : 0 if. (jmarka-:jmarkc{.y)*.

Re: [Jprogramming] Print Custom Alphabet

2012-08-29 Thread bob therriault
Hey Robert nice work. If your approach is applied to Raul's we get: |:1j1#(25{.(u:,2#65 97+/i.26)(>:@i.}.[)])"0 's' t u v w x y z a b c d e f g h i j k l m n o p q r |:1j1#(25{.(u:,2#65 97+/i.26)(>:@i.}.[)])"0 's.' t u v w x y z a b c d e f g h

Re: [Jprogramming] Print Custom Alphabet

2012-08-28 Thread bob therriault
; e > f > g > h > i > j > k > l > m > n > o > p > q > r > s > t > u > v > w > x > y > z > > a bug, a feature, or both? > > > On Tue, Aug 28, 2012 at 9:03 AM, Raul Miller wrote: >> On Mon, Au

Re: [Jprogramming] Print Custom Alphabet

2012-08-28 Thread bob therriault
Thanks Ric, I guess that why the specs were written, huh? New version back up to 63 characters. (a.{~,(('.'e.t){32 10)(,"0)2#65 97+/i.26)&(50{.[}.~2+[i.0{])t=. 'k' l m n o p q r s t u v w x y z a b c d e f g h i j (a.{~,(('.'e.t){32 10)(,"0)2#65 97+/i.26)&(50{.[}.~2+[i.0{])t=. 'k.' l m

Re: [Jprogramming] Print Custom Alphabet

2012-08-27 Thread bob therriault
Hi Brian, I haven't had a chance to really take this apart to see how it ticks, but are you sure that e. is monadic? It looks like the first verb on the left tine, which I usually would think is dyadic, but there may be more things than are dreamt of in my philosophy. Also, I don't think your

Re: [Jprogramming] Print Custom Alphabet

2012-08-27 Thread bob therriault
Wow, If you take out the assignment and wrap it in brackets, I see a solution in 50 characters. Impressive Raul, you should put that up on the contest site. Previous leader was Golfscript at 53 I'm gonna take a look at how you did it later tonight. The best thing about these contests with the

Re: [Jprogramming] Print Custom Alphabet

2012-08-27 Thread bob therriault
Oops, should have been (,.@]^:('.'e.[)(a.{~,2#65 97+/i.26)&(25{.[}.~1+[i.0{])) 'u.' v w x y z a b c d e f g h i j k l m n o p q r s t got greedy with the {. cheers, bob On 2012-08-27, at 12:17 PM, bob therriault wrote: > Tweaks get me down to 55 > > (

Re: [Jprogramming] Print Custom Alphabet

2012-08-27 Thread bob therriault
@]^:('.'e.[)(a.{~,2#65 97+/i.26)&(26{.[}.~1+[i.0{])) '[' Cheers, bob On 2012-08-27, at 12:13 PM, bob therriault wrote: > Hey Robert, > > Nice to see a fresh approach. > > First impressions: > > I think that the specs require

Re: [Jprogramming] Print Custom Alphabet

2012-08-27 Thread bob therriault
6:27 AM, R.E. Boss wrote: > >> Nice solution. >> >> $(,.@]^:('.'e.[)(a.{~,,.~65 97+/i.26)&(1}.26{.[}.~[i.{.@])) '[' >> 25 >> >> $(,.@]^:('.'e.[)(a.{~,,.~65 97+/i.26)&(1}.26{.[}.~[i.{.@])) '[.' >> 2

Re: [Jprogramming] Print Custom Alphabet

2012-08-27 Thread bob therriault
opqrstuvwxyzabcdefghi (,.@]^:('.'e.[)(a.{~,,.~65 97+/i.26)&(1}.26{.[}.~[i.{.@])) '[' #'(,.@]^:(''.''e.[)(a.{~,,.~65 97+/i.26)&(1}.26{.[}.~[i.{.@]))' 58 Cheers, bob On 2012-08-25, at 3:25 AM, Viktor Cerovski w

Re: [Jprogramming] Print Custom Alphabet

2012-08-27 Thread bob therriault
This also works with length 64 (,.@]^:(46 e.[)(,,.~65 97+/i.26)&([:}.26{.[}.~[i.{.@]))&.(a.&i.) 'B' CDEFGHIJKLMNOPQRSTUVWXYZA (,.@]^:(46 e.[)(,,.~65 97+/i.26)&([:}.26{.[}.~[i.{.@]))&.(a.&i.) '[' (,.@]^:(46 e.[)(,,.~65 97+/i.26)&([:}.26{.[}.~[i.{.@]))&.(a.&i.) 'B.' C D E F G H I J K L M N

Re: [Jprogramming] Generating a sequence

2012-08-25 Thread bob therriault
Hi LInda, I think it has to do with the shape of the }. result. '.'-:}.'t.' 0 $'.' $}.'t.' 1 ${:'t.' '.'-:{:'t.' 1 cheers, bob On 2012-08-25, at 2:18 AM, Linda Alvord wrote: > '.'-:}.'t.' -- For information

Re: [Jprogramming] Print Custom Alphabet

2012-08-25 Thread bob therriault
amp;([{~(>:i.25)+[i.{.@])) ::(0$]) 'e' cheers, bob On 2012-08-24, at 5:16 PM, bob therriault wrote: > 67 characters with same issue that Raul mentions that argument would need to > be quoted. > > (,.@]^:('.'e.[)(a.{~a{~(>:i.25)+(a=.,65 97+/26|i.51)i

Re: [Jprogramming] Print Custom Alphabet

2012-08-24 Thread bob therriault
67 characters with same issue that Raul mentions that argument would need to be quoted. (,.@]^:('.'e.[)(a.{~a{~(>:i.25)+(a=.,65 97+/26|i.51)i.a.i.{.)) ::(0$])'f' spaced below for legibility (,.@]^:('.'e.[) (a.{~a{~(>:i.25)+(a=.,65 97+/26|i.51)i.a.i.{.)) :: (0$]) deci

Re: [Jprogramming] Miscellaneous J Questions

2012-08-08 Thread bob therriault
Hey peter, My guess is that the .htm extension may be causing a non-browser application to try and open these files. I'll give you a solution that works for me on Lion OSX. (0) Do a spotlight search on .htm, select one of those files (as you will see in step 3 it doesn't really matter which

Re: [Jprogramming] boxing each element

2012-07-17 Thread bob therriault
, each i. 10 would put a list in each box created. ] each i. 10 would put a scalar in each box Cheers, bob On 2012-07-17, at 2:14 PM, Dan Bron wrote: > It's not abuse - that's perfectly valid. Note, however: > > > ]A=:1 <\ i. 10 > +-+-+-+-+-+-+-+-+-+-+ > |0|1|2|3|4|5|6

  1   2   >