As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I have a requirement to compare two XML documents and report differences. String comparison is not sufficient as I want to be able to say that:
<Foo/>
is the same as
<Foo></Foo>
Anyone used a library they would recommend?
There's the cunningly named xmldiff which I've used before with success.
XMLUnit also works well. It's primarily for use in unit tests (alongside JUnit).
or try diffxml:
The standard Unix tools diff and patch
are used to find the differences
between text files and to apply the
differences. These tools operate on a
line by line basis using well-studied
methods for computing the longest
common subsequence (LCS).
Using these tools on hierarchically
structured data (XML etc) leads to
sub-optimal results, as they are
incapable of recognizing the
tree-based structure of these files.
This project aims to provide Open
Source XML diff and patch utilities
which operate on the hierarchical
structure of XML documents.
What I always do is format both sides of the XML (xmllint -format) and diff the results.
Related
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
Anyone know any existing library in the market? or open source project? The library should be able to convert picture or any images to cartoon-like image.
Please suggest me if you have use anything like that before.
Depends on what you mean by cartoon-like. Sometimes, applying some filters and doing some other minor operations might give you a decent result. If that is what you are after, you could use something like JavaCV (which is a wrapper for OpenCV.
This library should provide you with access to some graphical tools which should allow you to manipulate the image to obtain what you are after.
If on the other hand you are after a caricature type of cartoon, I think that you would need to use some AI techniques since caricatures usually involve the exaggeration of some physical feature, and for that, you would need AI to extract the said feature.
Finally, you can take a look at this previous SO thread which contains some other pointers on how you can convert an image to a cartoon.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I want to write a Mediation Software in Java and I want to know which design patterns I should use to do this.
NB : A Mediation Software is used in the domain to telecommunication to collect and distribute file to differents outputs via FTP.
Thank you.
Don't start by looking for design patterns. Start by making the requirements very clear and then considering the objects and responsibilities that emerge from satisfying the requirements. As you improve your object design you start to find a need to control dependencies and increase flexibility, and at that point you being to see design patterns.
For example: suppose you receive several different data formats and need to transform them in the mediation. Then you might have some transformer classes able to do say JSON->XML, CSV->XML, SpecialData->XML. You begin to see commonality between those transformer classes and how instances are created. Then patterns such as Facade or AbstractFactory might emerge.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
Subjective Logic is fundamental as part of my next project, and I was just wondering if there are any implementations already out there. I've read some things (not a lot) about the operators but I'm still unsure as to how it is implemented.
Preferably I would like a C/Java/Go/Python implementation
I dont see any example codes for subjective logic after a google search. This concept is more into AI and logic based languages like Prolog will have to be employed. Also if you have a rule evaluation engine (like CLIPS rule-engine as mentioned here), then good to go.
There are couple of algorithms proposed which leverage subjective logic and can be coded in java or C right away.
The demo page contains a Java applet which can be used to visualise networks of trust using subjective logic. While no source can be obtained for the applet up front, the applet JAR file can be decompiled using a program such as JD (java decompiler) and from there reverse engineered.
The code somewhat provides a library and is the only example of subjective logic in code I've seen.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
is there an open source tainting tool? I am trying to analyze a Java project and it's java source code. Therefore I can see where and which purpose are parameters used for. For instance, is it used in an if statement or is it assigned to another variable etc.
Thanks
You could try using the Checker Framework.
Modern java IDEs provide such information. IMHO, best one is IntelliJ IDEA , but comemrcial license will cost you about 130$ (there is free community edition
wuth somehow reduced functionality with source code published, or 30 day free trial
of full version)
Eclipse and netbean also provide similar functionality, but are not as good.
( IMHO of course )
If you want a general purpose tool to track how a an arbitrary variable is used, or the source of values that feed into a variable, what you want is a program slicer. (Tainting is a special case, where one only wants to slice on certain inputs, usually from a source outside the program).
There is one called Indus. I've never used it, and I don't know its status.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I am looking for an opensource product or some code examples of how I might design either a Java or HTML based GUI to design message flows.
One would add nodes/entities to the diagram and then messages that would flow between entities. The properties of the nodes and entities could then be modified.
The reason I want to extend something open source or code it from scrath is that I have numerous formats that i want to export the data in such as :
An image of the flow for use in documentation.
Human readable description of the message flow.
A test script to simulate the flow.
In an ideal world this would eventually be an Eclispe plug-in which is why I'd like it to be done using a sutable Java GUI framework however if a tool exists that could export message flows in a good structured langauge (XML) I guess my tool could just import this and convert to the other formats required.
Any ideas?
Eclipse GMF is a good choice, but it is quite hard once you start putting in advanced features.
Take a look at the jboss jpdl designer. I think it is built on top of an extensible core library for graph modeling. I know for a fact that jBPM is built like that, so this one also might be built along the same lines. If it is so, you should be able to reuse the core library.