I am working with Collapsed dependencies using Stanford CoreNLP.
I am getting
cannot find Symbol. Symbol:method getEdgeSet()
error while typing the following code:
Set<SemanticGraphEdge> edge_set1 = dependencies.getEdgeSet();
No other errors are found. I have already imported
edu.stanford.nlp.semgraph.SemanticGraphEdge;
Why does it happen so?
The type of dependencies is SemanticGraph which doesn't have the method getEdgeSet().
In the first paragraph in the documentation you can see:
There is no mechanism for returning all edges at once (eg edgeSet()). This is intentional. Use edgeIterable() to iterate over the edges if necessary.
See getAllEdges(IndexedWord gov, IndexedWord dep) and edgeIterable() instead.
Related
I am building an Android ROM, but I am having trouble in the middle of the compilation.,What do I need to adjust?
This is base on a useably rom‘s device tree, I want to use another rom,so i made it to another rom. But when I successfully bring up and start compiling, it will be stuck in this error.
Here is the device tree link
https://github.com/lemonbigbig/device_xiaomi_vince
hardware/qcom/media-caf/msm8996/mm-video-v412/vidc/vdec/src/omx_vdec_v412.cpp:3401:15:
error: use of undeclared identifier'V4L2_QCOM_CMD_FLUSH'
dec.cmd = V4L2_QCOM_CMD_FLUSH;
hardware/qcom/media-caf/msm8996/mm-video-v412/vidc/vdec/src/omx_vdec_v412.cpp:4145:26:
error: use of undeclared identifier 'V4L2 HPEG VIDEO H264 LEVEL UNKNOWN'
case V4L2 MPEG VIDEO_H264_LEVEL_UNKNOWN:
You need to define V4L2_QCOM_CMD_FLUSH before you use it. I am not sure what the appropriate value is for your kernel, but I found a definition here:
https://github.com/tonight0210/device/blob/a7a7fa827a44dc04571616d8f41e417de753eee5/google/crosshatch/sdm845/kernel-headers/linux/videodev2.h#L1067
I'm getting a "Conditionally Required Field Missing" error message, even though I'm sure that field is there.
58=Conditionally Required Field Missing, field=55
Versions:
QuickFixJ 2.1.0
FIX 4.4
Here is the FIX message that I'm sending (with mocked values and a few fields removed for clarity)
8=FIX.4.4
9=709
35=R
34=4
49=TARGET
56=ME
11=myClOrdID
131=myQuoteReqID
146=myNoRelatedSym
55=mySymbol // field missing
167=mySecurityType // field missing
Here is the calling code:
String symbol = quoteRequest.getField(new StringField(55)).getValue();
I also tried:
String symbol = quoteRequest.getString(55);
Here is my Data Dictionary:
<field number="55" name="Symbol" type="STRING"/>
I realize that the symbol field is no longer a part of the QuoteRequest FIX specification for 4.4 (though it was in earlier versions, such as 4.0), however surely there are ways to retrieve custom fields? I have no control over the QuoteRequest message that I receive.
I can always parse the message myself using toString() but that kinda defeats the purpose of using quickfixj in the first place.
Any ideas?
Tag 55 is inside the 146 repeating group. See the docs for reading repeating groups.
The symbol field is still in FIX44. You should spend some time familiarizing yourself with the FIX44.xml data dictionary file that you're using.
(You may find that you need to customize that file based on your counterparty's messaging; in practice, nobody uses the basic FIX44 message definitions without changing them at least a little.)
// create group
QuoteRequest.NoRelatedSym group = new QuoteRequest.NoRelatedSym();
// set group, confusing method name I find
message.getGroup(1, group);
// you now have all the getters of fields in that group
Symbol symbol = group.getSymbol();
In the following code snippet, I attempted to use the createOFG from JavaToObjectFlow.rsc:
void run(loc source) {
m = createM3FromEclipseProject(source);
set[Declaration] asts = createAstsFromEclipseProject(source, true);
FlowProgram p = createOFG(asts);
}
Upon executing this method, the following error was received:
|std:///lang/java/flow/JavaToObjectFlow.rsc|(4167,1,<153,26>,<153,27>):
Undeclared annotation: decl on Expression
Advice: |http://tutor.rascal-
mpl.org/Errors/Static/UndeclaredAnnotation/UndeclaredAnnotation.html|
Since the error is coming from std:///lang/java/flow/JavaToObjectFlow.rsc and none of our fellow students receive the same error, I am wondering what is going wrong. The error occurs in both the stable and unstable versions of Rascal.
you should be on unstable, as this message points to a known problem on stable.
are you sure you get exactly the same message on unstable? in that case, please tell me what you see on that line (153 of file /lang/java/flow/JavaToObjectFlow.rsc)
If you don't have a source location to click on to get you there, you can always browse the code from any rascal project:
I'm trying to build a MT940 parser using antlr4. The grammar is simple but works for most cases.
Now I want to return my own classes. This works:
file returns [String myString]
:
Header940? record+ EOF
;
I think this is becasue String is in the default java packages.
I want this:
file returns [List<MT940Record> records]
:
Header940? record+ EOF
;
The TestRig complains (logically):
/tmp/TestRigTask-1392235543340/MT940_5aParser.java:50: error: cannot find symbol
public List<MT940Record> records;
^
symbol: class MT940Record
location: class FileContext
How can I set the CLASSPATH / lib directory in the TestRig in ANLTRWorks?
In ANTLRWorks, you can't. You can add an issue for this on the issue tracker:
https://github.com/sharwell/antlrworks2/issues
Note that ANTLR 4 was designed so you no longer need to use user-defined arguments and/or return values in your grammar. Instead of returning a List<MT940Record> like you described above, you should use a listener or visitor after the parse is complete to compute the necessary result.
I'm having trouble getting xmlunit to ignore whitespace in my XML using setIgnoreWhitespace... any idea what could be wrong or what I could check?
JVM: 1.6, XMLUnit 1.3, IDE: JDeveloper 11.1.1.6
For example the below returns "Expected number of child nodes '2' but was '1'". If I take out the extra space it passes.
#Test
public void testExample() {
String inputXML = "<test><innertest>data</innertest></test>";
String expectedResultXml = "<test> <innertest>data</innertest></test>";
XMLUnit.setIgnoreWhitespace(true);
XMLUnit.setIgnoreComments(true);
XMLUnit.setIgnoreDiffBetweenTextAndCDATA(true);
try {
assertXMLEqual("Did not match!!", expectedResultXml, inputXML);
} catch(Exception e) {}
}
I must have some incompatible XML library in my classpath. Overriding the JAXP libs as below resolved the issue (also added xerces and xalan jars).
XMLUnit.setControlParser("org.apache.xerces.jaxp.DocumentBuilderFactoryImpl");
XMLUnit.setTestParser("org.apache.xerces.jaxp.DocumentBuilderFactoryImpl");
XMLUnit.setSAXParserFactory("org.apache.xerces.jaxp.SAXParserFactoryImpl");
XMLUnit.setTransformerFactory("org.apache.xalan.processor.TransformerFactoryImpl");
It looks a bit you expected that any whitespace characters is to be ignored but that is just not the case for that setting.
See XMLUnit.setIgnoreWhitespace:
Whether to ignore whitespace when comparing node values.
[...]
Setting this parameter has no effect on whitespace inside texts.
This setting does not mean that whitespace-only text-nodes will be removed (and not checked for). It will only mean that the whitespace is ignored when comparing the node values of the <test> elements. But that test didn't cause the message. In your case a check for the count of child-nodes did raise the message.
See 3.8.1. Whitespace Handling for a more detailed description and more configuration options (e.g. XMLUnit.setNormalizeWhitespace).
Overriding the JAXP libs as #user392909 did, did not succeed for me.
But a conflict with another library in my project was the root cause. First I changed the import order of some libraries which finally fixed the test. So I was able to identify the conflicting library. It was j2ee.jar.
I removed it (and had to replace it by tomcat-catalina.jar, tomcat-juli.jar and javamail.jar to resolve upcoming compilation errors).
The import order doesn't matter any longer since j2ee.jar was removed / replaced and the xml diff is now working as expected.