• 0 Posts
  • 159 Comments
Joined 1 year ago
cake
Cake day: June 10th, 2024

help-circle

  • Rust is fundamentally more limiting than C, even with unsafe. It is often faster if you write naive code (because the Rust compiler can optimize more aggressively due to those same limitations), but an experienced developer with a lot of time for optimization will probably be able to squeeze more performance out of C than they would out of Rust - as you can see in this example. Rust is still better because those limitations all but guarantee that the resulting code will be safer, and the performance differences would be negligible all things considered.


  • For off-road and hiking: (properly customized) OsmAnd is the best app in existence, hands down. My setup shows me all the information there is: surface type, road quality, required road clearance for tracks; surface, incline, difficulty, obstacles for trails; surface, vegetation, elevation, steepness for completely off-road/off-path sections; all the amenities that are there (water sources, picnic tables, random gas stations in the middle of nowhere); easily switchable and overlayed layers to look at aerial imagery if something is unclear on the vector map; and there is a 3D map to help visualize the terrain, which works both with vector maps from OSM, aerial imagery, and the combination of both (which has saved my ass on a couple occasions). All of this can be fully offline (including pre-downloading aerial imagery) which is indispensable when you’re in the middle of nowhere.

    I avoid driving in cities at all costs (out of principle, shout out https://lemmy.ml/c/fuck_cars, but also practicality). When I really have to, I use OsmAnd. It’s perhaps not ideal (way too much information density even if you disable most things) but I’m using it when I get there anyway so why switch.

    For walking in cities: OsmAnd is ok. I have a profile which disables most details and makes the map readable.

    For cycling: OsmAnd is ok, but for some reason routing always takes ages, and I’ve never figured out why. If I need to take a longer trip I just use CoMaps - it gives slightly worse directions but finds the way nearly instantly.

    For city transit: I mostly know the routes in my city already, but when I’m in an unfamiliar part of town I use the city’s transit app. It’s OSM-based, doesn’t require google play services or anything like that, provides great routing and instructions and live position updates. Sadly OsmAnd is not a good fit for this purpose: it takes forever to load the routes, and the coverage on OSM is not good enough to be 100% reliable.

    For inter-city transit: sadly it’s not too good here, and it’s very badly mapped; I tend to give up and resort to rome2rio. I can usually find a phone number of the bus driver to call and figure out the current schedule.

    For finding businesses I would not expect much… there seems to be no good answer that isn’t Yelp or Google Maps, and of course that kinda goes by the nature of crowd sourced reviews and information.

    This is where you can actually contribute yourself. Adding businesses to OSM is trivial with something like StreetComplete or EveryDoor. The OSM community is strong where I live so I can find almost any business I would want to visit.


  • While not a “default setting”, a thing I always suggest is to avoid setting multiple substituters in your config. Instead, set trusted-substituters and trusted-public-keys, and then only set the substituters you need in the nixConfig.substituters attribute of the flake.nix of the project they are needed in (if you’re not using flakes, add a .nix.conf file to your project and export NIX_USER_CONF_FILES="${NIX_USER_CONF_FILES+$XDG_CONFIG_HOME/nix}:$PWD/.nix.conf" to your .envrc)




  • I don’t know if it’s of any solace, Linux used to be a much more… ahem… “involved” experience a decade or two ago. This was more-or-less the norm:

    xkcd

    I can’t really say what the newcomer experience is nowadays, but I can say for sure that even in the worst-case (as it was in the times when I started using it), after a couple months of furious issue-fixing and trying new things, you will eventually settle on a setup that works for you. Some people actually get addicted to all the problem-solving and start looking for more issues to fix; some start distrohopping to find a “more perfect setup”, getting their fix of issue-fixing in the process. If you’re not one of them, congrats, at that point you can (mostly) just continue using it, until you need to update your hardware, then process may or may not be repeated depending on your luck. If you really hate fixing issues twice, you can look in the direction of declarative distros like NixOS or Guix, but I will warn you that the two-three months of furious hacking is still very much a thing here, but after that you’re set more or less for life.


  • balsoft@lemmy.mltoLinux@lemmy.mlIntroduction to Nix & NixOS
    link
    fedilink
    arrow-up
    25
    arrow-down
    1
    ·
    edit-2
    27 days ago

    NIX IS FOR REPRODUCIBLE BUILDS. That’s fucking it, seriously. It’s literally on their website.

    This post is specifically about NixOS and friends, though.

    IT’S A HORRIFIC EXPERIENCE FOR NEW USERS TRYING TO RUN A DESKTOP. Steer clear.

    There are thousands of users who run NixOS on their desktop, and thousands more users of home-manager (or nix-darwin) on macOS. If you are ready to put in the time and learn how it works, it’s wonderful - your entire distribution, the thing through which you interact with computers, becomes just another project in your ~/projects, rather than something you have to manually configure. You can’t forget “how to configure $X”, because it is all recorded in one place and done automatically when you get a new machine or update or whatever. It’s GNU Stow on steroids, for your entire system.

    There are a lot of downsides for sure as well (mostly the learning curve, and having to fix the buggy bullshit in some software which only runs well in FHS), but if you are a software developer (or adjacent) and like Linux, NixOS is still awesome.


  • Hmm, I think for me it just picks it up from the project root “magically”. I’m starting my editor from the project root too, maybe that matters (i.e. clangd looks for this file in $PWD)?

    Actually, looking at the docs, it should just search for it upwards from the source file you’re editing, so it can find it in the project root or in the subdirectory where your code lives. If you have it in some other locaiton, you can set this option in the .clangd file in your project root.


  • This is clearly not “a russian wondering what’s wrong”, this is “a russian living in russia who doesn’t want to die in prison”. This would be a fair criticism if there wasn’t a law criminalizing pacifism together with many laws making it easy to deanonymize internet users.

    Silence does not fix things.

    Neither does grandstanding on Lemmy. It especially wouldn’t fix anything if a person in Russia trying to build international relations would go to prison for it.


  • This is about as useful as suggesting to an average USian/brit/german that they violently overthrow their oppressive governments and install socialism. The punishment for trying (at least in UK/germany) is about the same as it would be for a russian wearing an anti-war T-shirt, the benefits for the humanity would be greater than they would be for overthrowing Putin’s dictatorship, and yet I don’t see people yapping about it any time someone from those countries posts an open-source project.


  • There’s almost no civil society of any kind left in Russia, so it’s impossible to say if a nation overall supports or opposes the warfare. People with an active pro-war or anti-war stance are minorities, somewhere in the 10-20% range, and neither are allowed to speak up (interestingly, quite a lot of pro-war social media influencers are in prison right now for daring to speak up against corruption in the army or similar). The vast majority of people are just going about their days. Does that technically help with the war? Yes, I guess, it drives the economy, people pay taxes etc, but then the same can be said about an average american, brit or german right now - I don’t see them blowing up munitions factories (that directly supply the ongoing genocide).




  • balsoft@lemmy.mltoOpen Source@lemmy.mlVOID — my FOSS second-brain app
    link
    fedilink
    arrow-up
    16
    arrow-down
    1
    ·
    edit-2
    27 days ago

    The basis of trust has been breached by whole nation, so it has to be earned by every single member of that nation.

    1. WTF is this collective punishment nonsense? Replace “nationality” with “race” (keeping in mind that a person typically doesn’t choose either and it’s decided by who their parents were) and you should be able to see the issue here
    2. I hope you rather quickly uninstall almost all popular FOSS software from your devices, because almost all of it contains sizeable contributions from russian citizens and I don’t think you’ve individually verified their intentions

  • For context I’ve been using aerc as my email client for a while now, and was looking for something similar for calendars/tasks myself

    I’ve tried:

    • calcurse: fine but clunky, also a bit difficult to set up. The most mature option and probably the best one available, but I just couldn’t get used to the interface
    • calcure: similarly clunky interface, glitchy/blinking rendering to the point of being headache-inducing, lacking features (couldn’t figure out how to look at all event attributes?)
    • khal: limited in features (compared to calcurse) and slow when there are a lot of events (even when it’s only 2-3 per day), also there are some rendering bugs sometimes. Probably the most intuitive and clean interface of all, and good scripting opportunities.
    • gcalcli: only Google Calendar (I also need support for arbitrary CalDAV), didn’t investigate further
    • plann: no TUI as such, just CLI

    A couple weeks ago I’ve decided to start writing my own. It’s still very much a hacky WIP but I’ll update in this thread if I ever decide to publish it. In the meantime, I hope one of the above works for you!


  • Because C++ doesn’t have a single well-defined build system, clangd doesn’t know how exactly to compile the files you are asking it to - in this case, it doesn’t know what headers to include. On some other distros it might “just work” because all headers are lumped together somewhere in /usr/include or something, and something somewhere tells clangd to just look in there. This isn’t the case on NixOS (in fact the headers are not installed at all with your system), and so you have to tell clangd where to look for them.

    Typically, your build system will have that information somehow. The process can vary depending on the build system you are using - some (like CMake or meson) can do it natively, for others you have to resort to a very useful hack called bear. Judging by your shell.nix, I would guess it’s make, which doesn’t have native compile_commands.json support, so what you have to do is:

    1. Add bear to your nativeBuildInputs
    2. Enter the shell again so that you have it in $PATH
    3. Run make clean (or otherwise ensure there are no build artifacts already present - maybe git clean -fx but be careful with that)
    4. Run bear -- make from the project root.

    make should then build your entire project, compiling every file in the process. bear will inspect the system calls that make is executing and determine which commands (and hence which command arguments) it used to compile each file, and create a file called compile_commands.json recording this information. clangd should then automatically find that file and use it to figure out which headers (and other arguments) it needs to compile each file.

    This is the setup I personally use to hack on Nix itself BTW, and it works great. Although I’m using helix and not neovim, but that shouldn’t matter.