sage | The SAGE rewrite project
kandi X-RAY | sage Summary
kandi X-RAY | sage Summary
This project is trying to reimplement the functionality from the SAGE (Strategy Action Game Engine) written by EA. The reason for this is that the current engine is not working very well on modern CPUs since has many technical limitations.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of sage
sage Key Features
sage Examples and Code Snippets
Community Discussions
Trending Discussions on sage
QUESTION
i tried to follow this mysql - move rows from one table to another with action to perform a "move to archive" function using PDO and i am failing miserably.
So i have created a job card system, and to cut it short, when a job is complete, i have a "ARCHIVE" button that essentially needs to move the selected job card from table "repairs" into table "archived_repairs". The 2 tables are exactly the same, it just needs to be deleted from repairs table and moved to archived_repairs table in case we need to come back to it at a later stage.
This is the button/link i am using on my CRUD table:
...ANSWER
Answered 2021-Jun-14 at 22:22You'll have a much easier time doing this directly in MySQL.
Something like the following should be essentially all you need.
QUESTION
I am trying to use ipycanvas in Jupyter notebook with SageMath 9.3 (I also tried 9.3.rc2) for macOS 11.4, and Python 3. When I was using SageMath 9.2 and Python 3 ipycanvas was working fine, but when I updated sage to SageMath 9.3 I started having problems.
The first thing I did was installing again ipycanvas on my mac terminal
$ sage —pip install ipycanvas
And the installation was apparently successful.
However, even running a minimal instance of ipycanvas produces type JSON serializable errors, e.g.,
...ANSWER
Answered 2021-May-30 at 06:37TL; DR Unfortunately you will need to convert the numbers that you need to pass to ipycanvas
I think you have figured out the answer in your own question. It turns out that numbers in Sage notebooks are by default interpreted as Sage types (check out https://doc.sagemath.org/html/en/tutorial/tour_coercion.html#types-versus-parents for more info on types coercion). So when you type, say 7
it casts as Integer(7)
as in the element 7 in the ring of integers Z.
The class Integer
is highly optimised for algebraic computations, however it contains some methods/attributes that cannot be JSON- serialised*, which is what ipycanvas
need to render javascript.
- On a separate note, related to one of the questions you asked "in passing", all Sage rationals can be serialised with pickle. This unfortunately doesn't help with the ipycanvas situation.
QUESTION
I'm quite struggling when trying to to what follows.
I'm currently using an ActiveX, through an interop dll generated by Visual Studio (more precisely tlbimp, implicitly).
Different versions of this ActiveX exist, that sometimes add, remove, properties in the interfaces. If I want to change the version, I have to change the reference, recompile and so on.
I'd like to have a single version of my code. I remember that to drive Word for example, one can instantiate a word object via CreateInstance on Word.Application, and call methods, whatever the version. Calls being linked only at runtime. I'd like to do the same with the activeX I use, but I don't really know how to do that (btw, it's sage objets100c dll). I don't find it in the list of ActiveX, thus I'm not even sure I can do like for Word.Application.
Has someone a clue about how I could do that ? (might be a completely different solution, as my need is: having one code with no need to recompile).
Thank you in advance
...ANSWER
Answered 2021-Mar-01 at 14:25If you have a corresponding *.tlb file, reference this one, not the dll. In the properties window of the reference, you can set the Specific Version
property to False
and EmbedInterop Types
to True
(makes it more stable).
If this does not help, you can try to create and access the object dynamically instead of adding a reference. You need either the ProgID
of the COM type …
QUESTION
I have a list of vectors and I would like to compute the shortest distance between any pair of vectors in the list.
...ANSWER
Answered 2021-May-20 at 20:05Does [(v-w).norm() for v in V for w in V]
give you what you want? Or [[(v-w).norm() for v in V] for w in V]
? The first is one big list, while the second is a nested list, one for each v in V.
The norm
method gives the length of a vector, so this computes the length of each difference v-w
for pairs in your set of vectors.
Edit: to remove 0 from the list(s): [[(v-w).norm() for v in V if v != w] for w in V]
or [[(v-w).norm() for v in V if v-w] for w in V]
in the case of nested lists, or [(v-w).norm() for v in V for w in V if v-w]
or [(v-w).norm() for v in V for w in V if v != w]
in the unnested case.
QUESTION
Suppose you have a matrix with complex entries, and you would like to extract the imaginary component of each entry and make a new matrix in Sage. For instance, suppose
...ANSWER
Answered 2021-May-19 at 09:03I think this will solve your problem [[z.imag() for z in v] for v in M]
. You iterate over the rows in M and then you iterate over the elements in each row and compute the imaginary part of it.
QUESTION
i am still new to python, i have tried this way to overwrite a line on a txt file
'''
answer =input("R/S/L/M:")
...ANSWER
Answered 2021-Apr-25 at 14:02You could do this:
QUESTION
I'm trying to persist the states of my saga into the Session of the AzureService Bus Messages. As long as the State of the Sage is just in memory it works fine. But if I activate RequiresSession and use a MessageSessionSagaRepository, my sage isn't doing anything anymore.
...ANSWER
Answered 2021-Apr-22 at 12:31Your configuration is a bit mixed, I'd suggest cleaning it up to bring it up to date and make it consistent:
QUESTION
Edit: This problem still remains unsolved, I have tried to even boot into a different OS (Debian instead of Kali) (not using anaconda, will (hopefully) get more time to try that)
As the title describes and illustrated by this screenshot:
Instead of the expected 3D plot, just a white plain background with a question mark in it, that, when clicked, displays a menu like this:
I have now experimented quite a bit on this example (on my system) and... to give an example:
This shows just a black square (while it's supposed to show a sphere):
...ANSWER
Answered 2021-Mar-11 at 20:11The problem could have to do with the threejs package in Debian that came for the particular version of Sage you got.
You might have better luck installing via Conda or from binaries.
For reference, here is a list of similar reports (including the present one):
- Stack Overflow question 66584781: Sage not displaying/Rendering 3D plots
- Ask Sage question 55896: implicit_plot3d not rendering in Jupyter Lab
- Ask Sage question 55661: plot3d shows a black window
- Ask Sage question 52722: plot3d displaying black graph in jupyter for both 9.0 and 9.1
- debian-science-sagemath, 2019-11: Consider updating package three.js
QUESTION
I have the following structure in my Django project
The gitignore is the one suggested by https://www.toptal.com/developers/gitignore/api/django
The steps to initialize GIT were: Create the project with apps/A and apps/B, create the .gitignore file and run git init
.
Then I ran makemigrations
and migrate
The problem occurs when, starting from master, a new branch called Z is created with an apps/ZApp, a new model is created and makemigrations
and migrate
are executed from that branch. Thus:
ANSWER
Answered 2021-Apr-21 at 23:41This is expected behavior. Git isn't doing anything at all to files it ignores. That means if .pyc files are created while you have one branch open, then you switch to another branch, nothing will happen to the .pyc files, because all you've done is switch git branches, and those files are ignored by git.
If you like, you can add a post-checkout hook that deletes all pycache directories and .pyc files each time you check out a branch.
QUESTION
This is my program:
...ANSWER
Answered 2021-Apr-19 at 01:46Your problem is the student_info
function, the file only contains None
because if a function doesn´t return something the default behavior is to return None
. When you are doing str(student_info(sname,sage,sgender)
you are calling the __str__
method of the None
class, that return the string "None"
. So, the correct way is returning a string, instead of printing inside the function:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install sage
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page