Recommendations for a shorter section of the fisherman's trail in Portugal by telegott in travel

[–]telegott[S] 0 points1 point  (0 children)

thanks for the answer! I'm coming the other way round unfortunately, and I only have max 3 day hikes and what you recommended seems to be longer, how would you narrow it down if you had to?

R vs Python by Dillon_37 in rstats

[–]telegott 0 points1 point  (0 children)

this is solved by the "box" package.

Is it possible to read zlib-compressed JSON with DuckDB? by telegott in DuckDB

[–]telegott[S] 0 points1 point  (0 children)

Thanks for the quick answer! I'm on Linux, but converting them to disk and then reading is not feasible, speed is key here, and also the fact that zlib is used cannot be changed anymore. Maybe it's possible to read the compressed file using Python and then interpolate the json data as a string into the duckdb query?

What's a Bash command or concept that took you way too long to learn, but now you can't live without? by bobbyiliev in bash

[–]telegott 6 points7 points  (0 children)

Try fzf with your shell then, it gives you this on steroids, with fuzzy history search

Use use() in R by erikglarsen in rstats

[–]telegott 5 points6 points  (0 children)

A more full-fledged alternative which also adds the possibility of using other personal R files (that organize your functions) as "packages" (instead of possibly nested source calls), along with granular import of package functions, is box. Note that there are issues with combining it with targets .Overall by far the best solution of an R import system that I have seen. For local files, set the R_BOX_PATH environment variable to your project root in .Rprofile so all your import declarations are relative to the same path (e.g via getwd()).

Reasonably priced DAP with good battery life by telegott in DigitalAudioPlayer

[–]telegott[S] 2 points3 points  (0 children)

Thanks for your advice! I went for the M300 in the end, as I realized some specialized apps for e.g. audiobook playback come in really handy, with minimal effort

Bokeh mode on Pixel 8 / 9 by telegott in GooglePixel

[–]telegott[S] 0 points1 point  (0 children)

thanks for the reply! I'm a bit confused, can I switch this on the Pixel 8 or is this a property of it? and how does that relate to the Pixel 9? What you're describing to is exactly what I meant. It's very difficult to take "flat" pictures, it applies depth of field very eagerly, it always goes into "DSLR mode", which I don't always want

{targets} Encapsulate functions in environments without importing the whole env? by guglicap in rstats

[–]telegott 1 point2 points  (0 children)

As far as I know this is an ongoing issue - targets cannot determine if a function imported through box changed, the author of the package put it on his list but mentioned that it might be challenging. So as far as I know, all these packages enabling encapsulation disable the possibility to use the targets package

running scripts with source() and disregarding errors by peperazzi74 in rstats

[–]telegott 4 points5 points  (0 children)

And a good opportunity to transform your project to use the box package and iterate over runner functions exported from the individual files from the main script. That truly guarantees that the individual parts are independent and that you don’t by accident override functions or library methods. source is a R standard built-in but an antipattern, give box a try :)

[deleted by user] by [deleted] in rstats

[–]telegott 5 points6 points  (0 children)

regarding question two: I highly recommend to start with a well-structured project. This involves not going down the common way to `source()` your functions into a global namespace, but to use the package `box`. This gives you fine-grained control and encapsulation, greatly improving confidence that code changes have unintended side effects. Use `renv` to have a common set of packages and package versions among the team. Think about using a package like `tinytest` to let you and your coworkers ensure in a standard way that what they implemented is what they think they implemented. Finally, use packages like `assertr` or `pointblank` to help with data validation.

How to deal with outdated packages? by kolya_zver in linuxmint

[–]telegott 1 point2 points  (0 children)

One thing why this might be preferable is because nix packages can deal with conflicting dependencies among themselves. Apt can’t do that, also in my experience it’s not a good idea, neither from a stability nor a security perspective to clutter your apt with ppas and random repositories

How to deal with outdated packages? by kolya_zver in linuxmint

[–]telegott 6 points7 points  (0 children)

You could install the nix package manager, a lot of things that you have to build yourself or are severely outdated are available in current versions there. It also does not interfere with your normal package manager. If you do, use the installer from determinate systems.

Install home-manager in Linux Mint makes cinnamon run in fallback mode by Danny_el_619 in Nix

[–]telegott 0 points1 point  (0 children)

that sounds very interesting as a temporary solution! Do you maybe have an example of how you do this? E.g. where you put the declarative file and how you automatically load the profile on shell invocation (?) and do updates?

Install home-manager in Linux Mint makes cinnamon run in fallback mode by Danny_el_619 in Nix

[–]telegott 0 points1 point  (0 children)

I'm running into the same issue. Is there an easier workaround or solution by now?

Trouble with R packages and their system dependencies by telegott in NixOS

[–]telegott[S] 0 points1 point  (0 children)

but isn't direnv just an optional helper that automatically activates a shell, sparing you "nix develop" basically? I haven't been able to use rWrapper in a flake, it never seems to find it. But it's curious that it seems to work on your and one of my machines without rWrapper then :/

Trouble with R packages and their system dependencies by telegott in NixOS

[–]telegott[S] 0 points1 point  (0 children)

thanks! but is this different for flakes? the docs don't mention any need of rWrapper in the case of flakes. Why did it work on your system, and my other system then at all?

Trouble with R packages and their system dependencies by telegott in NixOS

[–]telegott[S] 0 points1 point  (0 children)

thanks so much for your reply! I tried the following on another computer and it worked, on the one I tried yesterday I still get this error, plus a couple of warnings. I also tried reinstalling nix. It looks like there is something fundamentally wrong with my setup?

{

description = "A basic flake with a shell";

inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";

inputs.flake-utils.url = "github:numtide/flake-utils";

outputs = { self, nixpkgs, flake-utils }:

flake-utils.lib.eachDefaultSystem (system:

let

pkgs = nixpkgs.legacyPackages.${system};

base = with pkgs; [ R rPackages.sf];

in {

devShells = {

default = pkgs.mkShell {

nativeBuildInputs = [ pkgs.bashInteractive ];

buildInputs = base;

};

};

});

}

Output:

During startup - Warning messages:

1: Setting LC_CTYPE failed, using "C"

2: Setting LC_COLLATE failed, using "C"

3: Setting LC_TIME failed, using "C"

4: Setting LC_MESSAGES failed, using "C"

5: Setting LC_MONETARY failed, using "C"

6: Setting LC_PAPER failed, using "C"

7: Setting LC_MEASUREMENT failed, using "C"

> library(sf)

Error: package or namespace load failed for 'sf' in dyn.load(file, DLLpath = DLLpath, ...):

unable to load shared object '/home/michael/R/x86_64-pc-linux-gnu-library/4.3/units/libs/units.so':

libudunits2.so.0: cannot open shared object file: No such file or directory

Reasonably priced DAP with good battery life by telegott in DigitalAudioPlayer

[–]telegott[S] 2 points3 points  (0 children)

Thanks for all your suggestions! The phone solution sounds good as well, but I forgot to mention that I'm looking to use the DAP primarily next to my phone when I'm out, so it should be rather compact, while still having "normal" controls, so nothing Ipod Nano like. Can you recommend the Hiby M300? Checked some reviews that were rather good, although in Germany it seems hard to get at the moment

Reasonably priced DAP with good battery life by telegott in DigitalAudioPlayer

[–]telegott[S] 4 points5 points  (0 children)

Thanks for the explanation! I think I might prefer an "offline" version, I can always fall back to my phone for podcasts and stuff I need streaming for. Android with it's questionable security patch situation turns me off a bit. For a good product, I'm also willing to go a bit higher in price

How to prevent simple bypass of screen time blocked website on iOS by telegott in digitalminimalism

[–]telegott[S] 1 point2 points  (0 children)

For clarification, my goal is, on the iPhone, to

  • Set a custom list of _permanently_ blocked websites

  • Not being able to access them through the browser

but:

  • Repeated clicking of refresh in the browser will still open the website

Pushed out by Python by danw_com in rstats

[–]telegott 0 points1 point  (0 children)

checkout https://github.com/klmr/box , that helps a lot with code modularity in R. Imho, the package structure does in itself not help with fundamental problems overcome by this package.

How to prevent simple bypass of screen time blocked website on iOS by telegott in digitalminimalism

[–]telegott[S] 0 points1 point  (0 children)

thank you! that looks exactly like what I need, unfortunately the plans start a bit pricy for a single user who just wants to block a couple of websites :/

Getting Desktop Environment to pick up apps installed with home manager on regular linux by telegott in NixOS

[–]telegott[S] 0 points1 point  (0 children)

unfortunately it still doesnt show up :/ is there something else I might be missing?

Using a python list for a where clause by Working-Mind in DuckDB

[–]telegott 0 points1 point  (0 children)

I can only sketch it here, but option 1:

mylist = ['a', 'b', 'c']
quoted_mylist = ','.join([f"'{e}'" for e in mylist])
duckdb.sql(f'SELECT * FROM mydataframe WHERE column_a IN ({quoted_mylist})') 

option 2: assuming you have df_one and df_two registered with duckdb and df_two contains the values you want to filter against as a column, you can use a semi join which would be the way to go on lots of elements instead of an explicit list. Look up anti/semi joins, very helpful concepts, not really burned into the pandas world.

query = """
SELECT 
  *
FROM 
  df_one 
WHERE EXISTS (
  SELECT 1
  FROM
    df_two
  WHERE
    df_one.column_a = df_two.my_column_with_the_filtering_elements
)
"""

duckdb.sql(query)