Definition of limit and axiom of choice

Question: In the definition of limit of a function ($\epsilon-\delta$ definition) we say certain statements such as for every $\epsilon>0$ there exist $\delta>0$ ....
Now my question is, is a choice function required to ensure that for every $\epsilon$ there exist a $\delta>0$? Moreover, how we can we test whether a mathematical statement depends on axiom of choice or not?
I really don't know whether this question has any meaning or not, so please help me.
Comment: I don't understand how choice could be involved. It's a definition, not a theorem. I.e., you're not making a claim of the form "the limit of a function is $x$, therefore there exists a $\delta$...". Rather you're making a statement of the form "the limit of a function is x, which is to say there exists a $\delta$..."
Answer: The question doesn't make much sense, and it seems that you are misunderstanding the definition.
We define continuity by $\varepsilon$-$\delta$ at a point $x$ in such way. If you want to show that a function is continuous at $x$ it suffices to show that every $\varepsilon$ has such $\delta$. We are not required to assign in a single stroke all the $\varepsilon$'s with fitting $\delta$'s. We just have to show that given $\varepsilon>0$ there is some $\delta$ which satisfies the statement.
On the other hand, the axiom of choice is required in order to show that continuity by $\varepsilon$-$\delta$ at a point is equivalent to continuity using sequences (i.e. $f(x)=\lim_{x_n\to x_0}f(x_n)$ for every $x_n\to x$). The axiom of countable choice suffices here.
For more details on that last part, see the entire discussion on: Continuity and the Axiom of Choice
Finally, to prove that the axiom of choice is required to prove $\varphi$ we can either show that $\varphi$ implies something we already know to require the axiom of choice (or a fragment thereof), or that we can construct a model of $\sf ZF$ in which $\varphi$ fails (of course it makes sense only if $\sf ZFC$ proves $\varphi$ in the first place).
For more on that, you can read:

How do we know we need the axiom of choice for some theorem?
We cannot write this function
Comment: I think the confusinon is: There is a $\delta$ (depending on $\varepsilon$). Which one? If we pick one, did we use choice? Of course, we do not need to assign a single $\delta$ to each $\varepsilon$ (knowing that there are possible assignments suffices). But, regardless, *if* we were to assign a $\delta$ (in a situation where the limit indeed exists), this is still possible without any use of choice, because if $\delta>0$ works for $\varepsilon$, then so does any $\delta'$ with $0<\delta'<\delta$, so we may restrict ourselves to rational (thus explicitly enumerated) values of $\delta$.
Answer: The answer to your first question is: usually no. In $\epsilon-\delta$ questions, you usually have to construct a specific $\delta$ given $\epsilon$; i.e. your $\delta$ will be some function or equation in terms of $\epsilon$.
Having such a construction is exactly when you don't need the Axiom of Choice.  Very basically, you need the Axiom of Choice when you need to make an infinite number of choices that you cannot explicitly construct.
Answer: I don't get your first question, could you elaborate? As for the second one, a mathematical statement can't "depend" on the axiom of choice, a proof of this statement can.
Now, if your question was "does a proof of the statement require the axiom of choice", then this is very difficult to answer. More formally, for a formula $\phi$, you are asking whether $\mathrm{ZF} \not\vdash \phi$ but $\mathrm{ZFC} \vdash \phi$ is true. To illustrate how this is difficult, take $\phi$ to be the countable axiom of choice. Then it has not been known for a long time whether $\mathrm{ZF} \not\vdash \phi$ was true, altough $\mathrm{ZFC}\vdash \phi$ is trivial.

Definition of limit and axiom of choice


Does Diigo have a way to merge tags?

Question: I've got too many tags in Diigo.  Is there anyway to merge tags that have been displayed only once, into other tags that you've used many more times?
Comment: I'm not sure I understand, could you show an example?
Answer: Hopefully I get this because I am not sure I understand whether you want this done automatically.
Manually you can just rename the less used tag to the more used tag.
Comment: @lee Yeah, there is no official merge from what I see, but the above (added more screenshots) does this for you. The only extra effort is typing out the parent tag you want the current tag to be merged with. This actually similar to how tag merges work in StackExchange.
Comment: I was actually thinking more along the lines of selecting two tags, and then selecting one tag to replace with the other tag.

I.E. I click tag_a and I click tag_b, and then when I click merge, and then click tag_a, all of the tag_b entries are replaced with tag_a.

Does Diigo have a way to merge tags?


Are feature importances of ensemble methods sensible interpretable?

Question: As mentioned in the question, it is easy to interpret the meaning of features in algorithms like simple decision trees. But in the case of ensemble methods that are known to average/modify features, are these results still sensible interpretable/usable to argument about the feature(s)?
Answer: During recent years, the most successful feature attribution method from has been the SHAP values.

SHAP (SHapley Additive exPlanations) is a game theoretic approach to explain the output of any machine learning model. It connects optimal credit allocation with local explanations using the classic Shapley values from game theory and their related extensions

One of the most famous implementations is Tree Explainer

Tree SHAP is a fast and exact method to estimate SHAP values for tree models and ensembles of trees

The paper originally appeared in Nature ( here in Arxiv): Explainable AI for Trees: From Local Explanations to Global Understanding.
In case you want to extend and see more related literature you can have a look at the appendix "Methods 5 Previous Global Explanation Methods for Tree". They provide the previous state of the art of feature-relevance methods.
The exact algorithm that answers your question is in the Method 10, it explains how TreeShap is computed.
Answer: Feature importances and the interpretation of the meaning of features are entirely different things.
The importance of a feature shows how strongly the feature influences the answer. If the importance is low, the answer only slightly depends on the feature. If the importance is high, the answer is highly influenced by the feature.
The interpretation of the meaning of a feature relates to the question of how ( = in which form, in which way) the feature influences the answer.
I will illustrate it here with a simple example. Because, you ask about ensemble methods, I will use two ensemble methods: random forest and gradient boosting:
from sklearn.ensemble import RandomForestRegressor, GradientBoostingRegressor

Let's take a 1000 samples of 3 features $x_0$, $x_1$, $x_2$, each with values between 0 and 1.
x0 = np.random.uniform(low=0.0, high=1.0, size=(1000,1))
x1 = np.random.uniform(low=0.0, high=1.0, size=(1000,1))
x2 = np.random.uniform(low=0.0, high=1.0, size=(1000,1))

X = np.concatenate((x0, x1, x2), axis=1)

Let the target variable $y$ depend on $x_0$ and $x_1$ but not on $x_2$, e.g. $y = -1 + 2x_0+sin(6\pi x_1)$
y = -1 + 2 * x0 + np.sin(6 * np.pi * x1)

These features look as follows

Calculating feature importances with random forest,
reg = RandomForestRegressor()
reg.fit(X, y.ravel())
print(reg.feature_importances_)

gives
[0.43457062 0.55951066 0.00591872]

and with gradient boosting, reg = GradientBoostingRegressor():
[4.02569166e-01 5.96839179e-01 5.91654881e-04]

Two features $x_0$, and $x_1$ have similar importances, as can be seen from the picture above, while the importance of $x_2$ is much less (ideally, it should be zero).
Let's scale one feature relative to another, and see what happens to feature importances.
y = -0.2 + 0.4 * x0 + np.sin(6 * np.pi * x1)

Feature importances according to random forest:
[0.01887166 0.97918728 0.00194106]

Feature importances according to gradient boosting:
[2.08344663e-02 9.79105292e-01 6.02418447e-05]

The second feature is more important. Let's scale them differently.
y = -1 + 2 * x0 + 0.2 * np.sin(6 * np.pi * x1)

Feature importances according to random forest:
[0.9545089  0.03933793 0.00615317]

Feature importances according to gradient boosting:
[9.48205203e-01 5.17843116e-02 1.04852064e-05]

Now the first feature is more important.
We could easily evaluate feature importances with ensemble algorithms, and they make sense. The feature that greater influences the answer is more important.
From the pictures, we also see the meaning of each feature. However, we cannot get the meaning easily from the ensemble algorithms. Usually, for many algorithms, it is easier to evaluate feature importances than interpret the meaning of features.
If the question of feature meanings can be answered by analyzing a certain algorithm, that algorithm is interpretable. Otherwise, it will be called uninterpretable, black box, or something like that. The feature is still there, its role doesn't change, no mater if a human can interpret it or not.
Even if you take the same class of algorithms, say, decision trees, you can build different decision trees for the same problem, depending on the method of tree growing. I illustrated it on the XOR example in this answer: link where two trees for the same problem are constructed, one being interpretable, the other is not.
As far as the modification of features is concerned, every algorithm modifies features. Even the decision tree does that. When it chooses a subset of a feature, it is equivalent to the multiplication of the feature by an indicator function $I(x)$: if $x<x_0$ then $I(x) = 0$ else $I(x) = 1$. Other algorithms modify features differently. Ensemble methods are nor more harmful to features than any other.


Prove positive definiteness

Question: I want to prove that the matrix
$$\begin{pmatrix}
1   &\cfrac{1}{2} &\cfrac{1}{3} &\cdots &\cfrac{1}{n} \\
\cfrac{1}{2} &\cfrac{1}{3} &\cfrac{1}{4} &\cdots &\cfrac{1}{n+1} \\
&\vdots &&\ddots &\vdots \\
\cfrac{1}{n} &\cfrac{1}{n+1} &\cfrac{1}{n+2} &\cdots &\cfrac{1}{2n-1}
\end{pmatrix}$$
is positive definite. Using mathematical induction, I only need to show that its determinant is positive. But I can't find the way out.
Comment: This is a [Hilbert Matrix](http://en.wikipedia.org/wiki/Hilbert_matrix), and in the link the determinant is computed in the closed form; but I think this is not needed in its fullest strength, in the mere order to show that the determinant is positive.
Comment: https://oeis.org/A005249 tabulates (the inverse of) the determinant of this matrix and gives a formula, which maybe you can prove by induction. It also gives some references that might be helpful.
Comment: See also: [Prove the positive definiteness of Hilbert matrix](https://math.stackexchange.com/q/1754729).
Answer: Hint. Call your matrix $H$. Then $H=\left(\int_0^1 x^{i+j}dx\right)_{i,j=1,2,\ldots,n}=\int_0^1 v(x)v(x)^Td x$, where $v(x)=(1,x,x^2,\ldots,x^{n-1})^T$. Can you see that $H$ is positive semi-definite? Now, if $u^THu=0$ for some vector $u$, then $\int_0^1 u^Tv(x)v(x)^Tu dx=0$. Can you infer that $u=0$ (think about Vandermonde matrix)?
Remark. From a wider perspective, $H$ is an instance of matrices of the form $A=\left(\frac1{1+x_i+x_j}\right)_{i,j=1,2,\ldots,n}$ where $x_i\ge0$ for all $i$ (in your case, $x_i=i-1$), which is known (q313249) to be positive semidefinite. The same trick in the above hint can be used to show that $A$ is positive definite iff all $x_i$s are distinct.
Edit. Alternatively, $H$ is a Hilbert matrix. Every leading principal submatrix of $H$ is again a Hilbert matrix. So, by Sylvester's criterion, it suffices to prove that every Hilbert matrix has a positive determinant. As Gerry Myerson has pointed in his comment, mathematical induction may be useful in this case.

Prove positive definiteness


What is the technical definition of "sprite batching?"

Question: Platform and language agnostically, how is sprite batching defined? It seems as though there are many different techniques for lessening the amount of work when drawing, and that they are often lumped with "batching". It occurs to me that there may not be a real answer, but perhaps someone here has found something I have not.
Answer: Technically, "batching" is putting multiple actions and their data into one data structure so it all can be executed at once rather than individually.
The biggest bottleneck of modern GPUs is not their working power, but the communication between your game running on the CPU and the GPU. Each package of data sent to the GPU has an overhead, but the overhead of a small package is just as big as that of a big package, so it's a big gain when you send one big package rather then a hundred smaller ones. And that's what batching is; making one big package out of all those smaller ones.
Batching is particularly useful for sprites because of the ridiculously small amount of data per sprite; four vertices and four tex coords. So the overhead of the small package is proportionally big.
Comment: +1 for mentioning the latency problem; this is the very same principle as also applies to network traffic and disk I/O - in the general case, very few big batches trumps lots of small batches.
Answer: Sprite batching is the method of submitting multiple sprites to the GPU with a single draw call.
Neither of the other answers point out the real point of doing this: minimizing state changes and GPU command submissions.  If you have 100 sprites I draw, each with their own texture, the hardware can only process one sprite at a time.  The dozens or even thousands of shader cores end up barely being utilized, and the GPU spends far too much time configuring its render state for texture switches.
If you put all your sprite images into an atlas, you can minimize the state changes needed to draw.  The driver may even be able to automatically combine sprite draw requests into a single batch so that the hardware can be fully utilized, but this is not guaranteed or likely.
If you use a sprite atlas and then create a single VBO with all your sprites quads filled into it, an make a single draw request with that data, you are guaranteed that the hardware is fully utilized and all of your sprites are rendered in parallel.
Sprite batching then is doing that very thing: putting as many of your sprites as possible into a single VBO using a single atlas that is submitted to the GPU with a single draw call, maximizing GPU usage.
There are other ways to do sprite batching (like hardware instancing, using geometry shaders, etc), and other benefits to doing so, but the gist of it is that batching means drawing multiple objects per draw call.
Comment: Mr. Beast: it has nothing to do with OpenGL or any platform or language.  It's how the very hardware itself actually works, on all platforms and all graphics APIs using any language.
Comment: -1: Minimizing the state changes isn't "the point" of the batching. It's just a requirement comming from the way OpenGL is structured. (It is the point of texture atlases, but those weren't asked for.) The question specifially asks for a "Platform and language agnostically" definition.
Comment: So the method of drawing everything to a backbuffer first solves this problem how? Isn't the data still being manipulated one at a time to a single image in memory, *and then* pushed to the front buffer? I think my understanding must be a bit flawed.
Answer: It's not a tightly-defined technical term. Batching is basically any system where you perform multiple operations as a set rather than individually, and often this is done because it's more efficient to do so. The efficiency gains usually come from being able to re-use some or all of the context that the operation requires.
So, sprite batching is just any system that lets you draw multiple sprites at once and hopefully gain some efficiency from it. Usually the benefit is that your sprite batch is all using the same texture, so you can draw all the sprites in the batch without changing texture, which is a relatively slow operation.


Xbox One - Access Windows Remote Desktop Connection

Question: Is there a client (or another way) for the Xbox One to connect to a Windows PC over Remote Desktop Connection?
Comment: Not sure remote desktop, but console of Xbox One can be taken. Please refer this URL: http://support.xbox.com/en-IN/xbox-360/connections/windows-media-center-on-xbox-360-windows-7
Answer: This can be done between Windows 10 and an Xbox One console with more recent updates.
Note that this is currently, as of my post, in Beta. It also will require a decent network connection between the PC and the console (preferably an Ethernet connection though I've done it before over WiFi as well). You will need an Xbox controller connected to the PC to control the console (I've used an Xbox 360 wired controller and it works just fine).
What you need is an Xbox One and a Windows 10 computer connected to the same network. Install the Xbox app from the Windows 10 app store. When it is installed, run it and log in. Look in the app for an icon that looks like an Xbox One. Tap or click it and it will let you connect to an Xbox One on the network.
The console will initially have to be on so that it can find it on the network and register it with the app. You may also have to enable streaming in the Xbox One settings to allow this feature to work. After it is registered with the PC, you can turn the console on by initiating a connection from the app.
Only some apps are allowed to stream to the PC. Notably, from my experience, you cannot watch TV or certain video content while streaming to the PC..


Pass value of textarea when submit button is clicked

Question: <textarea id="Comment" type="text" runat="server" rows="7"
maxlength="2000" />

<input id="SubmitComment" type="button" value="Submit"
onclick="SubmitButton()" />

When the user enters data into the textarea and clicks the 'Submit' button I want the data to be passed to the submitButton() where I can then send it on to Functions.CommentBoxForInvoiceUpdates
function SubmitButton() {
var commentBoxData = $('#Comment').val();
Functions.CommentBoxForInvoiceUpdates(id, Labour, commentBoxData);
        }

Id and Labour are defined earlier so they work fine, 'CommentBoxData' however is showing up as undefined when I run it through a break point.
Any why the data in the comment box is being sent through when submit is clicked?
Thanks for any ideas
Comment: Can you create a fiddle
Answer: You tagged with asp.net. Sure you are using the rendered IDs?
Answer: Try
var commentBoxData = $('#<%=Comment.ClientID%>').val();


What hand-span is required by alto recorder

Question: I have small hands and I am 4 feet 11 inches.  I was looking into getting an alto recorder. Is the fingering too spread apart for me? Should I just stick to Soprano?
Comment: @Dekkadeci Clarinets are always keyed. Recorders are only keyed where an average person doesn't have the reach otherwise. There are even many tenor recorders without any keys. Altos never have them unless you specifically look for one with keys.
Comment: My mother (who plays all sizes of recorder) had the same problem, but she was able to increase her hand spread via exercises, involving placing wine corks between the fingers of the left hand (which needs to spread more than the right on a recorder).
Comment: I played bass clarinet in school bands starting in elementary school, and I'm currently about 5 feet tall. Both of my hands only comfortably span an octave on the piano and must hit adjacent notes when I try to reach a 9th. I think you can handle an alto recorder just fine.
Comment: You should try a couple of altos and see.  My wife is also about 4'11" and has no trouble with normal altos.  There are expensive alternatives, as people mention in the answers below.  Another one is the Paetzold square plastic tenor, with all keys.  But get a cheap plastic alto and try it out first.
Answer: An alto (treble) recorder is about one and a half (3/2) times the size of soprano (descant).
This means that the 2 spaces (between 3 consecutive holes) on an alto, will be roughly equal to the 3 spaces (between 4 holes) on a soprano.
So three fingers on each hand of the alto will need to span a length that 4 fingers would on a soprano.
Consequently, you can test the span required for an alto recorder, on your soprano recorder easily:

Place your left hand top finger on the top hole, and see whether you can reach the fourth hole down with your third finger, (placing your second finger somewhere between holes two and three):

Similarly with the right hand; place your top finger on the fourth hole down and see if you can reach the bottom hole (twin holes) with your third finger:

NB: While the ratio of an alto recorder to a soprano is 3/2, the ratio of a tenor recorder to an alto is 4/3.
Answer: It's impossible to answer definitely because you'd need to try an instrument to see for yourself if you can cover the holes. There are decent inexpensive plastic recorders available which would enable you to try the compass for yourself, which would be your best option. Whilst tenor and above may be beyond your hand span, many players with smaller hand compass are very comfortable on the alto.
As a much pricier option, Mollenhauer are one manufacturer who make keyed models, providing keys on the 3rd and 4th holes to bring hole 3 closer to 1 and 2, and hole 4 closer to 5 and 6. They would be able to advise on the span required, their customer services contact form is prominently available on their website.
Comment: You can also have keys custom fitted, but that would cost more than $100 per key.
Answer: The American Recorder Society (ARS) says:

Some players with smaller hands will find starting on the alto difficult. ... However, there are models available from ARS Business Members to help players with small hands avoid fatigue when playing. (From the ARS FAQ page; link added.)

In addition to the ARS Business Members, you can try contacting the manufacturer of an instrument that interests you and ask about finger-hole distances. You might also look for someone with expertise in recorders (whether at the manufacturer or perhaps a teacher) who can help you measure your hands and advise on whether alto recorders will work for you. You might find someone through the Recorder Forum discussion site.
Note: I did not find finger-hole distances published online. Allowing I just didn't find them, it seems your best bet will be to contact stores and/or manufacturers.


double coset question

Question: Let $G$ be a group and $H$ a subgroup. Consider $H/G\backslash H$ the set of double cosets of $H$ in $G$. Show $H$ is normal in $G$ if and only if the mapping $f$ from $G/H$ into $H/G\backslash H$ defined by
$f(aH) = HaH$ for all $a$ in $G$ is a bijection. The part of $H$ normal in $G$ implies a mapping $f$ is a bijection is easy. (It was a comment in Bourbaki Algebra).
Answer: If $H$ is not normal, then there exist $a\in G$, $h \in H$ with $a^{-1}ha \not\in H$, so $ha \not\in aH$ and hence $aH \ne haH$. But $f(aH) = f(haH)$, so $f$ is not a bijection.

double coset question


Combine blender with other free programs to make films

Question: I'm a 13 year old who aspires to be a filmmaker, but I don't have money to spend on software. Luckily, Blender is free, and so is HitFilm Express 2017. I know Express doesn't support 3d models, so is there a way I could still use both programs?
Comment: Free programs worth exploring to make films: Resolve (for editing and color correction). Fusion (for compositing). Natron (open source compositing).
Comment: Well, you could use Blender for the bigger VFX stuff and HitFilm for the small stuff. For example, if you wanted to have someone shooting a gun you could use blender for the gun itself, and once you successfully rendered that into the footage you could go into HitFilm and add in muzzle fire. I don't know a lot about HitFilm, but I can see that being a good use for it.
Comment: The answer is yes. This is how most film workflows work, nobody really does 3D stuff directly in editing or compositing software unless its absolutely necessary or convenient for some reason.

Personally what i find useful is to watch tutorials from other more common software like After Effects or Maya and then try to recreate in Blender with the toolset that you have. Most of common techniques still work, they are just named differently in the different programs.

Another thing to consider is that Blender does by itself have an editor and compositor integrated (but they are hit and miss)
Answer: The answer depends a little of what you want to do, but your workflow will usually be to generate video sequences in blender and the export them to the video format you need to edit them in hitfilm. You dont need to support 3D model in HitFilm since blender can export video sequences.
For an animation movie, you just render your sequence and use it as such in hitfilm.
For special effect, blender has a lot of tools that allows to integrate 3D objects in a video,camera tracking, green screen masking, ...
You will import a video in blender (a movie sequence) and add 3D item in the scene, using camera tracking to keep the orientation of the blender camera consistent with the "real life "camera used to make this sequence.
You will use masking to keep a part of your real life object to integrate it in a 3D scene.
You will use object tracking to identify the position of a real life element to attach a 3D object, like a gun to a hand.
Blender can do all of this so the choice of HitFilm won't restrict you for the 3D parts. Only for the editing/compositing part.
Comment: I'd recommend rendering to an image sequence, using png files can keep the alpha to help compositing in hitfilm that you will loose with video files.


problem in case of window service

Question: i made a windows service & add project installer.in which only contain this code.
System.Diagnostics.Process.Start(@"C:\Windows\system32\notepad.exe"); inside the timer tick event & interval is 60 sec.i just wanted to try to run Windows service.
1st-serviceProcessInstaller1 i have been changed its account setting as local system.
2nd-serviceInstaller1 in this case i have been changed its start up type as Automatic.
then i create a setup add another project then right click add project output then add primary output then press ok.
then go to Right click on project->view->custom Action->right click on Install->Add custom Action->select Application folder & add primary output.the same thing done for all the remaining options like commit,rollback,uninstall.
after that i build the setup it build succesfully then i install the setup it installed properly into program file n create one .exe file n one Instalfile.
but problem is that when i search the service into "services.msc" the service is not there.
means service is not showing there.i tried but not getting the ans.plz help me to solve this problem.
Comment: possible duplicate of http://stackoverflow.com/questions/2569365/facing-a-problem-when-i-am-making-a-setup-of-windows-service
Answer: Not the answer to your original question, but

Starting an application with a GUI from a service is a bad idea (tm) and won't work in the majority of cases
Check what kind of Timer you use. .Net provides 3 Timer classes, not all of them work in a service (because they depend on a window's message loop, iirc)

To test any service: Why don't you go for the installutil binary first (bypassing the setup project)? You find it in your framework directory, for example in "C:\Windows\Microsoft.NET\Framework\v2.0.50727".
Answer: I'd suggest trying to install the assembly manually to see if you get any kind of error message.
Just open a Visual Studio command prompt and run InstallUtil.exe [YourService].exe. At least you'll know if it installed properly.
Answer: Even better option is to use the command line tool sc.exe
Try "sc create /?" on command line and see its options.
You can then use "sc start " , "sc stop " & "sc query " to control service. You can use sc.exe to send custom command to the service. Check windows event log for errors related to service installation. It may be .Net version used to create it is not on target machine.

problem in case of window service


HTTP/2 between Nginx reverse proxy and Express

Question: I have an Express web server behind Nginx reverse proxy.
The Nginx is configured for HTTP/2.
Is it better to leave the default http1 connection between Nginx and Express, or is there worth in upgrading Express to HTTP/2 also?
I guess there'll be some performance loss since SSL is required on both, but don't know whether multiplexing (and other improvements) will make up for it.
Comment: Possible duplicate of [Use HTTP/2.0 between nginx reverse-proxy and backend webserver](https://serverfault.com/questions/765258/use-http-2-0-between-nginx-reverse-proxy-and-backend-webserver)
Comment: Do you even need https on your backend connections?!
Comment: It's not a requirement, I'm just thinking in terms of performance, I guessed that HTTP2 should be faster even in this backend combo.
Comment: So are your backends hosted in some other datacenter than your frontends? There's little other reason to bother with TLS here.
Answer: Nginx does not support HTTP/2 for proxy_pass connections so this is not an option.
In my opinion, there is not huge reason to have HTTP/2 all the way through, in a similar way that HTTPS is not required all the way through.
For more details see the answers to this identical question on StackOverflow: https://stackoverflow.com/questions/41637076/http2-with-node-js-behind-nginx-proxy


How to bounce dnsmasq in opensuse 13.1

Question: OpenSuse 13.1 is missing the init.d dnsmasq script. Is there another way to start and stop dnsmasq or is this a bug in suse?
Answer: I'm not that familiar with SuSE but on other distros you can use the service command to stop/start/restart services. Perhaps something like this would do it:
$ sudo service dnsmasq restart

Answer: I just discovered that another way to do this in OpenSuse and Suse is to use Services Manager GUI in YAST.
Just find the service nameed dnsmasq and ensure its enabled and you can start and stop from the GUI. Active = running, Inactive = stopped.
Answer: With OpenSuSE switching to systemd completely in version 12.3, init.d scripts are slowly being phased out.
Although systemd can use init.d scripts, it much prefers .system files instead.
That all being said, OpenSuSE has some nice features that other distros don't have. For example, in OpenSuSE, chckconfig foo on still works to enable services. In other distros, it's been replaced by systemctl enable foo (OpenSuSE can make use of this as well).
As mentioned above, to start a service is through service foo start. In OpenSuSE, the most common way that I've seen is through rcfoo start; however, YaST will work as well. Other distros will use systemctl start foo (again, OpenSuSE can use this as well).

How to bounce dnsmasq in opensuse 13.1


Why we store session id instead of user id inside cookies?

Question: Would not it be better to store user id instead of session id so that we only lookup database once for extracting other user info instead of twice extracting user id from session db then user db?
Comment: User ids are usually predictable and difficult to revoke, take a look at [session hijacking](https://www.owasp.org/index.php/Session_hijacking_attack).
Comment: But a cookie is supposed to be short-lived. If you're not storing the `sessionID` then how do you know if a cookie is expired?
Comment: Ah yes i understand so it is related to expiration purposes, could i store other info then inside the session database along with user id to track user behavior ?
Answer: That would be a very bad idea because a malicious user could change the id they are sending.
If for example the admin has the id 1, and a user the id 101, that user could simply change their id in the cookie to 1, and thus gain admin privileges.
For the same reason, you would not want to send any other relevant data in cookies, as you cannot trust this data (unless it's signed and thus cannot be altered, eg using jwt).
You could of course generate random user ids. But even if we assume that these are unguessable, this would be problematic. It would essentially be the same as if you were sending the password in a cookie. If an id leaks even once, an attacker would gain permanent access as it is unrevokable. Session ids on the other hand expire after a while or can be revoked.
Comment: Could i store other info then inside session database along with user id to track user behavior ?
Comment: @Dodz It probably depends on the details of the implementation, but at least in general, I don't see why not.
Answer: The user ID is a constant value in the database which isn't what you want for handling session tokens in cookies, as the session ID has to change frequently.
As @AndrolGenhald has said, the user ID in a database will probably be easy to predict as it will likely be a number which simply increments with new users. A session ID on the other hand will have a high entropy such that it is very difficult to guess the value of a session ID.


Advantage of exposing data model to customers using our product

Question: We have a product through which we provide a standard definition to customer's asset data. The problem currently lies in importing customer's data from different types of data sources to our data model. I am looking for an option of exposing our data model to customers so that they can populate it accordingly. What are the pros and cons of this approach ?
What are the different ways through which I can achieve this ? Any inputs would be greatly appreciated.
Comment: Are you liable in any way of a customer imports rubbish and/or error causing rows? Does the import table have sufficient constraints, foreign keys, unique constraints, check constraints to stop people importing rubbish? For example if you have a report which joins on a field, and the field is incorrectly duplicated, it will duplicated all joined tables as well, causing incorrect data.
Comment: Keep your friends close, your enemies closer and your customers closer still! :-). If you are going to embark on this (perilous) route, then as @Nick.McDermaid hints, lock it down and lock it down tight. Plus, cover thine ass - make sure that any mistakes are theirs and theirs alone and that they and they alone take responsibility for their own mistakes. From a veteran in those particular trenches.
Answer: One obvious disadvantage is that no matter how good your data model is, it better suit your needs for years to come because you will have just set it in concrete.
I try not to even give app developers access to the the underlying data model. There is a "wall of abstraction" between users and the physical data. That wall is build from a wide variety of views. Just about any format that best fits the user's need can be provided. View triggers do the conversion behind the scenes.
Give your customers whatever logical model best suits their requirement in getting their data to you. So you have to convert it to your current actual model. It sure beats not being able to fix flaws or implement new designs in your database.
Answer: In my opinion, this would vary depending on what your responsibility is for the database. I wouldn't want to expose my data structure to them as they might be able to take advantage through injection and the like. Additionally, it would allow them to form adhoc queries and reports which will most likely cause performance issues that you now need to support.
My thought for inputting user data is to allow them to import CSVs, this would allow for a standard format you can give them and most other programs can export them.


RESOLVED: "Review your contribution" returns a 404 after it worked before on CiviContribute Member Contribution page

Question: This was the base page setting that got corrupted or confused somehow. Making a new one and setting that as the base page in the CRM Settings page resolved my issues.
I'm setting up a new site (https://members.marylandtesla.com). CiviCRM 5.48.0, WordPress 5.9.3, CentOS 9 Stream, PHP 8.0.13.
Had a CiviContribute Member Contribution Page (click on the 'become a member' link to see it) that worked, but it didn't ask what WordPress login was desired and didn't mail the user their credentials when the contribution was processed (note, I'm still using a dummy payment processor for now). Then I remembered I had to go into my Profile used on that page to the Advanced Settings, so I did that, and it's now asking for a WP login to check availability.
I don't think I changed anything else in the meantime, but the Review your contribution link now gives a 404 instead of the actual contribution review page. Tried rolling back the Profile change to no avail, so clearly something else changed.
Searched the web, and found this question was already asked and answered here ("HTTP Error 404.0 - Not Found" error on Contribution page). But I made sure the CMS Database Integration WordPress base page was not blank and is the default civicrm. Tried to change WP Permalink setting but man that caused chaos, so I changed it back to its default.
I also set the redirect URL under the profile to a Thank You page from another answer here.
Turns out this is not just for contribution reviewing. Event registration does the same thing.
Anyone have any ideas as to what I am doing wrong here? Wish I could remember what else may have been changed between "it worked" and "it doesn't." Thanks.
Michael
Answer: Once again just asking the question gave me some more ideas on how to resolve it. Base page got confused, added a brand new one and set the base page to that and it works again.
Comment: you mentioned "Tried to change WP Permalink setting but man that caused chaos, so I changed it back to its default."   What is the default on your site?
Comment: /index.php/%year%/%monthnum%/%day%/%postname%/. The root cause of my problems here were likely me purging the base page without realizing it was the base page.


Setting textfield value back to null for login j2me program

Question: Below is some code which simply allows a user to log in, however i want to be able to reset the value of the text fields userName and password to nothing in the else statement if the user enters the name or password wrong so that is no longer displays their previously entered details. Can anyone tell me how i do this? Also how do you set the characters of the password field to be *** instead of characters so on one can see the entered password.
Many thanks
public class LoginMIDlet extends MIDlet implements CommandListener {

    private boolean midletPaused = false;

    //<editor-fold defaultstate="collapsed" desc=" Generated Fields ">
    private Form SignIn;
    private TextField userName;
    private TextField password;
    private StringItem sim_Result;
    private Form Continue;
    private Command _login;
    private Command _cancel;
    private Command okCommand;
    //</editor-fold>

    /**
     * The LoginMIDlet constructor.
     */
    public LoginMIDlet() {
    }

     public void validateUser(String user, String password) {
     if (user.equals("qm") && password.equals("j2")) {
         switchDisplayable(null, getContinue());
     } else {
         switchDisplayable(null, getSignIn());
         sim_Result.setText("You have entered an Incorred Username Or Password, Please Try Again");
     }
}

Answer: Can you not use the setString() method of the TextField class?  Call it with an empty string "", that will clear the field.
On the password hiding, set constraints on the field, either at construction or after.  See the TextField javadocs for more detail.
Example:
password.setConstraints( TextField.PASSWORD );


weak convergence and unbounded functions with bounded moment

Question: I want to prove the following: Given a topological space (it is a Lusin space, but I think that does not matter) $\Omega$, a function $f \in C(\Omega,\mathbb{R})$ and a sequence of Radon measures $P^{N}$ defined on it that converges weakly to a measure $P$, then
$$
     \mathbb{E}^{P^{N}}\left[ f \right] = \int_{\Omega} f dP^{N} \rightarrow \int_{\Omega} f dP = \mathbb{E}^{P}\left[f\right].
$$
The problem is that the function $f$ is not bounded, i.e. $f \notin C_{b}(\Omega)$ but instead satisfies the condition
$$
      \sup_{N} \mathbb{E}^{P^{N}}\left[\left|f\right|^{1+\varepsilon}\right] \leq C
$$
for an $\varepsilon > 0$. I read this claim in a paper, but unfortunately with neither a proof nor a reference. A similar question was posed in this thread:
weak convergence of probability measures and unbounded functions with bounded expectation
but there we had $\varepsilon = 0$. As far as I can see, the counterexample posted there is not a counterexample here. The result appears to me rather elementary but I haven't found it anywhere yet...
Comment: You tagged the question "probability". Are all the involved measures probability measures? If $\Omega$ is $\mathbb R$ with the usual topology, then we pick $R$ and a function $\chi_R$ with values in the unit interval, value $1$ on $[-R,R]$ and $0$ outside $[-R-1,R+1]$. The assumption on $f$ show that the contribution of $\int_{\mathbb R}f(1-\chi_R)$ is not important, and you can use the weak convergence for the part $\int_{\mathbb R}f\chi_R$.
Answer: I give an answer for probability measures, as it seems from your questions that this is the setting you are interested into.
This follows from the following theorem contained in van der Vaart - Asymptotic Statistics. I will cite directly from that book:
A sequence of random variables $Y_n$ is called asymptotically uniformly integrable if
$$
\lim _{M \rightarrow \infty} \limsup _{n \rightarrow \infty} \mathrm{E}\left|Y_n\right| 1\left\{\left|Y_n\right|>M\right\}=0 .
$$
Uniform integrability is the missing link between convergence in distribution and convergence of moments.
Theorem. Let $f: \mathbb{R}^k \mapsto \mathbb{R}$ be measurable and continuous at every point in a set C. Let $X_n \rightsquigarrow X$ where $X$ takes its values in $C$. Then $\mathrm{E} f\left(X_n\right) \rightarrow \mathrm{E} f(X)$ if and only if the sequence of random variables $f\left(X_n\right)$ is asymptotically uniformly integrable.
Example. Suppose $X_n$ is a sequence of random variables such that $X_n \rightsquigarrow X$ and $\lim \sup \mathrm{E}\left|X_n\right|^p<\infty$ for some $p$. Then all moments of order strictly less than $p$ converge also: $\mathrm{E} X_n^k \rightarrow \mathrm{E} X^k$ for every $k<p$.
By the preceding theorem, it suffices to prove that the sequence $X_n^k$ is asymptotically uniformly integrable. By Markov's inequality
$$
\mathrm{E}\left|X_n\right|^k 1\left\{\left|X_n\right|^k \geq M\right\} \leq M^{1-p / k} \mathrm{E}\left|X_n\right|^p .
$$
The limit superior, as $n \rightarrow \infty$ followed by $M \rightarrow \infty$, of the right side is zero if $k<p$.
Therefore your condition implies asymptotic uniform integrability, that in turn gives weak convergence even if the $f$'s are unbounded. This is true as long as the moments are bounded at least as you specified.


Total number of spanning trees of a set of graphs

Question: Given an undirected graph G with $n$ nodes, we can compute its number of spanning trees in polynomial time using Kirchhoff's matrix-tree theorem. Now consider a more complicated setting, in which each of the $n$ nodes in the graph has $m$ versions and each version has different connectivity with the other nodes of the graph. The connectivity between different versions of different nodes can be encoded with a 4-dimensional array A where A[i][k][j][l] is 1 iff the $k$-th version of node $i$ is connected by an edge with the $l$-th version of node $j$. Therefore we have $m^n$ different graphs. We want to compute the total number of spanning trees in these $m^n$ graphs. The brute-force approach that computes the number of spanning trees in each graph separately would require exponential time. My question is whether there is a polynomial-time algorithm.
Comment: Why don't we simplify the problem? Choose $t$ edges which share no vertices, and ask to count the total number of spanning trees in the $2^t$ graphs which have all possible subsets of these $t$ edges. Is there a way to do this in polynomial time?
Comment: Actually, there is. This is equivalent to counting each spanning tree $2^k$ times, where $k$ is the number of edges they contain from this subset. Now, just make a multigraph where you replace each of these edges with two edges and use Kirchhoff's theorem.
Answer: Can't this problem be used to compute the permanent of a 0-1 matrix? Since permanent is a #P-complete problem (harder than NP), there is very unlikely to a polynomial-time algorithm.
Suppose you have an $n \times n$ matrix $M$ that you want to compute the permanent of. Construct a graph on $2n+1$ vertices, where there is a special vertex $v$ which has one copy, and $n$ of the vertices $x_1$ $\ldots$, $x_n$ have only one copy, while the remaining $n$ vertices $y_1$, $\ldots$, $y_n$, have $n$ copies each. On the $i$'th copy of vertex $y_j$, connect it to $x_i$. Connect the $i$'th copy of $y_j$ to $v$ if and only if the entry $M(i,j) = 1$.
Now, for $x_i$ to be in the spanning tree, you must have chosen the $i$'th copy of $y_j$ for some $j$. So we must have a permutation $\pi$, where we have chosen the $\pi(j)$ copy of vertex $y_j$. For this permutation to be a spanning tree we must have $M(\pi(j), j) = 1$ for each vertex $j$. This shows that the permutation $\pi$ yields a spanning tree if and only if it contributes $1$ to the permanent of $M$. Thus, the number of spanning trees is the permanent of $M$.


Uninstalling Ubuntu for a fresh start

Question: After failing countless times to install ubuntu to dual boot with windows 7, I decided to try to get rid of all things ubuntu and try again. There is no partition in my hard drive that I can find at this point, but when I go to re-install Ubuntu it says that I already have 2 OSes installed, and I can't use the normal install alongside option. Is there anything I am missing that is making it think there is something left?
Answer: Windows can't read Ubuntu partition, so you can't see it on Windows. When you have 2 OS's there should be an Erase Ubuntu ... and reinstall option with warning. It's exactly what you need.

I mean the second option in this screenshot.
Alternative
You can alternatively select Something else which shows you all your partitions, then:

be careful and don't do what you're not sure about;
select the Ubuntu partition, on which it's currently installed;
click on change/edit button [I can't remember the word];
set the type as ex4, check for format, and set / as the mount point.

That's it. This will format your current Ubuntu partition and reinstall everything again.
Answer: You need to use a partition tool to find out how many and which partitions you have. With Windows 7 you will probably have 2 (1 for system and the other for Windows itself).
Partition tools can be Computer Management tool on Windows 7, or Gparted Live iso for example.
After seeing the partitions you should create the partitions where you want to install Ubuntu.
Comment: Looking at it in Partition wizard I have 3 Partitions in my hard drive, one (unlabled) that is FAT, one labled Recovery(NTFS) and one Labled OS (NTFS) then the USB I have been using for ubuntu the live CD. After looking in there and in windows explorer I haven't been able to find any trace of ubuntu. I am aiming to reinstall ubuntu with the dual boot option that was in the installer in the live CD, it had it's own partition slider-thing.
Comment: Yes do that. It appears that you don't have an Ubuntu partition
Comment: That doesn't show up when I boot the live CD, it says I already have two OSes
Comment: Remove the USB, burn a iso into a CD or DVD and try again.
Comment: Ok, I will try that.
Answer: Open Computer Management by clicking the Start button , clicking Control Panel, clicking System and Maintenance, clicking Administrative Tools, and then double-clicking Computer Management.   If you are prompted for an administrator password or confirmation, type the password or provide confirmation.
In the Navigation pane, under Storage, click Disk Management.
There you can see all your partitions and you can delete/format it including the Linux partitions.
Best Advice : Delete the Linux Partition and then extend your Windows partition(by right clicking on the Windows partition).
Boot up Ubuntu and select the option install Ubuntu alongside with Windows. Then you will get a slider to allocate required space for Ubuntu partition. This will make installation much more easier
Comment: There is no Linux Partition, and when I boot Ubuntu, there is no option to install alongside.
Answer: I screwed up my first install of ubuntu and decided to start over. I just went into the Windows control panel, add/remove programs, and uninstalled ubuntu. ubuntu went away completely, even in the boot options on the machine, and I re-did the install successfully.
Answer: Use the Live-CD or Live-USB, choose Try Ubuntu. Then use the installer, and when you see the options 'Install inside Windows', 'Re-Install Ubuntu', etc, there should be an option 'Something Else'. In that option you should see all the partitions in your Hard Drive.
Another thing you can do to see the partitions is, once in the Live version, open the terminal (ctrl+alt+t) and use:
<code>sudo -s
fdisk -l
</code>
The /dev/sda corresponds to the hard drive, and the /dev/sdaX (where X is a number) represents different partitions.
I guess you don't see the Ubuntu partitions in Windows because they're in a diferent file system (ext2, ext3 or ext4) and Windows recognizes only FAT16 FAT32 and NTFS file systems.
Anyway, in case there are or not Ubuntu partitions, use the 'Somthing else' option to format the existing Ubuntu partitions, or create them if they don't exist.
PS: the Ubuntu version I used is 12.10, maybe other versions don't have this option in the installer...

Uninstalling Ubuntu for a fresh start


Do Tron video games include any canon expansion to the storyline

Question: There are a few Tron Video games. Do they expand the story of Tron? If so, do those expansions considered canon?
Comment: I know there was at least one game (Tron 2.0? maybe?) that expanded the storyline, and *Legacy* took a different direction that negated the game's story.  Not familiar enough with the details to answer properly though.
Comment: This is just my opinion, but I tend to assume video games based on a movie (or a book) are not canon sources, unless the authors explicitly say they are.  Likewise, I don't consider movies based on a video game to be canon to the established video game storyline.  They have their own canon, but are effectively "alternate universes."
Comment: I agree that they are not canon unless stated as canon. That is why I am asking.  Are there any statements regarding canon games? :-)
Answer: Tron: Evolution is apparently canon for in between the first and second movies. Tron 2.0 (killer app) was questionably canonical until the second movie came out.
Teeeeechnically during the Tron ARG there was a version of Space Paranoids which we could play, which would technically make it a canon game even without any storyline.
None of the other Tron games have enough story to be canon.
Comment: When Tron 2.0 came out, somebody from the original film's creative staff said that the game was the official continuation of the story.  I can't recall who it was, though maybe I can find the interview again.  Obviously, this was subsequently retconned.
Comment: @Buzz right, that was my point, I just expressed it poorly. Thank you for clarifying and for the confirmation :)
Answer: There were only 2 arcade games I've ever seen. 1, was the most fun-Discs of Tron. You were on a platform or 2 or 3. Your opponent on the other side. You'd throw discs back and forth off the walls, and use a shield to block un-dodgeable projectiles. The other, had a few different scenarios-piloting a light cycle being one of them. I failed to finish either game, but there is nothing mentioned on the arcade cabinets regarding any story. The games themselves are just games with the movie title thrown in to generate sales. Anything after 1990/95 would be new to me-such as Kingdom Hearts 2 or whatever anyone else is talking about. Those first 2 games did come out back in the 80s, and they were completely different.
Answer: Here is an article on the TRON Wikia concerning what is and isn't canon. Apparently, the only canon game is TRON: Evolution. To sum it up, the following are canon:

TRON
TRON: Legacy
TRON: Evolution (Game)
TRON: Uprising

The following are not canon:

TRON 2.0 (Game)
TRON 2.0: Killer App (Game)
TRON: The Ghost in the Machine
TRON: Evolution - Battle Grids (Game)

(Note the events in TRON: Betrayal and Evolution differ in how Clu
took over the TRON system, with TRON: Evolution depicting the events
to be very close to the film.
According to Dave (a friend of Steven Lisberger, the creator and
director of TRON), TRON is the only story that is truly
canon.[citation needed] TRON 2.0's storylines differ from Lisberger's
original intentions of the characters and the story, therefore, TRON
2.0 should be considered as its own canon. TRON: Legacy effectively ignores most of the material shown in TRON 2.0.
Comment: Does the wikia have any sources for how it deduces what is and isn't canon? It claims that "Dave" said something, but has no citation, this could just be made up, for all we know.
Comment: That article didn't list any citations unfortunately, but I think it's basing these claims on how the story in the games conflicts with the story in the movies or is confirmed by them. TRON 2.0 was released 7 years before TRON: Legacy, and the hostile merger of Encom with fCon and all that was never mentioned in Legacy. In Evolution, which was also released before Legacy, some events that happened in the game were mentioned in the movie (Flynn saving Quorra in the Outlands, etc). David Warner is the actor that played Sark and Ed Dillinger in TRON. I will see if I can dig up that quote...


How do you restart a app in google play store?

Question: I need to restart an app to fix a bug but i don't know how
Comment: What app? What do you mean 'restart an app in the Play Store'?
Answer: I'm not sure what kind of phone you have, but when I need to restart an app on my Samsung S8, I pull down the menu on the main screen and select the setting icon. Then the Apps menu, once in here I select the app I want to force restart and select it. It will bring up the option to uninstall or force stop. Force stop the app. Now that it is truely down, it should be able to restart from its normal icon.
Comment: Sometimes after pressing on the app, going to the storage label and clearing storage does it.


Can You Redeem a PSN Code for a Game You Already "Own" through PS Plus?

Question: If you get a "freebie" game via Playstation Plus and later decide that you want to own the game independently of your subscription, can you enter a code for a game (say from Amazon) while your PS Plus subscription is still active? What if your subscription lapses, can you then buy/redeem a code for a game?
Answer:
You cannot purchase a game that is already listed on your current PSN account as "Purchased" (which these free games are). You would have to wait until your subscription expires or make a separate PSN account.
I sort of answered this in part 1, but yes, if your sub is no longer active you are free to purchase any games you had for free on PS+ (otherwise they would essentially be locking people out of buying certain games if they choose to no longer use PS+, which would just be a terrible business model).

Some info found from this post.
Comment: It is disappointing that you can't directly buy a game you got through PS+, but according to that post it seems you might be able to if it comes in a bundle. I wonder if you buy a code from Amazon for a game that you got for "free"from PS+, if PSN will let you redeem it and own the game indefinitely. Any notion?
Comment: @P.M. - Hmmm... Interesting question. It's possible and I would *hope/think* that's what would happen. Worst case scenario, I would think that they don't let you redeem, but your code would not expire (I'm not 100% sure on this) and you could just redeem whenever your subscription ends.
Comment: It appears that you cannot. I have a code for a game I already got through PS+, and when I try to confirm the use of the code after inputting it and being shown the information about the game it is for, I get the error "The code you entered may not be correct or may no longer be valid. Please check your entries."


Connect a M.2 (B & M) key SSD into a B socket

Question: I have bought a SSD with M.2 socket (B & M) key, but my computer just have a B key socket. My question is if I can connect the SSD in this B socket, and would it work correctly?
Comment: Are the B and M key on the picture not reversed?
What is here named B key ( on the right) supports 4 pcie lanes
Comment: The picture is from wikipedia, https://en.wikipedia.org/wiki/M.2
Answer: It should... a B&M module should work with either a B or M socket, this is by design.

The B interface provides x2 PCIe, SATA, USB 2.0 and 3.0, audio, UIM,
  HSIC, SSIC, I2C, and SMBus support. The M interface provides x4 PCIe,
  SATA, and SMBus.

Source

If your module is B&M SATA (most likely), connecting it to a B or M socket should work fine since both types support SATA.
Of course, being a bootable device is another story, this depends on your hardware and UEFI.
Answer: No, you cannot. If the socket only have 1 keyed, then you have to only insert 1 keyed NOT B+M keyed m.2. i already tried, its not working.
Comment: Their SSD can be installed in a M.2 slot with a B or M slot.  Their SSD absolutely is supported.


HDMI TV not showing as audio output in System Preferences

Question: I have linked a cable from my MacBook Air to my TV via HDMI but cannot get volume on the TV. I have gone into preferences-sound but their is no facility to change 'internal speakers'. How can I do this?
Answer: If you are using a Mini Displayport to HDMI adapter this should help you.  If you are using Mini-DVI to HDMI adapter then you will have to get audio from your headphone port via an external cable because DVI is strictly video.
Comment: because I am not tech savvy I assume that the little adapter I purchased from Mac Book Air is not sufficient to power audo to TV.    Because I cannot change 'audio output' on Mac perhaps it will never work and I will need the eternal speaker via headphone port???


Coordinate translation in QGis?

Question: Is there a way to apply an arbitrary coordinate translation to a layer in QGis 2.8.2? I have some data sets that are in a truncated coordinate system, and I need to shift them by a certain amount to line up with the real world coordinate system.
Comment: I believe you can do this in the CRS definition by tinkering with the parameters.
Comment: I thought about doing this, but the CRS screen doesn't let me edit the proj+ line. I'll keep looking...thanks!
Comment: I would try affine transformation. v.transform seems to do it and then there should be this http://plugins.qgis.org/plugins/qgsAffine/. However, I can't install the latter with the plugin manager. But I am not sure what you mean with arbitrary. Affine is not arbitrary. For more flexible "rubber sheet" warping with warping vectors I would use OpenJUMP.
Comment: There is a plugin called 'vectGeoref' that might help. (I think it is experimental.) I've never used it so I'm not putting this forward as an answer.
Comment: I am working on a site where mine coordinates are state plane coordinates minus 800,000 in X and minus 2,300,000 in Y, so in order to use layers generated in mine coordinates, I need to shift the layer by +800,000 in X and +2,300,000 in Y in order for them to be overlaid properly with layers that are in actual state plane coordinates. Thank you all for your suggestions!
Answer: In QGIS, you can take the CRS definition, go to Settings -> Options -> Custom CRS, and paste it there as a new CRS.
If it is a projected CRS like transverse mercator, lambert or albers, you can set or modify the projection with a false Easting +x_0 or false Northing y_0.
For geographic CRS with degrees as units, you can modify the +towgs84 parameters.
Having saved your custom CRS, you can Rightclick -> Set Layer CRS to apply it to your datasource.
Using a plugin for affine transformation might be easier, see

AffineTransformations
Vector Bender
vectorgeoref

plugins. You might have to enable experimental plugins in the settings tab to see and install them.

Coordinate translation in QGis?


cakephp validation message not showing

Question: i am new to cakephp and am trying to build an app in it. I have some textfields, i wish to have validation on them. I following cakephp tutorials in cakephp.org and did the following but i cant see the validation messages near the textfields. Following is my code:
ctp:
   <?php echo $this->Form->text('Rideoffer.PickFrom',
                                                array('class' => 'address-text',
                                                    'value' => $dropFrom));  ?>

model:
public $validate = array(
         'PickFrom' => array(
        'rule' => 'notEmpty',
        'message' => 'Cannot leave this field blank.'
    ),
    //'PickFrom' => 'notEmpty',
    'DropAt' => 'notEmpty',
   // 'born'  => 'date'
);

where am i getting wrong? how do i solve it?
Comment: refer http://book.cakephp.org/2.0/en/index.html
Answer: You have used comma in dropat
public $validate = array(
         'PickFrom' => array(
        'rule' => 'notEmpty',
        'message' => 'Cannot leave this field blank.'
    ),
    //'PickFrom' => 'notEmpty',
    'DropAt' => 'notEmpty'
   // 'born'  => 'date'
);

Answer: You can use this
    Form->text('Rideoffer.PickFrom',
                                 array('class' => 'address-text',
                                       'value' => $dropFrom,
                                       'error'=>'Cannot leave this field blank.'));  ?>

cakephp validation message not showing


Can I find out why this question was deleted?

Question: Can I find out why this question was deleted and whether there are changes that could allow it to be undeleted? I have found an answer and would like to post that.

https://dba.stackexchange.com/questions/302471/why-does-access-recalculate-a-stored-query-when-i-copy-it-can-i-tell-it-not-to
Answer: The question was automatically deleted by the system because it seemed 'abandoned'.
This is explained in the Help Centre entry, "The Community user deleted my question! What gives?":

If the question is more than 365 days old, and ...

has a score of 0 or less, or a score of 1 and a deleted owner
has no answers
has no active bounty
is not locked
has view count <= the age of the question in days times 1.5
has 1 or 0 comments
isn't on a meta site

... it will be automatically deleted. (These are termed "abandoned"
questions in the code.)

The idea being to clean up questions no one has shown interest in.
Since you want to add an answer, that is clearly no longer true. I have undeleted the question.
Answer: I don't know if you can see the question timeline; as its author, I imagine you should be able to. After you originally had posted it, some site members thought it wasn't a good question and suggested it be closed. It hadn't seen any activity for a year, so it was automatically deleted after that.
If you think it's valuable enough, you can always post another question and answer it, though I think it is not on topic on this site. Perhaps this site would be a better fit.


Script to save main InDesign book document INDB as an IDML

Question: We are looking for a JSX script that can save a copy of the INDB as an IDML after save. The .indb is the main book document in Adobe InDesign CS5/6. The code would be roughly similar to the one below for INDD to IDML but in our case specific for the .indb book document itself. Other persons have asked this same question in recent years (on Adobe forums).
StackExchange INDD-IDML
Answer: In Adobe InDesign scripting, there isn't a direct way to access individual documents within a book file and export them to IDML automatically.
To achieve the task of converting individual documents within a book file to IDML, you would need a more complex script that programmatically opens each document, exports it to IDML, and then closes it. Here's Indesign script that you can use for this purpose:


Applescript voice control

Question: I'm trying to create an app to toggle voice control on and off, as for some reason Catalina removed the link between dictation and voice control thus ridding itself of the ability to use a keyboard shortcut for voice commands. I'm trying to ad that back by creating an app. Am ridiculously disabled (think one step below paralysed) and for my setup this functionality had become very useful.
Here is what I have so far, but unfortunately its not working:
tell application "System Preferences"
    reveal pane id "com.apple.preference.universalaccess"
    delay 1
    tell application "System Events"
        tell window 1 of application process "System Preferences"
            select table 1 of scroll area 1
            delay 0.1
            select row 12 of table 1 of scroll area 1
            delay 0.1
            click checkbox "Enable Voice Control"
        end tell
    end tell
    quit
end tell

It highlights the correct row in the accessibility options but doesn't quite get as far as clicking the checkbox. Results in this error:
The action "Run AppleScript" encountered an error: "System Events got an error: Can't get checkbox "Enable Voice Control" of window 1 of application process "System Preferences"."

System Events got an error: Can't get checkbox "Enable Voice Control" of window 1 of application process "System Preferences".

Could someone please offer some direction on where I'm going wrong?
Thank-you!
Answer: Seems like this sorted it:
tell application "System Preferences"
    reveal pane id "com.apple.preference.universalaccess"
    delay 1

    tell application "System Events"
        tell window 1 of application process "System Preferences"
            select row 12 of table 1 of scroll area 1
            delay 0.1
            click checkbox "Enable Voice Control" of group 1
        end tell
    end tell
    quit
end tell

Applescript voice control


add CSS classes on ajax update?

Question: I have a JSF app and I generate
s dynamically based on some data.
For each cell I dynamically generate the css class and I write all the classes in the *.jsf File (using ResponseWriter)
A simplified resulting page:

    Jill
    Smith

    Eve
    Jackson

The table can be very big and it is possible for cells to share the same style.
The cell styles can change based on some user input in the table. I can update the cell on ajax request overriding  UIComponent.visitTree(VisitContext context, VisitCallback callback)
but I have no idea if and how I can add additional css classes.
Answer: I think I have found a solution: inside UIComponent.visitTree(VisitContext context, VisitCallback callback) I can rewrite the cell () and add the

add CSS classes on ajax update?


Irreducible polynomial of $\mathrm{GF}(2^{16})$

Question: I'm implementing some code for the Galois field $\mathrm{GF}(2^{16})$. Which irreducible polynomial do you recommend that I use?
Answer: This table contains a list of primitive polynomials written in octal. The first entry in that table for $GF(2^{16})$ is
$$
210013_8=x^{16}+x^{12}+x^3+x+1.
$$
IOW each octal digit gives 3 coefficients of the polynomial, the least significant bits correspond to lowest degree terms.
For many a hardware implementation a low weight polynomial is better - particularly for generating $m$-sequences, so you may want to support those. For reasons of compatibility / portability / independent verification on a different program you may also consider the primitive polynomial used by Matlab. I no longer have a copy on my laptop, so cannot tell, which polynomial they use.
If you decide to generate discrete logarithm tables as part of your program initialization, then you can support several primitive polynomials! The logic of the construction of the said table (and its inverse table, if judged useful) is independent from the exact form of the primitive polynomial.
Comment: "...you may also consider the primitive polynomial used by MATLAB. I ... cannot tell, which polynomial they use." - Jyrki, [apparently it's $x^{16}+x^{12}+x^3+x+1$...](http://www.skynet.ie/~moonpie/college/4th%20year/sem1/MatLab/comm/comm/gfprimdf.m) so, exactly what you gave. ;)
Comment: Of course, if you don't do discrete log tables, then there is no compelling reason to use a **primitive** polynomial. But I would recommend doing that. For implementing multiplication of two elements of the field a couple of table look-ups (and a modular addition of discrete logs) is a good approach.
Answer: I would recommend giving some thought to a different alternative.  GF$(2^{16})$ is a degree-$2$ extension field of GF$(2^8)$, that is, each element of GF$(2^{16})$
can be represented as a polynomial $a_0 + a_1z$ where $a_0, a_1 \in \text{GF}(2^8)$,
and so arithmetic operations in GF$(2^{16})$ become polynomial arithmetic operations in GF$(2^8)$.  While the latter would take more time than the log table
approach that can be used directly in GF$(2^{16})$, extensive subroutine libraries
have been developed already for arithmetic in GF$(2^8)$ and you might be able
to use them to save development effort and cost.
I will also suggest that the modular addition of discrete logarithms that @Jyrki has recommended be modified a little to avoid modular arithmetic, and also the
unstated need to check if a multiplicand is $0$ before looking up its logarithm.
By defining a suitable "value" for the logarithm of $0$, multiplication can
be implemented via two table lookups, an addition, and another table lookup
to get the product, without the need for testing the operands or for modular
reduction following the addition.  This is much faster.
See here for ideas as to what can be done in this regard.
Comment: +1 What a nice idea! (The doubled-up LUT) I know a dude who needs to do a little bit of coding sometime soon. When I needed this the most, I was battling against the 64 kByte barrier of a segment, so then this might not have been best. But that is a thing of the past, now. Of course, this won't necessarily do away with all the modular arithmetic, as sometimes one may want to compute powers using the log table - and doubling the range won't do then. But I often use a LUT of Frobenius automorphisms to aid that anyway, and then this trick will help very much.
Comment: And to get a multiplicative inverse you can take a suitable 2s complement of the logarithm, and offset that by a fixed amount (that I can't be bothered to compute right now...)


What does leak in memory/info leaks?

Question: When a binary is running and there is some memory/info leak are there areas of program (or OS?) memory which are more prone to leak and is a leak in one segment worse than in another segment?
Answer: Generally, programs running in userspace don't have access to kernel space memory. As a result, it is overwhelmingly unlikely that a program would be able to leak kernel memory.
The memory being leaked depends heavily on the program running. A famous example is Heartbleed, which leaked all sorts of information regarding the TLS process and contents of communications of other users. Concretely, this means:

Private Keys
Passwords
Sensitive Personal Data
etc.

This, of course, would be the worst case. Some internal states of your program, such as "how many more bytes need to be sent to this user", are of very little relevance to an attacker. Depending on the specific memory leak, it may be possible for an attacker to determine what sort of data is being leaked, or it might be completely random. In the latter case, an attacker would need some form of analysis to determine what the data being leaked means.
For example, if I gave you 01bf7621 6dd8317f 820c5ab1, then you really wouldn't know what that means unless you had some sort of context.
Comment: Any region where a leak would be more prevalent (code,stack,heap...)? I'd expect that leaks somewhere where the programs interacts with the external world would occur more often? Not sure if true.
Comment: @larsmitsars You can't really tell which one is more prevalent, it depends entirely on the vulnerability. If you insist on an answer, then as a completely unsourced gut feeling, I'd say the heap tends to be more affected in practice.

What does leak in memory/info leaks?


Is there an orbit decay associated with synchrotron radiation of a relativistic particle?

Question: I had a question about a particle (say a proton) with relativistic energies interacts with a magnetic field (in the z direction). As it is accelerates the particle emits synchrotron radiation. Naturally I assume that this emission of photons reduces the particle's energy. My question is as the energy decreases is there a change of orbit (orbit decay) associated with the emission of synchrotron radiation?
Comment: possible duplicate of [Why doesn't the LHC accelerate electrons?](http://physics.stackexchange.com/q/112483/)
Comment: Hi Pierre. The question I've linked isn't an obvious duplicate, but it does answer your question.
Comment: Thank you @JohnRennie, the link is very helpful. I can't comment on DarioP's answer. I'm interested in how to derive the energy loss for any particle on an arbitrary curved path. Any advice?
Answer: Yes, there is an orbit change which is however rather small for one turn (one revolution) in a electron synchrotron (Protons almost don't radiate at usual energies around 1-10GeV and don't do it at even higher energies , however they will radiate in the Future Circular Collider) . Actually, all e-synchrotrons are equipped with a set of radio-frequency cavities which restore the lost energy. So due this compensation the orbit change is very small and only reflected in a small variation of the beam energy of the order of 1 promille of the total beam energy. Orbits that leave dipoles  actually vary in function of the beam energy (dipoles generate "dispersion", i.e. an orbit that varies with energy) , but as the energy deviation is very small it actually only leads to a small increase of the horizontal beam size which is subsequently corrected by other beam optic elements. The exact effect of the emission of synchrotron photons on a particle orbit is a bit more involved because the considered particle usually exerts transverse "betatron" oscillations which get actually damped by a combined effect of synchrotron radiation emission and energy compensation in the radio-frequency cavities.
If the radio-frequency cavities, however,  are switched off, the orbit will "slowly" spiral inside, "slowly" means that if you start with a electron beam of 3GeV during 1 turn each electron looses for instance 1MeV around 3000turns are needed for the beam to loose its full energy (this is an approximation), 3000turns correspond about 2.7 milliseconds.  However,  the spiral motion typically is interrupted as soon as the beam particle hits the vacuum chamber wall of the vacuum system.
Comment: Wonderful answer, what do you mean by FCC and promille. Also do you have a particular text where I can find the derivation of synchrotron and betatron oscillations?
Comment: A rather good introduction is written by K.Wille: "The physics of accelerators: An Introduction". The original edition is in German.
Comment: I forgot: the FCC is the "Future Circular Collider", the successor project of the LHC at CERN.
Comment: Much appreciated!


Differential Equation Question $y'=\frac{1}{\cos y-x}$

Question: I want to find the solution for the first order differential equation
$$y'=\frac{1}{\cos y-x}$$
I have no clue what to do, what I tried is:

$$(\cos y-x)dy=dx$$
$$\frac{dy}{dx}=\frac{1}{\cos y-x}$$

hints will be welcomed,thanks.
Answer: Hint: Consider $\frac{dx}{dy}$.
Comment: I am still dont get it. I need to write it as $y'+p(x)y=q(x)$, but you want to do as $x'+p(y)x=q(y)$?
Comment: @OfirAttia You don't always _need_ to write it as $y^{\prime}+p(x)y=q(x)$; $x^{\prime}+p(y)x=q(y)$ is equally valid since it's still a linear equation.
Comment: We get $\frac{dx}{dy}=\cos y-x$, or equivalently $\frac{dx}{dy}+x=\cos y$, a nice **linear** equation.
Answer: Rewriting the equation as
$$
(x-\cos y)y'+1=0
$$
and putting $M(x,y)=1$ and $N(x,y)=x-\cos y$,
$$
M(x,y)dx+N(x,y)dy=0
$$
We see that the equation is not exact because
$$\frac{\partial M(x,y)}{\partial y}=0\neq 1=\frac{\partial N(x,y)}{\partial x}.$$
We have to find an integrating factor $\mu(y)$ such that
$$
\mu(y)M(x,y)dx+\mu(y)N(x,y)dy=0
$$
is exact, that is $$ \frac{\partial \mu(y)M(x,y)}{\partial y}=\frac{\partial \mu(y)N(x,y)}{\partial x}. $$
We find that $\mu$ must satisfy $\mu'(y)=y$ so that $\mu(y)=e^{y}$.
Multiplying $(x-\cos y)y'+1=0$ by $\mu(y)$ one has
$$
e^{y}(x-\cos y)y'+e^{y}=0
$$
Let $A(x,y)=e^{y}$ and $B(x,y)=e^{y}(x-\cos y)$; this is an exact equation because
$$
\frac{\partial A(x,y)}{\partial y}=\frac{\partial B(x,y)}{\partial x}=e^{y}.
$$
Let $F(x,y)$ such that $\frac{\partial F(x,y)}{\partial x}=A(x,y)$ and $\frac{\partial F(x,y)}{\partial y}=B(x,y)$; so the solution of the equation is given by
$$
F(x,y)=C
$$
with $C$ an arbitrary constant.
Integrating $\frac{\partial F(x,y)}{\partial x}$ with respect to $x$ one has
$$
F(x,y)=e^yx+\psi(y)
$$
where $\psi(y)$ is an arbitrary function of $y$. Differentiating $F(x,y)$ with respect to $y$, we find
$$
\frac{\partial F(x,y)}{\partial y}=e^yx+\psi'(y)=B(x,y)=e^{y}(x-\cos y)
$$
so that
$$
\psi'(y)=-e^{y}\cos y
$$
and solving
$$
\psi(y)=-\frac{1}{2}e^{y}(\cos y+\sin y)
$$
Finally
$$
F(x,y)=e^yx-\frac{1}{2}e^{y}(\cos y+\sin y)
$$
so the solution is $F(x,y)=C$:
$$
e^yx-\frac{1}{2}e^{y}(\cos y+\sin y)=C
$$
or
$$
x=\frac{1}{2}(\cos y+\sin y)+Ce^{-y}.
$$
Answer: HINTS 1st order non-linear differential equation.
take all the terms to one side then multiply both sides by x-cos(y) .. this is not an exact equation. So have to find the integrating factor.
answer will be ((e^y) * x) - 0.5*e^y*(cos(y)+sin(y))  = c
Answer: Hint: let $$z=y+\ln|x|$$
This will lead you to $$\frac{de^z}{de^y}=\pm\cos(\ln e^y)$$
It's easy to calculate $\int\cos(\ln x)dx$.
Answer: If you use the hint of @Andre Nicolas your DE becomes a linear eqn. in $x$:$$\frac{dx}{dy}+x=\cos y$$ (the roles of $x$ and $y$ are interchanged) with the integrating factor $e^y$. So the solution to ths eqn. is $$x=e^{-y}\int e^y \cos ydy+ce^{-y}$$


How can I recreate this polygon/wire effect?

Question: Sorry for not providing more info, I just don't know where to start with this, would be cool to learn how to recreate this effect.
Answer: That cannot be done with any photo filtering effect. If you apply some polygon mesh filtering to a photo it cannot create polygons which are like perspective images of polygons on a 3D surface. That's because filters cannot guess the missing depth info.
It can be a drawing where the mesh lines are drawn with extreme care to create an illusion of 3D surface mesh. Human reasoning has in that case had the needed 3D knowledge.
I bet it's a 2D image of a manually colored version of real 3D surface mesh. As well it can be a manually colored version of 2D image of 3D surface mesh.
Creation of 3D meshes is possible in 3D programs. One can also buy them. If a 3D mesh is too dense (=made accurate for high res 3D purposes) one can decimate it to sparse enough for 2D art like this.
Manual drawing of 2D image lookalike of 3D mesh is possible in drawing programs such as Illustrator or Inkscape. Technically it's easy, but needs an extreme ability to see the needed paths right. I guess people who made images as metal or wood engravings, had that ability but nobody ever asked them to imitate computer style surface meshes.
Actual detailed creation process in 2D and 3D are beyond the scope of this answer, but I can show a shaded 3D model of a simple thing (much simpler than the head) and the surface mesh of it.

In Illustrator one could fill the areas in the mesh for ex. with the shape builder. The mesh is finally a bunch of lines. The apparent nodes in your image could be round arrowheads in illustrator.
Comment: Damn, didn't think this was that complicated, this is beyond my abilities to recreate unfortunately. Thank you for the provided information.
Comment: I agree with @user287001 - this looks like a low res poly sculpt, completed in any one of the major **3D DCC** (**D**igital **C**ontent **C**reation) packages out there (*Modo, Blender, Maya, 3DS, Cinema4D, Lightwave*) working in poly mode. I don't *think* it was done in a sculpting-specific tool like *Mudbox* or *zBrush* - really looks like straight poly modeling to me. The base head was done with symmetry on, and the mane had symmetry off when it was sculpted.


Finding MacBook power status from command line (AC plugged in, or not)?

Question: I want to start some rsync jobs in macOS Sierra 10.12 when the power and home network are connected, I know how to use the ipconfig command to check the IP address, but is there anyway to tell whether the power is connected besides grepping the system_profiler? (Which seems a lengthy exercise to get the small snippet)
Comment: `pmset -g batt` shows the state of the attached power source. See if that works for you.
Answer: The pmset command has much shorter output than system_profiler:
pmset -g batt

The first line on my MacBook says "Now drawing from ..." either "AC Power"  or "Battery Power" when it runs.
Answer: pmset -g batt | head -n 1 | cut -d \' -f2
You can just use the delimiter to and escape the single quote to get the extracted text.
Answer: Maybe help extracted text
pmset -g batt | head -n 1 | cut -c19- | rev | cut -c 2- | rev

output
Battery Power
AC Power


Where i can find this properties panel in blender 2.79

Question: i am trying to find this properties panel in blender 2.79 but i am not able to find it, can you guys tell me that does this panel exists in blender 2.79 or not?
Answer: In 2.7 the background images don't work the same way as in 2.8. If you want to load a background image you need to open the N panel, enable Background Images and load your image. Then you can only change the settings you see in the N panel, you can't manually move the image in the 3D view and you don't have access to any settings in the Properties panel:

That said, you can create an Empty > Image, then you have some settings in the Properties panel > Object Data. It doesn't work as a Background or Reference image, but you can use it as such:


How to run wires through a wall with existing wall wiring? (Tight Spaces)

Question: So I have a coaxial cable that I need to run from my TV to my sound system and there are already holes in the wall with wires from the last home owner. I've already tried using fishtape to run the cable through but there are too many twists and turns in the route. Are there any other options that I can explore to wire the cable through?
Comment: Are you replacing the wires or running more?  Unless they're stapled, it's really easy to use old wires to pull new wires.
Comment: I'm running more wires. The existing wires are not stapled but they are jam packed into the holes that are drilled into the 2x4 studs.
Comment: Use a flex-shaft drill to bore a new hole to run the new cables? Haven't used one, but they have the advantage of minimizing the need to damage the wall surface... Note that code foes set limits on how many power wires may pass through a given sixe jole; I'm not sure how low-voltage cables interact with that rule.
Comment: @kelsham - there is no bundling issue with low voltage cables.  Using a flex bit can be tricky along existing wiring.
Comment: @SwagPanda - I gather from your comments that you're trying to run the cable horizontally - I'd just do as Ed Beal says in his answer.
Answer: their are times I will cut a hole for an old work box, drill from the attic down or from the crawl space up (attic down is easier as you can see the 2x4) drop a string with a small 2oz fishing weight,  hook wire on and pull up, then do the same at the location of your sound system , install an old work box in each location these are the boxes that have wings that pull them tight to the sheetrock, or a low voltage ring that snaps in place and you fold the metal tabs around the sheetrock, then put a coax cover plate and it looks very profesional.
Answer: I have had good luck disconnecting one of the existing wires and tying two "pilot" lines to it.  Then, I use the wire to pull the pilot lines back through and untie one pilot line, leaving the other tied to the wire.  I pull the wire back through and reconnect it.  This leaves a pilot line that I can use to pull new cables.  Obviously, you should ensure that the wire you use to pull the two pilot lines is not hot before using it for that purpose.
Comment: If you are talking about line voltage electrical cables, these are usually stapled (if installed correctly). Also, repeatedly pulling electrical cables beyond the original installation is an invitation to damaging them. A broken AC cable in a wall is an ugly thing.
Comment: @bib I was assuming that the caution about hot wires would be enough.  However, he is right, SwapPanda, do this cautiously and not too much.
Comment: Thanks. But there are no electrical shocks associated with this project, the nearest hot wire is 6 feet away horizontally and 2 feet away vertically. The problem is that there are already 6 existing cables running through the holes in the studs and they are very tight, almost unable to be pulled, there's no slack to it.


Proper placement of Shel Yad

Question: The halacha, as set forth by the Mishna Berurah (27:4), requires the Shel Yad to be above the area where the bicep begins to become elevated. I've read that there is a dispute regarding whether the elevated part of the bicep is determined when to arm is outstretched, or when the arm is at a 90-degree angle. Does anyone have a source for one (or both) sides of this dispute?
Comment: Others will remember the sources for the discussion of the tall thin tefillin that were in style a couple of decades ago, as a way of being able to make them fit on the muscle even when the arm is bent. However, that seems to be a strong piece of evidence that the real halacha is, the muscle when the arm is outstretched: because no one ever heard of the issue till then, and people have been wearing large tefillin for centuries with no one complaining.
Comment: @Mich Exactly. Two is crowded. Three or two modern size ones, not a chance. Even one modern Chabad bayit is a stretch
Comment: @MichoelR R Yosef Karo's tefillin was tall and narrow. In early days people used to wear much smaller tefillin than is popular today.
Comment: Yeah, sure. But if I remember right, I saw the גר"ז and the ערה"ש both suggest that a lot of problems would be avoided with bigger tefillin. Certainly Chabad has been using big tefillin for a long time. Using small tefillin is not evidence (unless they say that's why), using big tefillin is. Especially because it seems that there is actually room for _two_ tefillos of the hand where we put just one.
Comment: Ben Ish Chai and the Taz talk about wearing Rashi and R"T at the same time, one above the other...
Comment: There's certainly room for two small tefillin. Two giant Chabad tefillin, not so sure. A couple hundred years of Chabad use isn't so long in the scheme of things. Giant tefillin are obviously easier to manufacture, but to wear them is another story
Comment: "There's certainly room for two small tefillin." You sure? There isn't that much room when the arm is bent. And the kadmonim are giving two etzbaos as more-or-less the standard size and there's room for two of them, and many/most of them hold it has to be from the midpoint of the muscle and down? Crowded.
Comment: @DoubleAA, how do we know about R' Yosef Kiaro's tefillin?
Comment: @mor he writes the dimensions somewhere in beit yosef iinm
Comment: Okay, I measured my arm. Bent, 10 cm from elbow to end of muscle. Half of that, 5 cm = way less than four etzbaos = not nearly enough room for two tefillos. Straight, 15 cm / 2 = 7.5 cm, more-or-less enough room for two tefillos of two etzbaos. I'm 5'10".
Comment: @MichoelR the tradition of two by two etzbaos is only for tefillin shel rosh (at least, that's the simplest read of most sources)
Comment: Interesting. Thanks, I'll watch for that.
Answer: Quote for https://www.hasofer.com/html/tefillinposition.html:
Lowest point for tefillin begins where the biceps muscle starts to elevate and is normally bulged. The tefillin must never pass below this point! {Mishna Berura 27:4} With your arm outstretched (according to the ruling of Harav Hagaon Rabbi Y. S. Elyashiv, shlita) as in the above diagram, you should carefully check your arm to recognize exactly where your biceps muscle starts to bulge, and always make sure the tefillin are positioned slightly higher than this point so that they will remain in the correct placement area even if they slip down a little.
Answer: Trying to turn a discussion in comments into an answer:

The Shulchan Aruch and the Rema (27(1)) poskin like the opinion that
the arm tefillah should be put on the half of the muscle toward the
elbow. (The Gr"a points out that every other Rishon argues and
allows the entire muscle. And the Aruch Hashulchan there actually
holds that the entire upper arm is kosher.) But the minhag is like
the Shulchan Aruch: on the bottom half of that muscle.
Orach Chaim 32(41), starting with the Tur:
The Bach in OH 32 (also Keset Hasofer, Ch. 21) says that both
the hand and the arm tefillin should lechatchilah be at least two
etzbaos (fingerbreadths) (that includes the תיתורא base section
surrounding the בתים), according to the שימושא רבה. Others argue
(see the Shulchan Aruch Harav there) and say that the שימושא רבה was only
discussing the head tefillah; the arm one can be smaller, down to
one etzba.
The conclusion of the gemara in Eiruvin 95b is that the arm
has room for two tefillos.
Various recent poskim (see there the Shulchan Aruch Harav, Aruch Hashulchan, Keset Hasofer and especially the Mishnah Berurah)
caution against tefillin that are too small; they say that it is
very likely that the result will be parshiyos that are badly written
and actually posul. However, the Mishnah Berurah also cautions
against tefillin that are too big, that is, larger than 4 etzbaos,
saying that they will likely not fit in the required area and
the person will not fulfill his obligation.
Some communities (Chabad) use large tefillin, and pretty much everyone today
that I
see uses ones that are well bigger than two etzbaos (always meaning,
including the תיתורא).

Okay! I am of average dimensions, 5'10'', and I measured my arm. Bent, 10 cm from elbow to end of muscle. Half of that is 5 cm = way less than four etzbaos = not nearly enough room for two tefillos. Straight, 15 cm / 2 = 7.5 cm, more-or-less enough room for two tefillos of two etzbaos each, or one big one of four.
So I ask you. How is that no one (that I saw) from around the time of the Mishnah Berurah even discussed the fact that for normal people a tefillah shel yad of four etzbaos is way too big to wear? It's certainly too big for me. Chabad has apparently been using them for a long time, and never noticed a problem. We are all strict to put them on the bottom half of the muscle, we all have pretty big tefillin these days, and until twenty years ago no one noticed that they don't fit!
The easiest conclusion is that the muscle is measured with the arm extended, in which case I would have enough room for one tefillah of 4 or two of 2, and so would most others.
There may be other solutions. Since the present situation is a combination of chumros, perhaps all poskim happened to hold in ways, different ways, that avoid the issue. The Gr"a and most Rishonim may just have put the tefillah in the middle of the muscle. Pretty much everyone else may have used smaller tefillin till recently and held that the hand tefillin isn't two etzbaos. If so, maybe only Chabad need hold that the muscle is measured extended. The rest of us might be stuck, trapped between several chumros with no way to wear our large tefillin.
It would still be surprising that no one discussed the issue. [Of course, I may just be ignorant of those who did.]

Proper placement of Shel Yad


Principal roots in the derivation of the quadratic formula

Question: The following is an abbreviation of a common derivation of the quadratic formula:
$$
ax^2+bx+c=0\\
\vdots\\
\sqrt{(x+\frac{b}{2a})^2}=\sqrt{\frac{b^2-4ac}{4a^2}}\\
x+\frac{b}{2a}=\frac{\pm\sqrt{b^2-4ac}}{2a}\\
x=\frac{-b\pm\sqrt{b^2-4ac}}{2a}\\
$$
Following the square root extraction, the equation should have three plus-minus signs:
$$
\pm(x+\frac{b}{2a})=\frac{\pm\sqrt{b^2-4ac}}{\pm2a}\\
$$
But instead there's only one. Is it because the signs cancel each other out, or are moved from one expression to the other (through multiplication in $-1$ or $\frac{-1}{-1}$) in six of the eight permutations that the three plus-minus signs allow; or is it a matter of choosing a principal root for some arcane reason beyond the scope of elementary algebra (eg. branch points)?
Comment: A simpler way of looking at it is if $u^2 = v^2$, then $u = v$ or $u = -v$.
Comment: One avoids at least half the problem by initially not dividing by $a$, but multiplying by $4a$.
Comment: "Multiplying by $4a$": http://math.stackexchange.com/questions/49229/why-can-all-quadratic-equations-be-solved-by-the-quadratic-formula/49243#49243
Answer: There shouldn't be $2$ plus-minus signs in the fraction:
$$\sqrt{\frac{b^2-4ac}{4a^2}}=\pm\left(\frac{\sqrt{b^2-4ac}}{\sqrt{4a^2}}\right)=\frac{\pm\sqrt{b^2-4ac}}{2a}$$
Once we put the plus-minus sign up, we simplify the radicals without worrying about plus-minus signs.
Why don't we have the plus-minus sign on the left side?
Well, if we have (as N.F.Taussig mentions) $$u^2=v^2$$, then it simplifies down to $u=\pm v$ or $\mp u=v$.
We just decided to put it on the right because we were solving for $x$.
You don't want two plus-minus signs because they sort of merge into one plus-minus sign:
$$\pm u=\pm v$$
$$u=\pm(\pm v)=+v,-v$$
It can only come out to be positive or negative, and so we just merge it together.
Answer: Cancellation and "moving" signs (as you put it) are one explanation for why only one $\pm$ sign is required. We know that
\begin{gather}
\frac{-p}{-q} = \frac{p}{q}, \\[.5ex]
-\left(\frac{p}{q}\right) = \frac{-p}{q} = \frac{p}{-q}, \\[.5ex]
p = -q \quad\text{if and only if}\quad -p = q.
\end{gather}
Using these facts we can show that the next four equations
are all equivalent, and hence by stating any one of them we also imply
that each of the others is true:
\begin{align}
x+\frac{b}{2a} &= \frac{\sqrt{b^2-4ac}}{2a}, &
x+\frac{b}{2a} &= \frac{-\sqrt{b^2-4ac}}{-2a}, \\
-\left(x+\frac{b}{2a}\right) &= \frac{-\sqrt{b^2-4ac}}{2a}, &
-\left(x+\frac{b}{2a}\right) &= \frac{\sqrt{b^2-4ac}}{-2a}.
\end{align}
The following four equations also are all equivalent to each other:
\begin{align}
x+\frac{b}{2a} &= \frac{-\sqrt{b^2-4ac}}{2a}, &
x+\frac{b}{2a} &= \frac{\sqrt{b^2-4ac}}{-2a}, \\
-\left(x+\frac{b}{2a}\right) &= \frac{\sqrt{b^2-4ac}}{2a}, &
-\left(x+\frac{b}{2a}\right) &= \frac{-\sqrt{b^2-4ac}}{-2a}.
\end{align}
By asserting the equation
$$\pm\left(x+\frac{b}{2a}\right)=\frac{\pm\sqrt{b^2-4ac}}{\pm2a},$$
then, assuming we can choose each of the $+$ or $-$ signs independently,
we assert that at least one of the previous eight equations is true.
So either one of the first four of those equations is true, in which case
$x+\frac{b}{2a} = \frac{\sqrt{b^2-4ac}}{2a}$
(as implied by any of those four equations),
or one of the other four of those equations is true, in which case
$x+\frac{b}{2a} = \frac{-\sqrt{b^2-4ac}}{2a}$.
That is, the equation with three $\pm$ signs is simply asserting that
$$
x+\frac{b}{2a} = \frac{\sqrt{b^2-4ac}}{2a} \quad\text{or}\quad
x+\frac{b}{2a} = \frac{-\sqrt{b^2-4ac}}{2a},
$$
which is just what we mean when we write
$$x+\frac{b}{2a} = \frac{\pm\sqrt{b^2-4ac}}{2a}.$$
It is simpler, however, if we apply the rules of sign cancellation, etc., earlier in the procedure, as detailed in the previous comments and answer, so that we never end up with three $\pm$ signs in the first place.
Answer: There are 2 roots and 4 possibilities. Which two will you eliminate? Answer is in the selection criterion.
Answer: Actually, there're cyclic properties for higher order equations.
For cubic  $x^{3}+3px=2q$,
$$x_{k}=e^{\frac{2i\pi k}{3}} \sqrt[3]{q+\sqrt{p^{3}+q^{2}}}+
        e^{\frac{4i\pi k}{3}} \sqrt[3]{q-\sqrt{p^{3}+q^{2}}}$$ for $k=0,1,2$.
We have same set of roots by writting $x_{k}$ as
$$e^{\frac{4i\pi k}{3}} \sqrt[3]{q+\sqrt{p^{3}+q^{2}}}+
  e^{\frac{2i\pi k}{3}} \sqrt[3]{q-\sqrt{p^{3}+q^{2}}}$$
For biquadratic $x^{4}-2ax^{2}+b=0$,
$$x=\pm \sqrt{a \pm \sqrt{a^{2}-b}}=
\pm \sqrt{\frac{a+\sqrt{b}}{2}} \pm \sqrt{\frac{a-\sqrt{b}}{2}}$$
Four combinations of $\pm$ signs giving four distinct roots.
Also de Moivre's quintic $x^{5}+5ax^{3}+5a^{2}x=2b$,
$$x_{k}=e^{\frac{2i\pi k}{5}} \sqrt[5]{b+\sqrt{a^{5}+b^{2}}}+
        e^{\frac{8i\pi k}{5}} \sqrt[5]{b-\sqrt{a^{5}+b^{2}}}$$ for $k=0,1,2,3,4$.
It also gives same set of roots by writing $x_{k}$ as
$$x_{k}=e^{\frac{4i\pi k}{5}} \sqrt[5]{b+\sqrt{a^{5}+b^{2}}}+
        e^{\frac{6i\pi k}{5}} \sqrt[5]{b-\sqrt{a^{5}+b^{2}}}$$
Last but not least, there are $n$ roots for $n$ degree polynomial equation.  Redundancy of root (don't mess up with multiple roots) means you've done an extra cycle, but make sure you don't miss any.
Answer: The  solutions of $Y^2=(b^2-4 a c)/4 a^2\;$ are $\;Y=+\sqrt {b^2-4 a c}/2 a\;$ and $\;Y=-\sqrt {b^2-4 a c}/2 a.$
If $(x+b/ 2 a )^2=Y^2$ then $x+b/2 a$ must be equal to one of these solutions or to the other.
So $x+b/2 a=\pm \sqrt {b^2-4 a c}/2 a$.


Find all files added by a Git user?

Question: In Git, how can I simply find all of the files that were added to a repository by a particular user?
Answer: git whatchanged --author="author regexp" --diff-filter=A --no-commit-id --name-only

Better methods are likely to be available.
Answer: Try to use below command:
 git whatchanged --diff-filter=A --author=AUTHOR --pretty=format:%an | awk '{print $6}'

Answer: According to the current documentation (v2.41.0), new users are encouraged to use git-log instead of git-whatchanged.
Here's the modified version of the originally accepted answer from 12 years ago:
git log --author=AUTHOR --format="" --diff-filter=A --name-only --no-commit-id

Find all files added by a Git user?