Undefined variable in execution of octave code - octave

When the following simple code is executed:
function u=complexu(z)
u = zeros(size(z));
u = z+exp(-1*z)+z*z;
end
The output is as follows:
tester
error: 'z' undefined near line 2 column 18
error: called from
tester at line 2 column 5
The name of the file that contains the function is tester.m. I have ensured that the current directory contains all the files of interest. I still can't figure out why this problem is occurring. Any help is appreciated.

Related

getting factory.php line 321 error during composer installation

In Factory.php line 321:
"./composer.json" does not match the expected JSON schema:
- name : Does not match the regex pattern ^[a-z0-9]([_.-]?[a-z0-9]+)*/[a-z0-9](([_.]|-{1,2})?[a-z0-9]+)*$
firstly try to do from c derive then again tried with E drive but still same error.
You need to set a name like "vendor/package_name" =)

Issue while accessing data from Octave dataframe

I am trying to access data from a dataframe in Octave which satisfy some criterias.
Let us say dataframe name is A with comulns 'Date' and 'Close Price'.
Let us say we intend to access Close prices when Close Price was less than 5.
I am using the command:
A.Close(A.Close<5)
I am getting the following error:
error: subsref.m querying name Close returned positions 5
subsref.m querying name returned positions
I see an instruction video in youtube, where same command is used but no error showed up.
I cannot reproduce the problem. Are you sure your dataframe is correctly initialised?
pkg load dataframe
A = dataframe( [1,2;3,4;5,6;7,8], 'colnames', { 'Date', 'Close Price' } );
A.Close( A.Close < 5 )
% ans =
% 2
% 4
I suspect your error may have to do with the fact that your column name is Close_Price, but you tried to index it via 'Close'. Do you have any other columns that start with the word 'Close' by any chance?

delete all cache file in cakephp 3

I want to delete all file from /tmp/cache. My code spinet is below:
\Cake\Cache\Cache::delete();
but it gives the error below:
-Error: Too few arguments to function Cake\Cache\Cache::delete(), 0 passed in G:\xamp727\htdocs\bootique_api\src\Controller\PagesController.php on line 94 and at least 1 expected
If you want to delete all use clearAll() method. method doc

CuSolverRf sample sorting error

I'm having trouble with the CUSolverRf sample to solve a sparse 196530 x 196530 with 2530239 nnz matrix.
I've not tried with B vector values yet (a problem for another time) and I already have an error:
Error (sorting of the column indecis check failed): (csrColInd1=2)>= (csrColInd[2]=2)
Error (sorting of the column indecis check failed): (csrColInd[3]=3)
= (csrColInd[4]=3)
Error (sorting of the column indecis check failed):
(csrColInd[5]=2251) >= (csrColInd[6]=2251)
Error (sorting of the column indecis check failed):
(csrColInd[7]=2252) >= (csrColInd[8]=2252)
Error (sorting of the column indecis check failed):
(csrColInd[9]=4501) >= (csrColInd[10]=4501)
I have attempted to Isolate the problem and to my analysis have narrowed down the error source to "qsort.c" routine which sorts the symmetrized pattern.
Would anyone please advise on what can I do to overcome the error?
And side note: can I and how do I add in the B values later? Thank you.
Raw data:
196530 196530 2530239
1 1 -26860.49266
2 1 11773.49315
3 1 557.7137436
2251 1 11734.57775
2252 1 2237.629363
4501 1 557.0786545
1 2 11714.30627
2 2 -37958.69476
....
Analysed the program line by line and found that the cause of the error was due to the first line of the data file:
%%MatrixMarket matrix coordinate real symmetric
I had assumed the "%%" in front of the statement was for the computer to ignore the line.
The matrix that I provided was not symmetric which caused the above error. Program works when the the word "symmetric" was replaced with "general"
Hope this lesson helps others if they meet the same problem.

Cakephp 1.3.14 not loading database schema

We recently made some changes to our site to prepare it for pre-production:
Moved to a load-balanced architecture
Now use memcache/memcached to maintain session data
Enabled APC
Now, everything was working until we made some change that we cannot recall that has caused the database to not load schema properly. Here is an output of some debug:
Warning (512): SQL Error: 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 [CORE/cake/libs/model/datasources/dbo_source.php, line 684]
Query: SHOW FULL COLUMNS FROM
Warning (2): Invalid argument supplied for foreach() [APP/models/datasources/dbo/dbo_mysql.php, line 127]
Warning (2): array_keys() expects parameter 1 to be array, boolean given [CORE/cake/libs/model/datasources/dbo_source.php, line 1968]
Notice (8): Trying to get property of non-object [CORE/cake/libs/model/datasources/dbo_source.php, line 812]
Query: SHOW FULL COLUMNS FROM
Query: SHOW FULL COLUMNS FROM
Query: SHOW FULL COLUMNS FROM
Query: SHOW FULL COLUMNS FROM
Query: SHOW FULL COLUMNS FROM
Query: SHOW FULL COLUMNS FROM
As you can see, it is not loading the table names.
The other problem we noticed, is that when the query is generated, it is generated like this:
SELECT Project.id FROM AS Project WHERE 1=1
Notice that there is no table name, it simply tries to create the alias on a blank table name.
Any thoughts?
We recently made some changes to our site to prepare it for pre-production:
Thankfully you version-control your code changes and can simply roll back until you find a working version and compare to find the breaking change. With git this is easily done using git bisect.
No? Well..
Debug and identify the cause
As with any error - step one should be to look at where the error is coming from:
// cake/models/datasources/dbo/dbo_mysql.php
$cols = $this->query('SHOW FULL COLUMNS FROM ' . $this->fullTableName($model));
foreach ($cols as $column) { // #127
What should be clear here, is that Cake is unable to determine the full table name for your model.
You're trying to query a model with no table
Looking at the source for fullTableName:
// cake/libs/model/datasources/dbo_source.php
function fullTableName($model, $quote = true) {
if (is_object($model)) {
$table = $model->tablePrefix . $model->table;
} elseif (isset($this->config['prefix'])) {
$table = $this->config['prefix'] . strval($model);
} else {
$table = strval($model);
}
if ($quote) {
return $this->name($table);
}
return $table;
}
It should be clear that the model has no table according to cake.
Common causes:
The model property useTable is set to false
No describe permissions
Given the info in the question - it's most likely the first is the reason.