Incorrect data format for value - UTCDate - utc

using Fix 4.2, I am receiving messages like this:
8=FIX.4.29=15135=W49=aSERVER56=myNAME34=84823052=20130226-00:43:05.53755=USD/JPY268=1269=2270=92.699271=0272=20130226273=19:43:04274=210=251
but my QuickFix implementation is throwing this error:
8=FIX.4.29=13935=334=949=myNAME52=20130226-00:43:05.66556=aSERVER45=84823058=Incorrect data format for value371=272372=W373=610=225
indicating that tag 272 is in the incorrect format.
Tag 272 is defined in the data dictionary like this:
<field number="272" name="MDEntryDate" type="UTCDATE"/>
so it looks like the format is correct to me. "20130226".
What could be wrong?

it seems this is a known bug, and will be released in the next release of QuickFix/N (most probably March 2013):
https://github.com/connamara/quickfixn/issues/135#issuecomment-14089433

Related

How to fix `TypeError: get_sheet_by_name() missing 1 required positional argument: 'name' error` in `openpyxl`

I am trying to display my worksheet names using openpyxl. I get the error "TypeError: get_sheet_by_name() missing 1 required positional argument: 'name'" How can I fix this?
I am on windows 10 OS. I am using Python 3.7 with openpyxl installed pip.
os.chdir(r'C:\Users\zhiva\Desktop')
wb= openpyxl.load_workbook('Book1.xlsx')
wb.get_sheet_by_name()
wb.get_sheet_by_name()
I expected the output as ['Sheet1','Sheet2','Sheet3']
Looks like what you want is:
wb.get_sheet_names()
wb.get_sheet_by_name will get a specific sheet, but you have to pass it the name, hence the error.
See documentation
Can use this as well,
wb_obj.sheetnames
Output :
['Sheet1', 'Sheet2', 'Sheet3']
And in case, if specific worksheet is required, then
wb_obj['Sheet12']

OpenNMS events varbinds decode always showing the raw value between (parentheses)

Is there a way to hide the raw value from a varbind that was decoded?
What I'm getting is:
deviceNotification trap received deviceRuleCode=browserOffline(7) notifObjType=trigger(1) notifObjSeverity=critical(6)
What i want is:
deviceNotification trap received deviceRuleCode=browserOffline notifObjType=trigger notifObjSeverity=critical
Obviously I'm passing the decoded varbinds parm[#] to the log message and/or description.
Any clue? Is it even supported?
After check the code, I've concluded that this is not supported.
The proof is here:
https://github.com/OpenNMS/opennms/blob/develop/features/events/daemon/src/main/java/org/opennms/netmgt/eventd/processor/expandable/ExpandableParameter.java#L75-L77
The token having the decoded value is always appended with the original value:
(...)
ret.append(decode.get(token).get(value));
ret.append("(");
ret.append(value);
ret.append(")");
(...)
.. and this happens for all the expanded values.

CSV file input not working together with set field value step in Pentaho Kettle

I have a very simple Pentaho Kettle transformation that causes a strange error. It consists of reading a field X from a CSV, add a field Y, set Y=X and finally write it back to another CSV.
Here you can see the steps and the configuration for them:
You can also download the ktr file from here. The input data is just this:
1
2
3
When I run this transformation, I get this error message:
ERROR (version 5.4.0.1-130, build 1 from 2015-06-14_12-34-55 by buildguy) : Unexpected error
ERROR (version 5.4.0.1-130, build 1 from 2015-06-14_12-34-55 by buildguy) : org.pentaho.di.core.exception.KettleStepException:
Error writing line
Error writing field content to file
Y Number : There was a data type error: the data type of [B object [[B©b4136a] does not correspond to value meta [Number]
at org.pentaho.di.trans.steps.textfiIeoutput.TextFiIeOutput.writeRowToFile(TextFiIeOutput.java:273)
at org.pentaho.di.trans.steps.textfiIeoutput.TextFileOutput.processRow(TextFiIeOutput.java:195)
at org.pentaho.di.trans.step.RunThread.run(RunThread.java:62)
atjava.Iang.Thread.run(Unknown Source)
Caused by: org.pentaho.di.core.exception.KettleStepException:
Error writing field content to file
Y Number : There was a data type error: the data type of [B object [[B©b4136a] does not correspond to value meta [Number]
at org.pentaho.di.trans.steps.textfiIeoutput.TextFiIeOutput.writeField(TextFileOutput.java:435)
at org.pentaho.di.trans.steps.textfiIeoutput.TextFiIeOutput.writeRowToFile(TextFiIeOutput.java:249)
3 more
Caused by: org.pentaho.di.core.exception.KettleVaIueException:
Y Number : There was a data type error: the data type of [B object [[B©b4136a] does not correspond to value meta [Number]
at org.pentaho.di.core.row.vaIue.VaIueMetaBase.getBinaryString(VaIueMetaBase.java:2185)
at org.pentaho.di.trans.steps.textfiIeoutput.TextFiIeOutput.formatField(TextFiIeOutput.java:290)
at org.pentaho.di.trans.steps.textfiIeoutput.TextFiIeOutput.writeField(TextFileOutput.java:392)
4 more
All of the above lines start with 2015/09/23 12:51:18 - Text file output.0 -, but I edited it out for brevity. I think the relevant, and confusing, part of the error message is this:
Y Number : There was a data type error: the data type of [B object [[B©b4136a] does not correspond to value meta [Number]
Some further notes:
If I bypass the set field value step by using the lower hop instead, the transformation finish without errors. This leads me to believe that it is the set field value step that causes the problem.
If I replace the CSV file input with a data frame with the same data (1,2,3) everything works just fine.
If I replace the file output step with a dummy the transformation finish without errors. However, if I preview the dummy, it causes a similar error and the field Y has the value <null> on all three rows.
Before I created this MCVE I got the error on all sorts of seemingly random steps, even when there was no file output present. So I do not think this is related to the file output.
If I change the format from Number to Integer, nothing changes. But if I change it to string the transformations finish without errors, and I get this output:
X;Y
1;[B#49e96951
2;[B#7b016abf
3;[B#1a0760b0
Is this a bug? Am I doing something wrong? How can I make this work?
It's because of lazy conversion. Turn it off. This is behaving exactly as designed - although admittedly the error and user experience could be improved.
Lazy conversion must not be used when you need to access the field value in your transformation. That's exactly what it does. The default should probably be off rather than on.
If your field is going directly to a database, then use it and it will be faster.
You can even have "partially lazy" streams, where you use lazy conversion for speed, but then use select values step, to "un-lazify" the fields you want to access, whilst the remainder remain lazy.
Cunning huh?

Apache Pig: ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1200: can't look backwards more than one token in this stream

I wrote a UDF that returns a string and here is a sample code:
split data into purchased IF ((boolean) (myudf(param)), failed OTHERWISE;
As an example, here is the example of that my udf returns:
split data into purchased IF ((boolean) (retcode == 'SUCCESS')), failed OTHERWISE;
Unfortunately. I get the following error:
Apache Pig: ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1200: can't look backwards more than one token in this stream
I also tried this:
split data into purchased IF ((boolean) '(retcode == 'SUCCESS')'), failed OTHERWISE;
I get this error:
2015-06-19 10:10:48,330 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1200: <line 11, column 85> Syntax error, unexpected symbol at or near '250.00'
I also tried this:
split data into purchased IF ((boolean) '(retcode == \'SUCCESS\')'), failed OTHERWISE;
I don't get any error, but the I don't get the expected result back.
Any help with this would be great.
That error is thrown because ANTLR can't parse correctly that sentence. Pig should give you a different error showing what is the problem, like it generally does, but it seems the parsing rules for the SPLIT sentence don't take into account what happens when you try to cast the condition.
The problem here is solved simply by removing that cast to boolean:
split data into purchased IF (retcode == 'SUCCESS'), failed OTHERWISE;
That will work.
Why does the cast make it fail? That I don't know. I guess that casting the output of an expression counts as two different expressions, since it has to resolve the inner expression to apply the cast afterwards, and the syntax rule for the split operator does not allow this. 0% sure though.

How can can I save my php created pdf file on a specific directory?

I need to convert a dynamic web page to pdf... So as a start, I use this code for practice,
This works fine as long as I use the directory c:/test.php. But everytime I change the directory to something like d:/xampp/htdocs/test.php I get the error message:
Fatal error: Uncaught exception 'PDFlibException' with message 'pdf_begin_document() expects exactly 3 parameters, 2 given' in D:\xampp\htdocs\mypdftest\pdf_file.php:1… Stack trace: #0 D:\xampp\htdocs\mypdftest\pdf_file.php(1… pdf_begin_document(Resource id #2, 'test.pdf') #1 {main} thrown in D:\xampp\htdocs\mypdftest\pdf_file.php on line 18
Please tell me what's going wrong and how to fix it... Any help is appreciated...
Read the documentation on this one. It seems that the function pdf_begin_document() accepts 3 mandatory parameters, which are:
PDF_begin_document($pdfdoc, $filename, $optlist );
where $optlist is an option list (not much documentation here), like this example:
$optlist = "destination={page=1 type=fixed zoom=1 top=100 left=50}";