[Solved] Webpack 5 Alias Resolution Wildcard

D

DanMad

Guest
DanMad Asks: Webpack 5 Alias Resolution Wildcard
I am wanting to know if some sort of wildcard is available when setting aliases in Webpack 5.

My current aliases look like so:

Code:
// ...
resolve: {
  alias: {
    'scope:a$': path.resolve(__dirname, 'node_modules/@scope/package/a'),
    'scope:b$': path.resolve(__dirname, 'node_modules/@scope/package/b'),
    'scope:c$': path.resolve(__dirname, 'node_modules/@scope/package/c'),
  },
},
// ...

This works well. It's currently preventing Relative Path Hell in my project. I can import :

Code:
@use 'eddy:a' as a;

Instead of:

Code:
@use '../../../../../a' as a;

But I would love to solve this with one alias. Something like this:

Code:
// ...
resolve: {
  alias: {
    'scope:': path.resolve(__dirname, 'node_modules/@scope/package/*'),
  },
},
// ...

This example implementation throws an error:

ERROR in ...

Module build failed ...

...

Webpack's documentation doesn't seem to mention any possible wildcard for resolve.alias. Does someone know if wildcards can be used in a Webpack 5 alias?

Thanks in advance.
 

Unreplied Threads

Ideal difference in the training accuracy and testing accuracy

girl101 Asks: Ideal difference in the training accuracy and testing accuracy
In a data classification problem (with supervised learning), what should be the ideal difference in the training set accuracy and testing set accuracy? What should be the ideal range? Is a difference of 5% between the accuracy of training and testing set okay? Or does it signify overfitting?

SolveForum.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your thoughts here to help others.

why wouldn’t the COM change position due to internal forces acting on objects inside a trolley?

  • Nitish
  • Physics
  • Replies: 0
Nitish Asks: why wouldn’t the COM change position due to internal forces acting on objects inside a trolley?
Question 7.3 is where I have got a bit of a problem. I do know that the COM would remain unaffected by internal forces in its system but according to my textbook those internal forces are supposed to cancel out each other. In the problem the internal forces seem to come from the child inside the trolley but I don’t see how those forces could cancel out and not affect the position of the COM. I have tried to think about this in an another way - if COM’s position is mathematically defined to be dependent on the mass and relative position of the objects in the system why wouldn’t it change when the child (an object of the system) changes their position by running around the trolley? :trash: enter image description here

SolveForum.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your thoughts here to help others.

Temperature distribution in a greenhouse

  • Fefetltl
  • Physics
  • Replies: 0
Fefetltl Asks: Temperature distribution in a greenhouse
Here is my problem: Imagine an hemicylindrical greenhouse, with length $L >> R$, its radius. So we consider it as a 2D problem. According to the schematic we have the flux of the sun at the $\Gamma_1$ boundary which is about $ \Phi = \Phi_0 \sin \varphi$ and the external temperature is $T_e$.

How do you compute the temperature distribution in polar coordinate inside the greenhouse $T(\rho,\varphi)$?

This is what I did but I am really stuck (I tried a lot of different boundary conditions in fact, found solution that did not converge and so on...):

$$ \Delta_{\rho,\varphi} T = 0$$ Stationary heat equation

and the boundary conditions for $\Gamma_1$ (heat on circular roof = sun's heat + radiation gained from ground - radiation loss to ground - conduction loss with exterior):

$$ \lambda \partial_{\rho} T (R,\varphi) = \Phi_0 \sin \varphi - \frac{\sigma}{2} T(R,\varphi)^4 + \sigma T(\rho,m \pi)^4 \left( 1 - \alpha \right) - \frac{\lambda_g}{h_g} \left( T(R,\varphi) - T_e \right) $$

with $\lambda$, $\lambda_g$ thermal conductivity of air and glass. $h_g$ thickness of glass roof, $\alpha$ reflection coefficient from glass to infrared ground radiation (so $\alpha \sim 1$), $m = {0,1}$ and $\sigma$ the Stefan constant. Then the boundary condition on ground ($\Gamma_2$) is (normal derivative):

$$ \lambda \cos \varphi \partial_{\varphi} T (\rho,m \pi) = \frac{\sigma}{2} T(R,\varphi)^4 - \sigma T(\rho,m \pi)^4 $$

where we consider just the radiation from the circular roof to the ground and the radiation loss from ground to roof.

Then we have the intuitive symmetric solution of the Laplace equation:

$$ T = A + \sum_{n=1} a_n \sin (n \varphi) \rho^n $$

But at this point, even when neglecting the conductive part (the derivatives in the B.C) and linearized the fourth power of temperature according to $T(\rho,\varphi) = \tau(\rho,\varphi) + T_e$, with $\tau << T_e$ it is still not easy to find the coefficients. Does someone have an idea of how to proceed ? Maybe I should consider only the plan limited to x > 0 and using more general solution... I tried a lot of stuff. Thank you for reading and the interest for the topic.

enter image description here

SolveForum.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your thoughts here to help others.

How do we describe the radial velocity in elliptical orbits?

  • Nectac
  • Physics
  • Replies: 0
Nectac Asks: How do we describe the radial velocity in elliptical orbits?
When I look at the velocities of elliptical orbiting satellites the radial velocity (k in the figures) increases from zero magnitude at periapsis, to a maximum at the latus rectum, then back down to zero at the apoapsis. This describes a rate of increase opposite the direction of gravity that changes over time.

From periapsis to the latus rectum, the satellite to planet distance increases at an increasing rate. Then from the point of the latus rectum to the furthest point, apoapsis, this distance increases at a decreasing rate.

The change in distance describes a net acceleration away from the planet until the satellite reaches the latus rectum where the net acceleration reverses direction - in the same direction as gravity. This occurs despite the fact that gravity is in one direction and is decreasing in magnitude throughout the periapsis to apoapsis satellite journey.

What is the math that we use to calculate the radial velocity?

When the satellite crosses the latus rectum, the radial velocity k decreases. Fig 4 reveals that the rate of change in distance from the planet decreases at that point which agrees with the change of radial velocity k. There is a point of inflection at the latus rectum which means there would be a mathematical change of sign. Is there math out there that describes this change of sign?

What is the physics we use to describe why the radial velocity does what it does? I’m not looking for a geometrical answer here. We should be able to describe this physically like we do with any other thing in motion experiencing a force and acceleration. I just can’t find any mention of it in my searches. enter image description here

enter image description here

enter image description here enter image description here

SolveForum.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your thoughts here to help others.

Using TextCases to identify prepositions

Syed Asks: Using TextCases to identify prepositions
Code:
Clear["Global`*"];

prepositions1 = 
  TextCases[WordList[], "Preposition"] /. {} -> Nothing // Flatten // 
   Union;
prepositions1a = 
  TextCases[#, "Preposition"] & /@ WordList[] /. {} -> Nothing // 
    Flatten // Union;

The two syntaxes above check if a word is a preposition (or so I think).

Then I checked every word in the dictionary using WordData for PartOfSpeech:

Code:
prepositions2 = 
  If[MemberQ[WordData[ToLowerCase[#], "PartsOfSpeech"], 
      "Preposition"], #, Nothing] & /@ WordList[];

Finally I generated enough prepositions using RandomWord such that the result didn't change after applying Union. This seems like a recognizable list.

Code:
prepositions3 = RandomWord["Preposition", 1000] // Union
{"a", "abaft", "aboard", "about", "above", "across", "after",
"against", "along", "alongside", "amid", "amidst", "among",
"amongst", "anent", "around", "as", "aslant", "astraddle", "astride", \ "at", "athwart", "atop", "bar", "barring", "bating", "before",
"behind", "below", "beneath", "beside", "besides", "between",
"betwixt", "beyond", "but", "by", "circa", "concerning",
"considering", "contra", "despite", "down", "during", "ere", "ex",
"except", "excepting", "failing", "fer", "for", "fore", "forth",
"from", "in", "inside", "into", "lacking", "less", "like", "mid",
"midst", "minus", "near", "neath", "next", "nigh", "notwithstanding", \ "o'er", "of", "off", "on", "onto", "opposite", "out", "outshout",
"outside", "outwith", "over", "pace", "past", "pending", "per",
"plus", "pro", "qua", "re", "reference", "regarding", "respecting",
"round", "roundabout", "sans", "save", "saving", "since", "sine",
"than", "through", "throughout", "thru", "thwart", "till", "to",
"touching", "toward", "towards", "under", "underneath", "unless",
"unlike", "until", "unto", "up", "upon", "versus", "via", "vice",
"wanting", "while", "with", "withal", "within", "without"}

Code:
Length /@ {prepositions1, prepositions1a, prepositions2, 
  prepositions3}
{394, 394, 124, 124}

Try: Select[StringContainsQ["ist"]][prepositions1] to see what has made its way into the prepositions1 list.

Question(s)

How can I use TextCases to identify prepositions (or another part of speech) properly? Since I didn't get any warnings, I want to ask if TextCases is intended to be used like this.

Thanks for your help in advance.

SolveForum.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your thoughts here to help others.

Bayes estimator p under squarred and absolute error loss function for a biased coin

Michael Gerund Asks: Bayes estimator p under squarred and absolute error loss function for a biased coin
We will toss a trick coin with θ probability of heads, and assume a uniform prior. After x tosses, we found no heads. We need to find the Bayes estimator of θ under both absolute error loss function and under squared error loss. How do the estimates change as x→∞ ?

SolveForum.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your thoughts here to help others.

Given a linear code $C$, then the subset $D\subset C$ with $D:=\{v\in C : w(v)=2k \textrm{ for }k\in \mathbb N \}$ is a linear code

  • Mikel Solaguren
  • Mathematics
  • Replies: 0
Mikel Solaguren Asks: Given a linear code $C$, then the subset $D\subset C$ with $D:=\{v\in C : w(v)=2k \textrm{ for }k\in \mathbb N \}$ is a linear code
I found the problem above in one of the previpous year exams for my discrete mathematics course but I think it might be wrong.

I've seen similar problems but they all add the hypothesis of $C$ being binary. This way, when analyzing the different cases for the addition of two elements of $D$ I get that $w(x+y)=w(x)+w(y)-2\{i\in \{1,...,n\} : x_i=y_i=1\}$ . This way, I can make sure the weight of the sum of two elements in $D$ is even and therefore the sum is an internal operation in $D$. That added to the fact that the element $0$ has an even weight ensures that $D$ is a vector space and therefore a lineal code.

However, when analyzing a field different to $\mathbb F_2^n$ I fail to find that $w(x,y)$ has to be even.

In fact, couldn't I just use $x=(1,2,0), y=(2,2,0) \in \mathbb F_3^3 $ such that $(x+y)=(0,1,0)$ where $w(x)=2, w(y)=2$ but $w(x+y)=1$ as a counter example?

I'd like someone to verify if the property is true or if my professor made a mistake in the exam.

I'd also apreciate it if someone checked the my reasoning on the binary part.

Thanks in advance

SolveForum.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your thoughts here to help others.
Top