Sage server customization

Dec. 9, 2014,
Sage useful commands to make homework keys in Algebra & Calculus.
1. To save the definitions of all functions and variables including history of input and output commands:
%colors NoColor
save_session() or save_session(‘2014.12.07’)
The saved session can befound in the user home directory (~), for example, 2014.12.07.sobj.
To restore a particular session:
load_session (‘2014.12.07.sobj’)
_oh (to list all output lines in the session, Python formatted).
_ih (to list all input commands in the session, Python formatted).
The original command can be reconstructed without type declaration.

2. To see the definition of a function or a variable (for example, dist formula)
show_identifiers()
dist

3. Set up log file with correct parameters (Python’s output, raw input, with timestamp). The log file is saved in the current directory RealNumber(2014.12).gen(09).log.
logstart -r -o -t 2014.12.09.log append
logstop to stop the log file recording.

4. Short definitions.
\(d=\sqrt{(x_{1}-x_{2})^2+(y_{1}-y_{2})^2}\)
sage: s_dis(x1,y1,x2,y2)=sqrt((x1 – x2)^2 + (y1 – y2)^2)
sage: s_dis(1,3,2,5)