What are the size limits of a Federation replicator?

Question: Are there any size limits on the items that a replicator can produce? Has there been shown any different sizes of replicators capable of replicator large objects? What are the smallest and largest things we know to have been replicated?
Comment: @Robotnik There are larger replicators than the usual small food ones.  They refer to them as 'industrial replicators'.
Comment: @Keen: What are the limits? Obviously they don't replicate the 1701-E.
Comment: As far as I can remember for bigger items they replicated parts first and then assembled later, take Voyager's [Delta Flier](http://en.wikipedia.org/wiki/Delta_Flyer) for instance. as for the actual sizes of the replicators, I can't help but think they would have an 'industrial' sized one as well as the mess-hall or personal-sized ones
Comment: @Keen - "*swish*"
Answer: There are two types of replicator:

Small ones that will fit inside a Starfleet cabin and is used for replicating food, clothing etc.. These are common and are used extensively, especially on starships were cargo space is at a premium.
Industrial ones that are used for replicating large components of ships and industrial constructs. As few as 15 industrial replicators are needed to kick-start a civilization that has suffered a planet-wide disaster (this was mentioned in one of the episodes, most likely DS9: "For the Cause" or DS9: "Sons and Daughters" [src]).

There are a couple of limitations in replicator technology:

Unlike transporters, replicators work at a "lower resolution", (molecular rather than quantum). This limits the amount of storage needed for the "templates" of anything required to be replicated but also means a replicated object isn't exactly the same as the real thing (several characters in TNG and DS9 noted how replicated food/drink doesn't taste the same as the real thing).
As the object being replicated increases in size, the energy required goes up exponentially, so while building a big enough replicator is feasible, the energy requirements would make it impractical.

Since replicators use molecular resolution, presumably they could replicate anything down to this size.
Answer: I don't remember any established or mentioned size restriction, so I'd say it always comes down to some obvious limitations:

Limited space: They obviously can't build replicators big enough to be able to create a whole ship inside (as they still have docks).
Limited energy: I assume the bigger your replicator the bigger the required energy (due to bigger distances when arranging atoms and stuff).

As far as I remember they only ever mentioned "replicators" as well as "industrial replicators". The difference is obviously the size and possibly the standard array of available things to create. I also don't think the latter would belong to the default equipment on spaceships, so most crews would be limited to using small/standard replicators. I'm not sure about ships like the Enterprise or Voyager, because they're made for deep space travel, and as such might include an industrial sized one as well to replace bigger spare parts in case the need arises.
Back to limitations:
Considering the beaming technology is considered to be closely related to replicator technology, I assume they've got similar restrictions. As such I assume an industrial sized replicator isn't significantly bigger (available space wise) than the common federation transporter platform. This would probably also fit with the Delta Flier's size mentioned in the comments: Even a small shuttle wouldn't fit inside, but obviously most or all parts as a whole when unassembled. Holodecks seem to be quite a lot bigger, but I think they're not really comparable, considering they don't create matter that keeps existing on its own.
Answer: Replicator technology is based on the same fundamental methods as transporter technology, only instead of taking an object, converting its mass to energy and beaming that to a location (in such a manner that it decays back into matter in the same pattern as it was originally, at some predetermined distance), replicators just start out with energy and beam it in such a way that it decays back into some arbitrary, pre-determined pattern of matter.
Sort of skipping step one.
If this is true, then in theory there should be no distance limitations to a replicator. It could replicate something thousands of miles in length, because beaming to a location thousands of miles away is quite routine. Rather, if something prevent replicating such a large object it would not be "size" at all, but the amount of mass. Each kilogram of mass of the object requires something on the order of 8.15E+16 joules, which is alot. It's an almost inconceivable amount of energy (enough to ruin your day if used maliciously). So while the size of an object created by a replicator could be quite large, having enough energy to make such is another thing entirely.
In truth though, there are probably too many Wesley Crushers but with half the IQ running around. You don't want them replicating a 670 meter steel I-beam in their quarters while Lt. Mommy is on watch duty, which could punch a hole through the hull or those fancy windows and explosively decompress the brat. I imagine there are software limitations to replicating objects larger than would fit within the replicator unit.
Answer: Actually think of a replicator like a 3d printer.  They do have industrial sized ones, they use them to make the parts to build the ships, and to repair them by making new parts.  The energy is not a problem a ship that contains this would have plenty, as the warp core, dilythium crystals make plenty, so stop worrying about energy.  The industrial replicators themselves are huge, but the area that produces the item is still limited to a certain size.
Lets say a new plate needed for the hull, we are talking about 20x20 give or take, or larger even.  Now think like a 3d printer, printing part and as it prints more it's expelled out, onto rollers, or such, until it finishes the end.  In this way you can have a piece thats say 20ft tall, but also 100 feet long.  The problem is the amount of matter (atoms) needed to produce such things.  The Nacelles collect only a certain amount while traveling (the fronts are made as collectors).  Energy is not the issue, material matter is because that's why Voyager had replication rations throughout the show because the matter to make the replacements and food came up short multiple times.


My text looks different on different documents although I've used the same paragraph styles

Question: I have a document of 27 pages. I've used the same paragraph styles for all of them. When I export it to a PDF, the text on some of the pages look stroked although I haven't used a stroke. I took a print out and they look the same but when I look at the PDF files the difference is visible. How do I fix this?
Comment: Have you tried viewing the PDF on different computers on the same operating systems, and then on a different operating system?

Assuming you're on Windows 7, try viewing the document on another computer that is running on Windows 7. If it's fine there, fault's on your computer. If not, then try Windows 8.

If it's fine there, fault's with W7. If not, try Mac and Android or another OS.

If it's fine there, it's a Windows problem. If not, I have no idea what's wrong. :D
Comment: Could we have some screenshots, please? :}
Answer: On the pages where the text appears to be outlined (I think that's what you mean by "stroked"), it sounds as if you have some kind of transparency effect that overlays the text. This could be a Blend Mode applied to an image or colored object, a drop shadow, or something similar.
Because transparency is flattened in many types of PDF output (and most PDF viewers assume that it will be, even if the PDF itself contains live transparency), any kind of transparency that overlays a piece of text (or any vector shape, for that matter) causes the entire region to be rasterized.
You can check for this kind of thing using InDesign's Flattener Preview (Window > Output > Flattener Preview), and you should, because it can be a problem with small text sizes. As an example (and just to make it really obvious), I've drawn a box over some text, made the fill transparent and given the object a drop shadow.

Flattener Preview shows where vector items will be rasterized in order to preserve the appearance of the transparency:

Notice that the area which will be rasterized extends beyond the visible edge of the drop shadow.
It is a best practice in InDesign to place all text on a layer above any areas that have transparency applied. When the transparency effect is under the text, all the font information remains in vector form inside the PDF.
Effects like this can often be more obvious on screen than in print, because the PDF viewer's rendering engine is working with a much lower resolution display than the fine dots of a printer output.
The reason for all this complexity about flattening is that PostScript, the page description language created by Adobe that has been the standard for decades, doesn't know about transparency
Answer: while exporting to PDF, do include "FONTS" .. and "prepare it for printing".. It will use maximum resolution for images. And fonts which are being used in file will be embeded in PDF file..
otherwise, OS and PDF readers tries to find the maximum next matching font if PDF used font is not available in computers....
Secondly most of the time PDF viewer settings are set FAST or DRAFT privew to faster preview of pdf.. while printing, PDF understands the quality needs Higher resolution and finest font. This setting are also available in PDF export screens.
I hope this could help you in resolving the issue..
Thanks
Answer: Have you tried zooming in and out? When a document is zoomed in at an odd number (like 87%) you get letters that looks heavier. Simply zooming to a round number usually fixes the problem.
Hope that helps.


Why would tube patch sometimes peel off with backing?

Question: Sometimes, when patching a tube, the newly placed patch will peel off when removing the backing. Sometimes I have this problem and sometime I don't and I'm not sure what the difference is. Is it the age of the glue/solvent? Not sanding enough? The temperature? The amount of time I'm waiting for the glue to dry?
Answer: I've found that the amount of time I let the glue dry makes the biggest difference. It really needs to get from "wet" to "tacky" to work best. Scraping the tube and the glue brand make a bit of difference too.
If the patch seems relatively well stuck, but comes up when you try to take the backing off, just leave the backing on; it won't hurt anything.
Comment: I've read elsewhere that it helps to shorten the drying time by smearing/flattening the glue with a 'clean' finger.
Answer: One critical step that's often missed is thoroughly bedding the patch.  After installing it (I prefer the glue to not be totally dry but with a few specks of "damp" yet) but before removing the plastic backing you take something like a smooth-ended tire iron and rub it slowly back and forth across the patch, pressing hard.  This assures that the patch, tube, and glue have fused together.
Then leave the plastic backing on, as it helps prevent the patch from sticking to the inside of the tire.
Comment: When at home, I use a wood clamp to apply pressure to the patch - and then leave it overnight. That always works but is not practical on a ride.
Answer: It almost never happens to me when I patch at home and not being on a rush, but when I patch during a ride, particularly on humid cold weather and if trying to do it quickly, So I guess that not allowing the glue to chemically act on the tube and not allowing it to dry is part of the key.
But also, I learned a trick after observing that when I take car tires to repair, they apply a patch and use a roller tool to really press the patch into the tire. The tool is actually a little wheel on a handle that allows to apply great pressure into a small area of the patch.
I use a somewhat similar approach: After allowing the glue to dry or become tacky and applying the patch, I place the area being patched over a curved part of the bike (top tube for example) and roll the bike pump or another cylindrical object over it. Think of what a baker does with a rolling pin. In that case the bike pump would be perpendicular to the top tube and I'd roll it back an forth applying pressure and leaning the pump left to right a little bit with each stroke. The point of this action is to apply a lot of pressure over a tiny area of the patch, until all of the patch has been pressed down.
That is obviously for repairs while on the go, at home you may have the roller tool or another substitute, or something else besides your bike to place under the tube.
Regarding the backing of the patch, when on the go I just leave it in there, as it prevents glue from sticking to the tire an it does not affect anything in any way. When At home, I usually check the repair after letting the glue dry for a long time (a day or a couple of hours). This check is to inflate the tube and submerge it in water, watching for bubbles. This wets the paper backing, letting me remove it by rubbing with my thumb.
Here is a picture of the tool if you'd like to acquire one:


Blender 2.8 - WorkBench - Gradients appear very low quality

Question: I'm building some models for a game that doesn't have any light sources so all the shadows and highlights are painted into the texture. Because I don't need any light sources I'm using WorkBench as the Render Engine as my understanding is that this Render Engine just prints the texture on the model similar to how "Texture View" did it in previous versions. So far so good, but what I'm noticing is that the gradients from the texture are much lower quality when I'm viewing the render in the viewport than they are in the actual texture file. Any idea why that might be happening? Thanks!
Here's a screenshot of what I mean:
Answer:
check your monitor/graphic driver color profile
check your image texture or it's color profile
check blender color management
Comment: Alright, will give it a try, thanks!


Mobile User Registration

Question: I am writing an android (and eventually iphone) app that is proposing to register a user to a wordpress site. The intent is to have the user registration solely through the mobile device and not through a website front end. The app will update the wordpress site and the user will be able to login in to see his data. I have a general idea on how to use the wp hooks with json to do the mobile registration. However, is there a way to the registration process without enabling "anyone can register" in "general/settings"? (note: I looked through all the questions using "Mobile User Registration" but did not see any related.). Thanks in advance
Comment: Look at XML-RPC, then please come back and file an [edit] with your research and your try/errors.
Comment: Had you _tried_ it? I am not sure this setting actually prevents you from creating user with code.
Comment: I'm in the process of setting up an android app (Was hoping to get an answer first :-) ). My impression from the code at the link below is that the setting is as you suspect. http://android.svn.wordpress.org/tags/2.0/src/org/wordpress/android/AddAccount.java
Answer: New users CAN be allowed to register remotely without setting "anyone can register" in "general/settings". The client is android and in addition to the android java client code using the 'org.xmlrpc library', the following was added to 'functions.php' in the child theme:
<code>function xml_add_method( $methods ) {
    $methods['xxx.wp_create_user'] = 'xxx_wp_create_user';
    return $methods;
}

add_filter( 'xmlrpc_methods', 'xml_add_method');

function xxx_wp_create_user( $args ) {
    $uname = $args[1];
    $pword = $args[2];
    $email = $args[3];
   $user_id = wp_create_user( $uname, $pword, $email );
   return $user_id;
}
</code>

Mobile User Registration


How can I get the day / hour traffic view in Google Analytics?

Question: On Google Analytics mobile, I can get the following view, which I find really useful. How can I get it for Google Analytics on desktop?
Comment: Questions on Google Analytics are much better suited for [webmasters.se], not here. This should have been migrated there.
Answer: It doesn't look like this exact chart type is available on the desktop version.
For equivalent data, you might try drilling into Behavior > Overview > Hourly.
Find more here (plus a custom report configuration) at this Stack Overflow answer:
https://stackoverflow.com/a/24781297/896802


$f:\mathbb{R}^n\to\mathbb{R}^n$ is diffeomorphism iff $f$ is local diffeomorphism and proper map

Question: I have to prove that a proper local diffeomorphism in $\mathbb{R}^n$ is a diffeomorphism. I'm trying to show that it is injective but I just have that the preimage of every $y\in\mathbb{R}^n$ is a finite set.
Could anybody help me?
Thanks.
Comment: Try to prove that it is a covering map. If this is the case, then since $\mathbf R^n$ is simply connected, it is in fact a diffeomorphism.
Answer: First remember that a proper map is closed. Because $f$ is a local diffomrphism its open hence $f(\mathbb{R}^n)$ is a closed and open set so $f(\mathbb{R}^n)=\mathbb{R}^n$.
Now we will want to show that $f$ is injective.
Let's show that if $f$ is local diffeomorphism and proper map we can lift any path uniquely once we choose a base point. Let $\alpha:[0,l] \to \mathbb{R}^n$ be a path. Once we choose a base point $p$ such that $f(p)=\alpha(0)$, we can use the fact that $f$ is a local diffeomorphism to lift $\alpha$ to $\tilde{\alpha}:[0,a) \to \mathbb{R}^n$ for some $0<a \le l$. Because $f$ is a local diffeomorphism the set $A$ of $a \in [0,l]$ such that $\tilde{\alpha}:[0,a) \to \mathbb{R}^n$ is open in $[0,l]$. if we can show that its closed we have shown that $A=[0,l]$ because $[0,l]$ is connected.
Assume to the contrary then exist $t_0 \in [0,l]$ such that $A=[0,t_0)$. Let $\{t_i\} \subset [0,t_0)$ be such that $\lim_{i \to \infty }t_i=t_0$. Since $f$ is proper and $\alpha([0,l])$ is compact we can deduce that $\{\tilde{\alpha}(t_i)\} \subset K$ where $K$ is compact. Let $r$ be an accumulation point of $\{\tilde{\alpha}(t_i)\} $ and let $V$ be a neighborhood of $r$ small enough such that $f_{\restriction V}$ is a diffeomorphism. Then $\tilde{\alpha}(t_0 ) \in f(V)$ and, by continuity,
there exists an interval $I \subset [0, l]$, $t_0 \in I$, such that $\alpha(I) \subset f (V)$.
Choose an index $n$ such that $\tilde{\alpha} \in V$ and consider the lifting $g$ of
$\alpha$ on $I$ passing through $r$. The liftings $g$ and $\tilde{\alpha}$ coincide on $[O, t_n) \cap I$,because $f_{\restriction V}$ is bijective. Therefore, $g$ is an extension of $\tilde{\alpha}$ to $I$,
hence $\tilde{\alpha}$ is defined at $t_0$ and $t_0 \in A$. This shows that $A=[0,l]$.
Now I get lazy and state a theorem form do Carmo curves and surfaces 387 (Its a similar construction to what I have done above)
Let $B$ be arcwise connected and let $\pi: \tilde{B} \to B$ be a
local homeomorphism with the property of lifting arcs. Let $\alpha_0, \alpha_1: [0, l] \to B$
be two arcs of $B$ joining the points $p$ and $q$, let
$H: [0, l]×[0, 1] \to B$
be a homotopy between $\alpha_0$ and $\alpha_1$, and let $\tilde{p} \in \tilde{B}$ be a point of $\tilde{B}$ such that
$\pi(\tilde{p}) = p$. Then there exists a unique lifting $\tilde{H}$ of $H$ with origin at $\tilde{p}$.
To complete the proof: Take $p_1 ,p_2$ such that $f(p_1)=f(p_2)=b$. Let $c$ be an arc from $p_1$ to $p_2$ so $f\circ c$ is a loop based in $b$. $\mathbb{R}^n$ is simply connected so $f\circ c$ is homotopy equivalent to the constant loop $\alpha(t)=b$ for all $t \in [0,1]$. But this shows that $c$ is homotopy equivalent to a constant path and this can only happen if $p_1=p_2$. This shows that $f$ is injective. As differentiability is a local property we can deduce that $f^{-1}$ is a differentiable function hence $f$ is a diffeomorphism.


Stream order and stream number

Question: I am Getting higher stream number for lower order streams in my analysis on ArcGIS,  order 6 has more streams than order 5. is this common in morphometric analysis?
Answer: Without a little more information on your project and files, it seems like your GRIDCODE value stands for your ranking order, and the count merely stands for the size (number of cells) of your feature.
If that's the case, it means that your stream of rank 6 is bigger than that of 5. I'm not sure if it's logically reasonable without knowing a little more about what you are trying to do. If the order of your stream is solely decided by the size of each, then probably no.
Comment: i am trying to do a morphometric analysis for a clipped basin from a DEM. i want to know the stream network in the basin. how many channels or segments and the stream orders as well. that is my work.
Comment: However, if i use a raster calculator, say 500 or 400 or 300, the ranking and count will reasonable and stream numbers will decrease gradually. but the total number of streams will be less with the raster calculator
Comment: I need a little more information on the raster calculator part. What did you do exactly with `raster calculator` and what was the formula you used with it?

Stream order and stream number


What is Ana's relationship to Deckard?

Question: Most people agree that Ana created K's memory of the horse and the bullies and therefore is Deckard's daughter, but at the end of the film, K gives Deckard the wooden horse and then 'remembers' a bit more, which is that the horse was not his but had been left in the orphanage by another child i.e. Deckard's daughter. So, if Ana created the memory from her own, then she can't be Deckard's daughter, or it's a red herring added to the memory to confuse any possible accusations of her having illegally used a real memory?
Answer: Yes. She was hidden in the upgrade center by Freysa. The story about her having a "compromised immune system" is likely false.
K remembers that the horse was left there by a child... that child is Ana.
The memory is Ana's memory from when she was in the orphanage.
From Den of Geek:

So Ana has spent the last few years of her life in a single room inside a Replicant upgrade center, creating fake memories for Wallace, who implants them into his Nexus-9s. This is why K has the memory of the wooden horse. It's in fact Ana's memory from when she was a little girl and left behind in a San Diego scrap yard. As Ana explains to K during his initial investigation into whether he's Rachael's son, every designer of memories puts a little bit of him or herself in the memory.

What we're seeing at the end is likely K re-interpreting the memory. The kid is the same child, not a different one from earlier versions of the memory. It's also worth noting that the memories are for the benefit of the audience, not likely the internal memories that K is having. If they were K's internal memories, we would be seeing them from a first person point of view of the child - meaning the camera would be the child's eyes at all times and we'd see what they saw - but this isn't the case. We're always shown the memory from a third-party position.
Here's a useful explanation (from the gaming world) of the differences between first, second and third-person perspectives:

So, even the first time we see the memories, we can see the child. Not as clearly as the last time, but we definitely see more than only their hands and feet. In fact, this seems to be the way the memories are crafted entirely. When Ana's building the memory of the birthday party, if we assume that the girl celebrating her birthday is the person whose memory it is, we can, again, see her. I choose to interpret this to mean that when we see the person, we're really sensing their personal "presence" in the memory, rather than their actual physical representation.
Also, it's valuable to remember that, at any point in time, memories are nothing like a video playback. People often remember sounds, smells, tastes and images but they're unlikely to remember a full sequence of events as if it were a detailed video. Those memories are also corrupted over time. Someone telling you part of their own memory of something can affect what you remember or how you remember something, so I think we should be interpreting the "memory" sequences as something other than direct memories. As with any flashback, they are presented for the viewer.

Interesting tidbit... they actually give away the fact that the child with the horse is female with the first playback of the memory. I remember noticing that the child being chased had hair while the ones doing the chasing had shaved heads. In the orphanage, only the girls have hair, so the child running away must be female.
We don't know that convention to be the case, so we assume that the child is male with short hair.
Comment: @HRRRR: I don't follow your logic. Why can't Ana be Deckard's daughter?
Comment: How does K have a memory of the horse being left in the orphanage by another child? If it's from Ana's memory and she's remembering it's not her toy as she is chased by the bullies then she can't be Deckards daughter - the original owner of the wooden horse.
Comment: I interpreted K's thoughts as he hands the toy horse back to Deckard at the end, as an additional bit of 'memory' about time in the orphanage.  From my own memory he looks down at the horse in his hand and the  the voice over says -this isn't my toy, it was left in the orphanage by another child- My point is, if this is memory, then it can't be the memory of Ana as it's from the POV of the child who gets the toy after she has left it in the orphanage. However, as someone above has pointed out, K may be reinterpreting his relationship to the original memory ie. It was never his toy.
Comment: Yes. @HRRRR That's likely the case... the voice is K telling himself that this isn't his own memory.
Comment: Catija- thanks for responding. Your explanation is most likely correct. I'd have to watch the scene again to be clear if it's an additional bit of memory or K's reinterpretation of the old memory. It definitely makes more sense if it's the latter though.

What is Ana's relationship to Deckard?


post hoc testing for a one way repeated measure between subject ANOVA

Question: I am trying to determine what the appropriate post hoc testing for a one way repeated measure between subject ANOVA. Would it be appropriate to use a Tukey test in this scenario?
Answer: Well, appropriateness of the test depends upon the comparisons to be made (whether planned or unplanned comparison). As different post-hoc tests have different desirable properties it's better to have a look at them and then decide which best suits you. This article might be of help to start with. If you are looking for post-hoc for between subject factors, this link and for within subject post-hoc this link give extensive resources on the same. And if you are using SPSS, the help file in SPSS GLM-RMANOVA menu has fair bit of explanations on each test.
Comment: Thanks for your help! I had taken a look at that page before but it doesn't mention if you can just carry out your post hoc test as you would normally or if it needs to be done somewhat differently to account for the fact that it was a repeated measure scenario. I was wondering if you had any comments on that?
Comment: Yes. You can carry out Tukey's test. Essentially, they run pairwise test taking into account the correlation (say, paired t test) and make comparison to adjusted level of significance according to number of comparisons to be made. If you really want to test it out, you can run LSD test (which makes no adjustments) in SPSS and see that, they are nothing but the results of separate paired t tests. For, more details on how Tukey works, you can refer the same link that I mentioned earlier. I hope this helps.


How to send AuthnRequest without user-agent interaction using HTTP POST?

Question: My question is similiar to How should I be implementing the HTTP POST Protocol Binding for SAML WebSSO Profile?, but I don't see exact answer that I needed. This is my case. I already implemented Service Provider for WEB SSO SP-initiated POST redirecting and my IDP is active directory and STS is ADFS2.0. After user log on, I need to send another AuthnRequest to ADFS2.0 without user agent interaction. Is it possible with HTTP POST? Or to send over HTTP POST, user agent interaction must needed. I set isPassive=true. I try to implement using Java.
Answer: Ok you could build an authentication request and send it to ADFS2 using any HTTP client (i.e. http://www.innovation.ch/java/HTTPClient/ works for me). But ADFS2 will always reponse you with the Login Form. The problem is that in the request you were missing the cookies that ADFS2 is using for tracking your session (SamlSession cookie).
Hope it helps,
Luis
ps: why do you need to send another authn request?


Canonical equations of motion

Question: The Hamiltonian is obtained as the Legendre transform of the Lagrangian:
\begin{equation}
H(q,p,t)=\sum_i p_i \dot{q_i} - L(q,\dot{q},t)\tag{1}
\end{equation}
If the Hamiltonian is expressed in canonical coordinates, the equations of motion would have the form
\begin{equation}
\begin{split}
& \frac{\partial H}{\partial q}&=-\dot{p},\newline
& \frac{\partial H}{\partial p}&=\dot{q}.
\end{split}\tag{2}
\end{equation}
This can be seen by taking the differential of $H$:
\begin{equation}
\begin{split}
dH&= \frac{\partial H}{\partial q} dq + \frac{\partial H}{\partial p} dp + \frac{\partial H}{\partial t} dt\\
&= -\dot{p}dq + \dot{q} dp -\frac{\partial L}{\partial t} dt
\end{split}\tag{3}
\end{equation}
and equating the coefficients.
But if the coordinates are not canonical, the form of the equations of motion would be different. However, nothing was said about the nature of the coordinates in which $L$ is expressed, or in the derivation, and hence, we don't know the kind of coordinates in which $H$ is written. Without assuming anything, the equations of motion came out in canonical form anyway. How does that happen? When did the restriction get placed on the coordinates?
Comment: What do you mean, Poisson brackets, in the context of Lagrangian mechanics, where momentum is yet to be defined and we just have coördinates and their associated velocities?
Comment: It's not a question about Poisson brackets in the Lagrangian formalism. It's about how the Hamiltonian is constructed from the Lagrangian which does not have any restrictions on its coordinates.
Comment: Your question statement explicitly mentions it right there at the crucial part, namely where the question mark appears. Also, we tend to try to use good coördinates, rather than explicitly seek for weird ones; the whole point of the standard prescription, to write down the Lagrangian by guessing with simple, tabularised set of known good stuff to combine, and then Legendre transform, is precisely because it is almost always guaranteed to give you canonical results. The Lagrangian formalism only has DoF in coördinates, and so it is much more difficult to get incompatibility between $q$ vs $p$
Answer:
Starting from a regular Lagrangian formulation, the Legendre transformation ensures that we can consistently define a Hamiltonian formulation with a canonical Poisson structure in phase space. For details see e.g. this Phys.SE post.

To derive OP's eq. (3) from eq. (1) it is implicitly used that:
$$\begin{align}p~=~&\frac{\partial L}{\partial \dot{q}}\quad(\text{Lagr. def. of momentum})\cr
\dot{p}~=~&\frac{\partial L}{\partial q}\quad(\text{EL eqs})\cr
0~=~&\frac{\partial H}{\partial \dot{q}}\quad(\text{standard assumption}).
\end{align}$$

It should perhaps be stressed that it is possible to consider a Hamiltonian formulation
$$ \dot{z}^I~=~\{z^I,H(z,t)\}$$
in non-canonical coordinates $z^I$, $I\in\{1,\ldots,2n\}$, but then the form of OP's eq. (1) is modified, cf. e.g. this Phys.SE post.
Comment: I don't see how that addresses the question. We still didn't make any assumptions about the $q$'s to begin with.
Comment: I updated the answer.

Canonical equations of motion


Hysteresis in a CMOS Schmitt trigger

Question:
How does this circuit work? Why do you get different threshold voltages for increasing and decreasing Vin?
Comment: What do you know about these FETs?
Comment: Only that P:N ratio is 2:1
Answer: This circuit is typically used to change the trip point of a standard inverter. If you look closely you'll find that the size of the feedback MOSFETs play a major role in deciding the Vin at which the output will switch from low to high or vice-versa.
Vih, is the input voltage at which the output switches from high to low. The source voltage of N2 is reponsible for that. Now the N2 source voltage depends on the output voltage, size of the feedback nmos. The more the width of feedback nmos N3, lower will be the Vih. Same holds true for the low to high condition in the Pmos side (which affects the Vil).
Answer:
These FETS would use Vgs of 1.5V so that P3 and N3 switch their respective sources to between 3.5~5V and 0~3.5
the N12P12 gates are wired as "AND" logic  with N3P3 forming 2 inversions and positive feedback to shift the levels for Vgs on N2P2
Comment: If Vdd exceeds twice the gate-source threshold voltage, it would seem that if the output is high and the input is at Vdd/2, there would be a Vdd->Vss path through N3 and N1.  Perhaps one could size components so as to limit the current, but that seems rather dodgy to me.
Comment: I believe all logic is designed this way with controlled RdsOn during crossover to limit transition current.
Answer: Suppose, Vin=0 and Vo was 1. That means N3 has pulled its source terminal to logic high. Now as Vin increases gradually, and reaches the Vt of NMOSes (assuming all Nmos have same Vt), N1 turns on in saturation but N2 turns on in linear region (deep triode). Which means it conducts almost no current. So you have to even further increase Vin so that N1 able to conduct enough current to have both N1 and N2 goes to saturation. By then, as N3 is a week transistor, would be hardly conducting as output node voltage decreases. So basically, High to Low trip point is increased as compared to what it is in normal CMOS inverter.
Similarly when Vin goes down from 1 to 0, P1 turns on in saturation region, but P2 turns on in deep triode region (because weak P3 was initially ON). And you need to reduce Vin even more than conventional to completely pull up the circuit.

Hysteresis in a CMOS Schmitt trigger


Why do TJvHidDeviceController throw "Device cannot be identified" when I drag the component on the form?

Question: I have the community edition 10.3 of Delphi on Windows 10 and trying to use the JEDI (JVCL v3.50) TJvHidDeviceControllerClass (v 1.0.35) to control my HID device in a VCL form application.
This exception also gets thrown when I start up Delphi and when closing it down showing a dialog, provided that the component is already present on the form when loading the project. When ran with the OnDeviceCreateError() event handler assigned, the application behaves OK as I set the debugger to let the application handle this particular exception and setting the "Handled" boolean to true inside the OnDeviceCreateError() handler. It also works fine when run outside the Delphi GUI.
I have been searching for clues about fixing this issue and have seen that other people have encountered it as well. As most of the posts about this is quite old I wonder if I don't have the correct version of the library (https://github.com/project-jedi/jvcl).
The JEDI library was fetched from github just a week ago using the instructions on the readme page. My local repo was cloned from the master branch. I built it and installed it locally with no hassle.
Albeit working fine when running the application this exception is a bit of a nuisance as it messes with the Delphi GUI itself during startup (the exception dialog is shown, parts of the GUI goes missing after clicking OK).
I don't think that my code is the culprit here as the problem presents itself before any application code has even begun executing. I suspect that Delphi itself runs the constructor for the component before the OnDeviceCreateError() handler has been assigned and so the exception propagates all the way up to the GUI during palette placement or startup. Why the exception shows while shutting Delphi down is harder for me to explain.
Is there a fix to this or a setting to prevent Delphi running the constructor at design time?
Should I create the TJvHidDeviceControllerClass instance during form creation instead?
Thanks in advance /Thom
Answer: After some trial and error I worked around the problem by removing the component from the form designer and adding the TJvHidDeviceControllerClass manually with method bindings to the class in code instead.
The default constructor should not be used as it does not bind the exception handler at create time. Use the other one that does the binding.
It now works fine without stray exceptions at start/stop times.
When creating manually, be shure to explicitly free the TJvHidDeviceControllerClass object instance at form close.


Why are new users having their role deleted on signup?

Question: Today my client added some new users & gave them a role, and checked 'Notify user of new account'. The users clicked the email link, entered their password and all was well - except that the role they had been given had been removed, so they had no useful access.  I've never seen this before, and in replicating it I can see that the role is removed at the point where the new user clicks save on their new password.  I'm  so puzzled by this, as we're at Drupal 7.69 which hasn't changed for a while and I can't see that anythig else has changed.
Comment: Thanks for the prompt Leigh - your comment directed me in the right direction.
Comment: Sounds like something within your code is doing a form alter on the user edit form and unsetting the roles. Have a look around your code to look for anything like that
Comment: There are of course modules like 'login security', 'password policies' so I will try disabling them but I've not added any code at all. It's a CiviCRM system.
Answer: The problem was caused by the module 'Civigroup Roles Sync'.  Adding the new user with a role that was synced to CiviCRM caused the user's role to be dropped because in CiviCRM they weren't in that group.


Difference between Unix OS Types

Question: What is the difference between Linux, AIX, Solaris, MAC. Aren't these all some kind of Unix flavors ?
Why do we need so many types. Why can't there be just one type ?
Comment: For the same reason that there is more than one brand of cereal at the supermarket.
Comment: It is a little bit more there being more than one brand of Bran Flakes.
Comment: To give different specialties what they need and remove what they don't.
Comment: This has roots in the 1980's when microprocessor-based computers took off. Customers wanted Unix, and vendors provided it, with variations. Vendor lock-in was likely a goal of some variations, but the charitable view is that vendors made extensions to Unix either as a necessity (e.g. to support their parallel hardware) or as a way to attract customers (e.g. to provide compatibility with the vendor's proprietary OS). Later, Minix and Linux appeared, and they were appealing because they were small and didn't require a license. The variants surviving today mostly compete on price and features.
Answer: It's historical, sort of like the question, "Why is there more than one nation state?".  Presumably, at some point a few hundred thousand years ago, there was only one, singular population of homo sapiens, and yet now there are many.
The original UNIX was a singular entity that was written in non-portable assembly for the PDP-11 as a AT&T Bell Labs project paralleling (or spun off from) the MULTICS OS, to which Bell had previously contributed.  Since this took a lot of work -- perhaps, an amount comparable to designing the PDP-11 itself, which wasn't a Bell product -- people at Bell Labs decided it would be nice to do this kind of thing in a higher level language than architecture specific assembly; i.e., a language that could be implemented using whatever assembly instructions were appropriate to a specific machine, but which itself worked the same everywhere.
This is now a very fundamental principle of software design: you engineer things in layers, where each layer deals with the ones bordering it as an abstraction.  "Abstraction" in this context means something that describes just the relevant details of something else; what is "relevant" is defined by the context.  Going back to our Unix example, the languages B and then C were developed; they abstracted away assembly level details into higher level commands.  This meant you could use such a language to read a file the same way on machine A as on machine B, even though there are lower level details involved that are completely different.  If you wrote an entire OS in such a language, you could then compile and run that OS on any machine for which the language is implemented.  If this sounds like more work rather than less, it's not; the language is less work than the OS, and the OS plus the language is likely still less work than the OS would have been by itself.  It certainly won't be more, because it's using the interchangeable bits of the language and those are bits that would have had to be implemented for the OS anyway, and when you get to architecture B, all you have to redo is the language implementation.  Plus, you now have two distinct things that can be layered and could be combined with other things.
Keep in mind that at the assembly level, there isn't even such thing as a file -- so there's an example of a higher level abstract entity.   B, C, and Unix came into being when concepts like this had taken a firm hold, and it was successful perhaps because it made good use of them.  The exact same people developed both the language, C, and the OS, Unix, and they fit together nicely.
Although there wasn't a formal C specification for some years, Bell did licence the source code for Unix to universities in the 1970's (methinks: a much more open era than now, technology wise) and this is how the first "unix-like" OS, namely, BSD, came about.  In addition, over the next decade Bell made some commercial agreements with (e.g.) HP and Sun Microsystems, resulting in even more variations.
While Bell did have control over their source code, they did not exert any ownership rights regarding OS concepts, perhaps because they had already licenced Unix out and allowed it to evolve independent of them.  Giving the world C meant C was more much more successful than it would have been if they had kept it to themselves -- this is the predominant pattern for language specifications -- and that benefited Unix.  This is why things like OSX were eventually possible; OSX is the successor to NeXTstep, which was a Mach (architecture) based platform using a BSD kernel.
That just leaves linux and GNU, which implemented a unix-like OS using all original open source code1 -- the concept of free, open source software having been previously championed by GNU and its founder Richard Stallman.  At this point, the various commercial aspirants had realized

that the standards rivalries often termed as the Unix wars were causing all participants more harm than good, leaving the UNIX industry open to emerging competition from Microsoft. http://en.wikipedia.org/wiki/Open_Group

And these specifications were unified, making it easier to write software that works on any complaint commercial variant.  It also meant anyone was free to comply; perhaps the major players did not see what was coming next, because it was a bit "outside the box", and perhaps they would not have cared anyway, but in any case, making the source code for such an implementation (GNU + Linux) itself open attracted a lot of positive attention, and so here we are: there was no grand scheme, just a lot of independent plans revolving around the same sun.

1. BSD was still in a bit of a legal limbo, original code base wise, at that time.
Comment: For the record, Stallman would freak out if he read "the concept of open source having been previously championed by GNU and its founder Richard Stallman." He doesn't do open source. There are like a zillion videos of him correcting people who say he does.
Comment: @FaheemMitha You got me.  I added the qualifier *free* and a "not as in beer" link.
Answer: Could also ask, why can't there just be one type of car? Wouldn't we all be happy driving a Gremlin? Or maybe an El Camino?
There are some historical reasons for some of the deviations between the proprietary flavors in Unix and Linux that would make for some interesting reading (finding all those resources would be out of scope for such an open-ended question, I recommend you do some searches on flavors you like or have read about to find their origins). Likewise newer Linux flavors have benefited from the open source world we now live in and can be very specialized and contain configurations/apps/tweaks meant for specific usages (why run extra services that will never be needed by that specific system).
So you can run a firewall (BTW it is linux), you can run a full gui desktop workstation (BTW it is linux), you could run a NAS (BTW it is linux).
So coming round full circle...
Linux = misnomer, there are too many versions of Linux to define in this manner.
AIX - IBM proprietary version of Unix.
Solaris - Sun proprietary version of Unix.
Mac - Apple proprietary version of Linux/Unix (Honestly have not looked to see where it was derived from).
I recommend you embrace the diversity :)
Comment: @BruceEdiger Maybe some of that which nobody ever talks anymore... Net/2 - NetBSD.
Comment: OSX is derived from FreeBSD.
Comment: OSX is derived from Mach 2.5, with a thin layer of BSD compatibility on top. I'm not so sure it's FreeBSD, it might actually be BSD 4.4 lite or whatever that last BSD release was.

Difference between Unix OS Types


Is there some kind of a local DoS against processes?

Question: Is there an attack that somehow floods a target process (e.g. by repeatedly calling a WinAPI function that involves the process) and thereby crashes or temporarily disables it?
Comment: If I wanted to be snide, I could say that Chrome on a Mac is just such an attack ...
Comment: http://en.wikipedia.org/wiki/Denial-of-service_attack#Application-level_floods talks about what you ask
Answer: Strictly speaking, what you are asking about is a Fork Bomb.

... wherein a process continually replicates itself to deplete
  available system resources, causing resource starvation and slowing or
  crashing the system.

In Windows (because you ask about that OS specifically) you cannot spawn new forks at the OS level, but you can create a cascade of new processes. That technique still falls under the "Fork Bomb" term.
Comment: So there is no targeted attack but only against system resources in general?
Comment: The fork bomb would simply slow down the whole system. I mean if there is something that only affects single processes.
Comment: Are you asking about a DoS that affects a particular process and nothing else? Sure, there are those, too. But those are usually caused by vulnerabilities in that process being unable to handle the requests - at some point, even a targeted attack will bring down the OS with the DoS.


Elpher loads for Gopher but not Gemini using Doom Emacs

Question: I am using the most up to date version of Doom Emacs, and I am trying to use Elpher to access Gemini pages. While it loads up Gopher pages just fine, any time I try to pull up a Gemini page I get a "Connection time-out message." Other users have suggested that it may be a TLS related issue, but I can't confirm that. They have stated that when they try the package with vanilla Emacs it works fine. Any suggestions on how I might go about fixing this?
Comment: Have you tried seeing if it works on your system with vanilla Emacs?
Comment: @JamesLeslie Indeed it does.
Answer: So after comparing the TLS related variables between vanilla Emacs and Doomemacs, and playing around with some of the settings, the following allows me access to gemini websites:
<code>(setq gnutls-verify-error 'nil)
</code>
I have no idea what security implications that has, but that gets things working at least.
Comment: According to the docstring, nil is the default and  tls checks are still performed via open-network-stream which still look secure: https://www.gnu.org/software/emacs/manual/html_node/emacs/Network-Security.html


SR Flip-flop logic

Question:
I am trying to understand SR flip-flops from a book which uses the above circuit to describe different states that this circuit can get in. Initially, both the switches are open and the current flows from the output of left NOR gate( highlighted in red in the image). However, I am struggling to understand as to why both the inputs to the left NOR gate are zero and the right NOR gate aren't since their inputs are dependent on each other's output. In other words, why can't we assume that since in the beginning  we have no input voltages to right NOR gate the output should be 1 which will mean that the current will be between the wire connecting output of the right NOR and the input of the left NOR?
Comment: i think that the book author is assuming that an incandescent bulb is being used ... the filament resistance is very low when cold ... at powerup, that would pull the output of the right gate low for a brief moment, just long enough for the left gate to supply a high to the right gate input
Answer: When an SR latch like this "wakes up" as power is first applied, it will (in practice) be in either the state where the output is high or the output is low. We can't look at a circuit like this and know what its initial state will be. My hope is that the book says somewhere "suppose that the output is initially..."
I have a big problem with this example because when the switches are open the input voltage for the NOR gates will be unknown. A proper schematic would have an explicit pulldown resistor from each input to ground.
I think you also have a misunderstanding about the flow of current. In general, no current (actually, negligible current) flows into the input pin of a gate. So, the left gate never supplies the current that makes the bulb light up. This current always comes from the right NOR gate. How is this possible? Each gate has implied connections to a power supply and ground, so when the bulb is lit the current is coming from the power supply through the right hand NOR gate.
Comment: unfortunately, the book fails to assume a  wakeup state. I guess my confusion stems from that. The name of the book is CODE by Charles Petzold written to understand computer hardware and software, which definitely targets layman and therefore glosses over many aspects of electrical circuits. Actually, what I meant was that the only current that flows in this circuit as per book is from the output of the left NOR gate which  acts as an input to the right NOR and therefore the bulb doesn't glow.
Comment: Now when I notice carefully, Don't you think that the asymmetrical nature of the circuit might have an influence on the initial state?
Comment: Find a different book. And, yes, if there is asymmetry in the circuit it can affect how it will wake up, but the presence or absence of a load is not the only factor. The figure is a cartoon, and a poor one at that.

SR Flip-flop logic


Difference between solid and gases thermal expansion

Question: The coefficient of linear expansion is
$$\Delta L = L \,\alpha \Delta T,$$
where $\Delta t$ can be the difference of any two temperatures. However, in volume expansion of gases,
$$\Delta V = V \,\beta \Delta T,$$
and the difference has to be from 0 degree. Why?
Comment: I don't see why it has to be from 0 K. In both cases $\Delta T$ seems to refer to a temperature change.
Answer: Actually, that is not the correct formula for gases. In the usual model of ideal gases, the volume is given as a function of both temperature and pressure by the equation: $$V=\frac{n\bar RT}{p}$$
Both formulas you wrote are valid for solids and liquids (but not for gases). In those phases, volume is much more affected by temperature than by pressure, so the latter doesn't go into the equation.
The reason why the formulas you wrote (that, again, don't work for gases) only need temperature differences instead of absolute values is that for solids and liquids the temperature coefficients are often considered constant, so length or volume can be modeled in the form $\ell(T)=aT+b$ such that: $$\Delta\ell=\ell(T_2)-\ell(T_1)=(aT_2+b)-(aT_1+b)=a\Delta T$$


Delete confirmation missing when I hit the delete key

Question: I'm sick of accidentally deleting files and directories as DEL button is badly located on my keyboard. I would really like it if ubuntu asked me to confirm before deleting anything. Is there a way to do this?
Comment: Are you talking about "Delete" or "Move to Trash"?  For the first it always asks for confirmation, for the second it doesn't (but you can restore them of course).
Comment: I'm using 11.10. There is no any confirmation dialog! I usually accidently delete some important folders. I mean pressing Delete button on the keyboard. Ok, It is moved to Trash Bin. But the problem is I don't know that I already deleted it! The trash contains 1xxxxxxx files, how to find it to restore if there so many folder same name? That's a big problem. I still don't understand why Ubuntu doesn't give an option to turn on and off the delete confirmation dialog. VERY annoying!
Comment: Which application? Nautilus pops up a confirmation dialog box for deleting any file by default. Are you talking about 'delete' on desktop entries?
Comment: @Godel No I don't get any confirmation dialog box!
Comment: @Emerald214 you need to manage your trash bin more closely.
Comment: You can use this technique from Ubuntu 13.10 onwards: https://www.howtogeek.com/183690/enable-the-confirmation-when-deleting-files-and-folders-using-the-rm-command-in-ubuntu/
Answer: Unless this has recently changed without my knowing, there is no way to get a delete confirmation on delete in Ubuntu. This is a feature that has been requested many times in Ubuntu, but is yet to be implemented thus far.
Comment: I think that there is some confusion on what you mean by "delete." On my system, when a file will be deleted permanently Nautilus asks for conformation. If it moves it to the trash, then it does not. Just pressing the "delete" key doesn't permanently remove the file. It will just be in the trash.
Comment: Nautilus has always asked before deleting files...
Comment: Really, because I never get a confirmation and I run Ubuntu 10.04 and I've been testing 10.10. Maybe there IS a setting somewhere that I don't know about?
Comment: Yes, @Adam and I are on the same page!
Answer: While there's no delete confirmation dialog, Nautilus can tell us which files we've just deleted.
Go to the trash and select "List" as view mode. This information is in the Trashed-On column.
It appears that Nautilus may be the only file browser that shows this information. I checked Thunar and PCManFM; none of them are able to show this column.
Answer: There is a setting for this in the Nautilus preferences (in the "Behavior" tab), but I just tested with a clean profile and asking for confirmation is on by default.
Comment: That setting is for permanently deleting files from the Deleted Items/Trash - it does not affect moving files to the Trash/Deleted Items as the original poster asked about.
Comment: Well, that's not what he says in his question, and he didn't reword his question when I asked if that was what he meant.  If you are right about what he is talking about, then he should edit the question and phrase it correctly.
Comment: delete key moves to trash, shift+delete requests confirmation this is what is meant by delete in the behavior tab
Answer: Kinda think both options if you are sure of someone asking either of them... This saves both times. Also it may help someone having the problem different than the other.
So in simple words, try to answer in all possible ways, if u are not that busy. :)
Well, MY ANSWER is:

Delete confirmation is on by default, and can be set to off.
   But Move to Trash confirmation is off, and can't be modified yet!


Why doesn't the Linguistics Stack Exchange have a different icon?

Question: The Phisics, Music, Science Fiction etc sites have different icons. Why doesn't this one have one too? And is there any prerequisite to a site that may prevent this one to have an icon?
Comment: Suppose prerequisite is having a good idea for a logo to begin with? I propose ripping the logo of a stuck out tongue from the Rolling Stones.
Answer: Linguistics SE was in beta until very recently. (Congratulations to our 29 oldest beta sites - They're now no longer beta!) We are out of beta now, but only in name. We have none of the features of mature SE sites.
Going by the phases in Design-Independent Graduation is on for early September! Linguistics SE has only gained the first bullet point of Phase 1. For all practical purposes, just assume we're still in beta here.


Is there a faster way to detect object type at runtime than using dynamic_cast?

Question: I have a hierarchy of types - GenericClass and a number of derived classes, InterestingDerivedClass included, GenericClass is polymorphic. There's an interface
interface ICallback {
    virtual void DoStuff( GenericClass* ) = 0;
};

which I need to implement. Then I want to detect the case when GenericClass* pointer passed into ICallback::DoStuff() is really a pointer to InterestingDerivedClass:
class CallbackImpl : public ICallback {
    void DoStuff( GenericClass* param ) {
        if( dynamic_cast<InterestingDerivedClass*>( param ) != 0 ) {
            return; //nothing to do here
        }
        //do generic stuff
    }
}

The GenericClass and the derived classes are out of my control, I only control the CallbackImpl.
I timed the dynamic_cast statement - it takes about 1400 cycles which is acceptable for the moment, but looks like not very fast. I tried to read the disassembly of what is executed during dynamic_cast in the debugger and saw it takes a lot of instructions.
Since I really don't need the pointer to the derived class is there a faster way of detecting object type at runtime using RTTI only? Maybe some implementation-specific method that only checks the "is a" relationship but doesn't retrieve the pointer?
Comment: Similar to http://stackoverflow.com/questions/500493/c-equivalent-of-instanceof
Answer: I always look on the use of dynamic_cast as a code smell. You can replace it in all circumstances with polymorphic behaviour and improve your code quality. In your example I would do something like this:
class GenericClass
{
  virtual void DoStuff()
  {
    // do interesting stuff here
  }
};

class InterestingDerivedClass : public GenericClass
{
  void DoStuff()
  {
    // do nothing
  }
};

class CallbackImpl : public ICallback {
    void DoStuff( GenericClass* param ) {
        param->DoStuff();
    }
}

In your case, you cannot modify the target classes, you are programming to a contract implied by the declaration of the GenericClass type. Therefore, there is unlikely to be anything that you can do that would be faster than dynamic_cast would be, since anything else would require modifying the client code.
Answer: As others have said, using a virtual function is good practice. There is another reason for using it, not applicable in your case, as you can't add the VF, but still worth mentioning I think - it may be much faster than using dynamic cast. In some (not very stringent) tests I've done with g++, the virtual function out-performed the dynamic_cast by a factor of 4.
Because there is such a disparity, it may be worth creating your own inheritance hierarchy which wraps the code you don't control. You would create instances of the wrapper using dynamic_cast (once) to decide what derived type to create, and then use virtual functions from there on.
Answer: Looks like a pretty hackish design to me. (As others have mentioned, having to use dynamic_cast is usually a sign that you have a design problem.). But if most of the code is out of your control, there's not much you can do about it, I suppose.
But no, the only general solution I'm aware of is dynamic_Cast. typeid only matches the most derived type, which may work in your case.
On a side note, the reason dynamic_cast is so expensive may be that it has to traverse the entire class hierarchy. If you have a deep hierarchy, that becomes expensive (in other words, don't have a deep hierarchy, in general, but especially in C++).
(Of course the first time you perform the cast, most class descriptor lookups will probably be cache misses, which may have skewed your benchmarking and made it look more expensive than it is)
Answer: Would comparing type_infos be any faster? (call typeid on parameter param)
Comment: Yes, it's faster but it doesn't test inheritance, only exact matches.
Comment: It may be faster. But its not a good idea (like the original code above).
Comment: I think he's been lectured sufficiently in the other answers. He asked for a faster way of doing what he's doing. (It's a fair point that comparing type_infos will only catch *exactly* InterestingDerivedClass, not anything derived from it).
Comment: Comparing type_info takes from 600 to 1200 cycles which is formally faster, but unimpressive. Add to this that I had to conduct a whole investigation to find which type the compiler expects for the comparison to succeed and that it only works for exact matches. In the same time dynamic_cast works "out of the box" and checks exactly the "is a" relationship.
Answer: First off, do not optimize prematurely. Second, if you do query an object for a concrete implementation inside, it's likely that there's something wrong with your design (think double dispatch).
As for the original question, introducing a GetRuntimeType() function to a ICallback will do quite nicely: see MFC for on how this can be done.
Answer: In your concrete use case, the answer is to use virtual functions.
There are situations, however, where you need to downcast dynamically. There are a few techniques to make this operation faster (or much faster depending on how smart your compiler implements dynamic_cast), in particular, if you limit yourself to single inheritance. The main idea is that if you somehow know the exact type, a static_cast is much faster:
f(A* pA)
{
  if (isInstanceOfB(pA))
  {
    B* pB = static_cast(pA);
    // do B stuff...
  }
}

Of course, the problem is now giving a fast implementation of isInstanceOfB().
See boost::type_traits, for instance.
Answer: Standard dynamic_cast is very flexible, but usually very slow, as it handles many corners cases you are probably not interested about. If you use single inheritances, you can replace it with a simple implementation based on virtual functions.
Example implementation:
// fast dynamic cast
//! Fast dynamic cast declaration
/*!
Place USE_CASTING to class that should be recnognized by dynamic casting.
Do not forget do use DEFINE_CASTING near class definition.
*\note Function dyn_cast is fast and robust when used correctly.
Each class that should be used as target for dyn_cast
must use USE_CASTING and DEFINE_CASTING macros.\n
Forgetting to do so may lead to incorrect program execution,
because class may be sharing _classId with its parent and IsClassId
will return true for both parent and derived class, making impossible'
to distinguish between them.
*/
#define USE_CASTING(baseType) \
  public: \
  static int _classId; \
  virtual size_t dyn_sizeof() const {return sizeof(*this);} \
  bool IsClassId( const int *t ) const \
  { \
    if( &_classId==t ) return true; \
    return baseType::IsClassId(t); \
  }

//! Fast dynamic cast root declaration
/*!
Place USE_CASTING_ROOT to class that should act as
root of dynamic casting hierarchy
*/

#define USE_CASTING_ROOT \
  public: \
  static int _classId; \
  virtual size_t dyn_sizeof() const {return sizeof(*this);} \
  virtual bool IsClassId( const int *t ) const { return ( &_classId==t ); }

//! Fast dynamic cast definition
#define DEFINE_CASTING(Type) \
  int Type::_classId;

template <class To,class From>
To *dyn_cast( From *from )
{
  if( !from ) return NULL;
  if( from->IsClassId(&To::_classId) )
  {
    assert(dynamic_cast<To *>(from));
    return static_cast<To *>(from);
  }
  return NULL;
}

That said, I complete agree with others dynamic_cast is suspicious and you will most often be able to achieve the same goal in a lot cleaner way. That said, similiar to goto, there may be some cases where it can be really useful and more readable.
Another note: if you say the classes in question are out of your control, this solution will not help you, as it requires you to modify the classes (not much, just just add a few lines, but you need to modify them). If this is really the case, you need to use what the language offers, that is dynamic_cast and typeinfo.
Answer: Can you use http://www.boost.org/doc/libs/1_39_0/boost/type_traits/is_convertible.hpp
and check the CPU Performance ?
You can also checkout the implementation..
Reference: http://www.boost.org/doc/libs/1_39_0/libs/type_traits/doc/html/boost_typetraits/reference/is_convertible.html


ASP MVC Routing with > 1 parameter

Question: I have the following route defined
            routes.MapRoute(
            "ItemName",
            "{controller}/{action}/{projectName}/{name}",
            new { controller = "Home", action = "Index", name = "", projectName = "" }
            );

This route actually works, so if I type in the browser
/Milestone/Edit/Co-Driver/Feature complete

It correctly goes to the Milestone controller, the edit action and passes the values.
However, if I try and construct the link in the view with a url.action -
<%=Url.Action("Edit", "Milestone", new {name=m.name, projectName=m.Project.title})%>

I get the following url
Milestone/Edit?name=Feature complete&projectName=Co-Driver

It still works, but isn't very clean. Any ideas?
Answer: When constructing and matching routes in ASP.NET routing (which is what ASP.NET MVC uses), the first appropriate match is used, not the greediest, and order is important.
So if you have two routes:
"{controller}/{action}/{id}"
"{controller}/{action}/{projectName}/{name}"

in that given order, then the first one will be used. The extra values, in this case projectName and name, become query parameters.
In fact, since you've provided default values for {projectName} and {name}, it's fully in conflict with the default route. Here are your choices:

Remove the default route. Do this if you don't need the default route any more.
Move the longer route first, and make it more explicit so that it doesn't match the default route, such as:
routes.MapRoute(
    "ItemName",
    "Home/{action}/{projectName}/{name}",
    new { controller = "Home", action = "Index", name = "", projectName = "" }
);

This way, any routes with controller == Home will match the first route, and any routes with controller != Home will match the second route.
Use RouteLinks instead of ActionLinks, specifically naming which route you want so that it makes the correct link without ambiguity.
Answer: Just to clear up, here is what I finally did to solve it, thanks to the answer from @Brad
<%=Html.RouteLink("Edit", "ItemName", new { projectName=m.Project.title, name=m.name, controller="Milestone", action="Edit"})%>

Answer: You can try
Html.RouteLink("Edit","ItemName", new {name=m.name, projectName=m.Project.title});

ASP MVC Routing with > 1 parameter


Can Old Church Slavonic be considered an artificial language?

Question: How much was Old Church Slavonic edited by Constantine and Methodius? And what modified more: The Old Church Slavonic when people in Bohemia started to write with it, or the slavic dialect they used before?
Comment: By which may we assume you mean Old Church Slavonic, i.e. словѣ́нє?
Comment: @user6726 Oh yes, sorry (edited)
Comment: Your use of terminology is incorrect, or could be more accurate. An artificial language refers to topics surrounding computer simulations and the like. What you mean to say is a planned or constructed language.
Answer: Yes, Old Church Slavonic (OCS) was an artificial language, but just in a way.
Firstly, in the 9th century, when Cyrill and Methodius devised the OCS, all the Slavic languages and dialects were so close, that they were closer to one another than the modern English dialects inside England. Secondly, Cyrill and Methodius did not create any new phonological system, they used their native Pannonian one, with all its tendencies.
What Cyrill and Methodius added to their contemporary Bulgarian-Macedonian dialect spoken in Thessaloniki was the Greek-Bible-style syntax and the Greek-style lexicon (lots of Greek words were borrowed, lots of Greek words were calqued). That's all, the job of Cyrill and Methodius was just to shape the Slavic lexicon and syntax to fit the Christian literature standards, nothing else.
And naturally, OCS had nothing to do with the then dialects of Bohemia or Moravia which were Western Slavic dialects, OSC has always been a South Slavic language.
Comment: Also I wouldn't call it "their contemporary Pannonian dialect".  It was the Thessaloniki dialect.
Comment: Well, up to you, but SE is known to far exceed EB in pedantry. ;-)
Comment: But OCS was still intelligible to the people in Moravia, so "nothing to do with" seems an exaggeration.
Comment: @A.M.Bittlingmayer - Come on, everybody understands that I mean it's all about slightly different dialects, not unrelated languages, and this is not an Encyclopaedia Britannica article which has to be brought to a shiningly precise formulation. Objection overruled. ))
Comment: @A.M.Bittlingmayer - It was definitely intelligible to the people in Moravia, because in the times of Cyrill and Methodius the Slavic languages had but minor differences, mostly phonetic ones. As for the Thessaloniki dialect, thank you, I corrected that.
Comment: We're in agreement, ie all Slavic dialects were close at the time, I just think the following wording is confusing: "OCS had nothing to do with the then dialects of Bohemia or Moravia".  As if it's Basque.  There must be a more precise formulation.


Write an algorithm to find minimum number from a given array of size 'n' using divide and conquer approach.

Question:
In Divide and conquer strategy, three main steps are performed:

Divide: Divides the problem into a small number of pieces
Conquer: Solves each piece by applying divide and conquer to it recursively
Combine: Combines/merges the pieces together into a global solution.

Write an algorithm to find minimum number from a given array of size
  'n' using divide and conquer approach.
Answer: Given is an array of size $n$ and the task is to find a minimal element.

Divide:  The problem instance is characterized by the number of
array entries $n$ and this step consists of moving to smaller
problem instances $n' < n$, meaning smaller arrays. We only do this
if $n > 1$. We have a couple of options at this point, like how many
smaller arrays we want to have and how to derive them from the given
array of size $n$. For simplicity we decide to derive two smaller
arrays by splitting the array into two non-empty arrays. Here we have to choose the
point where we want to split. E.g. at $\lfloor n/2\rfloor$, $\lceil
    n/2\rceil$ or at a random position within the array. We end up with
two arrays: $a_1$ of size $n_1'$ and $a_2$ of size $n_2'$ with $1 \le n_i' < n$ and $n_1' + n_2' = n$.
Conquer: If we are given an array of size $n=1$ we can claim that its element is minimal and return it.
Combine: We have used recursion to determine the minimal elements $m_1$ of the array $a_1$ and $m_2$ of the array $a_2$. We compare the two elements, and return $m_1$ if $m_1 \le m_2$ otherwise we return $m_2$. Another option would be to return $m_1$ if $m_1 < m_2$ and otherwise return $m_2$.
Comment: i solve my problem with your guideline ... thnx mvw.....
Answer: Here's a Python (3) function that does the trick:
def find_min(arr):
    """ Return the least number in nonempty list `arr`.
    """
    len_arr = len(arr)
    assert len_arr > 0
    # Base case:
    if len_arr == 1:
        return arr[0]
    # Divide...
    mid = len_arr // 2        # floor of len_arr/2; thus, mid ≥ 1
    m1 = find_min(arr[0:mid])
    m2 = find_min(arr[mid:len_arr])
    # ... and conquer:
    return min(m1,m2)

(In Python, the default lower and upper bounds for "slices" low:high of arr are 0 and len(arr) respectively, so the third- and fourth-to-last lines could be written more concisely. But I can't assume all readers are fluent in Python.
Of course, this function is "unPythonic" for an even more glaring reason — the min builtin does everything find_min does, and more: it can accept a list as argument, and then it returns the least element in the list.)
Note that a recursive, divide-and-conquer approach to this problem performs slightly worse than a straightforward iterative approach, because of the function-call overhead. However, both are $O(n)$ in the size of the array: any algorithm has to examine every element of the array, and make the same number ($n-1$) of comparisons or calls to min.

Write an algorithm to find minimum number from a given array of size ‘n’ using divide and conquer approach.


Read mobile provider from the phone

Question: Using my new Android phone established a small problem: I'm living in country A but my mobile provider is from country B, because it's just cheaper. Concerning mobile phone tarifs my country isn't a foreign country for country B. However I have to enable data roaming in my Android phone. The problem is, I'm also quite often in country C and every time I have to switch off data roaming.
So I thought about writing a small app which disables data roaming if I'm not in country A or B and enables it otherwise.
My first try was to define the location using GPS, but this is rather useless, because I would have to calculate for every coordinate if it is in the allowed range. So I think the better solution would by to read from the phone the current provider and if this provider isn't in the whitelist (which is defined by me), data roaming is switched off.
Do you know any other approaches? And how could I get the name of the current provider? And how to programatically disable data roaming?
Answer: You could use TelephonyManager:
TelephonyManager tm = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);

Some of its methods that might be useful for your case:
tm.getNetworkCountryIso();
tm.getNetworkOperator();
tm.getNetworkOperatorName();
tm.getSimCountryIso();
tm.getSimOperator();
tm.getSimOperatorName();

Answer: Can you use reverse Geocoding? Something like Nominatim? Simply send the GPS coordinates and check the country you are in.
On the other hand, this example shows you how you can get the name of the operator your phone is currently connected to.
About diabling the data roaming, it seems that entering invalid APN details does the trick.
Comment: Android has inbuilt Geocoding helpers see this http://developer.android.com/intl/de/reference/android/location/Geocoder.html
Comment: I thought about that, and it would be really nice, but the problem is, then I always have to have enabled GPS receiver. For various reasons, I don't want that.
Comment: You don't need to have GPS enabled, you can get coordinates from your network or WIFI.

Read mobile provider from the phone


What is the relation between eigen values and principal axes length for 3D data?

Question: For a region in an binary image, I have calculated co-variance matrix using co-ordinates of region. Using co-variance matrix, I got two eigen values. Later I have calculated major axis length and minor axis length using the formula $4\sqrt{\lambda_i}$ where the $\lambda_i$ are the eigenvalues. This formula is mentioned in the below given link  3-sigma Ellipse, why axis length scales with square root of eigenvalues of covariance-matrix. I have verified lengths of major axis and minor axis with the output of 'regionprops' command in MATLAB. It is exactly matching for 2D object.
Now, I want to calculate principal axes lengths (major, middle and minor axis lengths) for 3D object data. For that I want a relation between eigen values obtained from 3D object co-ordinates (using same procedure mentioned above) and principal axes lengths for 3D data. 'regionprops' command in MATLAB do not work for 3D object.
Comment: What is "principal axes length" and where the formula 2*2*sqrt(eigenValue) comes from?
Comment: @enzotib: Three dimensional object will have major axis, middle axis and minor axis. These axes are called principal axes. Formula mentioned above is taken from [link] (http://math.stackexchange.com/questions/911792/3-sigma-ellipse-why-axis-length-scales-with-square-root-of-eigenvalues-of-covar). I have verified lengths of axes using mentioned formula and using 'regionprops' from Matlab.
Comment: So you're saying: "I have accomplished this in 2D, and now I'm wondering how I can do it for 3D images"?
Comment: @GPerez: Yes. Exactly. 'regionprops' from MATLAB will give axes length for 2D. I want to calculate it for 3D data.
Answer: If I understand correctly your question, your formula seems to be wrong.
In three dimensions the distribution of mass could be represented by the inertia ellipsoid, whose equation, in a principal frame is
$$
I_x x^2 + I_y y^2 + I_z z^2 = 1,
$$
so that the length of the axes of the ellipsoid are $a_i = 1/\sqrt{I_i} = 1/\sqrt{\lambda_i}$ (the principal moments of inertia are the eigenvalues of the inertia matrix).
See section 4.5 of http://www.eng.auburn.edu/~marghitu/MECH2110/C_4.pdf .
Comment: I have verified lengths of major axis and minor axis with the output of 'regionprops' command in MATLAB. It is exactly matching with the value obtained using mentioned formula for 2D object.


Name for a deliberate change of a meaning?

Question: Is there a specific name, a figure of speech, for a "deliberate, even subtle change of the meaning of a word"? Example: "- You're doing politics at school as a teacher! - Everything can be considered politics." Meaning of politics in the accusation: political propaganda which is ethically wrong; meaning of politics in the defense: its ontological nature that can apply to any matter in a society. In the answer, in the defense, somebody discards the meaning, the acceptation of the word "politics" as intended by the accuser, possibily in order to play tricks, win the controversy by confusing a naive audience.  I would like to know if there is a specific name for that "change", that "semantic discard", the switching from a word acceptation to another, from a gnoseological level to another.
Comment: Please edit your question for clarity. As it stands, your question is not very coherent, and it's very hard to tell what you're asking. The example doesn't really make sense, and since the entire question is just one big paragraph of text with no divisions, it's very hard to even figure out where the example ends.
Comment: I put the example in quotation marks. The question looks clear to me, I realize the expression i'm looking for is quite specific. If there is one at all.
Answer: I think the term framing is perfectly cromulent to the situation described in the question.
Comment: Thank you so much! That is really cromulent! I'm still looking for a figure of speech but that word is already what I was looking for, and it opens so many new paths of research...


Examples of bounded continuous functions which are not differentiable

Question: Most often examples given for bounded continuous functions which are not differentiable anywhere are fractals.If we include probabilistic fractals exact self-similarity is not required. Are their examples of functions which are bounded ,continuous, not differentiable anywhere and can not be modeled as fractals?
Comment: Do you mean non differentiable at each point? As otherwise, you can just take $|x|$
Comment: @voldemort- Yes non differentiable at each point, i will edit the question
Answer: First, you have to define what you mean by a "fractal". There is only one mathematica definition of a fractal curve that I know, it is due to Mandelbrot (I think). A curve is called fractal if its Hausdorff dimension is $>1$.
Now, back to your question. The condition of being bounded is not particularly relevant, as you can restrict any continuous function $f: R\to R$ without 1-sided derivatives to the interval $[0,1]$ and then extend the restriction to a periodic function $g$, $g(x+n)=g(x)$ for all $x\in [0,1]$, $n\in {\mathbb N}$.
Now, take the Takagi function: it has no 1-sided derivatives at any point, is continuous and its graph has Hausdorff dimension 1 (see here).
Edit: Note that Takagi's function does have periodic extension since $f(0)=f(1)$. For a general nowhere differentiable function $f$ you note that it cannot be monotonic (if it is nowhere differentiable). Then find $a<b$ such that $f(a)=f(b)$ and then extend to $R$ periodically using $[a,b]$ as the period.
Comment: Actually, extending the restriction periodically might break continuity if $f(0)\neq f(1)$. This problem doesn't occur for the Takagi function though.
Comment: @kremerd: Right, I was careless.
Answer: It might be worth pointing out that the typical function, in the sense of Baire category, has this property.  More specifically, Let $X=C([0,1])$ denote the set of all continuous, real valued functions defined on the unit interval endowed with the sup norm.  Let $S\subset X$ denote the set of all functions that nowhere differentiable and let $T\subset X$ denote the set of all functions whose graph has Hausdorff dimension $1$.  Then $S$ and $T$ are both residual sets - i.e., each is the complement of a countable collection of nowhere dense sets.  As a result, their intersection is second category as well and, in particular, non-empty.
The fact that $S$ is second category is a classic theorem of Stefan Banach - in fact, it's the seminal result of this type.  A proof may be found in chapter 11 of the important book Measure and Category by John Oxtoby.  The fact that $T$ is second category is proven by Humke and Petruska in Volume 14 of the The Real Analysis Exchange, though the title is "The packing dimension of a typical continuous function is 2" and it's proven in some other references as well.
Comment: Hi Mark! Two comments: (1) Second category usually means "not first category", which isn't the same as complement of first category, in the same way that having positive measure isn't the same as having full measure. See the start of my answer [here](http://math.stackexchange.com/questions/96938/generic-elements-of-a-set) for more about the nomenclature. (2) That $T$ has a first category complement was proved earlier in Mauldin/Williams, [*On the Hausdorff dimension of some graphs*](http://www.ams.org/journals/tran/1986-298-02/S0002-9947-1986-0860394-7/), Trans. AMS (1986) -- Th. 2 on p. 794.
Comment: Hey Dave - thanks!  Yes, I originally typed "residual" but then changed it.  Thanks for the reminder.


Hosting an apache server from my mac

Question: I created a website with PHP and JS. I want to send my IP address to a friend who is in another state and let him see it. My site is loaded by xampp. How could I do this?
Answer: This may get complicated depending on your ISP.  If your ISP hasn't blocked port 80 then it is as simple as making sure that your router forwards all requests on port 80 to your computers internal ip, then just going to whatsmyip.org then having him type in http:// followed by your IP address, then of course followed by the subdirectory of XAMPP.
Also, remember that depending on your ISP your IP may change so he will want to view it fairly fast.  If your ISP does not allow port forwarding it becomes quite a bit more complicated and I would suggest just finding a free host and having him look at that.
Comment: I have verizon FiOS and I found out that port 80 is blocked. what should I do?
Comment: @Coder404 You can either get a free website.  Or you can try having your router accept incoming connections from something like port 6000 and forward them to 80.  Then you just have to tell your friend to use http://yourip:6000 where yourip is your ip address then after 6000 append the path to the file.
Comment: 1. What is a free website? Are people actually giving away domain names? 2.How could I make my router accept port 6000?
Comment: You can use a .tk domain at http://dot.tk if you have it.  People give out hosting.  Some give out free subdomains too.  http://www.000webhost.com/ give free PHP hosting.  Port forwarding I can't really help with as it depends on the router brand and model.  You can usually login to it at either http://192.168.0.1 or 192.168.1.1
Answer: Verizon lets you log in (on recent routers) at 192.168.1.1.  If you don't have the password, hold the reset button on the back of your router for 30 seconds or more (not 29!  it's picky).  The settings for open ports are considered advanced, I recommend watching this video, as it shows the process well.  Simply open the port 80, or select the web server/HTTP option from the list.
You'll have to specify which device to forward the ports of.  Open a terminal on your Mac, and type ifconfig | grep '192\.168'.  You'll likely see 192.168.1.3 with perhaps a different ending number instead of 3.  This is the router's name for your computer on the local network, and which device you should use on the port settings page.
If you decide to go with free hosting, some options include X10Hosting (gives most control) or 000webhost (almost as good, I've used both).  If at any point you decide you need more, I strongly encourage Cloud Hosting, as it costs the same or less as paid versions of the aforementioned hosts and gives you about 20x the performance per dollar spent (based on my benchmarks of Bluehost vs Digital Ocean).

Hosting an apache server from my mac


How can I put GFCI protection on high-current outlets without using a GFCI breaker?

Question: Is there a way to get GFCI protection on a circuit greater than 20A (or 120V) other than with a GFCI breaker?  (I know you can do outlets and dead-front switches up to 20A on 120V.)  Just turning things over in my brain for future outdoor electrical stuff, like e-vehicle chargers.
Comment: Note that vehicle chargers often incorporate GFCI,  so you may not need to do anything else
Comment: What's the problem with using a breaker?
Comment: I'm interested in why?  Sometimes, if you describe "why" in words out loud ... then you imagine yourself trying to build and sell a product to meet that need ... you can also imagine yourself losing a lot of money.
Comment: @isherwood no real problem, just spitballing.
Comment: @keshlam just thinking about adding another 120V circuit to the location.  But I guess that could be done with the standard GFCI outlet/switch.
Answer: You can't, because they are not made, so it's a breaker or nothing.
Well, in the specific case of vehicle charger, you hardwire them and they have one (that's smart enough to self-reset) built in, so if you don't use a receptacle to PLUG them in, you're good.
Comment: Yeah. For future use, just run the wire,  terminate  iit in a box on either end, and  wait.  Or, perhaps better, run conduit with a pull rope to boxes, and then you don even have to guess wire gauge in advance.
Comment: My electrician told me a horror story about a customer last year who **insisted** on a large receptacle for *future* EV, in a jurisdiction that at that time already required GFCI for large 240V receptacles, which meant GFCI/breaker. Which my electrician had a crazy time sourcing due to manufacturer issues (not *only* "the supply chain" but also breakers not exactly fitting the panels they were supposed to fit). He eventually got it resolved properly, but if the customer had either picked an actual EVSE (and then hardwired it) or run the wires for future hardwired use and not with a receptacle
Comment: then it all would have been super easy.
Comment: @keshlam after reading the responses here and doing some additional research, that's probably the way it's gonna go.
Answer:
Is there a way to get GFCI protection on a circuit greater than 20A (or 120V) other than with a GFCI breaker?

Well, this might change, because NEC 2020 and NEC 2023 impose GFCI requirements on many 240V circuits.  However, (and this is the part that is an off-topic shopping question), the current products being offered by GFCI manufactures, which exceed 20A, only come in TWO types:

GFCI breakers
Car "chargers" = EVSE (Electric Vehicle Supply Equipment)

Just turning things over in my brain for future outdoor electrical stuff, like e-vehicle chargers.

If it's an EVSE powering a J1772, Mennekes or Tesla port, it will have "smart GFCI" built right into the EVSE.  So adding a "dumb GFCI" to those circuits is a waste of time and will defeat the smart GFCI (ground faults may trip all GFCIs, so the EVSE is now stone dead and cannot self-reset and cannot notify you).
However, if the EVSE is not installed thoughtfully, a dumb GFCI may be necessary.  For instance, if it is connected plug-and-socket, the socket must be GFCI protected. Better to hard-wire the EVSE, even if that concept feels a bit alien.  This requires a wall-mount style EVSE intended for permanent installation.
Note that many EVs ship with a "travel" EVSE that is intended for use traveling, for opportunity charging on the road, and as such, contains the sockets found on road trips: the normal one, and the NEMA 14-50 RV (Recreational Vehicle) socket found at RV parks. It was never intended for daily at-home charging, but its existence confuses the heck out of people, and fills their heads with wrong ideas.
Comment: Thanks, Harper!  I'll add that the reason I'm thinking to do this outdoors (rather than in the garage) is the risk of vehicle fire.  That may or may not still be a concern by the time I ever get an EV—who knows if things will improve in this area—but for the moment, I would sleep better knowing the car isn't gonna burn the house down.
Comment: @Huesmann Interesting concern about vehicle fires.  Honestly I spend all my time thinking about *service panel* fires due to putting unnecessarily large EV charging on an already-loaded panel.
Comment: It's not just fires that's a concern of the increasing adoption of EVs,  There are issues such as parking structures not being able to handle the weight—what happens when cars weight 1000 lb more than they used to?  (Obviously not a concern for SFH surface parking.)
Comment: @Huesmann LOL were you not paying attention? That already happened, not EVs' fault. Automakers [convinced people to buy these monsters](https://youtu.be/jN7mSXMruEo?t=114) so they could sidestep smog/MPG standards. Even econoboxes got fat: my last 3 cars weigh <2100 lb but post-2000 even econoboxes weigh 3100-3500 lb. depending on trim (read: automatic trans and A/C, which everyone gets, of course).  So that ship *has sailed*.  If anything, EVs will lighten vehicles by deleting the reasons automakers push SUVs.
Answer: TL;DR GFCI/breaker for 240V and 240V/120V has a number of advantages in design and production and little disadvantage (except cost) in use, so unlikely to see a lot of GFCI/receptacle options in the near future.
As already noted, these things are nearly unobtainable. But I think it is a matter of supply and demand, not any inherent complexity.
First key point: NEC 2020 does require GFCI for 240V receptacles. See this article for some details. Old stuff all grandfathered, but in new homes (or major renovations) you're going to need GFCI for "everything" in the key locations that have 240V or 240V/120V receptacles and appliances. That includes clothes dryers (laundry = wet area = GFCI in general so now GFCI for 240V), some cooking equipment (which is all the more reason to hardwire where practical), a lot of HVAC (inside not required if, as usual, hardwired, but outside now required for 240V even hardwired), etc. Exceptions are, at least for now, indoor hardwired appliances (oven, water heater, HVAC air handler) and hardwired outdoor that include GFCI in the appliance (EVSE).
Many jurisdictions are being deliberately slow to adopt these particular sections of NEC 2020 due to cost and problems getting the right parts. GFCI/breakers are the only option for most people, most of the time, for 240V any size, 240V/120V any size and 120V > 20A, and that can be a real problem with older panels and even with some recent panels (as my electrician can attest).
Honestly, I think this is a supply/demand issue, not a technical issue. It is easier for a panel manufacturer to make (and test, certify, etc.) one 30A GFCI/double-breaker than for a receptacle manufacturer to make two separate types (14-30 240V/120V and 6-30 240V), plus the GFCI/breaker will work for the hardwired appliances (now required for outdoors though not for indoors), and it may be a bit of a challenge to fit a 240V/120V GFCI/receptacle in a standard box.
Volumes are higher too. GFCI 15A/20A receptacles are "everywhere", so true volume production has kicked in to lower the cost per unit, even after including features such as automatic testing. A typical house will have at least 5 120V circuits requiring GFCI (kitchen x 2, bathroom, laundry, outdoors) and often several more (basement, extra kitchen and bathroom, etc.), all of which (except outdoors, where indoor location of the GFCI away from the weather is a plus) benefit from convenient point of use reset. Unlike kitchen, bathroom and outdoor receptacles, all of which are subject to occasional trips due to real-world problems (getting things wet while working in the kitchen and bathroom and outdoors are normal situations), 240V GFCI are likely to go years between trips, so convenient reset is a non-issue.
Back to the technical aspects: A 240V (hot/hot no neutral) GFCI/receptacle should be no more expensive than the equivalent 120V (hot/neutral) GFCI/receptacle, except for handling higher current. A 240V/120V (e.g., 14-30, hot/hot/neutral) GFCI/receptacle has to handle neutral, so the detection is more complex, but arguably the cost should not be more than double, except for handling higher current. An ordinary 120V receptacle (non-GFCI, no USB, etc.) might range from $1 to $5. An ordinary 240V/120V receptacle is more on the order of $10 to $30, depending on brand and quality. In fact, most 120V GFCI/receptacles that I know of include a better quality receptacle as part of the product - i.e., you don't get a $10 GFCI/receptacle that is based on a $1 receptacle, it is based on the $3 receptacle. With the cost on 240V/120V receptacles starting higher, and ranging even higher, GFCI/receptacle would either go really high cost or end up hiding the lower-quality of the rest of it to get a lower price-point, which is trading one problem for another.
But on GFCI/breaker, most of the high-current issues are handled pretty easily (e.g., you don't have user accessible contacts to deal with - everything is screwed in place), and in fact what you will typically find (quick Home Depot search, YMMV) is that within a given brand, a 2-pole GFCI/breaker will cost incrementally more than 2 single pole GFCI/breakers (i.e., more than 2x but less than 3x) and a high-current (e.g., 50A vs. 20A) GFCI/breaker will cost the same or very little more than a low current breaker. Because the panel manufacture can get everything done as one nice big batch for production, certification, etc.
Comment: a point showing that it's clearly just a supply-chain issue and not a technical one is the obvious fact that Europe has 240V GFCI breakers all over the place
Comment: @manassehkatz-Moving2Codidact: That's true, but I don't think checking three wires is _that_ much more complicated: most GFCI designs I've seen pass the two wires through a current-sensing coil; in normal use the currents are opposite so cancel out; if there is any current detected it indicates an imbalance so the GFCI trips. Moving to three wires just means passing all three wires through that coil (ie it doesn't trip as long as any current flowing through one hot returns through either the other hot or neutral). But as you say, supply and demand makes all the difference :)
Comment: FWIW, I wasn't planning to stick an outlet on the end of this thing, the Q was more of curiosity of "they have these things for 20A circuits, I wonder why you don't see them for 240V?"  But I guess it's because not many homeowners plug anything requiring 240V outdoors.
Comment: True about outdoors. But would apply equally to 240V in a basement or workshop or garage - all of which are a bit more common (240V woodworking equipment, etc.).
Comment: @user253751 Basically true. Except one key difference: A 240V European GFCI (RCD they call them, but basically the same thing) is checking two wires, while a US 240V is usually 240V/120V and checking three wires.
Comment: 3P+N DIN rail mount RCDs are definitely a thing here in Europe. I'm surprised no manufacturer has taken one and tweaked it's trip specs to meet US standards, maybe US certification is to onerous.
Answer: FYI, a spa panel can be sourced for $100-$150 and most of them come with a GFCI breaker already installed. It doesn't looks as nice as a plain plug on/in the wall, but it's definitely cheaper.
Answer: You can add one on the plug end... but I hope you've got a big budget. We're talking about a commercial-grade device that could cost more than your charger (that one is about $450). Contrast that with this 30A 240v GFCI breaker at a big-box hardware store for $130.
What makes this complex is how 240v works. A GFCI typically watches the hot and neutral. If they go more than slightly out of balance, it trips so you can't get electrocuted. A 240v setup doesn't technically need a neutral. As I noted elsewhere, there just aren't a lot of use cases for 240v GFCI as a result (and NEC doesn't mandate them either). With the market limited, anything that does exist will be for industrial setups where you are spending a ton on electrical anyways (when you're spending $50k on electrical, a $450 point-of-use GFCI makes more sense).