DrRacket Contract Violation - racket

I installed DrRacket so I can learn programming concepts using SICP. But for the past week or so, every time I launch DrRacket the console windows comes up with the following message:
fl-:contract violation
expected: flonum?
given: 0
argument position: 2nd
other arguments...:
2.0
I am not sure how I got here. I tried uninstalling and re-installing as 32-bit and 64-bit, restarting my laptop, searched forums for a possible fix. No luck. Just want to get back to my normal window where I can type in code. Thanks.

hope u found the answer. For my case, I found out that from a file I had been working on, and my computer shut down unexpectedly, there were three files associated with the initial file name - upon resuming Windows. The file extensions were .rkt (original), .bak and .1. I renamed the '.1' file as a second copy of the original and the 'contract violation' problem ended. It appeared the '.1' file was due to the laptop shutdown and was the auto-retrieve file.

Related

Strange source command when start Julia REPL

I am a bit fresh to Julia (and stack overflow), so it might be a dummy question. I am using VS code in ubuntu 18.04.
Every time I start Julia REPL from VS code (Ctrl+shift+P, then "Julia: Start REPL"), the Julia REPL starts with a strange command "source /home/$user_name/bin/activate" and then an error (of course source is not defined in Julia) :
ERROR: UndefVarError: source not defined
Stacktrace:
[1] top-level scope
# REPL[1]:1
This problem was shown a couple of weeks ago but it does not affect my code at least for now. I have tried to search the problem but haven't found any similar questions. Any hints on what's going on? Many thanks!
Edit:
I think I might have used Conda somewhere.
Do "which Julia", I got:
/home/$user_name/julia-1.7.2/bin//julia
There is no "/home/$user_name/.julia/config/startup.jl" file, all the directories under "/home/$user_name/.julia/" are as follow:
artifacts compiled dev logs prefs scratchspaces
clones conda environments packages registries
Then I found a "startup.jl" file under "$JULIA_INSTALL_FOLDER\etc\julia\startup.jl", with following content (seems like not helping on my problem).
# This file should contain site-specific commands to be executed on Julia startup;
# Users may store their own personal commands in `~/.julia/config/startup.jl`.
Solved by following #SundarR's suggestion.
The problem was caused by the VSCode-Python extension installed.
Please see the comment above for the details and thanks again!

Unable to start VSCode; suggestions for debugging?

I'm working on a disconnected network, so some options are a bit limited. Also, we have SAs who handle stuff like system updates (so, for instance, it is possible that there was a system update in there that I know nothing about).
However, I had 1.33.1, then 1.34.0, then 1.38 versions of VSCode working on my (Windows 10) machine. One day, for no apparent reason (I hadn't just installed something, for instance), 1.38 stopped working. It wouldn't even start up. Running 'Code --verbose' from the command line produced no output (the mouse cursor turned briefly to a spinner, but nothing even showed up in Task Manager, let alone something like a splash screen).
I did get an error message in the Application log, which included the lines (more or less; remember, no cut-n-paste possible):
Faulting Application Code.exe, version: 1.38.0
Faulting module ntdll.dll, version 10.0.16299.936
Exception code: 0xc0000374
Faulting Application path: c:\Program Files\Microsoft VS Code\Code.exe
Faulting module path: c:\Windows\System32\ntdll.dll
Re-installing VS Code (with or without system restart after uninstall) did nothing.
Removing all extensions (we have a bunch) did nothing
Installing 1.39.2 did nothing
The only good thing is that I can still run 1.34.0, if I reinstall that (did not try 1.33.1, and I don't have any in-between versions from 1.34 to 1.38 to try). So at least I'm not completely shut out.
I also tried deleting basically all of workspaceStorage, to no effect. Nor did renaming my storage.json.
The biggest weirdness, to me, is that the path to ntdll.dll is in System32, rather than in SysWOW64 (is there some way to force usage of the latter?). Second, why did 1.38.0 work just fine for a while, and then stop.
So, I'm curious if anyone else has seen this problem, and/or if anyone has any idea what else could be done to get more insight into what's causing this.
(edit: I plan to file bug for VSCode, but been waiting on confirmation email to finish creating my github acct for some time now. sigh)
I've had exactly the same problem twice. I'd been running the application since June 2019 and then in March of this year, Yep! Exact same problem as you encountered. A simple reinstall fixed that, but I've had the same problem again today and after some investigation, Windows 10 was telling me that I didn't have the right permissions to access the item (this is using the Owner's account!). Attempting to reinstall failed, with errors stating that the file / directory all ready existed and couldn't be overwritten or renamed. Attempting to un-install the application was only partially successful with the executable code.exe still remaining afterwards. The only way I managed fix it this time was to reinstall to a directory with a different name. Surprisingly though, all the existing workspaces, projects and extensions even were intact and the application opened where I had left off as though nothing had happened. This is a little worrying I have to say! But that's how I fixed it this time.

Is there a way to retrieve user settings from a corrupt VS Code?

I have Visual Studio Code 1.27.2 on Windows 10.
Background:
Recently there was an issue in the system not related to VS, and I had to run system repair which seems to have messed up with the settings of various programs, including VS.
Current situation:
Now when I open VS I get this:
title bar of VS with 'Unsupported' at the end
warning: "Your Code installation appears to be corrupt. Please reinstall."
According to the official FAQ, this can be due to fishy extensions. But this seems unlikely given that the last extension I installed was more than a week before this incident, and more importantly because of the system-wide settings shake-up.
Main issue:
When I try to access settings directly, I get another strange error:
warning: "Unable to open 'User Settings': e.replace is not a function (2 errors in total)."
This function didn't look familiar so I looked it up and it was in the doxygen code, which has not changed for weeks, so also don't think this is the real issue.
I tried the suggestions here but there was nothing found in my folders.
I plan on re-installing in all cases. It's not the end of the world if the settings are gone, but it would be great to ensure they are saved because I spent a lot of trial and error customizing them.

Why is matlab's psychtoolbox failing to detect the Screen mexfile when running AssertOpenGL?

I've managed to install the psychtoolbox-3 from the NeuroDebian repository without any explicit errors, but running AssertOpenGL yields this very verbose error message.
My system specs are as follows: Intel-based PC with Ubuntu 12.04 LTS
I've tried adding ~/Documents/MATLAB and all it's subdirectories to the Matlab pathdef, as this is where I pointed the DownloadAdditionsForNeuroDebian function to. Similarly, I've tried adding /usr/share/octave/site/m/psychtoolbox-3/ and it's subdirectories to the matlab path as well.
The error seems to be originating from a failed call to Screen; according to the above error message, Screen can't be found. That having been said, I'm able to run Screen at the Matlab console, although I get this error:
>> Screen
In place of the expected mex file this placeholder file was executed:
Screen
This mex file seems to be missing or inaccessible on your Matlab path or it is dysfunctional:
Screen.*
Hmm. I cannot find the file on your Matlab path?!?
One reason could be that your Matlab path is wrong or not up to date
for the current Psychtoolbox. You may want to run SetupPsychtoolbox to
fix possible path problems.
??? Error using ==> AssertMex at 210
Missing or dysfunctional Psychtoolbox Mex file for this operating system. Read the help text above carefully!!
Error in ==> Screen at 161
AssertMex('Screen.m');
Running SetupPsychtoolbox yields an error that is very similar to the first one.
I tried installing the suggested packages, but they were all already installed -- nothing seems to work.
I have absolutely no idea where to go from here. Does anyone have any suggestions?
The SetupPsychtoolbox command seems to have a bug. What is happening for you (and for me, when I tried this) is that the folder containing Screen.mex is being placed at the bottom of the search path. Here's how to fix;
type "pathtool" at the Matlab commandline
find the PsychtoolboxAddons entry and move it to the top (for me this was /usr/share/psychtoolbox-3/PsychtoolboxAddons)
If you don't have a folder PsychtoolboxAddons you may need to follow the instructions at http://docs.psychtoolbox.org/DownloadAdditionsForNeuroDebian
Don't forget to move your personal Matlab directory to the top also (the SetupPsychtoolbox command moves your personal directory to be underneath it's directories, which is a bit mean).
Save the path. Don't ever run SetupPsychtoolbox again!
Good luck!

Runtime Error in Visual Simulation Environment - Microsoft Robotics Studio

I am using Microsoft Robotics Studio for a school project and I am getting a strange error when I try to run the Visual Simulation Environment. It was working fine until yesterday and then suddenly it gave me a runtime error saying "Illegal command line arguments... do not use VPLHost directly, use dsshost instead to run a manifest" But I am only clicking on Run in VPL/DSS Manifest editor.
I am running MRDS as administrator and I even tried re-installing MRDS but it is still showing the same MS VPL Runtime error. I tried to search online, but cannot find any suitable solution.
I already tried running the existing samples, I.e. Urban Environment, Multiple Simulated Robots etc. but it still gives me the same error. The strange thing is that it was working perfectly one minute, and then started giving me this error message the next minute, when I had not changed anything in between. In fact, I had wanted to change something in my manifest, so I closed the running VPL application, closed VPL and opened DSS manifest editor, and ran my manifest and that is when I got this error.
What is going wrong? Is some MRDS script using vplhost32.exe instead of dsshost? If so, then where and how do I change it?
I tried running the urban envrionment manifest from the command prompt and Using DSSHost32 directly. This time, it didn't give me a runtime error but an intiialization error. I tried changing port numbers but it still doesn't work. I have deleted many files from my computer to free space (JIC) and it still doesn't work. The window just doesn't open even when I hover over it in Windows 7.
The error message looks like this: Only one usage of each socket address (protocol/network address/port) is normally permitted."
This was even after I checked netstat for free ports and tried but I get this error message. Its either this one or the "Don't use VPLHost directly" if I run it through VPL or DSS Manifest Editor.
Could it be that some external services are interfering with DSSHost/VPLHost? Are there any such services which I could try killing? ANY help/suggestion would help right now as my project is due Thursday and this is a really unfortunate time for it to be acting up like this.
Does the problem reproduce after logging off & logging back on? It's likely that you had a process hanging around that you weren't aware of. Logging off should shut down any processes you personally started.
I don't know the solution of your problem, but it would be better that you post your question on the link below:
http://p2p.wrox.com/book-professional-microsoft-robotics-studio-isbn-978-0-470-14107-6-410/
[official forum for the book : Professional Microsoft Robotics Studio], i hope you will shortly get reply there,
The other option is to post your question on the msdn forum,
http://social.msdn.microsoft.com/Forums/en-US/category/robotics
hope this would help....