[sage-support] Re: Got sagenb running, need help

2014-07-21 Thread Jole Bradbury
Could you push me in the right direction? Would Django be a good tool to 
accomplish this with?

On Tuesday, July 15, 2014 3:32:53 PM UTC-4, Nils Bruin wrote:
>
> On Tuesday, July 15, 2014 11:28:35 AM UTC-7, Jole Bradbury wrote:
>>
>> I can't. I've tried compiling sagecell using the instructions posted 
>> online and have gotten countless errors. It appears that it is because I am 
>> running 10.9 not 10.6, but I cannot revert back to 10.6.
>>
>
> OSX 10.9 I presume? Just make a virtual machine with your favourite Linux 
> flavour and set it up there. If this server is going to be facing  anything 
> remotely public, it will need insane lockdown anyway and running on a 
> virtual machine tends to be the first step for that anyway nowadays. That 
> frees you from 10.9 worries already.
>
> The problem with communicating with the regular notebook via curl is that 
> there is quite a bit of state (including authentication!) on the browser 
> side. You'd have to track that and ensure that curl has that available. 
> You'd end up implementing the network facing part of a browser. I imagine 
> that some python libraries would be more suitable for that.
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Re: Got sagenb running, need help

2014-07-15 Thread Jole Bradbury
I can't. I've tried compiling sagecell using the instructions posted online 
and have gotten countless errors. It appears that it is because I am 
running 10.9 not 10.6, but I cannot revert back to 10.6.

On Monday, July 14, 2014 5:54:54 PM UTC-4, P Purkayastha wrote:
>
> You should look at sagecell instead for this kind of thing:
>
> https://sagecell.sagemath.org/
> https://github.com/sagemath/sagecell
>
> On Tuesday, July 15, 2014 4:12:14 AM UTC+8, Jole Bradbury wrote:
>>
>> I take it this is impossible?
>>
>> On Saturday, July 12, 2014 5:10:09 PM UTC-4, Jole Bradbury wrote:
>>>
>>> Ran 
>>>
>>> sage: import sagenb.notebook.notebook_object as nb
>>>
>>> sage: nb.notebook(directory="mynotebook")
>>>
>>> And got the server running, I can log in on localhost.
>>>
>>>
>>>
>>> My problem is that for the past few weeks all I've been trying to do is 
>>> set up a server *where data can be sent and evaluated and sent back,* my 
>>> users will be sending requests from a separate site. I have been trying 
>>> curl 
>>> --data x http://localhost:8080/home/admin/0/
>>>
>>>
>>> But keep getting 
>>>
>>> 405 Method Not Allowed
>>>
>>> Method Not Allowed
>>>
>>> The method is not allowed for the requested URL.
>>>
>>>
>>>
>>>
>>> I really need to just send an http request and get it evaluated and get 
>>> an httpresponse. Can someone please help with that?
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Re: Got sagenb running, need help

2014-07-14 Thread Jole Bradbury
I take it this is impossible?

On Saturday, July 12, 2014 5:10:09 PM UTC-4, Jole Bradbury wrote:
>
> Ran 
>
> sage: import sagenb.notebook.notebook_object as nb
>
> sage: nb.notebook(directory="mynotebook")
>
> And got the server running, I can log in on localhost.
>
>
>
> My problem is that for the past few weeks all I've been trying to do is 
> set up a server *where data can be sent and evaluated and sent back,* my 
> users will be sending requests from a separate site. I have been trying curl 
> --data x http://localhost:8080/home/admin/0/
>
>
> But keep getting 
>
> 405 Method Not Allowed
>
> Method Not Allowed
>
> The method is not allowed for the requested URL.
>
>
>
>
> I really need to just send an http request and get it evaluated and get an 
> httpresponse. Can someone please help with that?
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Got sagenb running, need help

2014-07-12 Thread Jole Bradbury
Ran 

sage: import sagenb.notebook.notebook_object as nb

sage: nb.notebook(directory="mynotebook")

And got the server running, I can log in on localhost.



My problem is that for the past few weeks all I've been trying to do is set 
up a server *where data can be sent and evaluated and sent back,* my users 
will be sending requests from a separate site. I have been trying curl 
--data x http://localhost:8080/home/admin/0/


But keep getting 

405 Method Not Allowed

Method Not Allowed

The method is not allowed for the requested URL.




I really need to just send an http request and get it evaluated and get an 
httpresponse. Can someone please help with that?

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] Re: Can't import sage into Python

2014-07-09 Thread Jole Bradbury
Then how do people set up sage servers? Should I use the notebook?

On Wednesday, July 9, 2014 12:32:31 PM UTC-4, William wrote:
>
>
>
>
> On Wed, Jul 9, 2014 at 8:28 AM, Jole Bradbury  > wrote:
>
>> Aha, that does make sense... And yes the Django import failed. My PATH 
>> has Python version 3.4 on it which should have been a dead giveaway since 
>> Sage runs Python 2.6? Or 2.7 I believe?
>>
>> Would you recommend that I attempt to use kcrisman's answer, or try to 
>> install Django in Sage's Python, OR should I use sage notebook?
>>
>
> Install Django into Sage's Python... at let us know if it works -- I've 
> never heard of anybody doing it (or even trying):
>
>  sage -sh
>  easy_install django  # or something like that...
>
>
>  
>
>>
>>
>> On Wednesday, July 9, 2014 11:18:35 AM UTC-4, Nils Bruin wrote:
>>>
>>> On Tuesday, July 8, 2014 11:53:33 AM UTC-7, Jole Bradbury wrote:
>>>>
>>>> I have a Django project with 
>>>> views.py:
>>>>
>>>> #!/usr/bin/env sage -python
>>>>
>>>> from django.shortcuts import render
>>>> from django.http import HttpResponse
>>>> import sys
>>>> from django.http import HttpRequest
>>>> from django.template import RequestContext, loaders
>>>> sys.path.append('/Users/Jole/Desktop/django_proj/mysite/sage/src/bin')
>>>> sys.path.append('/Users/Jole/Desktop/django_proj/mysite/sage/')
>>>> from sage.all import *
>>>>
>>>  
>>> Unfortunately, when I fire up my Django server on localhost, I get: No 
>>> module named sage.all
>>>
>>> As an error message. As you can see I have already tried appending to 
>>> the path. My Python Path includes sage and I can see this on my Django 
>>> page, however my "PATH" is 
>>>  PATH
>>>
>>> '/Library/Frameworks/Python.framework/Versions/3.4/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin'
>>>
>>>
>>>
>>> That's not the path that `sage -python` would set up, so my guess is 
>>> that `views.py` doesn't actually get *executed* (and hence run in a way 
>>> equivalent to `sage -python views.py`), but instead gets loaded/interpreted 
>>> by whatever python is running django. You should probably try and execute
>>>
>>> sage -python -c 'import django.shortcuts'
>>>
>>> my guess is that that would fail, proving that you didn't install django 
>>> in sage's python and hence prove that your script isn't being executed by 
>>> sage's python, since that line seems to execute properly in your situation.
>>>
>>> If you want to use both django and sage in the same python, you have to 
>>> ensure that both are available to the same python. The easier way to 
>>> accomplish that is probably to install django in sage's python, since sage 
>>> has its own python for a reason. I have no experience with django, nor a 
>>> clear idea what it does, so I have no idea whether it's a good/feasible 
>>> plan to mix the two. If django is a web-server, then you should probably 
>>> tread very carefully. Math software and web services mix badly, because 
>>> math software is usually written with no concern for security (it's written 
>>> for a situation where one trusts the user), but for web software security 
>>> is vital.
>>>
>>> Things like sagecell and MathCloud put a *lot* of work in mitigating the 
>>> security holes that are virtually unavoidable in making large parts of math 
>>> software available via web services.
>>>
>>  -- 
>> You received this message because you are subscribed to the Google Groups 
>> "sage-support" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to sage-support...@googlegroups.com .
>> To post to this group, send email to sage-s...@googlegroups.com 
>> .
>> Visit this group at http://groups.google.com/group/sage-support.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> William Stein
> Professor of Mathematics
> University of Washington
> http://wstein.org
>  

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Re: Can't import sage into Python

2014-07-09 Thread Jole Bradbury
Aha, that does make sense... And yes the Django import failed. My PATH has 
Python version 3.4 on it which should have been a dead giveaway since Sage 
runs Python 2.6? Or 2.7 I believe?

Would you recommend that I attempt to use kcrisman's answer, or try to 
install Django in Sage's Python, OR should I use sage notebook?

On Wednesday, July 9, 2014 11:18:35 AM UTC-4, Nils Bruin wrote:
>
> On Tuesday, July 8, 2014 11:53:33 AM UTC-7, Jole Bradbury wrote:
>>
>> I have a Django project with 
>> views.py:
>>
>> #!/usr/bin/env sage -python
>>
>> from django.shortcuts import render
>> from django.http import HttpResponse
>> import sys
>> from django.http import HttpRequest
>> from django.template import RequestContext, loaders
>> sys.path.append('/Users/Jole/Desktop/django_proj/mysite/sage/src/bin')
>> sys.path.append('/Users/Jole/Desktop/django_proj/mysite/sage/')
>> from sage.all import *
>>
>  
> Unfortunately, when I fire up my Django server on localhost, I get: No 
> module named sage.all
>
> As an error message. As you can see I have already tried appending to the 
> path. My Python Path includes sage and I can see this on my Django page, 
> however my "PATH" is 
> PATH
>
> '/Library/Frameworks/Python.framework/Versions/3.4/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin'
>
>
>
> That's not the path that `sage -python` would set up, so my guess is that 
> `views.py` doesn't actually get *executed* (and hence run in a way 
> equivalent to `sage -python views.py`), but instead gets loaded/interpreted 
> by whatever python is running django. You should probably try and execute
>
> sage -python -c 'import django.shortcuts'
>
> my guess is that that would fail, proving that you didn't install django 
> in sage's python and hence prove that your script isn't being executed by 
> sage's python, since that line seems to execute properly in your situation.
>
> If you want to use both django and sage in the same python, you have to 
> ensure that both are available to the same python. The easier way to 
> accomplish that is probably to install django in sage's python, since sage 
> has its own python for a reason. I have no experience with django, nor a 
> clear idea what it does, so I have no idea whether it's a good/feasible 
> plan to mix the two. If django is a web-server, then you should probably 
> tread very carefully. Math software and web services mix badly, because 
> math software is usually written with no concern for security (it's written 
> for a situation where one trusts the user), but for web software security 
> is vital.
>
> Things like sagecell and MathCloud put a *lot* of work in mitigating the 
> security holes that are virtually unavoidable in making large parts of math 
> software available via web services.
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Re: Can't import sage into Python

2014-07-08 Thread Jole Bradbury
Anyone??

On Tuesday, July 8, 2014 2:53:33 PM UTC-4, Jole Bradbury wrote:
>
> I have a Django project with 
> views.py:
>
> #!/usr/bin/env sage -python
>
> from django.shortcuts import render
> from django.http import HttpResponse
> import sys
> from django.http import HttpRequest
> from django.template import RequestContext, loaders
> sys.path.append('/Users/Jole/Desktop/django_proj/mysite/sage/src/bin')
> sys.path.append('/Users/Jole/Desktop/django_proj/mysite/sage/')
> from sage.all import *
>
>
> def index(request):
> 
> querystring = request.GET.get('querystring')
> 
> return HttpResponse(querystring)
>
>
> As you can see I am trying to import sage as a library into my Python 
> document so I can do some sage computations.
>
> Unfortunately, when I fire up my Django server on localhost, I get: No 
> module named sage.all
>
> As an error message. As you can see I have already tried appending to the 
> path. My Python Path includes sage and I can see this on my Django page, 
> however my "PATH" is 
> PATH
>
> '/Library/Frameworks/Python.framework/Versions/3.4/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin'
>
>
>
> According to the Django server output. I'm not sure if this could be the 
> problem. Any help would be *greatly appreciated.*
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Can't import sage into Python

2014-07-08 Thread Jole Bradbury
I have a Django project with 
views.py:

#!/usr/bin/env sage -python

from django.shortcuts import render
from django.http import HttpResponse
import sys
from django.http import HttpRequest
from django.template import RequestContext, loaders
sys.path.append('/Users/Jole/Desktop/django_proj/mysite/sage/src/bin')
sys.path.append('/Users/Jole/Desktop/django_proj/mysite/sage/')
from sage.all import *


def index(request):

querystring = request.GET.get('querystring')

return HttpResponse(querystring)


As you can see I am trying to import sage as a library into my Python 
document so I can do some sage computations.

Unfortunately, when I fire up my Django server on localhost, I get: No 
module named sage.all

As an error message. As you can see I have already tried appending to the 
path. My Python Path includes sage and I can see this on my Django page, 
however my "PATH" is 
PATH

'/Library/Frameworks/Python.framework/Versions/3.4/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin'



According to the Django server output. I'm not sure if this could be the 
problem. Any help would be *greatly appreciated.*

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] Re: Help with understanding and setting up Sage Cell Server

2014-07-03 Thread Jole Bradbury
Is SageMathCloud a better way to do this sever thing? Can you answer any of 
my other questions?

On Thursday, July 3, 2014 1:59:50 AM UTC-4, William wrote:
>
> On Wed, Jul 2, 2014 at 10:43 PM, Nils Bruin > 
> wrote: 
> > On Wednesday, July 2, 2014 10:14:44 AM UTC-7, Jole Bradbury wrote: 
> >> 
> >> 2) I've noticed on the Sage Cell Server demo online that typing Maxima 
> >> code will result in every line being evaluated but Sage code only 
> evaluates 
> >> the last line. For example, 
> >> integrate(1,x) 
> >> integrate(2,x) 
> >> In "Sage" code will return: 2 
> > 
> > All lines do execute. It's just only printing the result of the last 
> line (I 
> > wouldn't mind if that got changed). If you try 
> > 
> > print integrate(1,x) 
> > print integrate(2,x) 
> > 
> > you'll see both results. 
> >  (I can't help you with the other questions, but hopefully having this 
> > little fact corrected is also helpful somehow) 
>
> For what it is worth, the Sage Notebook and Sage Cell work that way 
> because at the time (2006) that we implemented the first version, we 
> couldn't figure out how to get it to work the way Jole wants. And 
> that weird design just sort of stuck. 
>
> In SageMathCloud, doing 
>
> integrate(1,x) 
> integrate(2,x) 
>
> outputs 
>
> x 
> 2*x 
>
> It does this properly by breaking the input into blocks, and exec'ing 
> each block separately. I think SageCell (and IPython Notebook, 
> etc.) should do the same, but nobody listens to me when I suggest 
> this. 
>
>  -- William 
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Help with understanding and setting up Sage Cell Server

2014-07-02 Thread Jole Bradbury
Hi all,

I've done some work in Java, HTML, CSS, JavaScript, ActionScript 3.0 and 
recently Python.

I have a project I'm working on where I'd like to set up a very simple Sage 
server, to function as follows: The server will receive Sage or Maxima 
code, execute the code, and send back the result. Example, sending 
"integrate(1,x)" to the server would return "x".

However, I have found myself getting a little lost in the process, I am not 
quite used to server-side scripting yet. The questions I'd like answered 
are:

1) Am I using the correct tool for the process, or is there an easier way 
to do this? I don't want a graphical interface on a website, I only want a 
server.

2) I've noticed on the Sage Cell Server demo online that typing Maxima code 
will result in every line being evaluated but Sage code only evaluates the 
last line. For example, 
integrate(1,x)
integrate(2,x)
In "Sage" code will return: 2
In Maxima will return :
1
2
Therefore, since I am more familiar with Maxima code I would like to set up 
the server to use Maxima code. Is this easily possible?

3) Is writing Python code required for this task?

4) How simple would the task be, of setting up a simple server like this? 
In Sage? In Maxima? Any resources would be appreciated.

Thank you very much.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.