@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, (edited ) to random
@coolbutuseless@fosstodon.org avatar

Introducing {moggy} - a package for creating markdown documents from scratch without using a template.

My use-case for this package is to create markdown documentation directly from meta-information stored in lists/data.frames

The development progress of this package is proportional to the quality of the image of the cat in the logo.

https://github.com/coolbutuseless/moggy

coolbutuseless, to random
@coolbutuseless@fosstodon.org avatar

Developer note: Nearly every single one of my projects has started with these 3 thoughts:

  1. That'd be cool.
  2. It can't be that hard.
  3. It should only take me a few hours to do.

Then I spend the next month* riding the Dunning Kruger wave - realising there's so much I don't know that I don't know! - and thinking my past self a fool for ever thinking this was possible.

...

It is nice when they occasionally pan out...

(*) year

coolbutuseless, to random
@coolbutuseless@fosstodon.org avatar

TIL: someone once attempted refactoring R from C to C++

Project name: CXXR

https://www.cs.kent.ac.uk/projects/cxxr/

coolbutuseless, to random
@coolbutuseless@fosstodon.org avatar

Anyone know how to get a list of functions callable via ".Internal()"?

Or to I have to go to the R source code?

coolbutuseless, to random
@coolbutuseless@fosstodon.org avatar

Today I am pleased to annouce the c64-verse!

I trio of packages for c64 development in

  1. {c64vice} talks to a running VICE c64 emulator to send/receive info, cpu registers, memory dumps etc

  2. {c64asm} is a revamp of {r64}, a pure-R assembler for c64 6502 machine code - including syntax for including R data into code

  3. {c64tass} a wrapper for TASS - the de factor standard in c64 assemblers.

Logo for c64tass package. A hexagon with a Commodore computing logo in the centre.
Logo for c64asm package. A hexagon with a Commodore computing logo in the centre.
Logo for c64vice package. A hexagon with a Commodore computing logo in the centre.

coolbutuseless,
@coolbutuseless@fosstodon.org avatar

Currently, with {c64asm}, you can compile 6502 assembly to machine code, incorporate data and text from R objects, and use calculations on R variables when compiling.

Once compiled to standard c64 program format (.prg), you can inject the program directly into a running VICE c64 emulator using {c64vice}.

The ultimate desired workflow is using RStudio as a c64 IDE.

coolbutuseless,
@coolbutuseless@fosstodon.org avatar

With {c64vice} R communicates with the VICE emulator over a socketConnection() to send/receive requests/responses.

This allows for things such as:

  • Getting/setting memory
  • Manipulating the program counter
  • Dumping the full machine state
  • Injecting text into the keyboard buffer
  • Taking screenshots.

In the example pictured, {c64asm} used to compile code, {c64vice} used to inject code into VICE emulator and run it.

Screenshot showing how {c64vice} can be used to construct and send requests to a running VICE c64 emulator.
Screenshot taken from VICE using a command sent from R

coolbutuseless,
@coolbutuseless@fosstodon.org avatar

{c64asm} is based on an older package of mind called {r64}, but it has been tidied up and simplified a bit.

{c64tass} used to reside within the {c64asm} package but was split off for the sake of simplicity.

{c64vice} is totally new and makes development faster as you can set memory and breakpoints in the machine much much easier than trying to do so from the command line.

coolbutuseless,
@coolbutuseless@fosstodon.org avatar

Thanks to @gaborcsardi for the 'socketConnection()' tip.

This worked out really well for sending/receiving raw bytes over a TCP socket in order to communicate with VICE emulator.

coolbutuseless, to random
@coolbutuseless@fosstodon.org avatar

Excluding {spongebob} what's the weirdest, most useless package on CRAN?

Https://cran.dev/SpongeBob

gabbspalomo, to random
@gabbspalomo@fosstodon.org avatar

Wait a minute. So there’s purrr and furrr. So furrr is purrr but in parallel? 🙀 Is this correct? Oh I am so going to learn more about furrr now! Also what’s up with those names? 😹😹😹

coolbutuseless,
@coolbutuseless@fosstodon.org avatar

@hrbrmstr would using {yyjsonr} instead of {jsonlite} help here at all?

@rmflight @gabbspalomo

coolbutuseless, to random
@coolbutuseless@fosstodon.org avatar

Package suggestions wanted:

From R, I want to send raw bytes to a server and receive raw bytes back.

It's not a HTTP server.

What packages do you recommend?

coolbutuseless,
@coolbutuseless@fosstodon.org avatar

@gaborcsardi socketconnection() worked! Thanks for the tip.

coolbutuseless, to random
@coolbutuseless@fosstodon.org avatar

Waiting for videos to come online ...

coolbutuseless, to random
@coolbutuseless@fosstodon.org avatar

Nothing says safety like running "eval(parse(text = string)))" on input from the user.

coolbutuseless,
@coolbutuseless@fosstodon.org avatar

@Mehrad fork bomb?

coolbutuseless, to random
@coolbutuseless@fosstodon.org avatar

If anyone manages to produce this #RStats error, I will grant you a gold star.

"math1 compiler/interpreter mismatch"

I'd also be very interested to hear how you got there!

This almost seems like a superfluous check that could be dropped for a 0.000001% speed increase.

#RStats #Internals

coolbutuseless,
@coolbutuseless@fosstodon.org avatar

@LukeTierney4 :)

I realise the check is probably there to ensure the math1 ops don't get out of order between R and C.

It was interesting to find an error that could not be triggered by doing something in R.

coolbutuseless, to Discord
@coolbutuseless@fosstodon.org avatar

I passed 3 "Are you human?" checks, reset my password, and did authentication for signing in from a new location.

I'm now on discord and remembering it's an incomprehensible interface of colour and movement :)

coolbutuseless,
@coolbutuseless@fosstodon.org avatar

@jonthegeek Maybe there should be an #I'mTooOldForThis :)

coolbutuseless, to random
@coolbutuseless@fosstodon.org avatar

Anyone familiar with WASM/webr? i.e. running R via WASM in the browser.

Is it running the R interpreter in WASM, or is it running the JIT compiled R bytecode?

I have code that I think can tell whether it's running interpreted or compiled - and it thinks that the WASM webR is only running the R interpreter.

https://docs.r-wasm.org/webr/latest/

@gws

milesmcbain, to random
@milesmcbain@fosstodon.org avatar

Vector index recycling is convenient but it would be really great if core could sort it so that it plays a sound effect of some chimes tinkling when it’s happening so I know to check I want that magic right now. Next R sprint maybe? ✨🧙‍♂️🪄

coolbutuseless,
@coolbutuseless@fosstodon.org avatar

@milesmcbain I'd appreciate only recycling for length = 1.

All other cases you have to do an explicit rep() / rep_along()

coolbutuseless, to random
@coolbutuseless@fosstodon.org avatar

{yyjsonr} Update v0.1.7. Fast read/write of JSON/GeoJSON/NDJSON.

I did a great renaming of the user-facing functions.

It's not perfect, but it's better than it was before (see image).

https://github.com/coolbutuseless/yyjsonr

Table showing comparison of features across R JSON packages.
Image showing speed comparison of R JSON packages.

coolbutuseless, to random
@coolbutuseless@fosstodon.org avatar

relax-a-coding

library(magick)
i <- image_read(system.file("img", "Rlogo.png", package="png"))
i <- image_scale(i, geometry_size_percent(100, 50))
i <- image_data(i)[2,,]
d <- dim(i)
i <- c(' ',"\u00B7","\U2025","\U1805","\u238a")[cut(as.integer(i), 5, F)]
i <- matrix(i, d[1], d[2])
cat(apply(i, 2, (x) paste(x, collapse = '')), sep="\n")

image/png

coolbutuseless, to random
@coolbutuseless@fosstodon.org avatar

one-liner wanted:

Turn a character vector into a 0-indexed character vector.

Shortest answer wins*

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