call of overloaded 'setField(int, double&)' is ambiguous - arduino-ide

In this i will face an error: "call of overloaded 'setField(int, double&)' is ambiguous
"
'''
ThingSpeak.setField(1, emon.Irms);
ThingSpeak.setField(2, emon.Vrms);
ThingSpeak.writeFields(ChannelNumber2, apiKey2);
'''

Related

Parsing with JSON.parse() returns the wrong unexpected token

When writing JSON.parse("hi") getting the following error:
Uncaught SyntaxError: Unexpected token 'h', "hi" is not valid JSON
When writing JSON.parse("foo") getting the following error:
Uncaught SyntaxError: Unexpected token 'o', "foo" is not valid JSON
Why is f letter ignored?
JSON.parse("false") is acceptable, so it's reading the "f" as a potential start of the "false" string, but failing when the next character isn't "a".

Invalid JSON Expression

I am making use of non-static import
JsonPath jp = response.jsonPath();
System.out.println(jp.get("data?(#.id>14).employee_name").toString());
For a JSON as shown below:
{"status":"success","data":[{"id":"1","employee_name":"Tiger Nixon","employee_salary":"320800","employee_age":"61","profile_image":""},{"id":"2","employee_name":"Garrett Winters","employee_salary":"170750","employee_age":"63","profile_image":""}]}
When i am trying to run it , i am getting below error:
java.lang.IllegalArgumentException: Invalid JSON expression:
Script1.groovy: 1: expecting EOF, found '[' # line 1, column 31.
data[?(#.id>14)].employee_name
^
1 error
Can someone guide me why is this error being thrown ?
I doubt if that syntax is right, nonetheless, you should be using the below
Also note that the id is a string in your response so you will have to include it in quotes
js.get("data.find {it.id > '14'}.employee_name").toString();

Error in fromJSON(commandArgs(1)) : unexpected character '''

I am calling a R script from Scala by using scala.sys.process. This script takes a command line argument in JSON format and processes it. I am using rjson's fromJSON function to store the JSON in a list.
This works very fine when I execute the R script from the command line:
$ ./dfChargerFlink.R '{"Id":"1","value":"ABC"}'
But when I call it from scala, I get the following error:
Error in fromJSON(commandArgs(1)) : unexpected character '''
Execution halted
This is the code I am using:
val shellCommand = "./dfChargerFlink.R '"+arg+"'"
return shellCommand !!
where arg is the JSON string.
You can notice that I have appended " ' " to both the sides of the JSON string as if I don't, I get this error:
Error in fromJSON(commandArgs(1)) : unclosed string
Execution halted
How can this be solved? Is it some bug?

to type "System.Int32"Error:"Input string was not in a correct format

I Run the this power shell script
"$InstallPh\Database\bin\mysql.exe" -'uroot' -'e''select status from zibcatalog.zibmonitor where backupset="$BACKUPSET" AND operation="ZIB_BACKUP";' > 'c:\\auto\\firstbackup-result.txt'
Powershell throws this error message:
Cannot convert value "\Database\bin\mysql.exe" to type "System.Int32". Error: "Input string was not in a correct format."
At line:1 char:2
+ "$InstallPh\Database\bin\mysql.exe" -'uroot' -'e''select status from zibcatalog ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvalidCastFromStringToInteger
Your problems the way your trying to execute and pass the parameters to MySQL.exe. Try using the & operator to execute the exe file.
& "$InstallPh\Database\bin\mysql.exe" "-uroot -e'select status from zibcatalog.zibmonitor where backupset=`"$BACKUPSET`" AND operation=`"ZIB_BACKUP`";'" > 'c:\auto\firstbackup-result.txt'

Why the model "FourierAnalysis" does not run on OpenModelica? error: lvalue required as unary '&' operand

The test model "TestSine" from the package "Sensors.Tests.FourierAnalysis" from the Xogeny library: https://github.com/xogeny/Sensors does not run on OpenModelica.
The error message is: "error: lvalue required as unary '&' operand". In the C-file generated by OpenModelica, the message error is about this lines:
infoStreamPrint(LOG_EVENTS, 0, "reinit $Panalysis$Pai$lB1$rB = %f", 0.0);
copy_real_array_data_mem(&0.0, &$Panalysis$Pai$lB1$rB);
I don't understand this message and I want to use the block "FourierAnalysis" with OpenModelica.
It was an implementation bug in OpenModelica; it has been fixed in r22261.
Note: Bug reports should ideally be reported to https://trac.openmodelica.org/OpenModelica/newticket