I'm trying to use http://ci-merchant.org/ for CodeIgniter. But when I load the merchant library, I get these errors:
A PHP Error was encountered
Severity: Warning
Message: stripos() expects parameter 1 to be string, array given
Filename: libraries/merchant.php
Line Number: 97
A PHP Error was encountered
Severity: Warning
Message: strtolower() expects parameter 1 to be string, array given
Filename: libraries/merchant.php
Line Number: 103
Here is my code:
$this->load->library('merchant');
$this->merchant->load('paypal_express');
Looking at the source of that file, the driver name needs to be passed as a string. So I highly doubt the two lines of code you put above is actually what's being called, it looks like you are passing an array as the driver name.
If you aren't sure where it's coming from, try adding some debug_print_backtrace() lines to the merchant.php file to figure out where the array is getting passed from.
Related
I could use a little hand with utPLSQL.
I am trying to produce the test results so that Sonar would pick it up and scan them. so far, Sonar is picking up the report file, but the test executions are ignored because they are not referencing to the appropriate source files.
I am trying to make a reference to the source and test files when running ut.run(ut_sonar_test_reporter()); and our Jenkins does not have utPLSQL-cli installed. Short version: They said they will not install it.
To get a result for a single test, I tried the following:
spool sonar_results.xml;
exec ut.run('test_get_something');
exec ut.run(ut_sonar_test_reporter(), a_source_file_mapping => ut_file_mappings(ut_file_mapping(file_name => 'this_dir/get_something.fnc', object_owner=> 'GET_SOMETHING_OWNER', object_name=> 'GET_SOMETHING', object_type=>'FUNCTION'));
spool off;
And got the following error message:
Error starting at line : 4 in command -
BEGIN ut.run(ut_sonar_test_reporter(), a_source_file_mapping => ut_file_mappings(ut_file_mapping(file_name => 'this_dir/get_something.fnc', object_owner=> 'GET_SOMETHING_OWNER', object_name=> 'GET_SOMETHING', object_type=>'FUNCTION'));
Error report -
ORA-06550: line 1, column 219:
PLS-00306: wrong number or types of arguments to call to 'RUN'
ORA-06550: line 1, column 219
PL/SQL: Statement ignored
utPLSQL's documentation doesn't provide anything about referencing parameters like a_source_file_mapping or a_test_file_mapping.
I am a little stumped.
when I write an R script in a test.R file
nb <- 22
paste("Etudions le nombre: ",nb)
paste("Le logarithme népérien de ce nombre est: ", log(nb))
paste("La racine carrée de ce nombre est: ", sqrt(nb))
paste("Le cosinus de ce nombre est: ", cos(nb))
paste("Si on ajoute 3 au nombre ", nb, " on obtient: ", nb + 3)
q("ask")
I executed using :
source("/Users/shous/Desktop/Master2.0/LanguageR/test.R")
error message :
Error in source("/Users/shous/Desktop/Master2.0/LanguageR/test.R") :
/Users/shous/Desktop/Master2.0/LanguageR/test.R:1:9: unexpected numeric constant
1: nb <- 22
It can be encoding problem: unexpected numeric constant 1: nb <- 22
I guess you don't want to have this character Â.Try to change file encoding or rewrite problematic line (not copy paste).
unexpected numeric constant 1: nb <- 22
This is R telling you that it found the line
nb <- 22
and that isn't valid syntax. You can duplicate this simply on the command line with something like a = a 22, which also isn't valid syntax. You need to correct that line of code - I don't know what you want it to be, perhaps there is a missing line break, or perhaps it should be  + 22 or Â[22], etc...
The line that produces the error does not occur in the code you show, perhaps you should make sure you are running the right file.
For an automated test script, I would like to generate random UUID values at runtime, so I added some YAML that looks like this:
---
applicant:
idNumbers:
nationalId: !!python/object:uuid.uuid4
However, this generates an error when I try to yaml.load the value:
ConstructorError: expected a mapping node, but found scalar
in "<unicode string>", line 4, column 17:
nationalId: !!python/object:uuid.uuid4
^
How do I inject a UUID value via YAML tags?
I found the error message a bit intimidating at first, but after some thought, I was able to unpack it.
The parser is expecting a "mapping" node, not a scalar. So, what happens if I add a mapping?
>>> yaml.load('''---
... applicant:
... idNumbers:
... nationalId: !!python/object:uuid.uuid4 {}''')
{'applicant': {'idNumbers': {'nationalId': UUID('71e09d1d-e84e-4ea6-855d-be1a2e91b60a')}}}
Additional info: http://yaml.org/type/map.html
I have a simple Azure Machine Learning experiment, with two input blocks ("Enter Data Manually") that pass their input to an "Execute R Script" block that binds the two inputs.
When the two input values are the same, I get an AFx Library exception FileNotFound. When the two input values are different, everything works fine.
Here is the R code and the experiment outline.
d1 <- maml.mapInputPort(1) # class: data.frame
d2 <- maml.mapInputPort(2) # class: data.frame
print(d1)
print(class(d1))
print(d2)
print(class(d2))
The error I get when I set the same input data in the two input blocks, in more detail is the following:
[Critical] Error: Error 1000: AFx Library library exception: File: ..\..\Dataset2\Dataset2.dataset cannot be found.
[Critical] {"InputParameters":{"DataTable":[{"Rows":2,"Columns":1,"estimatedSize":12001280,"ColumnTypes":
{"System.Int32":1},"IsComplete":true,"Statistics":
{"0":[1.5,1.5,1.0,2.0,0.70710678118654757,2.0,0.0]}}]},"OutputParameters":
[],"ModuleType":"LanguageWorker","ModuleVersion":"
Version=6.0.0.0","AdditionalModuleInfo":"LanguageWorker, Version=6.0.0.0,
Culture=neutral, PublicKeyToken=69c3241e6f0468ca;
Microsoft.MetaAnalytics.LanguageWorker.LanguageWorkerClientRS;
RunRSNR","Errors":"Microsoft.Analytics.Exceptions.ErrorMapping+ModuleException:
Error 1000: AFx Library library exception: File: ..\\..\\Dataset2
\\Dataset2.dataset cannot be found. --->
Microsoft.Numerics.AFxLibraryFileNotFoundException: File: ..\\..\\Dataset2
\\Dataset2.dataset cannot be found.\r\n at
Microsoft.Analytics.IO.Local.DataTableReader..ctor(String filePath)\r\n at
Microsoft.MetaAnalytics.DllModuleHost.DataLab.Handlers.DataTableDatasetHandler.H
andleArgumentString(String argument, ParameterInfo paramInfo)\r\n at
Microsoft.MetaAnalytics.DllModuleHost.ParameterArgumentBinder.InitializeParamete
rValues(MethodInfo method, Dictionary`2 moduleDescription)\r\n at
Microsoft.MetaAnalytics.DllModuleHost.DllModuleMethod.Execute(Dictionary`2
moduleDescription)\r\n at
Microsoft.MetaAnalytics.DllModuleHost.Program.Main(String[] args)\r\n --- End
of inner exception stack trace ---","Warnings":[],"Duration":"00:00:00.5755180"}
Module finished after a runtime of 00:00:01.4722617 with exit code -2
Module failed due to negative exit code of -2
Any suggestion is much appreciated, Flo.
You should get rid of the R code referencing the second dataset because you only have one input dataset.
I am trying to run some Xquery code in a java program and I am using the Saxon free java library for this purpose.
Now for some reason I am getting repeated "duplicate function definition" errors when I run this code-- this error is occurring for the "Functx" Xquery library which I downloaded from xqueryfunctions.com.
I dont understand what is wrong here? I am making straightforward calls to some functions in the FunctX Library.
Given below is a section of the error log- it also mentions the line numbers for the "duplicate functions"-- however, when I went to the 2 line numbers I saw that one line number corresponded to the start of that function, while the other line number closed that function.
The library that I am using is at this URL--
http://e0aad1ab954aa14b69e0-bd55729d8fadb0b3214bfee0a8fb65e0.r16.cf1.rackcdn.com/functx-1.0.xq
A section of the error log is given below--
Error on line 2488 column 4 of functx-1.0.xq:
XQST0034 XQuery static error near #...ion the duration :) declare#:
Duplicate definition of function functx:total-days-from-duration (see line 2
484 in
http://e0aad1ab954aa14b69e0-bd55729d8fadb0b3214bfee0a8fb65e0.r16.cf1.rackcdn.c
om/functx-1.0.xq)
Error on line 2502 column 4 of functx-1.0.xq:
XQST0034 XQuery static error near #...ion the duration :) declare#:
Duplicate definition of function functx:total-hours-from-duration (see line
2498 in
http://e0aad1ab954aa14b69e0-bd55729d8fadb0b3214bfee0a8fb65e0.r16.cf1.rackcdn.c
om/functx-1.0.xq)
Error on line 2516 column 4 of functx-1.0.xq:
XQST0034 XQuery static error near #...ion the duration :) declare#:
Duplicate definition of function functx:total-minutes-from-duration (see lin
e 2512 in
http://e0aad1ab954aa14b69e0-bd55729d8fadb0b3214bfee0a8fb65e0.r16.cf1.rackcdn.c
om/functx-1.0.xq)
Error on line 2530 column 4 of functx-1.0.xq:
XQST0034 XQuery static error near #...ion the duration :) declare#:
Duplicate definition of function functx:total-months-from-duration (see line
2526 in
http://e0aad1ab954aa14b69e0-bd55729d8fadb0b3214bfee0a8fb65e0.r16.cf1.rackcdn.c
om/functx-1.0.xq)
Error on line 2544 column 4 of functx-1.0.xq:
XQST0034 XQuery static error near #...ion the duration :) declare#:
Duplicate definition of function functx:total-seconds-from-duration (see lin
e 2540 in
http://e0aad1ab954aa14b69e0-bd55729d8fadb0b3214bfee0a8fb65e0.r16.cf1.rackcdn.c
om/functx-1.0.xq)
Error on line 2558 column 4 of functx-1.0.xq:
XQST0034 XQuery static error near #...e string to trim :) declare#:
Duplicate definition of function functx:total-years-from-duration (see line
2554 in
http://e0aad1ab954aa14b69e0-bd55729d8fadb0b3214bfee0a8fb65e0.r16.cf1.rackcdn.c
om/functx-1.0.xq)
Now, looking at the last error as shown above-- the line numbers for the duplicate function definition error in functx-1.0.xq are "2558" and "2554"
The relevant code from the file functx-1.0.xq for lines 2554-2558 is now given below--
declare function functx:total-years-from-duration
( $duration as xs:yearMonthDuration? ) as xs:decimal? {
$duration div xs:yearMonthDuration('P1Y')
} ;
How do I resolve this error?
When you use xquery engine in a loop for example (my case) and you use one single object to execute multiple xquery that import the same function the engine will try to import the function each time, so you have duplicate the second loop.
To solve that I simply reset the object configuration each time I execute the xquery (in my Java problem I created a class that run the xquery engine and do al lthe configuration from 0 each time, so that previous run does not mess up the new run).