7 ms·
Show HN: I rewrote my notepad calculator as a local-first app with CRDT syncing
I launched NumPad v1 on here a few years ago, and back then it wasn't much more than a thin CodeMirror wrapper around the calculator engine I'd written.
Now I've rewritten it as a PWA that supports multiple documents, persists them to IndexedDB, and has a syncing service for paying customers. Syncing is handled by Automerge[1] under the hood, which should make it relatively easy to get document sharing working too.
[1] https://automerge.org/ https://automerge.org/
- wslh 1y agoLooking for other notepad calculators I found odd products like this: https://www.ubuy.com.ar/en/product/IP17JM9X0-calculator-with-notepad-and-lcd-writing-tablet-12-digit-large-display-office-desk-calculators-with-magnetic-stylus-support-solar https://www.ubuy.com.ar/en/product/IP17JM9X0-calculator-with...
- abfar 1y agoNice tool, but the calculator executes division before exponentiation. E.g. 2^4/2 is evaluated to 4, not 8. However, it executes exponentiation first before multiplication (e.g. 2^2*3 is evaluated to 12). Is this intentional?
- bobeboph 1y agoThis is intentional, even if unexpected, as shown in line 152 of the link (turn on line numbers in the settings menu). I agree that following PEMDAS would make more sense. Edit: it's the equation below "Although if you want to find roots higher than 3..."
- deleted 1y ago[deleted]
- zamadatix 1y agoMaybe the author did intentionally break order of operations for shorthand on other roots, maybe they just forgot that's not how it's normally parsed. 152 doesn't comment on intent one way or the other, it just demonstrates how it currently is.
- tonyonodi 1y agoYeah, you're correct, it's intentional. Though it's pretty gross to be honest.
- kragen 1y agoThat's pretty nice; I've made a few attempts at such things myself, but the UI flow seems pretty smooth. What's the license? I wouldn't want to use your code if copyright law poses a threat.
- ajjenkins 1y agoThis is really cool. I’m not sure what I would ever use it for, but it’s a cool idea and seems well executed.
- justusthane 1y agoI don't mean this as a knock on OP, but it's not a new idea — I think the best known apps in this category are Soulver and Numi. I find them super useful. Using natural language and storing the context along with the calculations helps me to sort of think through problems. Being able to define variables on the fly is also very useful — I often use them for pricing out materials for projects. E.g.: "8ft 4 × 4" = $15 "8ft 2 × 4" = $4 "8ft 2 × 8" = $12 "8ft 2 × 6" = $6.50 "3/8in x 8in carriage bolt" = $3.50 Adjustable stand "8ft 4 × 4" × 4 "8ft 2 × 4" × 2 "3/8in x 8in carriage bolt" × 12 Plans $12 (What you can't see here is that Soulver gives all the totals in a bar on the right). Soulver has some examples of other uses on their homepage: https://soulver.app https://soulver.app
- tonyonodi 1y agoThere's a shout out to Soulver in the FAQ https://docs.numpad.io/#did-you-invent-the-notepad-calculator https://docs.numpad.io/#did-you-invent-the-notepad-calculato.... It's a great app, but Mac/iOS exclusive, and I think NumPad handles unit calculations a bit better (though I'm biased).
- eviks 1y agoUnfortunately doesn't support superscripts 6² Also is it possible to use CRDT as rich undo history, not only syncing?
- tonyonodi 1y agoYes it is, and it's on my roadmap.
- zamadatix 1y agoSuper clean style of interaction regarding the units and general syntax. Regarding the CRDT side of things what's the main driver? Syncing is probably better off without CRDT (I'd rather know a note had 2 copies significantly edited differently and now I have a sync conflict rather than no sync conflict but a hacked up note) so I'm assuming paid customers get (or will soon get) live multi user editing (i.e. you can trade local for concurrent usage)
- tonyonodi 1y agoYes exactly, I had live multi-user editing as a feature until just before launch. In the end it needed a bit more work though, so I had to pull it.
- shepik 1y agoThe interface looks great. Handling of "to" is a bit odd though. 150 kn in km/h [277.79976 kph] - this is unit convertion 150 kn to km/h [-276.79976 kph] - this is unexpectedly subtraction. I expected the unit conversion here, because of Raycast and Google
- tonyonodi 1y agoYeah, this was a deliberate decision, but a tough one and I can see why you might find it annoying. I think it makes date and time calculations more readable: 09:11 to 15:46
- xz18r 1y agoI use Numerals(1) in Obsidian for this, and it works great. It's built on mathjs(2) and has things like @total functions which automatically sum all uninterrupted lines above it. 1 https://github.com/gtg922r/obsidian-numerals https://github.com/gtg922r/obsidian-numerals 2 https://mathjs.org/ https://mathjs.org/
- owebmaster 1y agoMate this is a show HN post, not a "recommend me something" post. Don't be rude.
- xz18r 1y agoIt doesn't hurt to list alternative products, right? Understanding the competition and lacking features. Mine isn't the only post in this thread mentioning other products that do roughly the same thing.
- owebmaster 1y ago> It doesn't hurt to list alternative products, right? Yes it does. Show HN is a very small opportunity for normal ppl to talk about their things.
- tonyonodi 1y agoHonestly, I don't mind. It's useful to know about alternative products, and I hadn't heard about this one. Thanks all the same though :)
- idanp 1y agoI always wished these notepad calculators would run plain python. POC - https://github.com/idanpa/jupad https://github.com/idanpa/jupad
- zuzzurro 1y agoHow do I do get the right result when trying: 200Mbps * 2hours? I get "400 Mbits/s hr" and that's not what I'm looking for. It seems to be working if I use seconds instead. 200Mbps*2s=400 megabits
- tonyonodi 1y ago`200 Mbps * 2 hours in Mb` the second one works because the derived unit of the calculation works out to be exactly the same as a megabit, but that's not the case for the first one so you have to convert manually.
- johncosta27 1y agoThis is very cool. I was able to so some a small budget to see what my expenses are monthly, it's quite nice. I can see myself using it anytime I need something more than paper, and less than a full spreadsheet. Very cool.
- eps 1y ago[flagged]
- jasonjmcghee 1y agoClearly he likes notepad calculators.
- kragen 1y agoWas the other one by a different author?