@coolbutuseless@fosstodon.org
@coolbutuseless@fosstodon.org avatar

coolbutuseless

@coolbutuseless@fosstodon.org

Nerd.

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

coolbutuseless, to random
@coolbutuseless@fosstodon.org avatar

Introducing {naratext} - render text into nativeRaster objects

I wrote this pkg because I need to render text into nativeRaster and then interface/composite into other nativeRasters with {nara}

This is at the "proof-of-concept" stage, but looks promising!

#RStats

https://github.com/coolbutuseless/naratext/
https://github.com/coolbutuseless/nara/

coolbutuseless, to random
@coolbutuseless@fosstodon.org avatar

{nara} update. A pkg for handling nativeRaster images.

  • New demo sprite.
  • Updated hex logo

All rendering done in R with {grid} and {nara}

https://github.com/coolbutuseless/nara

Animated pixel deer running across the screen
Hexagonal logo with the word "nara". Inside the hexagon is an animated pixel deer

coolbutuseless, to random
@coolbutuseless@fosstodon.org avatar

{nara} pkg for working with native rasters in R

Work-in-progress: experimenting with isometric tiles

Fun!

https://github.com/coolbutuseless/nara

coolbutuseless, to random
@coolbutuseless@fosstodon.org avatar

Which one of you crazy kids built a sprite editor in the Rstudio viewer?

Possible back in times of tw*tter...

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.

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?

coolbutuseless, to random
@coolbutuseless@fosstodon.org avatar

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

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!

#WorkInProgress

https://github.com/coolbutuseless/emphatic

#RStats

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

coolbutuseless, to random
@coolbutuseless@fosstodon.org avatar

#RStats API

(Last meme for the week - I promise!)

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

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 :)

coolbutuseless, to random
@coolbutuseless@fosstodon.org avatar

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

coolbutuseless, to random
@coolbutuseless@fosstodon.org avatar

mood

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.

#RStats

https://github.com/coolbutuseless/rmonocypher

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!!!

coolbutuseless, to random
@coolbutuseless@fosstodon.org avatar

I ❤️ {rhub} !

Just checked new package on 9 R setups - including valgrind and address sanitizer.

Such a confidence builder that the package won't barf too much on CRAN :)

coolbutuseless, to random
@coolbutuseless@fosstodon.org avatar

The wildest R error I've seen this week!

I've managed to trigger a condition that requires "R 22538.0.0 or newer"

o_O

coolbutuseless, to random
@coolbutuseless@fosstodon.org avatar

A handy thing about having a local CRAN mirror is that I can zgrep across the repository looking for code examples :)

coolbutuseless, to random
@coolbutuseless@fosstodon.org avatar

Is there a blessed way to create a RAWSXP from an existing chunk of memory within C?

Specifics:

  • The memory is already allocated elsewhere
  • I don't want to use memcpy, just wrap the memory where it is such that the RAWSXP points to it.
  • I don't want the garbage collector to know about it - I will free the memory myself later.
  • It still has to be valid RAWSXP that I can use in R

This is a bit of a callback to this post: https://fosstodon.org/@coolbutuseless/111956983679205597

coolbutuseless, to random
@coolbutuseless@fosstodon.org avatar

Now that this pkg is actually in a state where it can do something useful, I can quickly realize some ideas for rendering. From idea to proof-of-concept render was ~15 minutes.

This is a ggplot object rendered into isometric layers.

It's just a shear + foreshortening transformation applied to the geometry, with points further offset in the y axis.

Isometric transformed ggplot with layer separation.

coolbutuseless, to random
@coolbutuseless@fosstodon.org avatar

This was a lot of work to get this new graphics device package to this point.

Yet it looks like I've done nothing at all :)

animation of layers of a simple ggplot in R

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