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

2012-12-03 Thread PackRat
Thank you, Ric and especially Bob! Bob Therriault wrote: > Is there a reason that you would not be able to add the spaces at > the end using iji # ? > > sqdata=. 'X@@.@..@@...@' > e=.5 5 $ e3 { sqdata > 1j1#"1 e My original version was along your lines (that is, no spaces until the

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

2012-12-03 Thread Ric Sherlock
I was wanting to get a feel for if I was on the right track but that is pretty easy to add that too if need be: 1j1&#"1 ((e3 e."1 {.f)+e3 e."1 f)}'.','@',:5 5$'X' . @ . . . . @ @ . . . X . @ . . @ . . . . . . . @ On Tue, Dec 4, 2012 at 6:49 PM, bob therriault wrote: > Yeah, I picked that up

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

2012-12-03 Thread bob therriault
Yeah, I picked that up off of Raul in a codeGolf thing we did last summer. I like your way of generating the matrix but it doesn't have the 'X' for the 0 in Harvey's original example. I just relied on sqdata being defined so I am really not being critical :) Cheers, bob On 2012-12-03, at 9:3

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

2012-12-03 Thread Ric Sherlock
Thanks Bob, I was trying to work out how to insert alternate spaces and 1j1# is nicer than my solution. Here is a simplification of my earlier idea: 1j1&#"1 (e3 e."1 f)} (5 5$'.'),:'@' . @ . . . . @ @ . . . @ . @ . . @ . . . . . . . @ On Tue, Dec 4, 2012 at 6:13 PM, bob therriault wrote:

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] Getting more than one value back from "From" or alternative approach

2012-12-03 Thread Ric Sherlock
Does this provide something similar to what you are wanting? e3=: 5 5$ e3 ;"1 (e3 e."1 f)} (5 5$<'. '),:<'@ ' . @ . . . . @ @ . . . @ . @ . . @ . . . . . . . @ On Tue, Dec 4, 2012 at 3:21 PM, PackRat wrote: > I have an application where I have a numeric evolute that I want to > visualiz

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

2012-12-03 Thread PackRat
I have an application where I have a numeric evolute that I want to visualize. Essentially, I have a list of values within the evolute that I want to display as a given literal character, while the remaining values would be a default "background" literal character. Everything works fine until

Re: [Jprogramming] @: and capped fork

2012-12-03 Thread bill lam
A workaround has been committed to JAL, please update and try again. Пнд, 03 Дек 2012, David Ward Lambert писал(а): > Sadly, the current j version 7 version of the "Object Oriented > Programming" is broken. > > Lab: Object Oriented Programming > To advance the lab, press Ctrl-. in JHS or Ctrl-J i

Re: [Jprogramming] @: and capped fork

2012-12-03 Thread bob therriault
I find myself using J602 for labs (the instructional value is still valid in most cases). Cheers, bob On 2012-12-03, at 1:06 PM, David Ward Lambert wrote: > Sadly, the current j version 7 version of the "Object Oriented > Programming" is broken. > > Lab: Object Oriented Programming > To advance

Re: [Jprogramming] @: and capped fork

2012-12-03 Thread David Ward Lambert
Sadly, the current j version 7 version of the "Object Oriented Programming" is broken. Lab: Object Oriented Programming To advance the lab, press Ctrl-. in JHS or Ctrl-J in Gtk. On a tablet your mileage may vary. ── (1 of 70) Overview ─── This lab is about Obje

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-03 Thread Alex Giannakopoulos
Thanks Marshall and Raul, and yes, of course the question assumed that there /was/ a need for an object. My guess is you'd get that asked a lot if people were arriving at J from OO languages, I'd hate to be the one making the case that you don't always need objects, even when I agree with that sta

Re: [Jprogramming] @: and capped fork

2012-12-03 Thread Raul Miller
There are several ways of translating that javascript code into J, I would have to know something about the larger context to know which of them I would pick. That said, one of the simplest would be: do_something 'bee' do_something 'see' Another variation would be: b_a_=: 'bee' s_a_=: 'see' do_

[Jprogramming] error message in '~addons/media/image3/view_m.ijs

2012-12-03 Thread Brian Schott
What is causing the following errors, please? 9!:12'' 5 9!:14'' j602/2008-03-03/16:45 load '~addons/media/image3/view_m.ijs' directory =: '/Users/brian/Pictures/' $b =: read_image"1 directory,'Scan2-8at300.jpeg' |domain error: cd | a=.'jpeg_get_info + i *c *i *i *i *i'zj

Re: [Jprogramming] @: and capped fork

2012-12-03 Thread Alex Giannakopoulos
Thanks Stefano, that's what I meant, viz. how can you access a structure within a variable, whether its a box or whatever, by a variable that is only defined within the context of the main variable, i.e. not an index, but a structure name. Same as you'd do with a "struct" in C. A property, or what

Re: [Jprogramming] @: and capped fork

2012-12-03 Thread Marshall Lochbaum
There are a lot of disclaimers here: this code, without context, is quite useless, and typically there are easier ways to do things in J than using objects. But here's the way I would probably do this, if I decided that the best way to store data was to make use of values in a locale. The key is nl

Re: [Jprogramming] @: and capped fork

2012-12-03 Thread Stefano Lanzavecchia
The proposed Javascript is more along the lines of: execute a function (do_something) on the value of each (for (var prop)) of the variabiles contained in a specified locale (a). So, a literal translation would involve the retrieval of the list of the variable names (b and c in the exampple, but it

Re: [Jprogramming] @: and capped fork

2012-12-03 Thread Devon McCormick
I'm sure I don't understand the Javascript-specific nuances of your question, but is a J version much different than this? do_something"0 a=. 'bee';'see' On Mon, Dec 3, 2012 at 1:09 PM, Alex Giannakopoulos wrote: > On 3 December 2012 15:59, Raul Miller wrote: > > > That said, when I want

Re: [Jprogramming] @: and capped fork

2012-12-03 Thread Alex Giannakopoulos
On 3 December 2012 15:59, Raul Miller wrote: > That said, when I want to translate J into a language other people > understand, Javascript is usually my first choice. > Why does that not surprise me? :-) Incidentally, and if you have nothing better to do, how would you code this Javascript in

Re: [Jprogramming] @: and capped fork

2012-12-03 Thread Alex Giannakopoulos
On 3 December 2012 15:59, Raul Miller wrote: > Also, there isn't anything you can do with lambda notation that you > cannot do in J. J's gerunds have all the expressiveness of lambdas, > and you can implement anything in them up to and including call/cc. > Raul, you know your stuff and I always

Re: [Jprogramming] Passing arbitrary data from JavaScript back to JHS

2012-12-03 Thread Eric Iverson
The short answer is yes, the jdoajax can send any data it wants. The details depend a bit on whether you are trying to do this on the jijx page, or on a new custom grid page. In the page form define a hidden textarea. Then put your JSON serialized data in the textarea and jdoajax with that text a

Re: [Jprogramming] @: and capped fork

2012-12-03 Thread John Baker
That getting paid bit is always a bummer On Mon, Dec 3, 2012 at 9:59 AM, Raul Miller wrote: > J's performance is a blend of the language design, Roger Hui's years > of implementation, and probably Arthur Whitney's influence. > > Also, there isn't anything you can do with lambda notation tha

Re: [Jprogramming] Passing arbitrary data from JavaScript back to JHS

2012-12-03 Thread John Baker
I am using JSON to pass the grid data from JHS to Javascript. The verb griddatfrtd reads TAB delimited CSV style text and builds a JSON string for DHTMLX. What I am wondering is how to do the reverse. I can build the JSON on the JavaScript side but how do you post this back to JHS. jdoajax pulls

Re: [Jprogramming] @: and capped fork

2012-12-03 Thread Raul Miller
J's performance is a blend of the language design, Roger Hui's years of implementation, and probably Arthur Whitney's influence. Also, there isn't anything you can do with lambda notation that you cannot do in J. J's gerunds have all the expressiveness of lambdas, and you can implement anything i

Re: [Jprogramming] Passing arbitrary data from JavaScript back to JHS

2012-12-03 Thread Eric Iverson
You probably want to look at JSON. This is a serialization of any JS object. Javascript has built in methods to serialize an object and to create an object. The encoding is pretty straight forward and it is easy to write equivalents in J. Note that for data there is direct correspondence between a

Re: [Jprogramming] JHS meets MathJax

2012-12-03 Thread John Baker
Interesting. If this becomes well accepted COM may have broken out of its MS jail. On Mon, Dec 3, 2012 at 9:36 AM, Stefano Lanzavecchia wrote: > > I had heard about COM in Win8. > > > > Is it still being promoted as a development target? It's been tolerated > in .Net > > for ages but always pr

Re: [Jprogramming] JHS meets MathJax

2012-12-03 Thread Stefano Lanzavecchia
> I had heard about COM in Win8. > > Is it still being promoted as a development target? It's been tolerated in > .Net > for ages but always prefaced with phrases like "legacy technology." > COM's main drawback is that it has not caught on outside of Microsoft. For > those of us interested in por

Re: [Jprogramming] JHS meets MathJax

2012-12-03 Thread John Baker
I had heard about COM in Win8. Is it still being promoted as a development target? It's been tolerated in .Net for ages but always prefaced with phrases like "legacy technology." COM's main drawback is that it has not caught on outside of Microsoft. For those of us interested in portable programmi

Re: [Jprogramming] @: and capped fork

2012-12-03 Thread Bo Jacoby
Alex Giannakopoulos wrote: "it's the *spirit* that counts." 1361: CREDO IN SPIRITUM QUI LOCUTUS EST PER PROPHETAS AMEN - Bo > > Fra: Alex Giannakopoulos >Til: [email protected] >Sendt: 12:37 mandag den 3. december 2012 >Emne: Re: [Jprogramming] @: and

Re: [Jprogramming] @: and capped fork

2012-12-03 Thread Alex Giannakopoulos
> *Ric Sherlock* tikkanz at gmail.com > *Sun Dec 2 20:58:35 UTC 2012 > > *The issue becomes - are we writing scripts/libraries to showcase J to beginners > or to provide performant utilities for users? IMO, = if you want to push J =, there is only one answer to that question. The old hands will w

Re: [Jprogramming] @: and capped fork

2012-12-03 Thread Alex Giannakopoulos
*> Don Guinn* donguinn at gmail.com *> Sun Dec 2 14:12:01 UTC 2012 > >* [BASIC] and the popular programming languages today are all essentially scalar. > They handle one element at a time and use loops to handle arrays. While the central point of what you are saying is definitely true, remember t