What is the best algorithm known to learn the regular expression from a set of positive examples?

I have a blackbox program that generates a set of strings. What is the best regular expression learner that I can use to learn (approximate) what the blackbox program uses as a generator? Note that I only have positive examples. (Checking whether a string is accepted or rejected is possible but rather costly). I see that algorithms like RPNI and L* requires both positive and negative examples.

I especially want to avoid overgeneralization.

Examples of handling exceptions in ways other than logging

Something I haven’t quite grasped.

You catch exceptions if you can “handle” them, e.g. if you check a file exists or not, and perform action if the file exists, but then let’s say the file is deleted, you would throw an exception. This could be “handled” by prompting for different input etc. Other examples are using a different web service if one is down, anything with the Polly framework.

However, are there examples of where you can handle an exception with anything more than logging? Just seem to have a mental block with this. So basically examples of any code other than logging in a catch block.

Thanks

How to “open all” examples in local help pages for Mathematica 12?

Sorry if this is easy to find, but I am not able to find it.

When I do ?DSolve and select local help (this is new in V12), the help page that comes up says there are 157 examples. But below it only 2 basic examples are shown.

How does one open or see all 157 examples at once to browse them all? Clicking on Examples only closes the basic examples page.

Mathematica graphics

Is one supposed to manually open each link in the list below and search each looking for these examples?

Now if I select the web version of the help, I see this on https://reference.wolfram.com/language/ref/DSolve.html

Mathematica graphics

And it works. Clicking open all it opens all examples there. I did not count there are 157 ofcourse, but at least all examples are on same page on the web.

How can one view all 157 examples of DSolve in the local help page?

V 12, windows 10.

Any best practices or examples of mix and match functionality on a fashion e-commerce?

I’m trying to design this feature, but so far not much luck finding any decent implementations of this feature. one example is http://www.bonarium.com but even that is pretty basic.

what would the user flow be like? for now i think the feature could be triggered when a user add an item to cart and then browses to a category that compliments the 1st one (e.g. 1st shirt, 2nd pants)

and which pages would this feature be able to be accessed from. catalog? pdv? cart?

how would the user be able to add products into selection of products?

Teaching cohomology via everyday examples

This question is a “sequel” to my similar questions about the fundamental group and homology. All of these questions were inspired by seeing a talk, by Tadashi Tokieda, about the interesting physics that appears in toys.

Short version:

What stories, puzzles, games, paradoxes, toys, etc from everyday life are better understood after learning about cohomology?

Long version:

I am teaching a short course on cohomology, from chapter three of Hatcher’s book. I would like to present a collection of real-life phenomena that are greatly illuminated by actually knowing about cohomology. Ideally, I would refer back to these examples as the course progressed and explain them with the new tools the students learn.

There are some interesting examples, best explained via cohomology, given as answers to my previous questions. These include:

  • Impossible objects such as the Penrose tribar that exist locally, but not globally. (I would be very very happy to get a much longer, more in-depth reference.)

  • Currency arbitrage.

  • Addition with carrying.

Here is a non-example:

  • The belt trick; this relies on the fundamental group, not on cohomology.

And here is one example firmly on the border:

  • Kirchhoff’s laws for electrical circuits. Now, these are cohomology made flesh, but they are not quite an “everyday” example…

Examples where existence is harder than evaluation

In expressions involving an infinite process (infinite sum, infinite sequence of nested radicals), sometimes the hardest part is proving the existence of a well-defined value. Consider, for example, Ramanujan’s infinite nested radical: $ $ \sqrt{1+2\sqrt{1+3\sqrt{1+\ldots}}}. \qquad(*) $ $ Assuming the above is well-defined, there is a slick trick showing that it evaluates to $ 3$ .

But such careless assumptions can lead to trouble, as in the example of the expression: $ $ -5 + 2(-6 + 2(-7 + 2(-8 + \ldots))). \qquad(**) $ $

Applying the identity $ n = -(n + 2) + 2(n + 1)$ repeatedly for $ n=3,4,5,\ldots$ , we get \begin{align} 3 &= -5 + 2(4) \ &= -5 + 2(-6 + 2(5))\ &= -5 + 2(-6 + 2(-7 + 2(6))\ &= -5 + 2(-6 + 2(-7 + 2(-8 + 2(7)))\ &=\ldots, \end{align} which would falsely suggest that $ (**)$ evaluates to $ 3$ .

What are some interesting examples where evaluating an expression assuming its existence is much easier than proving existence?

Any examples on how to use requisition_lists API Endpoint?

Trying to use the save requisition list REST API endpoint. The API docs are not very clear on what the values should be and currently don’t have access to the B2B module code to see what it exactly needs for the JSON input.

So, has anyone used this endpoint before? What would be a working example JSON? Am I even supposed to use this endpoint?

Doc link: https://devdocs.magento.com/redoc/2.3/async-admin-rest-api.html#operation/requisitionListRequisitionListRepositoryV1SavePost

Endpoint Example (POST method): https://magento-store.com/index.php/rest/V1/requisition_lists

Example of what I have used:

{   "requisitionList": {     "id": 0,     "customer_id": 215120,     "name": "My List A",     "updated_at": "2019-05-06T15:49:00",     "description": "None",     "items": [       {         "id": 1,         "sku": 20410320,         "requisition_list_id": 0,         "qty": 10,         "options": [],         "store_id": 1,         "added_at": "2019-05-06T15:49:00",         "extension_attributes": {}       }     ],     "extension_attributes": {}   } } 

Example Responses (2 of them):

{     "message": "Could not save Requisition List" } 
{     "message": "Internal Error. Details are available in Magento log file. Report ID: {error-id}" } 

Why each functor defines an invariant, but not every invariant is functorial ? Examples?


In Category Theory each functor defines an invariant, but not every invariant is functorial

Why ?

Can you provide some examples when

  • a functor is an invariant
  • a invariant is a functorial
  • a invariant is not functorial

I need also another example:

– a functor is not an invariant $ =>$ this is absurd and false but I need that you show me the underlying contradiction

Idea

For $ A$ a monoid equipped with an action on an object $ V$ , an invariant of the action is an generalized element of $ V$ which is taken by the action to itself, hence a fixed point for all the operations in the monoid..

An action of a category $ C$ on a set $ S$ is nothing but a functor $ \rho : C \to$ Set.

Examples of problems where considering “discrete analogues” has provided insight or led to a solution of the original problem

The Kakeya conjecture posits that any Kakeya set in $ \mathbb{R}^n$ has dimension $ n$ .

A discrete (finitized?) version of this problem is the Finite Field Kakeya conjecture, which was proved by Dvir in 2008.

My understanding is that the Finite Field Kakeya Conjecutre was proposed at the end of the twentieth century with the hope that it would lead to methods that could be applied to the original Kakeya conjecture. However, it seems that in this case the approach used for resolving the discrete analogue is not easily applied to the original problem, so that the Kakeya conjecture still remains open.

My question is asking for examples of problems where discretizing “succeeded.”

Question: Are there examples of math problems where looking at a finite or discrete variant of the initial statement did lead to a solution (or if not a complete solution, at least significant progress) of the original problem? If so, what are they?

Edit:

As commenters pointed out, this question is similar to the one here which requests examples where a discrete version of a theory was developed before the continuous version of the same theory.

My question is different from that previous question, in that I am not interested in cases where discrete problems predated continuous problems. Instead, I’d like to learn about instances where a continuous problem was already proposed, and studying a discrete version of that problem helped inform a solution to the continuous variant.