GHCI character limit? - haskell

I'm using ghci to do some incremental development using Emacs' run-haskell. Every once in a while, I get an error that looks like
<interactive>:[line]:[character]: _Lexical error at character '\EOT'
Setting up an intermediate variable or two gets a working response, and the file I'm working on both loads and compiles properly. Reducing character count also works; the max I seem to be able to hit is 252.
Anyone have an idea of what's going on?

This was filed and closed as a bug in GHC several years ago, so looks like no dice on fixing it at the GHCi end. (Searching "_Lexical error at character '\EOT'" gives a few other results (for example), but I can't work out how applicable they are.)

Related

explain what is missing from 10print

10 PRINT CHR$(205.5+RND+(1));:GOTO 10
I seem to be the only person ever to not be able to do this. i have written all kinds of BASIC but I can't do anything with this. What am i missing?
I get "SYNTAX ERROR IN 10"
i can't get it to work And really, why would it? 205 is a memory address and so the value of 5 in and we have random number thing going but where does the pattern come from. Don't we need? "/" "\ ".
205.5 produces these/??? that doesn't make any sense. I must have an extreme misunderstanding of computers and BASIC that curiously doesn't prevent me from creating functioning programs.
I also program in C and I am still completely clueless. never seen anything like this work seems like there is a hidden line 1,2,3,4,5,6,7,8,9, that wasn't listed so I don't know what the rest of the code is???
I've tried on the 64mini and several emulators and they all give the same error.
Did I have a stroke and need to goto the hospital? maybe I can no longer discern what I see on the screen Lol.
10 PRINT CHR$(205.5+RND+(1));:GOTO 10
As pointed out by teapot418, you have a typo in your code. The exact code is:
10 PRINT CHR$(205.5+RND(1)); : GOTO 10
CHR$ creates the ASCII character for the given number. (What you wrote about reading from address is PEEK.)
CHR$(205) gives you the "\" and CHR$(206) the "/". The floating part of the number gets ignored. Because of the randomness, you get random sequences of CHR$(205) and CHR$(206) which creates the maze. The ; at the end of PRINT avoids a newline.

How to debug when vim writes random files

I have a weird hard-to-localize issue with vim. It's almost certainly a weird custom configuration that is my fault, but I don't know (1) what I should be looking for and (2) how to reproduce it. I don't know if anyone will be able to help, but its been plaguing me for years, so I thought I'd at least make a post about it.
The issue is that after using vim, I occasionally find weird files in the directories I was working. The file names were usually characters I was typing. I have absolutely no idea what is triggering this, and it doesn't happen that often, so its hard to simply comment out a piece of my vimrc check if it occurs and narrow it down that way.
Examples of the file names I get are:
= np.diff(bins)
ep='')
= {
(shape0, device=device"
_rect = cv2.undistortPoints(left_corners, cameraMatrix, distCoeffs)
elf.alt_fc = nh.layers.MultiLayerPerceptronNd(
=feat_dim, noli=swish,
hape0 = (
ys, ubelt
tates, evidence=evidence)
ample_input = torch_encoder_result
tack = kwimage.stack_images(imgs, axis=1, resize='smaller')
hear_range=(-10, 10)
There is nothing in common between the files names that I can see. The majority have an "=" and a paren, but not all. I really have no idea how to reproduce this error. I feel like I must have a habit of hitting an incorrect key stroke that causes this issue, or there is some plugin doing something weird, or I have a crazy configuration (which I do).
The contents of the files varies. Sometimes they look like git differences. The one from the first example was the page for "less --help" (yes I grepped for that). Another is what looks like a docstring for a python class (I'm not 100% sure if this only happens with Python files, because most of my vim usage is Python).
Any tips that anyone has for how to further debug this would be appreciated.
Just for reference this is my vimrc: https://github.com/Erotemic/local/blob/master/vim/portable_vimrc and it does reference and source several other files in that repo, so I don't expect anybody to be able to parse it and figure it out.
If I was to take a guess I'd say its probably an auto-commands that's doing it, and I do have all of those auto-commands defined in this file: https://github.com/Erotemic/local/blob/master/vim/rc_settings/autocommand_settings.vim but I don't see anything that would cause this issue.

AutoPEP8, Anaconda, Sublime Text 3 Inconsistent Error Reporting

Please reference the attached screenshot.
I am working on a scrapy pipeline. I am using Sublime Text 3 with Anaconda/AutoPep8. I just moved over from ST2 where I did not have AutoPep8 or Anaconda.
The huge white dot is telling me that this line has invalid syntax. I could not figure out what the problem was, so I copied the line and pasted it here on line 1 of what was then an empty file. The syntax error still showed, suggesting it was not a problem with a prior line missing a closing parenthesis.
Then I made up some similar code, lines 3, 6, & 9. As you can see, they all pass muster. (I don't care about the other little errors, they are not the issue).
Then I pasted in the entire method over onto this new document, and now, as you can see, even the suspect line (22) passes.
Then I copied and pasted the whole class, and again, as you can see, line 49, the code it was complaining about before now doesn't cause any issues at all.
I tried using the command palette - PEP8: Preview Changes, (see https://github.com/wistful/SublimeAutoPEP8) but nothing happened.
I also tried the right click menu Anaconda > Autoformat PEP8 Errors but the E501 errors (line too long) were ignored and nothing happened with the supposed syntax error in the if statement.
Note: When I first started using AutoPep8 to fix E501 errors last week, I noticed that about halfway through a script, it suddenly stopped reporting errors at all. Don't know if this is related.
I also get this error when ST3 starts: https://github.com/DamnWidget/anaconda/issues/514. However, the consensus seems to be that if Sublime works even after you click through this error, it is nothing to worry about. I just mention this to give you as much as I know so you can help.
I also tried turning len('advocate') into a string, but the syntax error remains.
What is going on here? Is there a bug in Anaconda, AutoPep8, ST3, or my code?
Ubuntu 16.04, Python 3.4, (but 'automatic' build in ST3) ST3 Build 3126 (I don't know how the Build number lines up with a version number) Anaconda, AutoPep8 version numbers unknown, but I got them less than two weeks ago.
Well, it took a lot of very patient Googling and a comparison test in VSCode, but I have the astoundingly simple answer: I should have put '==', not '=' ! Yes, dear friends, it is basic Python. = means assignment, == mean equality or comparison. My if is of the latter type, because you can't make an assignment in an if statement. Now VSCode didn't make this any clearer, I think they both use Pylint, but it at least let me know that this was probably a valid error, whether I understood it or not. (Unless of course I know more that the devs at Pylint...Yea, not likely).
Kudos to Jean Mark Gawron, (who must be related to the Klingon Emperor) for giving me the answer: http://gawron.sdsu.edu/python_for_ss/course_core/book_draft/programming_intro/boolean_results.html

LaTeX document errors where no errors exist

I am writing my thesis with LaTeX and since today very curious errors turn up. I wrote something and made a citication in the file references.bib, and then the errors turned up. Befor writing that few lines everything worked great. Thus, I deleted everything I've added. But the errors still turn up. One Error is: Extra }, or forgotten $. ...ckoverflow Permission SYSTEM_ALERT_WINDOW}. I think my citication (which I've deleted after the errors turned up) is still stored somewhere , because "ckoverflow Permission SYSTEM_ALERT_WINDOW" was a part of the title of the cite.
I hadn't found any error in any file.
The next weird thing is that a mate of mine can compile that files without any problems. He is using WinEdt. I am using TeXStudio, but I've tried it with WinEdt, too.
There is a screenshot of my errors:
Please help me, any suggestions are appreciated.
Best regards
Looks like you might need to escape your _ characters there, as they are normally used for subscript, but only in math mode; hence the "missing $ inserted".
(La)TeX error messages make me sad... :(

ghc-mod only shows first line in *GHC info*

I am using emacs (24.3.1) in haskell-mode together with ghc-mod to play with Haskell.
Now everything works fine aside from one annoying thing:
Every output in the GHC info buffer contains only the first line.
For example when I ask for ghc-show-info (let's say on sqlSettings from persist) I get this:
while Interactive-Haskell works fine:
This happens with everything: infos, errors, warnings, etc.
Right now I have no clue what is causing this issue as it seems that ghc-mod in emacs is parsing the output wrong.
Maybe someone can help me get all the info.
Thanks
PS: maybe this one shows the problem a bit better:
instead of
It might be this bug https://github.com/kazu-yamamoto/ghc-mod/issues/297
It has been fixed recently with ghc-mod >= 4.1.6

Resources