Posts

This profile is from a federated server and may be incomplete. Browse more on the original instance.

coolbutuseless, to random
@coolbutuseless@fosstodon.org avatar

4.4.0 now includes "%||%" in base

I've always called it the "null operator", but I'm happy to learn of a better name.

multimeric,
@multimeric@genomic.social avatar

@Mehrad Don't you mean it will return the LHS unless it's null?

Mehrad,
@Mehrad@fosstodon.org avatar

@multimeric
You are right, in the text I wrote left and right in wrong order. I now edited my toot. Thanks.

coolbutuseless, to random
@coolbutuseless@fosstodon.org avatar

{rmonocypher} is now feature complete! Simple (yet bulletproof) encryption

Core encryption function is

encrypt(mtcars, filename = "secure.rds", key = "my secret key!")

Security/usability feedback welcomed!

Below the surface there's lots going on!

  • Argon2 key derivation
  • RFC8439 "Authenticated Encryption with Additional Data" using ChaCha20 stream cipher + Poly1305 Message Authentication
  • Required random bytes (nonce) sourced from OS CSPRNG

https://github.com/coolbutuseless/rmonocypher

coolbutuseless, to demoscene
@coolbutuseless@fosstodon.org avatar

users, if your method for creating tables isn't letting you create retro demo effects then what even is the point?

This is {emphatic} output to an SVG animation played back in the browser with 'scale_colour_gradient2()' and some sine waves doing the effect.

video/mp4

coolbutuseless, to random
@coolbutuseless@fosstodon.org avatar

Has anyone ever written a "multi-facetted" package for CRAN?

For example, I have a package that uses the connections API.

I would like the full version available from GitHub and r-universe.

Through clever use of defines and 'if' statements etc, the CRAN version would exclude all forbidden code.

Could this exist in one pkg tarball? Or would the tarballs have to be different?

Are there CRAN-specific ENV vars that can be used to control the inclusion/exclusion of code?

gaborcsardi,
@gaborcsardi@fosstodon.org avatar

@coolbutuseless You can create another package for the extra features, and keep that on GitHub.

coolbutuseless, to random
@coolbutuseless@fosstodon.org avatar

hive: has anyone resubmitted a package to CRAN and been asked to fix their use of SET_TRUELENGTH?

LukeTierney4,
@LukeTierney4@fosstodon.org avatar

@coolbutuseless I don’t think there are plans to insist on fixing this one. But you are using something that is very experimental, even if it hasn’t changed in a number of years, so is not part of the API, so you have to be prepared to make changes on fairly short notice.

coolbutuseless,
@coolbutuseless@fosstodon.org avatar

@LukeTierney4 thanks for the info. It was unclear whether the NOTE was a blocker to package updates.

I do recall a checkbox when submitting to CRAN along the lines of "I have checked the CRAN checks and fixed all the errors and warnings and notes(?)".

I am mis-remembering the exact text and extents of the assertion - but that was the gist.

coolbutuseless, to random
@coolbutuseless@fosstodon.org avatar

{emphatic} typst support: added!

Good news: It works!

Bad news: I can't work out how to disable text wrapping and/or set overflow in a block to be hidden.

Large tables make 'typst' want to reflow the text which I expressly do NOT want to do.

I've added a 'font_size' option to help deal with this, but being able to control reflow/overflow would be better!

https://github.com/coolbutuseless/emphatic

coolbutuseless, to random
@coolbutuseless@fosstodon.org avatar

{emphatic} now renders to latex!

Which means that Quart/Rmd rendering to PDF now works!

https://github.com/coolbutuseless/emphatic

coolbutuseless, to random
@coolbutuseless@fosstodon.org avatar

Help needed!

I want to email R-devel & get clarification on "Can we create custom connections in packages?"

I find the situation confusing because using the "Connections.h" is mentioned in R-exts manual - and so formally(?) part of the API

But this conflicts with the NOTE generated if you try to use "R_new_custom_connection()" which says it is "non-API"

Am I tilting at windmills? Poking the bear? HELP!

Edits/suggestions welcomed in the gist below.

https://gist.github.com/coolbutuseless/2b261e2f7f54206c1263fbca0e71ac64

michaelchirico,
@michaelchirico@fosstodon.org avatar

@coolbutuseless @gaborcsardi @jeroenooms now I just saw this r-devel message and am not sure if I'm missing something 😅😅

https://stat.ethz.ch/pipermail/r-devel/2024-April/083356.html

gaborcsardi,
@gaborcsardi@fosstodon.org avatar

@michaelchirico @coolbutuseless @jeroenooms Hah, I forgot archive used connections. pak embeds curl, but does not actually use the connection API.

coolbutuseless, to random
@coolbutuseless@fosstodon.org avatar

API

(Last meme for the week - I promise!)

LukeTierney4,
@LukeTierney4@fosstodon.org avatar

@coolbutuseless somebody really needs to get a life …

coolbutuseless, to random
@coolbutuseless@fosstodon.org avatar

Eye-watering stats on packages with unit tests on CRAN

60+% of packages had no tests

From data in 2017 by @juliasilge : https://juliasilge.com/blog/mining-cran-description/

coolbutuseless, to random
@coolbutuseless@fosstodon.org avatar

Do any of the standard/extended checks on CRAN use *BSD?

gaborcsardi,
@gaborcsardi@fosstodon.org avatar
coolbutuseless, to random
@coolbutuseless@fosstodon.org avatar

How do I write a test to check if a random number generator is
working?

Context: I need something cross-platofrm that access system CSPRNGs (arc4random, bcyprt (on win), etc).

I can test local on a mac that it behaves sanely, but on windows (running as a github action), I want a few quick tests to check that it as least not all the same number repeated :)

But something a bit cleverer :)

gdagstn,
@gdagstn@genomic.social avatar

@coolbutuseless diehard/dieharder test?

Cmastication,
@Cmastication@mastodon.social avatar

@gdagstn @coolbutuseless last time I thought about rng or pseudo rng, diehard(er) was the answer.

coolbutuseless, to random
@coolbutuseless@fosstodon.org avatar

mood

gaborcsardi,
@gaborcsardi@fosstodon.org avatar

@coolbutuseless I think that's actually fine? There is (de facto) only one implementation of R, and the released versions are not going to change any more. So it can only break on R-devel, which you'll notice because they will email you that your package is crashing.

coolbutuseless, to random
@coolbutuseless@fosstodon.org avatar

I am paying close attention to the R-devel discussion on R API definition.

A package I'm working on (rmonocypher) uses connections to enable encryption in lots of useful places in R for seamless/easy data encryption.

But connection registration in R code is "non API", meaning that you can't write a new connection in a package!

The connection API has been stable for 10 years. Not sure why its use is verboten.

https://github.com/coolbutuseless/rmonocypher

LukeTierney4,
@LukeTierney4@fosstodon.org avatar

@coolbutuseless I wouldn’t hold my breath.

coolbutuseless,
@coolbutuseless@fosstodon.org avatar

@LukeTierney4 :/

I would've thought I could just use/check the R_CONNECTIONS_API version and update the package when it gets updated ?

Just like we do with R_GE_version for the graphics system.

It feels limiting to have a stable API for enhancing R marked as "don't use"

coolbutuseless, to random
@coolbutuseless@fosstodon.org avatar

Programming tip: When writing extensions for R using C:

  • Allocate memory before trying to copy data into it.
  • Copying into a NULL pointer is bad.

Like and subscribe for more "great" programming tips!!!

Cmastication,
@Cmastication@mastodon.social avatar

@coolbutuseless huge if true…

  • All
  • Subscribed
  • Moderated
  • Favorites
  • JUstTest
  • rosin
  • Durango
  • cisconetworking
  • mdbf
  • InstantRegret
  • DreamBathrooms
  • ngwrru68w68
  • magazineikmin
  • osvaldo12
  • Youngstown
  • ethstaker
  • slotface
  • kavyap
  • provamag3
  • thenastyranch
  • normalnudes
  • modclub
  • khanakhh
  • everett
  • tacticalgear
  • cubers
  • GTA5RPClips
  • anitta
  • Leos
  • tester
  • megavids
  • lostlight
  • All magazines