[Jprogramming] Saving viewmst images

2014-03-18 Thread Linda Alvord
I have created two images named First and Second. require 'viewmat' viewmat (%:(i:160)>./i:160);'First' viewmat (*:(i:160)>./i:160);'Second' How can I use the code mentioned in the viewmat lab to save them as "First.bmp" and "Second.bmp" to the temp file? Here are the hints I

[Jprogramming] shebang

2014-03-18 Thread Raul Miller
I needed to run J from the unix command line, and I didn't find anything up on jsoftware.com that seemed to fit the bill. So I added a J entry to rosettacode that illustrates some of the concepts: http://rosettacode.org/wiki/Multiline_shebang#J Hypothetically speaking you could build J scripts t

Re: [Jprogramming] J Extensions

2014-03-18 Thread Raul Miller
One thing I'd keep in mind is that errors do have utility. (Programmers use errors to help focus their attention on parts of the code that need attention.) So when you change the language to eliminate an error case you need to make sure that you're adding something useful. That could easily be th

Re: [Jprogramming] Silly puzzle

2014-03-18 Thread Raul Miller
Ok. 4 :0 1y2x : 0 ) 4 :0 ignores the monadic part of the definition. Here's another oddity: F=:3 :0 1 : 2 : 3 ) Predict: F 'c' 'a' F 'b' Thanks, -- Raul On Tue, Mar 18, 2014 at 9:08 PM, Henry Rich wrote: > That's silly enough, but I meant that one of the lines read by the : t

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] jqt android 1.0.25

2014-03-18 Thread bill lam
You may also try 2!:1 that is also being used in Michael's built. type inside your Term window android_exec_host_z_=: 2!:1 then see if browse_j_ or menu help can work. If success, add this definition to your ~config/startup.ijs menu help remote might not work because it hardcoded to use am star

Re: [Jprogramming] Installation Questions

2014-03-18 Thread km
Chris, I am unable to post to the General Forum. I have just downloaded J801 and can run jqt JVERSION Engine: j701/2011-01-10/11:25 Library: 8.01.025 Qt IDE: 1.0.24/4.8.5 Platform: Win 32 Installer: j801 install InstallPath: c:/users/kip murray/j801 I need step-by-step instructions for running

Re: [Jprogramming] Silly puzzle

2014-03-18 Thread Henry Rich
That's silly enough, but I meant that one of the lines read by the : that defined the verb was 1y2x. (in your example, the : that defines the verb doesn't read lines from the script). Henry Rich On 3/18/2014 7:59 PM, Raul Miller wrote: Here's one way: F=: 3 :(0 :0-.LF) x+y NB. 1

Re: [Jprogramming] J on Kindle Paperwhite?

2014-03-18 Thread Joe Bogner
Not J, but that reminds me that I set up a scheme interpreter on my Kindle 3G a few years back: http://www.mobileread.com/forums/showthread.php?t=56 With J on my android phone and tablet, I can't think of when I'd use it on a kindle. The 3G physical keyboard could be novel idea. Theoretically

Re: [Jprogramming] Silly puzzle

2014-03-18 Thread Raul Miller
Here's one way: F=: 3 :(0 :0-.LF) x+y NB. 1y2x ) (This presumes that "One the lines" meant "One of the lines"). Thanks, -- Raul On Tue, Mar 18, 2014 at 7:12 PM, Henry Rich wrote: > I wrote the explicit definition of a verb. It used : 0 to read lines from > the script it was defi

Re: [Jprogramming] jqt android 1.0.25

2014-03-18 Thread bill lam
please also post what are the output of 2!:5'TMP' for both old and new devices. 19.03.2014, в 2:17, Paul Jackson написал(а): > I ran your tests in jqt on an old machine, where Help and browse_j_ work. > > 2!:0 'which am' > |interface error > | 2!:0'which am' > > 2!:0 'am start -a

Re: [Jprogramming] jqt android 1.0.25

2014-03-18 Thread bill lam
Michael Dykman's version does not use 2!:0'am ...' to run other android apps. What are model and spec of your android devices that failed to run 2!:0'am ' ? 19.03.2014, в 2:17, Paul Jackson написал(а): > I ran your tests in jqt on an old machine, where Help and browse_j_ work. > > 2!:0

[Jprogramming] Silly puzzle

2014-03-18 Thread Henry Rich
I wrote the explicit definition of a verb. It used : 0 to read lines from the script it was defined in. One the lines, encountered before the end-of-verb delimiter ), was 1y2x (just the 4 characters). Yet, the definition was created without error. How is this possible? Henry Rich --

[Jprogramming] J on Kindle Paperwhite?

2014-03-18 Thread Devon McCormick
Has anyone looked at trying to get J on a Kindle Paperwhite? Apparently it's a Linux OS and easily rootable. -- Devon McCormick, CFA -- For information about J forums see http://www.jsoftware.com/forums.htm

Re: [Jprogramming] jpkg problem

2014-03-18 Thread chris burke
Thanks, fixed now in 8.01.025. BTW - pacman now properly supports dependencies, which were ignored before. The bug in pacman console was introduced in this code. On Wed, Mar 19, 2014 at 3:17 AM, Tomei L. wrote: > After last update of base library (8.01.024), I have problems with > pacman.ijs >

Re: [Jprogramming] intermediate tacit result assignments

2014-03-18 Thread km
Have a look at the diagrams for Hook and Fork in http://www.jsoftware.com/docs/help801/dictionary/dictf.htm --Kip Murray Sent from my iPad > On Mar 18, 2014, at 2:15 PM, Pascal Jasmin wrote: > > to be clear, I am in no way asking for how to double a product. > > what the function is actually

[Jprogramming] jpkg problem

2014-03-18 Thread Tomei L.
After last update of base library (8.01.024), I have problems with pacman.ijs Using jpkg verb, I cannot install / upgrade addons from jconsole or jhs. jqt package manager seems ok. -- For information about J forums see http://www

Re: [Jprogramming] intermediate tacit result assignments

2014-03-18 Thread Pascal Jasmin
to be clear, I am in no way asking for how to double a product. what the function is actually equivalent to, though is: (*+*)   What seems interesting about the function is it is doing something I previously thought was impossible.  Saving and reusing intermediate (noun) results in a tacit func

Re: [Jprogramming] intermediate tacit result assignments

2014-03-18 Thread Raul Miller
Here's another function which achieves that end: test9=: 2 * * One interesting thing though, when comparing different expressions which accomplish the same end, has to do with how their components can be used differently. And there's something to be said for having a wide variety of components.

Re: [Jprogramming] jqt android 1.0.25

2014-03-18 Thread Paul Jackson
I ran your tests in jqt on an old machine, where Help and browse_j_ work. 2!:0 'which am' |interface error | 2!:0'which am' 2!:0 'am start -a android.intent.action.VIEW -d "http://www.google.com"; -t text/html' Starting: Intent { act=android.intent.action.VIEW dat=http://www.google.co

Re: [Jprogramming] intermediate tacit result assignments

2014-03-18 Thread Pascal Jasmin
interesting function, Raul, but not quite what I was doing:    test8 =: 4 : 'c' + [ 4 : 'c =: x * y' ] function simply multiplies x and y and then doubles result.  Its a 5 element train where the : conjunctions makes single train elements.   The point is doing this with potntial side effects an

Re: [Jprogramming] intermediate tacit result assignments

2014-03-18 Thread Raul Miller
It's not clear to me what you want to accomplish here - no sample data, no results. Also note that while this is, in a sense, tacit, you'll get some ... interesting (and probably unintended) behaviors if you try using your 3 : and/or 4 : verbs with rank. I've got some code I'm working on which use

Re: [Jprogramming] jqt android 1.0.25

2014-03-18 Thread Paul Jackson
There must be some major difference because on the old version I'm using on this machine: JVERSION Engine: j701/2011-02-23/15:25 Library: 7.01.068 Platform: Android 32 Installer: j701a_linux32.sh InstallPath: /data/data/org.dykman.j.android/app_jconsole browse_j_'http://www.google.com' works

Re: [Jprogramming] J as a calculator

2014-03-18 Thread Pascal Jasmin
If we refuse to understand .* there is also marginPct=: (1 - [: %~/ [: +/ *)    100 5 (1 - [: %~/ [: +/ *) _2 ]\ 10 3 7.5 2 0.701205 - Original Message - From: Devon McCormick To: J-programming forum Cc: Sent: Tuesday, March 18, 2014 12:07:28 PM Subject: Re: [Jprogramming] J as a ca

Re: [Jprogramming] jqt android 1.0.25

2014-03-18 Thread Paul Jackson
Quite consistent: 2!:0 'which am' |interface error | 2!:0'which am' 2!:0 'am start -a android.intent.action.VIEW -d "http://www.google.com"; -t text/html' |interface error | 2!:0'am start -a android.intent.action.VIEW -d " http://www.google.com"; -t text/html' 2!:0 'am start -

[Jprogramming] intermediate tacit result assignments

2014-03-18 Thread Pascal Jasmin
Here is a neat way to get intermediate results within a tacit expression.  Many drawbacks, but it is possible.  Drawbacks include global variables, and dyad vs. monad must be known prior to access: 3 : 'c' + [ 4 : 'c =: x * y' ] That may not look very tacit, but it is :P  intermediate result c

Re: [Jprogramming] J as a calculator

2014-03-18 Thread Raul Miller
Note that marginPct=: 1 - [: %~/ [ +/ .* ] can be simplified: marginPct=: 1 - [: %~/ +/ .* (Balanced square brackets around what would be the right most verb of a train are redundant.) Thanks, -- Raul On Tue, Mar 18, 2014 at 12:07 PM, Devon McCormick wrote: > I thought of this too.

Re: [Jprogramming] J as a calculator

2014-03-18 Thread Devon McCormick
I thought of this too. Also, at some point you may want to name it (here incorporating the suggestion to move the pairing out of the concept): marginPct=: 1 - [: %~/ [ +/ .* ] 100 5 marginPct 10 3,: 7.5 2 0.701205 On Tue, Mar 18, 2014 at 11:02 AM, Pascal Jasmin wrote: > the only things I

Re: [Jprogramming] J as a calculator

2014-03-18 Thread Pascal Jasmin
the only things I'd change: use ] instead of [ to be able to work in a dyadic verb then make a verb, and probably assign it so as to be able to do the calc another day or with other data.     13 : '1- %~/ +/ x * _2]\ y' 1 - [: %~/ [: +/ [ * _2 ]\ ]     100 5 (13 : '1- %~/ +/ x * _2]\ y')

Re: [Jprogramming] J as a calculator

2014-03-18 Thread Brian Schott
If you are willing to enter longer lists using ,: , the following is pretty concise and requires no use of ,s . 1- %~/ 100 5 +/ .* |:10 7.5,:3 2 -- (B=) -- For information about J forums see http://www.jsoftware.com/forums.

Re: [Jprogramming] 0 : 0 Adverb

2014-03-18 Thread Pascal Jasmin
thank you, defining myadverb =: ( 0 :) 1 : 0 ... ) has the added benefit of keeping syntax highlighting in the multiline definition for  def =: 0 myadverb ... ) - Original Message - From: Jan-Pieter Jacobs To: programm...@jsoftware.com Cc: Sent: Tuesday, March 18, 2014 9:01:37 AM S

Re: [Jprogramming] J as a calculator

2014-03-18 Thread Pascal Jasmin
the only things I'd change: use ] instead of [ to be able to work in a dyadic verb then make a verb, and probably assign it so as to be able to do the calc another day or with other data.     13 : '1- %~/ +/ x * _2]\ y' 1 - [: %~/ [: +/ [ * _2 ]\ ]     100 5 (13 : '1- %~/ +/ x * _2]\ y') 10 3

Re: [Jprogramming] J as a calculator

2014-03-18 Thread Joe Bogner
Thanks for the ideas Brian and Raul. On Tue, Mar 18, 2014 at 10:27 AM, Raul Miller wrote: > Of course, technically the parenthesis are unnecessary, and are just there > for emphasis. But another way of emphasizing would emphasize that you are > working with pairs: > >10 3,:7.5 2 > > Note that

Re: [Jprogramming] J as a calculator

2014-03-18 Thread Raul Miller
I might be tempted to rephrase the price and cost part of this. One variant pulls the _2[\ into the parenthesis, because it's a part of the structure of your numbers: (_2[\ 10 3 7.5 2) Of course, technically the parenthesis are unnecessary, and are just there for emphasis. But another way of

Re: [Jprogramming] 0 : 0 Adverb

2014-03-18 Thread Henry Rich
No way to have a single word, since a single word is just a value and is not executed. And I can't find a way to do it on 2 words when one is an adverb. Henry Rich On 3/18/2014 8:42 AM, Pascal Jasmin wrote: from http://www.jsoftware.com/jwiki/PascalJasmin/Multiline%20tacit%20expressions%20wi

Re: [Jprogramming] J as a calculator

2014-03-18 Thread Brian Schott
1- %~/ 100 5 +/ .* _2]\10 3 7.5 2 0.701205 On Tue, Mar 18, 2014 at 9:50 AM, Brian Schott wrote: > I cannot beat that, but the parentheses are unnecessary. > > > > > -- > (B=) > -- (B=) <-my sig Brian Schott -- For

Re: [Jprogramming] J as a calculator

2014-03-18 Thread Brian Schott
I cannot beat that, but the parentheses are unnecessary. -- (B=) -- For information about J forums see http://www.jsoftware.com/forums.htm

[Jprogramming] J as a calculator

2014-03-18 Thread Joe Bogner
I'm trying to use J more in my daily calculations in addition to programming. I was working with some simple margin % calculations in a one liner 1- %~/ +/ (100 5) * _2[\ (10 3 7.5 2) I'd like any ideas on how others would do this type of 'spreadsheet' calculation. I'm pretty happy with it, but

Re: [Jprogramming] 0 : 0 Adverb

2014-03-18 Thread Jan-Pieter Jacobs
Since you'd want to have the verb as return value, you'd want to have an adverb or conjunction. They both need operands to do a job. I tried this with } instead of Tacify, but I guess it will just work as well: >foo =: (0 :) } > >0 foo >123 >) >(49 50 51 10{a.)} I think this should equal

[Jprogramming] 0 : 0 Adverb

2014-03-18 Thread Pascal Jasmin
from  http://www.jsoftware.com/jwiki/PascalJasmin/Multiline%20tacit%20expressions%20with%20macros test =: 0 : 0 Tacify ( +/ x % y 13 MACdef NB.macro that will call 13 : x % y and return % #) NB. blank line with comment next without comment @:> ) produces +/ % #)@:> and is