How can I type simple underline "_" in Auctex

Question: I am using Auctex in Aquamacs. Everytime I type underline "_", it will show as $_{}$ automatically which is very annoying. I am wondering how could I turn off this function. Thanks.
Comment: This (very useful, actually) feature is not enabled by default.  As explained by Gilles, this is controlled by `TeX-electric-sub-and-superscript`, you somehow set it to `t` in your init file.
Answer: You can always insert a character literally by typing C-q first (quoted-insert).
Many "electric" characters (that's what Emacs usually calls characters whose insertion has extra effects such as inserting extra braces, reindenting, etc.) are designed to revert to a plain insertion if you pass a numeric prefix argument, i.e. type ESC 1 _ or M-1 _ to insert one underscore. I don't know if this is the case specifically for the command you're using.
To see the effect of the _ key, type C-h k (describe-key) followed by _. That will give you a description of the command, and perhaps a way to customize it. By default, in AUCTeX, _ runs TeX-insert-sub-or-superscript which just inserts a _ unless TeX-electric-sub-and-superscript is turned on, and even then it only inserts braces if already in math mode.
It turns out that you're using cdlatex, where _ is bound to cdlatex-sub-superscript. If you want to keep using cdlatex but deactivate the electric behavior of _, you can remove _ from the cdlatex keymap after the package is loaded:
(defun my-after-load-cdlatex ()
  (define-key cdlatex-mode-map "_" nil)
  t)
(eval-after-load "cdlatex" '(my-after-load-cdlatex))

You may wish to activate AUCTeX's less invasive electric _ by setting TeX-electric-sub-and-superscript:
(setq TeX-electric-sub-and-superscript t)

Comment: Hi Gilles, thank you for your answer. I tries `C-h k` followed by `_`. The response is given below:
>  _ runs the command cdlatex-sub-superscript (found in cdlatex-mode-map), which is an interactive Lisp function in 'cdlatex.el'. At this moment, `C-q _` works for me. But how could I do to keep underline bound with  brace`{}` and dollars works and only works in math environment? Thank you.
Comment: @Raymond See my updated answer.


Can I use liquid floor leveler on a previously tiled wood bathroom floor where I could not get up all of the thin set

Question: This is a 8 x 5 bathroom floor on the second level. The wood subfloor seems to be in good condition, no movement, solid.  One section all of the old thin set that came up very nicely. The rest of it was a bear and I could not get it up at all whatsoever and seemed to possibly have something like self leveler over the thinset. We already primed it with the intent of putting floor leveler on it but am having second thoughts. I believe the largest variance from the lowest part to the highest part maybe a quarter inch.  we realize that the floor leveler will be pretty thick in some areas. Is there a reason this is not recommended? We intend on putting down a heat mat, thinset finishing with large 18 x 36 ceramic floor tiles.  Thank you.
Comment: Thickness and area size of old thinset ?  "*We intend on putting down a heat mat, thinset finishing with large 18 x 36 ceramic floor tiles.*" **You did not mention cement board**.  Cement board in the low spots, self leveling cement  in the voids, then thinset, cement board wall to wall,  heat mat, tile ?
Answer: 1/4" is not a problem with all the self leveling compounds I have used, self leveling compounds work best in a large area if you get them close with a wide trowel, I usually mark the edges or use a laser get it in the ballpark and it dose it's job.
Comment: Beat me to it.. just about my same answer...+  stay safe out there Ed


Haptic feedback on samsung galaxy s3 mini

Question: I have recently bought a Samsung galaxy s3 mini and there is no haptic feedback on my soft buttons or typing a message, there is only a vibration key press on my lock screen. I have tryed going into settings, language and input, keyboard setting but there is no vibration on key press option in any of the settings I have looked through. Can someone help me please?
Answer: Haptic feedback is still there. Go to Settings > My Device > Sound and it should be around the bottom of the options. It is labled haptic-feedback
Your keyboard should have its own option, but it depends on the particular keyboard.
Samsung Keyboard: Click on the 'cog' icon beside the space bar.  Click 'Vibration'.
SwiftKey: Settings > Sound & Vibration > Keypress Vibration.
Answer: When you want to type, there is the option "choose input method", that comes on the crossbar. Click it, then click "setup input method", then click the "Settings" on the Samsung keypad. Then scroll down to the "advanced options". Click it, then disable key tap sound. That is easy.


1981 amc concord won't start

Question: I have a 81 amc concord. I drove it and it died and went to start it again there was nothing. Replace starter battery and starter relay. There is no headlights no buzzer no radio no dome light. Any idea whats the problem?
Comment: Try checking your fuses and the ignition switch
Comment: Check the ground to the battery (both sides). You do not have connectivity to the battery.
Comment: Hey Paulster2. This happen once before. But the starter relay and battery was bad. But I drove it for a month now.
Comment: You have lost connectivity somewhere if you are getting nothing as you described. If you replaced the parts a month ago and it solved the issue, more than likely you only masked the true issue. Moving wires/cables around could have caused it to reconnect, but now it's lost it again. I'd check all of your power cables to see where the lack of continuity is located.
Answer: There is a fusible Link that possibly has blown, where the positive battery cable connects to the starter relay, there is a smaller red wire usually has heat shrink on it. replacement fusible link avail at NAPA, Advance auto etc, but could also use a fuse and holder.
Comment: Hey Paulster2. This happen once before but the battery and starter was bad.I drove it for a month and it happen again.Thanks for the diagram and advice.
Comment: Can the voltage regulator cause this promblem?
Comment: and where is the regulator located at?

1981 amc concord won't start


QGIS count objects, merge polygon standing close together

Question: I have to count objects. At first I binarized the grid and separated the object of interest.
Now I have the problem, that some objects consist of several polygon fragments. These fragments must be merged without enlarging all other polygons. As an example in the figure, the object in the middle consists three small polygons. These must be merged without changing the other polygons. I am looking for a tool to connecting polygons, that are in a defined distance to each other (for example 3 pixels)
Comment: Welcome to GSE ! Please specify if you are looking for a script method or a manual method.
Comment: I'm not a Qgis expert and I'm not sure about the difference. I would like to install the step in the model builder. I probably need a manual method.
Comment: I would suggest to use a "majority filter" first on your grid, which will result in more homogenous regions.
Answer: This is just a suggestion, an approach if you will, I am sure there will be a more elegant way / more fail-safe.

Convert rasters to polygon
Buffer polygons with a certain search radius (depends on your data) OR convert your polygons to centroids (center points and start your search buffer from there)
Intersect your polygons with your search buffer
"Count" your new intersect_polygons e.g. give them unique IDs based on feature number.
Copy the intersect_polygon ID to your original rasters

Maybe you could instead use GRASS GIS functionality?
It might be worth to check out r.grow to essentially buffer your rasters and then reclass them.
https://grass.osgeo.org/grass76/manuals/r.grow.html
I can't provide ready made examples, but this might help you.
Answer: This is a use case for a Binary Morphological Operation called closing.
it seems to be implemented in Qgis with OTB :
https://docs.qgis.org/2.8/en/docs/user_manual/processing_algs/otb/feature_extraction.html
The idea of this operation is to do two steps in order to fill space between polygons.
1) first step : use a buffer of your desired distance (i.e 3 pixels in your case)
2) second step : re-use a buffer with the same distance but negative (i.e -3 pixels)
You can do it with buffer and not use the OTB implementation
this will fill open spaces and let the "lonely" polygons in the same shape.
this idea comes from image processing not really GIS, but it will work.
Explanations and examples here : https://www.cs.auckland.ac.nz/courses/compsci773s1c/lectures/ImageProcessing-html/topic4.htm
Comment: yes, the tool I linked is part of OTB tools, so not by default in QGIS. But you can still do two buffers and reach the same result.
Comment: This tool seems to be part of the Orfeo toolbox which isn't a default in QGIS anymore. Which is a pity, because it seems like the best solution (to me at least).
Answer: You should try the integrate tool in ArcMap. Set the x and y tolerance to a value that is slightly smaller than the dimensions of a "typical" one of your objects. See documentation for that tool here: http://desktop.arcgis.com/en/arcmap/10.3/tools/data-management-toolbox/integrate.htm
After you do that, you can use the dissolve tool to merge the polygons that are touching one another.
Edit: In qgis you will want to use the v.edit function with "tool = snap" and "threshold" set to the dimensions described above. You will still need to run a dissolve after to update your counts.
https://grass.osgeo.org/grass77/manuals/v.edit.html
Answer: I would use python and scipy module to clusterize, following these steps:

Rasterize your features.
Create centroids for each polygon and store them in an array.
Cluster them by distance
Merge the groups of polygons.

This code should do the trick once you have the polygonized file:
<code>from scipy.cluster.hierarchy import linkage, fcluster
import geopandas as gpd

features_gdf = gpd.read_file("polygonized_file.geojson")
features_gdf['union'] = 0

centroids = np.array([list(list(feat.geometry.centroid.coords)[0]) for _, feat in featured_gdf.iterrows()])

Z = linkage(centroids, 'complete')
clusters = fcluster(Z, max_dist, criterion='distance')
cluster_dict = defaultdict(list)

for index, value in enumerate(clusters)

    features_gdf.iloc[index].loc['union'] = value

new_feats = features_gdf.dissolve(by='union')
new_feats.to_file("new_pols.geojson", driver="GeoJSON")
</code>
Answer: How about turning the polygons into centroids and then running "Concave hull (k-nearest neighbour)" from the processing toolbox?
You could play around with the K-value and filter the resulting polygons by area (those with a large area will have "jumped" to a polygon far away), and then use the filtered, smaller polygons to select the original polygons to join.
If filtering by area turns out to be a bad approach you could play around with filtering by length/height of the bounding box of the kNN hull.
You could also try this using the vertices of the polygons instead of the centroids.
Although this approach assumes that the size of the objects are never larger than the distance between two objects, so that's a limitation.
Answer: You could create a buffered version of all the polygons with the "Fixed Buffer" tool (where you set the buffer size to 3 x cell size of you raster for example).
Then use "Join attributes by location (summary)" to intersect the buffers with the original layer. In the "Join attributes by location (summary)" dialog you choose "count" as summary to calculate to get the number of features joined.
Then you could filter out all joined buffers that have only a count of 1, since they only intersected their original, unbuffered self. Those with a higher count have probably found your multipart raster objects.


Why is the wtxid considered malleable?

Question: Why is the wtxid considered malleable since the transaction is unconfirmed?
How can a third-party modify it?
Answer: All transaction data is committed to the WTXID, unlike in the case of TXID's.
Malleability is found in the unlocking script/data of a transaction. It is malleable, because is not committed to the signature (circular dependency).
Sources of TX Malleability:

Signature Malleability
Input Script Malleability

See BIP62 for a great overview of TX malleability sources.
The unlocking script data is found in input scripts (non-witness tx's) and witnesses (witness tx's). For a witness transaction, if the witness is modified in a way that doesn't affect validity, this necessarily changes the resulting WTXID.
The TXID's of witness transactions are not malleable, because the input script is empty and witness data is stripped for its TXID derivation. Transactions are not referenced by WTXID, but by TXID's.
Comment: I should mention, even if only TXIDs are committed to block headers (merkle root), WTXIDs are committed to a coinbase output (witness root), so that once confirmed, none of the witness transaction data cannot be modified.
Answer: To add to James' answer, the "segregated" witness can be switched out for an alternative valid witness which changes the wtxid but not the txid. The txid stays the same if you change the witness as the witness is not hashed for the txid but is for wtxid.
Thanks to Gloria Zhao for providing this graphic from BIP144 during a Bitcoin Core PR review club in June 2021.

Why is the wtxid considered malleable?


Infinite life of a material, Fatigue Strength

Question: After 10^6 cycles a component is considered to have infinite life. What makes 10^6 cycles a deciding factor for infinite life? Why not 10^8?
Comment: Divide 10^6 cycles by the number of cycles used per year or per day or per use. How many times can it be used?
Comment: Right: if a cycle takes  $1 ns$, then the material will be gone while you watch it ...
Comment: No one knows the answer. It is just an empirical observation, and it works fine.
Answer: Studies on fatigue life estimations was first done on steel axis in trains and continued on for other steel constructions. The majority of the fatigue publications have been based on fatigue estimations for steel and it has become a "standard" that $10^6$ cycles is "infinite life", because the Stress - Number-of-cycles (S-N or Whöler) curve flattens out after $10^6$ cycles for most steel alloys with minimal inpact on life after more cycles.
However, new research in the field has started looking into "Very High Cyclic Fatigue" (VHCF), which is beyond the "infinite life" region. See the article by S. Sharma et. al. [1] for more info. In short, there is no such thing as "infinite life" for many alloys and more research is required, the $10^6$ rule has been a rule of thumb.

A. Sharma, M. C. Oh, B. Ahn, "Recent advances in very high cycle
fatigue behavior of metals and alloys – a review", Metals, vol. 10,
no. 9, pp. 1200, Sep. 2020, doi: 10.3390/met10091200.
Comment: DNV-RP-C203 specifies the fatigue limit for curves at 10 mil cycles, and also has the kink at 10 M cycles. It is simply not true that there is little damage after 1 M cycles. I believe the 1M cycles is just a practical choice made for tests. Waiting for more than a million cycles is just not practical. If the test show more that a million cycles at a certain load level, it makes sense to assume it is infinite and not wait for 10 or 100 M cycles to see if it breaks.
Comment: Yes, in the article I linked they also mention $10^7$ as a limit before VHCF, but I have seen $10^6$ as well in some literature. I guess you are right, that it is about practical choice.
Answer: No, the only metal that has an indefinite life at some stress level is steel. All other metals have a limit to fatigue life. A rule of thumb for steel is unlimited life with maximum stress cycles less than half of the tensile strength.


Applying for a UK visa

Question: I was granted a 6 months visitors visa and it expired last April. I am planning to apply again. Is it okay to apply for a visitors visa again, a month and a half before my plan of travel?
Answer: The only problem would be if the visa official thinks you are trying to spend a lot of time in the UK by using a series of tourist visas. As a general rule tourists cannot stay more than 6 months in any 12 month period.
Answer: Yes. It is okay. (the text in the bracket is to reach the minimum characters)

Applying for a UK visa


How many solutions are there to the equation $x^2 + 3y^2 \equiv 1 \pmod{p}$?

Question: Let $p$ be a prime. How many solutions $(x, y)$ are there to the equation $x^2 + 3y^2 \equiv 1 \pmod{p}$? Here $x, y \in \{0, 1, \ldots p-1\}$. This paper (https://arxiv.org/abs/1404.4214) seems like it may give some ideas, but focuses on equations of the form $\sum_{i = 1}^n x_i^2 \equiv 1 \pmod{p}$, i.e. it does not allow for the possibility of coefficients on the variables.
Answer: The count is $2$ and $6$ for $p=2$ and $p=3$ respectively,
and otherwise $p-1$ or $p+1$ according as $p$ is $1$ or $-1 \bmod 3$.
More generally, it is well-known that a smooth plane conic
over ${\bf Z} / p {\bf Z}$ has $p+1$ points in the projective plane,
so we need only subtract the number of points at infinity,
which here is the number of square roots of $-3 \bmod p$.
(The primes $p=2,3$ are special because $x^2+3y^2-1$ factors as
$(x+y-1)^2 \bmod 2$ and $(x+1)(x-1) \bmod 3$.)
For general $x^2 - D y^2 = 1 \bmod p$ (with $p \not\mid 2D$)
the count is $p - (D/p)$ where $(D/p)$ is the Legendre symbol.
For $D=-3$ we can also choose between $p-1$ and $p+1$ by observing
that the solutions come in triples
$\{ (x,y), \frac12(-x-3y,x-y), \frac12(-x+3y,-x-y) \}$
so the count must be a multiple of $3$.
This trick is possible here because $(-1+\sqrt{-3})/2$
is a cube root of unity; likewise for $D = -1$
there's a fourth root of unity $\sqrt{-1}$,
and the solutions come in quadruples
$\{(\pm x, \pm y), (\pm y, \mp x)\}$ so for any odd prime $p$
the number of solutions of $x^2 + y^2 \equiv 1 \bmod p$
is whichever of $p \pm 1$ is a multiple of $4$.
Answer: Here is an alternate approach, more algebraic and less geometric. As in Noam's answer we'll consider the more general equation $x^2 - Dy^2 \equiv 1 \bmod p$. Consider the $\mathbb{F}_p$-algebra $A = \mathbb{F}_p[\sqrt{D}] \cong \mathbb{F}_p[\alpha]/(\alpha^2 - D)$, which is not necessarily a field. It has elements of the form $x + y \sqrt{D}$ and a multiplicative norm map
$$N : A \ni x + y \sqrt{D} \mapsto N(x + y \sqrt{D}) = x^2 - Dy^2 \in \mathbb{F}_p.$$
We want to compute $|N^{-1}(1)|$, which can be done as follows. Things split into a few cases, the last few of which are degenerate. In most of the cases $N$ will turn out to be surjective which gives $|N^{-1}(1)| = \frac{|A^{\times}|}{|\mathbb{F}_p^{\times}|}$ and we will compute this.
Case 1: $\gcd(D, p) = 1$ and $\left( \frac{D}{p} \right) = -1$ (which implies $p$ odd). Then $A$ is the finite field $\mathbb{F}_{p^2}$, whose multiplicative group is cyclic of order $p^2 - 1$, and the norm map $N : \mathbb{F}_{p^2} \to \mathbb{F}_p$ is given by $N(\alpha) = \alpha \overline{\alpha} = \alpha^{p+1}$. Hence if $\alpha$ is a generator of the multiplicative group of $\mathbb{F}_{p^2}$ then $\alpha^{p+1}$ has order $p-1$ and so is a generator of the multiplicative group of $\mathbb{F}_p$. It follows that
$$\left| \{ (x, y) \in \mathbb{F}_p : x^2 - Dy^2 = 1 \} \right| = \frac{p^2 - 1}{p - 1} = p + 1.$$
Case 2: $\gcd(D, p) = 1$ and $\left( \frac{D}{p} \right) = 1$ and $p$ is odd. Then $\alpha^2 - D = (\alpha - \sqrt{D})(\alpha + \sqrt{D})$ splits into a polynomial with two distinct roots which gives $A \cong \mathbb{F}_p^2$. Under this isomorphism the norm map can be identified with the multiplication map $\mathbb{F}_p^2 \ni (x, y) \mapsto xy \in \mathbb{F}_p$ which is clearly surjective. It follows that
$$\left| \{ (x, y) \in \mathbb{F}_p : x^2 - Dy^2 = 1 \} \right| = \frac{(p - 1)^2}{p - 1} = p - 1.$$
Case 3a: $p \mid D$ and $p$ is odd. Then $\alpha^2 - D \equiv \alpha^2 \bmod p$ is a polynomial with repeated roots so $A \cong \mathbb{F}_p[\alpha]/\alpha^2$ and the norm map is $N(x + y \alpha) = x^2$. Here the norm map is not surjective: its image on units is the subgroup of squares which has order $\frac{p-1}{2}$. This gives
$$\left| \{ (x, y) \in \mathbb{F}_p : x^2 = 1 \} \right| = \frac{p(p - 1)}{ \frac{p-1}{2} } = 2p$$
which of course can be obtained in a more elementary way; I'm including this case for the sake of completeness.
Case 3b: $p = 2$. Here $\alpha^2 - D$ is either $\alpha^2 \bmod 2$ or $(\alpha - 1)^2 \bmod 2$ so $A \cong \mathbb{F}_2[\varepsilon]/\varepsilon^2$. The norm map is either $N(x + y \sqrt{D}) = x^2 = x$ if $D$ is even or $N(x + y \sqrt{D}) = x^2 - y^2 = x + y$ if $D$ is odd; either way it is clearly surjective and we get
$$\left| \{ (x, y) \in \mathbb{F}_2 : x^2 - Dy^2 = 1 \} \right| = 2$$
which is even easier to obtain but again is being included for the sake of completeness.
Answer: You may simply rationally parametrize this curve: if $y=0$ we have 2 solutions, otherwise we may denote $x=1+ty$, and $x^2+3y^2=1$ reads as $2t+(3+t^2)y=0$. If $-3$ is a quadratic non-residue modulo $p\ne 3$, this has unique solution $y=-2t/(3+t^2)$ for each $t\ne 0$. If $-3$ is a quadratic residue, there are two non-zero values of $t$ for which there is no solution.
Answer: For any for any nonzero residues $a,b,c\not\equiv 0\pmod{p}$, the number of solutions of the congruence $ax^2+by^2\equiv c\pmod{p}$ equals $p-\left(\frac{-ab}{p}\right)$. For the proof, see my post here. Note also that this proof generalizes easily to any number of variables.
Answer: We give yet another approach to proving the result,
using nothing more advanced than properties of the Legendre symbol.

Proposition.
Suppose $p$ is an odd prime and $D$ is not a multiple of $p$.
Then the number of solutions of $x^2 - Dy^2 \equiv 1 \bmod p$ is
$p - (D/p)$, i.e. $p-1$ if $D$ is a square mod $p$ and $p+1$ if not.

Proof:
It is clear that the answer depends only on the Legendre symbol $(D/p)$,
because for any nonzero $c \bmod p$ the invertible change of variables
$(x,y) \to (x,cy)$ shows that the count is the same for $D$ and $c^2 \! D$.
Let $N_+$, then, be the number of solutions for $(D/p) = +1$,
and let $N_-$ be the number of solutions for $(D/p) = -1$.
Next observe that $N_+ + N_- = 2p$, because each $x$ that contributes
$2$, $1$, or $0$ solutions to $N_+$ contributes
$0$, $1$, or $2$ solutions respectively to $N_-$.
So it is enough to prove the Proposition for one of $N_+$ and $N_-$.
But $N_+$ is the number of solutions mod $p$ of
$1 \equiv x^2 - y^2 = (x+y) (x-y)$.  Write $(r,s) = (x+y, x-y)$,
so $x,y \equiv (r\pm s)/2$.  Now the equation
$rs \equiv 1$ has $p-1$ solutions mod $p$:
each nonzero $r \bmod p$ determines uniquely the value of
$s \equiv r^{-1} \bmod p$.  Therefore the equation
$x^2 - y^2 \equiv 1 \bmod p$ also has $p-1$ solutions,
namely $\bigl(\frac12(r+r^{-1}), \frac12(r-r^{-1})\bigr)$.
This proves that $N_+ = p-1$,
whence it follows that $N_- = 2p - N_+ = p+1$.  QED
Answer: We give an elementary approach to the more general equation $x^2+Dy^2=1 \mod p$.
Firstly,
if $p=2$ we have $2$ solutions as either $x^2=1$ or $x^2+y^2=1$ and
if $p|D$  we have $p$ values for $y$ and $x=\pm1$ giving $2p$ solutions.
The remaining case is $(D,p)=1$ with $p$ odd.
The equation $x^2+Dy^2=z^2$ can be solved by re-writing as $z^2-x^2=Dy^2$ or $AB=Dy^2$ where $z-x=A$, $z+x=B$. An easy calculation shows this has a total of $p^2$ solutions. (Consistent with the Chevalley-Warning theorem which says the number of solutions must be divisible by $p$)
However we need to remove the $z=0$ solutions.  We have $2p-1$ to remove if -D is a quadratic residue and 1 if -D is a non-residue giving $(p-1)^2$ and $p^2-1$ solutions respectively.
Since $z\neq0$ has been excluded we can divide by $p-1$ to get the number of solutions to the original equation yielding $p-1$ if $-D$ is a residue and $p+1$ otherwise.


I have a pop up every time I open my phone

Question: Can someone please tell me what app is causing this pop up every time I open my phone? It's annoying, because I have to click on it every time just to use my phone. I've attached a screenshot.
Comment: It would seem you have an app on your phone that is popping up ads.  Without knowing what you have installed on your device, I would suggest trying to track down the app by uninstalling potential apps to see which one is triggering these.
Comment: Adwares. Proceed as described above.
Answer: Remember when did this start to happen. Then uninstall apps after that time.
If that didn't work a factory reset is always handy.
Good Luck!
Answer: At first check if you have installed any application that was installed by you or not. You can see the from setting >Apps (No rush if you are not much familiar with system apps and can leave them alone)
If you can't see any suspicious application, you should be cautious and maybe it is highly exploited. in this case you have to make full wipe and install a new rom.
if you can see some application that was installed by you but not from playstore uninstall that too cause Google developers have to follow their market and community standard .


breadcrumbs & rel="nofollow"

Question: Should a breadcrumbs navigation have links set to rel="nofollow"?
Answer: I think it depends what your goal is and what the breadcrumbs represent. I would say that for most wordpress sites nofollow on breadcrumbs is probably a nonissue.
Let's start with nofollow. Nofollow says you don't want a search engine to pass on page rank to this link. So if you had comment links and people can post their personal website you would probably use nofollow. This makes spamming your website link pointless because the links aren't being followed anyways.
Nofollow is also important because page rank flows evenly between links on the page. So if you have three links that are really important to you and then a hundred comments with random websites in them, you don't want page rank getting split 103 ways.
Now your question. If the breadcrumb items are important for search engines then have them followed. If you don't care about your breadcrumbs getting indexed then nofollow them. If it were me I would probably have my root node followed, the front page of my blog, and I would not have child nodes followed because those are just categories.
Comment: Hm. This brings me to a problem: I'd need to find out how to identify the category/archives/etc. links, then try to hack into them and then add rel="canonical" instead of rel="nofollow"...
Comment: In your header.php you can use conditional tags to determine when you are on pages of that type and include canonical. However, don't include canonical. This is used incorrectly because it is not understood well by people. It is also optionally enforced my search engines, has no means of being authoritative and is not trackable. http://codex.wordpress.org/Conditional_Tags
Comment: I know conditional tags, but they won't solve my problem. I need to check whether a link goes to an archive type page or not and not if i'm currently on an archive page. Links to non-archive pages should have follow even on archive pages. Archives (itself) of any kind are reduntant and therefore should be marked as a) nofollow (bad) or b) canonical (better).
Comment: You can't add canonical to links. They go on pages in the head section. So you can't mark the breadcrumbs as canonical in the first place. You can put canonical on the archive pages - but don't. I can't make sense of it or why you would want to do that.

breadcrumbs & rel="nofollow"


Which devices store DNS cache and how to flush?

Question: If a computer is running Windows its DNS cache can be flushed with ipconfig /flushdns but am I correct that routers also often store DNS cache? I'm assuming the ipconfig command doesn't flush the router, and that most routers would flush their cache on a power cycle? So does this mean if there's issues with an invalid DNS entry each intermediary router may not to be power cycled?
Comment: Invalid cache responses usually have a relatively short timeout and all well-functioning intermediaries will flush the response at the end of that timeout.  If the authoratative DNS says a request is invalid, it is,  If your Windows device is unable to connect to DNS, it will cache entries as invalid.  ipconfig /flushdns will clear these one you fix connectivity.  If you change networks, DNS validity may change, and /flushdns will fix this.  In either case upstream DNS will not have cached invalid data.
Comment: @BillThor this was for a smart TV and no one knew how to flush the dns cache on it.
Comment: A Smart TV the cache may flush DNS if you reconfigure the network.  They usually have continuous power, so you may need to unplug it for  several seconds to clear volatile memory.  I wouldn't expect a Smart TV to do a query that caches an invalid value very often.
Answer:
[A]m I correct that routers also often store DNS cache?

Some do but it depends entirely on the router, firmware involved and the current settings if applicable.

I'm assuming the ipconfig command doesn't flush the router[?]

No it does not.

[I'm assuming most] routers would flush their cache on a power cycle?

Again, it depends entirely on the router and firmware involved. That said, it would likely not be unexpected behavior.

So does this mean if there's issues with an invalid DNS entry each intermediary router may [need] to be power cycled?

It could be a possibility, yes, at least if you want them to immediately forget any cache entries (assuming a power cycle would do this).
If they were doing caching, it might also be possible to log into them manually and clear the cache.
Answer: Which devices store DNS cache and how to flush?

Almost all DNS servers store DNS cache.  Depending on your network requests will usually pass through one or more recursive DNS servers.  Normally, they will all cache the data for the time specified by the upstream DNS server.
Most recursive DNS servers will flush their cache when they are restarted.  Other than that they usually do not have a method to flush cache.  Cached values just time out and get replaced by new values as needed.  If the cache size is limited, inactive cached values may be removed from cache before they time out.
Your home router may have a DNS server which may be able to cache DNS values.  They are usually configured to use your ISP's DNS servers, which in turn may connect to other recursive servers.  Your ISP's DNS servers and other upstream DNS servers are unlikely to be flushed unless they are upgraded or the server is rebooted.
People who maintain DNS tables generally set short timeout values when making changes.  This ensures that properly functioning DNS caches clear incorrect values quickly if a mistake is made or a value is being changed.  Once the change is verified, the timeout may be increased.
Authoritative DNS servers are almost always configured so that there are redundant servers on different networks to ensure that at least one server is always available.


Can I compete with 20 domain authority in a high-paid niche?

Question: I have found a niche in which demand is relatively high for a freelancer, but all top websites have 10-20 domain authority, and I think I can achieve more than that. Considering this niche is related to language services with highly-paid customers, can I compete with them? i.e. I wonder why in this niche top websites' DA is low?
Answer: DA is not a strong indicator of competitiveness. It's is not a reflection of actual authority Google assigns.
Practice shows, best SEO results are achieved when people pay zero attention to DA, instead using less processed, but more raw metrics.
But to answer your question: if DA is everything there is to those sites, then sure, you can compete using only DA :)
Comment: No, not even close to everything, not even a quarter of everything. Moreover, in life, there's almost never a metric where everything that matters would be counted.
Comment: Thanks for your answer. Of course DA isn't everything, but I though everything was counted in calculating DA.
Answer: You Can Compete, but Don't Look at Domain Authority to Gauge Your Competition
Domain Authority is (IMO was) a metric developed by Moz in 1999. The original algorithm was primarily based on PageRank. In 2019, the company launched Domain Authority 2.0 - which now adds some degree of machine learning into the formula.

As of the Domain Authority 2.0 update in early 2019, the calculation of a domain's DA score comes from a machine learning algorithm's predictions about how often Google is using that domain in its search results. If domain A is more likely to appear in a Google SERP than domain B is, then we would expect domain A's DA to be higher than domain B's DA.

I still don't trust it, in fact I take all software proprietary metrics with a grain of salt. How can I trust something I don't understand? I go by instincts and observation. John Mueller has reaffirmed many times that Google does not have a domain authority metric or signal in use at Google.
BNazaruk is spot on - don't pay attention to it. Many of the most talented SEOs I know don't even use tools.
Optimize On-Page & Technical, Load Fast, Have a Good UX, and Create Better Content
When I think about how to rank on a SERP, rather than looking at what all of the results on the first page are doing (in their content), I look at what they're not doing that is highly relevant to the query.
So within this niche of yours, look for queries where you can add unique value to the overall SERP - how can you make it more diverse?
Proof that Good Content is Good Enough
Here is a screenshot of my site with a DA 3 and 1 backlink ranking 2nd for the term "keyword concatenation tool".
Comment: @PooryaZeynalzadeh of course domain age plays a factor that's just how the internet works. I encourage you to not actively _go far out of your way_  to build links. Let your content do that for you - if it has the merits you'll rank just fine. I've updated my answer with a screenshot that you should find interesting.
Comment: My domain was maybe 3 months old at the time that screenshot was taken.
Comment: Thanks for your answer, it was really helpful. However, unfortunately good content isn't enough for competing. I can get good quality backlinks, I can write better and more in depth content, but at the end of the day, Google tend to not trust newer websites over older ones. I think this is unfair


Examples for books that don't use (traditional) chapters?

Question: I'm a big fan of Terry Pratchett, and he doesn't use chapters (mostly).  Are there any other authors who tend to not use traditional chapters or chapters at all in novels?
Comment: @muntoo It took me forever, even knowing what H2G2 stood for, to figure out how H2G2 stood for that.  What a terrible abbreviation.
Comment: H2G2 Book 3 (Life, Universe, and Everything) by Douglas Adams has some chapters that are only a few sentences long.
Comment: Closing as a poll/list question.
Comment: @jae - when you speak of not using chapters, does additional whitespace breaking up the text count as a chapter break or not?  What genre (in the broad category of fiction or non-fiction, perhaps) are you looking to receive answers on?
Comment: Add'l space doesn't count as chapter break.  I'm think of explicit chapters, usually starting on a new page.  Something you can (and often would) make a table of contents from.  And it's about fiction, since I'd expect this to be a lot rarer in non-fiction.
Comment: @jae - since this calls for a list, I have converted it to CW.
Comment: @Strix Just google "what does h2g2 stand for" and look at the second link.
Comment: The question is, what do "chapters" do? Often, a chapter ends when a sequence of events comes to an end. In the Hunger Games trilogy, on the other hand, many chapters end at the most suspenseful moment of the action, thus creating a cliffhanger at the chapter end. Are these actually real chapters? And does the absence of empty pages and headlines between sections of text mean that a novel does *not* have "chapters"? There is a big difference between internal text structure and outward visual structuring such as paragraphs or chapters. They are not the same. So what are we talking about here?
Comment: [The Gates of Paradise](http://en.wikipedia.org/wiki/The_Gates_of_Paradise) forfeits not only chapters but sentences too.
Comment: Every author is different, therefore all their novels should be different. Like art..."that's the way I like it!"
Answer: I read an interesting novel by Lionel Shriver called We Need to Talk About Kevin.  This book didn't have any paragraphs at all, it was a series of letters written from the main character to her husband.
Although this sort of technique doesn't work for the vast majority of novels, it can be a good way to keep your readers reading.  Short blurbs of information (like letters or journal entries or even just short paragraphs) are a good way to make you lose track of time when you're nose deep in a good book.  It also makes it easy to stop reading when need be, without the pressure of getting to the end of the chapter in a hurry.
Comment: I would actually say that epistolary novels necessarily form chapters. It's an internal, intrinsic division into sections, which isn't that much different.
Answer: Austerlitz by W. G. Sebald consists of a handful of paragraphs, each of 50 or so pages. Many sentences are several pages long. This suits well the fluid and urgent first-person relation of the story.
Comment: Color me intrigued.  Because *I*, even though I can be wordy (aka eloquent ;-)), don't speak in sentences that long.  :-D
Comment: Well he didn't state how big the page is, *and the font size*.
Answer:
Gilead by Marilynne Robinson does not use chapters.  Sections are broken with an additional line or two of whitespace.  The entire pace of Gilead is intentionally slow, inviting you in to the mind of an aging, dying man.  The lack of chapters helps to keep this slow pace along with the beautiful description.
Home by Marilynne Robinson uses the same technique, but in the last case the lack of chapter breaks encourages you to continue moving through the story because of the use of more dramatic tension.
To the White Sea by James Dickey has no chapters.  It has been variously described as a first person poem in novel form as well as harrowing.  The story of a white man's escape from Japan in WWII.

The effect of not having chapters on a novel can, as the three books above show, be various.  In some cases it will slow the book down.  In other cases it will grip the reader and keep them turning the pages.  As long as your prose, plot, and characters fit your reasoning for the unique pacing a book without chapters provides, it can be a great decision.
Answer: David Gerrold has always shied away from numbering chapters; he just puts in a section break and keeps writing. Of particular note are his books When HARLIE Was One, The Man Who Folded Himself and The Flying Sorcerers, his collaboration with Larry Niven; all of these have no numbered or named chapters, just chunks of text.
Answer: Another is Alternatives to Sex. It has chapters, but they're not what you'd consider traditional chapters -- much shorter and they broken by the shape and pace of the narrative.
Answer: Play it as it Lays by Joan Didion has a very interesting use of chapters, some only one paragraph in length. It is laid out with lots of white space. It's a great book, too.


Graph program name

Question: Does anyone know the name of the program that gives graph output in this format? Notice how the numbers at the top are between lines instead of before or after.
Comment: I'm not familiar with this kind of diagram. As a graphic designer I'm just thinking any vector application could have been used to make this. And the placement of the numbers would be a design decision. But there might be a graph program that outputs this design by default of course.
Answer: You can 100% achieve an exact copy of that using a table in InDesign, however we can't possibly tell what was used to produce your original image.
Answer: The easiest way to imitate this look is to use a spreadsheet:

This is Excel, but freeware such as OpenOffice do the same as well.
Black squares are cells with black fill color.
The placements of the numbers and their typing directions vary. Numbers 10 and 20 occupy actually 2 cells each. 1 and 0 are in adjacent cells, only justified differently.
As said, this imitates only the visual look. No idea which program, data and functions would produce the same automatically

Graph program name


What is the difference between features in vgg

Question: I read the architecture of the model but this is the first time I try to use it . The calculations of the features map will be different if I extract the features from the two last layers or from the last layer but does it will affect if I used it in another model.
Answer: Yes it will definitely affect the result. If you are going to use CNN pre-trained models for feature extraction you have to remove the last output layer.
Along with that you have to remove all the densely(Fully) connected layers since those will act as ANN for processing to predict the results.
We need only the features to be trained using other models like SVC, Random forest etc.
Comment: Thanks a lot for replying , but excuse me if I want these features for captioning .. will I remove the last only ?
Comment: sorry to say. last layer is just the classification layer(i mean output layer) in the pre- trained models followed by some fully connected layers,  Irrespective of final output, either captioning or normal classification etc you only need the features so it is good to remove the fully connected layers as well.
Comment: Thakns. you mean like that `model=Model(inputs=model.inputs,outputs=model.layers[-2].output)`
Comment: Yes correct, make sure it removed all the fully connected layers using model.summary() before and after applying -2. Then sometimes -2 will remove any Average pooling layer as well, if so please add that layer at the end like.

`new_layer = tf.keras.layers.GlobalAveragePooling2D()(densenet_model.layers[-1].output).
customized_denset = Model(densenet_model.input, new_layer)`
Comment: Thanks a lot if you have a good background in captioning can you please give me your email . Thanks in advance


Support Beam for 14 ppt span

Question: I have a 14 foot span that is load bearing on 1st floor, 2x8 joists. What is needed to support the weight on this cape in connecticut.
Answer: While Ecnerwal is probably right, a little expansion is appropriate here.
You'll probably need a steel beam to hold it up. You can take a stab at a laminated beam, but steel is the gold standard because a steel I-beam holds far more than a laminated beam.
If it were my house, I'd make sure I get it right because if you don't the cost of repairs could be far more than a steel beam. Or a structural engineer.
Answer: The structural analysis of an engineer licensed to practice in Connecticut.

Support Beam for 14 ppt span


Why are there $3N - 3$ optical branches for a system in 3-Dimensions with $N$ different atoms per unit cell?

Question: I am specifically referring to when we can approximate the atoms to be in a chain and they interact via harmonic potentials, for instance, if $N = 2$, we have a diatomic cubical lattice. For the acoustic modes, I can see we have 3 acoustic branches (one for every dimension) but I don't understand why we have $3N - 3$ optical branches.
Answer: The acoustic and optical branches come about from the fact that per spacial dimension, there is one mode where the atoms oscillate "mostly in phase", and all the others have at least one atom per unit cell "out of phase".
The relation also holds for onedimensional systems, where it is easier to visualize. In that case, we have only 1 acoustic, and $s-1$ optical branches, $s$ being the number of atoms per unit cell.
Even though this is 1D, I drew the amplitudes vertically, so it's easier to see what's going on.

Excuse the crude drawing, but I think it will get the point across. The upper sketch is the acoustic mode at some $k$-value, the lower is the optical mode at the same $k$. The lower mode will have a higher energy, since the "springs" connecting neighboring atoms are stretched much further, resulting in stronger forces and faster oscillations. For 3 atoms in the basis, things get a little more complicated, but the acoustic mode looks pretty much the same. However, when there are 3 kinds of atoms, there are 2 different modes like the lower one.
A more mathematical take on this would be to look at the dimesion of the dynamical matrix. In 1D we get an $s \times s$ matrix that we need to diagonalize, giving $s$ eigenvalues for the frequencies. In 3D we have $3s \times 3s$ giving $3s$ eigenvalues, resulting in $3s$ branches in total. This does, however, not explain their distribution to 3 acoustic and $3s-3$ optical branches.


Tension in a string attached to a spring with deformation at a point

Question: I am trying to calculate the tension in a string in the configuration shown in the diagram below. Here is a verbal description of the setup:
The string is fixed at one end with the other end connected to a spring. The spring, with constant $K$, is limited to only vertical movement. The string begins with a tension $T$, which causes the free end of the spring to extend from its resting position $S_0$ to position $S_0+S$ such that the following relationship is upheld:$$F_s=K\cdot S=T\cdot\frac{h}{\sqrt{D^2+h^2}}$$ A distance $x$ along the horizontal from the fixed end of the string, a force $F$ is applied vertically downward. This force is such that the string is forced into the configuration shown with a tension $T_1$. The spring will naturally extend to accommodate this deformation until the free end is $h_1$ above the horizontal line defined by the segment labeled $x$. It seems to me that if the string has cross-sectional area $A$ and Young's modulus $Y$ then it should be possible to determine the tension $T_1$ as a function of $A$, $Y$, $x$, $T$, $D$, and $h$.

$S_0$ is not relevant to the calculation at all. I can calculate $S$ using $$S=\frac{T}{K}\cdot\frac{h}{\sqrt{D^2+h^2}}$$ I should be able to calculate $$T_1=K(S+h-h_1)\cdot\frac{\sqrt{(D-x)^2+h_1^2}}{h_1}$$ and from previous problems I know that I can calculate $$T_1=(T+AY)\frac{x+\sqrt{(D-x)^2+h_1^2}}{\sqrt{D^2+h^2}}-AY$$ However, I can't for the life of me find a way to write $h_1$ in terms of the other variables so that I can remove it from either equation for $T_1$. I think it should be possible since $h_1$ is simply an equilibrium point, but I've been unable to work it out myself. I'm probably missing something obvious, but some other eyes on this problem would be greatly appreciated!
Answer: I assume the length of the rope remains constant. At first the length is given by:
$$L=\sqrt{D^2+h^2}$$
After applying the force, the length is given by:
$$L=x+\sqrt{(D-x)^2+h_1^2}$$
By assuming $L$ is constant, one can derive an expression for $h_1$:
$$\sqrt{D^2+h^2}=x+\sqrt{(D-x)^2+h_1^2}$$
$$\left(\sqrt{D^2+h^2}-x\right)^2=(D-x)^2+h_1^2$$
$$h_1 = \pm \sqrt{\left(\sqrt{D^2+h^2}-x\right)^2-(D-x)^2}$$
Comment: Yes I can solve it if I assume the length is constant, but I'm trying to account for the stretching of the string under tension.


Hadoop Hive - best use cases to create a custom Hive Input and Output formats?

Question: Just wanted to understand what best use cases to create a custom Hive InputFormat and Output format?
If anyone of you have created could you please let know when to decide to develop a custom Input / Output formats?
Thanks,
Comment: There is only 1 use case : when you can't achieve your goal with the existing formats.
Answer: To make Hive varchar behave like Oracle varchar2:
While working on oracle to hadoop migration, we came across a setting in oracle where if the length of data for a varchar2 column exceeds the value defined in table DDL, oracle rejects the record.
Ex: Lets say we have a column 'name' in oracle and hadoop with max length 10 bytes
name varchar2(10 BYTE) - Oracle
name varchar(10) - Hive
If the value for name field="lengthgreaterthanten", oracle rejects the record as oracle applies schema during write time. Whereas hive reads "lengthgrea" i.e. 10 characters as Hive just applies the schema at the time of reading the records from HDFS.
To get over this problem we came up with a custom input format that checks the length of the varchar field by splitting on the delimiter. If the length is greater than the specified length, it continues to the next record. Else if the length is less than or equal to the specified length, the record is written to HDFS.
Hope this helps.
Thanks
Answer: one of the various file formats used for Hive are  RCFile, Parquet and ORC file formats. These file formats are columnar file format. This gives an advantage that when you reading large tables you don't have to read and process all the data. Most of the aggregation queries refer to only few columns rather than all of them. This speeds up your processing hugely.
Other application could be storing , reading and processing your custom input format, where data might be stored differently than csv structure. These might be binary files or any other structure.
You will have to follow the documentation to create input formats. For details you can follow the link: Custom InputFormat with Hive


Disabling Trackpad while typing does not work

Question:
I installed Ubuntu 12.04LTS on my Lenovo Thinkpad Edge 320 and the Option to disable the trackpad while typing does not work.
Thank you for your help!
Answer: You can use syndaemon to automatically disable touchpad while typing.
An example would be:
syndaemon -i -K -R -t -d
-i specifies how many seconds after last key press before enabling the touchpad (default is 2 seconds)
-K allows modifiers such as Shift and Alt
-R uses XRecord for detecting keyboard activity instead of polling
-t only disables tapping and scrolling but allows mouse movement
-d will start syndaemon as a daemon
you can see all of the options on
man syndaemon
Comment: so when i write "syndaemon -i 0.5" i won't get a new command line. It works but only until i close the Terminal. It looks like it is stuck in a loop after i send the command.
Comment: @Daniel You may try running it with ` &` at the end so that it's run in the background. As for the terminal closing problem, if you save the command in a simple script file and add it to the starting apps, I think it should do the thing. Perhaps adding something like `sleep 15` before the command may be necessary.
Comment: @Daniel did you try 'syndaemon -i 0.5 -d' ? The -d should start it as a daemon and run in background


Maximal Closed Subgroups of $ SU_4 $

Question: What are the maximal closed subgroups of $ SU_4 $?
The full list of maximal subgroups I'm proposing is:
Type I (normalizer of maximal connected subgroup)
\begin{align*}
& U_3 \cong S(U_3 \times U_1) \\
& S(U_2 \times U_2):2 \\
& 4 \circ_2 Sp_2
\end{align*}
Type II (finite maximal closed subgroup)
\begin{align*}
&4\circ_2 2.A_7
 \\
&4\circ_2 Sp(4,3)
 \\
&N(2^{2(2)+1})
\end{align*}
Type III (normalizer of a subgroup which is connected but not maximal connected)
\begin{align*}
& N(T^3)=S(U_1 \times U_1 \times U_1 \times U_1) : S_4\\
& SO_4(\mathbb{R})\cdot 4 \\
\end{align*}
Note that $ S(U_1 \times U_1 \times U_1 \times U_1) $ is contained in $ S(U_3 \times U_1) $ above. And $ SO_4(\mathbb{R}) $ is contained in $ Sp_2 $. However $ SO_4(\mathbb{R}) \cdot 4 $ is not contained in $ 4 \circ_2 Sp_2 $.
Note on notation. $ : $ means split extension (semidirect product). $ \cdot $ means nonsplit extension. $ \circ $ denotes central product, in all cases here we have $ 4 \circ_2 H $ is just the group generated by $ H $ and $ iI $ but that group is not a direct product since already $ -I \in H $, we get a central product essentially with two $ H $ components.
Here all the $ N $ denote normalizer. Recall that a positive dimensional (type I and type III above) maximal subgroup of a simple Lie group equals the full normalizer of its identity component.
https://arxiv.org/pdf/math/0605784.pdf
classifies all maximal closed subgroups of $ SU_n $ whose identity component is not simple (here trivial counts as simple). According to table 5 the maximal closed subgroups of $ SU_4 $ of this type are:
The normalizer of the maximal torus (row 4 table 5, $ \ell=4, p=1 $)
$$
 N(T)=S(U_1 \times U_1 \times U_1 \times U_1) : S_4
$$
As well as (row 1 table 5, $ p=3,q=1 $ )
$$
S(U_3 \times U_1 )\cong U_3
$$
and the normalizer of $ S(U_2 \times U_2)= \{\begin{bmatrix} A & 0 \\ 0 & B \end{bmatrix}:A,B\in U_2,det(A)det(B)=1 \} $ which is a split extension (row 1 table 5 $ p=q=2 $)
$$
< S(U_2 \times U_2),\begin{bmatrix} 0 & 0 & 0 & 1\\ 0 & 0 & 1 & 0 \\ 0 & 1 & 0 &  0 \\ 1 & 0 & 0 &  0 \end{bmatrix}> \cong S(U_2 \times U_2):2
$$
where the normalizing matrix swaps the two blocks in the direct sum.
Next there is (row 3 table 5, $ p=2 $)
$$
<SU_2 \otimes SU_2, \zeta_8\begin{bmatrix} 1 & 0 & 0 & 0\\ 0 & 0 & 1 & 0 \\ 0 & 1 & 0 &  0 \\ 0 & 0 & 0 & 1 \end{bmatrix}>
$$
where the normalizing matrix swaps the two tensor factors and applies a global phase. Here the identity component $ SU_2 \otimes SU_2 $ contains $ -I=(\zeta_8 SWAP2)^4 $, but does not contain $ iI=(\zeta_8 SWAP2)^2 $, so the full normalizer is the nonsplit extension $ SU_2 \otimes SU_2 \cdot 4 $. This subgroup is conjugate to the normalizer of the standard $ SO_4 $ subgroup
$$
 SO_4(\mathbb{R}) \cdot 4
$$
and we prefer to write it that way. For more details see
Is $ SU_2 \otimes SU_2 $ conjugate to $ SO_4(\mathbb{R}) $ in $ SU_4 $?
Next, we consider maximal closed subgroups with nontrivial simple connected component.
By dimension, such a subgroup would be isogeneous to $ SU_2,SU_3,Sp_2 $ or $ G_2 $.
There is no 4d irreps of $ SU_3 $ since the dimension of $ SU_3 $ irreps are given by the formula
$$
\frac{(m_1+1)(m_2+1)(m_1+m_2+2)}{2}
$$
Similarly there are no 4d irreps of $ G_2 $ since the dimensions are given
https://en.wikipedia.org/wiki/G2_(mathematics)
[Credit to Jason]
The symplectic subgroup
$ O_5(\mathbb{R})= 2 \times SO_5(\mathbb{R}) $ is a maximal subgroup of $ SO_6(\mathbb{R}) $. Lifting through the double cover $ SU_4 \to SO_6(\mathbb{R}) $ we have that
$$
4 \circ_2 Sp_2=<iI,Sp_2>
$$
is maximal subgroup of $ SU_4 $.
Every irreducible $ SU_2 $ subgroups of $ SU_4 $ is contained in a conjugate of $ Sp_2 $. See
Understanding the 4 dimensional irrep of $ SU_2 $
Indeed the containment $ SU(2)_{irr} \subset Sp(2) \subset SU(4) $ is the lift of $ SO(3)_{irr} \subset SO(5) \subset SO(6) $ through the double cover $ SU(4) \to SO(6) $. Here $ SU(2)_{irr} $ is the image of the 4d irrep of $ SU(2) $ and $ SO(3)_{irr} $ is the image of the 5d irrep of $ SO(3) $. Similarly we have that $ N(SU(2)_{irr})=4 \circ_2 SU(2)_{irr} \subset N(Sp(2))=4 \circ_2 Sp_2 \subset SU(4) $ is the lift through the double cover of $ N(SO(3)_{irr})=O(3)_{irr} \subset N(SO_5)=O(5)=S(O_5 \times O_1) \subset SO(6) $. So in particular there is no maximal subgroup of $ SU_4 $ with simple connected component isogeneous to $ SU_2 $. All such groups are $ 4 \circ_2 SU(2)_{irr} \subset 4 \circ_2 Sp_2 $ and thus not maximal.
Finally we consider subgroups with trivial connected component. These are finite since $ SU_4 $ is compact. To be maximal they must at least be primitive. Primitive finite subgroups of $ SU_4 $ are classified by work of Blichfeldt 1911 which was rewritten in modern notation here https://arxiv.org/abs/hep-th/9905212 From this we conclude there are $ 4 $ finite groups maximal among the finite subgroups of $ SU_4 $.
The central product
$$
4 \circ_2 2.A_7
$$
of order $ 4(2,520)=10,080 $ (maximal closed since it is maximal finite and a 3-design)
the central product
$$
4 \circ_2 Sp(4,3)
$$
of order $ 4(25,920)=103,680 $ (maximal closed since it is maximal finite and a 3-design).
$$
N(2^{2(2)+1})
$$
is the normalizer of an extraspecial 2 group of order $ 32 $. This group has order $ 4(11,520)=46,080 $ (maximal closed since it is maximal finite and a 3-design). This group is know as the 2 qubit Clifford group in quantum computing. For details see
https://quantumcomputing.stackexchange.com/questions/25591/is-the-clifford-group-a-semidirect-product?noredirect=1&lq=1
Note that this group has order $ 6!2^6=46,080 $ and is the lift through the double cover $ SU_4 \twoheadrightarrow SO_6 $ of $ W(D_6) $. Here $ W(D_6) $ is the subgroup of $ SO_6 $ of signed permutation matrices, the Weyl group of $ D_6 $, which has order $ 6!2^6/2 $. Finally,
$$
4\circ_2 2.S_6
$$
is maximal among the finite subgroups but is actually contained in the group $ N(Sp_2) $ described above. To see this observe that there is a faithful 4d irrep of $ 2.S_6 $ which is quaternionic (Schur indicator -1) so $ 2.S_6 $ is a subgroup of $ Sp_2 $. Thus by adding in $ iI $ we have that $ 4\circ_2 2.S_6 $ is a subgroup of $ N(Sp_2) $.
For references on designs and maximality see Finite maximal closed subgroups of Lie groups
So the maximal closed subgroups with trivial identity component are the $ 3 $ finite groups: $ 4\circ_22.A_7,
4\circ_2 Sp(4,3), N(2^{2(2)+1})
$.
This is consistent with the fact
that a maximal $ 2 $-design group is maximal closed ( all $ 3 $ designs are $ 2 $ designs).
Note: $ 2.A_7 $ denotes PerfectGroup(5040,1), the unique perfect group of that order.
Note:
\begin{align*}
& 4\circ_2 2.A_7
 \\
& 4\circ_2 Sp(4,3)
 \\
& N(2^{2(2)+1})\\
\end{align*}
are all 2-designs (at least). The other two designs are 3 other subgroups of $ N(2^{2(2)+1}) $. These six groups are all Lie primitive (not contained in any proper positive dimensional closed subgroup). There is in addition one more Lie primitive group: it corresponds to the $ GL(3,2) $ subgroup of $ A_7 $.
Comment: In my comment that you linked to, I was specifically focusing on simple subgroups of $SU(4)$ containing $SO(4)$.  In particular, I think your list should also have a finite extension of $Sp(2)$, included via the identification of $\mathbb{H}^2$ with $\mathbb{C}^4$.  The extension at least contains $iI$, but I don't know if it has more than 2 components.
Comment: A minor thing to add to my previous comment:  I can now show the maximal proper extension of $Sp(2)$ does indeed just have two components.  Would you like me to write it up as an answer?  Also, $SU(3)$ doesn't have an irreducible rep of dim 4, but it does have a 4 dim rep: the standard rep + trivial.  The corresponding subgroup of $SU(4)$ is the block $SU(3)$, so is not maximal, being contained in $U(3)$.
Comment: Sorry to be confusing.  There is nothing wrong in what you wrote above, I was just clarifying.  I hadn't though about it previously, but it seems the following is true:  For $G\in \{SU(n), SO(n), Sp(n)\}$, a closed subgroup $H\subseteq G$ is not maximal if the corresponding $n$-dim representation is reducible.  In particular, in terms of classifying maximal subgroups, one only needs to consider irreducible reps.  You probably already knew this ;-).  I'll write the answer about $Sp(2)$ now.
Comment: @JasonDeVito this is exactly the sort of feedback I was looking for I'll incorporate all those corrections into my question
Comment: @JasonDeVito Yes, please! And ya you are right that $ SU(3) $ has a 4d rep but all reducible representations are non maximal since they are contained in $ S(U_3 \times U_1) $ or $ S(U_2 \times U_2 ) $ as you say ( in my question I use irrep as short hand for irreducible representation, I think the only thing I claim is that $ SU_3 $ has no 4d irreps?).
Comment: I did already know that! But usually its the other way around I'm reading your posts and things that are obvious to you are all new thoughts to me! Indeed you can go further and and say that a closed subgroup $ H $ of $ G \in \{ SU(n),SO(n),Sp(n) \} $ is not maximal unless the corresponding $ n $-dim representation is primitive or $ H $ is the normalizer of some block diagonal subgroup. So to amend what you said above (and my previous comment) there is exactly one example $ H=S(U_3 \times U_1) $ which is maximal even though the corresponding $ 4 $-d representation is reducible.
Comment: For a definition of primitive see for example https://math.stackexchange.com/questions/4468936/primitive-subgroup-of-su-n-contained-in-maximal-finite-subgroup it basically just means block diagonal plus permutations of the blocks ( for example this is exactly the kind of extra stuff that you get when you pass from a group of block diagonal matrices like $ S(U_2 \times U_2) $ to its normalizer).
Comment: Do not vandalize your question.
Answer: I claim that $N:=N_{SU(4)}(Sp(2))$ is a maximal subgroup of $Sp(2)$, and that $N = Sp(2) \cup iI Sp(2)$.
To see this, consider the double covering $\pi:SU(4)\rightarrow SU(4)/\{\pm I\}\cong SO(6)$.  Note that $-I\in Sp(2)\subseteq SU(4)$, so $\pi|_{Sp(2)}$ is the double covering $Sp(2)\rightarrow SO(5)$.  Up to conjugacy, there is an essentially unique $SO(5)\subseteq SO(6)$, the usual block form.
So, instead of studying $Sp(2)\subseteq SU(4)$, we'll study $SO(5)\subseteq SO(6)$ and pull the information back via $\pi$.
Proposition:  The only proper subgroup of $SO(6)$ which properly contains $SO(5)$ is $O(5) = \{ \operatorname{diag}(A,\det(A)):A\in O(5)\}$.
Proof:  The isotropy action of $SO(5)$ on $S^5 = SO(6)/SO(5)$ is transitive on the unit sphere in $T_{I SO(5)} S^5$, so is, in particular, irreducible.  This, then, implies that $SO(5)$ is maximal among connected groups:  if $SO(5)\subseteq K\subseteq SO(6)$, then on the Lie algebra level, the adjoint action of $\mathfrak{so}(5)$ would preserve both $\mathfrak{k}$ and $\mathfrak{k}^\bot$, contradicting irreducibility.  (Here, I'm using the fact that we can naturally identify the isotropy action of $H$ on $T_{I SO(5)} SO(6)/SO(5)$ with $\mathfrak{so}(5)^\bot\subseteq \mathfrak{so}(6)$.)
Since we now know that $SO(5)$ is maximal among connected subgroups of $SO(6)$, and the identity component of a Lie group is always a normal subgroup, it now follows that $N_{SO(6)}(SO(5))$ is a maximal subgroup of $SO(6)$.
Of course, $O(5)\subseteq N_{SO(6)}(SO(5))$, but why is the reverse inclusion true?  Well, every matrix $B\in SO(5)$ fixes the basis vector $e_6$ of $\mathbb{R}^6$, and $\operatorname{span}\{e_6\}$ is the unique subspace of $\mathbb{R}^6$ fixed by all of $SO(5)$.  A simple computation reveals that for any $C\in N_{SO(6)}(SO(5))$, that $CSO(5)C^{-1} = SO(5)$ fixes $Ce_6$.  It follows that $Ce_6 \in \operatorname{span}\{e_6\}$.  Moreover, since $C\in SO(6)$, we must in fact that $Ce_6 = \pm e_6$.  In either case, the fact that $CC^t = I$ now implies that $C\in O(5)$.  $\square$
Now, let's pull that information back to to better understand $N = N_{SU(4)}(Sp(2))$.  It's not too hard to see that $\pi|_N:N\rightarrow N_{SO(6)}(SO(5)$ is a double covering, with $\pi$ mapping $Sp(2)$ and $iI Sp(2)$ to the two different components of $N_{SO(6)}(SO(5))$.
Now, let $g\in N$ be arbitrary.  Since $\pi|_{Sp(2)\cup iI Sp(2)}$ is surjective onto $N_{SO(6)}(SO(5))$, there is an $h\in Sp(2)\cup iI Sp(2)$ with $\pi(g) = \pi(h)$.  Then $gh^{-1}\in \ker \pi = \pm I$, so $g = \pm I h$.  Since both $h, \pm I\in Sp(2)\cup iI Sp(2)$, it follows that $g\in Sp(2)\cup iI Sp(2)$ as well.
Comment: very cool argument using the "accidental" isomorphisms $ SU(4) \cong Spin(6) $ and $ Sp(2) \cong Spin(5) $, love it!
Comment: Ok I finally posted a full classification that I'm pretty confident in. One last sanity check I wanted to make, $SO_4$ is a subgroup of $ Sp_2 $ right?
Comment: @IanGershonTeixeira:  No, I don't think $SO(4)$ is a subgroup of $Sp(2)$.   The complex $4$-dim representation of $SU(2)\times SU(2)$ given by $SU(2)\rightarrow SU(2)\rightarrow SO(4)\subseteq SU(4)$ is irreducible, so it is precisely one of real, quaternionic, or complex.  As it's obviously real, it cannot be quaternionic.
Answer: The full list of maximal subgroups is:
Type I (normalizer of maximal connected subgroup)
\begin{align*}
& U(3) \cong S(U(3) \times U(1)) \\
& S(U(2) \times U(2)):2 \\
& 4 \circ_2 Sp(2)
\end{align*}
Type II (finite maximal closed subgroup)
\begin{align*}
&4\circ_2 2.A_7
 \\
&4\circ_2 Sp(4,3)
 \\
&N(2^{2(2)+1})
\end{align*}
Type III (normalizer of a subgroup which is connected but not maximal connected)
\begin{align*}
& N(T^3)=S(U(1) \times U(1) \times U(1) \times U(1)) : S_4\\
& SO(4)\cdot 4  \\
\end{align*}
Note that $ S(U(1) \times U(1) \times U(1) \times U(1)) $ is contained in $ S(U(3) \times U(1)) $ above. And $ SO(4) $ is contained in $ Sp(2) $. However $ SO(4) \cdot 4 $ is not contained in $ 4 \circ_2 Sp(2) $.
Note on notation. $ : $ means split extension (semidirect product). $ \cdot $ means nonsplit extension. $ \circ $ denotes central product, in all cases here we have $ 4 \circ_2 H $ is just the group generated by $ H $ and $ iI $ but that group is not a direct product since already $ -I \in H $, we get a central product essentially with two $ H $ components.
Here all the $ N $ denote normalizer. Recall that a positive dimensional (type I and type III above) maximal subgroup of a simple Lie group equals the full normalizer of its identity component.
https://arxiv.org/pdf/math/0605784.pdf
classifies all maximal closed subgroups of $ SU(n) $ whose identity component is not simple (here trivial counts as simple). According to table 5 the maximal closed subgroups of $ SU(4) $ of this type are:
The normalizer of the maximal torus (row 4 table 5, $ \ell=4, p=1 $)
$$
 N(T)=S(U(1) \times U(1) \times U(1) \times U(1)) : S_4
$$
As well as (row 1 table 5, $ p=3,q=1 $ )
$$
S(U(3) \times U(1) )\cong U(3)
$$
and the normalizer of $ S(U(2) \times U(2))= \{\begin{bmatrix} A & 0 \\ 0 & B \end{bmatrix}:A,B\in U(2),det(A)det(B)=1 \} $ which is a split extension (row 1 table 5 $ p=q=2 $)
$$
< S(U(2) \times U(2)),SWAP_{\oplus}> \cong S(U(2) \times U(2)):2
$$
where the normalizing matrix $ SWAP_{\oplus}=\begin{bmatrix} 0 & 0 & 0 & 1\\ 0 & 0 & 1 & 0 \\ 0 & 1 & 0 &  0 \\ 1 & 0 & 0 &  0 \end{bmatrix} $ swaps the two blocks in the direct sum. This is the lift of $ S(O(4) \times O(2) ) $ through the double cover $ SU(4) \to SO(6) $.
Next there is (row 3 table 5, $ p=2 $)
$$
<SU(2) \otimes SU(2), \zeta_8 SWAP_\otimes>
$$
where the matrix $ SWAP_\otimes=\begin{bmatrix} 1 & 0 & 0 & 0\\ 0 & 0 & 1 & 0 \\ 0 & 1 & 0 &  0 \\ 0 & 0 & 0 & 1 \end{bmatrix} $ swaps the two tensor factors. Here the identity component $ SU(2) \otimes SU(2) $ contains $ -I=(\zeta_8 SWAP_\otimes)^4 $, but does not contain $ iI=(\zeta_8 SWAP_\otimes)^2 $, so the full normalizer is the nonsplit extension $ SU(2) \otimes SU(2) \cdot 4 $. This subgroup is conjugate to the normalizer of the standard $ SO(4) $ subgroup
$$
 SO(4) \cdot 4
$$
and we prefer to write it that way. This is the lift of $ S(O(3) \times O(3))\cdot 2 $ through the double cover $ SU(4) \to SO(6) $. For more details see
Is $ SU_2 \otimes SU_2 $ conjugate to $ SO_4(\mathbb{R}) $ in $ SU_4 $?
Next, we consider maximal closed subgroups with nontrivial simple connected component. [Credit to Jason for pretty much all the group with simple identity component stuff]
By dimension, such a subgroup would be isogeneous to $ SU(2),SU(3),Sp(2) $ or $ G_2 $.
There is no 4d irreps of $ SU(3) $ since the dimension of $ SU(3) $ irreps are given by the formula
$$
\frac{(m_1+1)(m_2+1)(m_1+m_2+2)}{2}
$$
Similarly there are no 4d irreps of $ G_2 $ since the dimensions are given
https://en.wikipedia.org/wiki/G2_(mathematics)
The symplectic subgroup
$ O(5)= 2 \times SO(5) $ is a maximal subgroup of $ SO(6) $. Lifting through the double cover $ SU(4) \to SO(6) $ we have that
$$
4 \circ_2 Sp(2)=<iI,Sp(2)>
$$
is maximal subgroup of $ SU(4) $.
Every irreducible $ SU(2) $ subgroups of $ SU(4) $ is contained in a conjugate of $ Sp(2) $. See
Understanding the 4 dimensional irrep of $ SU_2 $
Indeed the containment $ SU(2)_{irr} \subset Sp(2) \subset SU(4) $ is the lift of $ SO(3)_{irr} \subset SO(5) \subset SO(6) $ through the double cover $ SU(4) \to SO(6) $. Here $ SU(2)_{irr} $ is the image of the 4d irrep of $ SU(2) $ and $ SO(3)_{irr} $ is the image of the 5d irrep of $ SO(3) $. Similarly we have that $ N(SU(2)_{irr})=4 \circ_2 SU(2)_{irr} \subset N(Sp(2))=4 \circ_2 Sp(2) \subset SU(4) $ is the lift through the double cover of $ N(SO(3)_{irr})=O(3)_{irr} \subset N(SO(5))=O(5)=S(O(5) \times O(1)) \subset SO(6) $. So in particular there is no maximal subgroup of $ SU(4) $ with simple connected component isogeneous to $ SU_2 $. All such groups are $ 4 \circ_2 SU(2)_{irr} \subset 4 \circ_2 Sp(2) $ and thus not maximal.
Finally we consider subgroups with trivial connected component. These are finite since $ SU(4) $ is compact. To be maximal they must at least be primitive. Primitive finite subgroups of $ SU(4) $ are classified by work of Blichfeldt 1911 which was rewritten in modern notation here https://arxiv.org/abs/hep-th/9905212 From this we conclude there are $ 4 $ finite groups maximal among the finite subgroups of $ SU(4) $.
The central product
$$
4 \circ_2 2.A_7
$$
of order $ 4(2,520)=10,080 $ (maximal closed since it is maximal finite and a 3-design)
the central product
$$
4 \circ_2 Sp(4,3)
$$
of order $ 4(25,920)=103,680 $ (maximal closed since it is maximal finite and a 3-design).
$$
N(2^{2(2)+1})
$$
is the normalizer of an extraspecial 2 group of order $ 32 $. This group has order $ 4(11,520)=46,080 $ (maximal closed since it is maximal finite and a 3-design). This group is know as the 2 qubit Clifford group in quantum computing. For details see
https://quantumcomputing.stackexchange.com/questions/25591/is-the-clifford-group-a-semidirect-product?noredirect=1&lq=1
Note that this group has order $ 6!2^6=46,080 $ and is the lift through the double cover $ SU(4) \twoheadrightarrow SO_6 $ of $ W(D_6) $. Here $ W(D_6) $ is the subgroup of $ SO_6 $ of signed permutation matrices, the Weyl group of $ D_6 $, which has order $ 6!2^6/2 $. Finally,
$$
4\circ_2 2.S_6
$$
is maximal among the finite subgroups but is actually contained in the group $ N(Sp(2)) $ described above. To see this observe that there is a faithful 4d irrep of $ 2.S_6 $ which is quaternionic (Schur indicator -1) so $ 2.S_6 $ is a subgroup of $ Sp(2) $. Thus by adding in $ iI $ we have that $ 4\circ_2 2.S_6 $ is a subgroup of $ N(Sp(2)) $.
For references on designs and maximality see Finite maximal closed subgroups of Lie groups
So the maximal closed subgroups with trivial identity component are the $ 3 $ finite groups: $ 4\circ_22.A_7,
4\circ_2 Sp(4,3), N(2^{2(2)+1})
$.
This is consistent with the fact
that a maximal $ 2 $-design group is maximal closed ( all $ 3 $ designs are $ 2 $ designs).
Note: $ 2.A_7 $ denotes PerfectGroup(5040,1), the unique perfect group of that order.
Note:
\begin{align*}
& 4\circ_2 2.A_7
 \\
& 4\circ_2 Sp(4,3)
 \\
& N(2^{2(2)+1})\\
\end{align*}
are all 2-designs (at least). The other 2- designs are three other subgroups of $ N(2^{2(2)+1}) $. These six groups are all Lie primitive (not contained in any proper positive dimensional closed subgroup). There is in addition one more Lie primitive group: it corresponds to the $ SL(3,2)\cong PSL(2,7) $ subgroup of $ A_7 $/ the $ SL(2,7) $ subgroup of $ 2.A_7 $.
Comment: Literally brilliant.

Maximal Closed Subgroups of $ SU_4 $


Is it legal to do a barrel roll?

Question: Is it legal to barrel roll a plane?
Are you allowed with any pilot license?
Are there any requirements for the plane to be allowed to barrel roll?
Comment: Yeah I was just finding and posting that too
Comment: @Dave that answers the question thanks,  I would vote to close but I don't have enough priviledges
Answer: This answer is for the US. A parachute is required of everyone when the aircraft is carrying someone who is not a crew member.  The maneuver must not be prohibited by the aircraft flight manual. (Or must it be specifically permitted?)   (Future edit needed.)  And of course you must not exceed the permitted airspeed and G-load parameters.
There is no relation to the license (certificate) the pilot holds.
Actually, this related answer indicates that the airplane or glider must be in the "acrobatic" category: What are the US definition and restrictions on aerobatic flight?. But it's not clear what specific FAR is involved, if any.
Answer: Well, classic lawyer response here: It depends.
Barrel roll is an aerobatic maneuver which, at a minimum, requires the PIC comply with the legal limitations on aerobatic flight per 91.303 and 91.307.
Like any other risk management procedure on a proposed maneuver or mission, ask yourself: is it safe?  Is it legal?  Is it reasonable?
You are PIC - Directly responsible for and the final authority on the operation of that airplane.
SAFE:
What are the known risks associated with this maneuver and how can we minimize those risks?
What other mitigating factors eg MAC, CFIT, etc. can come into play here and how can we minimize them?  Do we have backup and emergency contingency plans available plus time and altitude in case something goes wrong?
Are we flying an airplane which is approved for these kinds of maneuvers?  Is the aircraft in good working order?  What about IMSAFE to assume PIC role in aerobatic flight?  What is your flight currency in both this make and model of airplane and the aerobatic maneuver?
Do we have an appropriate preflight and weather briefing for the proposed flight?  Do the conditions permit safe execution of the mission during the time window of operations?
LEGAL:
Do any of the proposed maneuvers or missions violate FARs, or other local, state, or federal laws?
REASONABLE:
Is the execution of the mission at the proposed place, time and with the planned personnel and equipment reasonable or prudent?  Is there any aspect here that while conforming within safe and legal limitations of airmanship would make this unnecessarily risky?
If any of these are in doubt, don't fly.  You can be held legally liable under 91.13 Careless and Reckless Operation otherwise.
A barrel roll is a safe, 1G maneuver WHEN PROPERLY EXECUTED and has been performed many times in all types of airplanes.  The ability to do so depends on the aircraft type, pilot's skill, and time and place.
Many airshow and test pilots have barrel rolled all types of aircraft - the late Bob Hoover and Tex Johnson quickly come to mind.  Keep in mind though, those guys were crazy skilled aviators with thousands of flight hours plus plenty of close calls where they quite frankly scared the s@*t out of themselves and escaped death by a hair's breadth.  Plenty of other people weren't so lucky and dug a smoking crater.
Comment: I read section entitled "Legal" is basically it's not illegal if it's not against the laws, without actually saying what the laws are, which is what I believe the OP was after.
Comment: True.  However it can come under scrutiny with the 91.13 Careless and Reckless Operation clause as well.  There are a lot of gray areas within the FARs where you can be held criminally liable, even if the act in and of itself is legal.

Is it legal to do a barrel roll?


Can analogue Hall sensors be used in BLDC for static angle measurement?

Question: Everything I have read on using Hall sensors with BLDC motors appears to use latching hall sensors which provide repeatable latching angles as the magnetic fields change at specific angles. I am wondering if an analogue hall sensor can be used to provide intermediate angles for static angle measurements are ever used? And if not then why?
Comment: Yes. There are ICs dedicated to this. Latching/digital hall sensors are used to commutate BLDCs trapezoidal because nothing more is needed for that task. A sinusoidally commutated BLDC on the other hand would need specific angular data.
Answer: It appears I have answered my own question in the affirmative by finding the paper:
Position Estimation and Control of Compact BLDC Motors Based on
Analog Linear Hall Effect Sensors which all though specific to pancake styled motors I'm sure is adaptable to traditional radial flux motors.
Also found information on analogue hall sensors being used in commercial motors in FAULHABER application note 162 Analog Hall Sensors
Comment: FYI from personal experiments dropping linear halls with suitable sensitivity ranges directly in the slots provided for latching halls in some motors gives a trapezoidal signal. While the flat spots in the signal mean you don't get full angular coverage, the slopes in the signal do give enough advance warning of pole changes to be able to do something about torque ripple down to speeds approaching zero.


How to control programs run at startup?

Question: I have wicd, hplib and psensor installed. But they all always a run at startup in KDE environment. How can I stop them running at startup?
Comment: Did you check `systemsettings -> startup & shutdown -> autostart ` ? What version of Ubuntu do you use?
Comment: There's no link for these apps in autostart.
Comment: There is an autostart module in Kubuntu (KDE), I believe the startup applications and programs should be added/removed from startup via the "advanced" tab in that module.  The system settings in Kubuntu should be called KDE control center.
Answer: KDE provides a wonderful tool in systemsettings ("Startup and Shutdown" -> "Autostart") for managing your personal autostart services (in either of the .kde directories) however it doesn't cover systemwide autostart scripts provided by your distribution packages, or created by the gnome apps.
Sometimes however it can be useful to override your distribution autostart preferences, for example I don't like having the printer-applet running as I don't own a printer, but it seems a shame to uninstall it in case I need it.
The correct way to disable a package installed is actually to copy it to your personal autostart folder. Anything of the same name in ~/.kde/share/autostart and/or /usr/share/autostart/ (also can be ~/.kde4/Autostart) overrides the .desktop file in the default installations. Once we have copied the .desktop file we can make changes.
Add the following line to the .desktop file you have just copied:
Hidden=true

KDE also restores your session when you log in, so if psensor is running when you log out, it will be started up again when you log in. To change that, just close psensor (i.e. actually quit the program, don't just close the window). If psensor is not running when you log out, it should not start up again when you log back in.
Comment: Since KDE 5.x, this stuff lives in `~/.config/autostart/`. You can also put your own scripts in `~/.config/autostart-scripts/`. See also: https://docs.kde.org/trunk5/en/kde-workspace/kcontrol/autostart/
Comment: Ok, but I am using Kubuntu 15.04 and I cannot get rid of skype autostart at boot since there is not skype app to disable in in Autostart options.  How do I remove skype startup from terminal?
Comment: @MarkoFrelih Did you check in `Skype->Options->General` that `Start Skype Minimised in system tray` is unticked?
Comment: in there is no such option under Linux (at least I cannot find it), since the last version available from Skype's website is 4.3, which is veryy old.
Comment: Can't find .desktop file...  @KernelPanic did you find out how to stop Skype from running at startup?
Comment: @Mr.WorshipMe nope sorry.
Comment: I found I had to put the entry into `~/.config/autostart`. Putting it into `~/.kde/Autostart` or `~/.kde/share/autostart` had no effect.
Answer: I found this useful, taken from David Edmundson's blog:
~/.kde/Autostart
~/.kde/share/autostart
~/.config/autostart
~/.local/share/autostart
/etc/xdg/autostart
/usr/share/autostart

I don't really know why we have so many... Anything inside the /usr/ or /etc folder will have been installed by your distribution.
Answer: On /etc/xdg/autostart
add .bak to .desktop on filename that you want to stop.
Comment: Did you note this question if over 8 years old. A lot has changed in 8 years. You may want to avoid giving a one line answer with no references to such an old question.

How to control programs run at startup?


How could a new society be violence free?

Question: If society would restart, how could it avoid violence both on the individual and community level?
Comment: Welcome to WorldBuilding! If you have a moment please take the [tour] and visit the [help] to learn more about the site. Your question is quite opinion-based. People have tried to establish a violence free society forever. Many believe that it's not possible for humans to be completely peaceful and creating a whole new society from scratch is too much for the format of StackExchange. Also does this include violence towards animals? Please try to [edit] your question to something that can be answered by focusing on certain aspects of society.
Comment: Restart from where? And what exactly would make the rebooted society want to avoid violence? Even at the dawn of the enlightened 21st century the idea that _all_ violence is a Bad Thing is only held by a small minority of humans, who live particularly sheltered lives. The ability to even contemplate such an idea requires a highly sophisticated world view; therefore it all depends on the point from which you want to reload society. And please please, "community" is a tricky word; it may mean an extended family, a clan, a tribe, a nation, an empire and so on, or it may be utterly meaningless.
Answer: I'm not certain violence can be avoided, not with humans. We have evolved emotions of anger, jealousy, greed and a desire for prestige. We are naturally competitive.
These emotions and compulsions are evolutionarily selected and preserved because they are useful in attracting mates and ultimately producing offspring: Any of our ancestors with genes that caused them to never get angry (say a malformation of their amygdalae) were not successful enough at procreation to pass those genes down.
Whether we like it on an intellectual level of considering fairness and equity, or not, taking things by violence works. Murdering your rivals works (just ask Putin). Threatening them with violence works. For hundreds of thousands of years, violent rape often resulted in procreation. (Modern medicine allows preemptive birth control, and abortion if rape results in pregnancy, but that is a recent development).
No matter how you organize society, there will always be love triangles, jealousies over mates, money, jobs, possessions and house locations. Even if everybody had exactly the same homes and possessions by law: Alex still wants Betty for a mate and Betty wants to mate with Chuck and Chuck is happy to mate with Betty, but really wishes he had Diane, but Diane is very happy with her musician boyfriend Earl.
Further, the more you control some parts of this equation, the less happy people will be, and that magnifies the consequences of even trivial difference. If you impose so much control that people hate the monotony and drudgery of their lives, they are much closer to saying "Fuck it, I am not going to be insulted anymore!"
This is why you see people literally murder somebody over a game of billiards or over an insult in a dive bar: The murderer has a low paying subordinate job he hates, he lives in a crap apartment, and all he really owns is equality among a few friends in run down bar: When some asshole disrespects him and makes him look weak, they threaten to take away everything he has. So he goes to his 30 year old truck outside, gets the pistol from under the seat, comes back in and puts six bullets into that asshole. Because in his rage, the future if he does not is intolerable (and in his rage, his frontal cortex is sidelined so he is not thinking of any other consequences).
I do not think you can eliminate individual violence without fundamentally changing the human mind. Jealousy and anger are natural phenomenon; so is resorting to force. Little kids do it, pushing each other out of the way and hitting. In extremes, like under the threat of losing everything, at least some people will be emotionally overwhelmed enough that the frontal cortex will be sidelined and they will engage in violence no matter what the consequences may be --- because they are incapable, in that moment, of considering consequences.
Comment: It is telling that we know of no human society ever that was violence free.
Answer: Give them as much resources as they need and make the individuals appearances as similiar to each other as possible.
Most conflicts erupt, because someone is in dire need of something he can't afford or because they fear what the 'others' could do to them. It's a real shame, but many people, even nowadays, fear people from other countries, just because they look different. "They look different, so they act different. Different means worse and thus dangerous, right?"
Answer: People (whatever their species) need resources in order to live, not to mention do all the other things they want to do. Those resources are finite, and not evenly distributed, and some will already be in use by other people.
One way for people to get resources is to take them from others, but others will fight to keep the resources they already control. (there's your violence)
People might be willing to part with the resources they control in exchange for something, so trade might be a cure to violence. Unless people are in a state of perfect competition, however, trade won't always get people what they need. Inefficiencies will exist in the market, either because people don't know where to find what they want, don't known what they want, refuse to trade for it, anger some third party, and so on (read the wikipedia article for a full list).
If you really want to write about a society with as little violence as possible, a good place to start would be the list in that link. A system that dealt with all of of those problems would take you a good bit of the way toward a society in which people have no reason to hurt each other.


Favicon is no showing in IE on my Angular application hosted on IIS

Question: I have a problem with my favicon not showing in Internet Explorer on my website. It's an Angular 7 application hosted on IIS. I have a dev site and a stage site and the favicon shows up fine at the dev site but not stage site.
Things I have tried/taking consideration of:

Change the favicon to .png instead of .ico
Add a link to the favicon between Head tags(not necessary in Angular)
Favicon is included in assets in angular.json
Same webconfig files for both sites
Same code for both sites
Clear IE cache
I can access the icon at /favicon.ico

What bothers me is that it works on the dev site which makes me believe it's something on the IIS.
Anyone have some suggestion?
Thanks
Comment: Have you ever tried to use F12 developer tools to check the html elements, whether the image load success? Based on your description, I try to create a new project, it seems that everything works well.
Answer: You could force a favicon refresh using the method below to rule out favicon caching by adding the v=2 parameter
<code><link rel="icon" href="http://www.yoursite.com/favicon.ico?v=2" />
</code>


Create a template from Data View web part

Question: I have displayed some SQL data in MOSS 2007 with the help of Data View web part. However I wish to create a template sort of from this web part so that going forward I can just go ahead and change the connection string of sql server and the sql query to fetch data and I am done. Any ideas for doing this. If not possible, is there any out-of-box web part to get this functionality? Thanks in advance.
Answer:
Configure the webpart
Export it to a .webpart file:

Navigate to Site settings, and select "Webparts gallery" under Galleries category
Upload previously saved file to the gallery:

Specify it's name and other settings, if needed
Navigate to a site page, switch to page edit mode, and there you will be able to add your webpart (by default, it will be under Miscellaneous category)
Comment: Did the same steps. But where can I configure the SQL connection and SQL query?
Comment: In SPD, by connecting appropriate DataSource to the webpart. If you want to do this from GUI by setting connection string and query through webpart properties, you will have to implement your own webpart, probably derived from DVWP, with additional property and it will have to create it's DataSource automatically. But I'm afraid that will cost much more labour hours, and actually I can't realize, why you would prefer this hard way, while SPD already has almost what you need (just create the datasource through SPD GUI and you're done)


Which ORM framework can best handle an MVCC database design?

Question: When designing a database to use MVCC (Multi-Version Concurrency Control), you create tables with either a boolean field like "IsLatest" or an integer "VersionId", and you never do any updates, you only insert new records when things change.
MVCC gives you automatic auditing for applications that require a detailed history, and it also relieves pressure on the database with regards to update locks.  The cons are that it makes your data size much bigger and slows down selects, due to the extra clause necessary to get the latest version.  It also makes foreign keys more complicated.
(Note that I'm not talking about the native MVCC support in RDBMSs like SQL Server's snapshot isolation level)
This has been discussed in other posts here on Stack Overflow. [todo - links]
I am wondering, which of the prevalent entity/ORM frameworks (Linq to Sql, ADO.NET EF, Hibernate, etc) can cleanly support this type of design?  This is a major change to the typical ActiveRecord design pattern, so I'm not sure if the majority of tools that are out there could help someone who decides to go this route with their data model.  I'm particularly interested in how foreign keys would be handled, because I'm not even sure of the best way to data model them to support MVCC.
Answer: I might consider implementing the MVCC tier purely in the DB, using stored procs and views to handle my data operations. Then you could present a reasonable API to any ORM that was capable of mapping to and from stored procs, and you could let the DB deal with the data integrity issues (since it's pretty much build for that). If you went this way, you might want to look at a more pure Mapping solution like IBatis or IBatis.net.
Answer: I designed a database similarly (only INSERTs — no UPDATEs, no DELETEs).
Almost all of my SELECT queries were against views of only the current rows for each table (highest revision number).
The views looked like this…
SELECT
    dbo.tblBook.BookId,
    dbo.tblBook.RevisionId,
    dbo.tblBook.Title,
    dbo.tblBook.AuthorId,
    dbo.tblBook.Price,
    dbo.tblBook.Deleted
FROM
    dbo.tblBook INNER JOIN
    (
        SELECT
            BookId,
            MAX(RevisionId) AS RevisionId
        FROM
            dbo.tblBook
        GROUP BY
            BookId
    ) AS CurrentBookRevision ON
    dbo.tblBook.BookId = CurrentBookRevision.BookId AND
    dbo.tblBook.RevisionId = CurrentBookRevision.RevisionId
WHERE
    dbo.tblBook.Deleted = 0

And my inserts (and updates and deletes) were all handled by stored procedures (one per table).
The stored procedures looked like this…
ALTER procedure [dbo].[sp_Book_CreateUpdateDelete]
    @BookId      uniqueidentifier,
    @RevisionId  bigint,
    @Title       varchar(256),
    @AuthorId    uniqueidentifier,
    @Price       smallmoney,
    @Deleted     bit
as
    insert into tblBook
        (
            BookId,
            RevisionId,
            Title,
            AuthorId,
            Price,
            Deleted
        )
    values
        (
            @BookId,
            @RevisionId,
            @Title,
            @AuthorId,
            @Price,
            @Deleted
        )

Revision numbers were handled per-transaction in the Visual Basic code…
Shared Sub Save(ByVal UserId As Guid, ByVal Explanation As String, ByVal Commands As Collections.Generic.Queue(Of SqlCommand))
    Dim Connection As SqlConnection = New SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings("Connection").ConnectionString)
    Connection.Open()
    Dim Transaction As SqlTransaction = Connection.BeginTransaction
    Try
        Dim RevisionId As Integer = Nothing
        Dim RevisionCommand As SqlCommand = New SqlCommand("sp_Revision_Create", Connection)
        RevisionCommand.CommandType = CommandType.StoredProcedure
        RevisionCommand.Parameters.AddWithValue("@RevisionId", 0)
        RevisionCommand.Parameters(0).SqlDbType = SqlDbType.BigInt
        RevisionCommand.Parameters(0).Direction = ParameterDirection.Output
        RevisionCommand.Parameters.AddWithValue("@UserId", UserId)
        RevisionCommand.Parameters.AddWithValue("@Explanation", Explanation)
        RevisionCommand.Transaction = Transaction
        LogDatabaseActivity(RevisionCommand)
        If RevisionCommand.ExecuteNonQuery() = 1 Then 'rows inserted
            RevisionId = CInt(RevisionCommand.Parameters(0).Value) 'generated key
        Else
            Throw New Exception("Zero rows affected.")
        End If
        For Each Command As SqlCommand In Commands
            Command.Connection = Connection
            Command.Transaction = Transaction
            Command.CommandType = CommandType.StoredProcedure
            Command.Parameters.AddWithValue("@RevisionId", RevisionId)
            LogDatabaseActivity(Command)
            If Command.ExecuteNonQuery() < 1 Then 'rows inserted
                Throw New Exception("Zero rows affected.")
            End If
        Next
        Transaction.Commit()
    Catch ex As Exception
        Transaction.Rollback()
        Throw New Exception("Rolled back transaction", ex)
    Finally
        Connection.Close()
    End Try
End Sub

I created an object for each table, each with constructors, instance properties and methods, create-update-delete commands, a bunch of finder functions, and IComparable sorting functions.  It was a huge amount of code.
One-to-one DB table to VB object...
Public Class Book
    Implements iComparable

#Region " Constructors "

    Private _BookId As Guid
    Private _RevisionId As Integer
    Private _Title As String
    Private _AuthorId As Guid
    Private _Price As Decimal
    Private _Deleted As Boolean

    ...

    Sub New(ByVal BookRow As DataRow)
        Try
            _BookId = New Guid(BookRow("BookId").ToString)
            _RevisionId = CInt(BookRow("RevisionId"))
            _Title = CStr(BookRow("Title"))
            _AuthorId = New Guid(BookRow("AuthorId").ToString)
            _Price = CDec(BookRow("Price"))
        Catch ex As Exception
            'TO DO: log exception
            Throw New Exception("DataRow does not contain valid Book data.", ex)
        End Try
    End Sub

#End Region

...

#Region " Create, Update & Delete "

    Function Save() As SqlCommand
        If _BookId = Guid.Empty Then
            _BookId = Guid.NewGuid()
        End If
        Dim Command As SqlCommand = New SqlCommand("sp_Book_CreateUpdateDelete")
        Command.Parameters.AddWithValue("@BookId", _BookId)
        Command.Parameters.AddWithValue("@Title", _Title)
        Command.Parameters.AddWithValue("@AuthorId", _AuthorId)
        Command.Parameters.AddWithValue("@Price", _Price)
        Command.Parameters.AddWithValue("@Deleted", _Deleted)
        Return Command
    End Function

    Shared Function Delete(ByVal BookId As Guid) As SqlCommand
        Dim Doomed As Book = FindByBookId(BookId)
        Doomed.Deleted = True
        Return Doomed.Save()
    End Function

    ...

#End Region

...

#Region " Finders "

    Shared Function FindByBookId(ByVal BookId As Guid, Optional ByVal TryDeleted As Boolean = False) As Book
        Dim Command As SqlCommand
        If TryDeleted Then
            Command = New SqlCommand("sp_Book_FindByBookIdTryDeleted")
        Else
            Command = New SqlCommand("sp_Book_FindByBookId")
        End If
        Command.Parameters.AddWithValue("@BookId", BookId)
        If Database.Find(Command).Rows.Count > 0 Then
            Return New Book(Database.Find(Command).Rows(0))
        Else
            Return Nothing
        End If
    End Function

Such a system preserves all past versions of each row, but can be a real pain to manage.
PROS:

Total history preserved
Fewer stored procedures

CONS:

relies on non-database application for data integrity
huge amount of code to be written
No foreign keys managed within database (goodbye automatic Linq-to-SQL-style object generation)
I still haven't come up with a good user interface to retrieve all that preserved past versioning.

CONCLUSION:

I wouldn't go to such trouble on a new project without some easy-to-use out-of-the-box ORM solution.

I'm curious if the Microsoft Entity Framework can handle such database designs well.
Jeff and the rest of that Stack Overflow team must have had to deal with similar issues while developing Stack Overflow:  Past revisions of edited questions and answers are saved and retrievable.
I believe Jeff has stated that his team used Linq to SQL and MS SQL Server.
I wonder how they handled these issues.
Answer: To the best of my knowledge, ORM frameworks are going to want to generate the CRUD code for you, so they would have to be explicitly designed to implement a MVCC option; I don't know of any that do so out of the box.
From an Entity framework standpoint, CSLA doesn't implement persistence for you at all -- it just defines a "Data Adapter" interface that you use to implement whatever persistence you need.  So you could set up code generation (CodeSmith, etc.) templates to auto-generate CRUD logic for your CSLA entities that go along with a MVCC database architecture.
This approach would work with any entity framework, most likely, not just CSLA, but it would be a very "clean" implementation in CSLA.
Answer: Check out the Envers project - works nice with JPA/Hibernate applications and basically does that for you - keeps track of different versions of each Entity in another table and gives you SVN-like possibilities ("Gimme the version of Person being used 2008-11-05...")
http://www.jboss.org/envers/
/Jens
Comment: Currently envers is integrated with hibernate
Answer: I always figured you'd use a db trigger on update and delete to push those rows out into a TableName_Audit table.
That'd work with ORMs, give you your history and wouldn't decimate select performance on that table. Is that a good idea or am I missing something?
Answer: What we do, is just use a normal ORM ( hibernate ) and handle the MVCC with views + instead of triggers.
So, there is a v_emp view, which just looks like a normal table, you can insert and update into it fine, when you do this though, the triggers handle actually inserting the correct data into the base table.
Not.. I hate this method :) I'd go with a stored procedure API as suggested by Tim.