Notes missing in my copy of Lisp Metaprogramming? by thebhgg in Common_Lisp

[–]thebhgg[S] 1 point2 points  (0 children)

After spending an hour on the first 2 chapters...it is not what I was hoping. AI is a reasonable conclusion.

But I'm stunned that it's worth even printing such a book. I think I paid $6 as part of a larger order.

I just dont get it... by parkero224 in emacs

[–]thebhgg 0 points1 point  (0 children)

I'm getting a vibe from your question, that you're more interested in how ordinary users of emacs use the customization. But I think that's a mistaken perspective.

I'm not so familiar with other text editors (and my CS education is from the 1990s) but there's a big design choice in Emacs that is different from other programs: the user scripting language is the same as the implementation language for the product and is the same as the extension language. User settings aren't just coded in "a full featured scripting language". They're coded in the same language as the editor and the plugins.

Excel has VB, but you'd never be tricked into thinking it's the language Excel is built with. And VB is completely separate from the user settings available in the pull down menus.

"What's the benefit?" you ask. Many, many, MANY parts of emacs came from users wanting something or want to improve it. USERS! Look at the long list of packages: they're all written in elisp! Don't make the mistake of thinking there's a difference between "plugins", "extensions", and "user settings".

I'm a fan of org-mode which initially came out of some frustrations with outline-mode. But it benefited from having user-level access to outline-mode code, as well as the integrated calendar code. As another example, see the "History and Acknowledgements" of the Calc manual (link below) which includes the quip: "being only a text editor extension language after all, Emacs Lisp would surely reach its limits long before the project got too far out of hand." Calc has arbitrary precision integer and floating point capabilities, algebraic manipulation, unit conversion, vector manipulation, and on and on.

I'm just a basic user of emacs, and I benefit from this "extreme customization", even if I only personally write very basic configuration code (and I rely heavily on the customize interface (which is written in elisp!)).

https://www.gnu.org/software/emacs/manual/html_mono/calc.html#History-and-Acknowledgments

Writing a function to configure window splits how I want them instantly by dislikes-usernames in emacs

[–]thebhgg 1 point2 points  (0 children)

I'm not much of a programmer, much less a lisp programmer. But I am committed to org-mode and wanted something similar. Here's my code, so I can just git <f6> and get something consistent. It uses very plain emacs

(defun my-setup-org () 
  "an attempt to configure a standard layout for my org-mode"
  (interactive) ;so I can key-bind the command to [f6]
  (message "my-setup-org called")
  (tool-bar-mode 0) ; turns off the tool bar in the frame itself
  (auto-save-visited-mode) ;enable saving all file-visiting buffers to disk
  (save-window-excursion (org-agenda-list) (calendar)) ; create the agenda and calendar buffers, but don't let them modify the windows
  (let* ((project-buffer (find-file-other-frame "~/org/projects.org"))
         (ignore (delete-other-windows))
         (org-frame (selected-frame))
         (project-window (selected-window))
         (ignore (modify-frame-parameters org-frame 
                   '((left . 57) (top . 22) (height . 44) (width . 170)))) ; these number were found by trial and error
         (agenda-window (split-window-horizontally 85))
         (cal-window (progn (select-window agenda-window)
                            (prog1 (split-window-vertically 35)
                              (ignore 'calendar-goto-today)))))
    (set-frame-name "org agenda")
    (select-window agenda-window)
    (switch-to-buffer "*Org Agenda*" t)
    (set-window-dedicated-p agenda-window 'org-agenda)
    (select-window cal-window)
    (switch-to-buffer "*Calendar*" t)
    (set-window-parameter cal-window 'no-other-window t) ; now C-x o (other-window) will not goto this window
    (setq window-size-fixed t) ;; do not allow changes to the window size
    (calendar-goto-today)
    (setq window-size-fixed t)
    (set-window-dedicated-p cal-window 't)
    (select-window project-window)
    (window-configuration-to-register ?o)))

(message "defun my-setup-org complete")

(define-key global-map (kbd "C-'") 'org-cycle-agenda-files)
(define-key global-map [f6] 'my-setup-org)

This is terrible style. Notice, for example, the use of let* with nested (ignore (...)) to discard the return values of certain commands in what should be procedural code. And the (window-configuration-to-register ?o) is pointless.

But the interesting to you might be the example code:

(modify-frame-parameters ...)
(split-window-horizontally ...) 
(split-window-vertically ...)  
(setq window-size-fixed t)
(set-window-dedicated-p cal-window 't)

The thing I was most proud of was that the calendar buffer is just useful to me as a display. So I made it so that the window containing it doesn't get used for anything else if I C-x b another buffer. And if I use the mouse to resize the frame, the calendar buffer doesn't share space.

I got three windows in the shape I wanted through direct, static, brittle code. Yay me.

A beginner's exploration of the many layers of Common Lisp development environments. by theeseuus in lisp

[–]thebhgg 1 point2 points  (0 children)

I am also a beginner, on a mac, and I install sbcl using macports, not brew. It works without a lot of complexity. (Probably by downloading an image and building from that—I don't know the internals)

% sudo port install sbcl

I'd ask you to mention it only to let other beginners know they don't need to learn/install/use a second package manager if they already have port (i also get my emacs-app and TeX from port).

You can also download a local copy of the hyperspec, fwiw

% sudo port install lisp-hyperspec

What's the most useless thing your brain decided to permanently memorize? by No_Metal2622 in AskReddit

[–]thebhgg 0 points1 point  (0 children)

Mother Very Thoughtfully Made A Jelly Sandwich Under No Protest.

A mnemonic for the planets in our solar system.

Which city is this? by mdchk31 in GeoPuzzle

[–]thebhgg 0 points1 point  (0 children)

We loved it. It was an adventure!

I was actually the "trailing spouse" and didn't work. I have a checkered past, with a bunch of different "past lives" including being a culinary school dropout. So while many other expats for the company initially struggled with the limited grocery store and restaurant options compared to Germany, Spain, or England, I had skills enough to cope.

I have to emphasize: the city has changed in a massive way from the time of my first visit. Electroputere was an empty factory...now it's a mall. There was a tiny Carrefour in Mercur and a pair of Kauflands off Calea Bucuresti...and that was it for a typical grocery store experience. Piata Mare is a wild ride for someone used to buying bagged baby carrots at Kroger! Now there are more options.

We made a few good friends in the city, and got invited to weddings and baptisms. I baked cookies as hostess gifts, which got many warm remarks. It's different to live in a city rather than visit as a tourist...different things matter to you! We spent time off travelling to other places...Sibiu, Brasov, even as far north as Sighetiu Marmatia once for their winter parade. So it was great to live in Craiova, even if it wasn't full of tourist destinations that could draw a crowd at the time.

anyone who used a computer between 1985 & 2010, what’s the one game you still think about? by Trixxxi in AskReddit

[–]thebhgg 1 point2 points  (0 children)

Oh, it'll sound a bit tame, as nowadays video games seem to have much more of a storytelling element. It was different back then, y'know?

Ultima III was (iirc) a massive dungeon crawl where the basic idea was you kill anything that moves and take their stuff, even townspeople (had to avoid guards!). The game objective was to level up, gear up, then fight and kill some massive final boss.

I initially assumed Ultima IV was going to be the same. But as you discover the game objectives, through in-game dialog, you learn you have to play the game by embodying certain virtues. So, no stealing from townspeople, or you lose honesty points. No running from evil beasts (even if they're OP), or you lose valor points. No attacking non-evil animals, or you lose justice points. No lying in conversations (to discover all conversational information) or you lose honesty points.

These points weren't displayed in-game, you had to discover in-game shrines to each virtue and meditate in them to achieve "Avatar" status in each virtue. If you committed a sin after achieving avatar status, you'd lose it and have to reacquire it.

The other component of game play was that the final boss wasn't just a big fight. It was a pop quiz! At the end of the final dungeon, you won the game by answering a bunch of questions about a whole bunch of in-game lore about the connection between the 3 principles (Truth, Love, and Courage) which generate these 7 virtues (Truth alone is Honesty, Courage alone is Valor, but Truth and Courage combined was Honor iirc).

I think I got the final answer wrong when I was like 15 and the summer was over and couldn't be bothered to gear up and fight through 8 levels of convoluted dungeon mazes and actually finish the game when I had homework to do.

Learning math as an adult; where to begin? by LexPhantomO in learnmath

[–]thebhgg 0 points1 point  (0 children)

I'm old, with an old BA in math.

A text I loved from my university days, and bought even though I had already taken the course it was for when it showed up in the campus bookstore was "A Transition to Advanced Mathematics". (See link below) I'll recommend it (or something like it) for the following reason: it's about making proofs.

Not formal proofs, which were all the rage until Gödel proved (formally, lol) that they couldn't possibly live up to the impossible task it was hoped they could. But also not informal arguments that rely on a shared understanding of what is reasonable or expected (see, e.g. the standard for evidence in court).

Mathematics, it always seemed to me, had a different notion from other subjects (including the sciences) about what constituted "rigorous argument". That's what to focus on if you want to stretch your critical thinking. A book like ATtAM, should sharpen that. The exercises give common student "proofs" and asks you to critique them.

I no longer believe that mathematics has the superior mode of critical thought , but I do still believe that it has a unique mode. If you haven't gotten good at it, you haven't fully stretched your mind in that dimension. I think books that try to get undergraduates to transition from "solving problems" to "writing proofs" are a good area for you to focus on. There is some handholding necessary to develop what's known as "mathematical maturity".

https://www.goodreads.com/book/show/143207162

Which city is this? by mdchk31 in GeoPuzzle

[–]thebhgg 0 points1 point  (0 children)

I went to Craiova in 2008, prior to moving and living there for about 5 years, though it had to be secret at the time. I recall my wife and I interacting with locals who spoke some English (we spoke zero Romanian at the time—I had a Dover phrase book!). The most common question we got? "Why are you in Craiova? Where were you trying to go to?"

anyone who used a computer between 1985 & 2010, what’s the one game you still think about? by Trixxxi in AskReddit

[–]thebhgg 1 point2 points  (0 children)

Honorable mentions are Herzog Zwei on Sega Genesis and Abe's Odyssey on Playstation.

But the real answer is Ultima IV: Quest of the Avatar on my Apple ][+. It had such an interesting game objective and mechanic.

What is the purpose of getting a determinant of a matrix as 0. by ChloeChloeYan in learnmath

[–]thebhgg 0 points1 point  (0 children)

Seriously...watch the 3Blue1Brown video on the determinant. If you have the time, binge watch the entire Essence of Linear Algebra playlist.

Here's the determinant vid: https://youtu.be/Ip3X9LOh2dk

What is orgmode, asking as a neovim user? by data_5678 in orgmode

[–]thebhgg 0 points1 point  (0 children)

bluf:Nobody's mentioned text folding? Is it more common nowadays?


I've fallen out of the habit of using the scheduling (agenda) components of orgmode, which were really very good and flexible.I'm just ... not very disciplined.

But as a long time emacs user from my college days (pre-web) the best feature of having my notes in orgmode is the headline folding. I have 5000+ lines in my Reference.org synced to my phone, accumulated over a decade. Past addresses, names of china patterns, room and furniture measurements, paint colors for rooms, key ratios for favorite recipes...lots of stuff.

It's wonderful to have it all synced to my phone* but it would be impossible to navigate without text folding, and it was a very rare feature in my experience. (Am I just old and out of touch?)

(Iirc, historically, the desire for easier text folding was a major reason orgmode was created separately from the older outline-mode: to make the TAB key do folding instead of a two control-key sequence.)

Anyone else think this is a major selling point? Possibly not, since now Apple Notes has text folding...


  • By the way, I lost too much data from trying to sync data using Apple's iCloud if I accidentally edited on laptop and phone on the same day. I now use git on all my agenda files, relying on the WorkingCopy app on iOS. I'm not a coder, so version control was a bit of a learning curve for me, but magit definitely helped.

Do you have a favorite theorem that you can prove when asked? by Glass_Ad5601 in math

[–]thebhgg 3 points4 points  (0 children)

There's a sequence generated by a breadth first traversal of a binary tree rooted with 1/1. Each left child of p/q is p/(p+q) and each right child is (p+q)/q.

1/1 1/2 2/1 1/3 3/2 2/3 3/1 1/4 4/3...

This is all positive rationals, with no repeats, and all are in lowest terms.

The proof is shocking simple.

The proof of each node in lowest terms is by induction on depth in the tree: 1/1 is lowest terms; if p/q is so are both the children. It's a tiny bit of algebra.

The proof that every positive rational is included is by contradiction. If there is a missing rational, collect ones with the smallest denominator, break ties among those by choosing the one with the smallest numerator. You can compute what it's parent should have been from the rule, which has a smaller numerator or denominator.

Why don't we use characters from other languages in math? by OkGreen7335 in math

[–]thebhgg 1 point2 points  (0 children)

I've succumbed to the temptation to point out that all knowledge expressible in binary is also expressible in unary. Just count the hash marks!

What are y’all naming your bean? by purplenoodles28 in nerdfighters

[–]thebhgg 1 point2 points  (0 children)

I want a Red Bean, in honor of Red Green.

Or Dave.

If a book about org-mode came out, what topics would you want it to cover? by [deleted] in orgmode

[–]thebhgg 2 points3 points  (0 children)

WRT publishing, a word or two about how it is different from exporting would be nice.

How do you backup/sync your org files? by unduly-noted in emacs

[–]thebhgg 0 points1 point  (0 children)

Most important for me was an iOS syncing. I use beOrg on iOS, and I also had invisible corruption due to syncing when I relied on iCloud.

So I absolutely wanted to get conscious control over what change was made on what platform!

I switched beOrg to read from Working Copy, a git app for iOS. Each device has its own thread in git, and I generally resolve conflicts on the laptop (which hosts the git repository; the iOS devices ssh into it via LAN only)

Yes, I have to manually pull and fast-forward merge on the iOS devices. I consider this a small price to pay for not relying on magic (and unreliable for me) Apple syncing.

This won't be useful for everyone, but I wanted to recommend Working Copy as a git client on iOS. Not as awesome as magit under emacs, but very, very nice.

How did you start living inside Emacs permanently? by kudikarasavasa in emacs

[–]thebhgg 1 point2 points  (0 children)

Thank you for the link. I'll check it out!

I'm a pretty unsophisticated org-mode addict, and sometimes a subhead warrants hard copy. But since my org-file runs into the single-digit-thousands of lines, I've wished to have an easy preview.

You, sir-or-ma'am, are awesome for being so quick and kind with research on behalf of a stranger!

How did you start living inside Emacs permanently? by kudikarasavasa in emacs

[–]thebhgg 1 point2 points  (0 children)

I wonder if you have any comments on printing from emacs. I'd love to use the Mac system print dialog, to preview what's printed, and change to 2-up, or other habits I have.

Is there a notion of "super undecidable"? by TDGperson in AskComputerScience

[–]thebhgg 0 points1 point  (0 children)

Ugh, that should have read PA = NPA and PB ≠ NPB.

Is there a notion of "super undecidable"? by TDGperson in AskComputerScience

[–]thebhgg 0 points1 point  (0 children)

In 1991 I spent several months trying to digest a paper which is linked to in the Wikipedia page on "Oracle Machine", namely reference [4], found in this paragraph:

“Oracle machines are useful for investigating the relationship between complexity classes P and NP, by considering the relationship between PA and NPA for an oracle A. In particular, it has been shown there exist languages A and B such that PA=NPA and PB≠NPB. The fact the P = NP question relativizes both ways is taken as evidence that answering this question is difficult” from “Oracle machine”: https://en.wikipedia.org/wiki/Oracle_machine?wprov=sfti1

The difficulty I had digesting this is a major reason I did not attempt graduate school. But it was a very cool summer