ln[*] in Jupyter notebooks when using the %%bash magic - bash

I'm working in Jupyter notebooks, when I use the %%bash magic I get the ln[*] (which means the kernel is busy) instead of the ln[number]. The kernel seems to stay busy until I restart it, and it always does this when using %%bash.
It was working fine until last week, when we were moved to Windows 10 pro with a new AVG antivirus - could this be it?
Any help would be great!

A possible cause is you use the %%bash magic command and not quit with "quit" command,for example the execution result will ask you to keyboard a "ipdb" message when you use "%debug" command ,if you skip this step and execute other cells ,you will get the "[*]" signal and it means those cells will not execute unless you restart the kernel,hope helpful.

Related

Spyder debugger freezes on second restart of code

My task is to repeatedly rerun a code from beginning. As I do not want to run the code to the end I set a breakpoint() command. However, Spyder freezes when the code is the second time called from debug mode. For demonstration a simple program is sufficient:
print('Hello World!')
breakpoint()
After launching Spyder I start the small program by F5. Everything works as expected and I jumped into the debug mode. Now I press again F5 and the code restarts correctly from the debug mode. After again pressing F5 the code is not restarted and instead the IDE freezes. It is not possible by any means to rerun the code again from debug mode. Interrupting the kernel by pressing the red button (see screenshot below) does not help. Trying to leave the debug mode by !q does not leave the debug mode. The only possibility to rerun the code is quite cumbersome, i.e. I have to restart the kernel (Ctrl+.) that takes a while. How to debug code under these circumstances?
Is this a bug of the IDE or expected behavior? How can I restart the code by a simple key press as often as possible from debug mode?
This is a screenshot of the Spyder console with comments in red added.
I use a recent version a WinPython with latest Spyder 5.4.0, Python 3.10.4 64-bit, Qt 5.15.2, PyQt5 5.15.6, Windows 10Pro Version 21H2. The problem also appears with Spyder 5.3.3 A similar problem (or maybe the same) appears with a different Python version.
After many trials, I noticed that there is something strange with IPython console. I noticed that when it hangs after running a code, if I delete all user variables, it worked fine.
Then I tryed to delete all variables before execution, and it work fine.
Therefore I discovered that a solution that worked for me is to go to preferences -> Run -> and untick the option 'Remove all variables before execution'
It is quite annoying because I have to do it manually every time before running, but in this way the spyder does not appear to hang anymore! I hope that the Spyder developers will solve it soon.
-
I automatically solved by typing at the beginning of any script these lines, inspired from the question Code to clear console and variables in Spyder :
try:
from IPython import get_ipython
get_ipython().magic('clear')
get_ipython().magic('reset -f')
import matplotlib.pyplot as plt
plt.close('all')
except:
pass
similar to Matlab in which you normally start your code with
clc
close all
clear all

How can I permanently setting the Screen Layout (arandr) in Manjaro i3?

I recently installed Manjaro i3 on my laptop and tried to connect an external Monitor, to extend the main Screen when it's plugged in and just use the single monitor mode when not.
This seems to mostly work using arandr. Unfortunately I have to reapply the arandr settings again on every boot to get my layout back, since it gets reset every time.
I have tried exporting the arandr commands to .xinitrc and /root/xinitrc, I have tried editing the xorg confs and I have tried putting it into .screenlayout, but with no result.
So how can I permanently set my screen resolution and layout?
I case somebody comes across this question:
1. open arandr
2. Set your desired layout
3. Export it
4. open /etc/lightdm/xsession
5. Add the exported code before the last line
6. reboot

how to close running process (Chrome) from task manager in Ubuntu

while working on application, code execution caught in infinite loop like-
console.log('print');
and now it is running and running.
To close Chrome I tried everything which I can but no result.
finally I restart my machine to solve it, that took several minutes
The same (infinite looping) happen again and again, I looked for that like -
http://ubuntuhandbook.org/index.php/2013/07/use-ctrl-alt-del-task-manager-ubuntu/
Advanced Scheduled Process/Task Manager - Linux
Killing a process in linux
finally I got solution, wanted to share with all to save the time-
Here is the solution-
1. Machine info-
Ubuntu 16.04 LTS.
Press windows Butoon-
type 'System Monitor', which will display one menu, click on that-
We will see list of all running process as-
At bottom, we have button as 'end process', click on that which will show one popUp as-
click Ok and that task enjoy!!!
Hope will work for you too!!

Virtual Pascal v2.1 has a small display in Win7 [64bit] - can I make it bigger?

Is there some way [software or VM] that will let me run VP in a larger box - this is really frustrating me.
I thought, from the display, that VP21 was running in DOS, so I tried "DOSBOX", but when I tried to run the VP.exe file, it came back with:
"This program must be run under Win32", so it seems to be Windows with a weird display.
The simplest is to change the setting in VP: set Options->Environment->Screen Size to "Keep original". Then exit VP, size the window the way you want it, and run VP again.
From the command line, you can do it with the mode command:
mode 120,60
is nice and large.
It is very simple (or I missed something obvious): Make a shortcut for vp.exe and edit the proporties. You can change the layout/window size to any values that your monitor allows.
I don't think you can - the app itself preventing full screen mode. And you cannot use DOSBOX because VP21 is a true Win32bit app. You can download and install "real" TurboPascal - that one will run under DOSBOX and that you can expand full screen.

How do I programmatically stop all synths?

How do I programmatically tell supercollider to stop all synths, as in the equivalent of Ctrl+. in the IDE?
I don't have SC booted at the moment, but s.freeAll should do the job, as it frees all nodes attached to the server.
http://doc.sccode.org/Classes/Server.html#freeAll
You can all Ctrl+. from code directly:
CmdPeriod.run
This is more complete than s.freeAll as it also stops language-side Threads, including the one that contains this command. To see how to have threads escape CmdPeriod, check out the helpfiles for CmdPeriod and for SkipJack

Resources