Threads for nikivi

  1. 1

    VSCode with these settings and extensions.

    1. 1

      What is it with Scala and so many custom build tools. I’ve seen at least 4 at this point. Rust has just one so as Go from what I know.

      1. 19

        I find it so odd that there is still code being written where they put a copyright clause at beginning of each source code file. It would drive me mad seeing same thing every time I open a file to edit.

        1. 22

          I find it so odd that there is still code being written where they put a copyright clause at beginning of each source code file.

          It’s important. Individual files are often copied between projects, without a per-file copyright notice it is incredibly difficult to comply with the license.

          1. 10

            Fair, but parts of files are also often copied. Why is the right granularity file-level rather than, say, function-level? Or module-level?

            1. 8

              Someone copying part of a file has access to the source file and so can easily copy the relevant copyright from it. Someone who has access to a file is not guaranteed to have access to the root of the repo.

              More importantly, someone copying part of a file already has made work for themselves if they want to sync with upstream, but if you copy an entire file then you can trivially update it by just copying the new one as an atomic unit. If you have to separately track copyright, that’s harder. For example, LLVM recently relicensed from. UIUC to Apache 2 + GPL exemption. LLVM has per-file copyrights, so anyone pulling a file from LLVM will see the license change and can check if they need to do anything else to comply. If the license is only in the root of the repo, this is easy to miss.

              Finally, a lot of projects pull a few files under a different license. For example, we’re about to release something under an MIT license, but a couple of files come from FreeBSD and so are 2-clause BSDL (which is more or less equivalent but very subtly different). If you want to know the license of a given file, it’s a lot easier to look at the first line than to go and read a detailed third-party notices file and see if it’s one of those or whether it’s from the LICENSE file (some projects that are less concerned with audit trails just put all of the licenses in LICENSE and say ‘some parts under this other license’. Working out which files are under which license is a pain).

              1. 2

                parts of files are also often copied

                One argument here is that at the function-level, for sufficiently short functions, the code might not actually fall under copyright protection.

                1. 1

                  MPL 2.0 allows you to modify and open source the single file to comply with the license rather than the entire project.

                2. 6

                  If it has to be there, why not put it at the bottom of the file so the top can have something more important?

                  1. 3

                    Mostly convention, some tooling. These days, the per-file license can be a two-line SPDX identifier and list of copyright holders (which can be vague. For Verona, ours says ‘Microsoft and Project Verona contributors’, which is sufficient that someone who cares can look at the git history in the canonical repo and get a complete list). That doesn’t take much space and makes that auditing tools simpler.

                  2. 4

                    I don’t know if it’s still common practice but adding a file named LICENCE to the root directory of a set of files under a particular licence is/was common.

                    This seems like it would be easy to find and therefore comply with. When you say it’s incredibly difficult without a per-file copyright notice (assuming you mean licence notice), is that without the top-level LICENCE file too?

                    1. 5

                      The issue is with copying individual files. Imagine I want to copy, say, the printf implementation from FreeBSD libc and it didn’t have a per-file copyright. I now need to also grab the LICENSE file from the root of the repo. I now either add it to my own LICENSE file, or to a separate third-party-notices file. In either case, I need to specify in that file that this file, unlike the others in my repo, is 2-clause BSDL. Someone else who comes along sees the printf implementation and sees that my project is MIT licensed, so they copy it. Did they notice the thing in my third-party-notices file that says that this file is actually 2-clause BSDL? If not, they don’t coy it and are now (technically , at least) I’m violation of the license.

                      Now consider that example in reality, where the file has the license in it. The only thing that they need to do to comply with the license is retain the license and copyright in source form and so they can simply grab it.

                      Now imagine that FreeBSD relicenses their printf implementation (this actually happened a few years ago when UCB allowed everyone to drop the advertising clause). I pull in the new one and, with per-file copyrights, the change of license is immediately visible in the diff for the file. Someone copying the file from me will see the change. With a separate license file, I might miss it and even if I don’t the folks downstream from me can easily miss it, especially if I don’t see it immediately had have the update of printf.c and LICENSE in separate commits.

                      It’s good practice to do this for every file because it’s hard to work out in advance which files will be copied to other projects.

                      1. 1

                        The issue is with copying individual files. Imagine I want to copy, say, the printf implementation from FreeBSD libc and it didn’t have a per-file copyright. I now need to also grab the LICENSE file from the root of the repo. I now either add it to my own LICENSE file, or to a separate third-party-notices file. In either case, I need to specify in that file that this file, unlike the others in my repo, is 2-clause BSDL. Someone else who comes along sees the printf implementation and sees that my project is MIT licensed, so they copy it.

                        A project should not be labeled as MIT licensed if it is in fact mixed-licensed.

                        It makes sense to use per-file notices for such a project, rather than trying to point to individual files from a LICENSE or third-party-notices file. But for projects that are all one license, a single LICENSE file is easier and reduces clutter, and nothing is stopping someone who wants to use a file from that repo from adding the license at the top if their project does it that way.

                        1. 2

                          But for projects that are all one license, a single LICENSE file is easier and reduces clutter, and nothing is stopping someone who wants to use a file from that repo from adding the license at the top if their project does it that way.

                          See my other comments in this thread. If I need to add a license for your file, my copy of your file is no longer simply a copy of your file. Now I have made changes and I need to track those changes. You make more work for me if I pull in a new version because now it isn’t a straight copy, I have to do a merge, and I need to go and check that you haven’t relicensed the project by reading a completely different file. In contrast, with per-file copyrights, I just grab the file and look at the diff. If the copyright header has changed, I know the license has changed and I catch that when I check for any other incompatible changes. If your copyright header is an SPDX identifier (which it generally is these days) then I don’t even need to look, it’s an automated check.

                          I consider doing a trivial amount of work if it avoids other people having to do a lot of work to be basic politeness. You may disagree.

                          1. 1

                            So you’re talking about repeatedly pulling a single file from another repo and merging it into yours as it is updated. That seems like a pretty uncommon practice, but maybe I’m wrong. If the author of a project wants to support that use case, then the file they expect to be used in other projects becomes a mini-project unto itself and it would make sense to add a license header, short of giving it its own repo.

                            I consider doing a trivial amount of work if it avoids other people having to do a lot of work to be basic politeness. You may disagree.

                            I would weigh the work of monitoring changes to a LICENSE file against the need to scroll past the header every time someone opens any file. The latter is a small amount of work, but it is a task done more often and by more people than the task of merging a single file from an external repo. Then there is the task of adding the LICENSE header whenever the author creates a new file.

                            1. 1

                              Copying individual files (or small groups of files) is pretty common for any popular project. The main reason that it happens is that consumers have a different notion of a reusable unit to the creator of the project. It also tends to happen after a project has grown, rather than as something that would be useful at the point files are originally added.

                              I modern SPDX copyright header is one or two lines long. If scrolling past that is a problem then you might want to consider larger editor windows.

                              1. 1

                                Copying individual files (or small groups of files) is pretty common for any popular project. The main reason that it happens is that consumers have a different notion of a reusable unit to the creator of the project. It also tends to happen after a project has grown, rather than as something that would be useful at the point files are originally added.

                                Can you think of an illustrative example?

                                I modern SPDX copyright header is one or two lines long. If scrolling past that is a problem then you might want to consider larger editor windows.

                                That seems handy but I am worried about whether those headers are as legally sound as a full copy of the license. Who certifies the binding between the license identifier and the license text?

                  3. 3

                    Reading about countless GPL copliance failures and how rarely copyleft theft is being accountable makes me want to put exact minimal amount of effort into licensing declaration. I’ll drop LICENSE file and I highly doubt any other action would protect my work more than that.

                    I wonder if adding the clause in each file ever made a difference historically speaking.

                    1. 1

                      We were instructed to do it, and it doesn’t bother me when I’m in the IDE, only when I’m using cat on the CLI for instance.

                    1. 9

                      I want to do more things in typescript either on client via Solid or inside Deno running locally or on the edge. So want to learn those very well.

                      Recently fell in love with Chiselstrike and EdgeDB so want to learn them well too. Will probably settle on Chiselstrike as EdgeDB is still maturing. Chiselstrike abstracts well over SQLite or Postgres.

                      Also want to build proper iOS native app so SwiftUI. Will go over Point Free and go over Composable Architecture. In future might try learn Expo to build cross platform.

                      Also want to learn fundamentals of ML/statistics. Heard good things about Probabilistic Machine Learning book.

                      Since I am building a native app with Tauri, I also will need to learn some Rust this year although I dread its feedback compile loop.

                      Also if I get to it, doing some local first architecture would be great to study. Some things with CRDTs.

                      1. 3

                        If you wouldn’t mind sharing, I’m curious what you loved about ChiselStrike and EdgeDB. I haven’t tried either but I used Supabase for a side project and have been looking at Convex but it seems like there are suddenly a ton of different backend as a service providers.

                        Also re: Rust, if you have Rust Analyzer you shouldn’t have to wait for the code to fully compile while you’re developing.

                        1. 2

                          I wanted to have some way to have a declarative schema. So I don’t have to write migrations manually and things like this. From this, Prisma was one option but I found EdgeDB to have nicer way to define things.

                          And ChiselStrike is nice as it gives me endpoints. I am still exploring it.

                          1. 1

                            prisma is the most infuriating technology I work with day to day. It’s filled with bad decision after bad decision, avoid at all costs.

                      1. 1

                        What’s interesting about tRPC is that together with a framework like NextJS or Solid Start (https://github.com/solidjs/solid-start), you don’t need to have a dedicated backend any more for web applications. Just do everything in getStaticProps and you get full type safety for everything. Simplifies many things.

                        1. 7

                          Is it possible to get a data dump of all of Lobsters comments/links/threads? Would be interesting to do some data science on it.

                          1. 9

                            No, but @pushcx will run queries for you: https://lobste.rs/about#transparency

                            1. 2

                              Out of curiosity, what is the reasoning behind keeping this data private instead of publicly open to all?

                              Does Google get to fully index lobsters?

                              1. 17

                                Users haven’t agreed to their comments being reused.

                                The 800 pound gorilla indexes whatever it would like to. We’ve also been indexed by ArchiveTeam, Archive.org, and many hobbyists. There’s some mild rate-limiting in place, and we have trivially predictable URLs with .json endpoints on many.

                                1. 7

                                  Gotcha, this is a considerate policy that I can certainly appreciate. Thank you kindly for explaining.

                          1. 1

                            Especially loved the part on future of it. I am trying to use SolidJS for all my web apps/sites going forward.

                            1. 7

                              I use Rosefinch as SQLite GUI.

                              1. 3

                                Even though, it might be worth the money, I had to click to realise that it’s closed source and requires a one time payment.

                              1. 4

                                Actually excited about this. I always wanted to know how real local first apps were built where all updates are done locally and then synced later using something like CRDTs. Replicache seems like a great tool for this.

                                1. 3

                                  Moved my wiki from GitBook to Docusaurus yesterday. Want to improve it further by adding search and changelog this week.

                                  1. 2

                                    Books by Objc.io are great. Also whilst not a book, Composable Architecture seems like a nice way to develop cross platform (iOS/macOS) apps.

                                    I saw CodeEdit posted recently that seems to have nice code.

                                    1. 1

                                      Wanted to try out using Remix Blues Stack and build my personal site with it.

                                      1. 5

                                        Karabiner for me.

                                        1. 2

                                          Karabiner Elements is so essential to my life. I use Caps Lock as Esc, and on Mac OS that is impossible without Karabiner. Other remaps add a 100 ms delay before you can type after you hit Caps Lock, and that makes my constant-insert/normal-swaps very annoying.

                                          1. 2

                                            I use Karabiner sometimes as well, but can’t you remap Caps Lock as Esc on a Mac without it? (System Preferences -> Keyboard -> Modifier Keys)

                                            I don’t often want an image on Lobster.rs, but today I do.

                                            I’m on Big Sur, and I have Caps Lock mapped to Control, but I could map it to Esc natively just with System Preferences. I can’t recall, but was Esc not one of the options for key remapping in earlier versions of macOS?

                                            1. 3

                                              It wasn’t one of the options earlier, but the real problem is that at least some users (including me) have this problem where there is a noticeable delay on using the Caps Lock key for whatever purpose. i.e. if you attempt to just tap it, all keyboard input will not work for a short period. Since I have Karabiner Elements installed now, I can’t reproduce (KE removes the delay), but it was incredibly frustrating. I think it might have stalled all input, but I can’t recall now (and I am not eager to reproduce it haha).

                                              1. 2

                                                Got it: thanks for clarifying.

                                        1. 8

                                          Each key except h j k l are layered. The mappings are here:

                                          https://github.com/nikitavoloboev/dotfiles/blob/master/karabiner/karabiner.edn

                                          i.e. My w layer will open apps

                                          w+k = open safari (browser) w+l = open vs code (code) w+j = open iTerm (terminal)

                                          My e layer is CMD key

                                          e+k is CMD+k e+w is CMD+w

                                          My . key will insert code fast for me, mostly logging

                                          So in JS mode, .+a will insert console.log()

                                          This is just a glimpse of course, there is 800+ lines of these kind of configs. Most keys are mapped in this way.

                                          If you want to read the config, it uses Goku which has a Tutorial.

                                          1. 2

                                            This is pretty amazing that you built everything in Karabiner. I’ve only dipped my toes in it, and I remap caps-lock to “espace when pressed, hyper when held”.

                                          1. 2

                                            There is a huge issue that with the dark theme, you can’t see links that were already clicked. They are all the same color when they shouldn’t be. In light theme and most other websites, already visited links are marked as such. Perhaps that’s a bug?

                                            Thank you for adding the theme though. Also would love a manual white setting even when in dark mode.

                                            1. 1

                                              That bug has been reported and logged, thank you!

                                            1. 1

                                              Not sure how interesting but I built gitupdate to solve automating commits on certain things where commit message does not matter. Like docs or wikis. It takes file names changed as commit message. I also like to use it on feature branches sometimes too as I like to squash commits with an actual meaningful commit on merge. Saves a bit of time.

                                              1. 2

                                                I once used Hammerspoon but later realized that I can do anything in Hammerspoon with Keyboard Maestro so I stopped using it.

                                                1. 1

                                                  How does your recommendation handle window management? (I looked at a few pages, but didn’t find much.)

                                                  1. 1

                                                    I use BetterTouchTool for window management. But KM has actions to move windows too.

                                                  2. 0

                                                    Do you have any incentives or connections that might influence your recommendation?

                                                    1. 1

                                                      Not sure what you mean. I love KM because its a tool where I can easily make custom macros with as many actions as I want and bind it to a key directly with Karabiner.

                                                      1. -1

                                                        I’m asking if you have any financial incentives to recommend Keyboard Maestro.

                                                        1. 2

                                                          Why are accusing him of shilling?

                                                          1. 0

                                                            I’m not accusing, just asking.

                                                          2. 1

                                                            What a profoundly odd line of questioning.

                                                            1. 2

                                                              In some other contexts, some would call this line of questioning “in bad faith”

                                                      1. 5

                                                        I’m starting to work on Dendron, a tool to make digital gardens of notes with a powerful VSCode plugin to query and refactor the notes.

                                                        I have two wikis now, one with GitBook and one with Dendron where I plan to do more in depth note taking, using all the best features of the tool.

                                                        Quite excited about working and making this digital garden space better for all. 🌿

                                                        1. 2

                                                          Sounds great, gonna check it out. Perhaps one day also available for Sublime Text?

                                                          1. 1

                                                            Certainly. Something I want to look into. :)