Sacha Chua https://sachachua.com/blog/feed/ Emacs, sketches, and life Mon, 03 Oct 2022 17:25:02 GMT en-US daily 1 11ty 2022-10-03 Emacs news https://sachachua.com/blog/2022/10/2022-10-03-emacs-news/ Mon, 03 Oct 2022 17:25:02 GMT emacs emacs-news https://sachachua.com/blog/2022/10/2022-10-03-emacs-news/
  • Help wanted:
  • Upcoming events:
    • M-x Research (contact them for password): TBA https://m-x-research.github.io/ Tue Oct 4 0800 Vancouver / 1000 Chicago / 1100 Toronto / 1500 GMT / 1700 Berlin / 2030 Kolkata / 2300 Singapore
    • Emacs Paris (virtual, in French) https://www.emacs-doctor.com/emacs-paris-user-group/ Tue Oct 4 0830 Vancouver / 1030 Chicago / 1130 Toronto / 1530 GMT / 1730 Berlin / 2100 Kolkata / 2330 Singapore
    • EmacsATX: Emacs Social https://www.meetup.com/emacsatx/events/288513822/ Wed Oct 5 1630 Vancouver / 1830 Chicago / 1930 Toronto / 2330 GMT – Thu Oct 6 0130 Berlin / 0500 Kolkata / 0730 Singapore
    • Emacs users group Slovenia https://emacs.si/ Thu Oct 6 1100 Vancouver / 1300 Chicago / 1400 Toronto / 1800 GMT / 2000 Berlin / 2330 Kolkata – Fri Oct 7 0200 Singapore
    • Atelier Emacs Montpellier (in person) https://lebib.org/date/atelier-emacs Fri Oct 14 0900 Vancouver / 1100 Chicago / 1200 Toronto / 1600 GMT / 1800 Berlin / 2130 Kolkata – Sat Oct 15 0000 Singapore
  • Beginner:
  • Emacs configuration:
  • Emacs Lisp:
  • Appearance:
  • Navigation:
  • Dired:
  • Writing:
  • Org Mode:
  • Completion:
  • Coding:
  • Shells:
  • Web:
  • Doom Emacs:
  • EXWM:
  • Community:
  • Other:
  • Emacs development:
  • New packages:
    • doc-toc: Manage outlines/table of contents of pdf and djvu documents (GNU ELPA)
    • org-tagged: Dynamic block for tagged org-mode todos (MELPA)
    • sweeprolog: Embedded SWI-Prolog (NonGNU ELPA)
    • tesouro: Brazilian Portuguese synonym search in dicio.com.br (MELPA)
    • xit-mode: A [x]it! major mode (MELPA)
  • Links from reddit.com/r/emacs, r/orgmode, r/spacemacs, r/planetemacs, Hacker News, lobste.rs, planet.emacslife.com, YouTube, the Emacs NEWS file, Emacs Calendar, emacs-devel, and lemmy/c/emacs.

    ]]>
    2022-09-26 Emacs news https://sachachua.com/blog/2022/09/2022-09-26-emacs-news/ Mon, 26 Sep 2022 13:39:00 GMT emacs emacs-news https://sachachua.com/blog/2022/09/2022-09-26-emacs-news/
  • Upcoming events:
  • Beginner:
  • Emacs configuration:
  • Emacs Lisp:
  • Appearance:
  • Writing:
  • Org Mode:
  • Completion:
  • Coding:
  • Mail and news:
  • Doom Emacs:
  • Fun:
  • Community:
  • Other:
  • Emacs development:
  • New packages:
  • Links from reddit.com/r/emacs, r/orgmode, r/spacemacs, r/planetemacs, Hacker News, lobste.rs, planet.emacslife.com, YouTube, the Emacs NEWS file, Emacs Calendar, emacs-devel, and lemmy/c/emacs.

    ]]>
    2022-09-19 Emacs news https://sachachua.com/blog/2022/09/2022-09-19-emacs-news/ Mon, 19 Sep 2022 13:09:55 GMT emacs emacs-news https://sachachua.com/blog/2022/09/2022-09-19-emacs-news/
  • Emacs 28.2 released (Reddit, HN)
  • [ANN] EmacsConf 2022 Second Call for Participation (extended until Sep 30)
  • LibrePlanet 2023 Call for Sessions | Free Software Foundation (until Nov 2)
  • Upcoming events:
    • M-x Research (contact them for password): 6th class - Advanced(ish) Features of Functional Languages https://m-x-research.github.io/ Tue Sep 20 0800 Vancouver / 1000 Chicago / 1100 Toronto / 1500 GMT / 1700 Berlin / 2030 Kolkata / 2300 Singapore
    • Emacs APAC (virtual, in English) https://emacs-apac.gitlab.io/ Sat Sep 24 0130 Vancouver / 0330 Chicago / 0430 Toronto / 0830 GMT / 1030 Berlin / 1400 Kolkata / 1630 Singapore
    • Emacs Berlin (virtual, in English) https://emacs-berlin.org/ Wed Sep 28 0930 Vancouver / 1130 Chicago / 1230 Toronto / 1630 GMT / 1830 Berlin / 2200 Kolkata – Thu Sep 29 0030 Singapore
  • Beginner:
  • Emacs configuration:
  • Emacs Lisp:
  • Appearance:
  • Navigation:
  • Writing:
  • Org Mode:
  • Completion:
  • Coding:
  • Shells:
  • Mail and news:
  • Fun:
  • Community:
  • Other:
  • Emacs development:
  • New packages:
    • pixelblaze: Interact with a Pixelblaze via Websocket (MELPA)
    • pueue: Interface for pueue (MELPA)
    • py-snippets: Collection of advanced Python yasnippet snippets (MELPA)
  • Links from reddit.com/r/emacs, r/orgmode, r/spacemacs, r/planetemacs, Hacker News, lobste.rs, planet.emacslife.com, YouTube, the Emacs NEWS file, Emacs Calendar, emacs-devel, and lemmy/c/emacs. Thanks to Andrés Ramírez for links!

    ]]>
    2022-09-12 Emacs news https://sachachua.com/blog/2022/09/2022-09-12-emacs-news/ Mon, 12 Sep 2022 13:20:50 GMT emacs emacs-news https://sachachua.com/blog/2022/09/2022-09-12-emacs-news/
  • Emacs 28.2 released (HN)
  • Last week! EmacsConf 2022 Call for Participation (Reddit) by Sept 18 - all levels welcome
  • Upcoming events:
  • Beginner:
  • Emacs configuration:
  • Emacs Lisp:
  • Appearance:
  • Navigation:
  • Dired:
  • Writing:
  • Org Mode:
  • Coding:
  • Shells:
  • Mail and news:
  • Community:
  • Other:
  • Emacs development:
  • New packages:
    • ement: Matrix client (GNU ELPA)
    • math-tex-convert: Convert LaTeX macros to unicode and back (MELPA)
    • mybuild-mode: Major mode for editing Mybuild files from Embox (MELPA)
    • samskritam: Library to get samskrit word definition, translate to & from (MELPA)
    • yul-mode: Major mode for editing Ethereum Yul intermediate code (MELPA)
  • Links from reddit.com/r/emacs, r/orgmode, r/spacemacs, r/planetemacs, Hacker News, lobste.rs, planet.emacslife.com, YouTube, the Emacs NEWS file, Emacs Calendar, emacs-devel, and lemmy/c/emacs. Thanks to Andrés Ramírez for links!

    ]]>
    2022-09-05 Emacs news https://sachachua.com/blog/2022/09/2022-09-05-emacs-news/ Mon, 05 Sep 2022 12:43:24 GMT emacs emacs-news https://sachachua.com/blog/2022/09/2022-09-05-emacs-news/
  • EmacsConf 2022 Call for Participation (Reddit) by Sept 18 - all levels welcome
  • Upcoming events:
    • M-x Research (contact them for password): Show & Tell - For non RSECon attendees https://m-x-research.github.io/ Tue Sep 6 0800 Vancouver / 1000 Chicago / 1100 Toronto / 1500 GMT / 1700 Berlin / 2030 Kolkata / 2300 Singapore
    • EmacsATX: Emacs Social https://www.meetup.com/emacsatx/events/287915164/ Wed Sep 7 1630 Vancouver / 1830 Chicago / 1930 Toronto / 2330 GMT – Thu Sep 8 0130 Berlin / 0500 Kolkata / 0730 Singapore
    • Atelier Emacs Montpellier (in person) https://lebib.org/date/atelier-emacs Fri Sep 9 0900 Vancouver / 1100 Chicago / 1200 Toronto / 1600 GMT / 1800 Berlin / 2130 Kolkata – Sat Sep 10 0000 Singapore
  • Beginner:
  • Emacs Lisp:
  • Appearance:
  • Navigation:
  • Writing:
  • Org Mode:
  • Completion:
  • Coding:
  • Shells:
  • Doom Emacs:
  • Multimedia:
  • Fun:
  • Community:
  • Other:
  • Emacs development:
  • New packages:
    • for: Iteration and sequence (MELPA)
    • ini: Converting between INI files and association lists (MELPA)
    • jit-lock-stealth-progress: JIT lock stealth mode-line progress (MELPA)
    • mos-mode: MOS toolkit usage (MELPA)
    • org-unique-id: Create unique IDs for org headers (MELPA)
    • pet: Executable and virtualenv tracker for python-mode (MELPA)
    • units-mode: Mode for conversion between different units (MELPA)
    • zuul: Interface to Zuul (GNU ELPA)
  • Links from reddit.com/r/emacs, r/orgmode, r/spacemacs, r/planetemacs, Hacker News, lobste.rs, planet.emacslife.com, YouTube, the Emacs NEWS file, Emacs Calendar, emacs-devel, and lemmy/c/emacs.

    ]]>
    Monthly review: August 2022 https://sachachua.com/blog/2022/09/monthly-review-august-2022/ Sat, 03 Sep 2022 22:51:54 GMT monthly review https://sachachua.com/blog/2022/09/monthly-review-august-2022/
  • Lots of little improvements because I've been getting some early morning coding time while waiting for A- to wake up.
  • Back to making visual book notes, thanks to the SuperNote
  • Lots of playing outside by ourselves or with others. A- sometimes feels jealous of others, but she'll get the hang of dealing with that feeling someday.
  • Blog posts and sketches

    Time

    Category Previous month % This month % Diff % h/wk Diff h/wk
    A- 39.1 41.6 2.5 69.8 4.1
    Discretionary - Productive 5.5 7.7 2.2 13.0 3.6
    Sleep 36.5 38.1 1.5 64.0 2.6
    Discretionary - Play 0.9 0.9 -0.0 1.5 -0.0
    Discretionary - Social 0.0 0.0 0.0 0.0 0.0
    Unpaid work 4.1 3.0 -1.1 5.0 -1.9
    Business 2.7 1.3 -1.4 2.2 -2.3
    Discretionary - Family 3.2 1.8 -1.4 3.0 -2.4
    Personal 7.9 5.7 -2.2 9.5 -3.8
    ]]>
    2022-08-29 Emacs news https://sachachua.com/blog/2022/08/2022-08-29-emacs-news/ Mon, 29 Aug 2022 12:50:47 GMT emacs emacs-news https://sachachua.com/blog/2022/08/2022-08-29-emacs-news/
  • Upcoming events:
  • Emacs configuration:
  • Emacs Lisp:
  • Appearance:
  • Navigation:
  • Writing:
  • Org Mode:
  • Completion:
  • Coding:
  • Mail and news:
  • Evil mode:
  • Community:
  • Other:
  • Emacs development:
  • New packages:
    • cern-ldap: Library to interact with CERN's LDAP servers (MELPA)
    • ipp: Implementation of the Internet Printing Protocol (MELPA)
    • media-thumbnail: Utility package to provide media icons (MELPA)
    • org-bookmarks-extractor: Extract bookmarks from Org mode (MELPA)
  • Links from reddit.com/r/emacs, r/orgmode, r/spacemacs, r/planetemacs, Hacker News, lobste.rs, planet.emacslife.com, YouTube, the Emacs NEWS file, Emacs Calendar, emacs-devel, and lemmy/c/emacs. Thanks to Andrés Ramírez for links!

    ]]>
    Recoloring my sketches with Python https://sachachua.com/blog/2022/08/recoloring-my-sketches-with-python/ Sun, 28 Aug 2022 00:30:04 GMT supernote drawing https://sachachua.com/blog/2022/08/recoloring-my-sketches-with-python/ The SuperNote lets me draw with black, dark gray (0x9d), gray (0xc9), or white. I wanted to make it easy to recolor them, since a little splash of colour makes sketches more fun and also makes them easier to pick out from thumbnails. Here's the Python script I wrote:

    Download recolor.py
    #!/usr/bin/python3
    # Recolor PNGs
    #
    # (c) 2022 Sacha Chua (sacha@sachachua.com) - MIT License
    #
    # Permission is hereby granted, free of charge, to any person
    # obtaining a copy of this software and associated documentation files
    # (the "Software"), to deal in the Software without restriction,
    # including without limitation the rights to use, copy, modify, merge,
    # publish, distribute, sublicense, and/or sell copies of the Software,
    # and to permit persons to whom the Software is furnished to do so,
    # subject to the following conditions:
    
    # The above copyright notice and this permission notice shall be
    # included in all copies or substantial portions of the Software.
    
    # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
    # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
    # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
    # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
    # BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
    # ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
    # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
    # SOFTWARE.
    
    import numpy as np
    import sys
    import os
    import csv
    import argparse
    from PIL import Image
    
    DARK_GRAY = 0x9d
    GRAY = 0xc9
    WHITE = 0xfe
    
    parser = argparse.ArgumentParser(description='Recolor a PNG.',
                                     formatter_class=argparse.RawTextHelpFormatter,
                                     epilog="If neither --colors nor --freq are specified, display the most frequent colours in the image.")
    parser.add_argument('--colors', help="""Comma-separated list of RGB hex values in the form of old,new,old,new
    Examples:
    9d,ffaaaa,c9,ffd2d2 - reddish
    c9,ffea96 - yellow highlighter
    c9,d2d2ff - light blue
    """)
    parser.add_argument('--freq', help="Color replacements in order of descending frequency (ex: .,ffea96). .: use original color")
    parser.add_argument('--csv', help="CSV of color names to use in the form of colorname,hex")
    parser.add_argument('--preview', help="Preview only", action='store_const', const=True)
    parser.add_argument('input', help="Input file")
    parser.add_argument('output', nargs='?', help="Output file. If not specified, overwrite input file.")
    
    args = parser.parse_args()
    
    def color_to_tuple(color_dict, s):
        if s in color_dict:
            s = color_dict[s]
        s = s.lstrip('#')
        if (s == '.'):
            return (None, None, None)
        elif (len(s) == 2):
            return (int(s, 16), int(s, 16), int(s, 16))
        else:
            return tuple(int(s[i:i + 2], 16) for i in (0, 2, 4))
    
    def load_color_dict(filename):
        dict = {}
        with open(filename, newline='') as csvfile:
            reader = csv.reader(csvfile, delimiter=',', quotechar='"')
            for row in reader:
                dict[row[0]] = row[1]
        return dict
    
    color_dict = load_color_dict(args.csv) if args.csv else {}
    
    input = args.input
    output = args.output if args.output else input
    if os.path.isdir(output):
        output = os.path.join(output, os.path.basename(input))
    
    im = Image.open(input).convert('RGB')
    data = np.array(im)
    red, green, blue = data[:, :, 0], data[:, :, 1], data[:, :, 2]
    
    if args.colors:
        colors = iter(args.colors.split(','))
        for from_c in colors:
            to_c = next(colors)
            from_r, from_b, from_g = color_to_tuple(color_dict, from_c)
            to_r, to_b, to_g = color_to_tuple(color_dict, to_c)
            mask = (red == from_r) & (green == from_g) & (blue == from_b)
            data[:, :, :3][mask] = [to_r, to_b, to_g]
    else:
        colors = im.getcolors()
        sorted_colors = sorted(colors, key=lambda x: x[0], reverse=True)
        if args.freq:
            freq = iter(args.freq.split(','))
            for i, f in enumerate(freq):
                if f != '.':
                    to_r, to_b, to_g = color_to_tuple(color_dict, f)
                    by_freq = sorted_colors[i][1]
                    if isinstance(by_freq, np.uint8):
                        print(i, '%02x' % by_freq, f)
                        mask = (red == by_freq) & (green == by_freq) & (blue == by_freq)
                    else:
                        print(i, ''.join(['%02x' % c for c in by_freq]), f)
                        mask = (red == by_freq[0]) & (green == by_freq[1]) & (blue == by_freq[2])
                    data[:, :, :3][mask] = [to_r, to_b, to_g]
        else:
            for x in sorted_colors:
                if isinstance(x[1], np.uint8):
                    print('%02x' % x[1])
                else:
                    print(''.join(['%02x' % c for c in x[1]]))
            exit(0)
    im = Image.fromarray(data)
    if args.preview:
        im.thumbnail((700, 700), Image.ANTIALIAS)
        im.show()
    else:
        im.save(output)
    

    I don't think in hex colours, so I added a way to refer to colours by names. I converted this list of Copic CSS colours to a CSV by copying the text, pasting it into a file, and doing a little replacement. It's not complete, but I can copy selected colours from this longer list. I can also add my own. The CSV looks a little like this:

    darkgray,9d
    gray,c9
    lightgreen,cfe8d3
    lightyellow,f6f396
    lightblue,b3e3f1
    y02,f6f396
    w2,ddddd5
    b02,b3e3f1
    ...
    

    It doesn't do any fuzzing or clustering of similar colours, so it won't work well on antialiased images. For the simple sketches I make with the SuperNote, though, it seems to work well enough.

    I can preview my changes with something like ./recolor.py ~/sketches/"2022-08-02-01 Playing with my drawing workflow #supernote #drawing #workflow #sketching #kaizen.png" --csv colors.csv --freq .,lightyellow --preview , and then I can take the --preview flag off to overwrite the PNG.

    Here's what the output looks like after recoloring grayscale images:

    ]]>
    One month with the SuperNote A5X https://sachachua.com/blog/2022/08/one-month-with-the-supernote-a5x/ Thu, 25 Aug 2022 15:44:41 GMT supernote drawing tech https://sachachua.com/blog/2022/08/one-month-with-the-supernote-a5x/ I've had my SuperNote A5X for a month now, and I really like it.

    Text from my sketch

    I use it for:

    • untangling thoughts
    • sketchnoting books
    • planning
    • drafting blog posts
    • drawing

    A- uses it for: (she's 6 years old)

    • practising cursive
    • doing mazes and dot-to-dots
    • drawing
    • reading lyrics

    Things I'm learning:

    • Exporting PNGs at 200% works well for my workflow. I rename them in Dropbox and upload them to sketches.sachachua.com.
    • Carefully copying & deleting pages lets me preserve page numbers. I use lassoed titles for active thoughts and maintain a manual index for other things.
    • Layouts:
      • Landscape: only easier to review on my laptop
      • Portrait columns: lots of scrolling up and down
      • Portrait rows: a little harder to plan, but easier to review
    • Many books fit into one page each.
    • Google Lens does a decent job of converting my handwriting to text (print or cursive, even with a background). Dropbox → Google Photos → Orgzly → Org
    • Draft blog posts go into new notebooks so that I can delete them once converted.
    • The Super Note helps me reclaim a lot of the time I spend waiting for A-. A digital notebook is really nice. Easy to erase, rearrange, export… It works well for me.
    • Part of my everyday carry kit

    Ideas for growth:

    • Settle into monthly pages, bullet journaling techniques
    • Practise drawing; use larger graphic elements & organizers, different shades
    • Integrate into Zettelkasten

    I put my visual book notes and visual library notes into a Dropbox shared folder so that you can check them out if you have a Supernote. If you don't have a Supernote, you can find my visual book notes at sketches.sachachua.com. Enjoy!

    ]]>
    2022-08-22 Emacs news https://sachachua.com/blog/2022/08/2022-08-22-emacs-news/ Mon, 22 Aug 2022 05:28:32 GMT emacs emacs-news https://sachachua.com/blog/2022/08/2022-08-22-emacs-news/
  • Upcoming events:
    • Emacs APAC (virtual, in English) https://emacs-apac.gitlab.io/ Sat Aug 27 0130 Vancouver / 0330 Chicago / 0430 Toronto / 0830 GMT / 1030 Berlin / 1400 Kolkata / 1630 Singapore
    • Emacs Berlin (virtual, in English) https://emacs-berlin.org/ Wed Aug 31 0930 Vancouver / 1130 Chicago / 1230 Toronto / 1630 GMT / 1830 Berlin / 2200 Kolkata – Thu Sep 1 0030 Singapore
    • Emacs Paris (virtual, in French) https://www.emacs-doctor.com/emacs-paris-user-group/ Thu Sep 1 0830 Vancouver / 1030 Chicago / 1130 Toronto / 1530 GMT / 1730 Berlin / 2100 Kolkata / 2330 Singapore
    • Emacs users group Slovenia https://emacs.si/ Thu Sep 1 1100 Vancouver / 1300 Chicago / 1400 Toronto / 1800 GMT / 2000 Berlin / 2330 Kolkata – Fri Sep 2 0200 Singapore
  • Beginner: (Looks like there's an ALX course that might include Emacs, so people are making tutorials for each other? I might not list all of them.)
  • Appearance:
  • Navigation:
  • Writing:
  • Org Mode:
  • Completion:
  • Coding:
  • Shells:
  • Community:
  • Other:
  • Emacs development:
  • New packages:
  • Links from reddit.com/r/emacs, r/orgmode, r/spacemacs, r/planetemacs, Hacker News, lobste.rs, planet.emacslife.com, YouTube, the Emacs NEWS file, Emacs Calendar, emacs-devel, and lemmy/c/emacs.

    ]]>