windows error handling - octave

The problem is that i'm running octave on windows or least I think that's the problem.
I'm causing an error on purpose and what I'm trying to do is get the whole error message so that I can grab the full file path from it. pwd() is returning the home directory, not the directory the program is running from.
I've tried error.file but apparently that's not part of the error struct.
so here is a full sample:
try
err = make_error();
catch
msg = lasterror.file;
print(msg);
end_try_catch

You've read the documentation wrong. The structure returned by lasterror does not have a field named file. What does have is a field named stack, which is also a struct, which does have a file field. So what you're looking for is lasterror().stack.file. See the manual section about catching error.
Also, pwd() returns the working directory, not the home directory. You are either doing something else wrong or it's a bug with the windows version.

Related

The configName must be a non-empty string in KNIME

I am trying to see configuration page of the KNIME node which i just published to my KNIME analytics tool.
Getting error "Error while creating node dialog for 'Readadwords': The configName must be a non-empty string" where Readadwords is my node dialog class which i created in eclipse.
Either in my Nodemodel or Nodedialog there is not a single config and i have defaulted it some or other string value.
Can some one help me where to look to fix my error and also please let me know if i can debug my knime plugin from eclipse rather than doing it in Analytics tool.
Debugging is explained in their developer guide, this page is the most relevant for that.
When you save your settings you have not specified the key for your config, that is what this error message is about. Like in this place assuming "" were used instead of "colName", I would expect a similar error message.
Issue is KNIME is not picking up the changes i have done to the code and i had to change version in plugin.xml file then it started working after copying new jar file to dropins folder of KNIME

Octave error : no such file

I'm running Octave 4.0.1 on windows 7 and I'm having this weird issue.
I created a functioning script which is saved under C:/User/Documents/Octave. This script also reads some files in a subfolder of this same location.
The problem is : my script correctly runs TWICE then I have the error "no such file" saying the software did not find my script (the same one I just ran). The only "solution" I have is restarting the whole software but then it still goes nuts on the third run.
In addition to that, my coworker tried it on an ubuntu machine and it seemed to work fine. Do somebody see an explanation?
Thanks
Here is the script :
data = [];
figure();
for i=1:200
filename = strcat('C:/Users/Utilisateur/Documents/Octave/data/DAQ_data_decoded_', num2str(1800+i))
d=lvm_import(filename);
data=[data d.Segment1.data(:,2)];
end;
data=reshape(data,6600,1);
hist(data);
The function lvm_import is a function I found on the web to extract data from a Labview data file. (d.Segment1.data(:,2) is a 33x1 array)
And the error message :
>> daqDataHist
error: no such file, 'C:\Users\Utilisateur\Documents\Octave\daqDataHist.m'
So I still don't really know what was going on but by adding fclose all at the end of the script I got rid of any error and can run the file as many times as I want. It was probably something going wrong with opening and closing the .lvm files and it "jammed" at some point.
Thanks anyway :)

IDL undefined procedure

I'm using IDL 8.3 on Mac 10.9.3
I am running a script that calls in a procedure. The procedure I am calling in is contained in a directory that I included in IDL's path (I did this by going under IDL->preferences->IDL->paths and adding the directory). However, when I attempt to run the script, I get the error message: "% Attempt to call undefined procedure/function: 'procedure.pro'. % Execution halted at: $MAIN$". The weird thing is is that it still lists all the syntax errors in the procedure that is supposedly 'undefined'. Also, when I type the procedure.pro name into the IDL prompt, it lights up teal/blue color (meaning it recognizes the procedure).
I tried making a very simple simple.pro, put it into the same directory I mentioned before, typed it into the IDL prompt (it turned teal/blue), and it ran perfectly with no errors.
I am unsure why the procedure.pro file is 'undefined' since it is contained it its path, and I proved with simple.pro that .pro files in this path will run correctly.
A couple of things to check:
Is the routine called as a procedure and defined as a procedure (or called/defined as a function)?
Does the name of the file match the name of the routine?
well, the procedure I was attempting to call in contained other procedures/functions that weren't included in IDL's original library. I just had to download these separate procedures/functions, and the syntax errors went away, along with the 'unidentified procedure' error message.

GAS Libraries Fatal Flaw: "Library with identifier FOO is missing (perhaps it was deleted?)"

Question:
Does anyone else experience this problem? And if so, what is the solution or my best course of action?
Problem Statement:
Libraries Fatal Flaw: "Library with identifier FOO is missing (perhaps it was deleted?)" + "We're sorry, a server error occurred. Please wait a bit and try again."
Please provide a short description of the issue:
Running any function in my GAS project results in the following error message:
"Library with identifier FOO is missing (perhaps it was deleted?)"
If I try to make any changes to my libraries (under the Resources tab) including:
updating the library FOO to the latest version,updating a second library (let's call it BAR) to the latest versionupdating FOO or BAR to any other versionsdeleting FOO or BAR completely orturning off development mode for FOO or BAR (which are currently in development mode).
In short, any change to the library resources are met with the following error message:
"We're sorry, a server error occurred. Please wait a bit and try again."
I first observed this error message today.I have never seen this problem before since I started this project at least two years ago or more.
Please provide a small sample script that reliably reproduces the issue.
The sample should run as-is or with minimal setup, without external
dependencies.
function test(){Logger.log("A")}
What steps will reproduce the problem?
Delete all code in my project.
Copy and paste the above function named "test" into a script file in my project.
Attempt to run the above function named "test."
After attempting to run "test" and seeing the error message: "Library with identifier FOO is missing (perhaps it was deleted?)," open Resources > Libraries.
Attempt to update FOO to it's most recent version. Or make any change to any of the libraries.
What is the expected output?
After running the function "test" I expect to see that it has successfully completed and the logger reads "A."
After trying to update the libraries, I expect to see the new library version in the dialogue box.
What do you see instead?
I see the error message: "Library with identifier FOO is missing (perhaps it was deleted?)"
I see the error message: "We're sorry, a server error occurred. Please wait a bit and try again."
Please provide any additional information below.
I have created a new project (let's call it B), copied and pasted all the code from the problem project (let's call it A) to B and successfully integrated the FOO and BAR libraries (latest versions) into B. After doing so, B runs fine without any error. The problem is that all my scriptDB data is still stored in A. Without being able to run any functions from A, I can not export any of my data from A. Otherwise, I would attempt a "messy" workaround such as restarting with B and updating all my (3rd party) calls to A with calls to B, for example.
Summary from comments:
Per #SoftwareTester:
I also experience this problem. I created a new file, copied all my code, provided a new name the lib (so instead of 'var a = AAA.myFunction' I now use 'var a = BBBBBB.myfunction'), changed every name of function, variable and text into BBBBBB. But still I could not run my (short and easy) testscript because of the missing library. I noticed that I deleted an old version (version 1) of the library by accident. Maybe that created the problem. I can imagine that because of the versioning system (keeping track of every code changes) old code reffering to the deleted version-1 causes the problem.

Error handling. How should a program do it?

How should a program handle errors? Example:
A program needs the file text.txt. It must exist and be writable. What should it do if it's not writable or doesn't exist? Should it try to chown/chmod the file? Should it try to create it or just display an error message?
Or: Should it try to find a solution or just display an error message?
It's up to you how to handle it. You have to define your scenarios, user interactions, and other parts of the program. Once you define those it is time to implement and test those scenarios.
Some questions to ask:
What data is being written to the file?
How critical is it that the data get saved?
If an error is reported, who will see the error?
If an error is reported, how do you expect a user to react? And what are their options?
I would go with Eilon's answer for the most part but would add the following caveat - I would not try to chown/chmod a file, unless you really need to i.e. if the purpose of your program is managing file permissions or acting as an installer of some sort. This is because a) your attempted chmod/chown may not work and b) your application should respect the user privileges with which it is run - if these are not sufficient you should inform the user via whatever mechanism you do this.
Your program should output an error on STDERR and return with an exit code different than zero.
For more informations :
http://en.wikipedia.org/wiki/Exit_status