Can one use a gpg smartcard to implement FIDO2?

Question: From what I understand, the idea of FIDO2 is to use symmetric cryptography, with secret key on the token, and public key on the server. When requesting to connect, the server uses the public key to generate a challenge that can only be solved with the private key, i.e., if the user can solve the challenge, he has the token containing the private key, and is granted access.

is that an accurate description of the protocol?

Then, I am curious of:

why would not all tokens containing gpg smartcards and a microcontroller for interfacing be implementing FIDO2?

To take an example, why would there be a Nitrokey Pro with a smartcard and microcontroller that cannot perform FIDO2, vs. a Nitrokey FIDO2 for the sole purpose of doing FIDO2, and without smartcard? (see https://www.nitrokey.com/#comparison ) The Nitrokey Pro has both smartcard and microcontroller, so I guess it could emulate whatever FIDO2 protocol, and do the crypto on the smartcard? Am I missing something, or is it possible to do but just 'doable in theory but not implemented currently'?
Answer: afaik FIDO 2 and gpg require two different architectures, thus require two different MCUs. In that the keys are not similar in their padding, and not similarly stored on the key.
If you wish, you might take a look at the technical details of the Pro 2 here, and the FIDO 2 here. Both keys store different kinds of "files" of keys.
Is there a possibility to store an authentication key on the PRO 2 or HSM, maybe, but it was not made for that. You can this question on the Nitrokey support forum, and the people there would know much better.


In the python version of Google App Engine, how do I find the urls that are taking the longest time to return?

Question: I would like to create a list of the top 10 or so urls that are taking the longest real time to return from my python Google App Engine application. I am using appstats already, but that does not provide me with a listing of urls by the longest real time taken to return. Is there a query that I can run or a regular expression that I can type in the log filter in the online console for my app? I'm looking for something more elegant that downloading and parsing all of my logs.
Answer: There's nothing for that out-of-the-box. You have several options. An easy one is to stash a list of (url, max-time) pairs in memcache. A slightly harder one is to customize appstats.
The rub is that a handler can run long for several reasons that aren't under your direct control (e.g., a request that causes a new instance to be spun up is going to take longer), so knowing what the longest one is might be of little help if the longest was a fluke.
Answer: You can work on a good Yslow score. If you make your webpages so that they get a good score in Yslow then I think you have a good case. You can also take the usual measures for optimization i.e. memcache, instance variables, javascript, more efficient data structures and such. Specifically if you get a score such as 70 % in yslow then it's probably alright.
Answer: Go to the Google App Engine dashboard and click on Logs in the left panel. Then select the All Requests radio button and expand the options box. Then type in ( ms=)([0-9]{5,}|[5-9][0-9]{3}) in the regex box. This will return all logs where ms=5000+ milliseconds. You can then tune the regex expression to return then number of logs you are interested in.


Additive disturbance in block diagram representation

Question: Drawing the open loop block diagram between valve and pump is straightforward (please see illustration). But why should $v$ be an additional disturbance in this system (please see solution)?
$v$ is going out of the tank?
Comment: @Dovendyr Because the tank's transfer function input signal is the net flow, the tank will start to drain if the outflow is larger than the inflow, i.e. $v- x\gt 0$, whereas it will start filling up if $v-x \lt 0$.
Comment: Did you notice the minus sign on top of the adder?
Comment: Why is it not after G_t(s)?
Answer: The pump keeps the tubing pressurized, the desired input flow is tuned via the valve. However the net flow rate that feeds the tank is not this inflow, it is the difference between the inflow and outflow.
The outflow caused by the pump is modeled as a disturbance because, in the current example, the goal is to model the liquid's level inside the tank. The outflow maybe considered a byproduct of the pump's operation.
Although the above diagram describes the plant (the physical process of the hydraulic system), if the control of the plant was studied later a possible design goal could be to maintain a constant and controllable level of the liquid in the tank (this requires feedback control aka a closed loop) and/or reaching the steady state value(desirable level in the tank) fast.
In addition a pump's flow rate tends to decrease as the pressure inside the tubing increases.
Think about a garden's hose, which sinks water into a flower pot at some flow rate and the water drains out of the flower pot through the bottom. Then if the inflow is much larger than the outflow the soil's surface will be flooded not being able to properly absorb the incoming flow of water. On the other hand, if the outflow is close enough to the inflow then the soil will be able to absorb the incoming water flow, not resulting in the flower pot's water overflow.
The block $G_t(s)$ describes the tank's response therefore the inflow-outflow difference is its input. The system $G_v(s)$ is the valve's response to the user input.


Identifying an appropriate statistical treatment

Question:
A College Algebra teacher would like to find out whether the possession of a textbook enhances achievement score $X$. From an engineering freshmen class of 50 students, she took the scores in a 20 – item quiz of 5 randomly chosen students with textbook (1) and 5 without textbook (0). Compute the correlation between X and Y.
My question, is $Y$ nominal and $X$ interval scale in this data set?What correlation should I use? Spearman Rho ; Pearson R ; Chi-Square? Thanks.
Answer: Your $X$ consists of achievement scores, so they are probably ratio scale, as I imagine they are numeric scores with a clear definition  of $0$.  Your $Y$ is a binary indicator variable; this one is tricky because although you may be tempted to label is as nominal, $1$ indicates the presence of a textbook and, in contrast, $0$ indicates the absence of one.  In this situation, you should consider $Y$ to be ordinal.
For comparing quantitative data to a binary variable, I would start by trying a logit model:
$$ \log\left(\frac{\Pr(Y)}{1-\Pr(Y)}\right)=\beta_0+\beta_1X $$
You can then perform a t-test to test the hypothesis that $\beta_1 = 0$.  If it the hypothesis is rejected, then $\beta_1$ tells us something about the direction and strength of the relationship between $X$ and $Y$.


Amazon app store Multiple APK Support like Android market?

Question: Does Amazon app store support multiple APK uploading like Android market?
Answer: The Amazon Appstore does support multiple APKs for the one app. This is confirmed in the Amazon documentation. It is possible to upload multiple APKs for different platforms and capabilities including screen size and density, OpenGL compression format, architecture or API version.
Multiple APK support in the Amazon Appstore works the same as the multiple APK support in the Play Store, where the app android:versionCode must be unique for each uploaded APK.
You can use the gradle build script to automate the generation of unique versionCode for the multiple APKs. Here is an example that generates different APKs based on device architecture:
<code>   splits {
        abi {
            enable true
            reset()
            include 'x86', 'armeabi', 'armeabi-v7a'
            universalApk true
        }
    }

    project.ext.versionCodes = ['armeabi': 1, 'armeabi-v7a': 2, 'arm64-v8a': 3, 'mips': 5, 'mips64': 6, 'x86': 8, 'x86_64': 9]

    android.applicationVariants.all { variant ->
        variant.outputs.each { output ->
            output.versionCodeOverride =
                project.ext.versionCodes.get(output.getFilter(
                    com.android.build.OutputFile.ABI), 0) * 10000000 + android.defaultConfig.versionCode
        }
    }
</code>
Comment: I've attempted to submit an apk for API 14+ and another for API 21+. Amazon rejects the apk for 21+ as the devices are already targeted by a different APK. The documentation can say what it wants, but shipping two apks for the same device vector (All other Android devices is a single device).
Answer: You can visit developer.amazon.com. Create an account there and  your are free to upload android apps. They also give you an option to choose when do you want the app to be available for the users. Unlike android market, the app will not be live immediately. It will undergo a review process and only after approval it will become live. You cannot edit the apk details once it is sent for review.
Comment: Thanks for respone but the question is is possible to upload  in Amazonr different APKs for my application that are each targeted to different device configurations?
Comment: Yes but make sure they do not have the same package.
Comment: Guys, the question is another one. I've got my application and two apks of that: one for tablet and another one phones.In Android market I can publish this two apks as a single application(from the user's point of view), this feature is known as Multiple APK support. I wonder if there is such functionality in Amazone app store
Comment: If your app is universal then you do not need to have two separate APKs. If you have used things like fragments which support only tablet 3.0, then you have a point in creating different APK. If your using phone UI, then just put all your layouts in layout-xlarge.Just try uploading and see what response you get. With such little information, I cant guide you much...Try uploading first and see if it accepts or not. It will tell you what error your are getting
Comment: layout-xlarge is unspported on android 2.2. Thats why I have two applications....
Answer: This feature is unsupported by Amazon Market
http://www.amazonappstoredev.com/2011/02/when-to-create-multiple-binaries-for-your-app.html
Comment: 5yrs on as you'd expect this answer is out of date and wrong. Currently  the Amazon app store supports multiple .apks


Definition of Differential Privacy

Question: Can someone please explain the definition of differential privacy. Here is the one which I see and am unable to understand it:
 Its from this paper. I do not understand the use of $S$ here and also what does coin tosses of $\kappa$ mean here? Is it that the probability is over the choice of the randomized function $\kappa$ which is uniformly random from a set $K$ of functions? Also why does this intuitively make sense?
Answer: As noted already, you are correct in your interpretation of the coin tosses: this simply is terminology for the sampling of a random function from $\mathcal K$. The use of subsets is to cope with continuous functions where the probability of any individual value is 0.
Let's consider how we would want privacy preservation to work when our family of functions produces discrete outputs each with non-zero probability. We might hope that including omitting/adding one element to a data set has a small relative, probability of changing the output of the function (we cannot hope for 0 probability unless our family of functions is constant for all inputs and this captures very little information). Our first thought may therefore be to require that for all elements $x\in\mathrm{Range}(\mathcal K)$ we have
$$\mathrm{Pr}_{\mathcal K}[\mathcal K(D_1)=x]\le\exp(\epsilon)\mathrm{Pr}_{\mathcal K}[\mathcal K(D_2)=x].$$
In fact this statement is equivalent to the quoted definition in the discrete case. Clearly the statement in the survey implies our first thought definition because we may take $S=\{x\}$. On the other hand, given any subset of discrete outputs $S$ we have
$$\mathrm{Pr}_{\mathcal K}[\mathcal K(D_1)\in S]=\sum_{x\in S}\mathrm{Pr}_{\mathcal K}[\mathcal K(D_1)=x]$$
so if our first thought definition holds we have
$$\mathrm{Pr}_{\mathcal K}[\mathcal K(D_1)\in S]\le \sum_{x\in S}\exp(\epsilon)\mathrm{Pr}_{\mathcal K}[\mathcal K(D_2)=x]=\exp(\epsilon)\mathrm{Pr}_{\mathcal K}[\mathcal K(D_2)\in S].$$
Thus our first thought is actually equivalent to the definition used.
However when we move to functions with continuous ranges, we could easily find ourselves in the situation where our first thought is meaningless because both probabilities are zero for all $x$. This does not mean that information cannot be inferred e.g. if there is a large jump in the value output by $K$ when we omit/add the extra element. However, the definition given does not have this defect as $S$ can be a continuous interval (or even a union of several continuous intervals) and the probability of the output lying in these ranges will not be zero for all possible choices of ranges. Thus the definition used is equivalent to what we might first conceive in the discrete case, but also has the advantage of retaining meaning in the continuous case.
Comment: Thanks, for the answer. I think to be more educative this answer needs some more basics like a sample database, query, and the query result. In the end, we are talking a data and queries, so the connection is crucial to understanding.
Answer: I'll do my best to break it down. You have some randomized function (algorithm if you prefer) $\mathcal{K}$ that will take a dataset as input and output something about it (e.g., a noisy average of all values). Here, the noise injected by $\mathcal{K}$ into the output is determined by the random coin tosses (random bits sampled by $\mathcal{K}$), as you correctly intuit.
Comment: @DanielS if the function is trivial (i.e., $\mathcal{K}(x) = 0$ for all $x$) then the probability $\Pr[\mathcal{K}(D_b) = 0 \in S]  = 1$. Did I miss something?
Comment: It's becoming increasingly unclear to me the scenario that you're trying to describe. Are you trying to describe the case where the family of functions $\mathcal{K}$ is just the family of trivial functions? These are definitely differentially private. If not then there will be a probability that the function is non-trivial.
Comment: I edited the answer and deleted the example, thanks for pointing out that it was confusing.
Comment: @DanielS could you write a proper answer?

Definition of Differential Privacy


How can make objects invisible in only certain areas?

Question:
I started to study blender recently, and I was just making some experiments with fluid simulation but I was stuck with this problem.
Answer: You can use the boolean modifier to achieve this. Put it after the fluid simulation modifier for the domain object, set its operation to difference and the target object to the region you want to hide.


Are there any physical symmetries that do not form a group?

Question: I'm trying to understand the role of symmetry in physics. The overall derivation seems pretty intuitive, reasonable and elegant, but one point I'm curious about is the identification of physical symmetries with groups. It does not seem a priori necessary that the transformations under which a mathematical object remains invariant obey the group axioms of associativity and invertibility. Identity seems necessary, since leaving the object unchanged obviously should not produce a change in the invariant, but it is at least conceivable that invariants can exist under non-associative or non-invertible transformations. Are there any examples of such invariants?
Comment: Related: https://physics.stackexchange.com/q/561118/2451
Comment: This is a request for clarification... Consider a cube in 3-d space, and consider a transformation that maps part of the space outside the cube to a single point (which makes it non-invertible), without modifying the part of space occupied by the cube (so the cube is invariant). Would you call that a "symmetry"?
Answer: Mathematically speaking, you are right, there is no necessity for the invertibility axiom or the associativity axiom, or both. If you drop the first you get a monoid, if you drop both, you get a non-associative monoid. You could also drop the identity which gives you a magma and if you then reinstate associativity, you get a semigroup. You can dualise and also get comonoids and comagmas etc.
There is in fact, a whole zoo of mathematical structures in physics that mathematical physicists are busy discovering, including the above. For example, the manifolds that general relativists are so fond of can dually be thought of certain algebras. Here, 'algebras' does not mean the generic term but is a specific term referring to a specific structure, essentially a vector space where multiplication is possible.
Symmetries in physics are identified with groups essentially because of Noether's theorem which shows that symmetries yield conservation laws and vice-versa. I'm not aware of a Noether theorem where the group axioms are weakened – but there could well be – you could try asking that in MathOverflow.
Mathematical structures, in a philosophical sense, represents symmetries in a larger sense. For example, algebras represent manifolds and in manifolds, all points are alike, and this is a kind of symmetry usually called homogeneity.
Comment: @niels nielsen: ... Given all this, I think Frenkel's *Geometry of Physics* is your best bet. It's written in physics language and sets a brisk pace and covers quite a bit of material - so it's best to dip into.
Comment: @niels nielsen: Unfortunately, the typical books of group theory in physics are either too elementary or too advanced. The notion of a group is easy enough to understand but for useful applications, like say that to Noethers theorem, it is smooth groups, otherwise known as Lie groups, that are required as well as the notion of a group action. These are typically seen as advanced since they use the notion of manifolds. Personally, recalling that textbook writers work off each other, I think the pedagogy of these ideas haven't been sorted out yet ...
Comment: The interesting thing with Noether's theorem is that it does not really use the full group structure to derive symmetries, only invariance of the Lagrangian under infinitesimal transformations. The catch though, is that under very mild mathematical assumptions infinitesimal transformations already generate a full group (via the exponential map), so invariance under those transformations is the same as invariance under the whole group. You cannot have one without the other, so mostly no one bothers with making the distinction.
Comment: What you call a nonassociative monoid [is also called](https://math.stackexchange.com/questions/2089449/is-there-a-term-for-a-magma-with-identity-only/2089767) a unital magma.
Comment: @Mozubur, thank you for these insights. Can you recommend to me an *elementary* treatment of group theory as it relates to physics? or is there no such thing? -NN
Comment: This is missing something, there are discrete symmetries too, that still form a group, but do not have any conserved physical quantity in the Noether sense.
Comment: @J.G.: Yeah, I know. But I didn't think it important to list every possible synonym. I've added a couple of sentences to point out dualised symmetries.
Comment: @Mauricio: If you look at the question, you will see that it isn't about Noether's theorem. Moreover, I said 'symmetries are identified with groups essentially'. This means I'm not considering edge cases.
Comment: @Mauricio: Noether's theorem is concerned with smooth groups and not discrete groups. My point is that there are many other symmetries in physics, I pointed out one and of course discrete groups are another. My answer isn't missing anything - you are merely pointing out another example.
Comment: @MLK: I don't understand you. You're simply explaining the traditional exposition - and badly. As far as I recall from Fomin & Gelfands *Variational Calculus*, the infinitesimal transformations implicitly form a group. I don't see why you need to invoke the exponential map which maps Lie alfebras to Lie groups here. Can you explain this?
Comment: I have found some helpful books, but unfortunately a proper streamlined treatment of Lie groups in physics has not been sorted out yet and is impossible to learn from one single book.  I recommend skimming through lots of different books until the picture starts to become clearer.
Comment: @Tom: Are you replying to Niels Nielsen? In which case you should address your comment to him. Like I've suggested to him, Frenkels book is a good one. As well as *Group Theory in Physics* by Wu-Ki Tung.
Answer: There is something called a non-invertible symmetry which sounds like it's exactly what you're looking for. A place to read about it is a recent paper on 2d QCD.
To summarize the motivation, an ordinary symmetry acts on a local operator as
\begin{equation}
\mathcal{O}(x) \mapsto U(g) \mathcal{O}(x) U(g)^{-1}
\end{equation}
where $U(g) \times U(h) = U(gh)$. If the symmetry is continuous, $U(g)$ is the exponential of a charge. But to get a charge, we integrate the zeroth component of a conserved current. Therefore,
\begin{align}
\mathcal{O}(x) &\mapsto e^{Q} \mathcal{O}(x) e^{-Q} \\
&= \mathcal{O}(x) + [Q, \mathcal{O}(x)] + \dots \\
&= \mathcal{O}(x) + \int_{t - \epsilon} J^0(y) \mathcal{O}(x) d\textbf{y} - \int_{t + \epsilon} \mathcal{O}(x) J^0(y) d\textbf{y} + \dots
\end{align}
now follows. The key step is that, because the current is conserved, if we just take $J^0$ and integrate it over a closed surface, we will get zero. The difference of integrals above (one over space at time $t + \epsilon$, the other over space at time $t - \epsilon$) form a closed surface except one which contains the point $x$ for the operator. Therefore this surface can be deformed into any desired shape (i.e. it is like a Gaussian surface) and we say that the action of the symmetry is topological.
Generalizations of symmetries now come from running with the above abstract principle and forgetting about Noether currents. A non-invertible (0-form) symmetry of a theory in $d$ dimensions is a nonlocal operator $L$ whose action on local operators is topological. That is, if we let $L$ live on a $d-1$ dimensional surface and $\mathcal{O}$ live on a point, $L[\Sigma] \mathcal{O}(x)$ is independent of everything except the side of $\Sigma$ where $x$ can be found. These things are sometimes as useful as symmetries because they can be gauged and are preserved by interactions. They form a fusion category meaning
\begin{equation}
L_i \times L_j = \sum_k N^k_{ij} L_k
\end{equation}
which is more general than the group law.
Answer: Symmetries act on objects. For a symmetry to be nonassociative, it would have to be the case that (doing A and then doing B) and then doing C was different from doing A and then (doing B and then doing C). I don't think that's possible.
There is a previous question about invertibility with some good answers. In short, there are noninvertible analogs of symmetries, but they often aren't called symmetries (i.e., "symmetry" is taken to imply invertibility by definition).
Comment: You can get quite close to non-associativity with 2-group (and n-group) symmetries. There, associativity is only true up to higher morphisms, as explained in https://arxiv.org/abs/1508.04770.
Answer: Consider a transformation that cuts out a unit square centred on the origin from the plane, throws away the rest of the plane, and magnifies the unit square by a factor of two. This is non-invertible, since the step of "throwing away" everything outside the unit square cannot be reversed. But there are lots of subsets of the plane that are invariant under this operation.
Perhaps the most obvious shape with this symmetry is a 2x2 square centred on the origin. We cut out square piece from the middle of it and magnify it to exactly replace the whole. But there are plenty more.
Define an infinite sequence of nested squares, starting with the 2x2 square, then 1x1, (1/2)x(1/2), etc. each one half the size of the previous. Draw any pattern in the region between the first and second squares, then copy it scaled down into each subsequent region. The result is a fractal that is invariant under the described transformation.
There are many fractal shapes in nature that look like this. Clouds, fern leaves, snowflakes, trees, lungs, river drainage basins, etc. We commonly say that they have a scale invariance - if you magnify them they look the same. But of course they don't, because if they did they would have to be of infinite size, as you scaled them up. What we mean is that pieces of them scaled up look the same as the whole thing. 'Taking a piece' is a non-invertible transformation.
It's usually mathematically easier to consider the corresponding invertible transformation and only cut out our finite piece from the infinite one once we're done. Groups are easier to work with. But whenever we talk about "pieces" of a shape, we're using non-invertible transformations.
Similarly, solid state physicists normally assume a crystal lattice extends infinitely - or use cyclic boundary conditions to get the same effect, so they can use groups. As any real crystal is finite, we're always really talking about pieces being similar. A finite crystal is still considered to have some sort of translational symmetry, even though this is impossible.
For another example, consider the famous Mandelbrot set and the related Julia sets, which are invariant under a transformation translating and squaring numbers in the complex plane. Squaring is non-invertible - there are two points mapping to any given point.
Comment: The crucial term here is [renormalization group](https://en.wikipedia.org/wiki/Renormalization_group) – which is, indeed, ironically not a group.
Answer: I wanted to add a simple, physical example, of non-grouplike symmetries to the existing answers, in order to answer to the exact title of your question.
Consider the critical Ising model in two dimensions. It has three primary local operators, $\mathbf{1}$, $\sigma(x)$ and $\epsilon(x)$, representing the identity operator, the spin, and the energy, respectively. Their OPE is
$$\begin{aligned}
\sigma\times\sigma&\sim \mathbf{1}+\epsilon \\
\sigma\times\epsilon&\sim \sigma \\
\epsilon\times\epsilon&\sim \mathbf{1}.
\end{aligned}$$
Now the Ising model has a celebrated $\mathbb{Z}_2$ symmetry. As explained nicely in @ConnorBehan's answer, associated to this symmetry there is a topological operator $U$ (I suppress the dependence of $U$ on the codimension-1 manifold (here, curve)). $U$ acts on our local fields, by wrapping around them, as follows:
$$\begin{aligned}
U\,\sigma &= -\sigma \\
U\,\epsilon &= \epsilon \\
U\,\mathbf{1} &=\mathbf{1},
\end{aligned}$$
i.e. it flips the spin, and leaves the rest untouched. Since $U$ is the generator of a $\mathbb{Z}_2$ symmetry, it squares to one. In topological operator language, it fuses with itself to the identity, $U^2\equiv U\otimes U = \mathcal{I}$, where $\mathcal{I}$ is the identity topological line operator (a transparent line). (Note: $\mathcal{I}\neq \mathbf{1}$, one is a line operator, the other one a local operator)
Notably, the Ising model has another symmetry, oftentimes called a duality, namely, the Kramers-Wannier symmetry. At the level of topological operators, this is expressed by means of an operator $K$, acting on the fields as
$$\begin{aligned}
K\, \sigma &= 0 \\
K\, \epsilon &= -\color{gray}{\sqrt{2}}\,\epsilon \\
K\, \mathbf{1} &= \color{gray}{\sqrt{2}}\,\mathbf{1}.
\end{aligned}$$
Now you can ask what happens if I do $K$ twice? Or $K$ after $U$? Or $U$ after $K$. What you will find is that the only fusion rules compatible with the OPE above are the following:
$$\begin{aligned}
U\otimes U &=\mathcal{I} \\
K\otimes U = U\otimes K &= K \\
K\otimes K &= \mathcal{I} + U.
\end{aligned}$$
I.e. the symmetries of the Ising model do not form a group!
Mathematically, this structure is known as a $\mathbb{Z}_2$ Tambara-Yamagami category :))
Answer: This started out as a comment on benrg's answer (which I like and fully agree with), but I felt it deserved to be an answer in itself.
I would argue that associativity is a (desirable) mathematical artifact that we impose on transformations because we want them to be composable.
And, being a mathematical artifact, it cannot have a physical meaning.  Essentially, symmetries in nature aren't associative — our mathematical models of them are.

Basically, let's say that we have a physical system whose possible states we can somehow represent as mathematical objects of some kind.  We can then represent transformations between different physical states by functions that map these objects to each other.  And since the result of applying a transformation to a physical state is itself a physical state, we can then apply another transformation to it, and then yet another, and so on.
However, what we don't have, a priori, is any reason to believe that there should be any way to meaningfully combine two or more consecutive transformations into one transformation that has the same effect.  That is to say, if $x$ is a physical state and $f$ and $g$ are transformations, then we can say (by construction of our model) that $y = f(x)$ is also a physical state, and so is $z = g(y) = g(f(x))$.  But we don't have any real reason to believe that there should exist any physically meaningful transformation $t$ such that $z = t(x)$!
However, mathematically, we can simply define one to exist anyway!  Function composition, after all, is mathematically well defined for any two functions acting on the same space of objects, so we can simply decide that, for any two transformations $f$ and $g$, there also exists in our model a transformation $t = g \circ f$ representing the act of first applying $f$ and then $g$.
Does $t$ have physical meaning?  Well, insofar as applying two transformations one after another, and calling the whole process a single transformation, makes sense, then it does.  But in general, we have no reason to expect it to have any other meaning, or even for $t$ to have any mathematical representation that would be more natural than "$f$, then $g$".
Nonetheless, we automatically get associativity, because function composition is associative.  And even if we were working in a mathematical framework that didn't have a suitable notion of function composition defined already, we'd still want to define our notion of "transformation composition" to be associative.
Why?  Simply because, if $t = g \circ f$ and $u = h \circ g$ are both composite transformations, then we want both $h \circ t = h \circ (g \circ f)$ and $u \circ f = (h \circ g) \circ f$ to represent the same transformation mapping $x$ to $w = h(g(f(x)))$, i.e. the act of first applying $f$, then $g$, and then $h$.
And because this is how we want the composition of transformations to behave, then even if we were defining transformation composition axiomatically from the ground up (and thus had full freedom to choose how it should work), the associative law $h \circ (g \circ f) = (h \circ g) \circ f$ should be one of the axioms that we'd want to include, just because it makes composite transformations combine together in the manner that representations of "two or more transformations applied in sequence" should combine.


Manage Azure Active Directory application manifest through PowerShell

Question: I have a large number of applications running in Azure that need to have some very specific values set in their Manifests in the Active Directory section of the old Azure Management portal. Is there a cmdlet or other way to retrieve and set manifests for such applications through PowerShell ?
Answer: The manifest is not a physical file, but a way for the 'system' to set values using the Graph API.
You can set these values yourself using your tenants graph api endpoint, see
https://msdn.microsoft.com/Library/Azure/Ad/Graph/api/entity-and-complex-type-reference
for further referencen to the api object
Comment: Welcome to Super User. External links can break or be unavailable, in which case your answer would not be useful.  Please include the essential information within your answer and use the link for attribution and further reading.  Thanks.


eBooks download website, page or post?

Question: I am creating an eBooks download website. There will be around 5000 eBooks. Each page/post will have a download link to the pdf file of the eBook. My question is, should I create 5000 pages or 5000 posts for these eBooks?
Answer: Pages are relatively more static. They don't change much. Posts on the other hand do change on a regular basis. Just like any store, it's best to use posts in this case.
You can also create a custom post type and call it "ebooks". It would be more appropriate, but posts can do fine.
Answer: The best way to create posts or custom posts instead of pages because you may be use pages type for creating various pages like about us, contact us, privacy etc.

eBooks download website, page or post?


Replacing a drive in a mirrored set (RAID1), how does it know which is "primary"?

Question: Let's say I have a RAID 1 array with two mirrored drives.  One goes bad.  If I order a spare online and just put it in, the hardware controller will rebuild the array, right?  How does it know which drive to mirror?  What if the drive I ordered wasn't wiped and was in another RAID1 array?  Is there any risk of it mirroring that drive's contents to my drive?
Comment: What RAID controller do you have? Are your disks hot swappable?
Answer: For most hardware RAID cards, when you remove the failed drive it will know that it is gone.  Then when you install a new drive of the same size it will just add that drive as the replacement for the removed drive that failed.
In the case of a drive that was in another RAID, the controller knows the ID of the RAID set that is written to the drives.  If it finds an ID on the new drive that doesn't match the array it is configured for, it will not join it to the array.  The management interface for the RAID card either by entering it during boot time or via the RAID management software within the OS will have an option to import a foreign disk or in some other way force a disk with a foreign configuration to be use.
Comment: There are no master disks in RAID-1 since both disks have the same data. Replacing of any of disk should not affect the entire array. Here is the similar topic:https://superuser.com/questions/610315/how-does-raid-1-determine-which-drive-should-act-as-the-source-for-a-rebuild
Comment: @Stuka, that answer was really helpful in filling in the gaps from this answer.  Both are good.  Thanks all!
Comment: NP were are here to help:)
Answer: Firstly, this depends on what RAID you are using.
Different raid controllers will do things differently.
I.e a HP raid card will sit and cry if it sees raid meta data already on the new drive. You will be able to see which drive failed and in which bay by running (Linux) hpacucli ctrl all show config
Others might not be so strict. You can also (if possible) look at the server physically, spot which has the red failed led on.
Software raid is different. mdadm on Linux will put the drive in and overwrite the contents of you add it to the array, but not automatically.
In that instance, run sfdisk -d /dev/sda for example in that case to see if the replacement drive has a file system partition on it.
I appreciate it was a broad answer but if you could update your question with more specifics we can help you more :)
Answer: To prevent this being an issue, you could wipe the drive before adding it to the array. Depending on the system the RAID is in, you could either use an external caddy (SATA), load into Windows and use Disk Part to clean the drive. If it's SAS, I'd remove the existing good drive, connect the new drive, boot into a Windows installation DVD/USB and run disk part from there. Turn off, connect drives as normal, load into the RAID controller and add the new drive to the array, which should inform you it will wipe the selected drive as it adds it to the RAID.
As has been said earlier, you shouldn't have a problem as the RAID controller should have mitigation to prevent this from happening but if you are  unsure, remove the RAID from the equation and wipe the drive prior.


Allowed Wave Functions of System

Question: Given a single-particle system with Hamiltonian $H$, what constraints can be put on the wave function at a particular point in time $\psi(x)$? Of course $\psi(x)$ must obey boundary conditions given by $H$. However, in situations where $H$ does not yield strict boundary conditions (e.g. the harmonic oscillator) can $\psi(x)$ be any normalised function? My intuition says no for the following reason: QM textbooks say that any valid wave function can be represented as a linear combination of the eigenstates of $H$. In the case of the harmonic oscillator, the eigenstates of $H$ are a countably infinite set. However the set of all normalised functions is uncountably infinite. It seems to me that one cannot change between one complete set of basis functions to another and reduce the "dimensionality" somehow. This makes me think that the eigenstates of $H$ are not complete, that they imply some constraints on $\psi(x)$. This is not an area of mathematics that I understand well. Can somebody help me out?
Comment: related: [Separability of a Hilbert space and its implications for the formalism of QM](http://physics.stackexchange.com/q/148676/)
Answer: Generically, any square-integrable function is an admissible wave function, and the space of square-integrable complex functions indeed has uncountable dimension as a vector space over $\mathbb{C}$.
And it is also true that the eigenstates of the Hamiltonian span the space of states, and that they are countably many. This is the content of the spectral theorem - eigenstates of bounded self-adjoint operators form an orthonormal basis of the Hilbert space (I will ignore the subtlety of free/non-normalizable "eigenstates" here, and assume the Hamiltonian is bounded above and below).
The point is that the notion of "basis" in the context of infinite-dimensional Hilbert space is not the notion of "basis" from finite-dimensional linear algebra, where the "span" of a set is the set of the finite linear combinations (a basis that forms a basis of a vector space in this sense is sometimes called a Hamel basis). When one speaks of a basis in the context of a Hilbert space, one means a Schauder basis instead:
The "Schauder span" of a set is the set of all convergent infinite series made out of the vectors in that set. This relies on the additional topological structure a Hilbert space carries through the norm on it, and on the completeness of that norm. This span includes the usual linear span, but is larger. In particular, a countable set can span a vector space of uncountable dimension in this sense, exactly like all reals are limit points of sequences of rationals, and there are countably many rationals, and uncountably many reals.
Comment: Since this question was made a duplicate to this, https://physics.stackexchange.com/questions/621622/can-the-wave-function-of-a-particle-be-any-function I have this comment to the answer here: It is true that any function can be approximated with a series of solutions of the QM equation. Nevertheless, a parabola, which is the exmple in the duplicate, has no indeterminacy in space, so Ido not think that even expanded in as series of sines and cosines it can be a wavefunction. One has to remember the postulates ofquantum mechanics http://hyperphysics.phy-astr.gsu.edu/hbase/quantum/qm.html .

Allowed Wave Functions of System


I need to add custom buttons on Salesforce1 Compact Layouts

Question: I am using Conga Composer for merging fields of the Lead record and creating a template.But that button is not visible on Ipad, most probably because no compact Layout is created so far.But how is it possible to add a custom button on the page Layout for Salesforce1 compact layout.
Answer: The approach for Salesforce1 is a little different as you need to configure a Global Publisher Action in conjunction with your custom button on the Lead.  Here's an article from the Conga support site around configuration of Conga Composer for Salesforce1.


Why does a hole moves from one atom to another?

Question: I know that in p-type semiconductors there are holes i.e the absence of electrons. What I can not understand is why electron from neighboring atom tends to fill that hole leaving a hole behind itself? I mean what makes that electron to leave its particular atom?
Answer: Because a covalent bond lowers energy.
Let us say there is an As and an adjacent Si. One filled hybridized orbital of Si and one empty hybridized orbital of As form a covalent bond, and still they each has a vacancy.
A wandering electron fills the holes so that another covalent bond is formed, lowering the energy.
In statistical perspective, states of lower energy will dominate in long term.
The filling of holes in acceptor material (and subsequent stripping of electrons in donor material) will stop when the electrostatic force pull them back, that is, the lowering of energy is cancelled by enhanced energy by electrostatic force.
Comment: I am talking about holes in P-type semiconductors.
Comment: movement of the electron explains the same
Answer: First, let's try to understand about electrons it will help us to understand about holes.The picture you often see of electrons as small objects circling a nucleus in well defined "orbits" is actually quite wrong. As we now understand it, the electrons aren't really at any one place at any time at all. Instead, they exist as a sort of cloud. The cloud can compress to a very small space briefly if you probe it in the right way, but before that, it really acts like a spread-out cloud. For example, the electron in a hydrogen atom likes to occupy a spherical volume surrounding the proton. If you think of the proton as the size of a grain of salt, then the electron cloud would have about a ten-foot radius. If you probe, you'll probably find the electron somewhere in that region.
The weird thing about that cloud is that its spread in space is related to the spread of possible momenta (or velocities) of the electron. So here's the key point, which we won't pretend to explain here. The more squashed in the cloud gets, the more spread-out the range of momenta has to get. That's called Heisenberg's uncertainty principle. It could quit moving if it spread out more, but that would mean not being as near the nucleus, and having higher potential energy. Big momenta mean big kinetic energies. So the cloud can lower its potential energy by squishing in closer to the nucleus, but when it squishes in too far its kinetic energy goes up more than its potential energy goes down. So it settles at a happy medium, with the lowest possible energy, and that gives the cloud and thus the atom its size. It lowers the average energy of the system.
Comment: and the answer to the specific hole question is ?
Comment: Hole movement is the electron movement.The term "hole" is used to make things simpler..if we want to study in detail about hole then we have to know the behavior of an electron.The hole is a hypothetical concept.I talked especially about electron because their behavior and qualities  supports the existence of hole.


Suppress Output

Question: I want to suppress the output of variables in a set of Matlab functions. The problem is that the author forget the ";" at many positions in the code. For debug purpose this output is useful but now I want to suppress it, without searching the whole code for the missing ";". Is there a possibility to turn off this kind of output?
Comment: Possible duplicate of this:
[http://stackoverflow.com/questions/3029636/suppressing-a-functions-command-window-output-in-matlab](http://stackoverflow.com/questions/3029636/suppressing-a-functions-command-window-output-in-matlab) The answer was:
"You might try wrapping the call to the function in an [evalc](http://www.mathworks.com/help/techdoc/ref/evalc.html)."
Answer: You can suppress the output using evalc, but this requires you to pass your expression in as a string. For instance if you were using:
[A,B,C] = notMyFunction(d,e,f);

You can use instead
[T,A,B,C] = evalc('notMyFunction(d,e,f);');

And any output that would have gone to the console will now be buffered and stored in T.
Answer: What about calling those functions with a semicolon at the end? So instead of calling
my_function()

simply type
my_function();

Edit: http://www.mathworks.de/help/techdoc/ref/evalc.html evalc('my_function()');
Edit2: Too late
Comment: This is wrong.
Adding the semicolon prevents printing the return value(s). It doesn't change anything about the behavior of the function.
Answer: Sorry, but there is no simple way to just turn off the display to the command window when you fail to add semi-colons. Just add the semi-colons yourself.
Yes, you could overload disp and display, preventing them from working as they are supposed to do, but then they would fail to work under normal circumstances also. You would be breaking a valuable part of matlab.
And sorry, but adding a semi-colon to the end of a function call has no impact on whether internal lines have no semi-colons. Those internally unterminated lines will still dump their results to the command window.
Answer: when calling the function, you need to put a sign " ; " at the end, otherwise the output would be displayed, no matter for user function or matlab-pre-defined functions.
Comment: The question was not to suppress the output of the return values of a function call. The question was to suppress the output of all nested function calls that might miss the ; sign. Therefore the `evalc` is the answer.

Suppress Output


Database design advice on a marksheet schema

Question: I am not sure whether this type of question is allowed here, but seeing other questions, i think it is.
I am doing a database design of processing exam marks. There is a marksheet for each of the answersheet. Marksheet is identified by reference of answer sheet. Each answer sheet is evaluated by 2 or more examiner.
I want to store the marks for each questions. So, if a question paper has 8 questions, there should be 8 entry for marks, some of which can be blank depending on whether the student has answered that question or something.
And there is a paper code associated with each answer sheet, which is unique for a given exam.
This is my AnswerSheet Table
Id (Primary Key)
Exam_ID (foreign key to exam table)
Paper Code (manually given for each paper, unique for a single exam)

Note that, by exam I am referring to a single course exam, not whole set of exams.
Here is my Marksheet table:
Id (Primary key)
Answer_sheet_id (foriegn key to the answer sheet table)
Examiner_ID (to identify the teacher evaluated this sheet)
Mark on Question 1
.
.
Mark on Question 8

Here, you see that I am hardcoding the question 1 to 8 in the database, which I think a bad design. My logic is that, It's very unlikely to change the no of questions in an exam in future. But, It's not absolutely guranteed.
I am seeking other alternative/better design for this problem?
Comment: This sounds very much like this question: http://dba.stackexchange.com/questions/142282/database-design-for-an-exam
Answer: There should be questions table that contain all questions with unique ID to each question. A new table reference AnswerSheet table Id and questions id  should be there.


Where can I get tutorials for Access Management for Tridion 2011 SP1 or the manual?

Question: We have installed Tridion for our enterprise and as a Content Admin/Author, I need some tutorials on Access Management and also if possible a link to the Manual.
Answer: Welcome to the Tridion Stack Exchange site.
You have done the right thing in asking about Tridion CME security and doing some research before diving in.  Tridion security is very flexible and powerful, but this does mean that you can easily tie yourself up in knots if you do not plan properly!
The main thing to be aware of is that it is focused around Users, Groups, Rights and Permissions.  If you set these up well at the start, and test them thoroughly, then the security set up will serve you well.  If you try to cut corners or plan to 'come back and fix it later', then it can cause you a world of pain.
As well as looking through the security section of the online documentation (login required), I would strongly recommend that you read Alvin's SDL Tridion CME Authorization blog post and and browse over the 'authorization' tagged questions on this site.
Answer: You may want to explore below links (Requires Login)
SDL Tridion Online Documentation
Releted links are below for Access Management:
SDL Tridion Online Documentation - Setting rights
SDL Tridion Online Documentation - User and group rights and permissions


Finding maximum value of absolute value of a complex number given a condition.

Question: On a recent test, I could not solve the following problem:
If
$$\left | z^2 + 2zcos\alpha \right | \leq 1 $$
then find the maximum value of absolute value of z.
Alpha is not a fixed parameter. Alpha is real and alpha ranges over all possible values.
I've never really solved any problem close to this.
Answer should not be in terms of parameter alpha  but rather a number, so how do i go about this?
I tried substituting $z= a+ib$ and then finding the abs. value by definition but then it looks like a quartic complex equation under root sign.
Please help.
Comment: There are not 2 variables. There is one variable, $z$, and one parameter, $\alpha$. The problem is under the form $\left | z^2 + z\times B \right | \leq 1$, where $B$ is a constant.
Comment: @Martigan Oh yeah , I'm sorry.What I meant is  answer should not be in terms of parameter but rather a number .
Comment: It is not possible to have a numerical answer with an undefined $\alpha$ parameter. Otherwise, just take $\alpha=\dfrac{\pi}{2}$! It will simplify everything... (just joking!)
Comment: @Martigan Why isn't it? Hypothetically one could calculate all the infinite combinations of z and alpha that satisfy the inequality and find the maximum value of abs. of z. Also I'm fairly sure the question isn't wrong.
Comment: Then what your are saying is that $\alpha$ is not a fixed parameter... sorry, that's what I understood from your description.
Comment: @Martigan No I'm sorry! I'll edit the original question.
Answer: First, as @Martigan notes, the answer does depend on $\alpha$. For $\alpha = \pi/2$, the answer is $|z| = 1$, while for $\alpha = 0$, the number $z = -1.5$ satisfies the inequality, so the maximum possible value of $|z|$ is at least $1.5$.
If the question is "what's the max absolute value of $|z|$ as $\alpha$ ranges over all possible values?", then setting $\cos(\alpha)$ to $-1$ is probably a good way to find the best answer (although I haven't proved that!), at least in the case where $\alpha$ is restricted to be real.
But whether you're supposed to solve the problem for a fixed $\alpha$ or optimize over all $\alpha$, the problem should say whether $\alpha$ is assumed real or not. If not, you can pick $z = -2\cos(\alpha)$, which gives an expression whose norm is zero, hence certainly less than 1. Since the norm of $\sin \alpha$ is unbounded (for $\alpha \in \mathbb C$), the answer to the "optimize over $\alpha$" version is evidently "infinity".
My conclusion: this is a really badly stated problem.
With the additional hypothesis that $\alpha$ is a fixed real number, I'd write
$$
z^2 + 2z \cos \alpha  = (z + \cos\alpha)^2 - \cos^2\alpha
$$
and play with that. I'd probably to to make a case for why the $z$ that produces the largest-modulus value for this expression has to be real, or better, why it can be rotated to a real number that produces an equally large modulus, by multiplying by $e^{i \theta}$ for some $\theta$. At that point, I'd have a single-variable calculus problem, and I'd solve it.
I can't guarantee that this works, but you asked for help in how to go about this, and I'm telling you what I'd do first. Offhand, it seems like a tough problem for an exam. Then again, I haven't thought much about complex vars since about 1984, so maybe it's easier than I'm making it.
If "$\alpha$ ranges over all possible values" means that I'm to optimize over $\alpha$ as well, I could take the solution to the part I just described (if it's correct!) and optimize over $\alpha$. Or I could go back to my original observation about $-1.5$ and say that
$$
(z + \cos\alpha)^2 - \cos^2\alpha
$$
seems as if it'd be less than 1 for the largest possible $z$ when the first term is larger than 1 and the second cancels it out. And the most cancellation comes when $\cos^2 \alpha = \pm 1$. Picking $\cos \alpha = -1$, I'd guess that $z = 1 + \sqrt{2}$ provides the optimum.
At this point, having played with the problem in my head, the real work -- proving the conjectured answer correct -- begins.
Comment: Okay so alpha is real and alpha ranges over all possible values. Then how to approach the problem?
Comment: Thanks for the answer! But I didn't understand the following sentence -"seems as if it'd be less than 1 for the largest possible z when the first term is larger than 1 and the second cancels it out." And your conjencture is indeed correct . Also , I didn't really understand why z has to be real. Also , for solving using calculus , do i have to set the derivative to zero? But by doing that I'm getting z=-cos alpha which is wrong.
Comment: No surpise. It was a vague description of intuitive woolgathering in my brain. Let me try again: We've got $(z+B)^2 - B^2$. Think of just real $z$ and $B$ for now. We want to make $z$ big, while keeping this expression small. If you had to choose between $z$ having the SAME sign as $B$ and the opposite sign, you'd choose "opposite" so that the first term would be smaller...allowing you to increase $z$. Now the only question is "do you want B big or small?" If $B$ is zero, then the max $z$ will be $\pm 1$; if $B = 1$, I've already shown $z=-1.5$ words. So big $B$ seems better. Re:calculus: yes.
Comment: To expand: be sure you're maximizing $|z|$ under the constraint that $|(z+B)^2 - B^2| \le 1$. That's constrained optimization, and a job for Lagrange multipliers, unless you can do it in some obvious and direct way.
Answer: Using the triangle inequality
$$|z^2|-|2z\cos(\alpha)|\leq |z^2+2z\cos(\alpha)|\leq 1$$
but $$|z^2|-|2z|\leq |z^2|-|2z\cos(\alpha)|$$
therefore
$$|z^2|-|2z|=|z|^2-2|z|\leq 1\Rightarrow (|z|-1)^2\leq2\Rightarrow ||z|-1|\leq\sqrt{2}$$
In other words
$$0 \leq |z|\leq \sqrt{2}+1$$
Notice that this inequality is sharp because it is attained for $\alpha=\pi$ and $z=\sqrt{2}+1$.
Comment: Thanks for the answer! But I've a question: 1. In the first step of triangle inequality , shouldn't the absolute value of LHS be less than what you've written ? (as the 'magnitude' of difference of two sides is less than the third side)
Comment: @ A Googler: I have used the fact $|a|-|b|\leq |a+b|$ then because $0\leq |\cos(\alpha)|\leq 1$ the result follows.
Comment: Oh yes I got it , fantastic answer!


ssh into device with wrong (probably) static ip adress

Question: I have a problem with a remote sensor (connected via a raspberry), it is connected to a local router and correctly uses it as gateway. I can see that the raspberry got an ip address via dhcp. However, there is some configuration mismatch. The raspberry thinks it has a different ip address (probably known to me). Therefore I cannot ping it or ssh into it. Is there still a way to connect to it via ssh ?
Comment: Do I understand correctly, that you don't know the IP of the RPi? Do you have other devices in this local network? Another Raspberry? If so you can try to run nmap or if you have a smartphone in the network you can use the Fing app on iOS or Android.
Comment: nmap -sP does not find the raspberry. The raspberry displays the ip adress locally on a screen and it is wrong. However, the router has given an ip adress to the device. Probably I have to get the sd card in order to see what is wrong.
Comment: ping should work by default. So I think the chances to connect are very small. Do you have physical access to the RPi or the SD Card?
Comment: I have to go there. Damn.
Answer: If you know the IP address that the raspberry pi 'thinks' it has: and you have access to the router configuration. Configure the router to allocate the IP that the Pi thinks it has by DHCP fixed/static address to the Pi.  That way both the router and the Pi agree what the address is.  You should then be able to connect. (provided that there are no other network configuration issues: e.g. routing).
Comment: Hah, I will try


What is the effect of adding sugar to the water when poaching eggs?

Question: I'm doing a food tech assignment and I need to know how adding sugar to the water effects the coagulation of protein when poaching eggs.
Comment: Does this mean we've finally reached the level of StackOverflow when people start asking homework questions here?
Comment: That's a bit of an odd question because sugar isn't generally used in the poaching of eggs. A lot of people use vinegar in the water, but not sugar. Even a Google search didn't show any examples of recipes calling for sugar in egg poaching water. That doesn't mean your question as written isn't answerable, it's just odd.
Comment: I can't help with the sugar question, but you might find this helpful anyway, even though there is no mention of sugar. http://cooking.stackexchange.com/questions/57/how-does-a-splash-of-vinegar-help-when-poaching-eggs?rq=1
Comment: @Jolenealaska just because it is not commonly added, it doesn't mean it won't have an effect if it is added. So, it makes sense to ask what will happen if we were to add it.
Answer: Sugar stabilizes proteins and reduces foaming (salting in).
I'm not sure how much sugar you'd need to add to your egg water to reduce dissipation and strand formation, but some protein structures are affected positively by sucrose concentrations below 30 grams per liter.
Comment: The source you linked tells us about foams in liquid protein. When we poach eggs, they don't foam. So, while I accept that sugar has an effect in modifying the protein unfolding behavior, I am not sure this is connected to poaching, where the proteins aren't unfolding anyway.
Comment: The proteins in the egg are unfolding/denaturing when you put them in boiling water. That's a normal part of the cooking process. Under those conditions, sugars will still form nice hydrogen bonds to amino acids at the surface of the egg blob, stabilizing it a bit whilst the middle starts cooking/denaturing and gelling up. See http://en.wikipedia.org/wiki/Denaturation_%28biochemistry%29 which includes a series of nice pictures of egg albumin denaturing as it is cooked.


Lg front load washer not doing high speed spin (wm2650hwa)

Question: My washer will go through all cycles then last 7 min does not do high speed cycle.  I had repair man come he said was control panel.  I replaced control panel, pump and hall sensor.  I did a reset. Then ran the machine twice empty and it worked perfect. Went through all cycles and did the high speed spin perfect.  I then put a small load in it and it went through the cycles until 7 min to go tries to go in to high then just goes to 1 min and shuts off.  Clothes are very wet.  Flashed LE code.  First time that happened.  With the parts I have replaced I am wondering if it is the stator.  Any advice?
Answer: Based on you description the control board is doing its job/functions.
It is possible the pump not doing its job.
It can not spin at high speed until water is pumped out, so check for water level.
I could be also the belt connecting the motor and the drum (slipping). If the belt is to loose, adjust the tension. The belt might be also worn out and needs replacement.


Knock Sensor using 555 Timer with a timed light

Question: I have seen a few Knock Sensors using the Piezo Speaker and the Arduino. I am wondering if there is a way to eliminate the Arduino and utilize a 555 Timer and other simpler components so that when the Piezo sensor detects a Knock it triggers a Relay to illuminate a light either in three successive pulses lasting 3 seconds or a continuous on time of 3 seconds then off again until the next Knock? ie: (Knock: Blink Blink Blink, or Knock Light on(3 seconds)off) I apologize, I have just started learning some of this.
Comment: Look up 555 or 556 one shot mode
Answer: Use a 555 timer as a monostable with a 3 second timeout directly driving an LED, pull the 555's input up to Vcc, and trigger the 555 with a negative-going cap-coupled pulse generated by the piezo loudspeaker and amplified enough to drive the 555's trigger input to lower than Vcc/3.


2011 f150 ecoboost timing chain and valve train

Question: Looking to find the book rate for how many hours labour to change full timing set including vct's, chains and intake cams 3.5l ecoboost
Comment: Welcome to Motor Vehicle Maintenance & Repair!
Answer: Mitchell shows 12.3 hours for the timing set and an additional 1.6 hours to R&R the cams on both banks. Probably add a half hour to R&R the vct solenoids. The actuators are figured into the 12.3 figure.
Answer: Alldata says 10.8 for the cams (but all four), and figure another 2.5 for the timing chain and guides/tensioners.  I doubt you need VCT solenoids, but the actuators won't add much (maybe an hour) if you are already replacing cams.
So Ben's answer totals about 14.4, my estimate (Alldata) suggests around 14.3 maybe an hour or more less if the exhaust cams stay put.
Either way . . .  OUCH
Better luck.
Comment: Doesn't sound any worse than a v8 triton lol.
Comment: @Ben Certainly not, especially after you leave half the spark plug threads in the head...


Visual Composer text block conflict with font awesome

Question: I'm building a website on WordPress that uses a theme called Total, the Visual Composer plugin and Font Awesome, when I add for eg.  to the text area of a text block and then save the text block view the page all is fine and dandy (displays fine) but as soon as I go back into the back-end and RE-OPEN the text block the text block is now empty - the  has vanished. I'm assuming there has to be a JS conflict but have no idea where to search for the issue and how to even begin troubleshooting.
Help will be much appreciated.
thanks!
Matthew McEwan
Answer: Matthew!
Visual Composer defaults back to "Visual" editor mode when you return to edit, and thus breaks the code you created in "Text" editor mode. As you see, it erases your links but leaves the FontAwesome code itself intact.
There are two different ways I've confirmed that will allow you to get around this:

Replace your Text Block with a Raw HTML block -- Within Visual Composer, search for a module called "Raw HTML". Place your content
    within this block and save. Any additional text formatting you did
    will have to be done manually.
Install the Raw HTML plugin for WordPress -- This plugin also prevents the HTML from being stripped. It also goes a step further: this plugin allows you to disable the Visual Editor altogether, on certain types of posts. It has some other interesting features, too.

Hope this help you!
-- Jammes
Answer: Here's a trick that I do so the icon code wont be erased during editing.
on your text block,
enclose this code within your icon code:
.

It will look like this:
.

Hope this little trick will help.


Is there a term that describes a written work that includes narrative in addition to scientific and historical information?

Question: I can think of a few books, such as The Year of Magical Thinking, by Joan Didion, and I Can Hear You Whisper by Lydia Jones. In both these novels, the author was narrating a true experience, but at the same time, she was writing large passages in which she interviewed scientists or made references to historical information to further illustrate the issues at the present time.
Comment: Welcome to Writers Stack Exchange, I don't think there's is a term for it but in House Of Leaves (don't worry about the author, the book is well-known) with authors and phsycholigsts the author made up, some were real with actual statements but it depended on the subject; this made it realistic
Comment: If you are looking for a certain word in the English Language I think this should be better posted on [EnglishLanguageAndUsage.SE](https://english.stackexchange.com/). I am voting to close this question as off-topic.
Answer: I'm writing this as an answer because I don't have enough reputation to comment.
What you're describing to me sounds like a blend of literary journalism (the research part) and memoir (personal story).  Or a well-researched memoir, which, at least in the memoir class I took several years ago, seems to be encouraged.  I was taught that good memoir should have meaning in the larger historical context, as well as your own personal story, and that does require, as you said, references to historical information and perhaps even interviews.  This is what differentiates memoir from autobiography.
Source: I took a college class on writing memoir from a professor who has written and published several of her own.  For her privacy, I'm not posting her name here.


Is it possible to completely wipe a flash memory?

Question: i have a 64 gb micro SDXC memory card that has sensitive files on it and i want to completely erase it but i heard it was impossible to be sure that your data was erased because of wear leveling ? The manufacturer (SanDisk) doesn't provide special tool for a secure erase.
What if i delete the files then use a software like eraser to erase unused disk space, would this work ?
Comment: You can take a look at this procedures (draft): http://csrc.nist.gov/publications/drafts/800-88-rev1/sp800_88_r1_draft.pdf
Answer: This topic has already been covered here and there. To sum up:

If you simply overwrite the complete disk (as a block) with data (random, null bytes... it does not matter), then there may be parts of surviving data, which could potentially be recovered by extracting the chip and reading from it directly.
You cannot know what data has survived without taking the chip apart.
Overwriting the whole disk repeatedly should eradicate (almost) all the data, but you cannot be sure of it, and it will severely diminish the lifetime of the card.

It is safer, and (in the long time) cheaper, to simply physically destroy the card. Next time, use disk encryption.
Comment: I just want to point out that overwriting drives with zero bytes may not work if the drive implements compression in the firmware. Apart from that, this is a good answer.
http://rscott.org/ssd/SSDs_and_compression.htm
Answer: With basic means (i.e. software to write to the memory card) I am rather doubtful that it is possible to trustedly delete all sensitive data.
Inside of such a SDXC there is a complex microcontroller. Those microcontroller is not known to you and its software/hardware is proprietary. The memory size shown by the SDXC must not reflect the complete data the microcontroller can write to. Even likely there is flash memory for 70, 80, maybe 128GB of flash memory in your device.
At first this would look like an extremely wasteful way of memory usage (having 128GB worth of flash memory and only offering 64GB). However it is less wasteful considering that a fair fraction of the flash memory is defective/broken already as the outcome of an ordinary production process.
The real deal is that under the hood such a memory is pretty f***ked up. The microcontroller is to counter the messy "under the hood" by using techniques of error checking to give the appearance that the data on the SDXC card appear to be safe and guarded, while internally memory cells are dying.
Comment: Any time, it's one of my hobbies. Note that I didn't fix everything though sorry )-:


C data type declaration query

Question: In the C programming language, on assigning 4,3 to an integer-type variable, like:
int a;

a = 4,3;

the variable receives the value to the left of the comma (i.e. a is set to 4 in the example).  On assigning a parenthesized list, however, like
a = (4,3);

, the variable takes the last value in the comma-delimited list (3 in the example).
What is the reason for this?
Comment: Can you please post the code you are using for testing?
Answer: C uses the comma (,) in two distinct ways: as an element separator in compound constructs such as array literals or lists of declarations, and as a binary operator.  It does not have list-based assignment such as some higher-level languages do.
As an operator, the comma evaluates its left-hand operand first, then evaluates its right-hand operand.  The value of the overall expression is the second result.  This is in some ways complementary to the && and || operators, both of which evaluate their left-hand operands first, but each of which evaluates its right-hand operand only conditionally, depending on the left-hand result.
The other key to understanding your observation is that the equals sign (=) is also an operator.  It evaluates both operands, in unspecified order, and its result is the same as the right-hand operand.  Modifying the value of the left-hand operand is a side effect.
The assignment operator has very low precedence, but the comma operator has the lowest precedence of all.  Therefore, if you do not use parentheses to alter evaluation order, this ...
a = 4,3;

... is equivalent to ...
(a = 4), 3;

.  It evaluates the assignment first, yielding the value 4 with the side effect of assigning that value to variable a.  Then it discards that value and evaluates 3, yielding the value 3 as the overall result.  Since the whole thing is not part of any larger expression, the result is discarded.
On the other hand, you can override precedence with suitable use of parentheses, as in this:
a = (4, 3);

.  In that case, the comma operator is evaluated first, yielding 3 as its result, and that is the right-hand operand of the assignment operator.  The assignment expression yields result 3, with the side effect of assigning that value to variable a.
Comment: @Wolf `;` is not an operator. Also, in `return 4,3;`, the comma is an operator, not a separator. In a comma-separated list there is no sequencing, e.g. `f(a(), b());` may call `a` and `b` in either order.
Comment: Good explanation. BTW `the comma operator has the lowest precedence of all` -- If you treat `;` as an operator (I know that's wrong, but just for illustration), then comma is evaluated first. That's why `return` takes the last value of a comma separated list. https://ideone.com/819cWn
Answer: Yes . That would be the correct operation.
   i = (a, b);             // stores b into i
                          // ... a=1, b=2, c=3, i=2
   i = a, b;               // stores a into i. Equivalent to (i = a), b;
                          // ... a=1, b=2, c=3, i=1

Check property of comma operator.
"In the C and C++ programming languages, the comma operator (represented by the token ,) is a binary operator that evaluates its first operand and discards the result, and then evaluates the second operand and returns this value (and type)." - wikipedia
Comment: You're right, but you haven't quite connected the dots.  It would be helpful to explain why the parentheses make a difference.
Answer: In C/C++, comma(,) operator is evaluated left-to-right, and the value of the left expression is discarded. The type and value of the result are the type and value of the right operand. All side effects from the evaluation of the left-operand are completed before beginning the evaluation of the right operand. Taken from KR book A.7.18
Also, comma operator has the least precedence and order of evaluation.
As = operator has higher precedence than , operator. In following statement
int a;
a = 4,3;

assignment happens first resulting in a = 4.
and also as we all know, () overrides the precedence, so we have a = 3 in case of
int a = (4,3);

Now, We all understood the theory of , and =, Let us concentrate when to use ,. Comma operator should be used sparingly, The most suitable uses are for constructs strongly related to each other. for instance in for loop
for (i = 0, j = strlen(s)-1; i < j; i++, j--)

Wherever possible, I will use () in conjunction with ,
Comment: `int a = 4,3;` is ill-formed. OP was asking about `int a;  a = 4,3;` and `a = (4,3);` .
Comment: My mistake, thank you for pointing this out. Do you mind reconsidering it

C data type declaration query


Concurrent access in SQLite

Question: Can SQLite manage concurrent access? I use SQLite with C/C++? If it doesn't support that. Is there any suggestion to support concurrent access in SQLite?
Comment: http://stackoverflow.com/questions/4060772/sqlite3-concurrent-access
Answer: Yes it does as the documentation states here:

SQLite Version 3.0.0 introduced a new locking and journaling mechanism
  designed to improve concurrency over SQLite version 2 and to reduce
  the writer starvation problem. The new mechanism also allows atomic
  commits of transactions involving multiple database files.

and:

SQLite uses POSIX advisory locks to implement locking on Unix. On
  Windows it uses the LockFile(), LockFileEx(), and UnlockFile() system
  calls.

And here:

SQLite uses filesystem locks to make sure that only one process and
  database connection is trying to modify the database at a time. The
  filesystem locking mechanism is implemented in the VFS layer and is
  different for every operating system. SQLite depends on this
  implementation being correct. If something goes wrong and two or more
  processes are able to write the same database file at the same time,
  severe damage can result.

Concurrent access in SQLite


How to generate a PDF programmatically?

Question: I'd like to make a PDF file comprised entirely of a folder of images, preferably with no added compression or cruft. Are there any programs that would let me author the PDF file manually via script or API? The important thing is that a) my JPEGs don't get compressed a second time, and b) they're displayed at their native resolution, with no borders. (In other words, I'd like my PDF file to have nothing more than the straight JPG image data centered at 0,0 on each page, sized correctly.) As far as I can tell, most authoring programs recompress the images and add their own layout stuff.
Comment: What's an "authoring tool" that you object to?  If I use Mac OS iWork Pages and "save as PDF" would the Pages be an authoring tool?  If not, why not?  Please be precise on what "authoring tool" means to you.
Comment: Any tool that pre-formats the pages and recompresses the images, which is basically all of them. To me, the important thing is that a) my JPEGs don't get compressed a second time, and b) they're displayed at their native resolution, with no borders. As far as I can tell, most authoring programs recompress the images and add their own layout stuff.
Comment: In other words, I'd like my PDF file to have nothing more than the straight JPG image data centered at 0,0 on each page, sized correctly.
Comment: So "Are there any programs that would let me generate the PDF file directly, without going through authoring tools?" is irrelevant?  If so, please remove it from the question.  "my JPEGs don't get compressed a second time, and b) they're displayed at their native resolution" is your real question?  If so, please **update** the question to actually state what you actually want to do.  Your question and your comments don't agree. Please **update** the question.
Comment: OK, question updated.
Comment: "Are there any programs that would let me author the PDF file manually via script or API?"  Why is this in there?  You just want no compression, right?  If that's the **real** goal, please leave the scripting stuff out of the question.  It's confusing to see a non-goal (i.e., scripting) in the question when the goal appears to be **no compression**.
Comment: Too late now, but, since you ask "Are there any programs  ...",  you really ought to have asked this at https://softwarerecs.stackexchange.com/
Answer: Creating PDF files by hand is not recommend for the faint hearted! If you really want to try it, we wrote a series on creating PDF files by hand on our blog http://blog.idrsolutions.com/2010/09/grow-your-own-pdf-file-part-1-pdf-objects-and-data-types/
Comment: Link-only answer are discouraged on SU due to possible link-rot in the future. Please attempt to include pertinent information in your answer(s).
Comment: This link **is** rotten.
Comment: I have fixed it
Comment: You should still include at least some details in the answer itself and not rely solely on the link.
Comment: That somewhat reversed approach is very interesting. Cool article, thanks for writing it!
Answer: You say "by hand" which confused some people, I think. You're not actually saying that you want to write raw PDF, right? Below is code that uses the open source iTextSharp library (18.104.22.168). Set the variable FolderWithImages to your folder containing images and PdfFileName to the PDF that you want to kick out and it will take all JPGs in the folder and create a PDF. This code is very simple but you can do a lot of things like resizing, scaling, etc. There's tons of code out there for iTextSharp and its parent project iText.
using System;
using System.ComponentModel;
using System.IO;
using System.Windows.Forms;
using iTextSharp.text;
using iTextSharp.text.pdf;

namespace WindowsFormsApplication2
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            //The folder containing our images
            string FolderWithImages = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
            //The PDF that we will output
            string PdfFileName = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), "ImagesCombined.pdf");

            //Create a basic stream to write to
            using (FileStream fs = new FileStream(PdfFileName, FileMode.Create, FileAccess.Write, FileShare.None))
            {
                //Create a new PDF document
                using (Document doc = new Document())
                {
                    //Bind a the document to the stream
                    using (PdfWriter w = PdfWriter.GetInstance(doc, fs))
                    {
                        //Open our document for writing
                        doc.Open();

                        //Will hold an instance of our image
                        iTextSharp.text.Image img;

                        //Grab all JPGs from the given folder and loop through them
                        string[] Images = Directory.GetFiles(FolderWithImages, "*.jpg", SearchOption.TopDirectoryOnly);
                        foreach (string i in Images)
                        {
                            //Get the JPG as an iTextSharp "image"
                            img = iTextSharp.text.Image.GetInstance(i);

                            //Tell the image that when placed we want it at (0,0)
                            img.SetAbsolutePosition(0, 0);

                            //Tell the system that the next "page" that we add should be the dimension of the image
                            doc.SetPageSize(new iTextSharp.text.Rectangle(0, 0, img.Width, img.Height));

                            //Add a new blank page
                            doc.NewPage();

                            //Put the image on the blank page
                            doc.Add(img);
                        }

                        //Close our output PDF
                        doc.Close();
                    }
                }
            }
            this.Close();
        }
    }
}

Comment: I think this is pretty much exactly what I'm looking for! For future reference, are you aware of any other programs like this?
Comment: (And by "programs" I mean, programs, libraries, scripts, etc.)
Comment: Yep, there's a bunch of them out there. PDFTK, Aspose.Pdf, Essential PDF, AspPDF. Just search for "c# pdf library".
Comment: Heh, I'm an idiot. Searching for "PDF library" gave me a bunch of great results. All this time I've been looking for the wrong thing. Thanks!
Comment: Used a version of your code with the Java iText library. Works perfectly — exactly what I wanted! Thank you again.

How to generate a PDF programmatically?


Is a scheme Noetherian if its topological space and its stalks are?

Question: Is a scheme being Noetherian equivalent to the underlying topological space being Noetherian and all its stalks being Noetherian?
Comment: I think this is a good question for this site : it's an interesting question (and answer) and I at least have not seen the counter example to the seemingly plausible result before.
Comment: Probably should be asked on MSE.
Answer: This is false. The easiest counterexample I could come up with is the following "affine line with embedded points at every closed [rational] point":
Example. Let $k$ be an infinite field, let $R = k[x]$, and for each $\alpha \in k$ let $R_\alpha = R[y_\alpha]/((x-\alpha)y_\alpha,y_\alpha^2)$. Then $R_\alpha$ is an affine line with an embedded prime $\mathfrak p_\alpha = (x-\alpha,y_\alpha)$ at $x = \alpha$, sticking out in the $y_\alpha$-direction. Finally, let
$$R_\infty = \bigotimes_{\alpha \in k} R_\alpha = \operatorname*{colim}_{\substack{\longrightarrow\\I \subseteq k\\\text{finite}}} \bigotimes_{\alpha \in I} R_\alpha$$
be their tensor product over $R$ (not over $k$); that is
$$R_\infty = \frac{k[x]\left[\{y_\alpha\}_{\alpha \in k}\right]}{\sum_{\alpha \in k}((x-\alpha)y_\alpha, y_\alpha^2)}.$$
This is not a Noetherian ring, because the radical $\mathfrak r = (\{y_\alpha\}_{\alpha \in k})$ is not finitely generated. But $\operatorname{Spec} R_\infty$ agrees as a topological space with $\operatorname{Spec} R_\infty^{\operatorname{red}} = \mathbb A^1_k$, hence $|\!\operatorname{Spec} R_\infty|$ is a Noetherian topological space.
On the other hand, the map $R \to R_\alpha$ is an isomorphism away from $\alpha$, and similarly $R_\alpha \to R_\infty$ induces isomorphisms on the stalks at $\alpha$. Thus, the stalk $(R_\infty)_{\mathfrak q_\alpha} = (R_\alpha)_{\mathfrak p_\alpha}$ at $\mathfrak q_\alpha = \mathfrak p_\alpha R_\infty + \mathfrak r$ is Noetherian. Similarly, the stalk at the generic point $\mathfrak r$ is just $R_{(0)} = k(x)$. Thus, we conclude that all the stalks of $R_\infty$ are Noetherian. $\square$
Remark. As requested in the comments, my motivation to come up with this example is the following: I was trying to prove by hand that the answer was positive. After an immediate reduction to the affine case, one needs to consider a chain $I_0 \subseteq I_1 \ldots$ of ideals. Because $|X|$ is Noetherian, we may assume they [eventually] define the same closed set $V$. Intuitively, to check that they agree as ideals, it should suffice to check it at each component of $V$. Then you can try to use the Noetherian rings $\mathcal O_{X,x}$ for the generic points $x$ of $V$.
However this is not quite true, because of embedded points. The precise statement [Tags 0311 and 02M3] is that the inclusion $I_{i-1} \subseteq I_i$ is an equality if and only if the same holds for the localisation at every associated point of $I_i$. Now you run into trouble if the $I_i$ differ at an embedded point that is not seen by the topology of $V$. Moreover, if this embedded point varies as we move through the chain, there is a chance that the localisations $\mathcal O_{X,x}$ at these embedded points are still Noetherian. Once you see this, coming up with the example is not so hard.
Comment: Can you give some motivation (when you are free) to think of this example..
Comment: @PraphullaKoushik I edited my answer to include some motivation behind the construction.
Comment: Thanks for the positive response.. This makes so much sense... Thanks..
Answer: A further counterexample is Example 2.3 in W. Heinzer, J. Ohm, Locally noetherian commutative rings, Trans. Amer. Math. Soc. 158 (1971), 273-284.


Is oversmart a correct word?

Question: I have heard several people using the word "oversmart" or "over smart" to indicate that person is trying to act extra smartly. Is this a correct word? Does it make any sense?
Comment: What has your research shown? Are they native speakers? Where are they from?
Comment: Nopes, they are not native speakers. I am not sure whether people use this word in US or not
Comment: Too act *smartly* means to act quickly, without delay.  What sense of *smart* do you mean? It can mean clever, or intelligent, or insolent.
Comment: Never heard it in this sense (or any other sense) in the US.  I kind of like it, though.
Comment: It's not a standard English word, but I've heard it used to mean using difficult vocabulary to appear smarter, or to confuse people into thinking the topic is more complex than it really is.
Comment: It really depends on what you mean by *"correct"*
Answer: "Oversmart" is not a word that I have come across before (appreciating that language changes all the time/over time, and that I am not the Lord and Arbiter of All English).
It feels like a business buzzword—possibly a contraction of "overly smart"—for which I presume the intention is to convey one of two opinions, in a mildly disparaging manner:

either that the person has devised a complex solution to a problem, where a simpler solution is apparent;
or that the person thinks they are being cleverer than they actually are; for instance, they may be attempting to win an argument with a person by attempting to confuse them, but have underestimated their target's ability to understand (or recognise the attempt).

The first option can potentially be softened to overengineered (when describing the solution) or overthinking (when describing the process of coming up with the solution).  This is possibly where the over- prefix has come from.  For example:

"You are overthinking the problem." (especially in cases of decision paralysis)
"He is overthinking it."
"You have overengineered the solution."
"You are overengineering the solution."
"She has overengineered the solution."
"The solution is overengineered."

The second might simply be better inferred with too clever, e.g. :

"You are too clever by half" (or sometimes "too clever by far")
"She is too clever by half"
"You are too clever for your own good" (note a possible veiled threat of escalation/retaliation here)
"He is too clever for his own good"

However, if this is a business buzzword, and it is being used in your line of business, you may just be better off using that term amongst your peers, until it falls out of favour.
PS.  Ngram suggests that it isn't very widely used (I always compare to "the", which hits about 6%)...

Trends suggest only occasional spikes (at least in the in the US):

A bit more interest in India:

Is oversmart a correct word?


Informatica HTTP transformation, End point URL does not give response for GET method

Question: I am trying to use HTTP transformation for getting response from an api. Here I am not sending any token or credentials for authorization. I am just using blanK text file as source and in HTTP transformation mentioned the URL. Below is mapping
<code>SQ(Blank text file)-->HTTP(GET method and URL)-->http response(FlatFile)
</code>
Kindly correct if I can use blank text file as source since I am not sending any data for GET request. I am getting error as follows in the image
Answer: This error is not about data being sent. The error mentions a problem with the certificate. One of certificates in the chain is self-signed - this means (briefly) it cannot be trusted. Try reading this thread for more info.


C++ game to Unity

Question: So I have made a game coded in C++ (using SFML as a library) and a custom JSON C++ library. Is there anyway I can port this to Unity so I could use its UI features as well as its compilation ( I want to build the game for phones ). I have read about Native Plugins but I am not sure if it will work.
Answer: I'm not sure it's possible to completely port a c++ game to unity. Your game uses sfml for drawing things on the screen, sfml uses opengl(or its way to draw things).
Unity has a much more complex architecture: it uses shader files, scripts, scenes and so on;
 This does not mean that the same concepts and mechanics can be applied to a game in Unity: most of the things are going to be much easier to do and less error prone.
In my opinion the solution (IF you want to use Unity) is to completely switch to unity, for both the android and desktop platforms.
IF you want to stick to C++ and sfml, there are ways to build your game for android

C++ game to Unity


Should I use SVG to fix pixelated circle in logo instead of PNG?

Question: I create a logo with a circle and because it has transparent area, I used png. The thing is that on my website it doesn't look smooth. There is a lot of aliasing... Should I use svg for logo? Is it well supported by browser?
Comment: I'm voting to close this question as off-topic because it is about visual design and file formats only.
Comment: You have probably saved your image as an 8-bit PNG instead of a 24-bit one. Nevertheless, this question is off topic for this site and probably belongs better on the Graphic Design Stack Exchange site.
Answer: I would have thought any problems you're having with the .png file are related to the original image itself and the quality of its conversion to .png, rather than a problem with the .png format.
In answer to your question though, Safari, Firefox, Internet Explorer, Edge, Chrome, and Opera all offer SVG rendering support.
If it was me, though, I would first try to see if you can get it to look as you want in PNG format first, only because PNG is more widely supported generally.
Comment: weird, because I used Illustrator and convert into png. Will see tomorrow if I can fixe that.
Answer: Your specific example's lack of smoothness is not because png renders bad. It is just because you did not exported your png file in a correct way.
If you have your original logo in vectors turn anti-alias on. In some rare cases you can export it two times larger and resample it on Photoshop or Gimp. If you do not have the original in vectors... you need to draw it again anyway. (Inserting a bitmap inside Ilustrator wil not magicly convert it to vectors)
For something like a Logo, you can use either format, but I would only use SVG if I really need to scale an image. Some map, some blueprints, some diagrams.


ubuntu software center not opening

Question: I  just installed ubuntu 12.04 by completely  removing windows. Now i am unable to open ubuntu software center . however i am able to see the icon on my desktop.
suppose i can open the software center successfully...  how can i install the required drivers ? can i use the cds(drivers , webcam , facerecognition) that were given at the time of purchase of my inspiron ? please guide me in this respect . i wish to explore the world of linux .
Comment: Split your question in to two question :)
Comment: Hello viveksura. Your question about drivers is answered here: http://askubuntu.com/q/47506/24694 .... As for the Software center:
Comment: This question should instead be filed as a bug report, and [as such](http://meta.askubuntu.com/questions/1317/what-to-do-with-questions-that-describe-known-bugs/) is off-topic, thanks! [Instructions on filing a bug report are here](http://askubuntu.com/questions/5121/how-do-i-report-a-bug).
Answer: Drivers don't get installed from the windows cds because the windows software is made only for windows. In GNU/Linux, a lot of the drivers that you'll ever need are already running with the default kernel from installation.
As for the webcam, it probably just works. I would suggest that you install the cheese webcam utility to test it out. To install cheese, either open the software center and search for/ install it from there.. Or, hit ctrl+alt+t to get the command line. Then, run this command:
<code>sudo apt-get update && sudo apt-get install cheese -y
</code>
After the installation is complete, you can click the Ubuntu icon, then start typing cheese, then launch the "Cheese Webcam Booth".

ubuntu software center not opening


I'm writing an application that needs to log error/ exception messages but should still continue execution if it not a fatal error

Question: I'm writing an application that needs to log error/ exception messages but should still continue execution if the error is not a fatal error. I was thinking of making a method that returns a Task but calling this method as a fire and forget and not wait for response from the method. What is the recommendation, is this a good approach?
Comment: Why not to log it synchronously?
Comment: The logging is happening in an external system, like Splunk and I don't want my application to wait till it completes and comes back.
Comment: You might better look into the documentation for your logger. It is likely that it can write events in batches, asynchronously, reduceing application latency, so you actually not waiting for each record to be written to the Splunk
Answer: Fire and forget is what we actually did.  The less code you have in the application that is initiating the log message the less code that you have to debug there.
All you actually need to do is write your messages to a logfile(s), and spunk can be configured to process those log(s).  You may want to have a process that queues the log messages and that appends them to the file - this would be useful if there are multiple processes or even multiple threads sharing the same log file, but also having n log files is also an option.
Having done this for splunk in C and C++ it is very straight forward.
Comment: The OP question as stated makes me hope that logging is not used as a substitute for appropriate error handling.


How can I make a child form resize when its MDI parent form is maximized?

Question: I have an MDI form with child form.
I keep the MDI form in normal by default.
When I maximize the MDI, the child form is not maximized within it.
What do I need to do to make it resize along with its parent?
Answer: use a custom event - when the parent changes window state to maximized, it raises the event; child forms attach to the event and maximize themselves
of course this begs the question of "why would you want to do this?" since only the last child to maximize itself will be visible...


Can I install MacOS and Windows 10 on the same external SSD without an internal drive?

Question: I have a MacBook Pro 13' 2017 with 250GB of storage. The internal SSD has died unfortunately. Occasionally, it will show up and be able to boot from it but leaving the MacBook on sleep for more than an hour or so makes it crash and it refuses to boot then.
So, I've since installed MacOS on my external SSD (Samsung T7 Touch 500GB) which works fine. Now, I'd like to also install Windows 10 on that same drive but I'm unsure how I would do that or if it's even possible.
The first problem that I encounter, for example, would be that Bootcamp tells me to unplug all external devices before I can run it, which of course I can't because that's where I have my MacOS installed.
I've seen this question but I'm not sure how I would go about setting up my partitions as described in one answer.
Comment: To post a command to setup the partitions, you should first post the output from `diskutil list` while booted to macOS from the external drive. Preferably when the internal drive shows up. Also, knowing the version of macOS might be useful.
Answer: Running macOS from external drives is easy and supported by Apple in firmware, software and testing.
Running Windows on an external drive via boot camp is the opposite. It is not so easy or vendor documented / supported / tested by Apple.
That being said, it's a very common request, so here is that thread of some awesome custom setups to attempt this in your case if you want to give it a shot.

Is it possible to use Boot Camp with Windows 10 from an external HDD?
Answer: Be aware, the internal drive is needed to do firmware updates. Currently, firmware updates are included in with certain versions of macOS. This would mean you could end up failing to install a clean version of macOS or have a failure while running a routine update to macOS.

I do not know for sure why the internal drive is needed for firmware updates. On my HP PC, a firmware update is performed by first copying the update file to the FAT32 formatted internal EFI partition, then the firmware is asked to update itself. The firmware then reads the update file from the internal EFI partition. I assume this is also true for Macs, but I do not know for sure.

An exception to have a working internal drive for firmware updates may exist by using an external Thunderbolt 3 drive (such as the Samsung X5). On a 2018 Mac mini, the Samsung X5 shows up as disk0 and the internal drive appears as disk1. Also, both drives appear as NVMe drives.
Otherwise, macOS can be installed on an USB external drive. The Boot Camp assistant can not be used to install Windows on a external drive. Installing windows manually can not be done on an external USB drive by just using the Windows installer GUI. However, Windows 10 can be installed on an external drive by using the Windows 10 CLI. In other words, you can open a Command Prompt window while running the Windows 10 GUI installer and enter commands to install Windows 10 on an internal or external drive.
The basic steps for installing Windows 10 on an external drive are are as follows:

Use MacOS to create space for Windows 10. The diskutil command is usually more reliable than the Disk Utility application.
Use the Boot Camp Assistant to download the Windows Support Software. This contains the Windows 10 drivers.
Use macOS to create the Windows 10 installer. You will need a Windows 10 ISO file. Usually the contents of the ISO file is this placed on an ExFAT formatted flash drive. This flash drive should include a copy of the Windows Support Software.
Boot from the Windows 10 GUI installer on the USB flash drive.
Open a Command Prompt window and install a bootable Windows 10. The three basic commands needed are given below.

diskpart: This command is used to edit and format the partitions.
dism: The command copies the Windows 10 image to the external drive and installs Windows 10 drivers from the Windows Support Software to the Windows store on the external drive.
bcdboot: This command installs the Windows 10 boot files to the EFI partition. Usually, this is the EFI partition on the external drive.

Boot to Windows 10 and follow the instructions.
Run the Setup.exe application included with the Windows Support Software.
Comment: It sounds like this effectively bricks the MacBook, since firmware updates are now not possible.