Setup CLISP Environment for Land of Lisp

How to setup CLISP environment in Spacemacs on Archlinux

Guowei Lv

1 minute read

The famous Land of Lisp uses CLISP. This is a tutorial to help you setup everything up. I use Spacemacs + Common Lisp Layer + CLISP + Manjaro Linux. After install the Common Lisp Layer in Spacemacs, when start up Slime, I got an error saying: could not load ASDF. Here is the fix that worked for me: Install asdf separately: yay asdf After it is successfully installed, it prints: To load ASDF every time you start Lisp, copy the lines from /etc/default/asdf to your ~/sbclrc or ~/.

Simple Toolbar Example

Straightforward toolbar example

Guowei Lv

1 minute read

Use NoActionBar theme <resources> <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"> <item name="colorPrimary">@color/colorPrimary</item> <item name="colorPrimaryDark">@color/colorPrimaryDark</item> <item name="colorAccent">@color/colorAccent</item> </style> </resources> Create toolbar layout <?xml version="1.0" encoding="utf-8"?> <androidx.appcompat.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" xmlns:app="http://schemas.android.com/apk/res-auto" android:background="@color/colorPrimary" android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" app:popupTheme="@style/ThemeOverlay.AppCompat.Light"> </androidx.appcompat.widget.Toolbar> Setting the layout_height to wrap_content will make it the correct default height. Since our app has a light theme, the texts color in toolbar will be black. To change it to white, we need to set the theme of the toolbar to ThemeOverlay.

Android Custom View 102 (Part 9)

A RatingBar Example

Guowei Lv

1 minute read

There is nothing new here, just another exercise. Two things to be careful with: Try to call validate() as fewer times as possible, it is expensive. If you want to handle the touch events in this manner, remember to return true from onTouchEvent(). Otherwise, only the first event will be triggered(most likely DOWN in this case) and not the succeeding ones (like the MOVES). Source Code

Emacs Orgmode Minted Setup

How to setup orgmode pdf export with minted on Arch Linux

Guowei Lv

1 minute read

Install minted package https://en.wikibooks.org/wiki/LaTeX/Installing_Extra_Packages Install Pygments https://pygments.org/ Configure Emacs (setq org-latex-listings 'minted org-latex-packages-alist '(("" "minted")) org-latex-pdf-process '("pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f" "pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f" "pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f")) Remove cached minted* dirs This is the step that unblocked me. Prevent src block line too long (setq org-latex-minted-options '(("breaklines" "true") ("breakanywhere" "true")))