HN user

oneearedrabbit

184 karma

mail@ username .net

https://kruzenshtern.org https://twitter.com/oneearedrabbit

Posts7
Comments61
View on HN

Cold turkey. More than seven years ago, on my way home, I stopped at T-Mobile and bought a random flip phone. I still own that same phone. https://news.ycombinator.com/item?id=21929194

Just a few minor updates to my original post:

  - Low-res photos are perfectly fine for my purposes
  - I don't need Google Maps when I'm on the go
  - Quick fact checking is not important
  - One day, I ripped off the band aid and migrated all auth keys to Yubikey
  - Tethering is occasionally useful
Edit: some things never change--I still haven't learned how to format a bulleted list here.

Decades ago, a closure in Forth was especially innovative with DOES>:

  : COUNTER
    CREATE ,
    DOES> DUP 1 SWAP +! @ ;
  0 COUNTER PK
  PK .  \ => 1
  PK .  \ => 2
A semi-equivalent in Javascript is:
  const counter = init => {
    let x = init;
    return () => { x += 1; return x; };
  };
  const pk = counter(0);
  console.log(pk());  // => 1
  console.log(pk());  // => 2

Neat trick. I found that I had to wrestle with Notes more than necessary, but if I were to pick up the project again, I would approach it differently this time:

- Notes function similarly to tweets, and, by definition, cannot by customized much. They are like cute little memos or a river of news where less is more.

- I thought it would also be cool, if within Notes I could subscribe to memos from my friends. Whoa, Apple Notes as a social network! As you are already familiar with Apple Notes structure, it won't be a surprise that it is not difficult to add content to special folders automatically (I built a prototype, which sadly never published.) However, this topic raises a bunch of important questions, and I don't remember whether I found all the answers. It's been a while.

Two years ago I got carried away and built a tool with a code name "notespub". It is the very same idea, albeit less polished. I documented my journey of extracting content out of Apple Notes, which naturally has been published with Notes as well [1].

I thought this was a cute idea; however, as I started using it more, I inevitably learned that there are features that are hard to mingle in Notes alone, i.e. custom themes, metadata, automatically generated home page, top/side navigation, cross-references, etc. These features could be implemented with an external system that helps you to manage a blog, yet that ruined the idea that I wanted a tool that puts local & privacy above everything else, a tool that has as little dependencies as possible.

Long story short, I started working on the second iteration that I thought wouldn't sacrifice privacy, but eventually shelved and haven't completed it. I guess it is time to open-source it.

[1] https://devlog.notespub.com/2022/08/site-generator-for-apple...

Not long ago, I went down the rabbit hole of space-filling curves, and learned about an obscure paper by Rolf Niedermeier, Klaus Reinhardt, and Peter Sanders that introduced a rather peculiar curve with an unfortunate name: H-curve [1]. The paper mentions that H-curve preserves better locality properties compared to Hilbert curve. It fills the space with H-like shapes, hence the name. Also, like the Moore curve, it generates a loop.

Space-filling curves are ridiculously easy to implement with L-system rules, and I spent a few days developing a set of axioms to express it in a rewrite system. This was a fun puzzle [2].

  A => BF-F-BFFFC-F-FC+F+BF-F-BFFFC-F-FC
  B => BFFFC-F-FC+F+B
  C => C+F+BF-F-BFFFC
[1] https://www.sciencedirect.com/science/article/pii/S0166218X0...

[2] https://kruzenshtern.org/25-h-curve.html

Not directly related to the post, but still feels somewhat relevant.

Back in March I used a bit more elaborate multi-step prompts for GPT3.5 to generate amusing pictures and published a gallery [1]. However, I eventually reached a point where changing prompts did not consistently improve the final results. At the end of the day, the quality of images are only as good as the training dataset, and GPT is a black box.

For something different, to test whether it is possible to "compress" visual content specifically for GPT, I ran another experiment. SVG, being a verbose format, takes time to generate a detailed image, and it also becomes expensive over time. I translated a subset of SVG elements into Forth words [2], which has a nice synergy with GPT tokens--this allowed me to progressively render pictures and produce smaller outputs without sacrificing much in quality.

Finally, I training my own GPT2-like model on the QuickDraw dataset [3]. It's not surprising that a sequence transformer can be trained to produce coherent brush strokes and recognizable images as long as there is a way to translate a graphical content into a sequence of tokens. That said, I found myself with more questions than I started, and trying other ideas now.

[1] https://drawmeasheep.net/pages/about.html

[2] https://drawmeasheep.net/pages/gpt-forth.html

[3] https://drawmeasheep.net/pages/nn-training.html

This number is tokenized as a list: 43 20 59 83 409 58 340 9 58 340 95 30 95 809 34 850 9 34 850 34 809 58 340 9 58 30 49 850 385 30 49 58 30. If GPT recognizes the context "+ 1 equals" through the attention mechanism, it can predict that the next number in the sequence should be 31: ... 58 30 -> ... 58 31

Hi. I built a tool that transforms input prompts to amusing SVG illustrations. It runs on GPT3.5, Janet, HMTX, and a home-grown scheduler.

A couple of months ago I learned that GPT is capable of creating rudimentary drawings, and since then I poured my heart into tinkering and improving GPT and algorithmic steps until I reached a point where images became recognizable.

GPT3.5 doesn't always generate the most artistic illustrations, but once in a while it may draw surprisingly delightful sketches. GPT4 is more creative, but is also more expensive. I selected a few images and prompts to demonstrate what GPT3.5 can do right out of the box: https://kruzenshtern.org/23-draw-me-a-sheep.html

First and foremost, pinpoint the goal. Is it purely for funsies? To acquire new knowledge? Must it be pragmatic? Perhaps a business venture? Are there any users who will interact with the thing?

Next, break it down into steps. Write everything down like a brainstorm meeting.

This is a preliminary plan. Identify any known unknowns and research topics until they become known knowns. In the end, there is a list of steps to be done to achieve the goal. Can't crack it yet? Not a problem, put it in the reserved zone and move on.

Tackle step #1, or perhaps start with the most troubling one, then reassess the remaining parts. Is the goal still stand, or has something changed? No? Excellent--proceed. Yes? Take a half step back and adjust the plan.

Repeat.

Don’t forget to take breaks, drink water, and, please, be forgiving.

Recently, I started a project that draws simple illustrations using GPT. It began as a lighthearted curiosity, but eventually grew into something bigger, something that makes me smile when “a cat” or “a tesla car” turns into a recognizable sketch with a hint of creativity. It is private yet, but I will be releasing soon. I cherry picked a few illustrations and published them here: https://drawmeasheep.net/

I built a similar tool you are describing. A quick demo and a technical post is here: https://notespub.com/. However, truth be told, I migrated off Notes to Emacs Org-mode recently and didn't finish the project for GA. If it helps, I do plan to release it on Github soon-ish.

If you are willing to go the extra mile, it is not that difficult to export Notes with media files from Sqlite and templatize them, and I am happy to help.

I second your sentiment that it is a hack, and here be dragons. At the same time, I had an honest conversation with myself about the dilemma, and whether I am worried about changes to the database or not. I ended up answering that it is a low-risk factor especially for the project of that kind.

I am sure that Apple won’t be making any substation breaking changes to a database structure unless they have to, there is a price to pay. Such changes will always be tied to a major macOS/iPhone release, and it doesn't happen very often.

That said, I had to put this project on the back burner, it was not immediately clear what is the ROI especially considering there is a long tail of databases to parse. It starts with Mountain Lion and then adds up quickly.

I need to release my source code to Github--ORM approach was worth exploring, it is a concise declaration that is relatively easy to update and manage.

I am excited to see more solutions that work with Apple Notes database directly. This is my go-to application to capture unstructured memos while researching various topics. Last year I got carried away and built a simple site generator for Notes [0]. As a fun exercise I implemented ORM models to query Sqlite database in Ruby:

  User::Account.server(database: "tmp/test.sqlite").first.
    folders_dataset.offset(1).first
    notes.
    map(&:attachments).flatten.
    find { |el| el.is_a?(User::ObjectTypes::EmbeddedPublicJpeg) &&
      el.height > 700 &&
      el.summary[/animal/i] }.
    media_filepath
 => "Accounts/<uuid>/Media/F669B83A-0C47-408E-9645-015737F3B11F/Pasted Graphic.jpg"
Apple Notes' database structure is a fascinating product story. Notes started as a simple note-taking application that stored its content as raw HTML in a few simple tables. However, as the product grew and needed more features like collaboration, they had to make changes and add new columns and tables. They also implemented two flavors of CRDT-like algorithms that evolved over time: one for plaintext chunks and the other one for embedded objects like tables. On top of that, every change that Apple makes must be backward compatible to support legacy devices and systems; but backward-compatibility was not always possible and users had to go through “Migrate your Notes” steps, but it is again a product story.

I wish that one day, someone from the development team would write an article about it.

[0] https://devlog.notespub.com/2022/08/site-generator-for-apple...

The E-Ink Badge 3 years ago

I love it! On a somewhat related note, I've been working on a tiny Forth interpreter lately, and I think the e-ink device it could be an interesting choice to explore and test it on as a dedicated computational environment. Inkplate looks very appealing: https://soldered.com/product/inkplate-6plus-e-paper-display-...

You might want to check out Kagi to summarize articles: https://labs.kagi.com/ai/sum. It does the heavy lifting of producing nice outputs for you.

The E-Ink Badge 3 years ago

Recently, I have come across some interesting developments in the e-ink space. Although I haven't had the opportunity to test DASUNG monitors myself, but I read positive reviews. It is impressive, these monitors have extremely fast refresh rate. Yes, they are pricy. I am intrigued if something has changed technologically?

The E-Ink Badge 3 years ago

After I completed the project, I made a somewhat lighthearted personal vow to try to design a custom PCB next time I fall down the rabbit hole of hardware tinkering. I suspect, these days it is a commodity skills, and curious if you happen to have any suggestions or articles that could serve as a starting point?

The E-Ink Badge 3 years ago

Exactly! The device is approximately 12mm thick. I will upload a side shot shortly. I appreciate you bringing this up, it's an excellent point! To be honest, it is still a bit thicker than I had initially hoped for; however, when I weighed my options - solder 26 devices by hand vs use pre-made components -- the decision was much more clear.

The E-Ink Badge 3 years ago

I built/assembled them. I carried out some informal experiments and found that it requires roughly one million full screen refreshes on two coin cells to completely drain them. Furthermore, given that Badger operates on an RP2040 and a battery holder comes with a toggle, it is astonishingly durable device. It is like a smoke detector, which can operate for a decade straight on a single battery.

I should have been more clear, thanks for correcting me! Apple Script does indeed work, and there are some limitations to be aware of. Some of them I explained in the article. For example, all images are encoded as base64 strings (which is not terrible, just inconvenient). I also couldn't extract tags even using `body`. todo-lists are formatted as ul/li blocks, which is reasonable, but also inconvenient. Ultimately, I wanted to render notes visually as close as possible to Apple Notes, and I was not happy with what Apple Script provides out of the box.

FWIW, Bear (a competitive note taking application) does provide an Automator script to help users migrate from Apple Notes, and they also mentioned similar limitations:

- Task lists convert into bulleted lists

- Rich media links will convert to plain text links

- Non-photo attachments like PDFs or other files are not supported and will be excluded from export to HTML files. They will remain safely in Apple Notes