Re: [Jbeta] data transfer fixes

2012-06-20 Thread Devon McCormick
I've only been skimming these i-pad discussions, but thought I would
offer this: I recently wrote a base-64 encoder/decoder if that would
help with these transfer problems - it's really more suited for image
encoding-ASCII subset but you could use it for general HTML.

NB.* base64.ijs: encode and decode base-64 strings.

B64=: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
b64decode=: B64([: #. _8 ]\ [: , 2 2 2 2 2 2 #: i.)
NB.EG (a.{~b64decode pngeg) fwrite 'mandelSample64x64.png'
b64encode=: B64([ {~ [:#. _6 ]\ [: , (8$2) #: ])
NB.EG pngeg=. b64encode a. i. fread 'mandelSample64x64.png'


On Wed, Jun 20, 2012 at 12:00 AM,  beta-requ...@jsoftware.com wrote:
...
 Message: 1
 Date: Tue, 19 Jun 2012 14:31:10 -0500
 From: John Baker bakerj...@gmail.com
 Subject: Re: [Jbeta] data transfer fixes
 To: Beta forum beta@jsoftware.com
 Message-ID:
        CABc=tnzaooxxj67v6akjnbut29wzu1mbc0c-4duagusokpz...@mail.gmail.com
 Content-Type: text/plain; charset=UTF-8

 A good test would be to use HTML source in place of J scripts. If  the
 unmangle recovers the original it's probably good enough.

 I've long used wrapped

 txt=: LF, fread '~temp/t.ijs'
 enc=: 5!:5 'txt'

 It expands the scripts but completely eliminates delimiters that may
 clash with HTML

 On Tue, Jun 19, 2012 at 2:15 PM, Eric Iverson eric.b.iver...@gmail.com 
 wrote:
 I thought the minimal mangling done was sufficient (assuming it is properly
 undone at the receiver).

 Why do you think the mangling is defficient? It is intended to handle html
 and html fragments and in my simple tests it did?
...
-- 
Devon McCormick, CFA
^me^ at acm.
org is my
preferred e-mail
--
For information about J forums see http://www.jsoftware.com/forums.htm

Re: [Jbeta] data transfer fixes

2012-06-20 Thread Eric Iverson
Thanks. At this point I think we are dealing with a very simple subset and
the current solution works. At least until I see a counter example.

What is being done here is the text file is in the html response stream as
the content for a textarea. All that is needed to see that this goes as
intended is to map  to amp; and  to lt; and this seems to get the
desired text in the textarea. Copying this to the clipboard reverses these
mappings by virtue of the built in clipboard conversion of html to text.

On Wed, Jun 20, 2012 at 11:58 AM, Devon McCormick devon...@gmail.comwrote:

 I've only been skimming these i-pad discussions, but thought I would
 offer this: I recently wrote a base-64 encoder/decoder if that would
 help with these transfer problems - it's really more suited for image
 encoding-ASCII subset but you could use it for general HTML.

 NB.* base64.ijs: encode and decode base-64 strings.

 B64=: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
 b64decode=: B64([: #. _8 ]\ [: , 2 2 2 2 2 2 #: i.)
 NB.EG (a.{~b64decode pngeg) fwrite 'mandelSample64x64.png'
 b64encode=: B64([ {~ [:#. _6 ]\ [: , (8$2) #: ])
 NB.EG pngeg=. b64encode a. i. fread 'mandelSample64x64.png'


 On Wed, Jun 20, 2012 at 12:00 AM,  beta-requ...@jsoftware.com wrote:
 ...
  Message: 1
  Date: Tue, 19 Jun 2012 14:31:10 -0500
  From: John Baker bakerj...@gmail.com
  Subject: Re: [Jbeta] data transfer fixes
  To: Beta forum beta@jsoftware.com
  Message-ID:
 CABc=
 tnzaooxxj67v6akjnbut29wzu1mbc0c-4duagusokpz...@mail.gmail.com
  Content-Type: text/plain; charset=UTF-8
 
  A good test would be to use HTML source in place of J scripts. If  the
  unmangle recovers the original it's probably good enough.
 
  I've long used wrapped
 
  txt=: LF, fread '~temp/t.ijs'
  enc=: 5!:5 'txt'
 
  It expands the scripts but completely eliminates delimiters that may
  clash with HTML
 
  On Tue, Jun 19, 2012 at 2:15 PM, Eric Iverson eric.b.iver...@gmail.com
 wrote:
  I thought the minimal mangling done was sufficient (assuming it is
 properly
  undone at the receiver).
 
  Why do you think the mangling is defficient? It is intended to handle
 html
  and html fragments and in my simple tests it did?
 ...
 --
 Devon McCormick, CFA
 ^me^ at acm.
 org is my
 preferred e-mail
 --
 For information about J forums see http://www.jsoftware.com/forums.htm

--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jbeta] data transfer fixes

2012-06-20 Thread bill lam
FYI, there is a base64 encoder/decoder in addons/convert/misc/base64.ijs

The current J7 base library contains a tar/tgz util written by Eric.

Срд, 20 Июн 2012, Devon McCormick писал(а):
 I've only been skimming these i-pad discussions, but thought I would
 offer this: I recently wrote a base-64 encoder/decoder if that would
 help with these transfer problems - it's really more suited for image
 encoding-ASCII subset but you could use it for general HTML.
 
 NB.* base64.ijs: encode and decode base-64 strings.
 
 B64=: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
 b64decode=: B64([: #. _8 ]\ [: , 2 2 2 2 2 2 #: i.)
 NB.EG (a.{~b64decode pngeg) fwrite 'mandelSample64x64.png'
 b64encode=: B64([ {~ [:#. _6 ]\ [: , (8$2) #: ])
 NB.EG pngeg=. b64encode a. i. fread 'mandelSample64x64.png'
 
 
 On Wed, Jun 20, 2012 at 12:00 AM,  beta-requ...@jsoftware.com wrote:
 ...
  Message: 1
  Date: Tue, 19 Jun 2012 14:31:10 -0500
  From: John Baker bakerj...@gmail.com
  Subject: Re: [Jbeta] data transfer fixes
  To: Beta forum beta@jsoftware.com
  Message-ID:
         CABc=tnzaooxxj67v6akjnbut29wzu1mbc0c-4duagusokpz...@mail.gmail.com
  Content-Type: text/plain; charset=UTF-8
 
  A good test would be to use HTML source in place of J scripts. If  the
  unmangle recovers the original it's probably good enough.
 
  I've long used wrapped
 
  txt=: LF, fread '~temp/t.ijs'
  enc=: 5!:5 'txt'
 
  It expands the scripts but completely eliminates delimiters that may
  clash with HTML
 
  On Tue, Jun 19, 2012 at 2:15 PM, Eric Iverson eric.b.iver...@gmail.com 
  wrote:
  I thought the minimal mangling done was sufficient (assuming it is properly
  undone at the receiver).
 
  Why do you think the mangling is defficient? It is intended to handle html
  and html fragments and in my simple tests it did?
 ...
 -- 
 Devon McCormick, CFA
 ^me^ at acm.
 org is my
 preferred e-mail
 --
 For information about J forums see http://www.jsoftware.com/forums.htm

-- 
regards,

GPG key 1024D/4434BAB3 2008-08-24
gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3
--
For information about J forums see http://www.jsoftware.com/forums.htm

Re: [Jbeta] data transfer fixes

2012-06-19 Thread bob therriault
Hey Eric,

I don't think that the forum allows attachments - at least I don't see an 
attached script with this email :)

By the way, massive congratulations on getting into the Apple infrastructure so 
smoothly. These things do not happen by accident and your efforts are 
appreciated.

Cheers, bob

On 2012-06-19, at 9:26 AM, Eric Iverson wrote:

 Attached script has fixed/improved documentation and verbs for moving files
 to/from iPad/iPhone.
 
 Put the script in your desktop ~temp folder.
 
 Read the file to see the instructions at the beginning.
 
 I think this provides a reasonable, though cumbersome, way to move iPad
 stuff.
 
 Example of use: install help addons on your desktop, pack it up and install
 on your iPad. You then have complete local J help in your J hview.
 
 ***
 Brian, I hope you are willing to try moving over math/misc again :)
 --
 For information about J forums see http://www.jsoftware.com/forums.htm

--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jbeta] data transfer fixes

2012-06-19 Thread Brian Schott

Eric, there's good news and there's bad news. The good news is that I was able 
to select all on the iPad with the math directory. The bad news is the 
directory (below) looks funky and I don't know where to get the files. The 
final directory is named misc, not math or math/misc. Also notice that each 
script has a HTML break after it.

In the instructions for the attach verb you forgot the prefix temp.

   jd '~addons/misc'NB. folder files
amoeba.ijsbr
bigpi.ijsbr 
brent.ijsbr 
build.ijsbr 
contfrac.ijsbr  
det.ijsbr   
fermat.ijsbr
gamesolver.ijsbr
gcd.ijsbr   
integer.ijsbr   
integrat.ijsbr  ...

---
(B=)

On Jun 19, 2012, at 12:26 PM, Eric Iverson eric.b.iver...@gmail.com wrote:

 
 Brian, I hope you are willing to try moving over math/misc again :)
 --
 
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jbeta] data transfer fixes

2012-06-19 Thread John Baker
Eric,

I have just attempted your transfer process with the jod.ijs script.
This is a 3000 line script so it's a good stress test.

Good News:

I was able to build the attachment and sent it to myself and save it
as a temporary file.

Bad News:

The mangling required to stuff the script into html is not undone.
The unmangle process you outline will probably work on most scripts
but if text in the original matches HTML fragments it will break.
Perhaps going to a safe encoding would do the trick.

jdb

On Tue, Jun 19, 2012 at 1:47 PM, Eric Iverson eric.b.iver...@gmail.com wrote:
 Thanks for the clear report. Progress, but not quite there yet.

 There are 2 problems.

 The first is that what should be created is ~addons/math/misc. This might
 be due to a typo mistake on your part.

 The create should be:
   jt 'c';'~temp/t.jt';'~addons/math';'misc'
 The extract should be:
      jt 'x';'t.jt';'~addons/math'

 Note: ~addions/math path and the misc folder.

 The 2nd problem is mine and I need to think about it a bit. The original
 text has to be mangled to fit in the html textarea. This mangling needs to
 be undone.

 What is required is something like;
   d=. fread't.jt'
   d=. d rplc 'br';LF
   d=. d rplc 'lt';''
   d=. d rplc 'amp';''
   d fwrite 'j.jt'

 and now do the extract.

 I need to think about where to do this. You could try the above suggestions
 manually. I'll have a fixed version out this evening.

 On Tue, Jun 19, 2012 at 1:52 PM, Brian Schott schott.br...@gmail.comwrote:


 Eric, there's good news and there's bad news. The good news is that I was
 able to select all on the iPad with the math directory. The bad news is the
 directory (below) looks funky and I don't know where to get the files. The
 final directory is named misc, not math or math/misc. Also notice that each
 script has a HTML break after it.

 In the instructions for the attach verb you forgot the prefix temp.

   jd '~addons/misc'    NB. folder files
 amoeba.ijsbr
 bigpi.ijsbr
 brent.ijsbr
 build.ijsbr
 contfrac.ijsbr
 det.ijsbr
 fermat.ijsbr
 gamesolver.ijsbr
 gcd.ijsbr
 integer.ijsbr
 integrat.ijsbr  ...

 ---
 (B=)

 On Jun 19, 2012, at 12:26 PM, Eric Iverson eric.b.iver...@gmail.com
 wrote:

 
  Brian, I hope you are willing to try moving over math/misc again :)
  --
 
 --
 For information about J forums see http://www.jsoftware.com/forums.htm

 --
 For information about J forums see http://www.jsoftware.com/forums.htm



-- 
John D. Baker
bakerj...@gmail.com
--
For information about J forums see http://www.jsoftware.com/forums.htm

Re: [Jbeta] data transfer fixes

2012-06-19 Thread Eric Iverson
I thought the minimal mangling done was sufficient (assuming it is properly
undone at the receiver).

Why do you think the mangling is defficient? It is intended to handle html
and html fragments and in my simple tests it did?

On Tue, Jun 19, 2012 at 3:08 PM, John Baker bakerj...@gmail.com wrote:

 Eric,

 I have just attempted your transfer process with the jod.ijs script.
 This is a 3000 line script so it's a good stress test.

 Good News:

 I was able to build the attachment and sent it to myself and save it
 as a temporary file.

 Bad News:

 The mangling required to stuff the script into html is not undone.
 The unmangle process you outline will probably work on most scripts
 but if text in the original matches HTML fragments it will break.
 Perhaps going to a safe encoding would do the trick.

 jdb

 On Tue, Jun 19, 2012 at 1:47 PM, Eric Iverson eric.b.iver...@gmail.com
 wrote:
  Thanks for the clear report. Progress, but not quite there yet.
 
  There are 2 problems.
 
  The first is that what should be created is ~addons/math/misc. This might
  be due to a typo mistake on your part.
 
  The create should be:
jt 'c';'~temp/t.jt';'~addons/math';'misc'
  The extract should be:
   jt 'x';'t.jt';'~addons/math'
 
  Note: ~addions/math path and the misc folder.
 
  The 2nd problem is mine and I need to think about it a bit. The original
  text has to be mangled to fit in the html textarea. This mangling needs
 to
  be undone.
 
  What is required is something like;
d=. fread't.jt'
d=. d rplc 'br';LF
d=. d rplc 'lt';''
d=. d rplc 'amp';''
d fwrite 'j.jt'
 
  and now do the extract.
 
  I need to think about where to do this. You could try the above
 suggestions
  manually. I'll have a fixed version out this evening.
 
  On Tue, Jun 19, 2012 at 1:52 PM, Brian Schott schott.br...@gmail.com
 wrote:
 
 
  Eric, there's good news and there's bad news. The good news is that I
 was
  able to select all on the iPad with the math directory. The bad news is
 the
  directory (below) looks funky and I don't know where to get the files.
 The
  final directory is named misc, not math or math/misc. Also notice that
 each
  script has a HTML break after it.
 
  In the instructions for the attach verb you forgot the prefix temp.
 
jd '~addons/misc'NB. folder files
  amoeba.ijsbr
  bigpi.ijsbr
  brent.ijsbr
  build.ijsbr
  contfrac.ijsbr
  det.ijsbr
  fermat.ijsbr
  gamesolver.ijsbr
  gcd.ijsbr
  integer.ijsbr
  integrat.ijsbr  ...
 
  ---
  (B=)
 
  On Jun 19, 2012, at 12:26 PM, Eric Iverson eric.b.iver...@gmail.com
  wrote:
 
  
   Brian, I hope you are willing to try moving over math/misc again :)
   --
  
  --
  For information about J forums see http://www.jsoftware.com/forums.htm
 
  --
  For information about J forums see http://www.jsoftware.com/forums.htm



 --
 John D. Baker
 bakerj...@gmail.com
 --
 For information about J forums see http://www.jsoftware.com/forums.htm

--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jbeta] data transfer fixes

2012-06-19 Thread Brian Schott
Eric,
yes I did omit part of the directory as you inferred.

When I added the correct directory I still got linebreaks. AndI get a peculiar 
error as you can see.


   jd '~addons/math/misc'NB. folder files
amoeba.ijsbr
bigpi.ijsbr 
brent.ijsbr 
build.ijsbr 
contfrac.ijsbr  
  [snip]
rsa.ijsbr   
simplex.ijsbr   
simplexnr.ijsbr 
spline.ijsbr
svd.ijsbr   
trig.ijsbr  
   load'~addons/math/misc/simplex.ijsbr'
not found: //math/misc/matutil
|file name error: script
|   0!:0 y[4!:55'y

---
(B=)
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jbeta] data transfer fixes

2012-06-19 Thread John Baker
A good test would be to use HTML source in place of J scripts. If  the
unmangle recovers the original it's probably good enough.

I've long used wrapped

txt=: LF, fread '~temp/t.ijs'
enc=: 5!:5 'txt'

It expands the scripts but completely eliminates delimiters that may
clash with HTML

On Tue, Jun 19, 2012 at 2:15 PM, Eric Iverson eric.b.iver...@gmail.com wrote:
 I thought the minimal mangling done was sufficient (assuming it is properly
 undone at the receiver).

 Why do you think the mangling is defficient? It is intended to handle html
 and html fragments and in my simple tests it did?

 On Tue, Jun 19, 2012 at 3:08 PM, John Baker bakerj...@gmail.com wrote:

 Eric,

 I have just attempted your transfer process with the jod.ijs script.
 This is a 3000 line script so it's a good stress test.

 Good News:

 I was able to build the attachment and sent it to myself and save it
 as a temporary file.

 Bad News:

 The mangling required to stuff the script into html is not undone.
 The unmangle process you outline will probably work on most scripts
 but if text in the original matches HTML fragments it will break.
 Perhaps going to a safe encoding would do the trick.

 jdb

 On Tue, Jun 19, 2012 at 1:47 PM, Eric Iverson eric.b.iver...@gmail.com
 wrote:
  Thanks for the clear report. Progress, but not quite there yet.
 
  There are 2 problems.
 
  The first is that what should be created is ~addons/math/misc. This might
  be due to a typo mistake on your part.
 
  The create should be:
    jt 'c';'~temp/t.jt';'~addons/math';'misc'
  The extract should be:
       jt 'x';'t.jt';'~addons/math'
 
  Note: ~addions/math path and the misc folder.
 
  The 2nd problem is mine and I need to think about it a bit. The original
  text has to be mangled to fit in the html textarea. This mangling needs
 to
  be undone.
 
  What is required is something like;
    d=. fread't.jt'
    d=. d rplc 'br';LF
    d=. d rplc 'lt';''
    d=. d rplc 'amp';''
    d fwrite 'j.jt'
 
  and now do the extract.
 
  I need to think about where to do this. You could try the above
 suggestions
  manually. I'll have a fixed version out this evening.
 
  On Tue, Jun 19, 2012 at 1:52 PM, Brian Schott schott.br...@gmail.com
 wrote:
 
 
  Eric, there's good news and there's bad news. The good news is that I
 was
  able to select all on the iPad with the math directory. The bad news is
 the
  directory (below) looks funky and I don't know where to get the files.
 The
  final directory is named misc, not math or math/misc. Also notice that
 each
  script has a HTML break after it.
 
  In the instructions for the attach verb you forgot the prefix temp.
 
    jd '~addons/misc'    NB. folder files
  amoeba.ijsbr
  bigpi.ijsbr
  brent.ijsbr
  build.ijsbr
  contfrac.ijsbr
  det.ijsbr
  fermat.ijsbr
  gamesolver.ijsbr
  gcd.ijsbr
  integer.ijsbr
  integrat.ijsbr  ...
 
  ---
  (B=)
 
  On Jun 19, 2012, at 12:26 PM, Eric Iverson eric.b.iver...@gmail.com
  wrote:
 
  
   Brian, I hope you are willing to try moving over math/misc again :)
   --
  
  --
  For information about J forums see http://www.jsoftware.com/forums.htm
 
  --
  For information about J forums see http://www.jsoftware.com/forums.htm



 --
 John D. Baker
 bakerj...@gmail.com
 --
 For information about J forums see http://www.jsoftware.com/forums.htm

 --
 For information about J forums see http://www.jsoftware.com/forums.htm



-- 
John D. Baker
bakerj...@gmail.com
--
For information about J forums see http://www.jsoftware.com/forums.htm

Re: [Jbeta] data transfer fixes

2012-06-19 Thread Paul Jackson
I don't have any Apple products, but it looks to me like the HTML changes
are wrong.  There should by semicolons after the escaped sequences, so
undoing them should include them.

  d=. d rplc 'lt;';''
  d=. d rplc 'amp;';''

Paul
On Jun 19, 2012 11:48 AM, Eric Iverson eric.b.iver...@gmail.com wrote:

 Thanks for the clear report. Progress, but not quite there yet.

 There are 2 problems.

 The first is that what should be created is ~addons/math/misc. This might
 be due to a typo mistake on your part.

 The create should be:
   jt 'c';'~temp/t.jt';'~addons/math';'misc'
 The extract should be:
  jt 'x';'t.jt';'~addons/math'

 Note: ~addions/math path and the misc folder.

 The 2nd problem is mine and I need to think about it a bit. The original
 text has to be mangled to fit in the html textarea. This mangling needs to
 be undone.

 What is required is something like;
   d=. fread't.jt'
   d=. d rplc 'br';LF
   d=. d rplc 'lt';''
   d=. d rplc 'amp';''
   d fwrite 'j.jt'

 and now do the extract.

 I need to think about where to do this. You could try the above suggestions
 manually. I'll have a fixed version out this evening.

 On Tue, Jun 19, 2012 at 1:52 PM, Brian Schott schott.br...@gmail.com
 wrote:

 
  Eric, there's good news and there's bad news. The good news is that I was
  able to select all on the iPad with the math directory. The bad news is
 the
  directory (below) looks funky and I don't know where to get the files.
 The
  final directory is named misc, not math or math/misc. Also notice that
 each
  script has a HTML break after it.
 
  In the instructions for the attach verb you forgot the prefix temp.
 
jd '~addons/misc'NB. folder files
  amoeba.ijsbr
  bigpi.ijsbr
  brent.ijsbr
  build.ijsbr
  contfrac.ijsbr
  det.ijsbr
  fermat.ijsbr
  gamesolver.ijsbr
  gcd.ijsbr
  integer.ijsbr
  integrat.ijsbr  ...
 
  ---
  (B=)
 
  On Jun 19, 2012, at 12:26 PM, Eric Iverson eric.b.iver...@gmail.com
  wrote:
 
  
   Brian, I hope you are willing to try moving over math/misc again :)
   --
  
  --
  For information about J forums see http://www.jsoftware.com/forums.htm
 
 --
 For information about J forums see http://www.jsoftware.com/forums.htm

--
For information about J forums see http://www.jsoftware.com/forums.htm