Re: [Jprogramming] font with extended ascii? -display binary data

2014-03-28 Thread bill lam
Thanks. Your problem is un-related to extended ascii or fonts. What you told j ide to do was to display some illegal utf8 characters. GIGO. I prefer to see some rubbish rather than something that appeared to be valid. ymmv. 29.03.2014, в 12:35, Pascal Jasmin написал(а): > 4 64 $ a. > > does

Re: [Jprogramming] font with extended ascii? -display binary data

2014-03-28 Thread Pascal Jasmin
4 64 $ a. does not display extended ascii with any font. u: 4 64 $ a. does with the default font and many others. - Original Message - From: bill lam To: programm...@jsoftware.com Cc: Sent: Friday, March 28, 2014 11:30:35 PM Subject: Re: [Jprogramming] font with extended ascii? -disp

Re: [Jprogramming] font with extended ascii? -display binary data

2014-03-28 Thread bill lam
I cannot understand your problem, you said lucida console workes and then said it cannot display extended ascii. May be you can show some J script with envioronment detail to reproduce the problem and post screen-shots some where else. Пт, 28 мар 2014, Pascal Jasmin писал(а): > I'm on windows.  

Re: [Jprogramming] font with extended ascii? -display binary data

2014-03-28 Thread Pascal Jasmin
I'm on windows.  Tried in J6 and j8qt to set font to wingdings, and it did not display extended characters either. I assume its not a font issue, because u: a. displays fine in the default QT font (lucida console on windows).  Font's that appear to have extended ascii characters display a ? ins

Re: [Jprogramming] font with extended ascii? -display binary data

2014-03-28 Thread bill lam
I guess they are issues. You have to select a font with all glyphs for latin-1 first. Try unifont or some apl fonts if they are available on mac. Display control characters or illegal utf8 characters is another issue. How j ide interpret and display box characters is yet another issue. 29.03.2

Re: [Jprogramming] font with extended ascii? -display binary data

2014-03-28 Thread Pascal Jasmin
j7 (gtk) displays octal for binary data it decides that it can't print.  J8 and jhs shows a pretty glyph in the same font, but its the same glyph for every char > 127. The proposal is why not display them as   u: 4 64 $ a. ┌┬┐├┼┤└┴┘│─  I assume are special coded already? - Original Mess

Re: [Jprogramming] font with extended ascii? -display binary data

2014-03-28 Thread bill lam
If you meant display them as octal like \123 then the ide must also escape all \ otherwise you cannot distinguish between textual and binary data, meaning the sum scan would displayed as +/\\ i.5 29.03.2014, в 0:11, Pascal Jasmin написал(а): > J stores the full 8 bits of binary data. There v

Re: [Jprogramming] space in file names?

2014-03-28 Thread Raul Miller
Aha! Thank you! I tested that and it worked. Wonderful observation, I'm impressed. This kind of thing should probably be documented in task.ijs (currently doumented as living at ~Source/api/task/task). Since I've not heard from Oleg for years, I wonder who maintains that? Thanks again, -- Raul

Re: [Jprogramming] Applied APL - How to think like an APL programmer?

2014-03-28 Thread Jose Mario Quintana
(!+/~)@i.11 1 1 1 1111 1 1 1 1 1 2 3 4567 8 910 11 1 3 6 10 15 21 28364555 66 1 4 10 20 35 56 84 120 165 220286 1 5 15 35 70 126 210 330 495 715 1001 1 6 21 56 126 252

Re: [Jprogramming] 2048

2014-03-28 Thread Pascal Jasmin
game is evil timewaster.  Some thoughts were here:  http://stackoverflow.com/questions/22342854/what-is-the-optimal-algorithm-for-the-game-2048.  The key implementation detail is that new tiles are in a random location with 90% probability of 2 and 10% of 4. heuristics that work: keep largest

Re: [Jprogramming] 2048

2014-03-28 Thread Zachary Elliott
The first issue would be that the blocks appear in a stochastic fashion. -- For information about J forums see http://www.jsoftware.com/forums.htm

[Jprogramming] 2048

2014-03-28 Thread Richard Donovan
Has anyone tried the game "2048" on http://gabrielecirulli.github.io/2048/ with the possibility of writing a J routine to solve it? For those who haven't tried it it's a very compelling number / logic game that I think is possibly solvable in J but I don't have the necessary experience to do it

Re: [Jprogramming] space in file names?

2014-03-28 Thread Joe Bogner
One more for good measure (if the double double quotes are irritating) shell 'cmd /c "C:\Program Files (x86)\Audacity\Audacity.exe"' or shell 'cmd /c "%ProgramFiles(x86)%\Audacity\Audacity.exe"' On Fri, Mar 28, 2014 at 5:04 PM, Joe Bogner wrote: > This works for me - double set of double

Re: [Jprogramming] space in file names?

2014-03-28 Thread Joe Bogner
This works for me - double set of double quotes shell '""C:\Program Files (x86)\Audacity\Audacity.exe""' You can also get fancy with shell '""%ProgramFiles(x86)%\Audacity\Audacity.exe""' and shell '""%ProgramFiles%\Audacity\Audacity.exe""' Maybe have some logic to check both places to see

Re: [Jprogramming] space in file names?

2014-03-28 Thread Raul Miller
Hmm... it does look like PROGRA~2 is a relatively stable reference to c:\Program Files (x86). But %20 does not work as a replacement for the space character. I suppose another workaround is to generate a *.bat file in some location without spaces in the name and run that (perhaps using cmd /c or

Re: [Jprogramming] font with extended ascii? -display binary data

2014-03-28 Thread Raul Miller
On Fri, Mar 28, 2014 at 12:11 PM, Pascal Jasmin wrote: > J stores the full 8 bits of binary data. There very well may be a great > reason not to provide a friendly display for binary data, I just don't see > it yet. > Yes. Keep in mind, it's not J that displays the data - at least not directly.

Re: [Jprogramming] Applied APL - How to think like an APL programmer?

2014-03-28 Thread Raul Miller
On Fri, Mar 28, 2014 at 2:50 PM, Linda Alvord wrote: > >0^i.4 > 1 0 0 0 >(i.4)^0 > 1 1 1 1 > > One or Zero? Both could be right some of the time, and both answers can't > be > right all of the time. Why not? I'm not saying that your assertion is incorrect, but I am asking you to explain

Re: [Jprogramming] Applied APL - How to think like an APL programmer?

2014-03-28 Thread Roger Hui
I once encountered a book where the author was aware of the 0^0 "issue" but had to have lots of polynomials in the book. So he wrote, multiple times, n p(x) = a0 + sigma ai xi i=1 Yuck. On Fri, Mar 28, 2014 at 11:50 AM, Linda Alvord wrote: >

Re: [Jprogramming] Applied APL - How to think like an APL programmer?

2014-03-28 Thread Linda Alvord
0^i.4 1 0 0 0 (i.4)^0 1 1 1 1 One or Zero? Both could be right some of the time, and both answers can't be right all of the time. So isn't the question - Which will be the most useful most of time and cause the fewest problems most of the time. When that is not a good choice for you, sinc

Re: [Jprogramming] apply verb to filtered list

2014-03-28 Thread R.E. Boss
Borrowing from Guinn: 1 0 1 0 } (,:~(+: :: ])L:0) 4;'a';3;6 +-+-+-+--+ |4|a|3|12| +-+-+-+--+ R.E. Boss (Add your info to http://www.jsoftware.com/jwiki/Community/Demographics ) > -Original Message- > From: programming-boun...@forums.jsoftware.com [mailto:programming- > boun...@foru

Re: [Jprogramming] Applied APL - How to think like an APL programmer?

2014-03-28 Thread Raul Miller
Pollution is a good choice of words here. There's a problem in assuming that = always has the same meaning. There's another problem in assuming that textbooks are accurate. These are typically not big problems, but they are (from some points of view) significant problems (and the scale of these pr

Re: [Jprogramming] font with extended ascii? -display binary data

2014-03-28 Thread Pascal Jasmin
J stores the full 8 bits of binary data.  There very well may be a great reason not to provide a friendly display for binary data, I just don't see it yet. On another note, there seems to be a case for an extra dyad form for u: .  Say 9 u: It would behave as monad u: does for char and wchar, bu

Re: [Jprogramming] font with extended ascii? -display binary data

2014-03-28 Thread Pascal Jasmin
thank you Raul, On further thought, it appears to be impractical to use larger than base 128 for binary encoding. A friendlier display of my numeric list compression routine is possible though u: BASE128 =: BASE64 , a.{~ 192 + i.64     u:  compresslistnum   100239482039420348x 2 248 +"1

[Jprogramming] font with extended ascii? -display binary data

2014-03-28 Thread Pascal Jasmin
Jqt uses menlo as default font.  Printing binary data over 127 all produce identical "not found" glyphs.  Is it a font issue? and is there a  fixed width font that would display extended ascii as this list (or as much of it as possible)? iso-latin 1?  Is there some informal code page that shows

Re: [Jprogramming] font with extended ascii? -display binary data

2014-03-28 Thread Raul Miller
"Normal ascii" occupies only 7 bits, so it's 128{.a. (or u: i.128). The problems created by what to do with the other half of they byte (along with our love/hate relationship with standards and professionalism) have a lot to do with why we are using ascii instead of ebcdic. Thanks, -- Raul O

Re: [Jprogramming] font with extended ascii? -display binary data

2014-03-28 Thread Raul Miller
There's http://www.unicode.org/charts/PDF/U0080.pdf But it's not an informal page. 240-248 corresponds to the rightmost column (the one with the caption 00F), and the top half of that column (00F0 through 00F8 in the small print at the bottom of each cell). Thanks, -- Raul On Fri, Mar 28, 2

Re: [Jprogramming] apply verb to filtered list

2014-03-28 Thread Raul Miller
What do you mean by "misbehave"? Note that the original specification was that adv behaves like this: 1 0 1 +: adv 2;'a'; 3 4 1 6 This takes a boxed argument and produces a numeric result. The implication is that a 1 in the left argument corresponds to unboxing the corresponding element in t

Re: [Jprogramming] lost art

2014-03-28 Thread Raul Miller
Note however: split ;:'this is an example' ┌──┬───┐ │┌┐│┌──┬──┬───┐│ ││this│││is│an│example││ │└┘│└──┴──┴───┘│ └──┴───┘ 13 :' ({.y);}.y' ;:'this is an example' ┌──┬──┬──┬───┐ │┌┐│is│an│example│ ││this││ │ │ │ │└┘│ │ │

Re: [Jprogramming] space in file names?

2014-03-28 Thread Raul Miller
Did that. That works. But that requirement is broken - it means that the program cannot be easily ported from one machine to another without a bunch of extra code. Now, granted, this brokenness is really a reflection of Microsoft's design. And presumably someone is getting paid good money for pers

Re: [Jprogramming] apply verb to filtered list

2014-03-28 Thread Pascal Jasmin
the difficlty I was having was that @.1 0 1 or ^:1 0 1 are errors or weird, even when I try to turn the noun into a verb that should produce identical result to [.      +:^:(1 0 1"_ 1) 2 1 3 4 2 6 2 1 3 4 2 6 Its hard to understand the magic of ^:[ , but a side effect is that a dyadic u (that

Re: [Jprogramming] apply verb to filtered list

2014-03-28 Thread Don Guinn
If the intent is to do the verb only on numerics you can avoid having to build f by (+: :: ])&.>list +-+-+-+ |4|a|6| +-+-+-+ On Fri, Mar 28, 2014 at 2:49 AM, Brian Schott wrote: > No, I see my variation does not compute when 0 corresponds with 'a'. > > > > > -- > (B=) > --

Re: [Jprogramming] Applied APL - How to think like an APL programmer?

2014-03-28 Thread Bo Jacoby
The wikipedia article on exponentiation https://en.wikipedia.org/wiki/Exponentiation#Zero_exponent is polluted by warnings against setting (0^0)=1. I have had a very long discussion on the talk page https://en.wikipedia.org/wiki/Talk:Exponentiation You may consider offering support to the po

Re: [Jprogramming] space in file names?

2014-03-28 Thread Mike Day
However, I thought you DID need the double quotes if there were likely to be spaces. The single quotes are obviously lost in translation. Mike On 28/03/2014 05:58, bill lam wrote: IIRC the program name does not need dquote for shell cmd. 28.03.2014, в 13:35, Raul Miller написал(а): re

Re: [Jprogramming] space in file names?

2014-03-28 Thread Mike Day
That's odd. I thought it wouldn't work for me either, but I tried: require 'task' shell '"C:\Program Files (x86)\Dev-Cpp\bigint-4-0-exe\bigInt.exe"' ... 0xf000 < 0xfedcba9876543210 = TRUE 0xf000 < 0xfffe = TRUE 0xf000 < 0x =

Re: [Jprogramming] lost art

2014-03-28 Thread Linda Alvord
Nice example. A=:'ABCDEFGHIJKLMNOPQRSTUVWXYZ' f=: 13 :' ({.y);}.y' f A ┌─┬─┐ │A│BCDEFGHIJKLMNOPQRSTUVWXYZ│ └─┴─┘ 7 f A ┌───┬───┐ │ABCDEFG│HIJKLMNOPQRSTUVWXYZ│ └───┴───┘ f {. ; }. -Origi

[Jprogramming] space in file names?

2014-03-28 Thread David Lambert
Use an alternate 8 character name '"C:\Progra~2\Audacity\audacity.exe"' or possibly '"C:\Program Files%20(x86)\Audacity\audacity.exe"' Date: Fri, 28 Mar 2014 01:35:58 -0400 From: Raul Miller To: Programming forum Subject: [Jprogramming] space in file names? Message-ID: Content-Type: te

Re: [Jprogramming] compressing numeric lists

2014-03-28 Thread Pascal Jasmin
Interesting how it doesn't work for sparse arrays.  I thought it was impossible to have boxed elements in sparse arrays, but: (j7)    <@afd"0 $. 0 0 4 0 3 2 │ ┌─┐ 4 │ │\004│   │ ├─┤   │ │\003│   │ └─┘ it compresses to an answer, but that answer seems wrong.  You can use compresslr on the sparse

Re: [Jprogramming] Applied APL - How to think like an APL programmer?

2014-03-28 Thread Marc Simpson
Simplified: (!+/~)i.11 On Fri, Mar 28, 2014 at 9:06 AM, Pascal Jasmin wrote: > well done, > > the tacit version: > > (] !"1 +/~) i.11 > > > > - Original Message - > From: Bo Jacoby > To: "programm...@jsoftware.com" > Cc: > Sent: Friday, March 28, 2014 3:23:06 AM > Subject: Re: [Jpro

Re: [Jprogramming] Applied APL - How to think like an APL programmer?

2014-03-28 Thread Pascal Jasmin
well done, the tacit version: (] !"1 +/~) i.11 - Original Message - From: Bo Jacoby To: "programm...@jsoftware.com" Cc: Sent: Friday, March 28, 2014 3:23:06 AM Subject: Re: [Jprogramming] Applied APL - How to think like an APL programmer? "his table on page 105 looks interest

Re: [Jprogramming] apply verb to filtered list

2014-03-28 Thread Brian Schott
No, I see my variation does not compute when 0 corresponds with 'a'. -- (B=) -- For information about J forums see http://www.jsoftware.com/forums.htm

Re: [Jprogramming] apply verb to filtered list

2014-03-28 Thread Brian Schott
Raul, Your adv is really slick but I think it misbehaves with a numeric value coinciding with zero. I have suggested a variation. adv=: (@])(1:`)(@.[)(&>) 1 0 1 +: adv 2;'a'; 3 4 1 6 1 0 1 +: adv 2;2; 3 4 1 6 adv=: (@])(]`)(@.[)(&>) 1 0 1 +: adv 2;2; 3 4 2 6 On Thu, Mar 2

Re: [Jprogramming] Applied APL - How to think like an APL programmer?

2014-03-28 Thread Bo Jacoby
"his table on page 105 looks interesting.  I wonder what is the shortest J expression that can reproduce it" This one may not be the shortest, but it works:      n!"1 n+/n=.i.11 Den 0:07 fredag den 28. marts 2014 skrev Jose Mario Quintana : Was Wallis himself the first to assume x^0 =1

Re: [Jprogramming] Applied APL - How to think like an APL programmer?

2014-03-28 Thread Steven Taylor
Is it worth asking Knuth? He's still on email. It sounds like Ken's influence needs more credit. If the first email client was by ipsharp then maybe the horse has bolted on that too though. -Steven On 27 Mar 2014, at 23:06, Jose Mario Quintana wrote: > Was Wallis himself the first to ass

Re: [Jprogramming] create matrix from diagonal

2014-03-28 Thread Zsbán Ambrus
You've already posted the simple solutions, but just for variation, here are two less simple ones. These should work for any numeric list. (|.@{."0~#\) 3 1 4 1 5 3 0 0 0 0 0 1 0 0 0 0 0 4 0 0 0 0 0 1 0 0 0 0 0 5 (-@#{.{:)\ 3 1 4 1 5 3 0 0 0 0 0 1 0 0 0 0 0 4 0 0 0 0 0 1 0 0 0 0 0 5 -- Am