Can Javers prettyPrint method output be localized? (Eg. pt_BR) - javers

a short question:
Can Javers prettyPrint method output be localized? For example, using locales like pt_BR, or ES, etc?
As I can see googling or looking at code, don't found anything related to.
So, the dev team has any plan to implement this? Thanks!

Related

OptaPlanner : Access ProblemId in ConstraintProvider (using SolverManager)?

I am using Optaplanner with Quarkus, does anyone know if ProblemId can be accessed from ConstraintProvider? I'm using the SolverManager, and I would like to be able to fine-tune the Constraints based on the resolution request that uses parameters sent by the user and stored in H2. These parameters are stored with the ProblemId, and I would like to find them in the ConstraintProvider. Is this possible? Has anyone tried to do something similar?
A ConstraintProvider can write constraints based on any method of any problem fact or planning entity.
So it can do something with the #PlanningId annotated method of for example Lesson: from(Lesson.class).filter((lesson) -> lesson.getId() ...)
But I suspect what you want to do is #ConstraintConfiguration. See docs.

Does Spring Data JDBC support inheritance

I am working on a new project using spring data jdbc because it is very easy to handle and indeed splendid.
In my scenario i have three (maybe more in the future) types of projects. So my domain model could be easily modelled with plain old java objects using type inheritance.
First question:
As i am using spring data jdbc, is this way (inheritance) even supported like it is in JPA?
Second question - as addition to the first one:
I could not found anything regarding this within the official docs. So i am assuming there are good reasons why it is not supported. Speaking of that, may i be on the wrong track modelling entities with inheritance in general?
Currently Spring Data JDBC does not support inheritance.
The reason for this is that inheritance make things rather complicated and it was not at all clear what the correct approach is.
I have a couple of vague ideas how one might create something usable. Different repositories per type is one option, using a single type for persisting, but having some post processing to obtain the correct type upon reading is another one.

I need to create a dynamic query using StreamInsight 2.1 and reactive extensions

I am looking for information about how to create dynamic queries using the newer StreamInsight 2.1 reactive extensions model. Specifically, I would like to use the CreatQuery() method or something similar (within IQueryable) with IQStreamable. Within the workflow I am creating, this new query would be inserted into StreamInsight as a standing query. I have done quite a bit of research but have not found a solution. Also, most of the documentation appears to reference what is now a "legacy" adapter model. Any help would be appreciated.
What do you mean by "Dynamic Query"? Something similar to Dynamic Query Composition, where you could use the output of one query as a stream input into another query? If that's the case, you can use Subjects for this. Subjects allow you to have multiple publishers/subscribers for a stream and also provide the ability to attach/detach publishers and subscribers at runtime.
As far as I remember StreamInsights does not support that concept, the only way to archive that would be to use dynamic compilation to publish to StreamInsights query instance compiled based on dynamically generated code. That is quite possible.

Achieve Multi-tenancy with GATE

I am using GATE in one of my applications and I have few queries related to Multi-tenancy. My requirements are as given below.
I have the keywords set, specific for each user and depending on
which user is signed in, I need to initialise gazetteer with the
applicable set of keywords.
At a given time there could be multiple users logging into my
application and I want to make sure that the multi-tenancy
approach will not be inefficient.
I don't want to store the keywords for each user in the .lst
file(s) but store it on a DB (mongo) and inject only at the
runtime.
I searched the web for few samples and though I found some thoughts on working with Processing Resource, I have no idea how the performance will be affected.
Your help is much appreciated.
Thanks in advance,
Sajith
That's an interesting use-case for a GATE gazetteer.
One thing I believe you should definitely do is add the user ID as a feature when you're creating the document. This way you'll be able to make your MongoDB query in a processing resource later on.
When you're processing the document, you have several options:
Create a custom PR which calls MongoDB and replicates the DefaultGazetteer code but with overwritten "init" method (or inherit or wrap it, haven't looked into much detail if that's possible). Instead of the default init method you should provide your list of keywords, then set the needed fields and call execute().
If you don't have too many keywords, create a custom PR (or groovy scripting PR) which calls MongoDB and does some simple regex search like the one in this thread.
They also suggest the stringsearch library in the comments. Then just use start and end indices to create Lookup annotations on your own.
You said you don't want that but still, several million words can be handled by both the default and the Hash gazetteer. Although, you should be careful as gate documents could be very memory-intensive if you have too many annotations - in your case Lookups for all user keywords.
Hope this helps.

Implementing a DSL in Ruby for generating domain specific XML

I'd like to implement a DSL in Ruby for generating domain specific XML documents (i.e. XML which conforms to a specific schema). I can use e.g. Builder to write the XML in Ruby, which is already a great improvement on writing the XML manually, but I'd also like:
convenience methods that would generate a whole bunch of XML for me
and possibly a way to restrict the generator to a schema (not necessarily an XSD or a DTD, but the implementation could possibly generate only certain tags)
So my plan at the moment is to extend Builder with the convenience methods and ignore the schema restriction side of things for now.
My questions to the community are does this sounds like a reasonable plan, and more importantly, are there any DSLs out there that extend Builder in some fashion that I could use for inspiration.
Unfortunately googling for ruby, xml, builder, extend, dsl, ... doesn't return very interesting results.
I don't know if it uses Builder, but haml is certainly worth looking.
I also found this article wich mentions many more, of those, probably Markaby is the closest to your idea, but the last commit on github is from 2008. Surely looking at _why's code should be entertaining.

Resources