Max line length of 1023 in iESS (R in emacs)? - r

When I try to enter the line below into R in an iESS buffer, it doesn't work -- it prints out ^G and hangs until I press Ctrl-C. It's 1024 characters long. If I shorten the line by one character, it works as expected. Any suggestions on how to fix this? Thanks.
I'm using emacs 25.1 (9.0). ESS installed via spacemacs on macOS Sierra.
a=c("2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345678","2345780")

Related

What is /bin/[ in macos Big Sur? Don't remember seeing an executable like that before [duplicate]

This question already has an answer here:
What is the "[" binary file in my "/bin" folder for? (MacOS Big Sur M1 chip) [closed]
(1 answer)
Closed 1 year ago.
I was poking around a new MacBook Air M1 running Big Sur. I came across an executable file in /bin called "[". Seemed strange to me so I looked into it a bit more but the mystery remains. Google/DuckDuckGo searches are fruitless. I copied the file into my homedir to do some more investigation. Here's what I found:
user#jackrabbit(s003) ~ % file foo
foo: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit executable x86_64]
[arm64e:Mach-O 64-bit executable arm64e]
foo (for architecture x86_64): Mach-O 64-bit executable x86_64
foo (for architecture arm64e): Mach-O 64-bit executable arm64e
user#jackrabbit(s003) ~ % strings foo
#(#)PROGRAM:test PROJECT:shell_cmds-216.60.1
33333
$FreeBSD$
missing ]
unexpected operator
%s: %s
closing paren expected
argument expected
%s: bad number
%s: out of range
#(#)PROGRAM:test PROJECT:shell_cmds-216.60.1
33333
k#$FreeBSD$
missing ]
unexpected operator
%s: %s
closing paren expected
argument expected
%s: bad number
%s: out of range
user#jackrabbit(s003) ~ %
I tried running the executable with a few different arguments but didn't get any useful output.
Any ideas?
After some more thinking and poking around, it's a copy of /bin/test. It's got the same size and last modified time, so it appears to be part of the original OS install. Anyone with Big Sur able to verify if they also have /bin/[?

Baffling: println prints then the line erases in Atom for arguments>1e8

function foo(x)
n = 0
t = time()
while n < x
n += 1
end
sec = time() - t
println("done in $sec seconds $(x / sec) operations/sec")
end
foo(1e7)
I'm on Windows using Atom latest version of everything. I run the above code and it prints fine for 1e1,..., 1e7
But for foo(1e8) and above, it prints the line, and then the line DISAPPEARS. I'm completely baffled by that.
It only happens in Atom (VS Code works fine). I use control-enter on the foo(1e8) line to evaluate it and I can see it printing the line and then the line erases by itself. For foo(1e7) and below, it prints fine.
Here's the video of this with 1e8 then 1e7 and it happens on Linux too. As you can see from one of the attempts the video was able to capture the printing and erasing (see at 5 second mark in the video). When I changed to 1e7, it prints fine every single time.
everything is up-to-date: Julia 1.4.1, Atom 1.46, Juno 0.8.1 and I did a complete Julia package update as well.
github.com/JunoLab/Juno.jl/issues/560.
(credit to pfitzseb )

How do I clear screen in julia-app mac OS-X?

**How do I clear screen in julia-app mac OS-X **
In mac terminal - clear would clear the terminal screen.
How do I do the same in julia interactive app in Mac OS X?
Use keyboard shortcut: Ctrl + L.
Use Julia's REPL shell mode:
julia> ; # upon typing ;, the prompt changes (in place) to: shell>
shell> clear # unix
shell> cmd /c cls # windows
If you need a function you could use the run function:
julia> ? # upon typing ?, the prompt changes (in place) to: help>
help?> run
INFO: Loading help data...
Base.run(command)
Run a command object, constructed with backticks. Throws an error
if anything goes wrong, including the process exiting with a non-
zero status.
julia> using Compat: #static, is_unix # `Pkg.add("Compat")` if not installed.
julia> clear() = run(#static is_unix() ? `clear` : `cmd /c cls`)
clear (generic function with 1 method)
julia> clear()
This works in a platform and version independent way (tested in Windows and Linux, Julia versions 0.3.12, 0.4.5 and 0.5.+).
Try Ctrl+L if you want to clear the screen the interactive shell runs in. Same as bash.
A partial answer
Create a function clear() to print new line characters
clear() = for i in 1:20
print("\n")
end
Then invoke the function
clear()

ESS produces "Variable binding depth exceeds max-specpdl-size"

I am trying ESS (Emacs Speaks Statistics).
The problem is: Ctrl-P and the up-arrow are disabled on any buffer because of the following error:
Variable binding depth exceeds max-specpdl-size
The trigger is the following line in .emacs.el
(require 'ess-site)
This line is needed to load ESS. If I delete this line, then the problems does not happen, but, obviously, I can't use ESS.
Notes:
"(setq max-lisp-eval-depth 10000)" does not solve the problem.
"(setq max-specpdl-size 32000)" produces a different error:
Lisp nesting exceeds `max-lisp-eval-depth'
When the above two settings are valid, then I get the error for max-lisp-eval-depth.
This problem happens before M-x R RET. For example, it happens on the scratch buffer just after emacs starts.
I have not found any other key with this problem. (So Ctrl-F and down-arrow are working, for example.)
Deleting the ESS buffer does not solve the problem.
The initial message on the ESS buffer is following. (I don't know, whether it is useful.)
[ess-site.el]: ess-customize-alist=nil
[ess-site.el 2]: ess-customize-alist=nil
(S): ess-s-versions-create making M-x defuns for
(R): ess-r-versions-create making M-x defuns for
Environment:
emacs-ess-15.03.1-1.3.noarch
emacs-24.3-17.2.10.x86_64
R-base-3.1.1-2.1.9.x86_64
openSUSE 13.2 (Harlequin) (x86_64)
You could try
(setq max-specpdl-size 32000)
M-x describe-variable max-specpdl-size for some info
I've had this problem with python-mode and rope, never with ESS though.
Solution: change the order of certain settings.
My .emacs.el has settings for smooth-scrolling (A)
(require 'smooth-scrolling)
(setq smooth-scroll-margin 5)
and for the initial file (B)
(find-file "~/init.org")
(A) should be loaded before (B). (B) was loaded before (A) in my previous .emacs.el and this causes the problem. (I do not know the precise reason for the error which I described in my question.)

How to limit the number of output lines in a given cell of the Ipython notebook?

Sometimes my Ipython notebooks crash because I left a print statement in a big loop or in a recursive function. The kernel shows busy and the stop button is usually unresponsive. Eventually Chrome asks me if I want to kill the page or wait.
Is there a way to limit the number of output lines in a given cell? Or any other way to avoid this problem?
You can suppress output using this command:
‘;’ at the end of a line
Perhaps create a condition in your loop to suppress output past a certain threshold.
For anyone else stumbling across:
If you want to see some of the output rather than suppress the output entirely, there is an extension called limit-output.
You'll have to follow the installation instructions for the extensions at the first link. Then I ran the following code to update the maximum number of characters output by each cell:
from notebook.services.config import ConfigManager
cm = ConfigManager().update('notebook', {'limit_output': 10})
Note: you'll need to run the block of code, then restart your notebook server entirely (not just the kernel) for the change to take effect.
Results on jupyter v4.0.6 running a Python 2.7.12 kernel
for i in range(0,100):
print i
0
1
2
3
4
limit_output extension: Maximum message size exceeded

Resources