How can I get a change history of faunaDB document? - faunadb

FaunaDB's At() function looks so nice! I wonder if I can log a time series of sensor data into one document, and draw a time series chart by At() function and change history of the document.
So, is there any way to get a change history of FaunaDB's documents? Thank you for your suggestion!

Events($ref) will give you the history of a document. The amount of retained history is configurable. The complete docs for Event is found here.
That said I'm not sure I'd choose to implement a sensor time series that way. I'd be more inclined to write a separate document per reading. Mostly because it's easier to work with first class values for time series and if you need to record quickly you won't run into conflicts.

Related

Vue 3 Better performance of lot of DOM elements

I have a big fat sort of table with lots of elements that make it really buggy.
For context 1 row per user, each user has X projects and each project has 3 month of day display (sort of gantt)
So I built something cool it's working great, but if I scale to more users it begin to be real buggy.
I'm implementing filter to display less users but at some point it need to handle the limit that I have now without being buggy.
What I found is when I'm updating a day it re-render the whole Gantt which is really stupid.
here is a minimal reproduction link: https://stackblitz.com/edit/vitejs-vite-g6azah?file=src%2FApp.vue&terminal=dev
As you can see when I'm updating an input with the v-model:
value.value
I have the attribute with the function
:test="testRerender()"
That trigger for the whole Gantt and I believe it is the issue here.
I saw v-memo that look like what I need but I can't figure out with the doc how can I use it to match my needs (and there is almost no good article on it)
Thanks for your help you would save my life!
I tried to filled proper :key attribute, code optimization, v-memo etc...

Optaplanner: How to calculate score delta for move

I'm using Optaplanner to automatically solve school timetables. After a timetable has been solved the user will manually change some lessons and will get feedback on how this affects the score via the following call:
scoreManager.updateScore(timetable);
This call takes some 200ms and will, I assume, do a complete evaluation. Im trying to optimize this and want to only pass in a Move object so that Optaplanner only has to recalculate the delta, like:
scoreManager.updateScore(previousTimetable,changeMove);
Is there a way to do this?
There really is no way how to do just a single move. You don't do moves - the solver does moves. You can only make external problem changes to the solution. You should look into the ProblemChange interface and its use in the SolverManager.
However, the problem change will likely reset the entire working solution anyway. And after the external change is done, you're not guaranteed that the solution will still make sense. (What if it breaks hard constraints now?) You simply need to expect and account for the fact that, after users submit their changes, the solver will need to run; possibly even for a prolonged period of time.

UiPath pdf table scraping into a DataTable type

Can I somehow import a table from pdf to a UiPath DataTable?
I can do it via loading it to a string array and after that splitting it. But I hope so there is a better and more safe solution to get a table from PDF.
The easiest way is to use the Read PDF Text activity.
As it's often changing, it does really make sense to give you a tutorial here about how you add it to UiPath and what parameters you currently have. Overall all info you can find on the official detailed tutorial.
Basically this activity gives you the easy way of extracting data and managing it.
If the result is not okay you will need to switch to the OCR activity with nearly the same name. This one reads the data visually. But from what you gave here, I would not recommend you that.
There are many other activities out there, like extracting it into an Excel Workbook. So simply try out what you need.

Solving VRPTW using OptaPlanner

I have tried to run example https://github.com/droolsjbpm/optaplanner/tree/master/optaplanner-examples/src/main/java/org/optaplanner/examples/vehiclerouting
as it is written here:
http://docs.jboss.org/optaplanner/release/6.3.0.Final/optaplanner-docs/html_single/index.html#downloadAndRunTheExamples with data set cvrptw-25customers.xml . When I changed readyTime and dueTime in some customers, it didn't result in any change in score. It looks like this program doesn't care about time windows. Should I change something in Java classes? My goal is to get time needed to drive to all customers, taking into account all time windows.
This should work, I 've done it several times myself. Potential causes:
Did you load the xml file again? Try changing the VehicleRoutingPanel code so it's obvious which customer you changed and if indeed the values changed. Compare the screenshot of before and after your change (or duplicate the xml file so you keep the original).
If some arrival times and dueTimes change, the score doesn't need to change. Try making very small time windows, at annoying times, that should definitely impact the score and make it worse.

How to Store lots of text in Core Data

This is a design questions, so multiple ideas will be fine.
In my iPhone app, I keep track of Multiple players' life, which can increase and decrease over time. After the game is done, I want to be able to show them their life throughout the game, so they can see how they did. Now, this will also be stored in Core Data, so they can look over their past games and see how they did.
So, the question is this: What is the best way to do it? I would like this information present in the life log:
time: Player Name - Current Life (Change in Life)
Where those variables would be stored and would be pulled out to display the list. So what's the best way to do this? Should I make a "Life Change" entity in Core Data and have many many of these lines in it? Or is there a better way?
Thanks for your advice!
Have a life entity that is hanging off of a one to many relationship that stores the data that is needed. Then when you display the data, turn those objects into text to display to the user, there is no reason to store thar kind of information as raw text in core data when you just need to store the variables.