Video test

It’s a long time for you guys to see me here. Because during this time, a lot of things happened, especially ChatGPT. And I figured out how to work with that. Now I think it’s time to go back and show you guys something I learned during this time. Not sure how to test video. Your browser does not support the video tag.

Emacs: go back to its associated `org header' in an `org-attachment' directory

I have a path like ‘~/org/3b/2d693a-83d9-40cc-a00f-71c227c5d7f5/’. I want extract ‘3b/2x693a-83d9-40ff-a00f-75d227c5d7f5’ using elisp. After extraction, I want convert ‘3b/2x693a-83d9-40ff-a00f-75d227c5d7f5’ into ‘3b2x693a-83d9-40ff-a00f-75d227c5d7f5’, then use ‘org-id-open’ to open it. `M-x wr/go-back-to-node`, you can go back to the headline. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 (defun wr/second-last-element (list) (nth (- (length list) 2) list)) (defun wr/third-last-element (list) (nth (- (length list) 3) list)) (defun wr/go-back-to-node () "" (interactive) (let ((file (if (equal major-mode 'dired-mode) default-directory (buffer-file-name)))) (if file (let ((extracted-string-2nd (wr/second-last-element (split-string file "/"))) (extracted-string-3rd (wr/third-last-element (split-string file "/")))) (setq converted-string (concat (replace-regexp-in-string "/" "" extracted-string-3rd) (replace-regexp-in-string "/" "" extracted-string-2nd))) (org-id-open converted-string t)) (message "The node has not been added to Emacs yet.

Elisp: Ability to identify shell variables in Helm detect file name

`Helm’ can detect a file name at point. The file name can be absolute or relative path. However, it does not have the ability to identify a shell variable. If you have a path like `$(FOAM_TUTORIAL)/some/path/' you will not able to find the file correctly. Here is what I do to solve this problem: First setup some constants: 1 (setq wr/project-root-path "/PATH/TO/PROJ/") Now you can `M-x wr/find-file-in-project-at-point’ to find file path in this case.

Emacs: a new package to create a formatted directory

Protesilaos/denote: is an efficient file-naming scheme. It was designed to take notes. I found the code itself relatively easy to understand, so I “borrow” some of the snippets to create a new package. It is called dedired/dedired.el. The motivation for this package is to reuse the file-naming scheme but for the folder instead. This is because I often find myself creating a new folder when I generate 3D models. A single big directory is not good, since there will be a different file formats.

fist: calculates all the projection areas

Following is the measurement of projection area shown in post. Geo Area (m^2) with_ball_small 0.01551 with_cone_long 0.01380 with_cone_mid 0.02029 with_cone 0.02029 with_cylinder_longest 0.01999 with_cylinder_longer 0.01936 with_cylinder 0.01761 with_ball_round 0.01778 with_ball 0.02566 lev_c 0.00649 lev_b 0.00650 lev_a 0.00740

fist: setup geometry to verify calculations

After the drag is calculated, the next step is to verify that the calculation makes sense. However, a fist is not a standard geometry and there are no experiments that I can directly compare against. One way to achieve it is to modify the fist and gradaully change it to a standard geometry. A total of 12 cases will be compared and they are shown in Fig. 1. Figure 1: Using diffetnt geometry to verify the drag calculations.

Emacs: improve skeletor

Chrisbarrett/skeletor.el is a powerful project template creator for Emacs. I used it before, but not very often. Today, I find it is more convenient for me to issue a command from dired, here are my tweaks with it: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 (setq skeletor-completing-read-function 'ivy-completing-read) (defun wr/skeletor--read-project-type () "Prompt the user to select a project skeleton.