Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 3 years ago.
Improve this question
What is the fastest way to construct target messages from source messages by mapping file?
Such integration tasks are usual for business applications, but i dont know any universal approach for it. Coding them with objects mapping libs (like MapStruct or ModelMapper) - its wasting developer time, its mindless routine, isn't so?
This work can be successfully done by analyst: create any simple data mapping in json, send to integration service and check target message format.
But for this purpose i've found only big and not-free solutions like Altova MapForce (modeler&server) or IBM Integration Bus data graphical editor.
How do you solve such tasks in your projects?
UPDATE
Mapping format, we choosed for our issue (incl. nesting, arrays, rules):
{
"camunda.Form": {
"blockA": {
"FullName": "QuestionareResEntity.FullName.data",
"RTOPA1TF": "QuestionnaireResEntity.ResTypeOfPaymentAgents.data || CONTAIN || ID1",
"RTOPA2TF": "QuestionnaireResEntity.ResTypeOfPaymentAgents.data || YOUR_RULE || Param1,Param2,Param3",
},
"blockB": {
"ColExMan": "InfoAboutGovernment.CollegialExecutiveManagement.data || DICT || CollegialExecutiveManagementDictionary"
},
"LEResColManag.row[].cells": {
"FName": "TableLERes3[].FullName.data",
"Citiz": "TableLERes3[].Citizenship.data",
"RegAddress": "TableLERes3[].RegistrationAdress.data",
}
}
}
How does it seem for you by convenience and readability?
Appreciate your thoughts and ideas.
You can convert JSON to XML by free automatic converters. Then use the classic way with XSLT and XPath on the converted XML to convert the data in a similar way as you have listed. A lot of free tools, graphical editors and librarys are out there for XML.
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I'm trying to solve the following problem:
I have some expensive work to do which I then cache the result of
The work is keyed by a string
Many requests may arrive simultaneously for the same key
I'd like to avoid doing the work more than once per key
I'd like to add callbacks against the key which will be invoked when the work is completed; not all of these are known when the work is first submitted.
This feels like a problem which ought to have been solved already; does anybody know of a Java framework or library which covers it?
I can imagine a wrapper around guava's LoadingCache but I'm not aware of a library which does everything out of the box.
While LoadingCache#get is synchronous, it does get you 1-4 and there may be some mileage in using refresh which can return a ListenableFuture (although to get all the features you list it might become a fairly chunky wrapper?)
For Reference:
http://docs.guava-libraries.googlecode.com/git/javadoc/com/google/common/cache/LoadingCache.html#refresh(K)
http://www.theotherian.com/2013/11/non-blocking-cache-with-guava-and-listenable-futures.html
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I am a complete newbie to Java programming and I am trying to learn caching and hash tables. I have seen tutorials online but they are complex, does anyone here know of any relatively short programs that utilise caching and hash tables?
Thanks for any help given
UPDATE:
I am basically starting from scratch. I know hash tables and sort of know caching (more simple caching programs would be much appreciated), but I don't get how the two work together. For example saving to a hash table and caching the data.
As the comments mention, a cache is just a store where you keep the output so you won't have to do the calculation again.
Here's a really simple example
Map<String,Double> answers = new HashMap<String,Double>();
// checking cache if we have the answer
If (answers.get("volatility") != null) {
System.out.println("volatility found in cache:" +
answers.get("volatility"));
}
// store a value in cache
answers.put("rate",1.887);
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I want to match regular expressions very fast, low overhead. And I want to be able to choose between multiple expressions.
E.g.
AB* -> case A
XXX -> case B
etc
So I want to name all of which cases matched.
The problem is very similar to a lexical analyzer but the patterns are dynamic. That is, a user could change them at any time. So I don't have the luxuary of re-running Lex. Plus, I could have any number of different matchers.
I don't need any of the subpattern identification/capture stuff in Java or the overhead.
Just need to know which cases matched.
I could write software to do this efficiently...but it would almost be like re-writing lex.
Are there any tools that can do this?
Are there any more efficient regular expression libraries than the built in ones in java? Thread safe, etc.
thanks.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
I'm migrating from PHP to Java and Spring. I noticed that Spring, even if it's great framework, misses things that are bundled in other frameworks on other platforms. One that I miss most is ability to build form using dedicated builders, without writing single line of html.
Let's take Symfony2 for example (click here for full article):
/**
* Controller class
*/
public function newAction(Request $request)
{
// create a task and give it some dummy data for this example
$task = new Task();
$task->setTask('Write a blog post');
$task->setDueDate(new \DateTime('tomorrow'));
$form = $this->createFormBuilder($task)
->add('task', 'text')
->add('dueDate', 'date')
->add('save', 'submit', array('label' => 'Create Post'))
->getForm();
return $this->render('AcmeTaskBundle:Default:new.html.twig', array(
'form' => $form->createView(),
));
}
Having this code, all I have to do is to call form (in fact form's toString() method, but appropriate twig plugin handles that) in my view. HTML is generated and filled on the fly:
{{ form(form) }}
Validation is done on entity (single field and complex validators), but you can also attach validators to form itself.
Is there any way to achieve this functionality in Spring?
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 3 years ago.
Improve this question
I need a java api, that cannot use JMF, to play video interpreted by the SO codecs but i want to retrieve the each frames in java code. Somebody know some?
Have a look at FMJ. It does not require the Java Media Framework (JMF).
They have an example at the bottom of the page that writes out the first 5 frames of the video to files, so you should be able to get to the individual frames.
FMJ is very much out-of-date and JMF is a lost cause (yes one of those is IMHO). If you want something that works and will do exactly what you have described, try Xuggle. In their media tools examples they offer a simple player example using AWT / Swing.
http://xuggle.com/
If you're OK with Java wrapper around FFMpeg, try velvet-video.
Code snippet to extract images from a video file:
IVelvetVideoLib lib = VelvetVideoLib().getInstance();
try (IDemuxer demuxer = lib.demuxer(new File("/some/path/example.mp4"))) {
IDecoderVideoStream videoStream = demuxer.videoStream(0);
IFrame videoFrame;
while ((videoFrame = videoStream.nextFrame()) != null) {
BufferedImage image = videoFrame.image();
// Use image as needed...
}
}
A more advanced example of video player implementation using velvet-video can be found here.
Disclaimer: I am the author of velvet-video.