|
AJAXSymja
Symja running on Google App Engine AJAX interface (Eval API)
Featured The user interfaceThis is a screenshot of the Symja online calculator:
Common evaluation buttonsThe following buttons are always defined in the user interface:
Persisting formulasThrough the Login link users can sign in with their Google User Account. When logged in, it's possible to persist user defined formulas and constants with the so-called $ user symbols in the Google App Engine datastore. You can for example create your own rules or formulas for a new defined symbol $cube. Type the following rules in the input area and press the Sym button to define your rules: SetAttributes[$cube,Listable]; $cube[x_]:=x^3 Now you can use this rule by evaluating a symbolic argument $cube[a] and you get the result a^3 in the output area. Because the $cube symbol has the attribute Listable you can also evaluate a list of numbers like this $cube[{1,2,3,4,5}] and you get the result {1,8,27,64,125}. In the same way you can define constants: $theAnswerToAllQuestions = 42 By evaluating $theAnswerToAllQuestions you get the defined value 42. If you are logged in again at a later date, you can reuse the $ user symbols without redefining them. Buttons for logged in usersThe following buttons are only defined in the user interface, if you are logged in with your Google Account:
Advanced configurationAJAX Evaluation APIThe simplified online Eval API lets you dynamically generate calculation forms. To see the Eval API in action, open up a browser window and copy the following URL into it:
On testiphone.com you can try the same example online in an iPhone simulator (you should use the Safari browser to get the real experience). Here is a link for the general iPhone AJAX interface The corresponding JSP file for the Evaluation API is the index.jsp file Install additional packagesSymja is extendable through the Package command. If you've installed AJAXSymja on Google Appengine, you can add new packages through the admin.jsp interface. Only users which are administrators for the Google Appengine application are allowed to use the admin.jsp interface. Example package for generating Laguerre or Legendre polynomials (Note - public symbols have to start with an uppercase character): Package[
"Polynomials",
(* define the public available symbols *)
{LaguerreP, LegendreP},
{
(* Laguerre polynomials
http://en.wikipedia.org/wiki/Laguerre_polynomials *)
LaguerreP[0,x_]:=1,
LaguerreP[1,x_]:=1-x,
LaguerreP[n_IntegerQ,x_]:=
ExpandAll[(2*n-1-x)*LaguerreP[n-1,x] - (n-1)^2*LaguerreP[n-2,x]] /; NonNegative[n],
(* Legendre polynomials
http://en.wikipedia.org/wiki/Legendre_polynomials *)
LegendreP[n_IntegerQ,x_]:=
1/(2^n)*Sum[ExpandAll[Binomial[n,k]^2*(x-1)^(n-k)*(x+1)^k], {k,0,n}] /; NonNegative[n]
} ]After installing the package with the Save package button the new command LegendreP[7,x] can be evaluated. Google Appengine DevelopmentBefore starting, please read the Google Appengine for Java Introduction Install the Google Plugin for Eclipse as described here: Checkout the symja.ajax source code from SVN: Change the symja.ajax configuration:
Select menu Run->Run As->Web Application to run the Google Web Application locally. | |