Sage command line `reset()` fails to create exit command - sage

I'm using the Sage command line interface, started from a Linux shell. Normally, typing exit <return> exits the command line and takes me back to the shell. However, if I use the reset() command during a session, this no longer works:
[matthew#tera ~]$ /usr/local/sage/sage-6.2-x86_64-Linux/sage
┌────────────────────────────────────────────────────────────────────┐
│ Sage Version 6.2, Release Date: 2014-05-06 │
│ Type "notebook()" for the browser-based notebook interface. │
│ Type "help()" for help. │
└────────────────────────────────────────────────────────────────────┘
sage: exit
Exiting Sage (CPU time 0m0.14s, Wall time 0m4.70s).
[matthew#tera ~]$
[matthew#tera ~]$ /usr/local/sage/sage-6.2-x86_64-Linux/sage
┌────────────────────────────────────────────────────────────────────┐
│ Sage Version 6.2, Release Date: 2014-05-06 │
│ Type "notebook()" for the browser-based notebook interface. │
│ Type "help()" for help. │
└────────────────────────────────────────────────────────────────────┘
sage: reset()
sage: exit
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
/usr/local/sage/sage-6.2-x86_64-Linux/local/lib/python2.7/site-packages /sage/all_cmdline.py in <module>()
----> 1 exit
NameError: name 'exit' is not defined
sage:
Note that quit does not work either.
So, it appears that the reset() function wipes exit from the namespace along with any user variables, and fails to recreate it, as it does x, the predefined symbolic variable, for instance.
Is this a reportable bug, or am I missing something?
Is there an alternate way to exit the Sage command line? I've gotten stuck in it a few times, and I end up hitting Ctrl-z and then ending the shell session; this seems both messy and bad, as I'm causing the shell to kill the Sage process.

Is there an alternate way to exit the Sage command line?
I usually use Ctrl-D in any case...
But this does indeed appear to be a problem. Note that this is an Ipython thing, so maybe reset is supposed to get rid of the magic things - but I don't see why. I have opened Trac 16704, though it's possible it's desired behavior because it's Ipython.

Related

Trying to test the "Example 2.7 Using a data provider that returns an Iterator object" from PHPUnit online documentation but, it is not working

A PHPUnit example from the online documentation is not working for me! Please see below for more details.
Your help is appreciated. Thank you in advance!
I'm trying to run the example test below from online documentation but, it is not working for me!
Example 2.7 Using a data provider that returns an Iterator object
The result I'm getting is shown below:
..#VivoBook MINGW64 ~/PHPunit/test-project
$ ./vendor/bin/phpunit --testdox dataProviders
PHPUnit 8.5.32 by Sebastian Bergmann and contributors.
Warning Test Case (PHPUnit\Framework\WarningTestCase)
⚠ Warning
│
│ The data provider specified for DataTest::testAdd is invalid.
│ Error: Class 'CsvFileIterator' not found
│ ..\PHPunit\test-project\dataProviders\DataProviderTest.php:16
│
Time: 77 ms, Memory: 4.00 MB
WARNINGS!
Tests: 1, Assertions: 0, Warnings: 1.
PHP info:
..#VivoBook MINGW64 ~/PHPunit/test-project
$ php -v
PHP 7.2.28 (cli) (built: Feb 18 2020 12:54:18) ( ZTS MSVC15 (Visual C++ 2017) x64 )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
The issue appeared because the class in use was not loaded. Loading the class 'CsvFileIterator' using require/require_once solved the issue.

Warning: Package xxxxx does not have POMDPSimulators in its dependencies in Julia if usual recommendations don't work.

I have seen this issue commonly since I started the transition to Julia v0.7 from v0.6. I am getting the following warning:
Warning: Package xxxxx does not have POMDPSimulators in its dependencies:
│ - If you have xxxxx checked out for development and have
│ added POMDPSimulators as a dependency but haven't updated your primary
│ environment's manifest file, try `Pkg.resolve()`.
│ - Otherwise you may need to report an issue with xxxxx
└ Loading POMDPSimulators into xxxxx from project dependency, future warnings for xxxxx are suppressed.
I do not understand why I get this warning. In one of my files, I do: using POMDPSimulators. Since I typed in that, I have done a resolve in the Pkg manager, and done a build POMDPSimulators in the package manager. This doesn't change the warning. How can I get rid of this warning?
Note: xxxxx is just the name of a file/project that is removed to make this post general.
Note: I asked a similar question here: [Julia ERROR: LoadError: ArgumentError: Package xxxx does not have ExcelReaders in its dependencies:
I already checked out the Julia documentation and did what it says. I added the package to the project by using the package manager and typing add POMDPSimulators.
Any suggestions to resolve this issue?
Note: If possible, I am looking for a general answer since I think I am going to have this issue with other packages as well. If there is any other documentation out there besides what was provided by JuliaLang I could appreciate that since I didn't find it helpful.
Link to the Julia Article about dependencies
I tried a pkg> update, build, and resolve. The issue isn't resolved. I see the file in my Manifest and Project file.
Here is what got the Warning to no longer show for me.
Go to your require file and type "NameOfPackageGivingWarning" on a new line.
Click "]" in Julia to open the package manager in Julia command line version:
up NameOfPackageGivingWarning
build NameOfPackageGivingWarning
resolve
activate NameOfPackageGivingWarning
This should resolve the issue for you. I am honestly unsure why this works and I may be taking more steps than necessary, but it resolved the issue for all of my package dependency warnings!

Julia 0.4.5: libz fails to load on Ubuntu

While I was attempting to use Requests in Julia, the following error was output:
julia> using Requests
INFO: Precompiling module Requests...
ERROR: LoadError: LoadError: error compiling version: could not load library "libz"
libz: cannot open shared object file: No such file or directory
while loading /home/michael/.julia/v0.4/Libz/src/lowlevel.jl, in expression starting on line 110
while loading /home/michael/.julia/v0.4/Libz/src/Libz.jl, in expression starting on line 11
ERROR: LoadError: Failed to precompile Libz to /home/michael/.julia/lib/v0.4/Libz.ji
while loading /home/michael/.julia/v0.4/Requests/src/Requests.jl, in expression starting on line 27
ERROR: Failed to precompile Requests to /home/michael/.julia/lib/v0.4/Requests.ji
in compilecache at ./loading.jl:400
I'm not knowledgeable enough in Julia to discern exactly what is happening, but here is the code from Libz.jl (line 11)...
include("lowlevel.jl")
...from lowlevel.jl (lines 103-110)...
# Functions
# ---------
function version()
return unsafe_string(ccall((:zlibVersion, zlib), Ptr{UInt8}, ()))
end
const zlib_version = version()
...and from Requests.jl (line 27)
using Libz
This problem has persisted after I've removed then reinstalled Libz, MbedTLS, and Requests, and after I've Pkg.update()'ed and restarted julia and my computer. Is anyone well enough versed in Julia to know how to fix this?
Per the comment by Gnimuc K and a tiny bit more research:
sudo apt-get install zlib1g-dev
installs zlib, which Julia needed. Once it was installed...
julia> Pkg.update()
julia> Pkg.build("Libz")
worked all the kinks out.

Meteor 1.2.0.2 - Couldn't run tasklist.exe on Windows 10

I just recently downloaded meteor and started the first tutorial where it has you make a todo list. When it came to running my code, command prompt popped up with this error:
Microsoft Windows [Version 10.0.10240]
(c) 2015 Microsoft Corporation. All rights reserved.
C:\Users\Rhys>cd ./desktop/simple-todos
C:\Users\Rhys\Desktop\simple-todos>meteor
[[[[[ C:\Users\Rhys\Desktop\simple-todos ]]]]]
=> Started proxy.
C:\Users\Rhys\AppData\Local\.meteor\packages\meteor-tool\1.1.9\mt-os.windows.x86
_32\dev_bundle\lib\node_modules\fibers\future.js:278
throw(ex);
^
Error: Couldn't run tasklist.exe: tasklist wasn't found on your system, it usual
ly can be found at C:\Windows\System32\.
at Object.Future.wait (C:\Users\Rhys\AppData\Local\.meteor\packages\meteor-t
ool\1.1.9\mt-os.windows.x86_32\dev_bundle\lib\node_modules\fibers\future.js:398:
15)
at findMongoPids (C:\tools\runners\run-mongo.js:134:16)
at findMongoAndKillItDead (C:\tools\runners\run-mongo.js:279:14)
at launchOneMongoAndWaitForReadyForInitiate (C:\tools\runners\run-mongo.js:4
00:7)
at launchMongo (C:\tools\runners\run-mongo.js:656:7)
at [object Object]._.extend._startOrRestart (C:\tools\runners\run-mongo.js:7
56:19)
at [object Object]._.extend.start (C:\tools\runners\run-mongo.js:714:10)
at C:\tools\runners\run-all.js:168:26
- - - - -
at C:\tools\runners\run-mongo.js:84:24
at exithandler (child_process.js:654:7)
at ChildProcess.errorhandler (child_process.js:670:5)
at ChildProcess.emit (events.js:95:17)
at Process.ChildProcess._handle.onexit (child_process.js:818:12)
C:\Users\Rhys\Desktop\simple-todos>
I went into the location C:\Windows\System32, and tasklist.exe was indeed there.
I tried a bunch of things that were online, but couldn't really find a clear answer. I also tried reinstalling the program, but that also didn't work.
Would appreciate it a bunch if you could help me.
Thank you.
Make sure your system32 folder is stored in your environment variables under path. This env variable tells Windows and subsequent command line arguments that if the command (.exe .bat. cmd) does not exist in the working directory, to check the directories in the path variable to see if they exist there. This is how command line commands such as ipconfig work from any directory.

On OS X, with SLIME, inferior lisp stopped when loading foreign libraries

I use Quicklisp to load systems, and I debug my code with Slime. Quicklisp loads many systems successfully except cl-postgresql.
When evaluating (ql:quickload "clsql-postgresql") in slime, the inferior lisp exits.
Slime prints
Lisp connection closed unexpectedly: connection broken by remote peer
in minibuffer and
Process inferior-lisp trace/BPT trap: 5
in *inferior-lisp* buffer.
But evaluating (ql:quickload "clsql-postgresql") in SBCL without Slime won't cause any error.
I have searched "trace/BPT trap: 5" with Google. The message seems indicating problems in loading dynamic libraries. I suppose the error is caused by wrong search paths set by Slime. According to http://clsql.b9.com/manual/appendix.html, I checked CLSQL:*FOREIGN-LIBRARY-SEARCH-PATHS* in bare SBCL and Slime environment, but they were both nil.
Why did clsql-postgresql fail to be load when using Slime?
Environment:
SBCL 1.1.8
OS X 10.8.4
latest quicklisp
latest slime
emacs 24.3
(sorry for my English, I'm not a native speaker)
I checked User Diagnostic Report. And I found the following lines:
Thread 7 Crashed:
0 com.apple.CoreFoundation 0x00007fff8fab52d5 __CFInitialize + 69
1 dyld 0x00007fff6f56d256
So I googled "CoreFoundation". It said that CoreFoundation must be loaded by the main thread, otherwise it would signal SIGTRAP. It's a rule of OS X.
See: Debugging a crash when a library is opened via dlopen on OSX
In bare SBCL, ql:quickload is directly evaluated in the main thread. But under SLIME, forms are evaluated with a separated thread started by SWANK.
The solution is to evaluate (ql:quickload "clsql-postgresql") in *inferior-lisp*, instead of *slime-repl*, when libpg is the first foreign library depending on CoreFoundation to be loaded.

Resources