dir? or any command followed by "?" yields a + sign. Why? - r

Just experimenting with help in RStudio. So I type setwd? and the help comes up in another RStudio window. Now I type ls? ( at the console ) and all I get is "+". What's it expecting? I was told you don't need to put the () in and even if you do, same thing happens. I have to escape out of it. Shut down and startup...same problem and same ole' output from setwd?.
I'm on a MacBook air M1 macOS BigSur 11.3.1

It's expecting a string/object after the ? to search the prior type of files for. The characters before the ? it is treating as a type. If nothing is before the ? it searches all types of documentation: objects, packages, etc. Examples:
Is?is
Error in `?`(Is, is) :
no documentation of type ‘Is’ and topic ‘is’ (or error in processing help)
?"is"
?is
package?methods

Related

system2("bash", "ls") -> cannot execute binary file

Anyone got an idea why
system2("bash", "ls")
would result in (both in R-Gui and RStudio Console)
/usr/bin/ls: /usr/bin/ls: cannot execute binary file
while other shells work w/o issues (see example below) and the "bash" in the RStudio Terminal also works w/o problems. AND if there is a remedy for that?
Working system2 example:
system2("powershell", "dir")
Running R-3.6.3 on Windows 10 here ... with "Git bash" executing as "bash".
PS: just in case someone wonders - I also tried the full path ie /usr/bin/ls -> same result
Ok - this does the trick
system2("bash", input = "ls")
so instead of args = ... as with the powershell command one needs (or more interestingly sometimes 'can') use the input = ... parameter with bash
OR as mentioned in the comments by #oguzismail this will also work
system2("bash", "-c ls")
as well as pointed out by #Christoph
system2("ls")
also works sometimes (ie in some RStudio[?] setups it will not return results in some it will).
But I have come to notice that different combinations of R-versions with different RStudio versions [or more probably Locales] will not always behave consistently of course also depending on the availability of bash commands like ls (more generally /usr/bin) being on the PATH or not.
So choose what suits u best!

zsh array assignment and no match errors

zsh version 5.2
I'm attempting an array assignment using filename generation like so:
files=(/some/path/*/dir/myfile)
Indeed this is the way the zshoptions manual recommends to achieve what I want.
When no matches exist I want the array to be empty. Instead it's producing
no matches found: /some/path/*/dir/file
and the script terminates.
I've tried setting NULL_GLOB, CSH_NULL_GLOB and ensured NOMATCH is not set.
When matches do exist it works as expected.
Any help is appreciated.
Thank you in advance,
Wayne
Well of course I found the solution after posting my question.
For this to work EXTENDED_GLOB needs to be set as well as NULL_GLOB. Or a glob qualifier can be used so that NULL_GLOB only effects this particular expansion.
This is how to set NULL_GLOB for a single operation:
files=(/some/path/*/dir/myfile(N))
Hope that can help someone else who encounters this.
Wayne

Tesseract use of number-dawg

I need to specify a numeric pattern. I already made training normally.
I created a config file that has the line
user_patterns_suffix user-patterns
and the file user-patterns contains my patterns, for example:
:\d\d\d\d\d\d\d.
:\d\d\d\d\d\d\d\d\d;
!\d\d\d\d\d\d\d\d}
then I launch tesseract with the config file over a tif, and it tells me "Error: failed to insert pattern " message, for the first two patterns. It ultimately acts as if no pattern has been issued.
I need to recognize only and ever that patterns, and tried to train a language with a number-dawg file, but then, when using tesseract command, I got a segmentation fault.
I used in the number-dawg file its conversion of the above patterns:
: .
: ;
! }
The questions, as the google documentation is not clear, and I do not speak english:
the patterns file, where have to be used? I suppose number-dawg has to be used during training, but I got seg fault so couldn't try with it, and user-patterns during recognition phase, when launching Tesseract, but didn't work. Where am I doing errors?
do I need a dictionary, also, when training with number-dawg? I have a digit and punctiation only set of possible characters, and all the possible numbers in the digits, a dictionary is not possible. If I need to use dictionaries, how could I do?
Thanks in advance for help, any hint would be very appreciated

Error invalid control sequence "a href=\”%s\”

I am translating a WordPress theme Magnovus using the default .po file in poEditor 1.6.3 on OSX Mavericks (free version). I got the following errors even when I copied the text over to the translation:
error invalid control sequence
the string I am translating is
You must be logged in to post a comment.
whether I copy it or translate it, I keep on getting this error.
I think the quotes are escaped properly here. Any ideas how to fix this?
This is a bug in Poedit 1.6.3 occurring for some (but curiously, not all) users on OS X Mavericks. It is related to OS X's Smart Quotes feature, which is on by default since 10.9.
It will be fixed in Poedit 1.6.4 and you can download a fixed build of 1.6.3 from http://www.poedit.net/dl/Poedit-1.6.3b.zip. You will need to manually fix the already-broken invalid translation to use \" (i.e. the "dumb quote"), but it won't happen again with 1.6.3b+.
(By the way: http://poedit.net/support.php)
Testing with poEdit 1.6.4 (and MacOSX 10.9.2), these errors of invalid control sequence continue to occur randomly (after fuzzy procedure). The place of errors indicated by red lines in screen table is not good. The only way to repair is to used a text editor and replace \” by \" !
Question : is a way to stop automatic fuzzy suggestion ?
M.
You should use: %s, not \"%s\".

Where is keywords code assist and letter not allowed problem(Aptana Studio 3)

I recently switched from Aptana2 to version3.0.3, and the first thing i did was to install the sdomcl. file to get jQuery code assist.It works fine for jQuery, but there is no code assist for many keywords.For exymple there is no support for var,while,throw,try,break,case,catch etc.
Also there is no function, instead intellisense sugests Function.
The second problem is that i am constantly getting this warning '<' + '/' +letter not allowed here when typing something valid like this:
confirmDiv =$("")-sorry for this,but it wont let me type what i want, basically i am just creating a new div with the correct syntax.
Could it be something with Html Tidy?Anyways, big thanks in advance!
Aptana Studio 3.0.4 includes code assist for JavaScript keywords.
I've read that for Javascript the slashes / must be escaped with backslashes \ as it says here
Doing so the warning dissapears ;)

Resources