MIC-02-5 Small progress during a busy end of week

I set the stage for command groups in bike.py with [my latest change to bike.py](added sel2pb command to bike.py · rdhyee/python-learning@a161fe9).

It seems that Keyboard Maestro doesn't allow for watching for changes in files that already exist. Maybe, more likely, I've just not been able to figure out how. I have some progress using hammerspoon though. Here's a relevant part of my init.lua:


function list_true_flags(flags)
  local true_flags = " "
  for key, value in pairs(flags) do
    if value then
      true_flags = true_flags .. key .. " | "
    end
  end
  return true_flags
end

function fileModifiedCallback(paths, flagTables)
  for i, file in ipairs(paths) do
    if file == "/Volumes/ryvault1/MacHD/Users/raymondyee/obsidian/MainRY/bike/overall.bike" then
      local flags = flagTables[i]
      print(i, file)
      print_true_flags(flags)

      local timestamp = os.date("%Y-%m-%d %H:%M:%S")
      -- local message = timestamp .. " overall.bike changed\n"

      local logFile = io.open("/tmp/hschange.log", "a")
      logFile:write(timestamp .. list_true_flags(flags) .. "\n")
      logFile:close()
    end
  end
end

watcher = hs.pathwatcher.new("/Volumes/ryvault1/MacHD/Users/raymondyee/obsidian/MainRY/bike", fileModifiedCallback)
watcher:start()

MIC-02-3 Sick day

I woke up with a sore throat this morning: oh oh. I'm glad that I took my Sweetie's advice to take an afternoon nap. I'm feeling slightly better but should continue to rest today. I did make some tiny progress by using click to add parameters to python-learning/bike/bike.py at 62005c488359f587f1863457c5eba24bd0863688 · rdhyee/python-learning. I can now use Keyboard Maestro to launch bike.py and change the base heading level through a prompt. I hope to be programming with energy tomorrow. 🙂

MIC 02-2 Refining bike.py with more options and a better understanding of Pandoc

bike.py (python-learning/bike/bike.py at f1bf45be1e886bf66c3dad97d3b0694a847528b3 · rdhyee/python-learning) is my working script for converting the currently selected rows in Bike (and their enclosed rows) to Obsidian flavored markdown, copying that markdown to the clipboard, and also writing it to a ScratchPad note in my Obsidian vault.

I am working on more fully integrating bike.py into my workflow before polishing the script to make it more useful to others and easier to maintain.

On my programming to-do list today and tomorrow are:

  • relearn Click and try out Typer so that I can add arguments and options to bike.py to change bike.py from a single purpose script to a script that will ultimately handle all aspects of automating the Bike program.
  • grok the containment hierarchy of the Pandoc AST -- what elements are allowed where in the tree hierarchy, specifically, whether I can wrap list items into anything other than a list-like container. I will study Document structure - Pandoc (Python Library) and use the Python pandoc library to help me grok the Pandoc metamodel.

MIC 02-1 A few thoughts about writing

Because I'm forcing myself to write in public during MyInfoCamp, I've been reflecting on how I write. I’m currently seeking a productive mix of "linear" and "nonlinear" writing. By linear writing, I mean, putting one word after another, and finishing one sentence before moving to writing my next sentence. (for some people, that means writing, plain and simple). By contrast, "nonlinear writing" is how I usually write: spitting out a collection of words and phrases as they come to mind, letting myself flit among ideas. I like to write in an outliner (such as Bike) because the outliner makes arranging the phrases into a hierarchy much easier than Microsoft Word. I have many notes scattered through my computer with lots of unrefined ideas, the side effects of my nonlinear writing process.

During the last week, I decided to shift more of my energy to writing linearly. I love the refreshing change, which seems to help me to deal with one of my perennial problems: too much "work in progress" (WIP). As the Kanban project methodology teaches, it's crucial to limit WIP; otherwise, it becomes very difficult to finish anything, because your efforts become diffuse, scattered over too many thoughts and incomplete sentences.

I wonder what writing "experts" (those who teach others how to write) would say about my distinction between linear and nonlinear writing. I find it hard to believe that I am happening upon some novel insight (even if it is novel for me.)

A key issue to dig into: when is it best to translate words into phrases into sentences? I now think that I could benefit from doing the translation earlier in my writing process.

One thing is clear: it's a mistake for me to give into the temptation of delegating to a LLM the task for translating words and phrases into coherent sentences of a first draft. That translation process is the heart of what makes writing the fraternal twin of thinking.

MIC-01-5 Working with pandoc format+extensions strings

Today, I dug into pandoc formats. I learned that there are two subfamilies of markdown formats. There are extensions that are associated with any given format. Some are enabled by default and some are turned off by default. I wrote code to compute the \"canonical\" and \"expanded\" versions of those pandoc format strings: rdhyee_utils/rdhyee_utils/pandoc at master · rdhyee/rdhyee_utils

MIC-01-4 Pandoc, tell me about yourself

I want to develop a mutually supportive habit of programming and writing together.  I feel torn right now because writing and coding feel like competitors for my focus and time.  I know that writing and programming are not enemies -- that I know -- but it will take patience and practice to harmonize (dare I say, synergize) them.

Over the past several months, I've made progress on programming MyInfoNet that pleases me. For better or worse, I've not spent much effort in communicating with others about the work I've been doing. While I jot copious notes to myself, I haven't forced myself to turn those notes into coherent prose.

Today, I've been focused on understanding how to use pandoc to handle Obsidian Flavored Markdown. Markdown is a popular lightweight markup language that has many "variants", "flavors", or "dialects".  I started experimenting with asking pandoc itself to tell me about the formats it supports and extensions that are supported for a given format (specifically markdown).

MIC-01-3 Filling the space with BLACK HOLES

Over the years, I've tried many times to blog daily but have failed almost every time. I
During these 12 weeks of MyInfoCamp, I’ve committed to writing on my blog each weekday. I’m determined to succeed this time, even if I all I do is to report in for the day and write “sorry folks, I don’t have much to say today.” I have some decent material in the hopper, including an exposition on outliners vs word processors, why I’m focused on clipboards, and why I love lightweight markup languages, even if they might be too geeky for many computer users. None of these writings is sufficiently “cooked” to serve up.

Instead, I will reach into my storehouse and paste another part of my Recurse Center application. One of the questions on the application was “What is the most fascinating thing you've learned in the past month?” I had a lot of fun crafting my response.

I'd like to share a smaller and a grander thing. I learned that the visually stunning artichoke flower that I bought at a farmer's market was actually not edible -- so my plotting about how to jam it into my instant pot was extraneous imaginative planning.

The grander item, on the other hand, was big news, featured in the New York Times, This week, I spent several hours trying to grok the confirmation of long wavelength / low-frequency gravitational waves through the use of data on how the time of arrival of light from pulsars undulates over long periods of time. But after hours of reading news articles, listening to podcasts, watching YouTube videos, and interacting with LLM chatbots, I couldn't find a better articulation of the fascination and excitement that I (and many others) feel than Katie Mack on Twitter:

Hugely exciting! We’re using RADIATION JETS from DEAD STARS to detect RIPPLES IN SPACE from the COLLISIONS OF SUPERMASSIVE BLACK HOLES ACROSS THE ENTIRE COSMOS. Honestly that’s just frickin’ awesome.

I've had my own multi-decade fascination with black holes. When I first read as a kid that something could be so massive that even light cannot escape its gravitational pull, my little brain was set alight. I thought that supermassive black holes were a recent discovery because I only learned about these "charismatic cosmofauna" but Wikipedia tells me that researchers have been pondering them for decades. Unsurprisingly, as I attempt to unravel the origins of my fascination with black holes, I sense that the connections permeate my entire brain. Consequently, I must curtail my introspection and focus on penning the requested sentences.

MIC01-2: Hacking on a pandoc reader and writer for Bike

When I get deep into programming, I find it difficult to do anything else that is intellectually demanding. Yesterday, I wrote briefly about the overall context for MyInfoNet and how I want to focus on automating system clipboards and browsers. However, what I am actually hacking on today is taking the next steps on moving text between two applications: Obsidian and Bike. Using some technical shorthand, I posted last week a paragraph explaining what I'm up to:

Thanks for this really interesting thread. I have some work in progress (that’s not ready for prime time) that is related to the work here: I have a rough draft of a Python library that converts .bike documents into the Pandoc JSON representation of its AST using lxml and panflute. I’ve put my draft in my own rdhyee_utils Python library – so it’s rough and not been packaged to useful to others yet: https://github.com/rdhyee/rdhyee_utils/blob/master/rdhyee_utils/bike/bikeformat.py. You can see also my work so far in writing a Python library to talk to Bike using AppleScript, or my precisely the deprecated, though still very useful, appscript 1https://github.com/rdhyee/rdhyee_utils/blob/master/rdhyee_utils/bike/init.py. More later once I get my work polished up (and after I get a draft on a pandoc bike writer)

I was hoping to narrate the technical details of my programming as I worked but didn't end up doing so. (I'm still mastering my writing and programming workflow.)

MIC01-1: MyInfoCamp kickoff

Applying to be a part of a Recurse Center (RC) retreat/batch was high on my to-do list for my personal sabbatical this year. I finally applied in early August and participated in two rounds of interviews, which, I thought, went swimmingly. I was shocked to be summarily turned down the following day. The interviewers were very nice to me, and though I wish I could learn the reasons for why I was rejected, I know that I will never know. I tell myself that accumulating a pile of rejection letters is a telltale sign of my actually trying to accomplish the bigger goals in life. I hope that the next time I get a NO that I will indeed be able to take it less personally.

As the Recurse batch for which I applied starts today, I express my gratitude for the Recurse Center. The process of applying to RC, of forcing myself to write down what I want to do and why, was the hard work that I needed. I even told the interviewers (a blunder?) that I was going to work on the project I described in my application regardless of whether I got into RC or not. I recognize that because I'm not in RC, I need to create my own support structures that will buoy me this fall.

So today, I'm kicking off my 12 week sprint, which I code-name "MyInfoCamp" or "MyInfoCamp23" -- for good or bad, I've taken to giving names to my projects (and electronic devices). I'm devoting (roughly six hours each weekday) for the next 12 weeks to work publicly on "MyInfoNet", which I described in my RC proposal.

MyInfoNet is my early-stage project for developing software services to simplify individual-level information, data, and knowledge integration. It seeks to apply enterprise integration principles, such as those found in Apache ServiceMix, to personal information management and small-scale IT solutions. The challenge lies in leveraging the robustness of enterprise integration without introducing undue complexity.

Because the clipboard and web browser are key hubs of information and data exchange, I will create two exploratory prototypes:

  • MyInfoNet-Clipboard: I'm developing this scriptable clipboard manager to streamline the exchange of text-based data across applications and platforms. Currently, it's a Python script that uses Pandoc for markdown and HTML conversion on the system clipboard. I plan to enhance it into a professional-looking, macOS desktop app that can be controlled via AppleScript and features relevant Shortcuts. Initially, it will handle markdown, HTML, and rich text before progressing to images.

  • MyInfoNet-Browser: This web browser controller automates, scripts, and scrapes web interactions. It's currently a Jupyter widget that lists open Google Chrome tabs and allows selective focusing or closing. I envisioin this as a tool to simplify and automate web-based information gathering and integration into a user's knowledge base.

There's a lot to unpack in what I compressed into my description of MyInfoNet -- that's a big part of what I will do during MyInfoCamp. My answer to the question "What do you want to be doing in two years?" in my RC application should provide some larger context to MyInfoNet:

I've carved out this calendar year as a self-funded personal sabbatical to reboot my life personally and professionally. In two years, I would like to be writing software to support my work as a consultant or entrepreneur, while still finding time to scratch my own itch. I would like to see where wholeheartedly designing, prototyping, and building MyInfoNet (which had its genesis about twenty years ago) will take me.

I'd love to see a practical path for generating sufficient revenue out of services or products that flow out of MyInfoNet. I'm prepared for MyInfoNet to continue only as my passion project. I'm currently exploring which of the fields that I've worked in to prioritize: academic research data, publishing, data engineering for small and medium businesses, services and products for older adults, and disaster preparedness, among others. Returning to the University of California system is also a live option for me, as someone who is just short of 10 years of service credit in the system.

In all cases, I'm hoping that the time I spend at the Recurse Retreat will allow me to consciously and deliberately improve my craft so that in two years, the scale and skill level at which I'll be operating will more closely match the ambition of what I imagine in, say, MyInfoNet.