Live data from Hacker News

Show HN: I made a web-based notepad with a built in unit calculator

numpad.io

191–200 of 246 posts

Re: Show HN: I made a web-based notepad with a built in unit calculator

#191

Earlier quoted context omitted.

Both are MIT licensed, I don't think this is the case.

It's true of source code but not artifacts. MIT places no obligation to distribute source, but requires credit and license when someone does so.

> It's true of source code but not artifacts.

That's simply not true. Please don't do stuff like this—to go off and make these kind of proclamations in public. It's negligent at best.

Re: Show HN: I made a web-based notepad with a built in unit calculator

#192

Earlier quoted context omitted.

It's true of source code but not artifacts. MIT places no obligation to distribute source, but requires credit and license when someone does so.

> It's true of source code but not artifacts. That's simply not true. Please don't do stuff like this—to go off and make these kind of proclamations in public. It's negligent at best.

Just when I thought I understood the MIT license, I'm back to confused. Can you link me to where this is clearly outlined? Do you need to attribute somewhere in artifacts or not?

Re: Show HN: I made a web-based notepad with a built in unit calculator

#194

Earlier quoted context omitted.

It's true of source code but not artifacts. MIT places no obligation to distribute source, but requires credit and license when someone does so.

Thanks for clearing that up, I'm not distributing the source code so I think I'm good.

Don't look to people who don't know what they're talking about to "clear things up" for you. If you think they have any qualms about leaving you to deal with the blowback after misleading you with uninformed takes (and pointing the finger at you for putting your faith in them to begin with), then you're setting yourself up to be burned.

There's a reason why everyone who has their ducks in a row (in other words, people with competent legal counsel along with something to lose, e.g. Mozilla, Google, Apple, Microsoft, etc) will bake something like about:license into the stuff they work on, even if it's buried in some "open source licenses" entry of an About screen reachable by the last menu item in the system settings. Spoiler alert: it's because they have to—in order to comply with the terms of the license. It's not because they just think it's the nice thing to do. (And definitely not because it's fun and easy to do, because it's not.)

Re: Show HN: I made a web-based notepad with a built in unit calculator

#195
post #57

This looks pretty cool. I've long been looking for something similar to Soulver ( https://soulver.app/ ) that I can use on Linux. This seems promising. One small criticism: In my opinion, no web-based writing app is useful unless the tab key inserts a tab. The default behavior of most browsers to move focus to the next field is tremendously infuriating in this context. Unfortunately, that's what happens here, at leas…

Yeah, honestly this has been annoying me too, I just haven't got around to fixing it. It's using CodeMirror 6 as the editor, the author said he deliberately made this version not "break" the default tab behaviour, which I think is understandable as a library author, but that makes it my job to fix!

To save you some time, here is what I did to add tabs to CM 6 (I think I found it somewhere or I may have cobbled it together to insert two spaces):

First import things you need:

    import { indentMore, indentLess } from "@codemirror/commands"
Then create a command:

    export const insertTab: StateCommand = ({state, dispatch}) => {
      if (state.selection.ranges.some(r => !r.empty)) return indentMore({state, dispatch})
      dispatch(state.update(state.replaceSelection("  "), {scrollIntoView: true, userEvent: "input"}))
      return true
    }
and then add it to the keymap in your extensions array:

    const extensions: Extension[] = [
      ...other extensions here...,
      keymap.of([
          ...closeBracketsKeymap,
          ...defaultKeymap,
          ...searchKeymap,
          ...historyKeymap,
          ...completionKeymap,
          {key: "Tab", run: insertTab, shift: indentLess}
        ]),
    ]
and then pass the extensions array into where you setup your editor view, eg:

    const view = new EditorView({
      state: EditorState.create({
        doc: textarea.value,
        extensions
      }),
      parent: editor
    })

Re: Show HN: I made a web-based notepad with a built in unit calculator

#196
post #57

This looks pretty cool. I've long been looking for something similar to Soulver ( https://soulver.app/ ) that I can use on Linux. This seems promising. One small criticism: In my opinion, no web-based writing app is useful unless the tab key inserts a tab. The default behavior of most browsers to move focus to the next field is tremendously infuriating in this context. Unfortunately, that's what happens here, at leas…

I've made this one and use it daily: https://github.com/filipesabella/calcpad It's electron though, if that's important to you.

Hey this is pretty cool. Instead of Electron app I would prefer it as a browser tab. Wish it could be self hosted.

Re: Show HN: I made a web-based notepad with a built in unit calculator

#200

Super cool. I wish this was open source so I could see how you did some things, but I understand you've decided to keep it closed. Just to satisfy my curiosity, would you mind sharing how you did parsing at a high level? Did you use some publicly available parser/lexer or did you just implement pattern matching yourself with something like regex or other token splitting measures?

I'm very glad you asked. I wrote my own parser combinator library in TypeScript partly based on eulalie[0], so it doesn't have a separate lexer and parser and doesn't rely heavily on regexes (though it does use them to do things like match a single alphanumeric character). I plan on open sourcing this library one day once I can tidy up the API because I think it would be useful to other people. But to give you an ide…

Thanks for sharing, I had the same question!

I wasn't familiar with Eulalie, that's a really interesting approach. I built functionality [0] similar to numpad into a larger record-keeping system, Tap [1]. Precedence rules kindof scramble my brain so I ended up implementing s-expression syntax for Tap formulas.

I ended up writing the parser myself, called sowhat, but used a library for tokenization, moo.js [2]. You can see a demo of just the sowhat editor here [3].

0. https://www.tatatap.com/formulas 1. https://www.tatatap.com 2. https://github.com/no-context/moo 3. https://tatatap-com.github.io/sowhat-editor/

Post reply on HN