Google Maps Hidden Div Overflows half map

Question: I'm using Google maps, with Drawning Manager

    var latlng = new google.maps.LatLng(41.7318187, 44.8627138);

    var mapOptions = {
        zoom: 8,
        center: latlng,
        disableDoubleClickZoom: true
    }

    bounds = new google.maps.LatLngBounds();

    map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);
    //Define a symbol using SVG path notation, with an opacity of 1.
    var lineSymbol = {
        path: 'M 0,-1 0,1',
        strokeOpacity: 1,
        scale: 4
    };

    drawingManager = new google.maps.drawing.DrawingManager({
        drawingControl: true,
        drawingControlOptions: {
            position: google.maps.ControlPosition.TOP_CENTER,
            drawingModes: [
                google.maps.drawing.OverlayType.MARKER,
                google.maps.drawing.OverlayType.POLYLINE
            ]
        },
        markerOptions: {
            icon: $imgFolderFullPath + '/' + $('#TourObjectType').val() + '.png',
            draggable: true
        },
        polylineOptions: {
            strokeColor: $("#LineType").val()
        }
    });

    drawingManager.setMap(map);

The problem is when map renders some element that has visibility hidden and z-index 107 which overflows half of the map and i cant insert, edit, move, poly lines and markers in that part

DOM structure of the problematic part looks like this :

...

and also when i comment visibility hidden in the code snippet above, there is something like white comment box with star shown on the map
i what to know what causes the problem
Answer: I can not tell you why this occurs, only that for me it also does in the example that is provided in the documentation. You can't draw in that area, but you can zoom into it, etc.
https://developers.google.com/maps/documentation/javascript/examples/drawing-tools.
EDIT: It seems to be a bug with the signed-in mode, as @MrUpsidown pointed out
Comment: 1 week ago it worked perfect when i started building map, it seems they updated version and have a bug,  aaaahg
Comment: Not a bug in the drawing manager. It comes from the signed-in mode. See my answer. Here is an example map with DrawingManager and no issue, until you add the signed-in mode: http://jsfiddle.net/upsidown/k0ye3v9z/
Answer: This happens when the signed_in=true is used.
Bug report: https://code.google.com/p/gmaps-api-issues/issues/detail?id=7788
I added a link to this post in the bug report for reference. Hope Google will fix that very soon.


assign AD GPO to a specific set of computers: what mechanism?

Question: (In exploratory mode: not sure what is the right question to ask, and how to ask it. Also, new to AD GPOs: please forgive lack of clarity in the question.)
Question: how do I assign an Active Directory GPO to a specific computer, or a set of computers, through which mechanism?
(Easy to follow concrete steps or examples, please? Do not answer with "use ABC mechanism" one-liners, please.)
Goal(s):

set up a GPO that disables Windows Defender on target computers

why: there's another antimalware agent running and there seems to be a severe resource contention between Windows Defender and that agent, and that other vendor recommends disabling Defender (but doesn't say how, exactly). Also, apparently Windows Server (unlike Windows 10 or 11) doesn't allow to manage multiple security providers through Windows Security app, does not disable Windows Defender when another security provider is installed, and does not allow that other provider to disable Defender

assign that GPO to maybe one AD computer to start with, confirm the policy is working as expected, then roll it out to more computers

Note(s):

the computer(s) in question are all Windows Server editions
... and are domain-joined (AD)

What I tried:

Created security group "Defender Disabled" in AD, and added a target computer to it as a member

in Group Policy Management on a DC:

Created "Windows Defender AV - disable" GPO by loosely following the steps in "Can't disable Windows Defender by using group policies" thread
In that GPO scope, under Security Filtering, added "Defender Disabled" security group - which didn't seem to do anything

This is where I got stuck:

What is the best practice in assigning a GPO to a set of computers?
How can I confirm a given GPO was indeed applied to those computers? (E.g. in case of Windows Defender and disabling it through a GPO, what are the symptoms of the desired configuration change taking effect on the target computer?)

P.S. I am about 6-8 hours into this, and have 30+ tabs open after doing 10+ relevant searches and reading through a bunch of articles including "Why can't we link GPO to an AD container?", "Use Group Policy settings to configure and manage Microsoft Defender Antivirus", and more. It's probably on me that it's this challenging - yet I am hoping I am not the only one in this boat.
Thank you!
Answer: You're on the right track using security group filtering to apply a GPO to specific computers. This is the most effective way.
I noticed in your process you left out the step of linking your new GPO to an OU that contains your target computer.
Another thing to note when working with security group filtered policies is they won't apply until the group member has refreshed their Kerberos token, which normally requires a reboot for computers and logging off/on for users.
To properly apply a security group filtered policy you should check the following:

The group contains the correct user/computer principal you are trying to apply the policy to.
The security group has the 'apply policy' permission on the GPO, and 'apply policy' is disabled for 'Authenticated Users'.
The GPO is linked to an OU the user/computer is within (does not need to be the direct OU, just one above them)
GPO inheritance is not being blocked on any OUs between the user and the OU the GPO is linked to.
The GPO user and/or computer setting is enabled, depending on which settings are being applied. Settings from the user policy must be applied to user principals and settings from computer policy to computer principals.
The GPO setting is not in conflict with the same setting configured in another GPO which has a higher precedence.

Once you have confirmed all of those steps, you can use rsop.msc on the target computer to confirm the applied setting. Right click on Computer or User configuration and select properties to see a full list of policies and their application status. You should see your new policy in there once it is linked to the OU.


How to summarise pattern in binomial-type expansion into a single expression

Question: I have a series of polynomials as follows:
\begin{eqnarray}
&1\\
&1+4x^3+x^6\\
&1+20x^3+48x^6+20x^9+x^{12}\\
&1+54x^3+405x^6+760x^9+405x^{12}+54x^{15}+ x.^{18}\\
& \vdots\tag{1}
\end{eqnarray}
and I want to find a general expression that will generate these.
I have noted that the coefficients follow a recognised (and documented) pattern:
1;
1, 4, 1;
1, 20, 48, 20, 1;
1, 54, 405, 760, 405, 54, 1;
1, 112, 1828, 8464, 13840, 8464, 1828, 112, 1;
1, 200, 5925, 52800, 182700, 273504, 182700, 52800, 5925, 200, 1;
1, 324, 15606, 233300, 1424925, 4050864, 5703096, 4050864, 1424925, 233300, 15606, 324, 1; ...

My initial researches have identified that the coefficients of my polynomials are those listed in the first set of numbers (above),which is the known integer sequence A181544 as listed at https://oeis.org/A181544.
The listing goes on to give the generating function for the polynomial coefficients:
Row generating functions begin:
(1) = (1-x)*(1 + x + x^2 + x^3 + x^4 +...);
(1 + 4*x + x^2) = (1-x)^4*(1 + 2^3*x + 3^3*x^2 + 4^3*x^3 +...);
(1 + 20*x + 48*x^2 + 20*x^3 + x^4) = (1-x)^7*(1 + 3^3*x + 6^3*x^2 +...);
(1 + 54*x + 405*x^2 + 760*x^3 + 405*x^4 + 54*x^5 + x^6) = (1-x)^10*(1 + 4^3*x + 10^3*x^2 + 20^3*x^3 + 35^3*x^4 +...); ...

and provides a combinatorial formulae for doing so.  For row $n$ the $k^{th}$ term where $0<k<2n$ is:
\begin{equation}
\left\{\sum_{k=0}^{2n} \binom{n+k-1}{k}^3 x^{k}\right\} \left(1-x\right)^{3n+1}
\end{equation}
I have two problems:  (1) I am unable to generate the given example polynomials from this expression - how is that done ? and (2) my polynomials are in powers of $x^3$, (see (1) above). How do I modify this algorithm to generate these?
Answer: The expression given in the OEIS header seems to have a mismatch between the $n$ in the binomial coefficient and the $n$ in the exponent on $1-x$. If you change the displayed formula to
$$\left(\sum_{k\ge 0}\binom{n+k-1}k^3x^k\right)(1-x)^{3n-2}\,,$$
it will give you the correct results for row $n$. For instance, for row $2$ you get
$$\left(\sum_{k\ge 0}\binom{k+1}k^3x^k\right)(1-x)^4=(1-x)^4\sum_{k\ge 0}(k+1)^3x^k\,,$$
exactly as in the second line in the table of row generating functions. If you number the rows starting with $0$ instead of $1$, it becomes
$$\left(\sum_{k\ge 0}\binom{n+k}k^3x^k\right)(1-x)^{3n+1}\,;$$
it appears that they inadvertently mixed the expressions for the two origins.
It seems to me that the simplest way to generate your polynomials is to generate these and then multiply every exponent on $x$ by $3$.


Rewriting ∃! using predicate logic expressions ( "=" excluded)

Question: A(x) is a predicate logic formula. A is a property (predicate), x is a variable. ∃!A(x) would mean that exactly one x exists which has the property A.
First thing that comes up is: ∃x( A(x) ∧ ∀y( A(y) → (x=y) ),
where y is a variable, but my assignment forbids the use of functional symbols such as =.
How do I rewrite this without using any functional symbols? Only the use of →, ⇔, ¬, ∨, ∧, ∃, ∀, variables, formula A(x) and brackets are allowed.
My idea was to simply write this: ∃x( A(x) ∧ ∀y( A(y) → (A(x)⇔A(y)) )
not sure if it's correct, though.
Thank you in advance.
By the way, the question is not a duplicate, as I'm trying to rewrite this without the use of =.
Comment: Is the use of equality forbidden? It is not a functional symbol. In most current versions of first-order logic, it is a basic logical symbol. I do not understand $A(x)=A(y)$, that is not a well-formed formula.
Comment: As André said, the second version is incorrect since you said $A$ is a predicate and not a function; however, the first one should be correct. BTW, you say $=$ is forbidden yet you use it in the second version?
Comment: Also, $=$ is a binary predicate, not a function (a function returns an object, so you can write things like $f(x) = y$, while $(x=y) = z$ makes no sense).
Comment: I'm sorry, I meant to write ⇔ instead of =. Well in my course, we were told that equality (=) is a basic binary functional symbol. We use it as =(x,y) .... which basically translates to x=y. Would ∃x( A(x) ∧ ∀y( A(y) → (A(x)⇔A(y)) ) be correct, then?
Comment: @P.Lance No - in fact, what you've written is exactly equivalent to $\exists x A(x)$; can you see why?
Comment: @StevenStadnicki After saying it out loud,I kind of can. Guess equivalence doesn't substitute equality, my mistake. Any ideas on how to rewrite this without =, then? Or if that's even possible?
Comment: It's a little strange for = to not be a valid symbol - in the language of set theory there are some reasonable definitions for equality, but most of those require at least $\in$.  You might have a look at https://en.wikipedia.org/wiki/First-order_logic#Equality_and_its_axioms , but I would speak to your professor first.
Comment: Now that this question excludes "=", it is not a duplicate.
Comment: @P.Lance Can you please clarify in your question what the informal "exactly one $\;x\;$" means, in terms of →, ⇔, ¬, ∨, ∧, ∃, ∀ (specifically excluding $\;=\;$ and something like $\;\in\;$)?  I mean, given two things, call them $\;x\;$ and $\;y\;$, when are they 'the same'?  Because the way I see it, "exactly one" only means something if you have a notion of 'sameness'.  And since neither $\;x=y\;$ nor $\;\forall z (z \in x \Leftrightarrow z \in y)\;$ may be used, what other formula do you want to use of '$\;x\;$ and $\;y\;$ are the same'?
Answer: You could possibly write it out in second order logic, encoding the following:
$$\forall B~(|A| \ge 0) \land ((A \cup B = \emptyset) \lor (A \subseteq B))$$
If $A$ is empty, then $|A| \ge 0$ fails.
If $|A| = 1$ then $\forall B$ can be partitioned into two cases,

$A \cup B = \emptyset$, in which case the proposition holds
$A \cup B \ne \emptyset$, in which case the proposition holds ($A$ only has 1 element, that element must be in $B$ if they have an intersection)

If $|A| > 1$, then presumably there is a $B$ where $|A \cup B| = 1$ and $A \not \subseteq B$, such as $A = \{X, Y\}$ and $B = \{X\}$.  So the proposition doesn't hold.
So the proposition only holds when $|A| = 1$, and always holds when $|A| = 1$.  Encoded it is:
$$\exists ! x~A(x) \equiv \forall B()~\bigg(\exists y ~ A(y) \land
  \bigg(\bigg(\forall z ~ \lnot A(z) \lor \lnot B(z)\bigg) \lor \bigg(\forall w ~ A(w) \implies B(w)\bigg)\bigg)\bigg)$$


Strictly positive inner product for a pair of non-zero, positive operators.

Question: Let $ A,B $ be non-zero positive operators on a infinite-dimensional separable Hilbert space $(H , \langle \cdot, \cdot \rangle)$. I am required to prove that there exists $u' \in H$ such that
\begin{alignat*}{2}
\langle Au' , u'\rangle >0 \ \ \text{and} \ \ \langle Bu', u' \rangle >0.
\end{alignat*}
I am quiet stuck with this problem. For a few things I have tried. It is obvious that there exists $v,w \in H$ such that
\begin{alignat*}{2}
\langle Av, v \rangle > 0 \ \ \text{and} \ \ \langle Bw, w\rangle>0.
\end{alignat*}
And I have tried to calculate
\begin{alignat*}{2}
\langle A(v + w), v +w \rangle
\end{alignat*}
for which I have to now show for instance $ \text{Re} \langle Av, w \rangle \geq 0 $. Alternatively I could try to directly find a positive operator $E$ such that
\begin{alignat*}{2}
\langle Eu \ , \ u\rangle \leq \langle Au, u \rangle \ \ \text{and} \ \ \langle Eu , u \rangle \leq \langle Bu, u \rangle.
\end{alignat*}
I have also tried to apply orthogonal projections and polarisations, etc, but to no success. Hopefully it's some trivial details which I have missed.
The spectral theorem for bounded self-adjoint operator is not at my disposal.
Could anyone provide me with some hint? Thanks!
Comment: I must be missing something here. If these are strictly positive bounded (so defined on the whole space) operators, doesn't every vector satisfy that?
Comment: @KeithMcClary Nonzero and positive doesn't make them strictly positive.
Answer: Let $v,w\in H$ be as you have defined them.  For $t\in[0,1]$ put $x_t=tu+(1-t)w$, and define $f,g:[0,1]\to [0,\infty)$ by
$$f(t)=\langle Ax_t,x_t\rangle,\quad g(t)=\langle Bx_t,x_t\rangle.$$
Note that $f$ and $g$ are non-zero polynomials (of degree at most $2$).  Argue that there is some point $t_0\in[0,1]$ such that both $f(t_0)>0$ and $g(t_0)>0$, which proves the result.
Answer: Suppose $\langle u,Au\rangle=0$ and $\langle v,Av\rangle>0$. Then from $$0\le\langle u+tv,A(u+tv)\rangle=2t\mathrm{Re}\langle u,Av\rangle+t^2\langle v,Av\rangle$$ it follows that $\mathrm{Re}\langle u,Av\rangle=0$. Similarly, by replacing $t$ by $it$, we get $\mathrm{Im}\langle u,Av\rangle=0$, so $\langle u,Av\rangle=0$ whatever $v$. Hence $$\langle u+v,A(u+v)\rangle=\langle v,Av\rangle>0$$
Similarly for $B$, assuming $\langle v,Bv\rangle=0$ and $\langle u,Bu\rangle>0$, $$\langle u+v,B(u+v)\rangle=\langle u,Bu\rangle>0$$


Convolution of distributions defined on a particular interval

Question: Suppose you have a random variable $Z=X_1+X_2$, where $X_1$ and $X_2$ are distributed identically with the following probability distribution function (pdf):
$$
p(X_i=x)=
\begin{cases}
    1-\frac{x}{2},& \text{if } 0\leq x\leq 2;\\
    0,              & \text{otherwise.}
\end{cases}
$$
If I wanted to convolve these two distributions, I thought I could just take the integral
$$p(Z=z)=\int_0^2{\left(1-\frac{z-t}{2}\right)\left(1-\frac{t}{2}\right)dt}$$
but that integral evaluates to $\frac{4}{3}-\frac{x}{2}$. Since $Z$ should be valid on the interval $0\le Z \le 4$ the pdf would look like:

However, this doesn't make any sense. The pdf should never be negative. I've tried different bounds of integration, etc., with no luck. What am I missing here?
Answer: If $f(x)$ is the pdf of $X_1$ and $X_2$, then the convolution is
$$ f_Z(z)=\int_{-\infty}^{\infty}f(z-t)f(t)\;dt=\int_0^2f(z-t)f(t)\;dt $$
since $f(t)$ is zero if $t<0$ or $t>2$.
However, you also have to take this fact into account for $f(z-t)$. For instance, if $z=1$ then the requirement $z-t\geq 0$ implies that we must have $t\leq 1$ in the integral. Similarly, if $z=3$ then $z-t\leq 2$ implies that $t\geq 1$. So you need to be more careful with your bounds before substituting in the definition of $f$.
Answer: Okay, I figured it out thanks to the answer by carmichael561.
I knew I had to do something about changing bounds of integration, but was getting confused on how to do so. The trick is you have to split the function for $p(z)$ into two different convolutions:
$$p(z) =
\begin{cases}
    \int_0^z{p(z-t)p(t)} = z-\frac{z^2}{2}+\frac{z^3}{24},& \text{for } 0\leq z\leq 2\\
    \int_{z-2}^2{p(z-t)p(t)} = \frac{8}{3}-2z-\frac{z^2}{2}+\frac{z^3}{24},              & \text{for } 2\le z\le 4
\end{cases}
$$
it's easy to check that these are a good probability distribution as their integral adds to 1:

Also, the probability distribution is continuous:

Here is an image of the probability distribution:


I'm confused about default access modifier of C# interface members

Question: What is the access modifier of interface methods? It should be public or protected because you have access to them when you implement them (which makes sense). It also should be abstract because they don't have implementation. But lately I've been reading a book called CLR Via C# and the chapter about interfaces says the following

The CLR requires that interface methods be marked as virtual. If you do not explicitly mark the method as virtual in your source code, the compiler marks the method as virtual and sealed.

When you mark the interface member virtual compiler complains that the access modifier in not valid. I mean no access modifier is valid for anything in interface rather than the default one which is given to them by compiler right? Can anyone make it clear for me?
Comment: There is a difference between the implementation details of the CLR and the specified behavior of the C# language. Not all that surprising. The CLR requires that interface methods be virtual, but you don't declare them that way in C# because you can't override them in a derived class.
Answer: Interfaces (C# Programming Guide)

Interfaces can contain methods, properties, events, indexers, or any
  combination of those four member types. For links to examples, see
  Related Sections. An interface can't contain constants, fields,
  operators, instance constructors, destructors, or types. Interface
  members are automatically public, and they can't include any access
  modifiers. Members also can't be static.

And about interface members implementation:

To implement an interface member, the corresponding member of the
  implementing class must be public, non-static, and have the same
  name and signature as the interface member.

So you can't implement an interface member using protected one.
Answer: Don't agree with your comment:

The CLR requires that interface methods be marked as virtual. If you do not explicitly mark the method as virtual in your source code, the compiler marks the method as virtual and sealed.

esp because you mentioned CLR Via C#, I am sure you have mis-read. Bible can not be wrong.
Edit: Providing more details.
As suggested by others, you can not have a access modifier (or virtual) in an interface member.
By default (and by definition) all members inside an Interface are public and abstract.
Comment: That's not *his* comment, that's a quote from the book you're calling the "bible". Even if it weren't, this isn't a very helpful answer. You don't explain anything, you just [appeal to authority](https://en.wikipedia.org/wiki/Argument_from_authority). Jeffrey Richter is human, of course, he could have made a mistake.
Comment: I copied the thing you see from the book. How could I miss-read it ?
Comment: what is wrong with you people? did I do something wrong? U just asked a question. The book said different thing than I knew and I got confused. If you could answer my question then you're welcome and if you could not then why are you here anyway ?


asp.net mvc publish not open in clients

Question: I have two asp.net mvc projects on my server. (iis 7 and win server 2012R2).
Both (app1 port:80 & app2 port:83) work and open on server.
But app2 with port:83 open only on server and client can not open app2 with link http://IPserver:83
Edge => Error Code: INET_E_RESOURCE_NOT_FOUND
Chrome => ERR_CONNECTION_TIMED_OUT
Is there a config on IIS?
Comment: You say that app2 works - how do you know?  What steps do you take to verify it is working?  It would seem since the client cannot reach it that app2 is not working (completely).
Comment: app2 works works correctly on server. Home/Index opens (http://localhost:83). and api/user/getusers shows users correctly. but Home/Index does not open on client(http://serverip:83)
Comment: Based on what?  Edge connecting?  So your client listed above are coming from a different PC, elsewhere on the network?  But - the app1 _is_ working on separate PC?  These are the kinds of details you should update your questions with so people have the context to be able to understand the issue.
Comment: app1 open on server and other PCs. app2 open on server but not on other PSc. I test it on my smart phone too and not opened.
Comment: Anybody don't know?
Comment: I recommend updating your answer with that information and formatting it to be clear the steps you have already taken.  I would suspect this has to do with a firewall somewhere.  I recommend turning off app1 and reconfigure app2 to use the standard 80 port and then see if it is working.  If it works, that proves it is the non-standard 83 port being blocked somewhere.
Comment: I told to our server manager and he opened port 83 and resolved. Thanks
Answer: Per the comments, summarizing the solution:

Both app1:80 and app2:83 are working if connecting from the server itself (locally).
However, on a remote client, app1:80 works, but app2:83 does not work.

The recommendation was that there was likely a configuration issue with the network (or a firewall/port manager/port configuration on the server itself) that is blocking port 83 since it is not a standard port like port 80 is.
One way to test this is to shut down app1, reconfig app2 to port 80, and see if the remote clients can connect to app2 on port 80.
Comment: Right - I was summarizing the solution we figured out in the comments, so that anyone that finds this Q&A will be able to have a good summary of the actions, which will hopefully help them out.

asp.net mvc publish not open in clients


Exponential family in testing and estimation

Question: In the Annals of Statistics paper "Defining the curvature of a statistical problem(with applications to second order efficiency)" by Bradley Efron, he claims the following two statements in the first paragraph.

The locally most powerful test of $\theta=\theta_0$ versus $\theta>\theta_0$ is uniformly most powerful in an exponential family.
The MLE for $\theta$ is a sufficient statistic in an exponential family and achieves the Cramer-Rao lower bound if we have chosen the right function of $\theta$ to estimate.

Can someone elaborate on these two statements as I am a Mathematician who has only a little knowledge of Statistics?
Comment: I would suggest that you precise the form of what is called an exponential familly here. That will bring pedagogy to this question (which is "scolar") and also will tell wether it is in a canonical form or not.
Comment: If you have no basic knowledge of mathematical statistics, I would advise against reading _Annals of Statistics_ papers... Try first to read an introductory book like [Casella and Berger](http://www.amazon.com/gp/product/0534243126/ref=as_li_ss_tl?ie=UTF8&camp=1789&creative=390957&creativeASIN=0534243126&linkCode=as2&tag=chrprobboo-20).
Comment: @Xi'an: Sorry, when I said I was not a Statistician, I was bit exaggerated. I have taken a course in introductory Statistics (but long time back). Anyway, thanks for your suggestion of the book.
Comment: @robingirard: An one parameter exponential family is of the form $f(x;\theta)=g(x)e^{\eta(x)T(x)-B(\theta)}$.
Comment: are you sure it is $\eta(x)$ ? http://en.wikipedia.org/wiki/Exponential_family . So it is not in the canonical form.
Comment: Sorry, it should be $\eta(\theta)$.
Comment: @robingirard: I don't understand obviously as I am not a Statistician.. scolar, canonical form,...? Can you elaborate what's really going on?
Comment: scolar was some useless word of mine. Canonical form is explained in Wikipedia's page (which I advise you to read before asking a question here :) )
Answer: This is a rather broad question, but I will try to give in informal reply.
Generally, these statements establish the fact that the exponential family is a "well behaved" parametric family of distributions.
The emphasis in the first is in that the exponential family satisfies the regularity conditions needed so that a uniformly most powerful test exist. This means there is a test statistic and a rejection region, that have a type I error rate no greater than $\alpha$, and no other statistic nor rejection region have more power than these.
Now to the second. The Cramer-Rao bound, or the "information bound" states that any unbiased estimator, cannot be arbitrarily precise, i.e., it's variance is bounded from below. So the novelty in the second statement is that, in those cases where the MLE is actually unbiased, it is also efficient in the sense it has the minimal possible variance.
Comment: Thank you. Can you give a good reference for the details?
Comment: Any book on statistical theory or mathematical statistics. E.g. http://www.amazon.com/Statistical-Theory-Concise-Introduction-Chapman/dp/1439851840
Answer: Here is a partial answer, maybe someone could complement it.
"Statistical sufficency" means that no other statistic uses more information from the sample. Definition of sufficiency. Maximum likelihood estimate $\hat{\theta}$ is a sufficient statistic.
Cramer-Rao lower bound states the lowest value (lower bound) for the variance. It is computed from the second differentiation (if it exists) of Fisher's information . When you use an estimate, you expect it to have the lowest variance, be unbiased, and sufficient. UMVUE estimate are Uniformly, Minimum Variance, Unbiased, estimator. This way, Cramer-Rao lower bound provides the minimum value for the variance of an estimator.
By the way, MLE for $\sigma^2$ is $\hat{\sigma}^2=\dfrac{1}{n}\sum(X-E\{X\})^2$, which is a biased estimate.


What are the differences between coated drumheads and clear drumheads?

Question: What are the differences between clear drumheads and coated drumheads?
Do they have different purposes?
Answer: Here are some Key points about Coated Drumhead vs Clear Drumhead:
Coated Drum head:

Coated heads are warmer in tone
Easier to tune
More controlled than Clear
Produces more bounce when hit by the stick
Muted and more focused

Clear Drum head:

The tones are a bit higher in pitch
Produce brighter and less controlled sound
More attacks than coated
Louder tone and more sustain

Clear heads are more recommended for the resonant side for toms and snare.  Coated heads are better for the batter side of the Snare.  For the Batter side of the toms,  it depends on the personal preferences of the drummer as well as for the type of music to be played.
These links have more discussions about drumhead.
http://silverlakestudio.com/2011/07/06/drumheadchoices/
http://www.moderndrummer.com/site/2011/10/what-you-need-to-know-about-drumheads/#.UZWTXKI3Bmw


Adding a new parser on a form control

Question: I'm trying to write a custom directive for inputs that will modify the model so that if a user types a number as "25,000" into the input, the model ends up with the value "25000" in integer form.
I have this code so far:

    <input type="number" name="some-field" ng-model="numericValue" integer />

The directive will replace any non-numeric value in the value and run it through the parseInt method before returning the value. Problem is that the value argument of the parser method is always null, no matter what. Not sure if I'm using the wrong function or if there's something else wrong with my code.

Edit I created a sample of my app on jsFiddle. Try things like adding commas to the fields and see what the output becomes. I've found that a major part of the issue seems to be the numeric field type. When I use a text field type, then it works fine.
Comment: I believe you will have a hard time with this due to the implementation of the number type, specifically with Google Chrome.  If a number field contains a non-numeric value, it is seen as invalid and has an internal value of ''.
Comment: possible duplicate of [HTML5 input type=number value is empty in Webkit if has spaces or non-numeric characters?](http://stackoverflow.com/questions/18677323/html5-input-type-number-value-is-empty-in-webkit-if-has-spaces-or-non-numeric-ch)
Comment: In case somehow you really get it works (e.g. by changing to use type="text"), don't forget to add a formatter to `ctrl.$formatters` as well to ensure the two-way binding won't break.
Answer: It seems that my issue is not related to Angular, but to the browser implementation of input[type=number]. The value attribute is set to null in Chrome if the value is not a number.
HTML5 input type=number value is empty in Webkit if has spaces or non-numeric characters?

Adding a new parser on a form control


rails, locals not passing to bootstrap modal partial

Question: Okay so some weird stuff is going on with passing some local variables to a partial using the bootstrap modal feature.
I'm creating a calendar in a table. Each table cell represents a date in the month. In each of these cells is a button with the date for that cell marking it. The idea is when this button is clicked a modal will open up displaying a list of clients that have tasks that day to be done.
Here is my views/jobs/index.html.erb

<% count = 0 %>
  <% 5.times do %>

      <% 7.times do %>

          <% date = @calender_days[count] %>
          <% client_set = create_client_set(date) %>
          <%= render partial: 'day', locals: {jobs: @jobs, count: count, date: date, client_set: client_set} %>
          <% client_set[0..2].each do |client| %>
            <%= User.find(client).username %>

          <% end %>
          <% count += 1 %>

      <% end %>

  <% end %>

Here is the partial referenced in the render, my views/jobs/_day.html.erb

<button type="button" class="align-text-bottom btn btn-primary btn-xs" data-toggle="modal" data-target="#day-tasks">
  <%= date.strftime('%d') %>
</button>

<%= date.strftime('%m/%d') %>

        <%= count %>
        <% client_set.each do |client| %>

<%= User.find(client).username %>

        <% end %>

        <button type="button" class="align-text-bottom btn btn-secondary" data-dismiss="modal">Close</button>

Now the weird thing is this: <%= date.strftime('%d') %> for the button at the top of the modal evaluates correctly, where date = @calender_days[count] yet <%= count %> in the modal body evaluates to 0 across the whole calendar.  Notice also that <%= date.strftime('%m/%d') %> in the modal-title evaluates to the first day in the calendar. So the partial is getting the values with the button receiving the correct values but for some reason the modal isn't getting them.
I'm really stumped, it makes no sense. Thank you all in advance for your help!
Answer: Your problem is not about the counter value, the thing is that you are generating different modals with the same ID and when you click to open the modal, it always open the first, not the one that belongs to the button you set, and this is the one that has 0 on their value.
a simple solution could be just to concat the count value to the id of the modal and of course to the data-target of the button, so you need to change those two lines
<button type="button" class="align-text-bottom btn btn-primary btn-xs" data-toggle="modal" data-target="#day-tasks-<%= count %>">
...
    <div class="modal fade" id="day-tasks-<%= count %>" tabindex="-1" role="dialog" aria-labelledby="day-tasks-Label" aria-hidden="true">
    ...

or concatenate the date or something that is unique for that purpose.
Comment: That did it! Thank you for your time looking into this.


IE8cv puzzler: setting zoom:1 via class hides content

Question: If the following conditions are met, setting zoom:1 hides the element's content:

Markup must have this structure:

        zoom

These styles must be defined:
.somethingSPECIAL .zoom {
    zoom: 1;
}
.overflow {
    width: 300px;  /* Whatever px here. */
    height: 150px; /* Whatever px here. */
    overflow: auto;
}

The somethingSPECIAL class should be applied to any ancestor of the markup above after page load (like on a button click).
The browser you've been forced to use must be IE8 in Compatibility View.

Here's a live demo.
Why is this happening, and what can I do to prevent it?  (I can't get rid of zoom: 1.  I also have to set the parent class as shown in the demo.)
Answer: I noticed that the width and height of the span element went from 33x19 to 0x0. So if you set it back to 'auto' it works.
$('.zoom').css('width', 'auto');

See http://jsfiddle.net/GgY6C/29/
Comment: That's redonkulous, but it works.  Thanks!  Any theories on why IE8CV does this?
Comment: Also, I guess just resetting the `span`s class works too, and this won't mess up any spans that might have a width (when they also have display:block).

    `.find('.zoom').addClass('.zoom')`

http://jsfiddle.net/GgY6C/30/
Comment: Whoops!  Missed the typo.  ".zoom" isn't a class and wasn't reapplying zoom:1...  It was just adding a class doing nothing.  This would work too:  `.find('.zoom').addClass('somethingThatDoesntEvenExist')`.  WTF?

http://jsfiddle.net/GgY6C/31/


Searching with command-T

Question: When I search some file with command-T it often failes to find it because I'm not in the right directory, so I have to change the directory.
Is it possible to set that command-T will search first in the directories that are bookmarked in Nerdtree or somewhere else?
I could change the directory to / but this search very large scope of files. When I change the dir to my home directory and I'm looking for something ordinary like .bashrc I will find rather many files that are located under .wine directory.
In 99 % of time I need to search files in project directories that I actively work with. Can I set these directories in some preferences?
Answer: According to the documentation you can exclude directories from your search:

                                            *command-t-wildignore*
  |'wildignore'|                                 string (default: '')

   Vim's |'wildignore'| setting is used to determine which files should be
  excluded from listings. This is a comma-separated list of glob patterns.
  It defaults to the empty string, but common settings include "*.o,*.obj"
  (to exclude object files) or ".git,.svn" (to exclude SCM metadata
  directories). For example:

     :set wildignore+=*.o,*.obj,.git

   A pattern such as "vendor/rails/**" would exclude all files and
  subdirectories inside the "vendor/rails" directory (relative to
  directory Command-T starts in).

So if you wanted to exclude a backup dir, you would write:
set wildignore+=project/backup

in your .vimrc
In addition, to ignore dotfiles/dotdirs you can look into these options:
g:CommandTNeverShowDotFiles
g:CommandTScanDotDirectories
g:CommandTMaxDepth

These allow you to:
 - ignore dotfiles completely;
 - stop searching recursively in dotdirs;
 - specify at what depth should Command-T stop scanning.
I found this information in the author's git, but you can probably see this document by issuing in vim:
:help Command-T

(or a similar name)
I did not see any reference to preferences or bookmarks in the plugin.
However if you start vim by opening a file in said project directory you might want to add this line to your .vimrc:
    set autochdir

This option will set on startup your directory to the current file's directory.
Comment: Thank you, it seems that I can partly achieve the goal with commands you suggested. I wish that the author add some opposite command to `wildignore`
Answer: You could try Ctrl-P. I had the same problems as you do and making the change solved them.
I also ignore some folders (in .vimrc):
let g:ctrlp_custom_ignore = {
\ 'dir':  '\.git$\|\.hg$\|\.svn$',
\ 'file': '\.exe$\|\.so$\|\.dll$' }

Searching with command-T


Standard deviation in Weibull distribution

Question: I've have a script that creates Weibull distributions with a static shape parameter and a variable scale parameter, the scale parameter changing to yield a distribution that meets a specified mean while maintaining the shape parameter.
I have calculated that the standard deviation for my distributions always equals 2*sqrt(5).  This is really small for what I am doing: I am using the distribution to model webpage read-time based on a known average (calculated from the number of words on the page).  Times, including standard deviation, are in seconds.  2*sqrt(5) doesn't seem like a whole lot of wiggle room for read-time variation when trying to emulate an "average" web browsing user.
How can I approximate how many standard deviations "wiggle room" is appropriate for my application?  I was surprised, since I thought that "standard" deviation implied that a majority of samples would be within one standard deviation of the mean.  I can't believe it's so tight around my average.  It doesn't seem like a "standard" deviation is "standard" at all, since in other distributions I've looked at, a large percentage of samples fall within one of them.  This assumes I didn't make a calculation error -- I'm not finding an error yet at least.
Thanks
Comment: It is possible for *all* the data to be one or more SDs from their mean. However, *at least* three-quarters of the data will lie within two SDs of the mean.  If that's not the case, then you have made a computational error.
Comment: The shape parameter I am using is 0.5
Comment: @whuber - thank you for that bit of information.  I don't have a data set myself, I'm trying to very roughly emulate someone else's results to just (again very roughly) approximate a process.  I guess I will try to play with the distributions until 3/4 of the output tends to lie within two standard deviations
Answer: Perhaps this paper,"A Simple Normal Approximation for Weibull Distribution with Application to Estimation of Upper Prediction Limit" by H. V. Kulkarni and S. K., will assist in answering your questions with respect to the UPL.
Link: http://www.hindawi.com/journals/jps/2011/863274/


_transform() takes 2 positional arguments but 3 were given

Question: I try to build a pipeline with variable transformation
And i do as below
import numpy as np
import pandas as pd
import sklearn
from sklearn import linear_model
from sklearn.base import BaseEstimator, TransformerMixin
from sklearn.pipeline import Pipeline

Dataframe
df = pd.DataFrame({'y': [4,5,6], 'a':[3,2,3], 'b' : [2,3,4]})

I try to get a new variable for predict
class Complex():
    def __init__(self, X1, X2):
        self.a = X1
        self.b = X2
    def transform(self, X1, X2):
        age = pd.DataFrame(self.a - self.b)
        return age
    def fit_transform(self, X1, X2):
        self.fit( X1, X2)
        return self.transform(X1, X2)

    def fit(self, X1, X2):
        return self

Then i make a pipeline
X = df[['a', 'b']]
y = df['y']
regressor = linear_model.SGDRegressor()
pipeline = Pipeline([
        ('transform', Complex(X['a'], X['b'])) ,
        ('model_fitting', regressor)
    ])
pipeline.fit(X, y)

and i get error
pred = pipeline.predict(X)
pred
TypeError                                 Traceback (most recent call last)
<ipython-input-555-7a07ccb0c38a> in <module>()
----> 1 pred = pipeline.predict(X)
      2 pred

C:\Program Files\Anaconda3\lib\site-packages\sklearn\utils\metaestimators.py in <lambda>(*args, **kwargs)
     52
     53         # lambda, but not partial, allows help() to work with update_wrapper
---> 54         out = lambda *args, **kwargs: self.fn(obj, *args, **kwargs)
     55         # update the docstring of the returned function
     56         update_wrapper(out, self.fn)

C:\Program Files\Anaconda3\lib\site-packages\sklearn\pipeline.py in predict(self, X)
    324         for name, transform in self.steps[:-1]:
    325             if transform is not None:
--> 326                 Xt = transform.transform(Xt)
    327         return self.steps[-1][-1].predict(Xt)
    328

TypeError: transform() missing 1 required positional argument: 'X2'

what i do wrong? I see the mistake is in class Complex(). How to fix it?
Answer: So the problem is that transform expects an argument of array of shape [n_samples, n_features]
See the Examples section in the documentation of sklearn.pipeline.Pipeline, it uses sklearn.feature_selection.SelectKBest as a transform, and you can see its source that it expects X to be an array instead of separate variables like X1 and X2.
In short, your code can be fixed like this:

import pandas as pd
import sklearn
from sklearn import linear_model
from sklearn.pipeline import Pipeline

df = pd.DataFrame({'y': [4,5,6], 'a':[3,2,3], 'b' : [2,3,4]})

class Complex():
    def transform(self, Xt):
        return pd.DataFrame(Xt['a'] - Xt['b'])

    def fit_transform(self, X1, X2):
        return self.transform(X1)

X = df[['a', 'b']]
y = df['y']
regressor = linear_model.SGDRegressor()
pipeline = Pipeline([
        ('transform', Complex()) ,
        ('model_fitting', regressor)
    ])
pipeline.fit(X, y)

pred = pipeline.predict(X)
print(pred)


Subset permutations

Question: Given that $B = (a_1, a_2 \cdots, a_{12})$ is a permutation of the set $(1, 2, \cdots, 12)$ such that $a_1>a_2>a_3>a_4>a_5>a_6$ and  $a_6<a_7<a_8<a_9<a_{10}<a_{11}<a_{12}$, then how many possible permutations can B represent?

I know of the permutation formula $P(n, r) = \frac{n!}{(n-r)!}$, but I don't know how that can be used here. How can I use $P(n, r)$?
Answer: Firstly, you can see that $a_6$ is the minimum since it is smaller than any other nubmer in $B$. So, $a_6=1$. Now, choose sets $\{a_1,a_2,a_3,a_4,a_5\}$ and $\{a_7,a_8,a_9,a_{10},a_{11},a_{12}\}$. This you can do in $\binom{11}{5}=\binom{11}{6}$ ways. Once you have defined these two sets there is a unique way to put them in the array $B$ and that is to sort them appropriately.

Subset permutations


What are the $n$th roots of the identity function?

Question: What are all the functions $f:\mathbb{R}\rightarrow \mathbb{R}$ such that $f^n=I$ where $f^n$ denotes the composition $f\circ f\circ f\dots \circ f$ of $f$ with itself $n$ times, and $I:\mathbb{R}\rightarrow \mathbb{R}$ is the identity function?
Is there a neat description of such functions? (There seems to be infinitely many of them, for each $n>1$.)
It is easy to see that such a $f$ has to be bijective.
Is there a better answer if $f$ is assumed to be continuous?
Comment: The answer left by Alex Becker (here: http://math.stackexchange.com/questions/114403/3rd-iterate-of-a-continuous-function-equals-identity-function ) appears easily generalizable to prove that if $f$ is continuous then it is $\pm I$, with $-I$ only available for even $n$, of course :)
Comment: @EricStucky I don't get the first comment, for $f(x)=-(1/2)x, x\geq 0, f(x)=-2x, x<0$, for instance, is continuous, and has identity as its square, isn't it?
Comment: I don't think there is a useful general answer to this question. Of course every number sits in a ``cycle'' of length a divisor of $n$, but that seems like all you can really say. Perhaps by using a weaker form of continuity you can get a less unwieldy class of functions.
Comment: @N: Yes, that is true. I thought I remembered that the only continuous square root was $-I$ but that's obviously wrong. Thanks :)
Comment: @EricStucky Is it that they are the only ones *up to some nice equivalence relation*? (In view of mercio's answer)
Comment: @N: I don't think that's what I was remembering, but perhaps it is true anyway. I'll give it some thought.
Answer: If you suppose that $f$ has to be continuous, then since it is bijective, it is monotonous.
If $f$ is increasing then $f = id$ : suppose not, then there is an $x$ such that $f(x) \neq x$. Suppose $f(x) > x$. Then $x = f^{\circ n}(x) > \ldots > f(f(x)) > f(x) > x$, which is a contradiction. The case when $f(x) < x$ works the same way.
If $n$ is odd then $f$ can't be decreasing so $f$ is increasing and $f = id$.
If $n$ is even then $f$ can be decreasing. Then $f^2$ is an $n/2$-th root of the identity and increasing, so $f^2 = id$.
So we are left to determine the continuous decreasing solutions to $f^2 = id$. Such a $f$ has a unique fixpoint $x_0$. You can define $f$ on $[x_0 ; \infty)$ in any way you want (as long as it's a bijection on $(-\infty ; x_0]$), then you have to extend $f$ on $(-\infty ; x_0]$ in a unique way with $f(x) = f^{-1}(x)$.

If you don't require $f$ to be continuous then such a $f$ can be obtained by partitioning $\Bbb R$ into finite sets $S_k = \{x_1^k,\ldots,x_{d_k}^k\}$ of cardinality $d_k$ with $d_k \mid n$, and then setting $f(x_i^k) = x_{i+1}^k$ and $f(x_{d_k}^k) = x_1^k$. There are many many possible functions then.
Comment: I guess if you consider conjugation classes by homeomorphisms of $\Bbb R$ ? Say $f_1 \sim f_2$ when there exists a homeomorphism $h$ of $\Bbb R$ such that $f_1 \circ h = h \circ f_2$. Then for even $n$ the decreasing $n$th roots of the identity are exactly the equivalence class of $-I$, and the increasing ones are the equivalence class of $I$ (which is just $I$). So really they are all the same up to renaming the elements of $\Bbb R$.
Comment: I should have added $f$ is to be continuous.
Comment: So there is just one odd root but there are infinitely many even roots. Is there a natural equivalence relation on the set of all (continuous) functions that reduces the answer to just two even roots, I and -I?
Comment: Very much true. Shall we add this to the question and answer?
Comment: And how to find all real analytic real valued $f$ with $f(f(x))=x$?


Best practise for proftp User and Group setting with mod_sql

Question: I am running proftp and I am not sure how to configure the user and groups properly.
In my proftpd.conf I configured:
<code># Set the user and group that the server runs as
User                proftp
Group               proftp
</code>
This will effect the system user, the proftpd service is running.
In mod_sql there are options the same settings, which seem to double for me:
<code># The SQLDefaultGID directive configures the default GID for users.
# This value must be greater than any configured SQLMinUserGID. Default: 65533
SQLDefaultGID xxxx

# The SQLDefaultUID directive configures the default UID for users.
# This value must be greater than any configured SQLMinUserUID. Default: 65533
SQLDefaultUID xxxx
</code>
There are also proftpd services which run this user as I can se using top.
Is there any best practise, how to set these values for best security?
Answer: These settings have no direct relation, beside that both could cause proftpd processes running as that user to appear.
The first ones control to which user ID the master process switches after initializing with full root privileges to be able to get all the privileges it needs.
The other (SQL) Settings are default values that only come into play if users are authenticated with mod_sql and the queries used for that do not return that information. So it depends on Your SQL setup whether they are used at all. If they apply to such SQL-authenticated users then the processes handling the sessions for the users will run with that UID/GID - and are used by the operating system to do file-system permission checks and as default owner/group for newly created files and folders.
How You want to setup any non-system authentication like SQL depends on Your need.
If all the users in the database are chrooted to some distinct directory and are no shell Users or such, it may be ok and convenient if they share all one User-ID/Group-ID which You probably would also define as operatingsystem-user/-group to have the files and processes listed in shell with some known name. Same can apply for some shared Write-Only, Read-Only or even Read-Write Direcories assigned to the user where it is ok or wanted that all the users have the same permissions.
If You want to share some data between the users or if they or some of them shall access the files they have permissions for via FTP also from shell etc. You may want to have unique User-IDs and some Groups the users are individually or generally assigned to. But in that case You either need to create the users as system users additionally or direct the system to also use the SQL User-DB, or You have to cope with the different numeric IDs assigned on operating system level.
It would also be possible to use the UID as some kind of primary group, so having users with similar or same permissions sharing one UID.
In the end it really only depends on what You want to be the outcome - and how users (besides root) access the system. And on whether You already have some default setups that You want to adopt instead of making it different all the time without real need for that.


Sum of four squares

Question: I was looking for numbers who can be expressed as sum of exactly  four squares and not less. And I think I have found them. They are all the integers of the form

$$4^{n}\,(7+8k);\;k,\,n\in\mathbb{N}$$

I have no idea how to prove this statement and I wonder if ALL the numbers which need four squares are this kind of numbers.
Edit
Thanks to the comments and the answer the statement can be more precise
A number can be expressed as the sum of four squares and not less if and only if it has the form
$4^n\,(7+8k);\;k,\,n\in\mathbb{N}$
Comment: Make that $4^n(7+8k)$. This is a well-known, but very deep, theorem of Gauss.
Comment: See [Legendre's three square theorem](https://en.wikipedia.org/wiki/Legendre%27s_three-square_theorem) and [Lagrange's four square theorem](https://en.wikipedia.org/wiki/Lagrange%27s_four-square_theorem) together, keeping in mind $0^2$ is allowed. And if anyone is still wondering about $178$ (it was an issue raised in at least two separate comments before they were deleted), we have $12^2 + 5^2 + 3^2$ or $13^2 + 3^2$.
Comment: Thank you for the correction. I reviewed my notes and it was just a typo. But I did not know that the property was known. I am glad anyway to have rediscover it by myself :)
Comment: @Arthur Legendre's theorem page looks quite wrong on wikipedia since the OEIS page and my result are about FOUR squares and not three. What do you think about?
Comment: @Raffaele No, I stand by what I said. Lagrange's four square theorem says that _any_ number can be written as the sum of four squares (allowing for $0^2$). Legendre says that the number can be written as the sum of three squares iff it is _not_ of the form $4^n(7+8k)$. Thus the numbers that can be written as a sum of four squares, but _not_ as a sum of three are exactly the ones excluded by Legendre.
Comment: @Arthur I lost a "not" while reading. Thank you :)
Answer: At least it is not hard to see that $4^n(7+8k)$ cannot be written as sum of three squares: $a^2+b^2+c^2\equiv m\pmod 4$ where $m$ is the number of odd squares on the left. Hence for $n\ge 1$, any representation of $4^n(7+8k)$ must use three even squares. But then this corresponds to the representation $4^{n-1}(7+8k)=(a/2)^2+(b/2)^2+(c/2)^2$ with smaller $n$.
We are thus reduced to the case $n=0$, i.e., $7+8k=a^2+b^2+c^2$. By the above argument, $a,b,c$ must be odd. As odd squares are $\equiv 1\pmod 8$, we obtain $7+8k\equiv 3\pmod 8$, contradiction.
The other direction is less trivial (see comments about Legendre's theorems)

Sum of four squares


Why don't we use regularization on decision tree split?

Question: I heard people ask which one is better: Linear regression with regularization or Random Forest. My question is why can't you use regularization with Random Forest?
My understanding is that different regularization technique is adding a term to cost functions such as cross-entropy to reduce accuracy/overfitting to training data.
Typically, preventing overfitting technique for decision trees is associated with using Random Forest. I have never heard people associate regularization with decision trees or Random Forests.
Is it that reducing overfitting at the individual node level is too complex?
Edit: I acknowledge that RF is already a regularization method in a sense for decision trees through bootstrapping and aggregating. I think RF can be imaged as trying to estimate the answer from aggregating answers from crowd versus an expert(aka wisdom of the crowd).
I am not asking what regularization for RF is, I am asking why can't we simply also apply regulation at a single node step of the decision tree, since it is just adding bias to the cross-entropy, which is the cost function for linear regression or the decision used to split a tree. Is it because there is no point doing that since we don't use cross-entropy to update values of the feature?
Answer: Random forest has regularization, it's just not in the form of a penalty to the cost function. Random forest doesn't have a global cost function in the same sense of linear regression; it's just greedily maximizing information gain at each split. Limiting child node size, minimum information gain and so on all change how the trees are constructed and impose regularization on the model in the sense that a proposed split must be "large enough".
Comment: Ordinary decision trees have low bias but high variance. Averaging many randomized trees, a.k.a random forest, creates a low-bias, low-variance estimator. This is a kind of regularization on its own. However, the "default" RF method does not regularize how splits are formed (instead making purely greedy splits). This is where child node size and minimum information gain enter the picture: change how the splits are formed to be less sensitive to "too small" effects.
Comment: (1) Can you write down an expression for what that regularization would look like? Random forest doesn't have a cost function in the same sense of linear regression, so it's not obvious what connection you're drawing between the two. (2) Imposing a constraint on the class of models that you can estimate is pretty much the definition of increasing bias. Think about the equivalence between ridge regression penalizing the norm of the coefficient vector and imposing a constraint that the norm of the coefficient vector must be smaller than some constant.
Comment: My understanding is that Random forest itself is a regularization method for decision trees by repeating various forms of decisions trees and have some fitting better to some data and other fitting better to others. My question was why don't we just apply regularization at each node of a single decision tree.n
Comment: I ddon't think the proposed split to be 'large enough' is regularization ?. I believe that proposing each split must be large enough is reducing bias . I imagine decision tree as drawing these  boundaries in n-dimensional space that accurately classify samples.  Random forest is a regularization technique itself with boostrapping and aggregating results of decision trees.
Comment: also I feel like even though RF has its own regularization technique dosn't explain my question , which is already acknowledging that RF is often associated with regularization on its own. My question is why can't we also just apply regularization(like adding a bias term to cross-entropy (which is also sometimes used for splitting a node)) at each decision step?)
Comment: ok thank you I think that answers my question :)
Answer: In fact, there are some works related to using regularization on decision tree splitting. For example, in [1], the author proposes a cost function to penalize redundant features, and thus get a more succinct feature set. The experimental results reveal that it can effectively get a more concise feature subset without loss of accuracy.
[1]. Deng H, Runger G. Feature selection via regularized trees[C]//The 2012 International Joint Conference on Neural Networks (IJCNN). IEEE, 2012: 1-8.
Answer: Is it because we can't update the value of feature that is used to split each nodde?
Decision Tree uses features to split data set, and sometimes there is no continuous value associated with that feature.
Regularization is applied to a cost function that is used to update the values of parameters.
Since we are not trying to predict the correct value for the feature in Decision trees then we don't prevent overfitting by changing the value of the feature.


How can I make sure all my table fields can be added in Views?

Question: I have a custom entity. Some of the fields are available to be added from Structure > Views, but some are not available. I already tried adding default properties under hook_schema, but to no avail. The one particular field I would like to add is of datetime type.
The particular field I would like to be available from Views is this:
'some_datetime_field' => array(
  'description' => 'some description',
  'type' => 'datetime',
  'mysql_type' => 'datetime',
  'not null' => TRUE,
  'default' => format_date(time(), 'custom', 'Y-m-d 00:00:00')
),

Is there some criteria or some sort of guidelines to follow to ensure all the fields of a given entity can be added from Views?
Update:
so I thought I had it figured out. It turns out the field is available for adding in Views but column shows empty values.
Here's the code snippet from hook_views_data_alter:
function my_module_views_data_alter(&$data) {
  $data['my_module_table']['some_datetime_field'] = array(
    'title' => t('Timestamp field'),
'help' => t('Just a timestamp field.'),
'field' => array(
  'handler' => 'views_handler_field_date',
  'click sortable' => TRUE,
),
'sort' => array(
  'handler' => 'views_handler_sort_date',
),
'filter' => array(
  'handler' => 'views_handler_filter_date',
),
  );
}

What else am I missing?
Comment: We can but guess until you will show us example. Can you make a "tryout" entity, trimmed down to just 2 fields, one that works and one that does not? And then post here the result?
Answer: To inform Views about your custom entity's properties, you need to implement hook_views_data().

Describes data tables (or the equivalent) to Views.

Fields are taken care of automatically, so it's just the properties you need to define in your implementation. The documentation page has an abundance of examples so I won't reproduce any code here.
Comment: The views module (or maybe entity api, I forget) implements a generic solution for _fields_ (as in ones you might create using `field_create_field()`, or through the UI). _Properties_, which aren't fields in Drupal 7, are different, and there's no auto-magic for them. Properties are the ones you define in your entity's base table, and unfortunately you have to add those manually, for now at least.
Comment: For posterity's sake, I opted to use `hook_views_data_alter` instead so the other fields that have been automatically added are retained.
Comment: Interesting. But how come Views is able to show some fields by default without me having to implement `hook_views_data()`?
Comment: Well, that explains it.


How configure the field permissions of a custom entity?

Question: I'm on D10.x.x and I've created a custom content  entity - code below.
Those entities are created programmatically after an event, and one is assigned to each one of the site' users.
The users with authenticated role have the permission to edit their own entities; however they should be able to edit only a sub-set of the entity's fields.
I can't figure how to implement that access check.
From my example, the entity has like uid, status, created, etc.
How could I limit one role to edit only status or title field?
<?php

declare(strict_types=1);

namespace Drupal\my_module_notification\Entity;

use Drupal\Core\Entity\ContentEntityBase;
use Drupal\Core\Entity\EntityChangedTrait;
use Drupal\Core\Entity\EntityStorageInterface;
use Drupal\Core\Entity\EntityTypeInterface;
use Drupal\Core\Field\BaseFieldDefinition;
use Drupal\my_module_notification\MyModuleNotificationUserInterface;
use Drupal\user\EntityOwnerTrait;

/**
 * Defines the my_module_notification_user entity class.
 *
 * @ContentEntityType(
 *   id = "my_module_notification_user",
 *   label = @Translation("User notification"),
 *   label_collection = @Translation("user notifications"),
 *   label_singular = @Translation("user notification"),
 *   label_plural = @Translation("user notifications"),
 *   label_count = @PluralTranslation(
 *     singular = "@count user notification",
 *     plural = "@count user notifications",
 *   ),
 *   handlers = {
 *     "list_builder" =
 *   "Drupal\my_module_notification\MyModuleNotificationUserListBuilder",
 *     "views_data" = "Drupal\views\EntityViewsData",
 *     "access" =
 *   "Drupal\my_module_notification\MyModuleNotificationUserAccessControlHandler",
 *     "form" = {
 *       "add" = "Drupal\my_module_notification\Form\MyModuleNotificationUserForm",
 *       "edit" = "Drupal\my_module_notification\Form\MyModuleNotificationUserForm",
 *       "delete" = "Drupal\Core\Entity\ContentEntityDeleteForm",
 *       "delete-multiple-confirm" =
 *   "Drupal\Core\Entity\Form\DeleteMultipleForm",
 *     },
 *     "route_provider" = {
 *       "html" = "Drupal\Core\Entity\Routing\AdminHtmlRouteProvider",
 *     },
 *   },
 *   base_table = "my_module_notification_user",
 *   admin_permission = "administer my_module_notification_user",
 *   entity_keys = {
 *     "id" = "id",
 *     "label" = "title",
 *     "uuid" = "uuid",
 *     "owner" = "uid",
 *   },
 *   links = {
 *     "collection" = "/admin/content/notification-user",
 *     "add-form" = "/notification-user/add",
 *     "canonical" = "/notification-user/{my_module_notification_user}",
 *     "edit-form" = "/notification-user/{my_module_notification_user}/edit",
 *     "delete-form" = "/notification-user/{my_module_notification_user}/delete",
 *     "delete-multiple-form" =
 *   "/admin/content/notification-user/delete-multiple",
 *   },
 *   field_ui_base_route = "entity.my_module_notification_user.edit_form",
 * )
 */
final class MyModuleNotificationUser extends ContentEntityBase implements MyModuleNotificationUserInterface {

  use EntityChangedTrait;
  use EntityOwnerTrait;

  /**
   * {@inheritdoc}
   */
  public function preSave(EntityStorageInterface $storage): void {
    parent::preSave($storage);
    if (!$this->getOwnerId()) {
      // If no owner has been set explicitly, make the anonymous user the owner.
      $this->setOwnerId(0);
    }
  }

  /**
   * {@inheritdoc}
   */
  public static function baseFieldDefinitions(EntityTypeInterface $entity_type): array {
    $fields = parent::baseFieldDefinitions($entity_type);
    $fields += self::ownerBaseFieldDefinitions($entity_type);

    $fields['title'] = BaseFieldDefinition::create('string')
      ->setLabel(t('Title'))
      ->setRequired(TRUE)
      ->setSetting('max_length', 255)
      ->setDisplayOptions('form', [
        'type' => 'string_textfield',
        'weight' => -5,
      ])
      ->setDisplayConfigurable('form', TRUE)
      ->setDisplayOptions('view', [
        'label' => 'hidden',
        'type' => 'string',
        'weight' => -5,
      ])
      ->setDisplayConfigurable('view', TRUE);

    $fields['uid'] = BaseFieldDefinition::create('entity_reference')
      ->setLabel(t('Author'))
      ->setSetting('target_type', 'user')
      ->setDefaultValueCallback(self::class . '::getDefaultEntityOwner')
      ->setDisplayOptions('form', [
        'type' => 'entity_reference_autocomplete',
        'settings' => [
          'match_operator' => 'CONTAINS',
          'size' => 60,
          'placeholder' => '',
        ],
        'weight' => 1,
      ])
      ->setDisplayConfigurable('form', TRUE)
      ->setDisplayOptions('view', [
        'label' => 'above',
        'type' => 'author',
        'weight' => 1,
      ])
      ->setDisplayConfigurable('view', TRUE);

    $fields['my_module_notification'] = BaseFieldDefinition::create('entity_reference')
      ->setLabel(t('Notification'))
      ->setRequired(TRUE)
      ->setCardinality(1)
      ->setSetting('target_type', 'my_module_notification')
      ->setDisplayOptions('form', [
        'type' => 'options_select',
        'weight' => 2,
      ])
      ->setDisplayConfigurable('form', TRUE)
      ->setDisplayOptions('view', [
        'label' => 'above',
        'type' => 'entity_reference_label',
        'weight' => 2,
      ])
      ->setDisplayConfigurable('view', TRUE);

    $fields['status'] = BaseFieldDefinition::create('list_string')
      ->setLabel(t('Status'))
      ->setSettings([
        'allowed_values' => [
          MyModuleNotificationUserInterface::UNREAD => t('Unread'),
          MyModuleNotificationUserInterface::READ => t('Read'),
          MyModuleNotificationUserInterface::ARCHIVED => t('Archived'),
        ],
      ])
      ->setDefaultValue('unread')
      ->setRequired(TRUE)
      ->setDisplayOptions('view', [
        'label' => 'above',
        'type' => 'string',
        'weight' => 3,
      ])
      ->setDisplayOptions('form', [
        'type' => 'options_select',
        'weight' => 3,
      ])
      ->setDisplayConfigurable('form', TRUE)
      ->setDisplayConfigurable('view', TRUE);

    $fields['created'] = BaseFieldDefinition::create('created')
      ->setLabel(t('Authored on'))
      ->setDescription(t('The time that the my_module_notification_user was created.'))
      ->setDisplayOptions('view', [
        'label' => 'above',
        'type' => 'timestamp',
        'weight' => 10,
      ])
      ->setDisplayConfigurable('form', TRUE)
      ->setDisplayOptions('form', [
        'type' => 'datetime_timestamp',
        'weight' => 10,
      ])
      ->setDisplayConfigurable('view', TRUE);

    $fields['changed'] = BaseFieldDefinition::create('changed')
      ->setLabel(t('Changed'))
      ->setDescription(t('The time that the my_module_notification_user was last edited.'));

    return $fields;
  }

  /**
   * {@inheritdoc}
   */
  public function getType(): string {
    return $this->bundle();
  }

  /**
   * {@inheritdoc}
   */
  public function getTitle(): string {
    return $this->get('title')->value;
  }

  /**
   * {@inheritdoc}
   */
  public function setTitle($title): static {
    $this->set('title', $title);
    return $this;
  }

  /**
   * {@inheritdoc}
   */
  public function getCreatedTime(): int {
    return $this->get('created')->value;
  }

  /**
   * {@inheritdoc}
   */
  public function setCreatedTime($timestamp): static {
    $this->set('created', $timestamp);
    return $this;
  }

}

Answer: - Create an Access Control Handler.
  // src/MyModuleNotificationUserAccessControlHandler.php

namespace Drupal\my_module_notification;

use Drupal\Core\Entity\EntityAccessControlHandler;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Session\AccountInterface;

/**
 * Defines the access control handler for the MyModuleNotificationUser entity type.
 */
class MyModuleNotificationUserAccessControlHandler extends EntityAccessControlHandler {

  /**
   * {@inheritdoc}
   */
  protected function checkAccess(EntityInterface $entity, $operation, AccountInterface $account) {
    // Check the operation being performed.
    switch ($operation) {
      case 'update':
        // Check if the user has the 'edit title' or 'edit status' permission.
        if (
          ($account->hasPermission('edit title') && $entity->access('update', $account, TRUE)) ||
          ($account->hasPermission('edit status') && $entity->access('update', $account, TRUE))
        ) {
          return AccessResult::allowed();
        }
        return AccessResult::forbidden();

      // Add additional cases for other operations if needed.

      default:
        // For other operations, fall back to the default checkAccess method.
        return parent::checkAccess($entity, $operation, $account);
    }
  }
}

- Define Permissions my_module_notification.permissions.yml
- Then use the Access Control Handler in my_module_notification.module
/**
 * Implements hook_entity_type_alter().
 */
function my_module_notification_entity_type_alter(array &$entity_types) {
  // Update the access control handler for MyModuleNotificationUser entities.
  $entity_types['my_module_notification_user']->setHandlerClass('access', MyModuleNotificationUserAccessControlHandler::class);
}

Comment: Thanks for the answer, but I think this code isn't a valid solution: the `hook_entity_access` run at entity level. Therefore, if I test it with an "authenticated" user, he is able to edit the entity, because the `$account` has edit access at least one `$restricted_fields`.

However, the user is still able to edit *all* the fields on the entity. By the way, `hook_entity_access` requires to return a `AccessResultInterface` object, not a bool.
Comment: Create file in `src/MyModuleNotificationUserAccessControlHandler.php` then add `checkaccess` method.
Comment: `checkAccess()` is for the operations on the entity itself, not for operations on the entity fields. `hook_entity_type_alter()` is not necessary, since the OP implements a custom entity. It is sufficient to define the access control handler in the entity annotation, which is what the shown code already does.
Answer: Since the entity defined from your module has an access handler (Drupal\my_module_notification\MyModuleNotificationUserAccessControlHandler), it is sufficient to implement checkFieldAccess() in that class, similarly to what the NodeAccessControlHandler class does with its checkFieldAccess() method. Do not confuse it with the checkAccess() and access() methods, which are called for operations on the entity itself, not on the entity fields.
  // Only users with the administer nodes permission can edit administrative
  // fields.
  $administrative_fields = [
    'uid',
    'status',
    'created',
    'promote',
    'sticky',
  ];
  if ($operation == 'edit' && in_array($field_definition->getName(), $administrative_fields, TRUE)) {
    return AccessResult::allowedIfHasPermission($account, 'administer nodes');
  }

  // No user can change read only fields.
  $read_only_fields = [
    'revision_timestamp',
    'revision_uid',
  ];
  if ($operation == 'edit' && in_array($field_definition->getName(), $read_only_fields, TRUE)) {
    return AccessResult::forbidden();
  }

  // Users have access to the revision_log field either if they have
  // administrative permissions or if the new revision option is enabled.
  if ($operation == 'edit' && $field_definition->getName() == 'revision_log') {
    if ($account->hasPermission('administer nodes')) {
      return AccessResult::allowed()->cachePerPermissions();
    }
    return AccessResult::allowedIf($items->getEntity()->type->entity->shouldCreateNewRevision())->cachePerPermissions();
  }
  return parent::checkFieldAccess($operation, $field_definition, $account, $items);

That method is called by the fieldAccess() method implemented by the EntityAccessControlHandler class, which usually is the parent class used by access control handlers.
  $account = $this->prepareUser($account);

  // Get the default access restriction that lives within this field.
  $default = $items ? $items->defaultAccess($operation, $account) : AccessResult::allowed();

  // Explicitly disallow changing the entity ID and entity UUID.
  $entity = $items ? $items->getEntity() : NULL;
  if ($operation === 'edit' && $entity) {
    if ($field_definition->getName() === $this->entityType->getKey('id')) {
      // String IDs can be set when creating the entity.
      if (!($entity->isNew() && $field_definition->getType() === 'string')) {
        return $return_as_object ? AccessResult::forbidden('The entity ID cannot be changed.')->addCacheableDependency($entity) : FALSE;
      }
    }
    elseif ($field_definition->getName() === $this->entityType->getKey('uuid')) {
      // UUIDs can be set when creating an entity.
      if (!$entity->isNew()) {
        return $return_as_object ? AccessResult::forbidden('The entity UUID cannot be changed.')->addCacheableDependency($entity) : FALSE;
      }
    }
  }

  // Get the default access restriction as specified by the access control
  // handler.
  $entity_default = $this->checkFieldAccess($operation, $field_definition, $account, $items);

  // Combine default access, denying access wins.
  $default = $default->andIf($entity_default);

  // Invoke hook and collect grants/denies for field access from other
  // modules.
  $grants = [];
  $this->moduleHandler()->invokeAllWith('entity_field_access', function (callable $hook, string $module) use ($operation, $field_definition, $account, $items, &$grants) {
    $grants[] = [
      $module => $hook($operation, $field_definition, $account, $items),
    ];
  });

  // Our default access flag is masked under the ':default' key.
  $grants = array_merge([':default' => $default], ...$grants);

  // Also allow modules to alter the returned grants/denies.
  $context = [
    'operation' => $operation,
    'field_definition' => $field_definition,
    'items' => $items,
    'account' => $account,
  ];
  $this->moduleHandler()->alter('entity_field_access', $grants, $context);
  $result = $this->processAccessHookResults($grants);
  return $return_as_object ? $result : $result->isAllowed();


Uploading and running Gensim model for data augmentation

Question: I am trying to follow this example https://github.com/dsfsi/textaugment to upload a pre-trained Gensim model for data augmentation
    import textaugment
    import gensim
    from textaugment import Word2vec
    model = gensim.models.KeyedVectors.load_word2vec_format(r'\GoogleNews-vectors-negative300.bin', binary=True)
    from textaugment import Word2vec
    t = Word2vec(model)
    t.augment('The stories are good')

but I get the following error:
TypeError: __init__() takes 1 positional argument but 2 were given

at line
t = Word2vec(model)

What am I doing wrong?
Answer: If you edit your question to include the full error message shown, including the traceback identifying exact files/lines-of-code leading to the error, it will often provide extra important info to know what's going wrong. (Whenever possible, show answerers all the text/output that you see, not just excerpts.)
But also, the examples at the page you link, https://github.com/dsfsi/textaugment, all show the model passed in as a named parameter (model=SOMETHING), not merely a positional parameter. You should try to do it the same way (and here I've changed the name of your local variabe to make it more distinct from the parameter-name, and removed the out-of-place r prefix):
my_model = gensim.models.KeyedVectors.load_word2vec_format('\GoogleNews-vectors-negative300.bin', binary=True)
t = Word2vec(model=my_model)

The error you got may be less confusing once you know, from experience or careful viewing of the traceback, that the call to the constructor Word2vec() actually calls another method, __init__(), behind the scenes. And that __init__() method receives both the newly-created instance, and whatever else you supplied, as 'positional' arguments. That is: 2 positional arguments, when it normally only expects 1 (the new instances), with any extra arguments as named arguments (model=SOMETHING style).
Comment: I pass a named argument, which textaugment says can be a model object or a filepath to the .model file, and I get the same error. I don't think it's a matter of passed named vs positional argument here
Comment: As with the person who reported a similar error about 19 months ago, the most helpful information would be a full error message, including tracebacks. As you can't edit your error into their question, I'd suggest asking a new question, with the full details of your code attempts, and error message(s) received.


Run Windows Task Scheduler through Web Interface

Question: Is it possible to run (on demand), not schedule, a simple task that has already been scheduled under Windows Task Scheduler, through a web interface?
Any suggestions are appreciated.
Thank you
Info: We have Apache server running on a windows 7 enterprise machine.
Comment: it is very clear that a web interface instead of winform interface to operate scheduled job was requested in this question. there is a need for this to expose scheduled jobs to operators who don't have rdp access. i m not sure why this question has negative votes.
Answer: You can run the scheduled task trough powershell, and you can execute powershell from php.
see https://stackoverflow.com/questions/5317315/executing-a-powershell-script-from-php for an example
Note that there's a native powershell web access in windows server 2012 (and powershell can connect to a remote workstation) :

Windows PowerShell® Web Access, first introduced in Windows Server® 2012, acts as a Windows PowerShell gateway, providing a web-based Windows PowerShell console that is targeted at a remote computer. It enables IT Pros to run Windows PowerShell commands and scripts from a Windows PowerShell console in a web browser, with no Windows PowerShell, remote management software, or browser plug-in installation necessary on the client device. All that is required to run the web-based Windows PowerShell console is a properly-configured Windows PowerShell Web Access gateway, and a client device browser that supports JavaScript® and accepts cookies.

source : https://technet.microsoft.com/en-us/library/Hh831611.aspx


What is the purpose of /usr/prog directory

Question: While reading some internal documentation, I unexpectedly stopped at the following word sequence: "as most other software available at <code>/usr/prog</code> ...". I've never heard of the directory, but the context is CentOS and I am rather new to CentOS as well.
Rapid web searching shows that the directory is indeed used by different software (in particular, I saw that python installation sometimes lives there), but I can not see where the directory is documented anyhow for CentOS or other systems. Is there a resource where one can read about it?
Comment: Well, I finally found a few results for ancient non-Linux systems, and a few modern ones regarding specialized scientific software (academic stuff always seems to do a lot of strange things that make no sense to anyone in IT, but they just don't care). Have you got something specific?
Comment: In the entire history of CentOS I've never seen that directory used anywhere. It is certainly not created by the system or any system package. I also have no idea what you found on a web search, as I couldn't find anything at all.
Comment: @MichaelHampton I just googled `"/usr/prog"` and see from the snippets that the directory is mostly used instead of `/usr/local`. I thought that there was some tradition behind that.
Comment: @MichaelHampton hmm, strange scientific habits make sense as an answer in my case. I will try to find some of those who might have influenced the decisions here. Thank you
Answer: Local to your site, you can put things wherever you want, including /usr/prog.
No one has bothered to document this as any kind of convention. Linux FHS, as well as hier man pages from a variety of systems, say nothing about it. Who knows where it came from originally.
On a system following FHS, site local software would be in /opt.  Maybe /usr/local.


Naming chords with diminished intervals

Question: From a pure theoretical perspective, what would be the appropriate names for these two chords? I want to respect the specific degrees. In other words, not treating the double flat seventh as a sixth, nor the third as a ninth.
R, b3, 5, bb7
R, bb3, b5, bb7
For reference, theses chord happen naturally in the Double Harmonic scale, the third and seventh mode respectively.
Comment: Intervals aren't "flat" or "double-flat", etc., they are "minor", "diminished", "doubly-diminished", etc.
Comment: The top chord has the structure of X half-diminished 6/5 if the bb7 is respelled. The bottom chord has the structure of X4/2 exactly.
Comment: @ElementsinSpace what you describe is classical nomenclature. In jazz nomenclature intervals diatonic in the major scale are called "natural", and any alterations are "flat", "sharp", "double flat" etc.
Comment: @user1079505 In jazz [they don't even play the right notes](https://www.youtube.com/watch?v=VMcqKyfnT2Y).
Answer: Since music theory does not address the double-harmonic scale or its modes, you could really call those chords anything you like. These chords simply don't exist in standard music theory, because chords are considered to be combinations of minor and major thirds.
In this case, the naming convention would simply serve the purpose of expressing the intervals in the chords, so names like

Xmin(bb7) and
Xdim7(bb3)

would be sufficient.
Otherwise, a functional theory of the double harmonic would have to be invented, naming these chords according to their operation within the key. For example

Xdhiii7 (X double-harmonic iii-seven chord) and
Xdhvii7 (X double-harmonic vii-seven chord)
Answer: The 'Chord Symbol' system of naming chords is based on a diatonic major scale.    'C' is a C major triad, we don't have to say 'C MAJOR'.   'Cadd2' is a C major triad plus a major 2nd.  If we want a minor triad or a minor 2nd, we have to say so.  (Yes,'7' is an exception, it means 'minor 7th'.)  But basically the major triad and scale is taken as the norm, anything else needs to be named as a specific modification of it.
This naming system works for music in major, minor or simple modal tonalities.  It falls down when confronted with the Double Harmonic scale. If you feel a triad-based naming system would be useful in this environment, you'll have to invent one.   I think I'd just go with a simple description,  like your initial suggestion: 'R, b3, 5, bb7', 'R, bb3, b5, bb7' etc.
(Note that even then, you're labelling the notes as modifications of the major scale!  It's pretty well entrenched in our 'theory' syntax!)

Naming chords with diminished intervals


show $1/x$ does not equal $ 0$

Question: Suppose that $x\neq 0$, show that $\frac{1}{x}\neq 0$
This seems like it should be simple, but I don't even know how to start to prove this.
Answer: If $\frac1x=0$ and $x\ne0$, then $x\cdot\frac1x=x\cdot 0$, id est $1=0$.
Answer: If $x\ne0$ then $x>0$, in which case $\frac1x>0$ (otherwise $x\frac1x=1<0$),
or $x<0$, in which case $\frac1x<0$ (otherwise $x\frac1x=1<0$).
In either case, $\frac1x\ne0$.

show $1/x$ does not equal $ 0$


Why would NPS suddenly stop authenticating users?

Question: We use a computer running Windows Server 2008 (32-bit) with the RRAS and NPS roles to authenticate users for VPN and wireless access over RADIUS.
This configuration has been working great for more than a year, but starting this morning the server has started denying all requests. As far as I know, the only change was installing Windows Updates last night.

It isn't a connectivity or firewall problem. The server replying to all RADIUS requests with Access-Reject.
There is only one connection request policy, and it processes all requests on this server 24/7.
For testing purposes, I have created one network policy that should approve all requests 24/7. The log file (C:\Windows\System32\LogFiles\IN1110.log) indicates that this policy is being selected, but the server still replies with Access-Reject.
I have verified that all servers which send RADIUS requests are listed in the RADIUS clients, and there are no entries in the event log about invalid RADIUS clients.

However, I am seeing a strange System event being logged each time the server responds to a RADIUS request. We don't use MGM or multicast at all, so I don't know how to track this down.
Warning
RasServer, 50015
Specified interface was not present in MGM.

I have already tried rebooting the server, and reinstalling RRAS/NPS. (Side note: when removing NPS, all configuration is preserved, and is still present after the reinstall.) Short of setting up a completely new server, I'm at my wits end.
Has anybody else had problems like this with RRAS/NPS?
2011-10-17 Update: Added the complete text of Event ID 6274
Network Policy Server discarded the request for a user.

Contact the Network Policy Server administrator for more information.

User:
    Security ID:                        CFL\nic
    Account Name:                       nic
    Account Domain:                     CFL
    Fully Qualified Account Name:       cfl.local/People/Prince George/Nic Waller

Client Machine:
    Security ID:                        NULL SID
    Account Name:                       -
    Fully Qualified Account Name:       -
    OS-Version:                         -
    Called Station Identifier:          00-17-9A-09-A8-1D:CFL
    Calling Station Identifier:         CC-08-E0-EE-BA-82

NAS:
    NAS IPv4 Address:                   192.168.123.12
    NAS IPv6 Address:                   -
    NAS Identifier:                     D-Link Access Point
    NAS Port-Type:                      Wireless - IEEE 802.11
    NAS Port:                           1

RADIUS Client:
    Client Friendly Name:               DWL-7100AP Wireless Access Point
    Client IP Address:                  192.168.123.12

Authentication Details:
    Proxy Policy Name:                  Always authenticate requests on this server
    Network Policy Name:                Permit wireless RADIUS via EAP DWL-7100AP
    Authentication Provider:            Windows
    Authentication Server:              PG-DC2.cfl.local
    Authentication Type:                EAP
    EAP Type:                           -
    Account Session Identifier:         -
    Reason Code:                        1
    Reason:                             An internal error occurred. Check the system event log for additional information.

Update: Actually, some requests are being approved. It looks only only 802.1x requests with the EAP authentication type are failing. Upon looking at the certificate situation, it looks like the server's certificate had expired and was preventing PEAP authentication.
Answer: The domain controller certificate had expired.
That prevented connections that required the Protected EAP authentication method. Re-issuing the domain controller certificate immediately allowed RADIUS requests to authenticate normally.
Answer: This error can also occur if the Domain Certificate auto renews.  NPS doesn't handle it well.
According to http://digitaljive.wordpress.com/2012/04/02/windows-nps-stops-authenticating-wireless-users/, you have to switch to a different certificate, apply it, and then switch back to the auto-renewed certificate.


Get a list of all the blocks

Question: I need an array of all blocks in the site
For example, if I display the array, it should output the block info or block titles e.g Search, User etc
Answer: Try this piece of code from a similar question
<code>global $theme;
$all_regions = system_region_list($theme);
$blocks = array();
foreach (array_keys($all_regions) as $region) {
  $blocks += block_list($region);
}
</code>
Comment: Getting following error Fatal error: Call to undefined function system_region_list()
Comment: It is a valid drupal 7 function http://api.drupal.org/api/drupal/modules!system!system.module/function/system_region_list/7. Which version of Drupal you are using ???
Comment: It is a valid function for Drupal 6 as well. Check if the system module exist and it has the proper read permissions.
Comment: I am using drupal 7 and i have checked system module it exists and it has proper read permission.
when i am calling it at hook_page_build function it works fine, but i am calling it in my custom function then i am getting Fatal error: Call to undefined function system_region_list()
Comment: I need simply all the list of block names at custom url. I think it should not be any relation with any region or theme. I need all the block list
Comment: This is a simple function only. When you collect block information it has to be w.r.t to a theme only. It will give you a list of all active themes.
Answer: Have a look at how blocks are defined. There are numerous hooks that are involved in providing a block. Call the appropriate one using module_invoke_all() to gather the appropriate information about the blocks.
Comment: Thanks for your help i have got the list of block with following code:  $blocks = _block_rehash($theme);

Get a list of all the blocks


Limpar Campo com JavaScript

Question: Estou utilizando esta função abaixo, para validar a data em todos os campos do tipo date do formulário, chamo a função no evento onBlur do txt.

 function VerificaData(digData) {
            var bissexto = 0;
            var data = digData;
            var tam = data.length;
            if (tam == 10)
            {
                var dia = data.substr(0, 2);
                var mes = data.substr(3, 2);
                var ano = data.substr(6, 4);
                if ((ano > 1900) || (ano < 2100)) {
                    switch (mes)
                    {
                        case '01':
                        case '03':
                        case '05':
                        case '07':
                        case '08':
                        case '10':
                        case '12':
                            if (dia <= 31)
                            { return true; }
                            break;
                        case '04':
                        case '06':
                        case '09':
                        case '11':
                            if (dia <= 30)
                            { return true; }
                            break;
                        case '02':
                            if ((ano % 4 == 0) || (ano % 100 == 0) || (ano % 400 == 0))
                            { bissexto = 1; }
                            if ((bissexto == 1) && (dia <= 29))
                            { return true; }
                            if ((bissexto != 1) && (dia <= 28))
                            { return true; }
                            break;
                    }
                }
            }
            alert("A Data " + data + " é inválida!");

            return false;
        }

Porém gostaria de saber como faço para que quando a data for inválida, limpar o campo ? Tentei de formar que daria certo, se fosse um txt e uma função, porém uso essa função para vários txts, então das formas que tentei, e pesquisei não funcionam.
Assim que chamo a função:

onBlur="VerificaData(this.value);
Comment: Olá Mariana! Essa função para verificar data parece-me desnecessáriamente complexa. Podes dar exemplo de datas que ela recebe e o que pretende detectar errado?
Answer: Pode construir outra função que interpreta o resultado da verificação da data e limpa caso não receba true:
function limparDataInvalida(campo){
     if (!VerificaData(campo.value)){
          campo.value = '';
     }
}

E o onblur passa a ficar sem o .value, assim:
<input ... onblur="limparDataInvalida(this);">

Edit
Para evitar o ciclo infinito de loops que se deve ao facto de o alert dentro de VerificaData chamar o onblur pode:

Mostrar a mensagem de outra maneira que não com um alert, por exemplo com uma mensagem do Jquery UI Dialog

Ou

Não validar a data se ela já foi limpa e por isso está vazia, modificando o if para ficar assim:
function limparDataInvalida(campo){
    //agora aqui vê primeiro se não é vazio
    if (campo.value != '' && !VerificaData(campo.value)){
        campo.value = '';
        campo.focus();
    }
}

Comment: @marianac_costa O problema é que o `alert` que está dentro de `VerificaData` força uma chamada ao `onblur`, e dai o ciclo infinito. Já coloco uma solução a isso.
Comment: Deu certinho Isac, muito obrigado. Como eu faço para o focus ficar setado para o  campo data ? Pois ele pula para o txt de baixo. Obrigado.
Comment: Para manter o focus no campo que tem a data inválida pode fazer `campo.focus();` a seguir ao `campo.value = '';` que está dentro do `if`. Mas tenha cuidado que isso faz com que o utilizador não consiga escrever em mais nenhuma caixa da página até acertar nessa data.
Comment: Eu fiz dessa forma, só que a mensagem de alerta, entra em loop infinito.
Comment: muito obrigado, deu super certo, e funcionou do jeito que eu precisava.
Answer: Mesmo que a resposta tenha sido dada pelo @Isac, eu queria deixar aqui minha contribuição.
Você pode usar uma solução completamente JavaScript, sem precisar passar nada pro HTML. Particularmente, porque eu gosto de manter tudo separado (HTML, CSS, JS, PHP, Python, Java, etc).
Você pode adicionar um event listener ao documento para monitorar o blur dos forms tipo data ou da classe que contém as valores de data, então executar sua função.
Conhecer o Document Object Model é uma forma excelente de não se perder. Estude-o! Você não vai se arrepender.
EDIÇÃO
Usando somente JavaScript
Primeiro método, sem protótipo:
// Seleciona os input tipo datanuma NodeList
var inputTipoData = document.querySelectorAll('input[type="date"]'),
    // Seleciona os input com a classe .date numa NOdeList
    inputClasseData = document.getElementsByClassName('date');

// Aplica o addEventListener para os input com tipo date
for (var i = 0; i < inputTipoData.length; i++) {
    inputTipoData[i].addEventListener('click', alertaOnBlur);
}

// Aplica o addEventListener para os input com classe date
for (var i = 0; i < inputClasseData.length; i++) {
    inputClasseData[i].addEventListener('blur', alertaOnBlur);
}
// Declara a função que será executada
function alertaOnBlur () {
    alert("Blur!!!");
};

Segundo método, com protótipo:
// Cria um protótipo para iterar uma NodeList monitorando cada elemento com
// addEventListener
NodeList.prototype.addEventListener = function(event, func) {
    this.forEach(function(content, item) {
       content.addEventListener(event, func);
    });
}

// Função definida por mim
function minhaFuncao () {
    alert("AAAHHHHHHH!!!");
}

// Pega todos os formulário tipo date na página
var formularioDate = document.querySelectorAll("input[type='date']");

// Monitora todos os formulários da lista acima com addEventListener
formularioDate.addEventListener("blur", minhaFuncao);

Comment: `querySelectorAll('input[type="date"]').addEventListener` vai dar erro, o `addEventListener` não trabalha sobre coleções como o `querySelectorAll` dá.
Comment: E tens o mesmo problema em `getElementsByClassName` que também retorna uma coleção.
Comment: Perfeito, @Sergio. Muito obrigado pela correção. Vi que você já editou a resposta. Obrigado mais uma vez.
Comment: Tony: não editei a resposta. O erro continua lá (na tua resposta). E tens o mesmo problema em `getElementsByClassName("classe-data").addEventListener`...
Comment: E de onde saiu esse `All` então? Eu sei que `querySelectorAll` pode funcionar dentro de um loop, usado junto com addEventListener. A resposta deveria ter `querySelector` só. Erro idiota meu.
Comment: ***Fuck!*** Dessa eu não sabia não. Vou fazer uma solução testada para essa questão. Obrigado!
Answer: Você pode também, em vez de criar uma nova função, na mesma função VerificaData(digData) adicionar o código abaixo após o alert:
window.focus();
campos = document.getElementsByTagName("input");
for (var x=0; x < campos.length; x++) {
  if(campos[x].value == digData) {
    campos[x].value = "";
  }

}
Esse código irá verificar o campo com valor enviado em digData e esvazia-lo.
O window.focus(); é para tirar o focus() do campo para evitar que o alert fique infinito.
Seu código ficaria assim:
function VerificaData(digData) {
            var bissexto = 0;
            var data = digData;
            var tam = data.length;
            if (tam == 10)
            {
                var dia = data.substr(0, 2);
                var mes = data.substr(3, 2);
                var ano = data.substr(6, 4);
                if ((ano > 1900) || (ano < 2100)) {
                    switch (mes)
                    {
                        case '01':
                        case '03':
                        case '05':
                        case '07':
                        case '08':
                        case '10':
                        case '12':
                            if (dia <= 31)
                            { return true; }
                            break;
                        case '04':
                        case '06':
                        case '09':
                        case '11':
                            if (dia <= 30)
                            { return true; }
                            break;
                        case '02':
                            if ((ano % 4 == 0) || (ano % 100 == 0) || (ano % 400 == 0))
                            { bissexto = 1; }
                            if ((bissexto == 1) && (dia <= 29))
                            { return true; }
                            if ((bissexto != 1) && (dia <= 28))
                            { return true; }
                            break;
                    }
                }
            }

            alert("A Data " + data + " é inválida!");
            window.focus();

            campos = document.getElementsByTagName("input");
            for (var x=0; x < campos.length; x++) {
                if(campos[x].value == digData) {
                    campos[x].value = "";
                }
            }
            return false;
        }

Limpar Campo com JavaScript