How do I compute this integral?

Question: I'm wondering how to compute the integral $$ \int_2^3\int_0^\sqrt{3x-x^2}\frac{1}{(x^2+y^2)^{1/2}}\,\mathrm{d}y\mathrm{d}x. $$ Clearly it is too complicated to do it directly, so I'm guessing you have to do some change of variables. But what kind of change? This is not really a sphere, so I don't think that polar coordinates would be so good.
Comment: Please check your upper limit of the inner integral as it should be in $y$.
Answer: You'll actually want to use polar coordinates. Set your first integral to y, square that y, and you should see you can move x to the left-hand side. You can then turn this into your r value for polar coordinates. You'll also note that it's mapping a sphere in the upper-right coordinate (which allows you to pick the theta values). From there it's a rather simple integration. I'll purposely leave the work to you, if you need clarification let me know.
Comment: Also, your dxdy should be dydx due to what your first integration is.
Comment: I'm not sure I got it. You means that since $y$ ranges in the interval $0\leq y\leq\sqrt{3x-x^2}$, we can square it and rewrite it as $(x-\frac{3}{2})^2+y^2\leq\frac{9}{4}$. But what do you do to transform the integralen then? I don't really get it
Comment: write the equation of the circle in polar $r=3\cos  \theta $. draw the region of integration, it extends from the straight line $x=2$ ( $r \cos  \theta  =2$ in polar) to the circle
Comment: As Lozenges said, what you'll do is square y, to get $x^2+y^2=3x$, which becomes $r=3cosx$. So that, to zero, is your limit of integration for r. Since this corresponds to a semi-circle ONLY in the upper right quadrant (where x and y are both positive) you can let theta be $pi/2$ to 0. Those are your limits of integration.
Answer: Starting with the integral
\begin{equation*}
\int \frac{1}{\sqrt{x^2+y^2}}dx
\end{equation*}
Use the substitution $x=y\tan(u),~dx=y\sec^2(u)du.$ The integral becomes
\begin{equation*}
y\int \frac{\sec(u)}{y}du=\int\sec(u)du=\int \frac{\sec^2(u)+\tan(u)\sec(u)}{\tan(u)+\sec(u)}du.
\end{equation*}
Use the substitution $s=\tan(u)+\sec(u):$
\begin{equation*}
\int \frac{1}{s}ds=\log(s).
\end{equation*}
Substituting back again and using $\sec(\tan^{-1}(z))\sqrt{z^2+1}$ and $\tan(\tan^{-1}(z))=z$ we get
\begin{equation*}
\log(\sqrt{x^2+y^2}+x).
\end{equation*}
Can you finish the rest of the integration?
Answer: in polar coordinates, the integral is equivalent to
$$\int _0^{\arctan \left(\left.\sqrt{2}\right/2\right)}\int _{2 \sec  \theta }^{3\cos  \theta }drd\theta =$$
$$\int_0^{\arctan \left(\left.\sqrt{2}\right/2\right)} (3\cos  \theta -2 \sec  \theta ) \, d\theta =$$
$$\sqrt{3}-\ln \left(2+\sqrt{3}\right)$$
$r$ goes from the straight line $r=2 sec  \theta $ to the circle.

How do I compute this integral?


Using electromagnetic induction to fire a neuron

Question: In order to make a neuron fire via an external electrode, the electrode must input some electrons in the extracellular space(just outside of the neuron). Imagine a straight conducting wire touching a neuron and other end free in the air. If you move a strong magnet near the wire, such that the wire cuts the magnetic flux, then voltage will be generated at the two ends of the wire. In this case will the neuron fire? or equivalently, will there be flow of electrons to the neuron? Note that the wire is in open circuit i.e. other end is in the air. If there will not be any flow of electrons, can some simple modification on this setup will make it happen?
Answer: Your goal is to move the electrons in a neuron with a magnetic field. If we assume a homogeneous magnetic field $\mathbf{B}$, then this will generate an electrodynamic force
$$\mathbf{F}=q\mathbf{v}\times\mathbf{B},$$
that acts on a charge $q$ which moves with the velocity $\mathbf{v}$.
If we move the magnet from orthogonal to the direction of the neuron-axis, then this is equivalent to moving the electors in the reverse orthogonal direction.
Let us assume that $\mathbf{v}=-v\mathbf{e}_y$ points in the negative $y$-direction. The magnetic field is pointing in the negative $z$-direction $\mathbf{B}=-B\mathbf{e}_z$ and we look at one electron with the charge $q=-1.609\cdot 10^{-19} \text{C}$. Then using $\mathbf{F}=q\mathbf{v}\times\mathbf{B}=-qvB\mathbf{e}_x$ (see picture).
The problem is that your electron will try to stay on a circular trajectory with radius $r$. This is obvious because your force is orthogonal to your velocity. The radius can be determined by assuming an equilibrium of the electrodynamic force and the centripetal force (both with magnitudes).
$$qvB=m\frac{v^2}{r}$$
If you would rotate the neuron-axis according to this knowledge, then you can move the electron from one side to the other side. But it is quite complicated compared to a standard electric field. Another more theoretical way would be to use a very small magnetic field so that the radius becomes very large, but that will lead to very slow accelerations because $\mathbf{F}$, will be very small.


How much information can a single taproot output hold?

Question: Does taproot make OP_RETURN obsolete? How much information can I stuff into an output? A tapscript leaf? Is there a max depth to the tapscript tree?
Answer: I think your question is confusing two things:

Commitments to data: using the blockchain as proof that some data existed before some point in time
Publishing data: making everyone actually see the data.

There are fundamentally different goals, and what you need depends on the purpose:

In case you want to timestamp something, a commitment is sufficient. A commitment can be achieved using a transaction with an OP_RETURN that contains a hash of the data, but there are many other, and more private, approaches. For example, it is possible to create a completely ordinary ECDSA signature on-chain, for a normal transaction that actually moves money, to an address that wasn't in any way specially designed for this purpose, which in fact "mixes in" some additional data. The signature cannot be distinguished from a normal signature, but together with an external proof, is evidence that this signature could not have been made without using said data. This approach is called sign-to-contract.
Commitments are not sufficient if you want to use a transaction to convey information to the recipient, like a message. This is a bad idea for several reasons, but ignoring that: if you'd use a commitment like sign-to-contract here, the recipient wouldn't know a message existed. You'd need to give them the message and the proof the transaction commits to it out of band, and if you need to communicate with them out of band, you could just give them the message directly there.
Commitments also do not prevent you for example from committing to two "conflicting" pieces of information. For example keybase.io periodically publishes a hash of their entire database on the Bitcoin blockchain. Even though it is only a hash, a commitment would not suffice, as the entire point is making allowing users to verify that keybase.io is providing the same database for everyone. With just a commitment, they could maintain two distinct trees, and reveal one to some users, and the other to other users.

Mechanisms for publishing include OP_RETURN outputs in transactions, or stuffing things in the keys raw multisig outputs, or stuffing data in witnesses (by using a script with an OP_DROP for example). Mechanisms for commitments include storing a hash using a publishing mechanism, but also the aforementioned sign-to-contract (which commits to data in signatures) or pay-to-contract (which commits to data in public keys).
Now back to your question: taproot does not help in either case. Yes, the taproot script Merkle tree means you can commit to lots of pieces of data, but you can already do that: just compute a Merkle root yourself of these pieces of data, and then commit/store that root. It also doesn't help with publishing, because the leaves are not published on output (only the tweaked public key is). You could reveal data when spending a P2TR output (by having the data in a leaf, and then spending through that leaf), but that doesn't let you do anything that isn't already possible with P2WSH.
Lastly, the script tree in taproot is limited to max 128 levels, but this doesn't affect the rest of what you're asking about.
Answer: I don't see how P2TR would benefit OP_RETURN applications at all. The scripts in the leaf are only published on spending which doesn't happen for NULLDATA outputs at all.


Quantum eraser without the quantum eraser

Question: I've recently watched PBS SpaceTime's video about the quantum eraser. In it, Matt describes a kind of crystal that splits particles into pairs and entangles them. The entangled particles are then delivered into the quantum eraser part of things. My question is, if we remove all the detectors and half-silvered mirrors and whatnot and let the other entangled particle fly off into space, undisturbed and undetected, would an interference pattern still emerge since we would not obtain the path information?
Answer: No, an interference pattern will not appear.
The key criterion whenever which-way information is involved is whether the information is available in principle, regardless of whether we detect it or not. The presence of the half-silvered mirrors and the detectors A and B (in PBS Space Time's notation) is irrelevant: the photon flying away is entangled with the photon that hit the screen, and in that entanglement it carries the which-way information of what slit both went through.
The only way to restore the interference pattern is to completely erase the which-way information, in a way that makes the reconstruction of which slit the photons went through impossible even in principle. The standard way of doing it is the one explained in the video (i.e. by making a coherent measurement between the two options, and then post-selecting out on the both outcomes, which will separate out the two overlapping complementary interference patterns on the screen), but in general the procedure needs to be coherent, it needs to perform a nontrivial projective measurement on the existing which-way information, and it needs to do a correlated post-selection to get anything meaningful.
If you don't do any of that (say, if you just let the which-way information fly away) then the interference pattern won't come back.
Comment: So, the photons hitting the screen will act like particles while their which-way information is in principle obtainable. So, in the original experiment, one entangled photon is set to hit the screen and another is set to interact with the eraser *after* the first had already hit the screen. In that brief time between the first photon hitting the screen and the second hitting the eraser, is an interference pattern not present? (Because the which-way information is still at large and in principle obtainable.)
Comment: Interference patterns are *never* present unless you post-select out the hits in correlation with the quantum eraser measurements.
Comment: @EmilioPisanty Sorry this is coming much later, but I hope you'll see it. You say that "in that entanglement it carries the which-way information of what slit both went through." What is it about the crystal that gives which-way information? And does that mean that this Fermilab video (https://www.youtube.com/watch?v=l8gQ5GNk16s) is wrong when it says "If [the detectors] are turned off, you see a wave pattern"? And, if so, how is turning off the detectors allowing the which-way information to be able to be recovered? Thanks again if you see this.
Answer: There is quite some confusion about this experiment, which is fed by some simplified explanations on youtube. The experiment can be quite easily understood if you let go of the idea that a photon behaves as a particle. A photon behaves as a wave package, consisting of a quantizised wave or superposition of waves. This is what QM tells us. Then 'which-way' is no valid property any longer; the photon always moves through both slits. It is only reduced to a single location at the point of measurement. See my video for detailed explanation of the experiment: https://m.youtube.com/watch?v=e-uopGrghFQ


Multiple base map in Qfield?

Question: Is it possible to load 2 base maps in Qfield (both of the 2 rasters are in geopackage format), and choose wich one I want to see and maybe switch during the field work ? I tried with the map themes but it does'nt seems to work with rasters.
Answer: It seems that I found the solution here: No sync geopackage raster layer to QFIELD  ! Even if I checked the option "relative path" in the project properties in QGIS, it seems that QFIELDSync still exported my project.qgs with absolute paths for rasters.
I try to explain how I did it: I opened my "project.qgs" directly in the mobile folder with notepad, and changed all the paths coresponding to my computer folders with the paths of my mobile folders (replace by "./raster.gpkg").
At this time it work for me !
Answer: You can configure Map themes in your project in QGIS and then using it in qfield.
Comment: Hi and welcome to GIS.SE! Could you please add more details to your answer so that other users can benefit from it too?
Comment: Thank you for your answer. I already tried it. It works with vector layers, but I would like to be able to switch between different background layers (for exemple photos, or maps). In the map themes, only the vectors are visible. Anyone have the same issue ?

Multiple base map in Qfield?


Why does white light have less energy than blue light?

Question: I remember seeing an experiment where Chris Bishop from the Royal Institution activates a mixture of hydrogen gas and chlorine gas using blue light. However, the blue light was in fact from white light passing through a blue filter. Since blue light is only a component of the white light's spectrum, how does the energy level increase with the blue light? I.e., why wouldn't the white light create enough energy to activate the mixture of gases?
Comment: @Floris https://www.youtube.com/watch?v=uFQdcKJUijQ around 22:04
Comment: "Taking something away" should not normally make that which is left more energetic. I wonder if you remember all the details of the experiment you saw correctly. Do you have any reference / link?
Comment: Does he actually shine the unfiltered white light on to the gas? It doesn't seem so.
Comment: I found a very old (1863) reference to the "power of blue rays" for initiating a reaction between hydrogen gas and chlorine gas, where"red rays" had no such effect. But that's different than your proposed experiment in which removing the red light makes the blue light better able to start a chemical reaction...
Answer: The experiment showed that red, yellow and green light did not provide the energy needed. It was the absence of blue photons that meant the activation energy was not being supplied.
Once you admit blue photons, an individual photon carries enough energy to provide the activation energy, and start the reaction. Since the reaction is exothermal, once you have started, it will "run away".
This is not unlike the early experiments regarding the photoelectric effect: intense light of insufficient energy per photon (long wavelengths) does not free electrons from the cathode; but a low intensity of blue light does.
This is a good demonstration of the fact that light is quantized - that it's the energy of the individual photons that matters, more than the total energy of the entire beam of light.
Incidentally - where it looks like he is shining white light on the sample (although he says "red light"), you are actually seeing the effect of saturation of the sensor. The projected beam clearly shows this.
Comment: Yes I think it would.
Comment: So, white light by itself would have detonated the charge?


How to stop iTunes from warning me about sync-ing notes

Question: When I sync my iPhone with my iMac (via iTunes, which is obvious, iGuess) I often get a warning message that I've changed more than 5% of my notes.  This would be fine if it did not stop the sync from proceeding.  But it does, so it's not fine.  All I can find in the docs is how to address this via iSync, nothing about iTunes.  (When I try to start iSync, I get iTunes.)  Any advice would be appreciated.  Thanks.
Comment: can the tag change from lotus-notes to just notes... since it's not about lotus-notes?
Answer: Here's how to disable that warning in iTunes for Windows:

Edit->Preferences
Devices tab
Uncheck "Warn when [more than 5%   v] of the data on this computer will be changed
Click OK
Resync
Comment: I'm using Mac OS X.  I cannot find that check box in the Devices section (or any section) of the iTunes Preferences dialog.  Excellent answer for Windows though (+1), and a fine edition to the now-growing knowledge base.
Comment: Hm, ok, sorry about that, didn't notice the Mac reference there. You have of course updated to latest iTunes version? Not that I know if this will matter though.
Answer: On Mac OS X, you need to open iSync, then open its preferences. Uncheck the 'Show Data Change Alert' checkbox.
Comment: But isync doesn't exist anymore on OS X.
Comment: I apologise for being unable to see into the future. Obviously I should I have anticipated iSync being discontinued when I wrote this answer in 2009.
Answer: I was able to start iSync via Spotlight.  Accessing the iSync->Preferences menu item gives me the following window:

Try unchecking that item and resyncing.


What does f(-5)=-2 tell me about f(x)

Question: As part of a math quiz I was given the following two functions:
f(-5) = -2 and g(x) = -2 * f(x)
The way I interpret the first function is "return -2 regardless of the input" since the right hand side is just a constant.  That would mean that f(x) will also result in -2, making the result of g(x) positive 4.
But I guess I'm missing something because that is not one of the available answers in the quiz.

Edit:
Apologies for the unclear question.
The full question in the quiz is as follows:

If $f(−5) = −2$ and $g(x) = −2 \cdot f(x)$, what point can you determine on the graph of $g$?

I realize now my interpretation was wrong.  Like André said in the comment: I only know the output (-2) of a given input (-5).  Knowing how to read the function f helped me solve the question, thanks guys.
Comment: What is your question?
Comment: The interpretation of the function $f$ is not right. All the equation says is "return $-2$ on input $-5$." It says nothing about what to return for other inputs.
Comment: You were given the functions, but what question about the functions did they pose?  It is true that $g(-5)=4$ but that doesn't mean that $g(x)=4$.
Answer: You miss understand.
$f$ is a function, say $f$ is $f(x)$. For example consider $f(x)=x+3$,
then $$f(-5)=-5+3=-2$$ but $f$ is not identically $-2$ because for
example $f(0)=3$.
Now, $g(x)=-2f(x)$, for what $x$ can you compute $g(x)$ ?
Comment: Thanks for the nice explanation.
Comment: I think the correct word is "misunderstand" and not "miss understand" (who is the daughter of Mr. and Mrs. Understand :-P).

What does f(-5)=-2 tell me about f(x)


Vulnerability of Java software

Question: The JAVA software provided by Oracle is a security mess.  But what exactly, in that software package is the most vulnerable. If someone install it and disables the Java plugin in the browser, will he still be vulnerable?
Comment: "The JAVA software provided by Oracle is a security mess" [citation needed]
Answer: The most problematic part with Java is that it offers a way to sandbox code for restricted execution but that this protection could often be bypassed in the past. Thus the main problem is the use of Java in scenarios where this sandbox gets used, which is mainly in the browser. When used instead with standalone applications and not applets the security of Java is similar to that of other programming languages which mostly don't even offer such sandbox facility.
If you make sure that Java is not usable as a plugin by any browser on your system it is as safe to use as other languages, i.e.  similar to applications written in C/C++/C#/whatever these standalone Java applications will have full access to everything your user account has. This means you have to still watch out where you get your application from and what it does, but you don't have to take special precautions just because this is a Java application.
For further information you might look at the discussion Why do I hear about so many Java insecurities? Are other languages more secure?.
Comment: What about the JDK(Java Development Environment)?Is it a standalone component?
Comment: @MayankSingh: from my understanding the JDK contains the JRE and the JRE contains the plugin. Thus JDK contains the plugin too.

Vulnerability of Java software


Level-triggered mono-stable multi-vibrator running at 12+ volts.

Question: I need a CMOS (preferably dual) level-triggered mono-stable multi-vibrator that runs at least 12V (better at 15~18VDC), perhaps in the CD4000 family. Everything I have found is edge-triggered only or is in the TTL families which won't operate at the voltages I need. Even an edge-triggered with set pin (instead of reset pin) will do as long as it stays in the pulse while the set pin is held active. The circuit must be continuously retriggered by holding the set pin active. The problem with edge-triggered here is that, if the trigger value never returns back to its idle state, the pulse will complete and no edge will come to retrigger it. A power transistor will turn back on and will go up in smoke. This is for a circuit to protect against shorts.
Comment: Can you post a schematic of the circuitry you want to protect?
Comment: NOR gate controls whether T0 is on or off. All 3 inputs must be low in order for Ctl0 to go high. R30=current sensing resistor, U10A=comparator. When too much current going through T0 then voltage will be higher than ref. Output of comparator will go high which triggers one-shot U11A. While Pulse0 is being generated, T0 will be off. The pulse is 1ms. Should be enough to cool off circuit and allow "try" again. Nets externally connected to load are 12V and Gnd0. T0 used to pull pwr thru load by shorting its Gnd pin to supply shown as a ground symbol bottom left. Don't know how to post picture.
Comment: Zeros are shown on this website to look too much like lower case 'o's. So in my explanation above, Pulse0 (PulseZero) looks like Pulseo. This is very misleading.
Answer: The CD4538 (now CD14538) or the CD4047?  Here's a digikey link with some serious filters.
Or maybe a Cmos 555?
Comment: @PaulMcKneely Digi-Key dropped their $25 minimum order requirement a few years ago, probably in response to Mouser.
Comment: Have already looked at CD4047 and CD1438 which only have edge-triggering. Already using a 2-input CMOS OR gate to combine the PWM signal with the pulse from a CD14538 to inhibit power on. Have solved problem another way by replacing 2-input OR Gate with a 3-input OR Gate and added the trigger clock signal to the 3rd input on the OR gate. Now the output of the OR Gate will only go low if all three conditions are met. This was a fairly simple solution since I was already using a 2-input OR gate but I lose one gate from the device because of the additional pins. Just have to use more packages.
Comment: I like Digikey but I am trying to fill my whole order using Mouser since I am in Texas and they have no minimum order. The 555 was tempting but I need to repeat the circuit 20 times and the 555 requires so many extra components that it would be getting too complicated. I wanted to increase integration to minimize board space as well as complexity of assembly. Thanks for the input.


Same origin policy implementation in Google Chrome

Question: I would like to know how and in which code module the Same Origin Policy for JavaScript is implemented in Google Chrome (V8). In Mozilla Firefox, the JS Engine (SpiderMonkey) has the provision of registering callback functions that implement the Same Origin Policy check. Specifically, this is done in the caps/nsScriptSecurityManager module, which walks the JavaScript runtime stack to find the appropriate principals. In V8's documentation, there is a small hint that V8 has "JavaScript Contexts" and each context has "different origins". Can anyone please point me to the specific code modules where these access checks are implemented in Chrome? I am trying to figure out how Google Chrome extensions leverage the Same Origin Policy.
Answer: I filed a bug report on a Chrome bug in CORS and was told, in response, that all the code lives in webkit.


Do Robo Monkeys do more damage than Sun Gods?

Question: Disregarding the Robo Monkey's ability upgrade, does it do more raw damage than Sun God monkeys?
Answer: It's a bit hard to compute, but I'll try my best.
According to multiple sources, a single sun ray from the Sun God will pop 15 balloons.  The Sun God fires 3 streams total.
The Robo Monkey can pop a total of 7 balloons per shot, and shoots twice at the same time.
However, the sunrays diverge somewhat and have a tougher time hitting individual MOAB-class balloons.  They also fire at half the rate of the Robo Monkey's streams.
The Sun God's streams do pierce, however, making them better at clearing out large swaths of balloons at once.
There's a lot of back and forth there, but I'd say the real advantage of the Sun God that makes me pick it almost every time over the Robo Monkey is the ability to turn it into a temple, which makes it obscenely powerful and leaves room for more towers to be placed.
Comment: Suppose you are choosing what to place next to a temple? Would you mix in some robos, so you can do a better job on MOABS, also, for those, only robos can be upgraded to tier 4?
Answer: I think sun god because it has a bigger damage, shoots three sun rays and you can turn into a temple you can't stop that.
Answer: I'd rather do sun avatar because the next upgrade is OP.
A sun temple is better than 2 sun avatars. It has two airplanes surrounding the temple.
Splash: Yes, Camo: Haven't tried yet but use the monkey village, Single Target: Yep, Fire Rate: Faster than a fortnight SMG
Answer: I would choose the robo-monkey since it is much cheaper and sun temple is almost equivalent to the cost of 4 tech terrors. Also if sun temple needs a LOT of sacrifices to be OP, I would choose several tech terrors to avoid not placing anything just to save up to the sun temple. Also since the robo monkeys are good at destroying MOABS and is much cheaper than sun god, I would say the robo monkey is stronger in earlier game I guess.
Answer: IMO, robo monkey and sun god are almost the same. They are better at different stages. Robo monkey is good for farming, for single target damage. Sun god is better late-game, when you are doing temples. I get one sun god when farming, to help with bloons if needed.
Comment: Welcome to Arqade! This answer appears to have some good information about which is better strategically, but it doesn't appear to answer the question posed (which does more raw damage).
Answer: As a rank 67
Sun God
Fires three streams a little under every second.
Sun rays are able to pierce and spread out as they go farther off the screen.
(Pierce means destroy more than 1 bloon layer at once.)
Camo:  No. Great on regenerating bloons.
Splash Damage: Yes.
Single target: Not so great.
Moab-class: Okay.

Robo Monkey
Instead of shooting one constant beam like a normal super monkey, has 2 guns that can shoot independently from each other. Guns shoot whatever upgrade you have(lasers, plasma, darts.)
Camo: Again, no. Great on regenerating bloons.
Splash Damage: Not really...
Single target: Definitely. Totally anti-moab.
Here is a little trivia, just to get your mind going.
-A sun god has more popping power than an unmodified temple(although temple has camo detection)due to the fact sun gods fire three rays a little under every second and temples shoot 1 huge wave a little under every 3 seconds(in non fast foward)
-a robo monkey with no path 1 upgrades surprisingly can destroy leads with ease, although a normal super monkey with only darts cannot even dent leads.
-robo monkeys are a reference to the 1987 film robo-cop.
-laser monkeys cannot destroy leads.
Here is my final answer:
sun gods will clear bloons with ease, so sun gods are better for taking out massive waves of bloons, however;
robo monkeys are better against moab-class bloons, due to the fact they are better-suited for single target combat.
So, you should definitely get a balance between the two tier 3s. Here is the ratio I use:
5:1(for every 5th robo monkey I get 1 sun god)
Comment: Pierce does not mean destroying more than one layer at once.  That would be popping power.  Pierce means hitting more than one bloon.  A "standard" projectile hits one bloon and stops.  Weapons with pierce can pierce through the first bloon and hit additional bloons behind it.
Answer: Robo Monkeys can dent several BFBS to nothing while the Sun God leaves some of them laying around into cermaics or zebras. A robo monkey can dent a ZOMG much better than the Sun God. The Robo Monkey is 3/5 the cost of Sun Gods, so you can have several robo monkeys instead of getting a few Sun Gods.


Kangxi input only letting me type two keys before moving on? E.g I type RMMR for m4, but it gives me 叼可 instead?

Question: This is presumably a simple issue with my keyboard usage. A dropdown for characters is offered after typing RM, but I should be able to type RMMR and have it know I mean m4, right? I am using Traditional HONG KONG SAR keyboard layout on Windows 10.
Answer: The problem is you want to use Changjie 倉頡, but you are using Quick 速成 instead. Just go to the language settings and add the 倉頡 back should work.


ActivePerl on Windows/Apache performance problems

Question: I would like to ask you for help. In our company, we have installed Bugzilla 4.0 on Windows machine. For running perl, we are currently using ActivePerl.The problem is, that we have around 50 users periodically querying the Bugzilla web service and server can't take this load. We have found out, that it is caused by perl.exe, which is being ran during every request. Server workload (CPUs) are on 90% during peaks.Have you ever experienced this problems? Is any possible configuration, we can make, to improve the performance?
We are using: Apache 2.2.17 and ActivePerl 5.8.9 b829.
Thank you very much in advance, it causes us (especially me) a lot of trouble.
Comment: http://stackoverflow.com/questions/6003442/bugzilla-performance-slow
Answer: This is a fairly common issue as sites grow.  And it's not specifically limited to Perl either.  There are solutions.  As one person mentioned, there is mod_perl, which is essentially installed as an Apache module.  It can be used in a sort of simple version via Apache::Registry, or you can go all the way by writing components that interact with the Apache API at each request phase.  Whatever approach you take with mod_perl, there are a few common notes:  It is a persistent process, meaning (in simple terms), Perl stays resident from one request to the next, to the next, so that you eliminate startup costs.  CGI scripts often cannot be ported directly to mod_perl without some amount of cleanup and refactoring.  Since the script runs in a persistent environment, global variables don't reset themselves between requests, for example.  There's a whole list of 'gotchas' to overcome.  To that end, Apache::Registry is somewhat easier to deal with in a mod_perl environment, at the expense of not providing 100% of the performance horsepower that programming for the API directly can provide.  Nevertheless, it's a pretty good compromise.
Another option would be FastCGI, which you can read about at the FastCGI website.
Well written CGI scripts can be ported to mod_perl or to FastCGI with some effort.  These are probably the least painful approaches, for that reason.  Some scripts can be converted with very little cleanup.  Others may require a lot of work, but should be still possible.
Luckily there is a plethora of useful modules on CPAN to assist you in using mod_perl, or FastCGI.  Under the Apache::* hierarchy on CPAN, for instance, you'll find many tools that are designed to work with mod_perl.  With respect to FastCGI, you'll even find Catalyst and Mojolicious-related modules to help meld the two, though those last two suggestions would probably require some real refactoring.
I found Practical mod_perl to be helpful as a starting point (an O'Reilly book).
Answer: Food for thought: mod_perl


Can I remotely trigger a SUNPAC NE-i flash (dedicated for Nikon DSLR's) using a FlashPoint wireless transmitter & receiver?

Question: I use Nikon D850 with other FlashPoint flashes. I have this older Sunpak NE-i that I used with a Nikon D200. Wondering if anyone has any experience triggering these with wireless remote like Flashpoint R2 i-TTL 2.4G Wireless Receiver For Nikon Flashes?
Answer: Provided the triggering voltage of the Sunpak NE-i does not exceed the capacity of the Flashpoint (Godox) receiver to tolerate voltage, it should work in any mode for which the flash is capable when used directly on the camera's hot shoe. With two different third party products from two different makers, should doesn't always happen, though. At the very least, you almost certainly could fire the flash in sync with the camera's shutter using manual power mode.


Looking for more information on a Wuxia novel term (返老還童)

Question: I have come across this term (返老還童) in a few of the manhwas and novels that I have been reading, and each work translates it to a different name and the rules are all a bit different. I know generally that this is meant to be "Returning to Youth" or "Returning to Origin" and it is when an elderly martial artist achieves enlightenment and returns to a younger state. I'd love to find the original work that this comes from or a foundation of rules or naming conventions for this concept. Does anyone know where I can read more about this topic?
Comment: https://dict-idioms-moe-edu-tw.translate.goog/idiomView.jsp?ID=885&webMd=2&_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp
Comment: Google Translate likes "rejuvenation" for this, and idents it as Traditional Chinese.
Answer: The oldest novel I know that used that term was by Jin Yong, a wuxia author.
He is the one who started the wuxia era in Chinese novels. His work existed pre-"Jade Dynasty", the one that started the xian xia novels and which many books got inspired by.
The main character described like that is 天山同老. 100-year-old grandmaster, but is in the body of an 8-year-old girl. The term was used at that time to describe some figures who looked very young while their actual age was much older than they looked.
The book was published in 1963 and called Demi-Gods and Semi-Devils, or 天龍八]部.


What's the Derivative?

Question: What is the derivative (gradient) of $$\operatorname{vec}(W)^\top
\left[\sum_i (ue_i^\top)\otimes(e_ie_i^\top) + \sum_j(e_je_j^\top)\otimes(ue_j^\top) - 2I\otimes I\right]
\operatorname{vec}(FF^\top),\tag{3}
$$ where $e_i$ denotes the $i$-th vector in the canonical basis and $u=\sum_ie_i=(1,1,\ldots,1)^\top$
where "$\otimes$" denotes the Kronecker product (tensor product) with respect to the rectangular matrix $F$? and $W$ is a constant matrix. The above term can also be simplified as $\sum_{ijl}(F_{il}-F_{jl})^2W_{ij}$ which is a much simpler expression. What would the derivative be? All the above entries are real while $F$ is a rectangular matrix. Also please refer to : Represent in a matrix form: $\sum_{ijl}(F_{il}-F_{jl})^2W_{ij}$ for the details on simplification/algebra.
Comment: The whole left side of the expression is independent of $F$, so all you need to do is calculate the vector derivative of $\mathrm{vec}(FF^T)$.
Comment: Considering the expression on the left to be $C$, the derivative of $CFF^T$ would be $(C+C^T)F$, I guess? Now with $C\operatorname{vec}(FF^T)$, am confused..
Answer: To find the derivative, it is much easier to work with your original expression $S=\sum_{ijl}(F_{il}-F_{jl})^2W_{ij}$. Note that, for fixed indices $I$ and $J$,
\begin{align*}
S = &\text{ terms that do not involve } F_{IJ}\\
&+\ (F_{IJ} - F_{IJ})^2 W_{II}
+ \sum_{j\neq I} (F_{IJ} - F_{jJ})^2 W_{Ij}
+ \sum_{i\neq I} (F_{iJ} - F_{IJ})^2 W_{iI}\\
= &\text{ terms that do not involve } F_{IJ}\\
&+\ \sum_{k\neq I} (F_{IJ} - F_{kJ})^2 W_{Ik}
+ \sum_{k\neq I} (F_{kJ} - F_{IJ})^2 W_{kI}.
\end{align*}
Let $K = W-W^T$. Then
\begin{align*}
\frac{\partial S}{\partial F_{IJ}}
=&2\sum_{k\neq I} (F_{IJ} - F_{kJ}) W_{Ik}
+ 2\sum_{k\neq I} (F_{kJ} - F_{IJ}) W_{kI}\\
=&2\sum_{k\neq I} (F_{IJ} - F_{kJ}) (W_{Ik}-W_{kI})\\
=&2\sum_{k\neq I} (F_{IJ} - F_{kJ}) K_{Ik}\\
=&2\sum_k (F_{IJ} - F_{kJ}) K_{Ik}\\
=&2F_{IJ}\sum_k K_{Ik} - 2\sum_k K_{Ik}F_{kJ}.
\end{align*}
Therefore
$$
\left(\frac{\partial S}{\partial F_{ij}}\right)
=2F\circ(KE) - 2KF
$$
where $E$ is the matrix with the same size as $F$ and all entries equal to $1$.
Comment: Wonderful answer!
Comment: also that's the Hadamard Product between $F$ and $KE$. Right?
Comment: @user75402 Yes, it's the Hadamard product.
Comment: There is a sign error in the second term of the derivative.  The derivative of $(F_{kJ}-F_{IJ})^2$ with respect to $F_{IJ}$ is $-2\,(F_{kJ}-F_{IJ})$.  However, the form of the final result is correct, if you redefine $K=W+W^T$.

What's the Derivative?


Preventing windows 10 from being installed

Question: I have windows 7 and do NOT want windows 10. I have the windows logo in my tray and have removed it twice. It always comes back.
   What I want is a SIMPLE way to prevent windows 10 from being installed on my computer. Any help appreciated.
Answer: The german Webseite heise provided a small script hat you can run.
Extract the 1516-159.zip and run the NoGWX.cmd as admin. It removes the Update KB3035583 and sets the value DisableOSUpgrade to 1 to prevent an Upgrade to Windows 10.
Comment: Alternative utility in English found [via this article](http://www.howtogeek.com/228551/how-to-stop-windows-7-or-8-from-downloading-windows-10-automatically/): [GWX control panel](http://ultimateoutsider.com/downloads/) also has this function under "Are Windows Updates OS upgrades enabled?"
Answer: If you just want to get ride of the tray icon, open Task Manager and end process for GWX.exe. Then, go to C:/Windows/System32 and right-click on the GWX folder and go to Properties > Security > Advanced. Here, change the owner from TrustedInstaller to Everyone or Users or Administrators. Click OK to close the Windows and you can now delete the entire GWX folder.
Windows 10 shows up as an optional update, so even with automatic updates enabled, it shouldn't install without your permission.
Answer: The update that installs this Windows 10 ad is called KB3035583
Go to Control Panel, and then Windows Update. Check in the bottom left corner for a link to Installed Updates. Look down the list for a Windows patch named KB3035583, which can be uninstalled by right-clicking on the entry and selecting Uninstall. Windows being Windows, you will then be prompted to completely restart your computer. But once you do, the Windows 10 icon should be absent from your Taskbar's notification area.
You will need to turn off Automatic Updates to not have it installed again on its own.


What was the last rocket-plane?

Question: Starting with the legendary Heinkel He 176, these unorthodox planes broke the sound barrier and other records. My question is: What was the last rocket plane to be produced?
Comment: Yeah, or the Opel glider, launched by firework-type rocket motors.
Comment: Google for Oper-Sander or Julius Hatry RAK.1 and you will be able to shift the birth of rocket planes quite a bit forward from the He-176.
Comment: It would depend on just where you draw the line between "plane" and "spaceship". Answers could be the Rocket Racing LEague's "Rocket Racer", or Virgin Galactic's "SpaceShipTwo" or even if you want to push it SPaceX's StarShip, if you accept a definition of plane that fits "flies and lands using active aerodynamic support"
Answer: Spaceship Two https://en.wikipedia.org/wiki/SpaceShipTwo currently flying (at least as of July 2021: https://www.theverge.com/2021/9/29/22701195/faa-virgin-galactic-spaceshiptwo-cleared-investigation )
Comment: D'oh!  I forgot about Virgin Galactic!  Didn't they fly paying passengers (or at least non-employees) just days before New Shepard's first human-carrying flight?
Comment: @ZeissIkon they did. Not sure I'd call it an rocket aircraft rather than a winged rocket but that's semantics.
Comment: It glides when the rocket is shut down, and briefly before ignition, just like the X-15 did -- but it's more advanced in many ways (though designed mainly for altitude rather than speed).  To my eye, it's an airplane with a big rocket engine.
Comment: @Zeiss Ikon: Though wasn't the X-15 primarily designed for altitude?  At least that's what I remember: several military X-15 pilots getting "astronaut wings" because of the altitude they reached: https://www.spaceline.org/united-states-manned-space-flight/us-astronaut-selection-drafts-and-qualifications/x-15-astronauts/
Comment: X-15 was designed *both* for altitude and speed -- and there's no way Spaceship Two would hold up to the Mach 6 the X-15's record flight obtained (melted some stainless steel parts of the airplane).  Spaceship Two is *only* made to go high and let passengers have maximum microgravity time.
Comment: As much of a space nerd as I am, I can't believe I forgot about spaceplanes!
Answer: Rocket Racer was a one-design air racing class founded in 2005, to be powered by a small ethylox rocket engine.  The airframe was a Velocity (kit plane) with some modifications (Rocket Racing League bought the manufacturer, which has since spun off and is back to producing kits) -- and while it's not a commercial production aircraft, three were built between 2006 and 2008.  At least one demonstration aircraft flew several times, demonstrating (among other things) rapid turn around (a big deal in rocket circles), ground takeoff and sufficient endurance to race, and safe operation.
The racing league that was to have featured these airplanes failed on financial grounds, and production was halted by the other teams that were originally to have founded the league, but these were solely rocket-powered racing aircraft built in the 21st century!

What was the last rocket-plane?


JW FLV Player Javascript event

Question: When a user triggers a Javascript action, I want the JW FLV to seek back 5 seconds from the current location. I know how to send events using player.sendEvent('SEEK',seconds). But I dont know how many seconds to pass as JS does not know the current location. Can someone please help?
http://developer.longtailvideo.com/trac/wiki/FlashEvents#Viewevents.
Answer: 1)You can get the current location as :
getPosition(): Returns the current playback position in seconds, as a number.
2)And then seek to required position as:
seek(position):Jump to the specified position within the currently playing item. Parameters: position:Number: Requested position in seconds.
Also refer this
Answer: Actually you can get the current location with javascript. Here's how:
player.addModelListener('TIME', 'timeMonitor');
var time = null;
function timeMonitor(obj) {
  time = obj.position;
}

The time variable constantly updates, so then just do something like:
function userTriggeredJsAction(){
   var newTime = time - 5;
   player.sendEvent('SEEK',newTime);
}

JW FLV Player Javascript event


Can someone translate this for me?

Question: http://m.imgur.com/i7FcLqc This is from the top of a container my friend found at work. I was wondering if someone could do a quick, easy translation. I tried to draw it in Google translate, but it didn't make any sense.
Answer: 一本萬利 in Traditional characters (as in your image) or 一本万利 in Simplified Chinese, the writing goes from top right to bottom left.
The expression means "small capital, huge gain/profit".
Answer: Yeah, gf agrees 一本万利
一 = 1
本=本钱=starting money
万= a lot
利 = gain
If you believe that, you will believe anything! Money for nothing!

Can someone translate this for me?


Load script only in the admin page

Question: I used the Custom Category Post Order plugin in my Wordpress site. But this plugin load 4 times jquery ui code in. This jQuery ui code generate errors in my own javascript code. Is it posible to load only the jquery ui script in the admin page in wordpress. Of is that not possible.?
Comment: `add_action( 'admin_enqueue_scripts', 'my_function_to_enqueue_scripts' );`
Answer: This is a very poorly coded plugin, and a good writer should know better.
I've grepped through the code and found the process_post method which is hooked into init (why?!) and enqueues jquery-ui-sortable which is probably the code which breaks your code:
function process_post(){
    global $wp_query;
    wp_enqueue_script( 'jquery-ui-sortable', '/wp-includes/js/jquery/ui/jquery.ui.sortable.min.js', array('jquery-ui-core', 'jquery-ui-mouse'), '1.8.20', 1 );
}

and
add_action('init', array($this,'process_post'));

in the constructor.
However the class isn't actually assigned to a variable when defined:
new customcategorypostorder();

And so unfortunately none of the actions can be accessed so you have no option but to modify their code. (Out of interest does anyone know how PHP handles such an instance?) To keep things simple, I'd recommend assigning the class to a variable, and then removing the hook and then re-adding it to just the admin area. To be brutally honest it shouldn't be added to any 'init' hook whatsoever, but it's probably best for compatibility reasons.
Modify last line of plugin into something like this,
$customcategorypostorderinstance = new customcategorypostorder();

And the add this to functions.php,
remove_action('init', array($customcategorypostorderinstance, 'process_post'));
add_action('admin_init', array($customcategorypostorderinstance, 'process_post'));

Hope this helps, and remember to complain to the developer!
Answer: It's very possible, and a good plugin writer should know better.  The solution is not a simple one, and unless you're comfortable editing the plugin, you'll probably want to contact the author of the offending code.
Scribu has a great little tutorial on the proper ways to load javascript located here: http://scribu.net/wordpress/optimal-script-loading.html
And Justin Tadlock does a good admin specific writeup here: http://justintadlock.com/archives/2011/07/12/how-to-load-javascript-in-the-wordpress-admin

Load script only in the admin page


Setting up drupal with docker using two containers? nginx and mariadb

Question: I am trying to get a Drupal local development environment up and running using docker.
The site I am working on is live, running on a digital ocean server. When I access that server (ssh -p 1111 @220.127.116.11)
and run (docker ps) I can see two containers running. One is for the nginx-php5-drupal container that I got from here (https://github.com/bnchdrff/dockerfiles)
The other container is a mariadb container that holds the database for the drupal site.
I have run (docker export) on both of these containers, downloaded them and then set them up as images locally, named (mariadb:local) and (bnchdrff/nginx-php5-drupal:latest) respectively
I then run:
sudo docker run -d --name mariadb mariadb:local /sbin/init
sudo docker run -d -p 80:80 -p 2222:22 --name nginx-php5-drupal-bnchdrff --link mariadb:db bnchdrff/nginx-php5-drupal:latest   /sbin/init
I then attempt to navigate to localhost:80 and/or localhost in my browser...
Nothing appears.
Am I doing this right?
My understanding is patchy as I am new to all of this. I think the best thing for me to do is to restart the whole process from exporting the running containers from the live site to running them locally because I  swapped out the live nginx-php5-drupal container for the old one from the github repo and I think the person who put the site online customised it...
Thanks.
Answer: If you are on a MAC OS you'll need to use the boot2docker ip address.
You can get this by running the following command: boot2docker ip
https://docs.docker.com/installation/mac/


Disable Ctrl+Q shortcut in Eclipse (prevent closing)

Question: In Eclipse, Ctrl+Q shortcut forces application closure. There are no warning messages AND if going to Windows -> Preferences -> Keys, there is nothing bound to Ctrl+Q and even if I bind something, it does not prevent closing.
Comment: I have the same exact problem on the latest Eclipse version (Kepler).
Answer: I tried this trick and it worked for me, (Kepler Version)
Go to Windows -> Preferences -> Keys.
Search for Close, you will see two close shortcuts Ctrl+F4 & Ctrl+W
Select any one Close command & Now Click Copy Command, so you will see another Close Entry with no Key binding.
Click the newly created Close command (that will have no binding now, i.e. Blank in the Binding section). Now in the Binding section, assign Ctrl+Q as your bind. Click Apply. Recheck in Eclipse whether Ctrl+Q is closing your application / opened files. It will close.
Again now go to Windows -> Preferences -> Keys.
Search for Close, and Locate the binding which you have created Close -->   Ctrl+Q. Click that and select the Unbind Command. Press Apply. Now Ctrl+Q will do nothing.
Hope that helps.
Comment: It worked partially: everything like you said caused Eclipse to close, but when I unbinded every single entry found for "Close", I was then able to make `Ctrl+Q` "Close current tab". It is better than closing entire worspace and waiting for background workers to finish their cleanup :) Thanks for the idea.
Answer: The issue is not related to key binding. To fix the issue you must remove Ctrl+Q binding at the following file:

YourWorkspaceRootFolder \ .metadata.plugins\org.eclipse.e4.workbench\workbench.xmi

Remove the line that contains 'keySequence="CTRL+Q"', and Eclipse will never close again when pressing Ctrl+Q.


How do I dispute a moderator's diclination of two of my flags that I raised?

Question: A moderator declined two of my flagged comments and I disagree with this. How should I proceed in getting this reversed?
Answer: You post here (on meta) explaining what you flagged and what the response was, and ask why the decision was made that way and whether it was the right decision.
Of course there is no guarantee the decision will be reversed, but if not, you'll get an explanation on why it was the right decision in the first place.
Answer: You shouldn't set too much store by declined flags. If you look on MSO, it happens relatively often that flags are declined and yet the action gets taken. There's two outcomes that can come out of this sort of thing.

First of all, did the action get taken? If it did, then no worries. If it didn't, what was it? If you were asking for removal of comments, then don't worry too much about it - comments are temporary anyway. If you don't like a comment but it's not offensive or anything, well, shucks.
The only thing a declined flag really does is it slightly affects your flag weight - that is, your total helpful vs. declined flags. This is not something to worry about unless a really large percentage of your flags get declined. This is used by mods as a very rough measure to help gauge the importance of flags.

All in all, there's not all that much to decry about a declined flag.


Converting all css files to scss in angular 2

Question: I have worked on angular 2 project and used angular-cli. I would like to replace all the css files with scss. what would be the easiest way to do it? Or is there a command line that can handle it without having do it manually.
Answer: I just had to do this to an existing project and pieced together a bunch of information from various places, mostly from this similar stackoverflow question.  Here's a set of command line actions (that worked for me on Mac OSX)
# rename all your current files
find . -name "*.css" -exec bash -c 'mv "$1" "${1%.css}".scss' - '{}' \;

# change angular cli config file to include styles.scss instead of styles.css
sed -i -e 's/styles.css/styles.scss/g' .angular-cli.json

# now we need to go thru and fix up all the places where ts files refer to .css files
# there's probably a better way (and will only work if you don't have multiple css files in a component)
# this is what I did
find ./src -name "*.ts" -exec sed -i -e 's/\(.*styleUrls.*\)\.css\(.*\)/\1\.scss\2/g' {} +
rm -r *.ts-e

# fix for future generates styles
ng set defaults.styleExt scss

# Add node-sass npm module

npm install node-sass --save-dev

# or if you are using yarn, like me:

yarn add node-sass --dev

Comment: If you were sloppy when you ran the first command, and did it at the root of your project, you might have renamed some of your npm dependencies' files. If so, delete those dependencies and do `npm i` to reinstall...
Answer: Step1 :-  Rename all css file from css (style.css) to scss (style.scss)
Step2 :-  If you are using old version (till 4) than please check
         .angular-cli.json file and replace css to scss in below code
         "defaults": {
           "styleExt": "scss",
           "component": {}
          }
      if you are using latest version (6) than please check angular.json
      file and replace css to scss
      "schematics": {
       "@schematics/angular:component": {
        "styleext": "scss"
      }
      },

And restart the project
Note :- For angular (till 4) basicall we used sass-loader to convert scss to css
but for latest version (6) we used node-sass to convert scss to css so if you are getting error like (Module build failed: Error: sass-loader requires node-sass >=4. Please install a compatible version) than please use below command
npm rebuild node-sass
Answer: Yeah now I have to do this and add a step for sass-convert because angular decided to merge this in
https://github.com/angular/angular-cli/pull/13444
-.-
Thank you very much 'Alex Eagle'


How to cause kernel panic by deleting a device driver (module)?

Question: Is it possible to cause kernel panic by removing a device driver and then making a system call that uses that driver so that kernel goes in panic?
Comment: Usually not, if device drivers is in use, eg, an ioctl call is running, then you can't unload the driver until the call return. After that, these ioctl would simply return an error like ENOSYS. Hope you understand that this is not talking about deleting a file on the filesystem.
Comment: But an illy programmed kernel module might cause kernel panic anyway when it run into a bug, including when it's executin exit function
Answer: It is possible when driver is not properly removed and application tried to use. If driver is removed properly kernel will give error like driver not found but never crash(In 99.99% cases until it hit any bug).
Answer: It is highly possible on the environment where the OS is configured on the SAN (Storage Area Networks) disks.
In my current client all servers boot disks are configured/installed with the SAN disks, i have seen many times kernel panic when the device driver not loaded or it's deleted.


Halting problem within a finite time interval?

Question: Let the finite time halting problem to be one where the program is counted as "not halting" if the Turing machine takes more than a given time interval to run the program.
Is this finite time halting problem undecidable?
Answer: This subject has annoying terminological redundancy - e.g. "decidable," "computable," and "recursive" all mean the same thing in this context. Below I'm using "computable" exclusively, since "recursive" is slightly old-fashioned and "decidable" does significant double-duty elsewhere in logic.
It is computable.
Precisely: the "general finite halting problem" $X$ of triples $(e,m,s)$ such that the $e$th Turing machine on input $m$ halts in at most $s$ steps is computable. Indeed, $X$ (or more precisely, the characteristic function of $X$) is even primitive recursive. (This is all related to Kleene's $T$ predicate.)
This is essentially a quick application of the universal Turing machine: to test whether $(e,m,s)\in X$ we want to run the $e$th Turing machine on input $m$ for $s$ steps and see what happens. And this is basically exactly what a universal Turing machine is for. It's a good exercise to write out the details, but there aren't any surprises.

Note that the halting problem $H=\{e:\Phi_e(e)\downarrow\}$ is a "projection" of $X$ in a sense: $$H=\{e:\exists s((e,e,s)\in X)\}.$$ In general, the image of a computable set under a computable function need not be computable but will always be computably enumerable.
Comment: What if the Turing machine is not allowed to run for s steps? This is true in the normal Halting problem where the Halt machine (that checks if a program halts) does not (and need not) run forever to decide that a program never halts.
Comment: @Danny Sorry, I just saw this. Using Turing machines in a finite alphabet, if we demand that we tell whether $(e,m,s)\in X$ in fewer than $s$ steps then in general we can't even read the full input (what if $e,m$ are much greater than $s$?). If we use register machines so the first two "cells" can hold $e$ and $m$ "all at once," this problem goes away, but now we hit (via the Recursion Theorem) the more subtle issue that we can never always simulate a length-$s$ computation in time $<s$ which means (since we have to spend a moment reading $e$ and $m$) that we still can't "quickly" compute $X$.
Answer: In addition to the excellent answer already posted, I'd like to point out some intuition for why it must be computable.
If you wanted to compute the characteristic function for the finite time halting problem we could run the machine for s steps on the given input. If we assign the value of 1 to problems that have halted in s steps and the value of 0 otherwise, then we have an algorithm that halts on every input.


Is there any technique for controling a smart phone over another smart phone ( both are android)

Question: As because one of the phones display is damaged throgh some part.
If there is any method please tell me....
Comment: You might wish to check with [Broken Screen + Using adb shell to run vnc server](http://android.stackexchange.com/q/19317/16575) and the questions linked to that.
Answer: You could try Teamviewer or Webkey. Teamviewer is only supported by selected Samsung phones, and Webkey requires root, though. If your phone is not supported by Teamviewer, you are most probably not going to achieve anything without rooting the phone you want to control. (Android only allows an app to inject screen taps and grab the screen in special circumstances: if the app is signed with the manufacturer's key (Teamviewer does this, so it doesn't need root) or the app is running as root.)
Comment: Trouble with both might be: Won't you have to start the "server" part on the damaged device? If so, how can that be done if there's no working touch-screen?
Comment: I think Webkey's "server part" can be started via ADB.
Comment: Just need to find out *how*. Maybe similar to [Broken Screen + Using adb shell to run vnc server](http://android.stackexchange.com/q/19317/16575), if one knows the name of the corresponding activity.


Using IDA pro decompiler in Ghidra

Question: Is it possible to use IDA pro decompiler in Ghidra ?
I know the opposite is possible.
Answer: The Hex-Rays decompiler heavily relies on IDA for disassembly and other analysis so it's unlikely it can be made to work without reimplementing (most of) IDA. Besides, it would be against the license.
You can, however, migrate your Ghidra project to IDA and then use the decompiler.

Using IDA pro decompiler in Ghidra


Zend Framework pChart Integration

Question: Can somebody explain to me how to configure a zendframework project with PCharts?I need to show data from my database in graph form. If possible please send me an example code of how to put the pieces together. Thank you
Answer: Call your pichartcreateAction in src attribute of an image of your .phtml file,
like
 In you main page phtml file
Now in pichartcreateAction() do the same as 'Mario' said.
Answer: I must say that this is not a different answer than that of Mario's but for me it was better solution with pChart in Path. As follows:
//public/index.php

set_include_path(implode(PATH_SEPARATOR, array(
realpath(APPLICATION_PATH . '/../library'),
realpath(APPLICATION_PATH . '/../library/pChart/class'),
...
get_include_path(),
)));

Render the Chart and return image name and path whom you'll need to use in the view, and you're all set.
Please ask, if in doubt.
Comment: That definitely a little nicer than having the includes in the action.
Answer: There may be a better way to do this, but since no one has answered here's a fairly simple way to do it.
Start by placing pChart in your library directory (myapp/library/pChart).
Next create an action for rendering the image (yes, your chart will require it's own action as you need to disable layouts and views, and set the header.)
Note: The following code will go into your action and I have only included the parts relevant to Zend Framework integration.
Disable layouts and views:
$this->_helper->getHelper("layout")->disableLayout();
$this->_helper->viewRenderer->setNoRender();

Include pChart:
include(APPLICATION_PATH."/../library/pChart/class/pData.class.php");
include(APPLICATION_PATH."/../library/pChart/class/pDraw.class.php");
include(APPLICATION_PATH."/../library/pChart/class/pImage.class.php");

Now start building your chart (pChart code excluded for clarity):
{... pChart code ...}

When specifying fonts use the full path:
$myPicture->setFontProperties(array(
    "R"=>0,"G"=>0,"B"=>0,
    "FontName"=>APPLICATION_PATH."/../library/pChart/fonts/pf_arma_five.ttf",
    "FontSize"=>12
));

Finish your chart code (pChart code excluded for clarity):
{... pChart code ...}

Finally set the content-type to image/png and render the image:
header('Content-type: image/png');
$myPicture->stroke();

Zend Framework pChart Integration


Do we need an orthonormal basis in Quantum Mechanics?

Question: I was wondering if it is important in Quantum Mechanics to deal with operators that have an orthonormal basis of eigenstates? Imagine that we would have an operator (finite-dimensional) acting on a spin system that has real eigenvalues, but its eigenvectors are not perpendicular to each other. Is there any reason why such an operator cannot describe an actual physical quantity?
Comment: @XinWang Physically, orthogonality of the eigenvectors means that the states are distinguishable. Therefore, if one has an "observable" with non-orthogonal eigenvectors, it means there does not exist *even in principle* a measurement that allows you to determine the value of that observable with certainty. This is a very strange property for an observable to have, although I can't see why this should actually be forbidden.
Comment: No. PT symmetric, but not Hermitian Hamiltonians are one example.
Comment: non-normal operators don't have functional calculus, and this is something you want most of the times.
Comment: @Phoenix87 the functional calculus is rather a mathematical construct, I was wondering more about why this is necessary from a physical perspective.
Comment: @ACuriousMind sorry, I don't understand what PT symmetric means.
Comment: @XinWang functional calculus **is** also physics. Without it you are not allowed to regauge your instruments...
Comment: @Phoenix87 could you explain this relationship maybe in an answer?
Comment: @MarkMitchison I suspected something like that, thank you.
Comment: Possible duplicates: http://physics.stackexchange.com/q/39602/2451 and links therein.
Answer: If two states are orthogonal, this means that $\langle \psi | \phi \rangle = 0$. Physically this means that if a system is in state $|\psi\rangle$ then there is no possibility that we will find the system in state $|\phi\rangle$ on measurement, and vis versa. In other words the 2 states in some sense mutually exclusive. This is an important property for operators because it means that the results of a measurement are unambiguous. A state with a well defined momentum $p_1$, i.e. an eigenstate of the momentum operator, cannot also have a momentum $p_2 \ne p_1$. Observables having an orthogonal (and complete) set of eigenstates is therefore a requirement in order for the theory to make physical sense (or at least for repeated measurements to give consistent results, as is experimentally observed)
Comment: @ComptonScattering the Hermitian conjugate is defined relative to some inner product. Given that we have particular inner product singled out (implicitly) by the axioms of QM, it makes sense to define hermitian conjugation relative to that. In other words $\langle \phi_n| = (|\psi_n\rangle)^\dagger$ by (the only sensible) definition n this context.
Comment: Are not your conditions satisfied if there exists a basis $| \psi_n \rangle$ and a dual basis $\langle \phi_n |$ such that $\langle \phi_n | \psi_m \rangle = \delta_{nm}$? Contrary to your answer, this condition is much weaker than orthonormality, which requires additionally  that the dual is provided by taking the Hermitian conjugate, i.e. $\langle \phi_n | = ( | \psi_n \rangle )^\dagger$.
Answer: If the eigenstates of your operator is not a orthogonal set, then your operator is not a hermitian operator, or in other words, is not an observable.
Actually, non-hermitian operators "appears" all the time, but if you investigate decoherence mechanism you may note that this operators don't affect directly the classical realm. This is because you can't construct consistent histories upon question about this non-hermitian operators. More concretely, if you have the coherent state $|\alpha \rangle$, i.e.
$$
a|\alpha \rangle=\alpha |\alpha \rangle
$$
where $a$ is the annihilation operator, then asking the probability of the system have some value of $\alpha$ don't make sense because we always can represent one $\alpha$ state in superposition of others $\alpha's$.
Comment: (1) This is mistaken: "Non-hermitian operators is operators that have at least one complex eigenvalue." Its converse is true, but this statement is not. (2) This is not quite true: "We cannot measure quantities that could assume complex values." There's no problem with generalizing hermitian operators to normal operators, thus allowing complex-valued observables (spectral theorem works, etc.). It's just not conventionally done because it's redundant and not useful, being equivalent to a simultaneous measurement of two commuting real-valued observables.
Comment: @StanLiou, Fixed.
Answer: A measurement extracts information from a quantum system that can be copied. Not all of the information in a quantum system can be copied as a result of the no-cloning theorem. The information that can be copied has to be described by an operator that remains unchanged under the unitary operator representing the measurement. And the only operators that respect this requirement are normal operators.
A similar argument can be given in terms of state vectors showing that only outcomes in orthogonal state vectors can be recorded:
http://arxiv.org/abs/quant-ph/0703160.


How to run code during app uninstall in flutter

Question: I would like to run code to delete files created on local storage when my flutter app is uninstalled. How can I do the same? Is there any event to handle this? If not, how can I clean up the images generated?I don't see any reference online for this.
Comment: I'm pretty certain that any app resources including files are deleted along with the app. I cannot quote anything so this is a comment, but I have seen this written somewhere...
Comment: No, it doesn't it. I have tried it. Images that were generated, for example through a qr br flutter package as images and saved to gallery, don't get deleted automatically and become orphans when app is uninstalled. Only if images are provisioned as part of app, it gets deleted
Answer: If you are saving images to users gallery, that image is no longer the domain of your app, in any way shape or form. If you create a gallery within your app this would be different, also, a gallery within your app would in fact be deleted along with any other memory your app uses. I highly doubt you could access users gallery & delete images even with users permission.
Possible backend server solution: here
This indicates this is not possible as per below:

All of your app's files are deleted by the OS when the user deletes
the app. If Apple wanted developers to have that capability, we would
have that capability
You could make a case for needing to know the app is deleted if you
are storing stuff on the server side. Currently from the server's
point of view there's no way to know whether the app was deleted or
the user just stopped using it. But locally stored files are not an
issue.

I am also looking for a solution to this & I think server logic will get it done.
Must be some sort of logic possible to discover server side if user is GONE!


How does the power-series expansion of the spectral phase describe chromatic dispersion?

Question: I don't understand how the spectral phase (the phase in the frequency domain) describes dispersion.
Answer: For example, if you measure the amplitude of a wave in point A you can find that the signal there has the form:
$s_a(t) = sin(\omega t)+sin(2\omega t)+sin(3\omega t)$
If you do the same measurement in point B you can get:
$s_b(t) = sin(\omega t)+sin(2\omega t+2\pi/8)+sin(3\omega t+3\pi/8)$
The last two sinus are shifted with $2\pi/8$ and $3\pi/8$. This shift with various phases is called dispersion.


Open Source Web Frameworks : Security

Question: How secure are popular open source web frameworks?
I am particularly interested in popular frameworks like Rails and DJango.
If I am building a site which is going to do heavy e-commerce, is it Ok to use
frameworks like DJango and Satchmo?
Is security compromised because their open architecture ?
I know being OS does not mean being down right open to hackers, Linux uses superb authentication mechanism, but web is a different game.
What can be done in this regard?
UPDATE:
Thanks for answers guys.
I understand that I will have to find a suitable hosting service for a secure e-commerce application and that additional layers of security will be needed.
I understand that Django and Rails have been designed keeping security aspects in mind, the most common form attacks like XSS, Injections etc.
(Django book has a ch on Security)
I was expecting comments from security Gurus. If you are a security Guru, would you recommend an important site, which is likely going to be popular, to be built on DJango
or Rails?
Comment: I think this question would be a great candidate to move to the future server fault site.
Comment: What is "future server fault site" ?
Comment: I can't speak to Django because I have no experience with it. But I would recommend Rails for such a site. You could definitely build a secure site which would handle lots of traffic.
Answer: Many people say that security through obscurity is not effective. Microsoft products, Adobe Reader, etc can be cited as evidence to prove that closed source is no more effective than open source at preventing security issues.
Many open-source advocates argue that the more eyes is better approach is one way of combating security related bugs. However, in reality when you are dealing with smaller applications or less popular both commercial or open source there are often few eyes. So there is the real danger of some black hat searching google code for a code snippet with a security hole in it.
Nonetheless, if you are using a fairly popular open source framework - I doubt it would be any more or less secure than a competing commercial product. At the very least, you may get a quicker turn around on security related bug fixes from a open source product with a very active community.
However, if you are serious about building an e-commerce site - you need multiple layers of protection. Definitely make sure that a proper firewall and an intrusion protection / detection system (IPS/IDS) is in place. You may need to pay for a hosting service that will provide security consolation and monitoring services in addition to hosting. Remember your users are your customers! Any breach could be catastrophic for the business.
Answer: Some of the answers are only talking about open source vs. closed and security, but since you asked about specific frameworks I thought I'd comment on what I know about Rails.
There are features which indirectly compliment security and those which are explicitly designed to implement security in Rails:

SQL Injection - ActiveRecord is generally encouraged to access the database within Rails applications. If used properly then you avoid string concatenation problems that can lead to exploitation via SQL injection. That's one of the most common methods of attack on web applications.
XSS - Easy to use macros are provided to HTML encode text which users entered as well as code to scrub out JavaScript a user might have entered into fields. By using these together you help protect yourself against cross-site scripting both coming and going.
Cookie manipulation - The default mechanism for storage of session data in Rails is sending it to the end user in the form of cookies. However, the user cannot simply alter that data and then resend it back to the server because it is signed with a lengthy private key before sending. Any altered session data will be immediately obvious to the server.
CSRF - This one is complicated to explain, but Rails provides security with its forms to ensure that the incoming request is coming from a form you actually sent to the user.

There are more things, but it's good that modern frameworks like Rails have built in support to help you get a more secure web application from the start. Perhaps someone familiar with the features of Django could weigh in as well.
Answer: In the testing courses I've taken (and I agree), I always been said that Open Source software are more secure since they are tested by more people and improved by more people.
Hiding the code source is not an effective way of securing an application. It could work for a specific software, but for a wide spread framework people are eventually going to figure out how things work (http://en.wikipedia.org/wiki/Reverse_engineering)
There are large scale e-business web application that use open source framework. If you are familiar with the ecommerce tools, you must know Shopify that is built using Ruby on Rails (http://weblog.rubyonrails.org/2006/6/5/shopify-is-open-for-business)
They also released ActiveMerchant :

Active Merchant is an extraction from
  the e-commerce system Shopify.
  Shopify's requirements for a simple
  and unified API to access dozens of
  different payment gateways with very
  different internal APIs was the chief
  principle in designing the library.
Active Merchant has been in production
  use since June 2006 and is now used in
  most modern Ruby applications which
  deal with financial transactions.

In my opinion security will be at least as good, if not better, using a framework like Rails than using a proprietary framework. I don't know about django since I never used it but I've heard that it is just as good.
Of course you'll need to keep your app secure and don't rely solely on the framework !
Answer: I've built several sites using Django and one storefront using Satchmo.  There is no difference in security between closed and open source frameworks since all the security related information is unique to your installation.
For example, the "secret code" in your settings.py file is uniquely generated when you start your project.  Its up to you to salt user passwords and to guard your encryption keys, the same as you would on any platform.
Something to note about Django is that out of the box, all form input is validated and "marked safe" via a sanitation process.  You can access a form's sanitized data via its cleaned_data dictionary.
Additionally, all templates are auto-escaped HTML so the risk of injection attacks or cross-site scripting are virtually nil.
Finally, the models offer an additional security layer and validation should any rogue data get through.
And as for Satchmo, its e-commerce gateways to paypal, visa, etc. are accepted by said companies and use their APIs so they're as secure as any other payment gateway.  Naturally, you need to be running an encrypted HTTPS connection to do credit card payments, but that is required universally and has nothing to do with the framework you use.

Open Source Web Frameworks : Security


Specify a template for referenced nodes

Question: I was wondering how to specify a specific template for rendering a node when it's referenced from another content type.For example I have a content-type (product) and I use the node--product.tpl.php template to render nodes of this type. Then I have a content-type named container that have a node reference field that may related a number of product nodes.I would like to use a different template when rendering a product when the product is referenced from the container content-type.
I just installed the theme developer module and check suggested templates, I then created a new template named node-reference--product.tpl.php in the same folder as node--product.tpl.php but this file is only used if node--product.tpl.php is removed.
I guess one approach would be to use some kind of theme_preprocess hook and load a node based on the arg(1) value and then check if the type is container and if it is add a template suggestion in the $variables parameter.
Answer: The simplest thing you can do is provide a new "View Mode" for nodes, so that you can use it with the "Rendered Node" display option for the node reference field.
This would be done in a small custom module using hook_entity_info_alter() like so:
function MYMODULE_entity_info_alter(&$info) {
  $info['node']['view modes']['node_reference_product'] = array(
    'label' => 'Node Reference Product',
    'custom settings' => TRUE
  );
}

Once the module is installed you'll have a new view mode under the "Rendered Node" display format options:

Now you can simply use the same node--product.tpl.php template file as normal and just test for the view mode to define what you want to display:
<?php if ($view_mode == 'full') : ?>

<?php elseif ($view_mode == 'teaser') : ?>

<?php elseif ($view_mode == 'node_reference_product') : ?>

<?php endif; ?>

Of course you still have access to the view mode in any hook_preprocess_node function so you could put your logic in there instead:
function MYTHEME_preprocess_node(&$vars) {
  if ($vars['view_mode'] == 'product_node_reference') {
    $vars['content'] = array('#markup' => 'Some other content');
  }
}

But perhaps the best part of solving your problem this way is that Drupal honours the new view mode in the UI, so for each content type you will now have a new view mode which you can choose options for as normal:

Just like the standard full and teaser view modes you will be able to decide which fields are displayed, and the ordering and format in which they are displayed too. It's entirely possible that after writing that tiny one-function module you won't need to write another line of code to solve the problem.
You'll also have this view mode available system wide for use in, for example, Views/Panels etc.
Comment: Glad to help, glad you got it sorted either way :)
Comment: I created a module that included `hook_entity_info_alter()` and set the `Render Node` view mode to `Node Product Reference` for the reference field in the `container` content-type, but the view_mode for all nodes were still set to full, why is that? I managed to solve the problem using `hook_preprocess_node()` in wich I forcefully set the view_mode to the correct value.
Comment: I'm not sure to be honest, I used the exact code in the answer above and it worked fine for me :/
Comment: I was thinking that it could be because the field already contained references when it changed the view mode. Anyway - Thanks alot for your nice answer=)
Answer: It might be simplest to create a different field formatter for the entity reference on the container node. Instead of the default "Title(link)" or "Rendered Node" you can add one and theme it however you would theme the separate node templete you were trying to theme. See a writeup here: http://www.computerminds.co.uk/articles/creating-new-field-formatters-drupal-7 . In your hook_theme() you could specify a template instead of a function.  I would choose this over creating a check in theme_preprocess() as it is easier to manipulate if you want to change it in the future.
I might also check out the Display Suite module if you haven't yet which will allow you to move parts of the node around in the content type settings form. It has some similar features to Panels but is much more lightweight. It might save you from creating separate node templates at all.

Specify a template for referenced nodes


CouchApp paths are wrong after import

Question: I'm using CouchApp to push an existing html&javascript application. The application uses jquery and twitter bootstrap and it works perfectly fine from a regular web server / when opened locally.
(The application is basically a ready made app I bought and which I wish to redesign)
After I push the application (which is structured in many folders) I can't open it from couchdb since all the paths are "wrong".
My HTML files are under Page/PageType/Pagename.html so every css for example is accessed via ../../stylesheet/style.css but the URL can't be accessed when calling couchdb.
For example I have this page:
<code>    http://127.0.0.1:5984/coreadmin/_design/coreadmin/pages%2fother%2fsign_up.html
</code>
Which is displayed in the browser but without style/js/images because the path is:
<code>    http://127.0.0.1:5984/coreadmin/stylesheets/application.css (So _design/coreadmin is missing)
</code>
Is it possible to upload the project as is and make it work or do I have to go over all the files and fix the paths? (which means it will not work on any other web server...)
Thanks!
Answer: The problem was with the URL - by replacing the %2f to / everything everything is now working just fine.

CouchApp paths are wrong after import


Solving discret log problem

Question: Can the discret log problem be solved when the modulus is a hard to factor composite number, i.e. when modulus $n=p*q$, where $p$ and $q$ are two large prime numbers?
Comment: Is the problem solving for integer $x$ the equation $g^x\bmod n=a$, given integers $n$, $g$, $a$, with $n$ a large composite too difficult to factor (which implies $n$ is several hundreds bits)? Is there information about the order of $g$, or/and the maximum value of $x$, and/or more generally how instances of the problem are built when it comes to $g$, $a$, and/or $x$, and /or the choice of factors $p_i$ of $n$ (perhaps with $p_i-1$ having a large prime factor)?
Comment: The values of $g$, $n$ and $a$ are known. There is also known that $n$ is a large composite number hard to factor. In this conditions, can we efficiently find $x$ such that $g^x mod n = a$?
Answer: The problem is solving for $x$ the equation $g^x\bmod n=a$, given integers $n$, $g$, $a$, with $n$ a large composite too difficult to factor (which implies $n$ is several hundreds bits). It is not stated how instances of the problem are generated.
That is hard at least for some instances of the problem. In particular, if one of the factor $p$ of $n$ is large (say, at least 1536-bit), and $p-1$ has a large factor $p_0$ (say, at least 256-bit), and the order of $g$ in $\Bbb Z_p^*$ is $p_0$ or a larger multiple, then an instance of the problem where $x$ was chosen at random in $[1,n/2]$ and $a$ computed as $g^x\bmod n=a$ is hard. Argument: ability to solve $g^x\bmod n=a$ for $x$ and knowledge of the factorization of $n$ trivially implies ability of solving $g^x\bmod p=a\bmod p$ for $x$ (modulo $p-1$), which is is believed hard; and lacking knowledge of the factorization of $n$ can only make the question's problem harder.
I conjecture without proof that the condition "$p$ large" can be replaced by the existing "$n$ too difficult to factor"; and that a random instance is hard.
Among the usual Discrete Logarithm methods, Baby-step/Giant-step and Pollard's Rho remain applicable, with cost $O(\sqrt x)$ multiplications modulo $n$ (and moderate memory for Pollard's Rho). That allows to solve instances with moderate $x$ (say 80-bit with a standard PC), but I see no better method to solve a random instance.
Comment: Wouldn't  be simpler to factor with NFS and then to solve the logarithms through NFS-DL ?
Comment: @Ruggero: yes, if $n$ can be factored (with NFS or otherwise; the algorithm of choice depends on how $n$ is generated), then that helps immensely, and is likely the way to go. But the problem statement makes $n$ "hard to factor", and I have reformulated it as "too difficult to factor", precisely to exclude that avenue.

Solving discret log problem


How could McGonagall afford a Nimbus 2000 on a teacher's salary?

Question: Seems like the best piece of equipment for a sport that is played professionally and has such a big public following probably costs quite a bit. Did McGonagall buy it in a private capacity or perhaps with funds available to her as head of house?
Comment: Are you *sure* McGonagall paid for it? dear old Albus could've and he just has Minerva deliver it to Harry.
Comment: [Related](https://scifi.stackexchange.com/q/115732/58193).
Comment: Maybe she expensed it?
Comment: How much does one cost?
Comment: How do you know it wasn't a funding project? Something like GoFundWitch?
Answer: Teachers don't make a lot in the muggle world (married to one, trust me), but since her living expenses were essentially zero during the school year, maybe she felt she could afford to splash out her 9 months (approximately) of school year salary on a nice gift for The Boy Who Lived™. Especially since he was in her house.
Comment: Seems pretty much speculation to me. We're never told how much do magic teachers earn. They might be really well paid.
Comment: @Roberto https://scifi.stackexchange.com/questions/115732/how-well-are-professors-paid-at-hogwarts
Comment: 'tis pure speculation, @Roberto, but if you look at the linked question, it's really not that far off. Especially since, as noted in that linked answer, room & board are covered for the period of time the professor is at school. (Though, one must assume that he's making mortgage/rent payments on her "permanent" non-school residence while at school).
Comment: Also, no more or less speculation than the answers on both of the linked questions.


What is a simple teachable example where normalization/standardization of data is necessary or convenient for valid inference?

Question: Many students come across normalization and standardization as a easy to understand, but hard to grasp/motivate problem. Often times reasons for why we should normalize or standardize data range from the fact we want to do PCA (variance sensitive) or want to make the results more readable. I was wondering if anyone had a simple, nearly trivial example that is teachable to students where the motivation behind normalization or standardization is justified?
Comment: A client ran into severe numerical problems (total loss of numerical precision in computing sums of squares and products), as well as issues in reporting results, in making simple regressions of monitoring data over time.  Her problem stemmed from using her software's default method of representing time as seconds since 1970.  That put the values of her times around $10^9$ and the rates of change (which were a few percent per year) were expressed as values less than $10^{-8}$.  The solution was not necessarily standardization, but expressing times in years since 2000 worked nicely.
Answer: Basically, you want your data to be normalized or standardized so that it would have zero mean and unit-variance. Although another way to explain it would be that the features need to be normalized simply because you do not want some features overpower the other features. Let's say for example that you have a column for movie prices. The prices are around 20-30 dollars each and then you have another column for number of people who went to the cinema that day and the value is around 1000-2000 people. You can clearly see that the column that contains the number of people is clearly larger than the price of the movie hence making it somewhat incomparable. The data is normalized to address this issue and make sure that one feature doesn't overpower the other features so that when it is used in Machine Learning algorithms, it would be comparable and easier to create models from it.
Answer: There can be different reasons to normalize/standardize in different contexts, so I don't think it could be distilled down to a single example. Here are a just a few examples:
In linear regression, we might standardize the explanatory variables if they have different units, but we want the weights to have the same units (e.g. to compare them). After standardizing, each weight represents the expected change in the output variable per standard deviation increase of the corresponding explanatory variable (holding all others fixed). We might choose not to standardize if we want the weights to be expressed in terms of the original units. In this context, standardizing simply corresponds to a change of units; it doesn't have any effect on model performance or fundamentally change what we're doing.
Inputs are typically normalized/standardized when using regularization (e.g. l1/l2 penalties, as in lasso/ridge regression). If the inputs weren't normalized, each weight would be penalized differently, depending on the scale of the corresponding variable (we don't want this). In this context, normalization does fundamentally change what we're doing.
For some problems, normalization lets us compute a solution more efficiently. For example, long, narrow valleys in the objective function can arise if inputs to a neural net have very different scales. Gradient-based optimization algorithms can take a long time to converge in this situation, because the negative gradient points mostly across the canyon walls, rather than toward the minimum. Normalizing the inputs can help improve convergence. In this situation, we're typically interested in predictions rather than values of the network parameters themselves, and we use normalization for computational reasons.
Distance-based methods are an interesting case (e.g. k nearest neighbors and RBF kernels). For example, the Euclidean distance between points depends on how we scale each dimension. Dimensions with greater scale contribute more heavily to the distance. It's common practice to normalize the inputs so that each feature contributes equally. In the absence of further information, this seems like a reasonable thing to do. But, there are no guarantees that this is actually the best choice. For example, if the original data contained many small amplitude features that were essentially noise, normalization would amplify the noise and decrease performance. Ideally, we might like highly informative features to have large scale, and less informative ones to have smaller scale (hence, various methods for learning an appropriate scaling).


Splitting of the 2-forms on a 4-dimensional vector space specifies unique conformal class

Question: The problem I'm facing is the following.
Let $V$ be a 4-dimensional real vector space with orientation $\omega\in\Lambda^4V\setminus\{0\}$. Suppose that $U_-,U_+\subset \Lambda^2V$ are linear subspaces with the following properties:

$\Lambda^2V=U_-\oplus U_+$
$U_-$ and $U_+$ are wedge-orthogonal, i.e. $\alpha\wedge\beta=0$ for all $\alpha\in U_-$ and $\beta\in U_+$
$\alpha\wedge\alpha$ is a positive multiple of $\omega$ for all  $\alpha\in U_+\setminus\{0\}$
$\alpha\wedge\alpha$ is a negative multiple of $\omega$ for all  $\alpha\in U_-\setminus\{0\}$

In 'The Wild World of 4-manifolds' by Alexandru Scorpan (p. 364) it is now claimed that there exists a unique conformal class of Riemannian metrics on $V$ such that $U_-=\Lambda_-^2V$ and $U_+=\Lambda^2_+V$, where $\Lambda^2_{\pm}V$ denotes the self-dual/anti-self-dual 2-forms on $V$.
I haven't been able to prove or find a proof of this. I also wonder whether it is possible to explicitly construct a metric in the mentioned conformal class. Any help with this would be much appreciated!
Answer: This argument is essentially contained in Lemma 2.2 of this paper:
https://arxiv.org/pdf/1704.07620.pdf


Pouring a concrete slab in batches

Question: I'm wondering if it's okay to pour a 7 x 9 x 4" slab for a shed in batches, in that I'm not able to handle all of the concrete in one day. If so, is there any attack plan that would work the best?
Thank you:)
Answer: A 7x9 slab is not very big...unless you are buying bags of concrete mix, loading them in your vehicle, unloading them to the site of the work, mixing them with water from a hose, pouring out of a wheelbarrow, and repeating this until the pour is done.  Then it is REALLY big.
Consider this: In many areas there are "mix and pour" concrete trucks that come to your jobsite and mix the concrete right in the truck. and pour it in your forms or in your wheelbarrow.  You only pay for the concrete you use.
Less backbreaking work. No spoils or leftovers that you have to find a home for. No trips to the home store. You are done in hours rather than days.
Comment: A 7' x 9' slab 4 inches thick will require 35 80lb bags (2800lbs total). I think you can get the big box stores to deliver it, otherwise you will probably have to make a few trips. I would rent one of those stand mixers, they can mix 3 bags at a time. I think planning to pour this in 2 pours over 2 days would certainly be doable.
Comment: **Only put 2 bags in a 3 bag mixer.** It's less strain on the $120 BS machine made in China, and you. Rent a vehicle, *buy* the mixer (even if you only use it once, it's worth it) and have them load an entire skid of 60 pound bags of concrete; excess to be returned: still in the truck. 80s are heavy.... Sixty, 60lbs bags = 1cu ft. (56 bags on a pallet)
Comment: Doing 2 instead of 3 mixes twice as fast, and completely w/o clumps every time because you can pan the drum down further so that it actually dumps over on itself as it falls off the blades w/o sloshing out.
Answer: Yes, you can do that.  You have to provide something like rebar between the sections to tie then together, and maybe some expansion joint material.  Heck, they pour road beds like that all the time.  And even the giant Hoover Dam was poured in sections (blocks).
One disadvantage of pouring in sections is that it's more expensive to get small batches of concrete delivered.  If you're going to mix your own, that's less of a concern.
I'll leave the details (which I would probably get wrong) to those with more experience in this matter.
Comment: Not an expansion joint. The slab is too small for that. Just a _control_ joint tooled into the surface.
Comment: That's what I meant by leaving the details to the experts!
Answer: Addendum to SteveSh's answer...
You want to form the sections separately by running a board across at the point where you'll stop the section. The form board at that point can be shorter in height than the perimeter form so that rebar and extra concrete can pass underneath. It's just needed so you can tool the edge to form the first half of a control joint. This can be done on the fly when you determine how far the first batch goes. Just make sure it's square.
You could accomplish the same thing by holding a straightedge over the forms and running your edger along that, but screwing a board between forms is easy enough and provides more stability.
At the next session you'd remove that intermediate form and continue the pour, once again tooling the control joint, but on the new side.
This leaves you with a standard sidewalk control joint, making your work appear continuous.

Source
Answer: Practical answer
You are dealing with 3/4 yard of concrete.
If you make your slab 7' x 9' x 5" then it will be a yard of concrete. Check local delivery prices and have a heart-to-heart with yourself as to whether the concrete work needs to be days of backbreaking labor or about 2 hours.

The answer to your exact question
How many batches do you plan to do it in?
How much time will elapse in between batches?
Pouring in multiple batches can result in uneven appearance due to moisture content. Definitely place a length of rebar for the next batch to latch onto.
Consider using a concrete bonding agent when pouring the subsequent batch:
Comment: Bonding agents aren't for vertical joints. They're for horizontal _layer_ situations.

Pouring a concrete slab in batches


Can I use a laptop charger as a psu for a guitar amp?

Question: My amp is a Blackstar core id 40 and has info in the back that says "Use 16V/3.5A DC Power Supply". I'm confused on this part though if it refers to dc being the input or a dc adapter. Found info about the original PSU and it says that it is an ac adapter. I can't find the original PSU being sold in my country so I tried looking for other alternatives and found a laptop charger that's 16V/4.5A that matches the connector size of the original PSU. From what I've researched, it should be fine as long as it's the same V and wouldn't go less than the required A. I think they're both center pin positive (Can someone please confirm this based on the pictures). I don't know much about electrical stuff so I'm not sure if it's okay to use the laptop charger.
Guitar Amplifier Info

Laptop Charger
Comment: Most guitar stuff I've come across is centre pin negative, however the picture you show is quite clear that this particular one is centre positive. Do check any other audio/guitar/stage equipment carefully though before assuming. Strictly speaking, that's not a laptop charger, but a laptop power supply. The charger, the thing that carefully monitors the batteries while charging, is in the laptop itself.
Comment: Be sure to insert plug with power off as indicated in manual.
Comment: looks ok to me. if it doesn't work instantly unplug it instantly (just to be safe)
Answer: Both are center-pin positive. If the connector fits, you should be good to go. However, the connector should fit snugly. There are different sizes and both the pin and sleeve need to make good contact.
Comment: Yes, the connector is also 5.5x2.5mm. I've finally tested it on the amp and it's working fine so far. Thank you!