Executing .m file with Octave GUI command window leads to error: no such file - octave

I'm pretty new to working with Octave (v 6.1.0) and could not figure out what's the problem with executing a .m-file via command window yet.
Octave is installed locally on my computer.
My working directory is in subdirectory on a server. The hierarchy of that server is like:
Server:/access/access/no_access/no_access/access/my_working_directory
With octave I can open and edit the scripts in my_working_directory.
Using the pwd command in the octave command window also returns: Server:/access/access/no_access/no_access/access/my_working_directory
When i want to execute the .m script I receive an error like:
error: no such file 'server:\access\access\file2execute.m
It seems like a path for the ocatve command tool is not set correctly, therefore it's searching in the wrong folder for the script.

Seems like Octave has problems with a path including spaces like:
Server:/access/access/no_access/no access folder/access/my_working_directory
If it's not possible to change the folder's name, you can mount the "my_working_directory" folder as a new drive of your computer (win explorer > computer > map network drive).
After that, open Octave again and change the working directory using the new path with the mounted folder. This worked for me.

Related

Problem with the command-line JSON processor JQ in Windows 10, 64 bit

I have downloaded the program jq-win64.exe from 'https://stedolan.github.io/jq/' and installed the program in a folder C:\Program Files\jq\ on my computer.
I have also added the PATH to the program to the end of the systemvariable string in Windows 10 : . . . ;C:\Program Files\curl\;C:\Program Files\jq\
In one terminal window in Visual Studio Code I am running a server.
In another terminal window I am trying to execute the command curl -s localhost:3000 | jq
Terminal window 1:
C:\Users\SteinarV\PROFF_JAVASCRIPT\PROJECT\smartHouse
node server.js
API running on port 3000
Terminal window 2:
C:\Users\SteinarV\PROFF_JAVASCRIPT\PROJECT\smartHouse>curl -s localhost:3000 | jq
'jq' is not recognized as an internal or external command,
operable program or batch file
... and do not understand why jq is not recognized.
Can someone help ?
I have downloaded the program jq-win64.exe from 'https://stedolan.github.io/jq/' and installed the program in a folder C:\Program Files\jq\ on my computer.
As you have indicated, you have a file called jq-win64.exe but you are trying to execute the command jq. You either need to rename the file to jq.exe or you need to use the command jq-win64.
For a detailed explanation of how Windows finds and executes a program in your path when you enter a command, see The Windows NT Command Shell: Command Search Sequence. Specifically:
...The shell now searches each directory specified by the PATH environment variable, in the order listed, for an executable file matching the command name. If a match is found, the external command (the executable file) executes...
...If the command name does not include a file extension, the shell adds the extensions listed in the PATHEXT environment variable, one by one, and searches the directory for that file name. Note that the shell tries all possible file extensions in a specific directory before moving on to search the next directory (if there is one)...
You indicate in the comments the same error persists even when the filenames match. Note that each running program has its own set of environment variables, and these aren't updated by global changes. You need to close and reopen cmd.exe windows after making a global change. See also Adding directory to path environment variable in windows. You can use the path command to verify whether a particular terminal session has inherited the PATH variable you defined, thus narrowing your problem.
You indicate that the problem still persists. You need to use the tools available to you to narrow it down further:
Try running the program with its full path:
"C:\Program Files\jq\jq-win64.exe" --help
This will confirm that the program is present where you think it is and can be run from the terminal.
Try running the program with no path and its extension:
jq-win64.exe --help
If this works but running the program without an extension doesn't, you might have set PATHEXT to something that doesn't include ".EXE".
Try setting the path explicitly in the terminal to contain only the program directory and nothing else, then run it with its full extension:
set PATH=C:\Program Files\jq
jq-win64.exe --help
(Note that after this test you'll need to close the terminal window and start a new one to reset the path.)
If this works, perhaps you have a mismatch in your path.

How to run a program from Files, coded using MonoDevelop, Gtk#, Ubuntu

I wrote my HelloWorld.cs using MonoDevelop, and Gtk# 2.0. It runs fine in the debugger, and it builds HelloWorld.exe. When I run from a terminal window "mono ./HelloWorld.exe" then the program runs as expected so I know it is coded as expected. However when I attempt to run it by double clicking on it from Files (Linux version of Windows Explorer) it opens Archive Manager with an error "An error occurred while loading the archive".
I am using Ubuntu 18.04.02 LTS, if that makes a difference.
I tried creating a link "ln -s ./HelloWorld.exe ./meow", and double clicked on meow, however that also opens Archive Manager with the same error.
I don't want my end product to require the user to open a Terminal window to run my program, what do I do so that the user can double click on my program from Files to run?
EDIT: [18FEB2019]
Thanks Some programmer dude, I like the bundle idea as I may port this project to a different flavor of linux and I hope this gives me a path to get there.
However, I got error:
Failure to load i18n assemblies, the following directories were searched for the assemblies:
Path: .
In Custom mode, you need to provide the directory to lookup assemblies from using -L
ERROR: Couldn't load one or more of the i18n assemblies: Failed to load I18N.dll
I searched and found
https://www.mono-project.com/docs/tools+libraries/tools/mkbundle/
I followed those directions and got stuck at this part
mkbundle -o CacheServer --cross mono-5.8.0-ubuntu-16.04-x64 CacheServer.exe --machine-config /etc/mono/4.5/machine.config
my error is
ERROR: Unable to load assembly `gtk-sharp' referenced by `/home/amccombs/Projects/HelloWorld/HelloWorld/bin/Debug/HelloWorld.exe'
I tried
mkbundle --fetch-target gtk-sharp
with result
Failure to download the specified runtime from https://download.mono-project.com/runtimes/raw/gtk-sharp
I then tried
sudo apt-get install gtk-sharp
with result
E: Unable to locate package gtk-sharp
Files is detecting the .exe extension as an archive, and therefore it opens it with File Roller or similar.
Just right-click the file HelloWorld.exe and select "Open With Other Application", click on "Find New Applications", and then type "mono" and press ENTER. The app will open.
Another possibility is to create a .desktopfile, and place it under ~/.local/share/applications, with this contents:
[Desktop Entry]
Exec=mono %F
MimeType=application/x-ms-dos-executable;
Name=mono
NoDisplay=true
Type=Application
MKBundle creates a native app from a mono application. The downside is that you have to compile both the app and all its dependencies, which can be tricky. In any case, the package you are looking for is gtk-sharp2.
An alternative to MKBundle is to include a text file, say HelloWorld.sh with the contents:
mono HelloWorld.exe
And then make it executable with:
chmod +x HelloWorld.sh
You can then pack both files together (use a .tar.gz target, which preserves attributes such as the executable one), and probably with a README file explaining to double-click HelloWorld.sh.
Or maybe you can pack the .exe with the .desktop file, and explain in the README file where it must be placed.
There are tons of possibilities.

xxx.mex: failed to load: No such file or directory

For some time, I've been using some .mex files I created. Now I have a new computer. I copied all the files over and reinstalled Cygwin and Octave. When I try to execute any of the .mex routines I get a message like:
error: testm: /cygdrive/c/A/Cwin/...../quad.mex: failed to load: No such file or directory
The file is definitely there and I'm having no trouble loading .m files from the same directory. It does not say there is anything wrong with the file. I'm guessing this is some sort of configuration problem. I am running Octave 4.2.1. When I start it, I get the following message:
Octave was configured for "x86_64-unknown-cygwin".
Could that have something to do with it? I think I'm developing x64 paranoia, since all my Excel .dll macros no longer work either. Thanks.

Strange response (about MySQL) for heroku login on windows (closed)

I have heroku toolbelt installed on Windows7 (x64 HomeEd). When i'm trying to login to heroku, i recieve strange message about MySQL (though MySQL already works fine with all software installed):
Microsoft Windows [Version 6.1.7601]
(c) Microsoft Corp., 2009. All rights reserved.
C:\windows\system32>heroku login
"MySQL" is not recognized as an internal or external command,
operable program or batch file.
"MySQL" is not recognized as an internal or external command,
operable program or batch file.
C:\windows\system32>
Exactly like shown - two times. As I found, heroku.bat does not invoke MySQL at any step. I think that OS runs some script (a kind of autoexec) just before or in parallel with heroku.bat, but i can't find the way used to do this. This is confirmed by the fact that when i start the other bat files the same two messages about MySQL appears.
Can you help me find how that strange script is invoked?
Detailed research shown that the reason is MySQL component, named "MySQL Fabric 1.5.3 & MySQL Utilities 1.5.3 1.5". During installation MySQL added it's location to Path environment variable. This caused to break Path variable contents with "&" symbol and any invocation of Path variable cause error
It seems that at some point a script tries to call MySQL.exe and this file can't be found. To solve this problem you should add the Directory containing MySQL.exe to %PATH%. First make sure MySQL.exe is located on your system. If you are not sure where it is, start CMD, go to your root directory (CD \) end enter dir /S MySQL.exe. This will search your drive for the file and show you the path, where it can be found. Save the path somewhere.
Now that you know where the file is is, you have to add it's location to %PATH%. To do so enter setx PATH "<NEWPATH>;%path%;" where is the path to the directory containing MySQL.EXE. Dont forget ;%path%;, this is very important. If you don't put it there it wil mess up your %PATH%.
Close the console, open a new one and type heroku login. This should fix the problem.
Now if you are not interested in fixing the error and just want to know where it comes from, you should post the code of the batch file that is executed by calling heroku login.
Just remove the C:\Program Files (x86)\MySQL\MySQL Fabric 1.5 & MySQL Utilities 1.5\;C:\Program Files (x86)\MySQL\MySQL Fabric 1.5 & MySQL Utilities 1.5\Doctrine extensions for PHP\; from your path (It is breaking things up, it gets added during MySQL installation)and add the MySQL bin path. For me it is C:\Program Files\MySQL\MySQL Server 5.7\bin

How do I extend the $PATH that Sublime Text 2 uses?

I just installed Sublime-jshint (and the requisite node.js + jshint) but get this error when I try to invoke JSHint from within ST2:
[Errno 2] No such file or directory
[cmd: [u'jshint', u'PATH-TO-THE-JS-FILE-I-AM-LINTING', u'--reporter', u'/home/cmg/.config/sublime-text-2/Packages/JSHint/reporter.js']]
[dir: DIR-MY-JS-FILE-IS-IN]
[path: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/cmg/bin]
[Finished]
The final item in the given path is in the home dir of my user (cmg), so it's been customized somehow... but I don't recall how, so I don't know how to add the dir I need (~/node_modules/.bin).
I've added it to $PATH in my shell (via both .bashrc and .bash_profile) but ST2 doesn't pick it up.
(I'm on Ubuntu 14.04. All the usable stuff I've found via Google on this subject has been either OS X specific or related to ST's build system).
Basically, the exec command, which the jshint package uses internally, allows you to set/extend the PATH of the spawned subprocess. (docs)
The package actually uses this path argument on OSX, but has it hardcoded (I am partly guilty of that as I rewrote the command because it was just horrible before). It should allow for a setting to specify the path to your jshint executable, so I suggest you create an issue for that.
I don't know why ST dosn't pick up your PATH from somewhere else since I have very little experience with that.
Open /etc/profile in Sublime (using sudo) and add the following line at the very bottom:
export PATH=/home/cmg/node_modules/.bin:$PATH
and save the file. Restart completely, and your PATH should be updated.