Tag Archives: utility

Idea2021 reports an error. Default operand size is 64 sets the startup task to automatically add the registry

Problem background:

Idea with git will remind you of the following error
arbitrary: use of Rex. W is meaningless (default operand size is 64)
because there is security software, you need to add a key in the registry
Computer \ HKEY_ LOCAL_ Create a new [string value] HookApi under machine \ software \ Tec \ ocular. 3 \ agent \ config_ Dis INS, numerical data: 1
but it’s too troublesome to manually add and restart idea every time. Now it’s changed to automatically add registry configuration after startup

1. Find a directory and create two files, one regidea.bat and one regidea.log

As shown in Figure

2. Modify the bat file and enter the following instructions

(reg query HKEY_LOCAL_MACHINE\SOFTWARE\TEC\Ocular.3\agent\config /v hookapi_disins && (echo %date:~0,4%-%date:~5,2%-%date:~8,2% %time:~0,2%:%time:~3,2%:%time:~6,2% reg exist... >>%~dp0\regIdea.log )) || ((reg add HKEY_LOCAL_MACHINE\SOFTWARE\TEC\Ocular.3\agent\config  /t REG_SZ /v hookapi_disins /d 1)&&(echo %date:~0,4%-%date:~5,2%-%date:~8,2% %time:~0,2%:%time:~3,2%:%time:~6,2% reg set suc... >>%~dp0\regIdea.log ))

The main idea is to query whether there is a hook API in the registry_ Dis INS, set and print a line of text set suc… In regidea.log
If yes, print reg exist…
log file just to see if the instruction takes effect

3. Create a shortcut to the bat file and drag it into the following directory

C: \ users \ XXX \ appdata \ roaming \ Microsoft \ windows \ start menu \ programs \ startup
where XXX is the user name
if the directory cannot be found, check the view hidden item of the folder

Change Jupyter Notebook Default Directory

Change Jupyter Notebook Default Directory

There are three way to change the default (i.e., start-up) directory of jupyter notebook.

Solution #1
1. Use command line (aka, cmd), run the following command: this will generate a config file (jupyter_notebook_config.py), in your working location (C:\Users[Your Username].jupyter).
jupyter notebook --generate-config
2. Goto that location (C:\Users[Your Username].jupyter) and edit file jupyter_notebook_config.py as follow.
Find line:

## The directory to use for notebooks and kernels.
#c.NotebookApp.notebook_dir = ''

3. Delete the “#” and type your default directory inside the ”. (Make sure the directory is exist, or it may causes some troubles)
For example:

## The directory to use for notebooks and kernels.
c.NotebookApp.notebook_dir = 'E:\Default Jupyter Dir\'

Solution #2
1. Find the Jupyter Notebook execute file.
2. Right click the file
3. Find “properties” tab and click it; this will lead you to the “Jupyter Notebook Properties”
4. Check the pop-up window, and you should see “Start in” property.
5. Change the directory to your default directory, e.g., ‘E:\Default Jupyter Dir\’
Solution #3

This solution is based on Anaconda, since Jupyter Notebook load the profile from Anaconda.

You may see the following information from properties window if you had gone through Solution #2.

"Target: D:\Anaconda3\python.exe d:\Anaconda3\cwp.py d:\Anaconda3 "d:/Anaconda3/python.exe" "d:/Anaconda3/Scripts/jupyter-notebook-script.py" %USERPROFILE%"

1. Goto the Anaconda installed location.
2. Find the ‘etc’ directory in Anaconda.
3. Open file ‘jupyter_notebook_config.json’
4. Add your default directory to the ‘notebook_dir’.