@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

hypothetical: what would happen if I

  • manually allocated some memory in C (with malloc)
  • Crafted the memory to be an R object by writing a proper SEXP header for it
  • Returned this to R

Would R consider this cuckoo object to be real? It wouldn't appear in the list of objects to be garbage collected - would that impact its validity?

coolbutuseless,
@coolbutuseless@fosstodon.org avatar

I think with a malloc and a memcpy I can quickly fake a real R SEXP object.

I will report back!

I will also see what PROTECT()/UNPROTECT() want to do, and see if it'll crash :)

MattCrumpLab, to random
@MattCrumpLab@fosstodon.org avatar

Had a bunch of fun with this one. Got some drum beats working with euclidean rhythms, and started on some compositional ideas with notes and stuff.

I put one 3-track sequence into Ableton and it didn't sound half bad. #midi #rstats #generativemusic

Too much coding for one day though, brain melt has set in.

https://homophony.quest/blog/44_2_10_24_euclid/

coolbutuseless,
@coolbutuseless@fosstodon.org avatar

@MattCrumpLab Mad beats!

How are you handling soundfonts within R?

coolbutuseless, to cooking
@coolbutuseless@fosstodon.org avatar

with {rhub2}

Package passing valgrind and clang-ASAN ! Woo!

https://github.com/r-hub/rhub2

odr_k4tana, to random

Do yourself a favour and don't use the {likert} package in . It apparently isn't maintained anymore, uses close to EOL functions (even whe it still was maintained) and its documentation + usability is crappy as heck.

coolbutuseless,
@coolbutuseless@fosstodon.org avatar

@odr_k4tana developers website has a lot of setup for a v2 .

Might be worth a shot to try that.

Developer might need some support to finish and ship the new version?

coolbutuseless,
@coolbutuseless@fosstodon.org avatar

@odr_k4tana maybe even just send an encouraging word :)

Only a few packages seem to use it, so maybe the author thinks it's not worth updating.

MattCrumpLab, to random
@MattCrumpLab@fosstodon.org avatar

is a thing, but is there an or similar hashtag?

coolbutuseless,
@coolbutuseless@fosstodon.org avatar

@MattCrumpLab probably just you, me and my tr808

https://github.com/coolbutuseless/tr808r

coolbutuseless, to random
@coolbutuseless@fosstodon.org avatar

pkg tip: Use "LazyDataCompression" option to pack more data into your package!

Setting "LazyDataCompression: xz" will override the default gzip compression of data - allowing for greater data sizes in your pakcage before hitting the 5MB(?) limit.

https://cran.r-project.org/doc/manuals/R-exts.html#Data-in-packages

coolbutuseless, to random
@coolbutuseless@fosstodon.org avatar

Introducing {fastpng} when you need to write PNG files, but you want to do it quicky.

{fastpng} allows for the tradeoff between compression and speed.

Writing PNGs can be 75x faster when compression is turned off.

Supports: arrays, rasters and native rasters.

https://github.com/coolbutuseless/fastpng

Benchmark of fastpng package when writing a colour image showing it can be 75x faster when not using compression.

coolbutuseless, to random
@coolbutuseless@fosstodon.org avatar

I'm laughing myself silly at this old project of mine:

Realtime MIDI decoding + playback of multi-channel audio in R. Listen to the whole 30s clip :)

Just R + menagerie of unreleased pkgs. No python :P

Components:

  • Bespoke synthesis of notes (it's terrible. so i worked on a soundfont library, so there is the possibility of better instruments)
  • MIDI parsing
  • Real-time multichannel audio output. I think this MIDI is 12 channels.

Cheers to @MattCrumpLab for re-awakening this!

R playing back multi-channel MIDI file in realtime.

MattCrumpLab, to random
@MattCrumpLab@fosstodon.org avatar

I might need to manipulate and synthesize midi in R, so I spent the afternoon trying to make various packages work. They are all wrappers for python stuff. It wasn't a cake walk, but I finally made an mp3 of the top gun theme song = declaring victory

https://homophony.quest/blog/32_1_30_24_R_synth/

coolbutuseless,
@coolbutuseless@fosstodon.org avatar

@MattCrumpLab This is so great!

I've got some half-arsed, half-finished packages for real-time midi playback in - you've inspired me to bump them up the priority list :)

coolbutuseless, to random
@coolbutuseless@fosstodon.org avatar

#RStats #HotTake

It annoys me when R packages are hosted on rforge.

coolbutuseless, to random
@coolbutuseless@fosstodon.org avatar

The sum total of my knowledge about running checks for CRAN submission.

https://github.com/coolbutuseless/CRAN-checks

coolbutuseless, to random
@coolbutuseless@fosstodon.org avatar

{testhat} unsung hero function: test_path()

"automatically generates a path relative to tests/testthat, regardless of where that directory might reside relative to the current working directory."

Summary: It'll find your file whether running interactively or running "R CMD check"

coolbutuseless, to random
@coolbutuseless@fosstodon.org avatar

Adventures in CRAN: Another CRAN rejection for {yyjsonr}.

CRAN is now reporting a clang-ASAN issue that I cannot reproduce with my clang-ASAN setup (using {rhub2})

Now what am I supposed to do?

Note: I have some line numbers related to the error, so I can do some digging.

But I can't do any testing to see if it's fixed. I have to use CRAN submission as my test runner.

Not something I want. And pretty sure they don't want it either.

coolbutuseless,
@coolbutuseless@fosstodon.org avatar

@gaborcsardi @_TimTaylor this was direct email in response to my resubmission trying to fix the public asan check errors on v0.1.16.

I'm not near a computer right now to see what this might be. Will try again this evening.

coolbutuseless,
@coolbutuseless@fosstodon.org avatar

Adventures in CRAN:

this latest clang-ASAN issue is very likely due to some signed operations I'm doing on a size_t value in C.

I still need to try and replicate issue in my {rhub2} setup so that CRAN volunteers aren't just operating as my CI test checkers.

Thanks to eagle eyed @_TimTaylor who had a poke around already.

coolbutuseless,
@coolbutuseless@fosstodon.org avatar

Adventures in CRAN.

Kicking off another round of clang-ASAN tests (+ some others) on {yyjsonr}.

Just checking whether the reported issue from CRAN somehow magically appears this time.

Lots of great machines to check your package under using the {rhub2} pkg.

coolbutuseless,
@coolbutuseless@fosstodon.org avatar

@gaborcsardi @_TimTaylor Confirmed! Just ran on macos and reproduced the error.

Fixed some pointer artihmetic and now is passing! Woot!

Thanks @gaborcsardi !

coolbutuseless,
@coolbutuseless@fosstodon.org avatar

@gaborcsardi I'm not certain that these options are the default in the CRANs clang-ASAN build.

i.e. the 'check' results for v0.1.16 didn't pick up this error (https://www.stats.ox.ac.uk/pub/bdr/memtests/clang-ASAN/yyjsonr/00check.log)

The check results were reported to me via email (without a full log of the check output), so this may have been a manual/bespoke extra-special run outside the standard machines.

Not sure. But then again I'm not sure anything is certain :)

coolbutuseless,
@coolbutuseless@fosstodon.org avatar

@gaborcsardi You are correct.

While the bug fixed today isn't related to the other clang-ASAN bug (related to strlen).

However, it is related to the fixes I did for the "M1Mac" issues reported when "-Wconversion" is set. https://www.stats.ox.ac.uk/pub/bdr/M1mac/yyjsonr.log

In short, yes I probably introduced this pointer overflow bug in the last couple of days.

coolbutuseless,
@coolbutuseless@fosstodon.org avatar

@gaborcsardi The M1Mac issues used flags I hadn't seen before in any of my other CRAN checks:

-Wconversion -Wno-sign-conversion

They may be part of mac-builder, but I didn't think to check on mac-builder as I'm developing on an actual mac.

coolbutuseless, to random
@coolbutuseless@fosstodon.org avatar

Adventures in CRAN.

Currently running clang-ASAN as a github action using {rhub2}.

https://github.com/r-hub/rhub2

coolbutuseless,
@coolbutuseless@fosstodon.org avatar

Adventures in CRAN: Huzzah!

{rhub2} running clang-ASAN as a github action replicates the issue report I got from CRAN.

So I'll now be able to tell if my fixes actually fix the right thing!

Just 10 minutes work to set up {rhub2} for the first time. Filed a minor issue report on GH as well: https://github.com/r-hub/rhub2/issues/10

Thanks to @gaborcsardi for this amazing workflow!!

image/png

coolbutuseless, to random
@coolbutuseless@fosstodon.org avatar

Adventures in CRAN (upcoming weekend "fun")

  • Can I figure out how to run Docker on my ARM Mac.
  • Does clang-ASAM run under docker on an ARM Mac?
  • Can Ifigure out how to build {yyjsonr} under clang-ASAN under Docker on ARM Mac
  • Can I debug a memory issue related to strlen() when running tests in {yyjsonr} under clang-ASAN under Docker on ARM Mac.

coolbutuseless,
@coolbutuseless@fosstodon.org avatar

But maybe try {rhub2} first ! :)

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