Emacs-style ranges on a text buffer that I can now hang attributes like color, decorations and click handlers on to.
Inserting/deleting text before a range moves it.
Inserting/deleting text after a range leaves it unchanged.
Inserting/deleting text within a range grows/shrinks it.
Deleting text at a boundary shrinks the range, and deletes it when it becomes empty.
Inserting text at boundaries can't disambiguate whether I want the text within or outside the boundaries. But I can grab some handles on the range to adjust.
The final complexity cost was 200 lines but it was a non-linear path getting there. I started out with the notion of pivots from my doodle app. There, pivots live inside the data structure for a single line of text. Since ranges now need two pivots that could be on different lines, I had to move them out. I started tracking pivots in a separate data structure, maintaining bidirectional mappings between pivots and their locations, and then tracking ranges as combinations of pivots. This quickly blew up the implementation to 500 lines, and I was juggling 27 manual tests of which half were failing.
The next day I started from scratch and threw out the notion of pivots entirely. Now I just maintain 2 locations directly inside each range, and linearly scan through them all for any book-keeping. The implementation dropped to 200 lines and the tests passed fairly quickly.
Earlier this year I threw out an implementation after suffering with it for 2+ years. It feels like I'm getting the hang of this programming thing that I threw out an implementation now after just 2 days. I'm setting a higher bar for elegance. At the same time, it's interesting that my instinct remains as poor as ever for the right approach in even a slightly new problem. Here I spent a lot of time trying to squeeze my ranges into lines so that deleting a line would transparently delete ranges within it. But I blindly assumed a fully normalized design with a first-class notion of a pivot must be a good idea.
My notebook app does simple variants of 2 and 3, and replaces 1 with explicit in-document markup.
Now I'm playing with another approach to 1. I already have the idea of pivots from my doodle app. Putting two of those pivots together should yield a range that adjusts in intuitive ways in the presence of edits. An example may be a WYSIWYG UI for adding a hyperlink to some text:
Inserting/deleting text before a range moves it.
Inserting/deleting text after a range leaves it unchanged.
Inserting/deleting text within a range grows/shrinks it.
Deleting text at a boundary shrinks the range, and only deletes the attached attributes if the range becomes empty. This makes ranges more robust to deletion than my doodles which attached to a single pivot.
Inserting text at boundaries can't always do what you want. I imagine it'd be nice to have handles that you can drag to adjust a range.
2024-10-16 - Like Icarus who flew too close to the sun - Cutting Tofu
From the corner of my eye I saw lightning strike. The first time I felt the ground shake underneath me, tectonic plates shifted back and forth. Will the earth open up and swallow me whole?
Close your eyes and jump. Close your eyes and jump.
I had to climb higher to fall harder. I’m at the edge, tipping the scale, gracefully teetering like a see-saw. I lost something strange and beautiful. Everything amounts to the reasons why.
Close your eyes and jump. Close your eyes and jump.
Let me become stardust. Perhaps the only thing I leave behind will be a feeling. Memories are overrated. Only fools fight against all odds to live.
Close your eyes and jump. Close your eyes and jump.
It's so fucking funny, I just can't. Awkwardly swaying for 40 minutes, enthusiastically dancing to YMCA, one of the gayest songs of all time. God, irony is so lost on republicans. lol
Metaphor ReFantazio is the best JRPG ever and you should play it. I will definitely be writing a post about it once I finish. Atlus cooked with this one, it's so so good. I put like...30 hours into it over 3 days.
I also watched The Substance last night and that was incredible. Top tier body horror and an incredible story to boot. Horror fans are eating good these past couple years.
I hadn't tried this until today, but it turns out to work: I can create equations forwards and back in notebook.love, and trigger either selectively based on what blanks I fill in.
The fine print: to switch directions I have to fill in the right blank, clear the old blank, and then type in something outside the old blank (to indicate I'm not going to type further into the old blank).
Works better if I clear the old query first, but who can remember that?
I've decided to just recompute on every keypress and mouse click. It seemed unnecessary, but now I see that there's some benefit from the inefficiency.
I think we are going to discover long term cognitive impacts from repeat Covid infections. This country did not have the IQ points to spare. It would be so fuckin' easy to be a right wing grifter. I'm not a piece of shit so I'm not trying to exploit people for profit, but god would it be SO easy.
So, Elon musk is definitely gonna use Twitter to fuck with the election somehow. This is just 1 of many reasons why billionaires should not exist. Musk is fully embracing the villain arc and when the billionaire who owns an information platform is teaming with the wannabe fascist dictator...y'all should be more concerned about this it is not a joke
This is what I should have done last year when between the research for Strange Loop, daily maintenance of active projects, and
implementation of new ones, code was what I only ever read or wrote about for
weeks on end. By the time winter came, I was fed up with all of it. If
everything works according to plan, I'm well on my way to not writing a single
line of code this month.
I'm instead using the game engine idea of a pivot. Any time I toggle into doodle mode I have to first pick a pivot from one of the characters on screen. All my drawings are relative to that pivot, and edits to text maintain pivots alongside.
Displacements to the pivot are preserved in font-derived units, so it looks "reasonable" as you resize the font.
Deleting a character deletes all drawings pivoted on it. (But there's undo.)
This took 200 lines, so not too much though it was more than I'd initially expected.
Watched the USC v Ole Miss game yesterday with the fam. I don't really care about the game, I'm just there to eat, drink, and be merry. To that end, we made smoked steak with a creamy mushroom topping, smoked mashed potatoes, corn, a veggie tray, pumpkin bread, and a cookie dessert. It's always fun, everyone always brings stuff to the gatherings. It's nice to do these regularly (even if USC lost lol).
Been playing lots of Space Marine 2 lately, super fun. 2024 was a great year for PVE games with EDF6, Helldivers 2, Space Marine 2.
Blanks can be filled in either with the results of computation or with what a
person typed in. Now we indicate such conflicts in two ways.
Blanks filled in from computations get a distinct look (the cyan background), separate from both hand-written (black on white) and computed, non-editable text (cyan on white)
If I manually edit a blank, its background changes, and any code that was overridden doesn't execute. Here are a couple of examples:
September stretched out like a lazy cat in a sunbeam, feeling like it lasted forever. In these long days, a crazy dance unfolded between the puppy and the child. It was a challenging yet fun game, like juggling flaming marshmallows without a mess.
Creatively, I retreated into my fortress of solitude. My side projects took a backseat. My energy levels seemed to have taken some time off, leaving me with just enough zest to update img now and then. It's been an introspective phase, where the usual hustle made way for a more laid-back rhythm.
Now, let's discuss the mystery surrounding the Diablo tapes. The production is taking longer than expected, feeling like a Monday morning that won't end. Am I being cleverly deceived? Only time will tell.
With all the spare time of this endless September, I indulged in reading, sleeping, and letting my mind wander. It's been a quiet rebellion against the chaos of the world outside and work.
There was also a lot of work, but I'm trying not to let it affect me too much.
October should bring more peace and tranquility, I hope. As the year comes to a close, I'm looking forward to getting away to London in December. The thought of holiday lights, busy streets, and warm tea is exciting. Here's to a refreshing October and exciting times ahead.
This debug UI has been surprisingly handy over the last few days. I'm able to visualize a parse tree even after it's been flattened, just using color transparency. All I'm doing is painting all the rects that contain the mouse cursor. Since the color is transparent, it doesn't matter what order they're in. (The larger rects actually come later; they're fall-backs if a more fine-grained rect isn't found.)
Hurricane Helene was devastating. I only had to deal with some downed trees and a half a day without power. Others lost everything. Whole towns are gone. This one will be one of those storms that gets remembered. It will be mentioned along with Katrina in terms of the devastation. I really feel for those affected.
And now there's the port strike going on. I already have political anxiety. It's just always something.
I finished my slides but I left in them some gaps to fill with puns, and
other miscellanea. There's this one where a whole culture of people is
programming entirely by multiplying fractions,
y'know what would be ridiculous? If I had actual examples, or even
implementations of classic functions to show the attendees. Not only that, how
better would my point be made if I built enough documentation to teach people
and even wrote games for it.
It has been 4 weeks now, I have vivid dreams in which I reduce the number of
steps it takes my fractions to find the Fibonacci sequence, I have written 3
different implementations and sit on enough material for a
whole extra talk of its own, or at least enough to bore a whole amphitheater to
tears. — Have we lost the plot yet?
i saw a really vivid sunset yesterday while walking ibarra. a large streak of orange sunlight cutting across a deep ash-blue. the traffic lights sharp in that dark. today is a sunny day and i'm slightly anxious about my follow-up appointments to the doctor and my optometrist. ah, getting olde.
2024-01-02
happy new year! i didn't do any traditional new year's rituals to mark the year like i did for the last three years. i didn't even do the animal crossing countdown. though i woke up early yesterday (because i slept early! start the year right, etc.) and wrote in my notebook. again today. i'm thinking of new wall decor. i'm thinking origami.
2023-12-18
more and more as i get older i realize the importance of holding space for people, giving them a chance to show up. when i was young there i had more urgency to form bonds (i wonder why when i had more time then). i'm leaning into the ebb and flow of connection as the years go by. it happens or it doesn't, there are no guarantees. this is both depressing and uplifting, depending on the day. today it's uplifting: i got a postcard from a friend whom i thought i wouldn't hear from for a long while.
2023-12-02
my friend el talked about updating their website and so i suddenly remembered mine. much has happened since my last entry. end of the year blues in full swing, my mom is in the hospital, my dog is a bit lonely in a dark house and is trying to get into his sack of kibble. what helps me: daily journalling, chats with my siblings, crying, writing letters, routines, home-mixed blackberry soda, we love katamari and animal crossing. i may start ingesting some vitamin d supplements to help a little. looking forward to the solstice.
2023-05-29
yesterday i saw so many corgis.
2023-05-26
mid-spring in full swing! i've been turning down a lot of event invites, but i'm really gratified that folks have been inviting me to things. also, ibarra and i have been taking a walk mid-mornings when the sun is full out and the lighting reminds me so much of childhood. i've also begun drinking afternoon tea, it doesn't interfere with my sleep patterns as much as coffee does.
2023-05-08
been a while since i updated this! i am actually writing from my new laptop. wiped off windows and installed linux mint. stuff i am enjoying lately: scrapbook/junk journalling ASMRs (love the sound of peeling stickers), eating meals outdoors in the yard, looking at the newly-sprung flowers in the neighbourhood. i am thinking of revamping this website but mostly i think i'll be satisfied adjusting the divs.
2022-12-15
it is very blustery outside. the wind hits the walls in a scary way, vibrating as in a flat of the hand against heavy wood. i'm organizing my old art right now, scanning doodles without really looking back or judging. i know enough that time is crucial for pulling meaning from drawings. and anyway, they are a record of a mood. most of the drawings i scanned were from 2017. i went through the wringer that year. my priorities in an image changed somewhat.
2022-10-25
my computer crashed last september and it's only now that i restored it. i can believe that i actually managed to go a month without my desktop, but then i was moving between tablet and my brother's laptop, so it was fine. what happened in october so far? i turned 35. i cleaned out the yard for the winter.
I thought about making another State of Fantasy TV article, but what's the point? I'll save some time. Rings of Power Season 2 - trash. House of Dragon Season 2 - also trash. Wheel of Time Season 2 - meh. As a fantasy lover, it's a damn shame seeing these amazing properties get absolutely ruined (or mishandled if I'm being generous) by incompetent fools. Every terrible adaptation, every streaming service price increase or password sharing crackdown, makes me very thankful I have a Plex server up and running. This is freedom.
I've been playing a good bit of LOTRO here lately. So glad I heard about the new legendary servers to simulate the feel of launch. Very refreshing. Got my highest character up to 41 so far and looking forward to seeing what cap is like.
In other news, hurricane Helene is going on. Mostly just rain by me but the winds are supposed to pick up later.
2024-09-23 - Limang taon ng paglumot - Cutting Tofu
Sabi nila
Ang di tumaya ay talo
Konting diskarte lang kailangan
Pero hindi pa rin sapat
Sa pagtitimpi ng kalooban.
Nanalo ako ng lotto
Ng milyong milyong dalangin
Kulang sa indulgencia
Para sa walang delikadesa.
Kinakati akong magdasal
Parang nilalanggam
Nabuhay yung Santo Niño
Ng alas tres ng madaling umaga
Ngunit walang nakaimik, walang nagising.
Itataya ko na lahat,
Kahit butas ng karayom papasukin ko.
Pagkalipas nitong lahat
Magkita muli tayo sa kabilang dako.