Difference between dirty and pristine in redux-form? - redux

This might be generic question as well, but talking specifically in terms of redux-forms, why are both dirty and pristine needed in the props. Wasnt it possible to only have one because both are exactly opposite of each other as given in the documentation here ?

Related

What is the state of OpenMath standard? Are there alternatives?

I have had a hard time finding any project that uses the OpenMath standard and that's still maintained. A lot of libraries seem to have disappeared, to be undocumented or rely on dependencies nowhere to be found... and I'm a bit lost.
Are there projects actively using this standard? Is there any cooler standard I'm not aware of? I know there's MathML and OMDoc but the first doesn't hold semantic information like OpenMath and the second relies on OpenMath, so neither of them counts as an alternative.
I have also found more recent libraries like pyopenmath and openmath-js, but neither of them implements the whole standard and are not being further developed.
(I wasn't really sure what site to post this question in... so if you think I should move it to somewhere else please tell me kindly. Thanks. Already moven from Math stackexchange)

If I use Google Closure, do I need to worry about absolute equality?

I was presented with this argument when fixing a bug related to implicit casting and speaking to the developer who told me:
If you use Closure, then you do not need absolute equality. Any value would be typed, therefor you don't need to worry about implicit casts.
My response was, that's dicey. You're making a lot of assumptions; Closure does not alter JavaScript, it's primarily a labyrinthine super layer (aside: probably a moot one, now that we have TypeScript).
Anyway, if one of these implicit things does slip by because the annotations don't resolve perfectly for some reason, you can end up with a tough bug (which is what happened; it got assigned to me because I guess the other dev didn't think it could be the problem).
I got responses of, "well if that dev had properly typed that object and this wasn't just an object and..."
Or...you could just protect against this sort of thing easily by using three equal signs instead of two. Use an assertion or console log to check the condition if necessary. Don't just leave it hanging out there.
Anyway what do you think; if you're using Closure, should you still observe the general best practice of using absolute equality in your JS code?
I know this leads to a wider conversation as well (e.g. Java 8's "optional" being "totally useless"), curious in the context of Closure though.
Question is a bit vague, code example would have helped. But yes, closure does not necessarily type every object and variable. I always use === unless there is a specific reason not to.

OpenMDAO: finite difference flag for Component.solve_nonlinear

For some of our components it would be useful to know whether it's being executed as part of a finite difference calculation or not. One example could be a meshing component where we'd want to maintain the same node count and distribution function during FD and allow for remeshing during major iteration steps. In the old OpenMDAO we could detect this from a component's itername. Would it be possible to reintroduce this or is that info already available to the Component class?
I can't think of any current way to figure out if you are inside an FD when solve_nonlinear is being called, but it's a good idea for the reasons that you mention.
We don't currently have that capability, but others have also asked to be informed when solve_nonlinear is being run for complex step as well.
One way to do this would be to introduce an optional_argument to solve_nonlinear such as call_mode="fd" or call_mode="cs" or call_mode="solve". The only problem with this approach is that its very backwards incompatible.
Another approach would be to add a regular python attribute to the component that you could check like self.call_mode="solve", etc. This one would be a pretty easy change and I think it would serve the purpose.
One last possible way would be to put a flag into the unknowns/params vector. So you would check params.call_mode to see what mode. This is somewhat sensible since its the param values that change when you're going to complex-step.
I think I like the last option the best. Both solve_nonlinear and apply_nonlinear need to know about this information. But none of the other methods do. So making it a component attribute seems a little out of place.

Why does JSONPath not support parent?

JSONPath seems to be a popular syntax to get XPath-like searching inside JSON data. And it has been repeatedly asked whether JSONPath supports navigation to a parent (see here and here).
My question is whether there is a good reason why it has not been suggested from the start, even though it is explicitly mentioned as unsupported. Is there some syntactic reason from JavaScript? Or is there some general workaround that I am missing?
This specification was written up on a blog; AFAIK, it is not part of any ongoing committee standardization.
However, to meet the need for parent accessors (and other features), at least one implementation, JSONPath-plus which is a superset of the original spec, allows for accessing parents through a number of means (see the README docs).
Disclaimer: I am involved in working on this implementation.

What is the Purpose of Deprecated Code?

I was changing out some PHP code the other day because it was deprecated, and no longer worked. I understand the meaning of deprecated code based on an answer I found here: https://stackoverflow.com/a/8111799/1810777
But several question came to mind:
I was wondering what is the purpose of deprecating code?
Why not just leave it in use, instead of recommending others to use
new alternatives?
Does it slow stuff down?
I couldn't find anywhere else online that talked about it. I'm just really wondering why code that used to work well, isn't useful anymore. Thanks!
It means that in a future release it's going to be removed.
This allows an API developer to give people time to migrate to the new version / method of doing whatever rather than just pulling the rug out from under them. Both the new and the old versions are available for a limited time.
As for why not leave it there forever ... because there's a new, better way to do it. You can't support legacy code forever (if you value your sanity and your budget). All support has a cost (be that tech support hours, bug fixes, regression testing, etc)

Resources