Tag Archives: SciTech

Science, technology (probably mostly around software development), various geekery.

emacs org-mode todo list priority (urgency) hack

Might as well brag about this, since I’m inordinately proud (I become an hacker about once every two or three years). I love -mode, but I don’t love what it does with todo entries (highest-priority, longest-scheduled first). For me, if something’s been at priority A for 280 days, it’s not that high-priority (but still higher than anything at priority B). I want highest-priority, most-recently-scheduled first, in the time-honored tradition of ignoring things in the hope they’ll go away.

Here it is.

(defun my-org-agenda-todo-sort (a b)
  "Function should only sort TODO items; since I can't return ``unsortable'' for things that don't compare, I just
return 0 and hope for the best.  Seems to be working so far.  Higher-priority and more-recently-scheduled items
have higher urgency." 
  (if (string-match "\\(Sched\\.\\s-*\\([0-9]+\\)x\\|Scheduled\\):\\s-+\\S-+ \\[#\\([ABC]\\)\\]" a)
      (let ((a-sched-days (string-to-number (if (null (match-string 2 a)) "0" (match-string 2 a))))
            (a-priority (match-string 3 a)))
        (if (string-match "\\(Sched\\.\\s-*\\([0-9]+\\)x\\|Scheduled\\):\\s-+\\S-+ \\[#\\([ABC]\\)\\]" b)
            (let ((b-sched-days (string-to-number (if (null (match-string 2 b)) "0" (match-string 2 b))))
                  (b-priority (match-string 3 b)))
                                        ;(message "Agenda item a of type %s: %s" (type-of a) a)
                                        ;(message "Agenda item b of type %s: %s" (type-of b) b)
                                        ;(message "a-priority: %s; b-priority: %s; a-sched-days: %s; b-sched-days: %s"
                                        ;         a-priority b-priority a-sched-days b-sched-days)
              (cond ((string< a-priority b-priority) 1)
                    ((string> a-priority b-priority) -1)
                    (t (cond ((< a-sched-days b-sched-days) 1)
                             ((> a-sched-days b-sched-days) -1)
                             (t 0)))))
          0
          )
        )
    0
    )
  )
(setq org-agenda-cmp-user-defined 'my-org-agenda-todo-sort)
(setq org-agenda-sorting-strategy '((agenda habit-down time-up user-defined-down category-keep)
                                    (todo urgency-down category-keep)
                                    (tags urgency-down category-keep)
                                    (search category-keep)))

Update: Ok, that was stupid. Here’s a more readable version:

https://gist.github.com/JohnL4/4ddd2ec185b8a9b948db6d62edb9d32d

Building a new Amazon AWS EC2 instance

Building a new Amazon AWS EC2 instance, since my old one is now so ancient I can’t install Go on it.

What’s the diff between t2 and t4g? Can I run Graviton2 chips? Should I use Corretto? Does Amazon contribute back to OpenJDK? What’s the diff between gp2 and gp3? What’s NVMe? Will an EBS volume made with it persist? Where’s my new volume that I made from a snapshot of my old root partition? Which of all these fstab/mount options do I need? Where are my old #JspWiki files? (Hmm, I should probably be using #Obsidian.)

#NotMyChosenCareer #IJustWannaDevelopSoftware

Washington State Votes To Kill Law That Restricted Community Broadband | Techdirt

“If entrenched broadband providers really wanted to thwart such options, they’d simply offer faster, cheaper service. Instead, they’ve found it **more cost effective to buy laws restricting the options**, even if local community members want to vote for it.”

https://www.techdirt.com/2021/04/15/washington-state-votes-to-kill-law-that-restricted-community-broadband/#:~:text=If%20entrenched%20broadband%20providers%20really%20wanted%20to%20thwart%20such%20options%2C%20they%E2%80%99d%20simply%20offer%20faster%2C%20cheaper%20service.%20Instead%2C%20they%E2%80%99ve%20found%20it%20more%20cost%20effective%20to%20buy%20laws%20restricting%20the%20options%2C%20even%20if%20local%20community%20members%20want%20to%20vote%20for%20it.

Law as code

Comment by JohnFen – https://news.ycombinator.com/item?id=37090710

I’ve actually always thought something like this:

«As a rough analogy that my lawyer told me early on, lawyers are like software engineers, and the law is like the operating system. A good lawyer writes robust “code” designed to deal with edge cases and unexpected conditions gracefully.»

Law as code, amenable to diffs and code review, and vulnerable to bugs.

My little Angular project

So… I’m working on a little hobby side project as part of my journey of discovery into Angular 16 and Material and a bunch of other stuff. (I taught myself Angular back in the version 2, 4 days, and am responsible for a dormant Angular 8 app at work.) I always though it’d be cool to have a blog acting as sort of a journal as I go, so others can learn along with me if they want (I’m trying to be a bit didactic about it).

It just occurred to me that my commits actually serve the purpose, albeit in rough, ragged form. I have an org-mode file in the repo that I’m maintaining sort of as a journal, so, between that, and the (hopefully well-commented) code changes I’m making, it should just fall out. You can stick the RSS URL into your favorite feed reader (I use https://newsblur.com) and get notified whenever I make a change (mostly on the weekends, probably).

Happy to entertain questions and comments, if anybody’s interested.

https://github.com/JohnL4/Journal-Go/commits/main.atom

POSSE desires

Ya know, I’m starting to be surprised this hasn’t been done yet (maybe it’s hard), but what we really need is an app (or web app) that acts as a front end for composing POSSE posts, and:

  • Gives you various indicators/metrics as you type of the character limits of each of SEVERAL social media apps to which you wish to crosspost;
  • The ability to include multiple links and indicate which one is the most important for those stupid sites that only embed one;
  • Ditto images;
  • Maybe makes it REAL EASY to provide summary slugs w/in character limits for various social media sites;
  • Tagging in a way that meshes with each of several different social media apps….

And probably a bunch of other stuff I can’t think of off the top of my head.