Skip to content

Commit 97f8e19

Browse files
author
y8z
committed
[ci skip] automated comment issue creation and tag+archive page generation
1 parent 0feac2d commit 97f8e19

File tree

2 files changed

+54
-0
lines changed

2 files changed

+54
-0
lines changed
+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
layout: post
3+
title: Mouse gesture on Mac
4+
subtitle:
5+
tags: [Mac, software, tool]
6+
author: Yuanpeng Zhang
7+
comments: true
8+
use_math: true
9+
---
10+
11+
On Windows, we have software like `AutoHotkey` with which we can define keyboard shortcut for running various actions in a convenient way. With `AutoHotkey`, we can also define mouse gestures to execute actions quickly. Here in Ref. [1] is provided a zip file containing the `AutoHotkey` files for some useful shortcuts and mouse gestures on Windows.
12+
13+
> With `AutoHotkey`, one weird observation is that sometimes, if we define shortcuts involving the `Ctrl` key, the simulated or physically press of `Ctrl` key will not be released. I am still not finding the solution to this issue, so in the version of `AutoHotkey` file provided above, I am not including any definition of shortcuts involving the `Ctrl` key.
14+
15+
On Mac, though, there is not such a single-shot solution to define mouse gestures in a convenient manner, at least I am not seeing any
16+
products on the market for such a purpose. However, there are some software, which, when put together, can realize somewhat what we need. The `Mac Mouse Fix` software [2] provides some tweaking capability for several of the alternative mouse buttons, including the middle button and some other available buttons on some mouse. The functionality is a bit limited but it can definitely make the use of normal mouse other than the Mac magic mouse more convenient and productive. Another useful software coming into the loop is called `MacGesture` [3], with which we can define some basic mouse operations, though, still limited, to realize some commonly executed actions, such as closing browser tab, moving forward and backward, scroll to the bottom and top of the page, etc. The combination of the two software mentioned here does make the using of normal mouse on Mac more convenient.
17+
18+
References
19+
===
20+
21+
[1] [https://yr.iris-home.net/mousegestureautohotkey](https://yr.iris-home.net/mousegestureautohotkey)
22+
23+
[2] [https://macmousefix.com/](https://macmousefix.com/)
24+
25+
[3] [https://github.com/MacGesture/MacGesture](https://github.com/MacGesture/MacGesture)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
layout: post
3+
title: Run Python Debugger in VSCode
4+
subtitle:
5+
tags: [IDE, software, tool, VSCode]
6+
author: Yuanpeng Zhang
7+
comments: true
8+
use_math: true
9+
---
10+
11+
Running the debug mode for coding in IDE is a very convenient feature, as we can put in break points and check variables in our program without killing the running process. In `VSCode`, to run the debug mode - here I am taking Python as the example - we need to first download the debugger extension. For Python debugger, we can just search in the extension sore within `VSCode` and we should be able to find the Python debugger listed to be installed. Once installed, we can go to the `Run and Debug` option in the left sidebar and try to run the program in the debug mode. Initially, it will ask us to populate the configuration file, if we have never used the debug before, as shown [here](https://code.visualstudio.com/assets/docs/python/debugging/debug-start.png). Clicking on the link as shown in the picture, we will be brought up with the configuration JSON file to populate. We can put something like below in the file,
12+
13+
```json
14+
{
15+
"version": "0.2.0",
16+
"configurations": [
17+
{
18+
"name": "Python Debugger: Current File",
19+
"type": "debugpy",
20+
"request": "launch",
21+
"python": "/Users/y8z/opt/anaconda3/envs/g2python311/bin/python",
22+
"program": "GSASII.py",
23+
"console": "integratedTerminal"
24+
}
25+
]
26+
}
27+
```
28+
29+
Here, the `program` option will specify the relative path (with respective to the workspace folder) to the main Python file to be executed. By default, the `python` entry will not be created but it is actually necessary as it specifies the full path to the Python executable (which then determines which environment we will be using) to be used for running the Python script. Once all the entries above are populated properly, we can then hit the `Run` button in the `Run and Debug` option to start the debug mode. Here, we can first insert some breakpoints in our codes (by clicking on the left edge of the editor corresponding to a certain like and red circle will be shown to indicate the breakpoints). Then when the running program hits the breakpoint, it will bump into the debug mode, allowing us to bring up the command console -- we can use ``` ctrl+` ``` to bring up the terminal panel where we can find the `DEBUG CONSOLE` among the top option tabs in the terminal panel. We can also go to the top part of the editor to find the several options to control the flow of the debug mode, e.g., to move forward, i.e., to skip the current break point.

0 commit comments

Comments
 (0)