Re: [Jprogramming] New visual teaching lab for J - contributors needed

2015-07-08 Thread Raul Miller
I suggested to Henry that that line should be changed to 1!:5(#~ [:*/\.0=#@(1!:0)@>)}:&.>,&.>/\(<;.2~e.&'/\')ofn The underlying problems are two: [1] J does not have a foreign which tests if a directory exists or not. (Closest we have to that is 1!:44) [2] For some reason getting a listing o

Re: [Jprogramming] New visual teaching lab for J - contributors needed

2015-07-08 Thread Raul Miller
On Wed, Jul 8, 2015 at 12:45 PM, wrote: > Suppose I just delete the first 2 boxes, which are the '\' and the > '\disk' levels, and use my original program on the remaining > directories. Would that be reliable on Mac? Probably not. I don't know why 2!:0 doesn't work for top level directories,

Re: [Jprogramming] Here we go again... another Project Euler Question

2015-07-10 Thread Raul Miller
I don't do project euler, I've never really gotten into it. But my impression is that the problems are chosen to make brute force solutions impractical. Here, I think I see a pattern in the relationship between >./@(_&q:) and func (for your definition of func) and I expect that the mechanism behin

Re: [Jprogramming] Powerize a while.

2015-07-13 Thread Raul Miller
This is not a good candidate for the power conjunction. You could do it with the power conjunction but it's not a good fit. The reasons for this are: (1) You have two independent values you are working with - the value you use for flow control is independent of the value you are passing to your

Re: [Jprogramming] Powerize a while.

2015-07-13 Thread Raul Miller
e. Heres a shorter view of what it does (shortened to avoid email line wrap problems). I have also swapped E and O, just because: (9$O`E) concatevoke [: O [: E [: O [: E [: O [: E [: O [: E O Thanks, -- Raul On Mon, Jul 13, 2015 at 1:01 PM, Raul Miller wrote: > This is not a good cand

Re: [Jprogramming] html screen scraping

2015-07-14 Thread Raul Miller
But that only works on 32 bit j602, because of limitations in our support for the xml/sax addon. I think it also only works for xhtml? Thanks, -- Raul On Tue, Jul 14, 2015 at 2:00 PM, Dan Bron wrote: > This RosettaCode solution is relevant; it demonstrates how to use J & the JAL > to scrape

[Jprogramming] minor note: csv data

2015-07-15 Thread Raul Miller
I've been using ~.": a lot lately, when working with csv data (with a header row). Here's what that looks like: ~.": (;:'a b c d'),]&.>p:p:p:i.4 4 ┌┬┬┬┐ │a │b │c │d │ ├┼┼┼┤ │13 │19 │43 │71 │ │163 │193 │293 │359 │ │463 │619 │743 │971 │ │1091│1181│1423

Re: [Jprogramming] minor note: csv data

2015-07-15 Thread Raul Miller
but keeps the data numeric > > (;:'a b c d'),: ,. each <"1&.|: p:p:p:i.4 4 > > > - Original Message - > From: Raul Miller > To: Programming forum > Cc: > Sent: Wednesday, July 15, 2015 3:33 PM > Subject: [Jprogramming] minor note: csv

Re: [Jprogramming] row puzzle

2015-07-18 Thread Raul Miller
Or row=:, ,:^:(2>#@$) -- Raul On Sat, Jul 18, 2015 at 8:15 PM, Roger Hui wrote: >row=: ,&(,:^:(1=#@$)) > >1 2 row 3 4 > 1 2 > 3 4 >1 2 row 3 4 row 5 6 > 1 2 > 3 4 > 5 6 >(1 2 row 3 4) row 5 6 > 1 2 > 3 4 > 5 6 >(1 2 row 3 4) row 5 6 row 7 8 > 1 2 > 3 4 > 5 6 > 7 8 > > > >

Re: [Jprogramming] row puzzle

2015-07-18 Thread Raul Miller
Is row=:, ,.&.|: beautiful enough? Thanks, -- Raul On Sat, Jul 18, 2015 at 8:17 PM, Henry Rich wrote: > The straightforward version: > >row =. ,&(,:^:(2 > #@$)) > > The shorter but ugly (and slower) version: > >row =. ;@,&:(<@,:"1) > > The beautiful but slowest version: > >row

Re: [Jprogramming] row puzzle

2015-07-18 Thread Raul Miller
row=:_2[\,&, would have been more concise? Or is that too silly? -- Raul On Sat, Jul 18, 2015 at 8:19 PM, Roger Hui wrote: > And another version: > > row=: _2&([\)@,&, > > > > On Sat, Jul 18, 2015 at 5:17 PM, Henry Rich wrote: > >> The straightforward version: >> >>row =. ,&(,:^:(2 > #@

Re: [Jprogramming] row puzzle

2015-07-18 Thread Raul Miller
Aw... come on, what about row=:_2,\,&, ? Thanks, -- Raul On Sat, Jul 18, 2015 at 8:44 PM, Roger Hui wrote: > This one's the winner. > > On Sat, Jul 18, 2015 at 5:26 PM, Raul Miller wrote: > >> row=:_2[\,&, >> >> would have been more concise? Or i

Re: [Jprogramming] insert column into tables

2015-07-20 Thread Raul Miller
The classic "insertion" method for J is to use {. for the part before the insertion and }. for the part after the insertion. An example of this might be: table =: 3 3 $ <"0 i.9 column =: 3 1$ (<,'0') column ((2{."1]),.[,.2}."1]) table But it also might be simpler to use transpose: co

Re: [Jprogramming] insert column into tables

2015-07-20 Thread Raul Miller
When this happens it's often worth spending a few minutes looking them up and trying some simple examples so you can see how they work for the kind of data you're working with. Thanks, -- Raul On Mon, Jul 20, 2015 at 8:54 AM, Strale wrote: > Hi Dan > > > this is getting me really scared :) >

Re: [Jprogramming] Substring sequences of a string

2015-07-21 Thread Raul Miller
You can't have an inverse crc, because crc is a lossy transformation. You are basically relying on statistics to avoid collisions (different strings with the same crc). So actual use would look something like: step one: get the distinct crcs which are in use. step two: go over the data again and

Re: [Jprogramming] Quantum algebra with J

2015-07-21 Thread Raul Miller
This looks like it could be fun, though I don't really have the background to intuit a lot of what's going on here. I did notice that you've a lot of code which you are not exercising (the gates, for example). It might be worth working through some examples? Thanks, -- Raul On Tue, Jul 21, 20

Re: [Jprogramming] Trippling productivity!

2015-07-23 Thread Raul Miller
Mostly I try to avoid utility code, but this one looks really nice. Thanks, -- Raul On Thu, Jul 23, 2015 at 4:18 PM, 'Pascal Jasmin' via Programming wrote: > Y =: @:] > > can be useful typing/reading productivity boost for tacit code > > Y =: (&{::)(@:]) > > is a different useful version wher

Re: [Jprogramming] Trouble making patter for a color cube

2015-07-24 Thread Raul Miller
I think you want: load 'viewmat' (,:0 0 255) viewmat 0 (,:0 255 0) viewmat 0 (,:0 255 255) viewmat 0 (,:255 0 0) viewmat 0 (,:255 0 255) viewmat 0 (,:255 255 0) viewmat 0 To see why compare: 0 { 0 0 255 0 and: 0 {,:0 0 255 0 0 255 You can try that with the other left arguments for viewmat

Re: [Jprogramming] Trouble making patter for a color cube

2015-07-24 Thread Raul Miller
oun...@forums.jsoftware.com] On Behalf Of Raul Miller > Sent: Friday, July 24, 2015 6:32 AM > To: Programming forum > Subject: Re: [Jprogramming] Trouble making patter for a color cube > > I think you want: > > load 'viewmat' > (,:0 0 255) viewmat 0 > (,:0 255 0)

Re: [Jprogramming] Trouble making patter for a color cube

2015-07-24 Thread Raul Miller
t;1 C=:face each plan > paint viewmat i.12 9 > ) > > cube '' > > Linda > > -Original Message- > From: programming-boun...@forums.jsoftware.com > [mailto:programming-boun...@forums.jsoftware.com] On Behalf Of Raul Miller > Sent: Friday, July 24

Re: [Jprogramming] Langford strings and interleaving utility

2015-07-25 Thread Raul Miller
This seems to be a bit more concise than mixes, and I think it accomplishes the same thing: mix=: ] (+"1/#~&(,/)1-+./ .*&:*"1/) [ {.~"1 0 (-@}. i.@>:)&{:&$ Thanks, -- Raul On Sat, Jul 25, 2015 at 1:29 PM, 'Pascal Jasmin' via Programming wrote: > for a description of langford strings, > > h

[Jprogramming] dot product

2015-07-25 Thread Raul Miller
1 0 1 +/ .* 10 100 1000 1010 The dot product is arguably a key feature of J. This allows you to multiply matrices: 1+i.2 3 1 2 3 4 5 6 7+i.3 2 7 8 9 10 11 12 (7+i.3 2)+/ .*1+i.2 3 39 54 69 49 68 87 59 82 105 Note also that you can often use %. to go the other way: ((7+i.3 2)

Re: [Jprogramming] dot product

2015-07-25 Thread Raul Miller
I was commenting on the "(I still don't get . )" quip. Thanks, -- Raul On Sat, Jul 25, 2015 at 4:30 PM, Mike Day wrote: > Thanks, Raul, but who/what were you commenting to/on? > > Cheers, > > Mike > > > > On 25/07/2015 20:11, Raul Miller wrote:

Re: [Jprogramming] multiline tacit code: was Re: [Jbeta] reload user keys?

2015-07-26 Thread Raul Miller
s, you also have > to close before opening in general. But the biggest reason this turns out to > be not useful is that the bottom to top multiline tacit format allows you to > split and join lines with enter and backspace > > I'm not 100% sure how your true if test can be co

Re: [Jprogramming] Trouble making patter for a color cube

2015-07-26 Thread Raul Miller
Message- > From: programming-boun...@forums.jsoftware.com > [mailto:programming-boun...@forums.jsoftware.com] On Behalf Of Raul Miller > Sent: Friday, July 24, 2015 12:51 PM > To: Programming forum > Subject: Re: [Jprogramming] Trouble making patter for a color cube > > That

Re: [Jprogramming] Trouble making patter for a color cube

2015-07-27 Thread Raul Miller
lease check this code again. It doesn't seem to work >> at all anymore. Thanks. >> >> Linda >> >> -Original Message- >> From: programming-boun...@forums.jsoftware.com >> [mailto:programming-boun...@forums.jsoftware.com] On Behalf Of Raul >&

[Jprogramming] twos complement

2015-07-27 Thread Raul Miller
Monadic #: is lossy. It will represent different integers in the same array with the same result: $#:i:4 9 3 $~.#:i:4 8 3 For backwards compatibility reasons, this should probably not be changed. Nevertheless, a non-lossy variant can also be useful: twosC=: #:~ 2 #~ 1 + {:@$@#: The na

Re: [Jprogramming] twos complement

2015-07-27 Thread Raul Miller
Personally, I prefer the fork 1 + u over the perhaps more obvious >:@u Other than that, I kind of like your ndr. Thanks, -- Raul On Mon, Jul 27, 2015 at 11:47 AM, Dan Bron wrote: > > Raul wrote: >> twosC=: #:~ 2 #~ 1 + {:@$@#: > > The clause {:@$@#: does a lot of work (computationally speak

Re: [Jprogramming] Trouble making patter for a color cube

2015-07-28 Thread Raul Miller
I think this is what you are asking for: load 'viewmat' 'E B G C R M Y W'=:#:i.8 V=:,"_1 each/"1 C=:y face each plan paint viewmat i.4 3*y ) cube 5 Personally, I prefer ('rgb' viewmat image), but your approach can certainly be made to work. Thanks, -- Raul On Tue, Jul 28, 2015 at 3:25 PM

Re: [Jprogramming] web service : page not complete

2015-07-28 Thread Raul Miller
This is an inherent quality of sockets, and the internet. The internet is a packet switching system - messages get chopped up into pieces and the pieces get sent independently. And the socket system is a low level api which requires that the programmer deal with this issue. Exactly how you deal

Re: [Jprogramming] Trouble making patter for a color cube

2015-07-28 Thread Raul Miller
numbers. The white > area can be spoted pretty easily. > > Linda > > -Original Message- > From: programming-boun...@forums.jsoftware.com > [mailto:programming-boun...@forums.jsoftware.com] On Behalf Of Raul Miller > Sent: Tuesday, July 28, 2015 4:12 PM > To: Programming for

Re: [Jprogramming] [Jdatabase] A few questions

2015-07-29 Thread Raul Miller
11 > > > But I wondered how to do it tacitly? > > > I would need a fork of with both the dyadic (>.@* <:@#) and the monadic > (/:~) parts. Can I combine them in a single tacit form? > > > Yoel > > > > > > > On Tue, Jul 28, 2015 at 8:09

Re: [Jprogramming] web service : page not complete

2015-07-31 Thread Raul Miller
On Fri, Jul 31, 2015 at 11:43 AM, yves.tanguy wrote: > But, after each request, connection is closed (but i am not sure, it > is depend on protocol version) That surprises me. It's possible you are running into some kind of timeout, I suppose... But perhaps there's another way. Try: requir

Re: [Jprogramming] multiplication bug

2015-07-31 Thread Raul Miller
Likewise: pffact=:([: +/ ] <.@% [ ^ 1 + [: i. <.@^.) P=:9+1e9 pw=.1e9 pffact">~ pr=.p:i.240 1 p: P 1 datatype P integer mul=.1+pr (P&|@^) 2 (P&|@*) pw datatype mul integer P&|@*/ mul 39355325 JVERSION Engine: j803/2014-10-19-11:11:11 Library: 8.04.06 Qt IDE: 1.4.3/5.4.2

Re: [Jprogramming] Understanding ^:

2015-08-02 Thread Raul Miller
I think Pascal has pretty much already covered it, but these are equivalent: f^:5 n f f f f f n And these are also equivalent: m f^:3 n m f m f m f n Thanks, -- Raul On Sun, Aug 2, 2015 at 11:26 AM, Jon Hough wrote: > I'm attempting some functions that use verb power (^:) , but

Re: [Jprogramming] unlock.ijs

2015-08-06 Thread Raul Miller
You are looking at the result of the adverb. In that sense, verbs don't stay hidden, either, since you can see their results. That said, the population of people who can read non-trivial J programs is rather small - I expect that most programmers would consider unlocked verbs unreadable. But, of c

Re: [Jprogramming] unlock.ijs

2015-08-06 Thread Raul Miller
On Thu, Aug 6, 2015 at 7:30 PM, 'Pascal Jasmin' via Programming wrote: > I'm unsure if there is a way to have code mathematically controlling a > computer against user wishes. I am sure that any frustrated user could express ways that the computer is acting against their wishes. -- Raul --

Re: [Jprogramming] Optimization ideas?

2015-08-08 Thread Raul Miller
I would not use A. when building sets. Instead: sets=: (*"1 [: #:@i. 2^#)1+i.9 sums=: +/"1 sets Ns=: +/"1 *sets sol=:4 :0 0 -."1~ sets #~ (x=Ns)*y=sums ) 4 sol 12 1 2 4 5 1 2 3 6 timespacex '4 sol 12' 2.8e_5 9472 timespacex '9 sol 45' 1.6e_5 8960 Seems efficient enough to me? Thank

Re: [Jprogramming] a trick for monadic gerund and /

2015-08-08 Thread Raul Miller
Another approach: (apply each~ +:`-: $~ $) 4 2 3 0 ┌─┬─┬─┬─┐ │8│1│6│0│ └─┴─┴─┴─┘ Except apply isn't quite right, since it's looking for a string representing a verb and it's not always the case that the part of the gerund inside the box is a string representing a verb. So, perhaps better:

Re: [Jprogramming] Detecting special products

2015-08-08 Thread Raul Miller
The product of three numbers in sequence can be represented as the product of three simply polynomials: +//.@:(*/)/ 0 1,1 1,:2 1 0 2 3 1 That gets us another way of expressing our original expression: 3 */\ i. 20 0 6 24 60 120 210 336 504 720 990 1320 1716 2184 2730 3360 4080 4896 5814

Re: [Jprogramming] How m"n shoulda been defined

2015-08-09 Thread Raul Miller
On Sun, Aug 9, 2015 at 9:20 AM, Henry Rich wrote: > If m"n had been defined consistently with the other partitioning modifiers, On a related note, no language can ever be completely consistent, because the human mind is always capable of finding new patterns. That said, the ;. family of verbs mi

Re: [Jprogramming] How m"n shoulda been defined

2015-08-09 Thread Raul Miller
Conciseness? I guess it's debatable whether constants with non-infinite rank are more or less common than gerunds which need to conform to the shape of their (eventual) verb argument. Perhaps it would be worthwhile collecting useful examples of each? I know I've used low-rank constants within the

Re: [Jprogramming] How m"n shoulda been defined

2015-08-09 Thread Raul Miller
t;> longer and I find that it better explains what I am trying to do. >> >> Marshall >> >> On Sun, Aug 09, 2015 at 02:45:11PM -0400, Raul Miller wrote: >>> >>> Conciseness? >>> >>> I guess it's debatable whether constants with non-infinite ra

Re: [Jprogramming] How m"n shoulda been defined

2015-08-09 Thread Raul Miller
selected verb to each cell. > > Henry Rich > > On 8/9/2015 6:38 PM, Raul Miller wrote: >> >> Hmm... but what should the effect be when the verbs in the gerund are >> not rank zero? >> > --

Re: [Jprogramming] unlock.ijs

2015-08-11 Thread Raul Miller
After chasing down some of the references from the responses to your question, I noticed this thread in comp.lang.c: https://groups.google.com/forum/#!topic/comp.lang.c/Z0mycsYvPyI/discussion But I do not think that that "weighting vector" is a good idea. On modern chip architectures, the occasion

Re: [Jprogramming] unlock.ijs

2015-08-11 Thread Raul Miller
On Tue, Aug 11, 2015 at 7:07 PM, Dan Bron wrote: > I’m not quite sure how you found that comp.lang.c thread, It was linked from an answer in http://stackoverflow.com/questions/30023867/how-can-i-work-with-dynamically-allocated-arbitrary-dimensional-arrays which in turn was linked from an answer t

Re: [Jprogramming] composite rank error

2015-08-11 Thread Raul Miller
A=:".;._2]0 :0 0 0 0.034 1 25 0.059 1.4 55 0.094 2 85 0 ) 2 2 1{"0 1 A |length error The length error is because the left argument has 3 items and the right argument has four items. So you would be getting index 2 from the first row of A, index 2 from the second row of A, in

Re: [Jprogramming] composite rank error

2015-08-12 Thread Raul Miller
Oops, I overlooked that issue. But of course, there is a way of giving rank to m - you just have to change the expression (use gerund form of } which extracts m out as an argument, for example). -- Raul On Wed, Aug 12, 2015 at 5:23 AM, Henry Rich wrote: > (2#,:2 2 1)}"1 _ > > } is an adverb.

Re: [Jprogramming] composite rank error

2015-08-13 Thread Raul Miller
)} (v2 y) > > and you can't put a rank on the selection operation that way either. > > Henry Rich > > On 8/12/2015 10:41 AM, Raul Miller wrote: >> >> Oops, I overlooked that issue. >> >> But of course, there is a way of giving

Re: [Jprogramming] ascii art

2015-08-13 Thread Raul Miller
I was surprised to find that neither Fractals Visualizations and J nor rosettacode.org currently has an implementation of hilbert curves. (I was also bemused to note that the google books entry for the Fractals book falsely claims that there's no ebook for it.) However, the forums do have some hi

Re: [Jprogramming] Bitwise operations utility

2015-08-13 Thread Raul Miller
You can also use set +H to make bash understand that ! means ! -- Raul On Thu, Aug 13, 2015 at 2:28 PM, David Lambert wrote: > I see the bitwise codes as great language design. Write in base 2 the > desired truth table for >#:i.4 > 0 0 > 0 1 > 1 0 > 1 1 > remembering, of course, to add 16

Re: [Jprogramming] Bitwise operations utility

2015-08-13 Thread Raul Miller
On Thu, Aug 13, 2015 at 5:15 PM, greg heil wrote: >>i wrote my undergraduate thesis (in APL) using the manipulation of Boolean >>matrices (categories, and many other algebra objects - with arbitrarily large >>sizes). i always disliked J because of its avowed anti-Boolean typology. >>Another thi

Re: [Jprogramming] Bitwise operations utility

2015-08-13 Thread Raul Miller
. i also contend there has >>been a long standing resistance to having such. There may be extenuating >>reasons, but it is definitely the poorer for those who would use such. > > greg > ~krsnadas.org > > -- > > from: Raul Miller > to: Programming forum > date

Re: [Jprogramming] Comparing pairs

2015-08-14 Thread Raul Miller
Or, for that specific example: d=: 2 -~/\ ] d i.5 1 1 1 1 -- Raul On Fri, Aug 14, 2015 at 10:40 AM, Roger Hui wrote: > What you want is "infix": > >2 <\ 3 1 4 1 5 9 > ┌───┬───┬───┬───┬───┐ > │3 1│1 4│4 1│1 5│5 9│ > └───┴───┴───┴───┴───┘ >2 -/\ 3 1 4 1 5 9 > 2 _3 3 _4 _4 > > > > >

Re: [Jprogramming] Regex vs I./E. for pattern matching

2015-08-16 Thread Raul Miller
Yes? E. is faster than rxmatches precisely because it is less powerful. And note that you could also use ;: (but the trace operation is 5x larger than you need and most people don't like making state machines). -- Raul On Sun, Aug 16, 2015 at 2:09 AM, Jon Hough wrote: > I recently went throu

Re: [Jprogramming] oneliner ?

2015-08-23 Thread Raul Miller
My version would be ([: ]/. ]"0/~)&|.&.;: Thanks, -- Raul On Sun, Aug 23, 2015 at 3:54 PM, 'Pascal Jasmin' via Programming wrote: > as a shorter verb > > ([: |. |./.@:(##,:)&.;:) 'O do please stop' > > > > - Original Message - > From: Mike Day > To: programm...@jsoftware.com > Cc:

Re: [Jprogramming] oneliner ?

2015-08-24 Thread Raul Miller
> > > > │+- /. --- ] > > > > -++ -- ] > > > >││L- ~ / --- " -+- 0 > > > > -- &. -+L- |. > > > >L- ;: > > > > > > > > > >

Re: [Jprogramming] Website 404

2015-08-25 Thread Raul Miller
Note the difference in urls. The url you originally posted needs "help/". http://www.jsoftware.com/dictionary/contents.htm The working url is: http://www.jsoftware.com/help/dictionary/contents.htm So the question about where you found the invalid url is a pertinent one, if we want to reduce th

Re: [Jprogramming] ic/ 3!:4 on osX

2015-08-25 Thread Raul Miller
On Tue, Aug 25, 2015 at 12:20 PM, Joey K Tuttle wrote: > profile, which SHALL use value "II". The next two bytes contain the value > 42, which identifies the file as a TIFF file and is ordered according to the > value in the first two bytes of the header. The last four bytes give the ... > This s

Re: [Jprogramming] Format a floating number without rounding errors

2015-08-26 Thread Raul Miller
I think you mean Ian Clark's verb??? Thanks, -- Raul On Wed, Aug 26, 2015 at 2:12 AM, Linda Alvord wrote: > If you begin by writing Raul's idea as an explicit definition, J selects a > different choice than his version. However, you can write and explicit > definition to produce his verb. >

Re: [Jprogramming] Pattern Puzzle

2015-08-31 Thread Raul Miller
You do not actually need the inner parenthesis here (| i.@,~@>:)3 0 1 2 0 1 2 0 1 2 0 1 2 0 1 2 0 Though even with that change, Mike Day's approach is still more concise, (and more efficient, in space and time): (i.$~2#>:) 3 0 1 2 0 1 2 0 1 2 0 1 2 0 1 2 0 timespacex '(| i.@,~@>:)1000'

Re: [Jprogramming] forward substitution and Back substitution for LU decamp and the like

2015-08-31 Thread Raul Miller
Can you double check whether you have posted what you intended? I get b1 %. A1 4.15625 1.375 _0.635417 L1 forsub b1 5 1.375 _0.635417 U1 baksub L1 forsub b1 0.517014 0.941667 _0.0635417 which does not correspond to the result you displayed. Thanks, -- Raul On Mon, Aug 31, 2015 at 9:5

Re: [Jprogramming] forward substitution and Back substitution for LU decamp and the like

2015-09-01 Thread Raul Miller
1 are >L1 > 1 0 0 > 2 _8 0 > 3 _15 _12 > >U1 > 1 2 3 > 0 1 0 > 0 0 1 > > b1 =: 5 18 6 NB. this is the right hand side of a system of equations of > the for Ax = b > > Matrix divide solution >b1 %. A1 > 1 _1 2 > > Solution using

Re: [Jprogramming] video: Ulam's Spiral

2015-09-01 Thread Raul Miller
Here's another copy of that particular essay: http://www.jsoftware.com/papers/play132.htm That said, picking up the book can certainly have some advantages. Thanks, -- Raul On Tue, Sep 1, 2015 at 2:35 AM, Rob Hodgkinson wrote: > Very nice work Michael, well presented and interesting !! > >

Re: [Jprogramming] video: Ulam's Spiral

2015-09-01 Thread Raul Miller
>timespacex '(1=#@q:) 1+i.1e7' > 14.7121 4.19433e8 >timespacex '1 p: 1+i.1e7' > 3.10132 2.85214e8 > > Best, > Marc > > On Tue, Sep 1, 2015 at 3:56 PM, Raul Miller wrote: >> Here's another copy of that particular essay: >>

Re: [Jprogramming] Comparing J speed

2015-09-01 Thread Raul Miller
There's a variety of fibonacci implementations at http://www.jsoftware.com/jwiki/Essays/Fibonacci%20Sequence I haven't looked at their timings, but you might find something interesting there. Good luck, -- Raul On Tue, Sep 1, 2015 at 8:32 PM, Jon Hough wrote: > In this talk https://www.youtu

Re: [Jprogramming] forward substitution and Back substitution for LU decamp and the like

2015-09-01 Thread Raul Miller
On Tue, Sep 1, 2015 at 11:42 PM, Thomas McGuire wrote: > Thanks I will try out your changes. Though in my implementation I was trying > to avoid multiplying the zero entries and your routines ignore that. Yep. It's slower to toss them than it is to just ignore them. Reason being that you're mak

Re: [Jprogramming] Comparing J speed

2015-09-01 Thread Raul Miller
Actually, thinking about this, the performance for finding the 475000th fibonacci number is going to be dominated by the performance of extended precision addition (it's much larger than the largest representable floating point number). And J's current implementation while rather portable is not op

Re: [Jprogramming] Comparing J speed

2015-09-02 Thread Raul Miller
But of course, J is GPL'd now, so it's now legal to use GMP in J. Someone's still going to need to do the integration work, of course... (And it may very well be that that will expose some difficult corner cases.) -- Raul On Wed, Sep 2, 2015 at 3:50 AM, aai wrote: > The main reason for speed

Re: [Jprogramming] Comparing J speed

2015-09-02 Thread Raul Miller
On Wed, Sep 2, 2015 at 10:56 AM, Mike Day wrote: > The Haskell implementation must be really tight, though. > Rademacher talks about lazy evaluation, but his function > _appears_ to employ a list of all prior Fibonacci numbers > to produce the required element. I suppose the zip and > tail func

Re: [Jprogramming] Comparing J speed

2015-09-02 Thread Raul Miller
On Wed, Sep 2, 2015 at 1:17 PM, 'Pascal Jasmin' via Programming > sslp =: IFWIN pick '';'D:\OpenSSL-Win64\bin\' I don't have that directory on any of my machines. This probably belongs in some other thread, also? Thanks, -- Raul -

Re: [Jprogramming] forward substitution and Back substitution for LU decamp and the like

2015-09-02 Thread Raul Miller
On Wed, Sep 2, 2015 at 3:17 PM, Mike Day wrote: > nicely concise. I feel there's a closed form hiding in there > somewhere, to replace the explicit loop, but haven't found > it yet! baksub looks like it could be done using u/\. but forsub would have to be some sort of u/&|.\ expression. -- Ra

Re: [Jprogramming] BigNum library from openssl

2015-09-02 Thread Raul Miller
On Wed, Sep 2, 2015 at 3:28 PM, 'Pascal Jasmin' via Programming wrote: > I don't really know what gets returned yet, but what is worrysome is that > repeated calls return slightly different values. This crashes J bn2dec a So it's wrong, and if you get a result at all you shouldn't be surpris

Re: [Jprogramming] A good remix

2015-09-04 Thread Raul Miller
Here is what I believe is a literal translation of mix: lim=:2^32 xor=:22 b. mix=:3 :0 a=:lim|a xor lim|b*2048 d=:lim|d+a b=:(lim|b+c) xor <.c%4 e=:lim|e+b c=:(lim|c+d) xor lim|d*256 f=:lim|f+c d=:(lim|d+e) xor <.e%65536 g=:lim|g+d e=:(lim|e+f) xor lim|f*1024 h=:lim|h+e f=:(

Re: [Jprogramming] Read JPEG files with graphics addon

2015-09-04 Thread Raul Miller
Note that you don't need the _z_ on the name unless you have defined your own jpath. This should work just fine: readjpeg jpath '~/Path/to/image.jpg' Thanks, -- Raul On Fri, Sep 4, 2015 at 11:51 PM, Jon Hough wrote: > Thanks, > > readjpeg jpath_z_ '~/Path/to/image.jpg' > > > works. > > >

Re: [Jprogramming] A good remix

2015-09-05 Thread Raul Miller
Nice. Except, I prefer shift to take the number of bits as a left argument. Also, there's still the matter of doing it tacitly. So, here's my rephrasing of your excellent work, for the explicit mix: top=: <:2^32 SH =: top AND 34 b. NB. 32 bit shift MP =: top AND + NB. 32 bit addition ("modplus")

Re: [Jprogramming] A good remix

2015-09-05 Thread Raul Miller
Mario Quintana wrote: >emix i.8 > 68112070 67580715 540296643 2058 539239185 529307 67580712 539769534 > >umix i.8 > |length error: SH > | umix i.8 > |[-23] > > ? > > > On Sat, Sep 5, 2015 at 10:50 AM, Raul Miller wrote: > >> Nice. >&

Re: [Jprogramming] A good remix

2015-09-05 Thread Raul Miller
ing. > > Thanks, > > -- > Raul > > > On Sat, Sep 5, 2015 at 7:00 PM, Jose Mario Quintana > wrote: >>emix i.8 >> 68112070 67580715 540296643 2058 539239185 529307 67580712 539769534 >> >>umix i.8 >> |length error: SH >> |

Re: [Jprogramming] A good remix

2015-09-05 Thread Raul Miller
Meh... I misremembered when I wrote this: this was wrong. Sorry about that. -- Raul On Sat, Sep 5, 2015 at 8:24 PM, Raul Miller wrote: > Oops, I should have included example uses. > > umix is a dyad - you need to give it a left argument saying how many > times you want it to

Re: [Jprogramming] A good remix

2015-09-06 Thread Raul Miller
──┐ > │68112070 67580715 540296643 2058 539239185 529307 67580712 539769534│ > ├┤ > │68112070 67580715 540296643 2058 539239185 529307 67580712 539769534│ > ├────────

Re: [Jprogramming] Lousy documentation

2015-09-08 Thread Raul Miller
On Tue, Sep 8, 2015 at 9:26 PM, Jo van Schalkwyk wrote: > It's a tribute to mankind's collective ability to self-deceive that the > damn language has taken such a hold. I similarly let rip on Quora recently > (pasted below, far too long, but might amuse). Nah... it's other issues. Probably bette

Re: [Jprogramming] Timer

2015-09-10 Thread Raul Miller
If I go to the menus: Help > Studio > Qt Demos... and select the timer demo, it displays this text for me: There are 2 timers - the system timer, and the form timer. There is only one system timer, while any number of form may have timers. Exa

Re: [Jprogramming] Removing not 7 bit ASCII code for a huge file

2015-09-11 Thread Raul Miller
Does it work if you disable utf8 support in regex? RX_OPTIONS_UTF8_jregex_=: 0 Thanks, -- Raul On Fri, Sep 11, 2015 at 5:42 AM, Strale wrote: > Hello > > I have a very big file 3 G Bytes and I need to make some search on it :( > data is 8 bit char data > > J open it without problem > but I h

Re: [Jprogramming] +. does not always work

2015-09-11 Thread Raul Miller
Does this help? +./ 0.711*t=:?100#100 1.01585e_13 +./ x:0.711*t 711r1000 Thanks, -- Raul On Fri, Sep 11, 2015 at 9:14 PM, 'Bo Jacoby' via Programming wrote: > How do I make it less sensitive to round-off errors?Thank you.- Bo >+./ 0.711*?100#1000.711 >+./ 0.711*?100#1001.28453e

Re: [Jprogramming] Changing the text of a menu item

2015-09-13 Thread Raul Miller
I'm not quite following your argument, Ian. It seems to me that if all windows owned by the JQt app must all have the same menu that this forbids user-defined menus. Is that really what you are saying J should be doing? Thanks, -- Raul On Sun, Sep 13, 2015 at 9:28 PM, Ian Clark wrote: > @Bi

Re: [Jprogramming] Changing the text of a menu item

2015-09-15 Thread Raul Miller
atures. > > The "proper" design for OS X isn't fit for Windows -- and vice-versa. > You don't need to be a conspiracy theorist to know this is (-was) > intentional on the part of M$. Remember the "look and feel" lawsuit? > > On Mon, Sep 14, 2015 at 3:5

Re: [Jprogramming] Changing the text of a menu item

2015-09-15 Thread Raul Miller
, Sep 15, 2015 at 1:36 PM, Ian Clark wrote: > @Raul - answer me this first: is a (collection of) "user-defined menus" > > (a) an app in its own right? or- > > (b) an extension of the J app? > > On Tue, Sep 15, 2015 at 1:46 PM, Raul Miller wrote: >> I'm sti

Re: [Jprogramming] Changing the text of a menu item

2015-09-15 Thread Raul Miller
o" - and here's a kludge to do it. The customers neither knew > nor cared that they were falling between two stools. They didn't even > want a usable UI – what price your job if any fool can do it? They > simply didn't want to look like dinosaurs. > > The price p

Re: [Jprogramming] Changing the text of a menu item

2015-09-15 Thread Raul Miller
Presumably the solution then would be to write a document using the terms you expect which links them up with J? (Much like Henry Rich's J for C Programmers?) That said, I think there's other problems issues with search (perhaps related to search engines placing too much load on J's website?). It

Re: [Jprogramming] Changing the text of a menu item

2015-09-16 Thread Raul Miller
I've dropped programming forum and moved to chat forum. For people not subscribed to chat, here's the current (or transitional) chat forum responses in this thread: Marc Simpson: http://jsoftware.com/pipermail/chat/2015-September/006739.html Me: http://jsoftware.com/pipermail/chat/2015-September/

Re: [Jprogramming] An adverb for a loopy algorithm

2015-09-16 Thread Raul Miller
combT =: ([: ; ([ ; [: i.@>: -~) ((1 {:: [) ,.&.> [: ,&.>/. >:&.>@:]):(0 {:: [) (:@:+/)@:(] ((<./@] I.@:= ]) {.@,. (<./@] I.@:= [ >@{~ <./@] I.@:= ])) <./ every)@:(([: +/ *:@-/@,:)tritable)) p' 0.000201414 35712% 5.13156e_5 39680 timespacex '(#~ [: (] = <./) ([:+/"1 *:@-/)"_1)@:({~ 2 comb #

Re: [Jprogramming] jconsole linux platform: delete / insert keys

2015-09-18 Thread Raul Miller
First off, there's multiple ways you might have installed J, and you seem to be using an older version. You might try upgrading to a current version. That said, here's what I looked at, and if you want to try debugging your old version, these steps might tell you what went wrong on your system: W

Re: [Jprogramming] Finding all cycles in a graph

2015-09-18 Thread Raul Miller
Looks like your code works? Are you looking for alternatives? Thanks, -- Raul On Fri, Sep 18, 2015 at 9:09 AM, Devon McCormick wrote: > Hi - > > The first piece of your code is ungrammatical: > > CONCOMP=. connected_components y > a:-.~ component_cycles&.> CONCOMP > ) > > Is there something

Re: [Jprogramming] Finding all cycles in a graph

2015-09-18 Thread Raul Miller
27;Jon Hough' via Programming wrote: > Well yes, just wondering if there is a better way to do it. This isn't for > work or anything, its just a bit of fun. > My code struggles with k6 and k7 seems to fail to return. I.e. the cycle > finding loop is too big ( it isn't infini

Re: [Jprogramming] Arrayfire (OpenCl/Cuda Blas Boost)

2015-09-20 Thread Raul Miller
I don't think anyone has been working on this. Note also that J's arrays are built on a C infrastructure where a pair of one dimensional arrays (shape and data) represent an arbitrary dimensioned J array. That said... how hard do you think it would be to implement the rank conjunction? (Rank migh

Re: [Jprogramming] Arrayfire (OpenCl/Cuda Blas Boost)

2015-09-20 Thread Raul Miller
into the official > distribution? > > Henry Rich > > On 9/20/2015 11:22 PM, Raul Miller wrote: >> >> I don't think anyone has been working on this. >> >> Note also that J's arrays are built on a C infrastructure where a pair >> of one dimensional

Re: [Jprogramming] Arrayfire (OpenCl/Cuda Blas Boost)

2015-09-20 Thread Raul Miller
y, you would call with 0 1;(seq 0 _1). For > columns 1 and 2, call (seq 0 _1);1 2. One problem though is that the name of > the function to call is 'operator()' . Is such a name bindable in J? > > > > > - Original Message - > From: Raul Miller

Re: [Jprogramming] dll error passing pointer to integer

2015-09-21 Thread Raul Miller
Compiler can choose whatever integer type it deems appropriate to hold an enum. So it's going to depend on what compiler built the dll. -- Raul On Mon, Sep 21, 2015 at 3:04 PM, 'Pascal Jasmin' via Programming wrote: > its a 64bit dll, posting code I have so far (though doesn't work) > > requi

Re: [Jprogramming] explanation?

2015-09-23 Thread Raul Miller
This? http://jsoftware.com/jwiki/System/Interpreter/Bugs#numeric_dyad_E._corrupts_memory -- Raul On Wed, Sep 23, 2015 at 5:36 PM, Henry Rich wrote: > There was an optimization for E., and that broke E. for non-character > arguments. Some integer arguments will crash J. > > Henry Rich > > > O

Re: [Jprogramming] explanation?

2015-09-23 Thread Raul Miller
n Wed, Sep 23, 2015 at 7:32 PM, Henry Rich wrote: > Yeah. > > Henry Rich > > On 9/23/2015 7:30 PM, Raul Miller wrote: >> >> This? >> >> >> http://jsoftware.com/jwiki/System/Interpreter/Bugs#numeric_dyad_E._corrupts_memory >> > > -

<    1   2   3   4   5   6   7   8   9   10   >