Restrict core usages PyCharm - intellij-idea

I have this program that I've written in PyCharm. This program should be running for a week or so, and it is very processor-needy. So when I run it I pretty much have no use of my notebook, as it becomes very laggy.
Is there a way to somehow tell PyCharm to use first three of my cores and leave one for other programms so they can operate normally?

Go into task manager
Find the running task (it probably won't be the main pycharm window)
Right click and select "go to details"
Right click on the details and click "set affinity"
Select whatever cores you wish the program to use
Alternatively you can use the "set priority" sub-menu and set it to "below normal". All other processes are normal priority by default, so it shouldn't interfere with anything, but still use any other available processing power. You can do the same thing with long installations or automatic windows updates so they don't slow you down.
I should also note that both of these selections will be reset upon restarting the program. Additionally, if you are using windows 7, you don't need to "go to details". Everything will appear in the context menu for the process.
Unfortunately, I don't know how to do this in pycharm.

Related

WSL terminal forgets to update and loses focus

I'm trying to use the WSL console in Windows 10 (version 1909) for some development work, but I find that often running processes will simply appear to have hung, but when I send a keystroke to the terminal it will update back to the bash terminal (as if had completed all along but hadn't updated).
I am running the latest version of the debian package from the store.
Is there anyway to make this problem go away or am I wasting my time trying to use the default terminal?
Just a hunch, but I am guessing you are ending up in select mode. If you click anywhere in the terminal the title of the window will change to be prefixed with "select" and the terminal output will freeze so that you can select text without it changing while you try to highlight it. Pressing any key will cause you to exit select mode.
If this bothers you you can turn it off by right clicking on the title bar, clicking properties, and disabling quick-edit mode. Alternately, might I recommend the new Windows terminal, which handles selection and the clipboard in a more intuitive way.

How to terminate Google Colab correctly?

I found
!kill -9 -1
it seems not working correctly.
When I do many tasks simultaneously on colab,
popup appears and asks me like this,
"Memory usage is close to the limit. terminate other? "
and after click yes, GPU gets much faster,
seems initialized correctly.
My question is,
how to call that popup by myself.
To see a list of running sessions along with the memory allocated to them and an option to terminate, follow these instructions.
Make sure notebook is connected to an active runtime.
Click on "Runtime" in the menu bar.
Clink on "Manage sessions" in the menu that appears.
The window that pops up lists your active sessions.

How to show run tool only when there is an error in IntelliJ Idea?

I use TDD quite a lot, and I was wondering if there is a way to show the Run Tool window only when there are failed tests?
Or to be more generic, for any run configuration, I would like the Run Tool window to be shown only when something goes wrong. Otherwise I would prefer the little non-obtrusive green pop-up to appear. Like when you run a lot of tests and you minimize the Run Tool by clicking on the "down arrow" in its top-right corner. When the tests are done, a little green pop-up appears over the minimized window.
I would also compromise for an answer that tells me how to keep the Run Tool always minimized, and only see little pop-ups, regardless if they are green or red.
This is probably not exactly the answer you wanted but if you look in the RunConfiguration (Run->Edit Configurations -> JUnit) for your test run you should see a checkbox called 'Activate tool window'. If that box is ticked then the Run Tool window will pop open even if its minimised. When it's not ticked then the Run Tool window will stay minimised.
So, for any individual existing test run you can change the check box value to prevent the tool window appearing. If you're doing TDD that could mean you have many configurations for specific test cases / suites etc, which you would need to change individually.
In the longer term, you probably want to avoid future run configurations popping up the test. You can do that through the Defaults -> JUnit section in the RunConfigurations window.
Also, in the tab "Logs" you can check the option "Show console when a message is printed to standard error stream"
When this option is checked the window is opened automatically if some test fails.

How to quickly change from one monitor to a next one in Gnome3.16

I use Gnome 3.16 under archlinux and would like to know if there is a quick way to change the integrated monitor with an external one via HDMI. This is the way I have to go (in pictures):
First, you have to open the monitor menu (here in spanish).
Second, you need to open the submenu (where you can choose out of four options: Make this monitor the primary, secondary, show the same content, or turn it off) of your external monitor and choose the option to show the same content in both monitors.
Third, you need to open the submenu of your integrated monitor and turn it off.
Does someone know an easier and faster way to do it, i.e., that as soon as you plug in the HDMI cable it automatically switches to the external monitor while turning off the integrated monitor and vice versa?
This is scriptable with xrandr. You can use the friendlier arandr to generate scripts that call xrandr. Run arandr twice, once for each config you wish to keep. Do a “Save As” to save the two xrandr scripts. Then you simply call the appropriate script whenever you want to switch monitors/configs. I name my scripts like xr1 and xr2 and have a hot-key menu (as part of window manager) to quickly invoke them (or any other script).

Show Networks Flyout (the "connect-to-network" thingie) without explorer.exe running

Requirements:
Our application replaces the usual windows shell (explorer.exe). This is a product requirement for a closed system that we're supplying.
We oughtta let the user select a wi-fi network and connect to it.
The problem: The wi-fi networks dialog only shows up when explorer.exe is running
What we tried:
Write our own wi-fi manager that uses wlan API. It lists connectible networks and allows the user to connect/disconnect. Problem: too many network types/configuratons that have to be tested, especially when the wheel has already been invented and reinvented all over.
Try and check how is the networks dialog implemented. It appears that it's and undocumented COM interface (IUIRAdioManager). Problem: it's undocumented, so no API
Use an existing network manager, for instance the one that comes with the driver. Problems: it's ugly, not to the product's taste; and it opens too many options for the user, like creating and loading profiles, browsing for files on a file system - these things are unacceptable.
Running explorer.exe just for the purpose of showing the networks dialog and then killing it. Problem: once we run explorer.exe - it pops up metro view and hides our fullscreen application or shows the taskbar.
The latter seems like the preferred solution: no need to reinvent the wheel, it does what's needed. Just gotta make explorer.exe not pop out, keep it quiet in the background.
So, we're down to two options:
How to show the networks flyout dialog without explorer.exe?
How to run explorer.exe without it popping out metro or taskbar above our application?
Your first solution would be incredibly difficult to implement. I am almost certain that the Networks window is dependent on explorer.
However, your second is entirely possible.
To hide the taskbar, you will need to find a window (using FindWindowEx) to find the taskbar (name is Shell_traywnd). This will hide the taskbar and start button. EDIT: Unless you are implementing your own taskbar, you might want to set the taskbar to autohide.
Next you will need to hide all of the metro programs. In a similar fashion as above, find the class named EdgeUiInputWndClass and close it. You should be able to get the process name of it and then kill the process.
Windows key. This is a little more difficult. You will probably need to use a program and delete the key or a keyboard hook (a low level keyboard hook) and just ignore key presses with the same scancode as the windows key. Left Windows is 0x5b and Right is 0x5c (source). Note that this will not block Ctrl+Alt+Del.
Finally, to show the Flyout, you can run %windir%\explorer.exe shell:::{38A98528-6CBF-4CA9-8DC0-B1E1D10F7B1B}
(source).
EDIT2:
You should also be able to hide toast notifications via this
Of course, I don't see why you cannot just use Windows 8/8.1 and put the app in kiosk mode.