Coder Social home page Coder Social logo

cactus.purge's People

Contributors

weshinsley avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

cactus.purge's Issues

Text positioning issues with Crayon 1.5.1 on R <= 4.1.3

Some text placement issues have arisen with Crayon 1.5.1 (whereas 1.4.1 was fine). The issue is that nchar(crayon::strip_style(text)) is not giving the correct number of visible characters in a string that contains some ANSI control codes.

The change in Crayon 1.5.1 is the addition of "useBytes=TRUE" here in has_ansi.r, which was not present in 1.4.1

strip_style <- function(string) {
  gsub(ansi_regex, "", string, perl = TRUE, useBytes = TRUE)
}

I've not worked out the reason for that yet, but by observation, that causes an incorrect answer when using gsub in R 4.1.3, but a correct answer again in R 4.2.0

Workarounds:
a) Force install crayon 1.4.1, or upgrade to R 4.2.0
or
b) Write our own strip_style omitting the useBytes.

Make performance more consistent

Use waitr package to try and make performance more even across different platforms. It may not be perfect, but should be a bit better...

Linux audio

Linux audio is generally terrible - audio is corrupt, and message get pasted on the screen.

Look for alternatives...

No sound -> crash on linux

Sound seems good out of the box on Win and Mac, however on ubuntu:-

##############################################################

L-|xError in play.default(x, rate, ...) : no audio drivers are available

Calls: ... play_sound -> -> play.audioSample -> play.default
In addition: Warning messages: #
1: In .Call(C_save_term_status) : converting NULL pointer to R NULL
2: In .Call(C_set_term_echo, echo) : converting NULL pointer to R NULL
Execution halted #
Warning message: #
In .Call(C_restore_term_status) : converting NULL pointer to R NULL

I should:-

  1. Detect absence of audio driver, and continue without sound.
  2. And then see what we can do about adding a driver/helping the user do so.

Improve reg key experience

A bit messy, especially if you choose 2:-

ERROR: The system was unable to find the specified registry key or value.

On Windows, you need a registry key set to allow colours
to be used from RScript in a terminal window. The command needed:
REG ADD HKCU\CONSOLE /f /v VirtualTerminalLevel /t REG_DWORD /d 1

Please choose:-

  1. Set this key now.
  2. Don't set this key now.

Your choice: 2

No changes made.
Error in check_windows_ansi() :
Calls: -> check_windows_ansi
Execution halted

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.