[sage-devel] Re: Touch Interacts on iOS

2012-01-24 Thread Jason Grout

On 1/24/12 3:17 PM, Stephen Hartke wrote:

On 1/22/12 12:56 PM, Stephen Hartke wrote:

Cutting and pasting on an Android phone does not work well (I had to
switch to plain text to paste into the code box)..  Will there

eventually be an option to "preload" code into the single cell
server?

On Mon, Jan 23, 2012 at 9:20 PM, Jason Grout
mailto:jason-s...@creativetrax.com>> wrote:

In fact, preloading code is one of the main purposes for the Sage
cell server embedded into web pages.  Check out the examples on
utmost.aimath.org , or Rob Beezer's home
page at http://buzzard.ups.edu/.  You can also see John Travis's
excellent examples of using this in WebWork problems (he posted here
a while ago on it).

Basically, when you initialize a single cell on a web page, you
specify a div for the input.  You just put your code in that div,
and it is used to initialize the edit area.  (Sparse) docs are at
https://github.com/sagemath/__sagecell/blob/master/doc/__embedding.rst

-- see particularly the example at the bottom for an example you can
cut and paste into a web page (change localhost:8080 to
aleph.sagemath.org ).


Jason,

Fantastic!  That's really cool.  It would be great to have examples
accessible from the main sagemath.org 
webpage---that way people could get a taste of Sage (and particularly
the interacts!) without having to install it or make an account on
sagenb.org .



We're just polishing up the last little bits for a Sage Cell Server 1.0 
release.  The plan is to advertise it like crazy then.  Of course, you 
can use it now if you'd like.


Thanks,

Jason

--
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org


Re: [sage-devel] Re: Touch Interacts on iOS

2012-01-24 Thread Stephen Hartke
>
> On 1/22/12 12:56 PM, Stephen Hartke wrote:
>
>> Cutting and pasting on an Android phone does not work well (I had to
>> switch to plain text to paste into the code box)..  Will there
>
> eventually be an option to "preload" code into the single cell server?
>
>
On Mon, Jan 23, 2012 at 9:20 PM, Jason Grout
wrote:

> In fact, preloading code is one of the main purposes for the Sage cell
> server embedded into web pages.  Check out the examples on
> utmost.aimath.org, or Rob Beezer's home page at http://buzzard.ups.edu/.
>  You can also see John Travis's excellent examples of using this in WebWork
> problems (he posted here a while ago on it).
>
> Basically, when you initialize a single cell on a web page, you specify a
> div for the input.  You just put your code in that div, and it is used to
> initialize the edit area.  (Sparse) docs are at
> https://github.com/sagemath/**sagecell/blob/master/doc/**embedding.rst--
>  see particularly the example at the bottom for an example you can cut
> and paste into a web page (change localhost:8080 to aleph.sagemath.org).
>

Jason,

Fantastic!  That's really cool.  It would be great to have examples
accessible from the main sagemath.org webpage---that way people could get a
taste of Sage (and particularly the interacts!) without having to install
it or make an account on sagenb.org.

Best wishes,
Stephen

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org


Re: [sage-devel] Re: Touch Interacts on iOS

2012-01-23 Thread Dan Drake
On Mon, 23 Jan 2012 at 06:25AM -0600, Jason Grout wrote:
> >https://github.com/sagemath/singlecell/issues/231
> 
> Unicode should work now.

I responded to the github issue, but: the problem seems fixed. So
Unicode/UTF-8 stuff should work. (Although I didn't try any other
encoding or fancy string stuff.)

Dan

--
---  Dan Drake
-  http://mathsci.kaist.ac.kr/~drake
---


signature.asc
Description: Digital signature


[sage-devel] Re: Touch Interacts on iOS

2012-01-23 Thread Jason Grout

On 1/22/12 12:56 PM, Stephen Hartke wrote:

On Sat, Jan 21, 2012 at 12:35 PM, Jason Grout
mailto:jason-s...@creativetrax.com>> wrote:

Can people test this functionality before we try to add it to the
sage notebook?  If you have an iOS or Android device, create an
interact at aleph.sagemath.org  and try
manipulating the controls.


The sliders on the n^2 example work great on a Google Nexus S (Android
2.3.7).  It's very cool to have the experience of sliding one's finger.

Cutting and pasting on an Android phone does not work well (I had to
switch to plain text to paste into the code box)..  Will there
eventually be an option to "preload" code into the single cell server?
That would be great for touch devices (where typing is very hard), or
even for embedding Sage functionality into webpages.


In fact, preloading code is one of the main purposes for the Sage cell 
server embedded into web pages.  Check out the examples on 
utmost.aimath.org, or Rob Beezer's home page at http://buzzard.ups.edu/. 
 You can also see John Travis's excellent examples of using this in 
WebWork problems (he posted here a while ago on it).


Basically, when you initialize a single cell on a web page, you specify 
a div for the input.  You just put your code in that div, and it is used 
to initialize the edit area.  (Sparse) docs are at 
https://github.com/sagemath/sagecell/blob/master/doc/embedding.rst -- 
see particularly the example at the bottom for an example you can cut 
and paste into a web page (change localhost:8080 to aleph.sagemath.org).


Thanks,

Jason

--
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org


[sage-devel] Re: Touch Interacts on iOS

2012-01-23 Thread Jason Grout

On 1/22/12 9:17 PM, Keshav Kini wrote:

Pasting does not even work in Firefox on Linux, I find. At least,
pasting with middle-click to dump the X selection buffer doesn't work.
Pasting with C-v to dump the X clipboard buffer does work, however. Both
work in plain text mode.


These all sound like CodeMirror 2 problems.  We should upgrade our 
Codemirror 2, as it is way behind the current codemirror now.


Even for the extra line bit in other messages---those examples also fail 
on my android 3.2 tablet, but switching to plain text mode makes it work 
without the extra line at the end, which again indicates that there is 
some sort of CodeMirror 2 issue.


Jason

--
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org


[sage-devel] Re: Touch Interacts on iOS

2012-01-23 Thread Jason Grout

On 1/22/12 1:10 AM, Dan Drake wrote:

On Sat, 21 Jan 2012 at 11:05PM -0600, Jason Grout wrote:

Uh, maybe.  I don't know.  Can you open an issue on github?  I'm not
sure where there would be an error, but surely if there is no
output, there is a traceback printed somewhere.


https://github.com/sagemath/singlecell/issues/231


Unicode should work now.  The main problem was that 
sage.misc.preparser.preparse_file explicitly sees if the string is of 
type 'string' (rather than basestring), so it was kicking out all 
unicode.  So now we just pass an utf8 encoded string.


Thanks,

Jason



--
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org


[sage-devel] Re: Touch Interacts on iOS

2012-01-22 Thread Pedro Cruz
>>Can people test this functionality before we try to add it to the sage 
>>notebook? 
 If you have an iOS or
>>Android device, create an interact at aleph.sagemath.org and try 
manipulating the controls.  

On iPod Touch, the n^2 example,

@interact
def f(n=(1..10)):
print n^2

works well.
Pedro

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org


Re: [sage-devel] Re: Touch Interacts on iOS

2012-01-22 Thread Maarten Derickx
I get exactly the same error as william on my iphone, but it doesn't happen 
in my browser (chrome) on my macbook.

If I add an extra enter all trouble disapear on my iphone and the sliding 
works nice.

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org


[sage-devel] Re: Touch Interacts on iOS

2012-01-22 Thread Jason Grout

On 1/22/12 1:59 AM, William Stein wrote:

The standard interact with slider.  You should see it in the log from an
hour ago?


This one?

@interact
def f(n=(1..9)):
print n^2

It works fine for me without any extra newline at the end (so the code 
ends directly after the 2).


Can you paste the messages, exactly what the error is, etc?

Jason


--
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org


[sage-devel] Re: Touch Interacts on iOS

2012-01-22 Thread Jason Grout

On 1/22/12 12:46 AM, William Stein wrote:

However, the codemirror (2?) editor is bad on my 3.2 device, compared to
the standard sagenb textarea.  Cursor positioning, cut/paste, etc. are
all very painful.


Yes, it's codemirror 2.  The codemirror 2 developer has made some 
changes recently to get it to work better on iOS, so maybe upgrading 
would help Android as well.  Regardless, we put the option to switch to 
plain text for situations like this (click the link under the editor).


Jason


--
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org


Re: [sage-devel] Re: Touch Interacts on iOS

2012-01-21 Thread William Stein
On Jan 21, 2012 11:53 PM, "Jason Grout"  wrote:
>
> On 1/22/12 1:30 AM, William Stein wrote:
>>
>>  > > On both I got a syntax error if I don't add a spurious newline at
>> the end
>>  > > of the input - what's up with that?
>>  >
>>  > I got some syntax errors, but I'm not sure if it was the newline at
the
>>  > end that fixed it.
>>
>> It was.   I got this on both my iphone and gtab.   It is a very serious
>> bug that needs to get fixed.
>>
>
>
> Can you give an example?

The standard interact with slider.  You should see it in the log from an
hour ago?

> Already, we add a newline to work around this bug in python:

I guess you aren't doing that correctly...?

> http://bugs.python.org/issue1184112
>
> Jason
>
>
>
> --
> To post to this group, send an email to sage-devel@googlegroups.com
> To unsubscribe from this group, send an email to
sage-devel+unsubscr...@googlegroups.com
> For more options, visit this group at
http://groups.google.com/group/sage-devel
> URL: http://www.sagemath.org

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org


[sage-devel] Re: Touch Interacts on iOS

2012-01-21 Thread Jason Grout

On 1/22/12 1:30 AM, William Stein wrote:

 > > On both I got a syntax error if I don't add a spurious newline at
the end
 > > of the input - what's up with that?
 >
 > I got some syntax errors, but I'm not sure if it was the newline at the
 > end that fixed it.

It was.   I got this on both my iphone and gtab.   It is a very serious
bug that needs to get fixed.




Can you give an example?  Already, we add a newline to work around this 
bug in python:


http://bugs.python.org/issue1184112

Jason


--
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org


Re: [sage-devel] Re: Touch Interacts on iOS

2012-01-21 Thread Dan Drake
On Sat, 21 Jan 2012 at 11:05PM -0600, Jason Grout wrote:
> Uh, maybe.  I don't know.  Can you open an issue on github?  I'm not
> sure where there would be an error, but surely if there is no
> output, there is a traceback printed somewhere.

https://github.com/sagemath/singlecell/issues/231

Dan

--
---  Dan Drake
-  http://mathsci.kaist.ac.kr/~drake
---


signature.asc
Description: Digital signature


[sage-devel] Re: Touch Interacts on iOS

2012-01-21 Thread Jason Grout

On 1/21/12 9:00 PM, Dan Drake wrote:

On Sat, 21 Jan 2012 at 12:35PM -0600, Jason Grout wrote:

Can people test this functionality before we try to add it to the
sage notebook?  If you have an iOS or Android device, create an
interact at aleph.sagemath.org and try manipulating the controls.
The author says the code is not thoroughly tested, etc, but it does
seem to work well.


The "print n*n" @interact from the recent singlecell thread works great
on my Nexus S (Android 2.3.4) with the stock browser.


Great!




I did discover a problem, though: I tried this

@interact
def f(n=(1..10)):
 print n*n, '한'

In the ordinary notebook (Sage 4.7.2), it works as expected. But on
aleph.sagemath.org, I get a blank output, on both my Android phone and
in Chrome on my Macbook. It doesn't print any messages, I just get a
blank line. I get the same thing if I write u'한'.

It works if I use '\xed\x95\x9c'.

Is this expected? I'm fine if the answer is "UTF-8/Unicode input isn't
supported yet."



Uh, maybe.  I don't know.  Can you open an issue on github?  I'm not 
sure where there would be an error, but surely if there is no output, 
there is a traceback printed somewhere.


Thanks,

Jason



--
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org


[sage-devel] Re: Touch Interacts on iOS

2012-01-21 Thread Jason Grout

On 1/21/12 12:53 PM, Alex Kramer wrote:

On Sat, Jan 21, 2012 at 1:35 PM, Jason Grout
  wrote:

Can people test this functionality before we try to add it to the sage
notebook?  If you have an iOS or Android device, create an interact at
aleph.sagemath.org and try manipulating the controls.  The author says the
code is not thoroughly tested, etc, but it does seem to work well.


Sliders don't work on Android 2.3 (Gingerbread) for me in the sense that
they're not draggable - I can click somewhere along the slider range
and the slider will move there, but there's no "sliding" animation.

Buttons appear to work fine.

Unfortunately I don't own an iOS device (which is what this library
appears to prioritize support for).


Yes, that's what the developer has.  John Travis reported to me that it 
worked on his Android device (I don't know what version, and I don't 
know if he tried dragging sliders).  If anyone knows how the touch 
events work in the browser, I'm sure the library author would accept 
pull requests.


Thanks,

Jason

--
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org