HorizontalPodAutoscaler deployment fails post GKE upgrade to 1.26

Question: We are using gcp and have recently updated to gke 1.26 earlier it was 1.16 something.
We had a horizontal pod autoscaler defined for one of our deployment
using version :- :autoscaling/v2beta2"
now since "autoscaling/v2beta2" has been removed from 1.26 gke,
we have updated the hpa manifest with version as "v2".
While trying helm upgrade we still get below errors:-
<code>UPGRADE FAILED: unable to build
kubernetes objects from current release manifest: resource mapping not found for name:
 "***-autoscaler" namespace: "*****" from "": no matches for kind "HorizontalPodAutoscaler" in version "autoscaling/v2beta2" ensure CRDs are installed first.
</code>
Although there is no reference to "autoscaling/v2beta2" in any deployment file.
What could be the issue here ?
Comment: can you please check what api versions are installed in the cluster using kubectl api-reosurces and check if that particular version is available
Comment: I tried
kubectl api-versions | grep autoscaling

autoscaling/v1
autoscaling/v2
internal.autoscaling.gke.io/v1
internal.autoscaling.gke.io/v1alpha1
Comment: kubectl api-resources | grep autosc

horizontalpodautoscalers          hpa                      autoscaling/v2                         true         HorizontalPodAutoscaler
capacityrequests                  capreq                   internal.autoscaling.gke.io/v1         true         CapacityRequest
Comment: Have you checked this github [link](https://github.com/helm/helm/issues/11287) and this official [documentation](https://cloud.google.com/kubernetes-engine/docs/deprecations/apis-1-26).
Comment: This was some issue with helm , tried uninstalling and reinstalling the chart and it worked for me.
Answer: This was some issue with helm , tried uninstalling and reinstalling the chart and it worked for me.


Storing Kerberos session keys

Question: How do you store Kerberos service keys in a Java program.
I have created a client and serverside program, where the serverside sites on my server and client is used on my computer, i can get to the serivce and use it - i then close it.
I want to reach the service again without having to log back into Kerberos, how could i do this?
Cheers
Answer: As a client? If you, oyu need a credential cache. This is done by logging in into the OS and have the cache maintained by your OS. Java accesses this cache.

Storing Kerberos session keys


Quotients of $S^{2n+1}$

Question: Any sphere $S^{2n+1} = SO(2n+2)/SO(2n+1)$ can be thought to be given as the zero-set in $\mathbb{C}^{n+1}$ of the equation, $\sum_{i=1}^{n+1} \vert z_i \vert ^2 = 1$
Now say one wants to quotient it such that the identification is, $\phi_i \sim \phi_i + \alpha_i$ where we think of each $z_i$ to be given as $z_i = r_i e^{i\phi_i}$.

For this quotienting to be well defined is it necessary that there exist integers $n_i$ such that $\sum_i n_i \alpha_i = 2\pi$?
I vaguely feel that if this condition is not satisfied then the resulting space would become an "orbifold" and may not be a manifold. But I can't make it precise..
Now consider the special case when $\alpha_1 \neq 0$ and all the others $\alpha$ are $0$.

In this scenario is is there a discrete group $\Gamma$ (of $SO(2n+1)$) such that the resulting quotient space can be thought of as $\Gamma \backslash SO(2n+2)/SO(2n+1)$?
Is $\Gamma =  \mathbb{Z}_{n_1=\frac{2\pi}{\alpha_1}}$? If yes, why?
Is this quotient space somehow naturally related to $S^{2n}\times S^1$?

Although I don't immediately need it but it would be interesting to know if someone can tell the corresponding statements to the above in the case when more than one $\alpha$ are non-zero.
Comment: I suspect you mean $\mathbb C^{n+1}$ in the first sentence.
Comment: @AlexBecker Ah..right!..i was counting reals :) So if you can help with the question...
Answer: Note that I use $n$ where the question uses $n+1$ since I didn't want to carry around all the $+1$'s, so here we are looking at $S^{2n-1} = \mathrm{SO}(2n) / \mathrm{SO}(2n-1) \subset \mathbb{C}^n$.
First note that the map $f(r_1 e^{i \phi_1}, \dots, r_n e^{i \phi_n}) = (r_1 e^{i (\phi_1 + \alpha)}, r_2 e^{i \phi_2}, \dots, r_n e^{i \phi_n})$ is an element of $\mathrm{SO}(2n)$, it is just rotation by $\alpha$ in the $z_1$ plane. It is given by the matrix in $GL(n, \mathbb{C})$, where $I$ is the $(n-1) \times (n-1)$ identity matrix:
$$
\begin{pmatrix}
e^{i \alpha} & 0 \\
0 & I
\end{pmatrix}
$$
Let $A_i$ denote rotation by $\alpha_i$ in the $z_i$ plane. Hence your equivalence relation is the same as quotienting by a certain subgroup of $\mathrm{SO}(2n)$.
Note that the subgroup generated by all the rotations in the $z_i$ planes is a torus, namely all the diagonal matrices in $\mathrm{GL}(n, \mathbb{C})$ with diagonal entries of length $1$, call this subgroup $T$.
I am not sure if you are considering quotienting by the subgroup generated by $\{ A_1, \dots, A_n \}$ or by the subgroup generated by $A = A_1 \cdot \dots \cdot A_n$. Where $A$ is the diagonal matrix:
$$
\begin{pmatrix}
e^{i \alpha_1} \\
& e^{i \alpha_2} \\
&& \ddots\\
&&& e^{i \alpha_n}
\end{pmatrix}
$$
In the first case consider $\alpha_i \in \mathbb{R} \setminus \pi \mathbb{Q}$ for some $i$, you get that each equivalence class $\phi_i + \alpha_i \mathbb{Z}$ is dense in $S^1$, but you still have uncountably many equivalence classes in $S^1$. But all these equivalence classes will be indistinguishable in the quotient topology, in the sense that if you have any open set, it either contains none of them or all of them. Hence the quotient space is not Hausdorff. We can restrict to considerations on $S^1$ like this since, quotienting by the subgroup generated by the individual $A_i$ is the same as the equivalence relations on angles given by $(\phi_1, \dots, \phi_n) \sim (\phi_1 + k_1 \alpha_1, \dots, \phi_n + k_n \alpha_n)$, and we can then fix the $r_i$, and the $k_j$ for $j \neq i$, since we don't risk collapsing equivalence classes in the $\phi_i$ parameter by rotating in the $\phi_j$ parameters. Hence the quotient of the sphere will also be non-Hausdorff.
So in the first case you probably want all the $\alpha_i$ to be rational multiples of $\pi$.
In the second case, for fixed $r_i$ you are looking at an n-dimensional torus and quotienting by the subgroup generated by a single element, the condition you mention looks a lot like $2\pi, \alpha_1, \dots, \alpha_n$ being linearly independent over $\mathbb{Q}$, which is exactly the condition equivalent to the subgroup generated by $A$ not being dense in the torus of rotations. This follows from Kronecker's approximation theorem, near the end of that page is the exactly the specialization that is interesting in this case.
But something stronger than linear dependence over $\mathbb{Q}$ is needed. Think of $n=2$, $\alpha_1 = \alpha_2 = \frac{1}{2}$. This is linearly dependent over $\mathbb{Q}$ but visits $0$ infinitely often. In the sense that for any $m$ and $\epsilon > 0$ we can find $M > m$ such that $(\frac{M}{2}, \frac{M}{2}) \in B_\epsilon(0)$, since $e^{i \frac{1}{2} \mathbb{Z}}$ is dense in $S^1$. And considering $n=3$, $\alpha_1 = \alpha_2 = \frac{1}{2}$, $\alpha_3 = \frac{\pi}{2}$ these parameters fulfill the exact requirement suggested but still give a non-Hausdorff quotient.
We can generalize this argument by considering $\alpha_i \in \mathbb{R} \setminus \pi \mathbb{Q}$ for some $i$. Then the subgroup generated by $A$ is non-finite, consider $H = \overline{\langle A \rangle}$ the closure of the subgroup generated by $A$, this is a closed subgroup of a compact Lie group hence a compact Lie group, it is non-finite and abelian hence the identity components $H_0$ is a torus, at least 1 dimensional. We see $H / \langle A \rangle$ is uncountable but has the trivial topology since $\langle A \rangle$ is dense in $H$. Look at the closed subset $H . p \subset S^{2n-1}$ for $p \in S^{2n-1}$, this is closed since $H$ is compact. If we choose $p$, such that all the $r_i > 0$ then the stabilizer in $T$ of $p$ is $e$. Therefore $H . p$ is a submanifold of $S^{2n-1}$ diffeomorphic to $H$, hence when we quotient by $A$ we get the same topological behavior as on the group. So the quotient of the sphere cannot be Hausdorff.
So we are probably still only interested in rational multiples of $\pi$, assuming the above checks out.
If you consider $\alpha_1 = \frac{p}{q}2\pi$, and $\alpha_i = 0$ for $i > 1$, $\frac{p}{q}$ a reduced fraction. It is now quite easy to see that $A_1$ has order $q$ just by taking higher and higher powers, hence it generates a cyclic subgroup of order $q$. So in this case $\Gamma \simeq \mathbb{Z}_q$.
When $\alpha_i = \frac{p_i}{q_i} 2\pi$ with $\frac{p_i}{q_i}$ reduced and $p_i \neq 0$. We see that $\langle A_1, A_2, \dots, A_n \rangle \simeq \mathbb{Z}_{q_1} \times \dots \times \mathbb{Z_{q_n}}$ whereas $\langle A \rangle \simeq \mathbb{Z}_{\mathrm{lcm}(q_1, \dots, q_n)}$. Hopefully it is now an easy exercise to see what happens with $p_i = 0$ for some of the $i$'s.
I know this doesn't answer all of your questions but hopefully it gives some insight, I will continue thinking about the problem.
Comment: So if I understand you right you mean that if $\alpha = \frac{2\pi}{N}$ then the subgroup one is modding out by is $\mathbb{Z}_N$ - right? I am not getting how you see a $SO(2n)$ rotation. It is a $S^{2n+1}$ and hence  doesn't this $\mathbb{Z}_N$ have to necessarily has to be generated by a rotation matrix in $SO(2n+2)$ which rotates by an angle $\alpha$ in the $z_1$ plane in $\mathbb{C}^{n+1}$?
Comment: Yes I silently subtracted $2$ from the dimension of everything since I didn't want to carry around the $+1$'s. It is now edited to reflect that more clearly.
Comment: Ehlers Nyholm Thanks! Can you shed light on the other part of my question as to if there is any natural relation between $S^{2n}\times S^1$ and the quotient of $S^{2n+1}$ with only $\alpha_1 \neq 0$?
Comment: Ehlers Nyholm Thor (...I am actually looking a similar case with $H^{2n+1}$ also..imagine that with the metric, $cosh^2\rho dt^2 + d\rho^2 + sinh^2\rho d\Omega_{2n-1}$ and identify $t \sim t+ \beta$..then apparently there a similar analysis says that the quotient is $\mathbb{Z} \backslash SO_0(2n,1)/SO(2n)$..again I would want to know if there is a natural relation between this quotient space and $\mathbb{H}^{2n} \times S^1..)It would be great if you could clarify this.
Comment: Those questions are really not my area of expertise, but talking a bit with my office mate has led to the following Wikipedia articles: https://en.wikipedia.org/wiki/Lens_spaces and https://en.wikipedia.org/wiki/Spherical_3-manifold which suggest that by taking $\alpha_1$ and $\alpha_2$ you get it in the 3-dimensional case. However our collective intuition suggests that the $\alpha_2 = 0$ case should (topologically) give you a 3-sphere as quotient. As for the hyperbolic case intuitively we think you are right, provided we understand you correctly, imagine it in the upper half space model and
Comment: make the $t$ direction parallel to the "bottom" plane. Then intuition suggest that the quotient you get should simply be a hyperbolic space cross $S^1$.
Comment: A treasure hunt through Hatcher's book referenced in the Wikipedia article on Lens spaces gives a wealth of information, specifically it seems that the $S^2 \times S^1$ case is not readily available as a quotient of the type we are considering. Furthermore since we quotient by finite groups hence the fundamental group of the quotient must be finite(the same group), specifically we can't get $S^{2n} \times S^1$ in this way.
Comment: Ehlers Nyholm So you are saying that my intuition is correct that identification I did on $\mathbb{H}^{2n+1}$ does indeed produce $\mathbb{H}^{2n} \times S^1$?
Comment: I guess you want to imagine the "t" direction in the $\mathbb{H}^{2n+1}$ metric to be orthogonal (And NOT parallel!) to the plane separating the upper half plane and the lower half plane..right? Only then does compactifying this "t" give us a H^{2n} \times S^1 - right?
Comment: Ehlers Nyholm And what happens to the curvatures under such a quotient if it indeed H^{2n}xS^1 arises from such a quotient of H^{2n+1}?
Comment: I think you are right, but I haven't proven it rigorously nor found a reference. The reason why I want the $+\beta$ action to be parallel to the bottom plane is that then $\mathbb Z$ will be acting by isometries. Note this is not a restriction since you can always act by an isometry making a given direction parallel to the separating half-plane, since it a symmetric space. With regards to exactly what metric you get on the quotient, that would be too far from my expertise that I have any reasonable suggestions.

Quotients of $S^{2n+1}$


What is a model of $RCA_0$ plus the negation of the weak Konig's lemma?

Question: What is a model of $RCA_0$ plus the negation of the weak Konig's lemma?
This came up in conversation with someone and I couldn't find anything with a cursory search.
Comment: The model REC consisting of $\omega$ and the computable subsets of $\omega$.
Answer: Elaborating on Carl Mummert's comment, the standard example is REC - this is the $\omega$-model (= standard first-order part) with just the recursive (or computable) sets. It is the smallest $\omega$-model of RCA$_0$.
To see that REC doesn't satisfy Weak Konig's Lemma, it's enough to show that there is a computable tree $T\subseteq 2^{<\omega}$ with no computable path. There are many well-known examples of such trees, the most natural in my opinion being the DNR$_2$ tree: a finite binary sequence $\sigma$ is on the DNR$_2$ tree iff for each $i<\vert\sigma\vert$ we have $$\neg(\Phi_i(i)[\vert\sigma\vert]\downarrow=\sigma(i))$$ where $(\Phi_i)_{i\in\omega}$ is some reasonable enumeration of the partial recursive binary functions. Since the defining property only refers to bounded-length computations, this tree is indeed computable. That is, the DNR$_2$ tree is in REC.
So why does REC think it has no paths? Well, the DNR$_2$ tree is trying to "diagonalize" against all the computable functions (and indeed "DNR" stands for "Diagonally Non-Recursive" - the "$2$" is because we're looking at binary functions): if $f$ is a path through the DNR$_2$ tree,  we know that $f$ can't be computed by $\Phi_e$ because the $e$th bit of $f$ is different from the $e$th bit of the real computed by $\Phi_e$ (if the latter even exists!). Such functions obviously exist, but just as obviously aren't computable, so the DNR$_2$ tree is infinite but has no computable path.

Incidentally, the DNR$_2$ tree is "universal" in a precise sense: if $T$ is an infinite computable binary tree, then any path through the DNR$_2$ tree computes a path through $T$, and this is uniform in an index for $T$. This is a good exercise. HINT: for a computable tree $S$ we can find an $e_S$ such that $\Phi_{e_S}(e_S)\downarrow=1$ iff the "left half" of $S$ dies before the "right half" of $S$ ...


The model passed into dictionary is type 'TestApp.Models.Registration.RegistrationVm' but this dictionary requires a model item of type System.String

Question: I have the Registration controller:
public class RegistrationController : Controller
{
    private RegistrationVmBuilder _registrationVmBuilder = new RegistrationVmBuilder();
    public ActionResult Index()
    {
        return View(_registrationVmBuilder.BuildRegistrationVm());
    }

}

and the RegistrationBuilder class:
public class RegistrationVmBuilder
{
    public RegistrationVm BuildRegistrationVm()
    {
        RegistrationVm registrationVm = new RegistrationVm
        {
            Courses = GetSerializedCourseVms(),
            Instructors = GetSerializedInstructors()
        };
        return registrationVm;
    }
}

RegistrationVm class:
public class RegistrationVm
{
    public string Courses { get; set; }
    public string Instructors { get; set; }
}

_Layout.cshtml:
@model string

    @RenderSection("JavascriptInHead")
    <link href="~/Content/bootstrap.min.css" rel="stylesheet" />
    <link href="~/Content/bootstrap-state.min.css" rel="stylesheet" />
    <title>College Registration</title>

    @RenderBody()

And in index view:
@model TestApp.Models.Registration.RegistrationVm
The problem is when i run the app I got this error:

The model item passed into the dictionary is of type
  'TestApp.Models.Registration.RegistrationVm', but this
  dictionary requires a model item of type 'System.String'.
Comment: What line of your code gets this error?
Comment: @alisabzevari after I run the application in registration url.
Comment: What do you mean by registration url?
Comment: For example `http://localhost:30460/registration`
Comment: You have to trace your application from the start of you controller action to find where the error occurs.
Comment: What is the model of the `~/Shared/_Layout.cshtml`? Are you sure _only_ `RegistrationsController.Index()` is being hit?
Comment: @CodeCaster is just general Layout to load in every page.
Comment: I didn't ask that. Does your layout have a `@model string` in it? Please show all relevant views.
Comment: Yeah remove the `@model string` from your `_Layout.cshtml`.
Answer: The shared _Layout.cshtml has a model declared (@model string), which is inherited by any view that uses it. So essentially your Index view's model (@model TestApp.Models.Registration.RegistrationVm) is ignored.
I don't know why you have @model string in your _Layout view (the model doesn't seem to be used in there), but if you want to use inheritance see Pass data to layout that are common to all pages.
Simply remove the model declaration from the shared layout.


Why does this jquery onClick event not get activated?

Question: Essentially, I'm building a quiz where at the end of the quiz, when you click results, I change the class of a button from nextquestion to showResults. However, the issue is that even after I change the class, when I click showResults, it's going into the nextquestion onClick() event and never even goes into the showResults. I inspect the element, and the button's class is most definitely showResults, so why is this still occurring?
$(".nextquestion").click(function ()
{
    if (questionnumberindex < NUM_OF_CHOICES)
    {
        var newQuestion = '<form>' + '
 Question' + (questionnumberindex + 1) + ': ' + questionholders[questionnumberindex].question + '
';
        var bob = questionholders[0].choices[0];
        for (var i = 0; i < questionholders[questionnumberindex].choices.length; ++i)
        {
            newQuestion += '<input type="radio" name="Q' + questionnumberindex + '" value="' + questionholders[questionnumberindex].choices[i] + '">' + questionholders[questionnumberindex].choices[i] + '
';
        }
        newQuestion += "</form>";
        questionnumberindex++;
        userAnswers.push($('form input[type=radio]:checked').val());
        $(".questioncontainer").html(newQuestion);
    }
    else
    {
        $(".questioncontainer").text("Quiz Finished!");
        $(".nextquestion").text("See your Results!");
        $(".nextquestion").addClass("showResults");
        $(".nextquestion").removeClass("nextquestion");
    }

});

$(".showResults").click(function ()
{
    var numCorrect = 0;
    //calculate number of answered correctly
    var totalQuestions = questionholders.length;
    for (var i = 0; i < totalQuestions; i++)
    {
        if (userAnswers[i] == questionholders[i].correct)
        {
            numCorrect++;
        }
    }
    var percentageRight = numCorrect / totalQuestions;
    //display all the questions
    var displayAllQuestions = "You got " + numCorrect + "/" + totalQuestions + "correct!";
    for (var i = 0; i < totalQuestions; i++)
    {
        var currentQuestion = "Question " + i + ": " + questionholders[i].question + "
";
        for (var j = 0; j < questionholders[i].choices.length; j++)
        {
            currentQuestion += "
" + questionholders[i].choices[j] + "
"
        }
        currentQuestion += "
";
        displayAllQuestions += currentQuestion;
    }

    $(".showResults").remove();
    $(".questioncontainer").html(displayAllQuestions);
})

});
Comment: I think you have an extra `});` at the end of your code...
Comment: Make sure that your button has the right class.  If you want to grab id use "#nextQuestion"
Answer: When you run the code to bind the events to the classes showResults and nextQuestion, jQuery finds the current items on the page with those classes and applies the function. Since nothing on the page has showResults until the end of the questions, the showResults click function will not be bound to anything.
One solution would be to bind the showResults event inside of the nextQuestion event:
$(".nextquestion").on("click.NextQuestion", function(){
    if(questionnumberindex < NUM_OF_CHOICES) {
        //insert Next Question Code Here
    }
    else {
        $(".questioncontainer").text("Quiz Finished!");
        $(".nextquestion").text("See your Results!");
        $(".nextquestion").addClass("showResults");
        $(".nextquestion").removeClass("nextquestion");

        //unbind the "Next Question event:
        $(this).off("click.NextQuestion");

         //bind the Show Results event:
        $(this).on("click", function() {
            //insert Show Results Code here
        });
    }
});

This solution also uses event namespacing so that you can remove the NextQuestion click event without removing any other click events associated with the button.
Comment: Great, I was wondering whether jQuery was even aware of this new class's existence. Thanks for the detailed answer andthe additional namespace solution.
Comment: can you explain `.on("click.NextQuestion")`? i thought the syntax was `$(scope).on( events, selector,callback)`
Comment: Sure, [event namespacing](http://api.jquery.com/event.namespace/) is a way to group events. In that example, `click` is the name of the event and `NextQuestion` is the name of the namespace. `NextQuestion` means absolutely nothing to the browser; it is a name I made up to pass it to jQuery so it could be referenced later.


How to embed user control (ascx) from code behind C#?

Question: Embedding user controls into html page is easy but what about embedding user controls dynamically from code behind c#? Any help/suggestions would be greatly appreciated.
Answer: Use LoadControl to load and create a control dynamically. Then you can add it to the page's control-collection.
UcType myControl = (UcType) LoadControl("UcType.ascx");
this.SomeContainerContainerControl.Controls.Add(myControl);

where UcType is the type of your UserControl and SomeContainerContainerControl is the control you want to add this uc like a Panel.
If you want to add it on top of the page simply use this.Controls.Add(myControl).
You should add it in Page_Init or Page_Load (at the latest). You have to recreate it on every postback as every other dynamic control with the same ID as before (if any).
Comment: It should be `UcType myControl = (UcType) LoadControl("UcType.ascx");` (without the .cs) otherwise it throws an InvalidCastException.
Comment: Thanks for noting. I wasn't sure since [MSDN](http://msdn.microsoft.com/en-us/library/t9ecy7tf%28v=vs.110%29.aspx) also shows an example with `.cs`.
Answer: You can use the LoadControl() method and load it into a content control
example:
protected void Page_Load(object sender, EventArgs e)
{
    controls_example exmp = LoadControl("controls/example.ascx") as controls_example;
    myContentPanel.Controls.Add(exmp);
}


are recommendation questions allowed re: tutorials?

Question: if I were to ask for "what's the best tutorial or website to learn Drupal AJAX implementations" -- that's not allowed, right?
This site is more for very specific, Drupal-only questions that don't involve PHP, Apache, REST, database issues, etc.?
Maybe someone with this type of requirement (recommendation) can ask this question in drupal.slack?
Answer:
if I were to ask for "what's the best tutorial or website to learn Drupal AJAX implementations" -- that's not allowed, right?

Right! "Best" is usually subjective, certainly with regard to what the best resource to learn something is (it will vary from person to person), which goes against our mission to produce a repository of objective knowledge. Asking for links has also been proven to produce generally low quality content across the Stack Exchange network, I'm not aware of any site that allows it.

This site is more for very specific, Drupal-only questions that don't involve PHP, Apache, REST, database issues, etc.?

If the subject matter of the question relates to Drupal, it's probably on-topic. If the subject matter is about something that you happen to be doing whilst also working on a Drupal site, it's probably off-topic. As a contrived example, not really an example of a "good" or even sensible question, but just for illustration:

I have Drupal installed in a sub-folder and I need to change the rewrite rule for the files folder. I tried xyz and it didn't work

Is a question about server config in the context of Drupal, it likely requires Drupal-specific knowledge to answer, so this is the right place for it.

I need to redirect all requests from the non-www to the www version of my site

Doesn't need any Drupal-specific knowledge to answer, it's the same thing for any website, so it can be dealt with elsewhere (i.e. Stack Overflow).

How do I change the colour of xyz element

Off-topic, CSS doesn't change with Drupal

I have this CSS rule that changes xyz element to red - how do I get it into an inline style in the head of the page?

Very much on-topic
There's a nuance to it that's hard to define 100%, so ironically there's an element of subjectivity in it, but only in the same way that literally everything in the world is rooted in someone or some people's opinions somewhere along the line. The guidelines in the help center do a good job of covering it for the most part.

Maybe someone with this type of requirement (recommendation) can ask this question in drupal.slack?

I can't speak to that channel specifically, but yes there are definitely other support avenues available than this site. We have a list of some of them here. If you find that Drupal.slack is a useful option, it would be great if you could provide an answer to that meta question with the details :)
Comment: Ah -- great answer.

I had to maintain some existing AJAX Drupal code a couple of years ago, and was able to get by. But would like to find a proper, 30-page, step-by-step tutorial with examples on how to implement some basic Hello World, Contoso, Meadowlark, Northwinds, Example.com modals, DB reads, DB writes, screen updates, modals, etc.

I'll start my IRC, slack, Google, etc. search!


How to hang a baby cradle from a concrete ceiling?

Question: I am considering buying a baby cradle that will hang from the ceiling. We have a concrete ceiling in the apartment and I am not sure that it will be possible to install it safely. It needs to be able to support 35-40 pounds of weight, max.

I was planning to use a Tapcon® concrete screw - is it a good idea?
How to actually connect the bag to that screw - I would need some kind of intermediary platform/connector.
When drilling a hole in the ceiling, does it matter where to drill, or should I use some kind of stud finder to look for a support beam (if they exist in concrete ceilings)?

The cradle comes with a hook, but I am not sure if it will hold.
Comment: That sounds incredibly scary to me. Concrete is well-known for crumbling even if properly reinforced. If you have no access to a support bean I'd give this a pass.
Comment: There are no studs in concrete ceilings, so that part of your question won't apply.  If this is a rental unit, most landlords strongly prefer tenants not perform this kind of work.  Some will put the hole in for you (I've seen landlords install plant holders for tenants in this fashion)
Answer: Concrete is a great building material because it has very high "compressive strength"; it resists being crushed, and so can support a very heavy load placed on top of it.
However, it has very poor "tensile strength" and "shear strength"; it can be "pulled apart" relatively easily. This means that hanging stuff from underneath usually doesn't work very well, because the hanging load will "pull" on the concrete. While the relatively light weight of something like this would not normally be a concern, the fact that you'll be putting something very precious and delicate in it makes me very wary.
If you want to try it anyway, forget the hook that came with the cradle; it's for screwing into a wood support member like a ceiling joist or beam, and will not work at all in concrete. You will first need to drill a hole in the concrete. This will require a concrete drilling bit (probably several of them; concrete is not easy to drill through and will dull bits very quickly) and possibly a hammer drill if it's treated or hardened concrete.
Then, you will want to install a concrete anchor. These anchors are designed to "crush" as you screw a bolt into them, expanding a part of their frame into and against the concrete to lock it in place. Here's one that should work for you:

Its 5,000-lb rated load may be a bit of overkill, but you don't want this to fail, EVER, so go for broke. You can even use some construction adhesive or epoxy to further "seat" the anchor in the hole.
Then, after any adhesive or epoxy you put in has had time to set and cure, you just hook the cradle to the D-bolt on the anchor (this may require an S-hook, climbing carabiner or threaded quick-link) and you're done.
Comment: How about buying a cradle that is designed to just sit on the floor?
Comment: +1 great answer, though it sounds like it could be easier (and involve less worrying) to build a wooden frame!
Comment: You're preaching to the choir here guys. I told him how to do what he wants specifically; I didn't say it was the easiest way to get what he needs.


Show Symfony profiler only for admins

Question: I would like to show the Symfony profiler bar (and access to profiler) only for page admins (ROLE_SUPER_ADMIN).
I have following this instructions: http://symfony.com/doc/2.8/cookbook/profiler/matchers.html#creating-a-custom-matcher
But there does not work. I get this error message:
AuthenticationCredentialsNotFoundException in classes.php line 2892:
The token storage contains no authentication token. One possible reason may be that there is no firewall configured for this URL.

Can anybody help me, or know this error message?
Thanks for all replies in future!
Comment: Thank you for your reply!
Here is a pastebin: http://pastebin.com/jJBFixkJ
I have already found the issue. The following lines need to be uncommented:
`firewall:
    dev:
        pattern: ^/(_(profiler|wdt)|css|images|js)/
        security: false`
Comment: could you share the security.yml file ? it seems that the problem is there
Answer: Make sure the dev section in your security.yaml have the right arguments.
Make sure you uncomment the following lines in your security.yaml:
firewalls:
    dev:
        pattern: ^/(_(profiler|wdt)|css|images|js)/
        security: false

After there it should working fine.

Show Symfony profiler only for admins


Jordan–Chevalley decomposition

Question: I'm trying to understand the proof of it in Humphreys(Humphreys 1972, Prop. 4.2, p. 17). And I've not got over which field we are working. The characteristic polynomial may not have roots in the initial field, but he considers the endomorphisms of kind $ (x - a_i * id) $, where x is the endomorphism that we want to decompose, and $a_i$ is one of its roots.
Comment: Humphreys has written more than one book. Perhaps you could mention the title?
Comment: Humphreys, James E. (1972), Introduction to Lie Algebras and Representation Theory
Answer: The first paragraph of Chapter II of Humphreys' book (pg. 15) states the assumption that the field $F$ is algebraically closed and has characteristic 0 for the duration of the book. Hence the roots of the characteristic polynomial must be contained in $F$.

Jordan–Chevalley decomposition


How to write Gstreamer-RS custom plugin with capability to update/overwrite extension header without allocation overhead in Rust?

Question: I am creating a custom plugin with application/x-rtp as sync and src. I want to add custom payload to the extension. My plugin definition is :
glib::wrapper! {
    pub struct CustomPlugin(ObjectSubclass<imp::CustomPlugin>) @extends gst_base::BaseTransform, gst::Element, gst::Object;
}

In transform_ip, I just want to add custom data to the extension.
As of current I have
fn transform_ip(&self, element: &Self::Type, buf: &mut gst::BufferRef) -> Result<gst::FlowSuccess, gst::FlowError> {
        let mut out_frame: BufferMap<Writable> = buf.map_writable().map_err(|_| {
            gst::element_error!(
                element,
                gst::CoreError::Failed,
                ["Failed to map input buffer readable"]
            );
            gst::FlowError::Error
        })?;
        let mut_buf: &mut Buffer;// = out_frame...
        let mut rtp_buffer = RTPBuffer::from_buffer_writable(mut_buf).unwrap();
        rtp_buffer.add_extension_onebyte_header(1u8, &[1u8]).unwrap();
        Ok(gst::FlowSuccess::Ok)
    }

Line containing let mut_buf: &mut Buffer;// = out_frame...  needs to be fixed.
My questions are :

Am I going in the right direction. Do I need to use a different Base class. The current base class is gst_base::BaseTransform.
I am new to multimedia and Rust. Is there a good resource apart from gstreamer. It is a good source but I find it difficult to follow. Though tutorial with Rust is fantastic with detailed explanations.
Comment: I was able to make buffer from BufferRef using `let mut new_buf = unsafe {gst::Buffer::from_glib_full(buf.as_mut_ptr())};` but then at end get error `(gst-launch-1.0:59163): GStreamer-CRITICAL **: 17:24:08.834: gst_pad_push: assertion 'GST_IS_BUFFER (buffer)' failed.` Still stuck !!!
Answer: GStreamer Change to fix above issue
Gstreamer team made a change to the interface and now RTPBuffer::from_buffer_writable accepts &mut gst::BufferRef, which we already have.
Final code looks like
fn transform_ip(&self, element: &Self::Type, buf: &mut gst::BufferRef) -> Result<gst::FlowSuccess, gst::FlowError> {
        let mut rtp_buffer = RTPBuffer::from_buffer_writable(&mut buf).unwrap();
        rtp_buffer.add_extension_onebyte_header(1u8, &[1u8]).unwrap();
        Ok(gst::FlowSuccess::Ok)
    }

And we have fix. Thanks, GStreamer team to resolving this fast.


Do I need 12" vertical brass stubs on this Rheem Water Heater?

Question: I'm installing a Rheem Marathon electric 50-gal water heater, in a 2nd floor, where it'll service only the 1st floor (so it kinda has a "built in" heat trap since the pipe only goes down). Been trying to contact Rheem for 2 weeks with no response. There's no code official here for me to ask either (unincorporated area). I want to follow best practices to ensure safety and performance.

The manual says "pre-solder 12" minimum stub pipes before installing to unit." We don't use copper here due to water composition. I could use a brass nipple, but I want to be sure I understand the purpose of this requirement. Is it:
-(a) to ensure vertical clearance (which I'll have regardless)
-(b) to ensure that a plumber does not melt plastic components while soldering < 12" from the inlet/outlet (irrelevant to me)
-(c) to make sure there is not a pressure "bottleneck" at the tank whether for safety or water pressure issues (good reason!)
-(d) some other reason?

If I do need to put 12" of brass here... does it have to be vertical? Or could I instead attach a brass street elbow directly to the inlet/outlet, then put the brass nipple horizontal? Again I don't want to mess with water pressure or safety.
--And if it does have to be vertical, then why Terry ok here? https://youtu.be/m598ynGCg74. (I trust him over the manual that came with my heater, which is generic for all Rheem tank models). Thing is, my installation will be all hard piped.

The unit is being plumbed with Pex-A (Uponor) which is rated for direct connection to a water heater. Manual p. 8 says "Hot water connection fitting must have an ID > 0.725"." I can accomplish that with a 3/4" brass nipple, which I will then adapt to Pex-A (0.681" ID) - but is there a minimum length required for that nipple?

Not trying to cut corners at all – just want to understand the purpose behind the instructions so I can do what's best in this situation. Thanks!
Answer:
Is about soldering to the pipe stub, and does not apply. Even if you don't have a local code official in your unincorporated area, you may have state codes that apply, technically. In my state we are supposed to have 3 feet of metal pipe before any plastic pipe, no matter how rated (annoying local code modification.) Stainless steel pipe is more resistant to most types of corrosion and usually cheaper than brass pipe.
Does not, therefore, apply.
Does not seem concerning, since it's going into that size anyway. If your plumbing setup allows, you could perhaps find a 3/4" NPTM-1"PEX fitting, and run the 1" PEX to the first Tee in the hot water line, to be fussy about it.

You DO need a vacuum breaker on the cold line, since the water heater is above all (or any of) the outlets. The tank can be crushed by vacuum if the supply is off and the outlets below the tank are open. That should be between the tank and any valve on the supply.
Comment: See https://diy.stackexchange.com/q/215364/18078 about the vacuum breaker.
Comment: Thank you ecnerwal! This water heater has a vacuum relief valve built into the cold inlet. As for the rest... do you think I'll have pressure issues (or any other) if the first thing connected to the inlet/outlet is a brass elbow? As opposed to something vertical or flexible.
Comment: No, but I'd look for stainless there, too.
Comment: Why stainless over lead free brass? The outlet/inlet on the heater are brass, and the pex adapters I have are brass...
Comment: Costs less, more corrosion resistant unless you specifically have chloride issues. But lead-free brass is fine, too.
Comment: Here's a response I got on Terry Love: "18" of hard pipe is the rule for most codes. Yes it's a saftey thing for a runnaway water heater situation. The T&P will feel the pressure and temp before the piping will, as long as there is 18" of hard pipe. Without it the steam heat and pressure can effect the piping connected to the water heater. The chimney is not a factor. Although maybe some inspectors might let some get away with hooking PEX to a water heater you don't want floppy noodles spraying steam and whipping around in every direction." Thoughts?

Do I need 12” vertical brass stubs on this Rheem Water Heater?


Checking parallel regression assumption in ordinal logistic regression

Question: I have tried to build an ordinal logistic regression using one ordered categorical variable and another three categorical dependent variables (N= 43097). While all coefficients are significant, I have doubts about meeting the parallel regression assumption. Though the probability values of all variables and the whole model in the brant test are perfectly zero (which supposed to be more than 0.05), still test is displaying that H0: Parallel Regression Assumption holds. I am confused here. Is this model perfectly meets the criteria of the parallel regression assumption?
library(MASS)
table(hh18_u_r$cat_ci_score) # Dependent variable

Extremely Vulnerable  Moderate Vulnerable    Pandemic Prepared
              6143                16341                20613

# Ordinal logistic regression
olr_2 <- polr(cat_ci_score ~ r1_gender + r2_merginalised + r9_religion, data = hh18_u_r, Hess=TRUE)
summary(olr_2)

Call:
polr(formula = cat_ci_score ~ r1_gender + r2_merginalised + r9_religion,
  data = hh18_u_r, Hess = TRUE)

Coefficients:
                      Value Std. Error t value
r1_genderMale          0.3983    0.02607  15.278
r2_merginalisedOthers  0.6641    0.01953  34.014
r9_religionHinduism   -0.2432    0.03069  -7.926
r9_religionIslam      -0.5425    0.03727 -14.556

Intercepts:
                                       Value    Std. Error t value
Extremely Vulnerable|Moderate Vulnerable  -1.5142   0.0368   -41.1598
Moderate Vulnerable|Pandemic Prepared      0.4170   0.0359    11.6260

Residual Deviance: 84438.43
AIC: 84450.43

## significance of coefficients and intercepts
summary_table_2 <- coef(summary(olr_2))
pval_2 <- pnorm(abs(summary_table_2[, "t value"]), lower.tail = FALSE)* 2
summary_table_2 <- cbind(summary_table_2, pval_2)
summary_table_2

                                            Value Std. Error    t value        pval_2
r1_genderMale                             0.3982719 0.02606904  15.277583  1.481954e-52
r2_merginalisedOthers                     0.6641311 0.01952501  34.014386 2.848250e-250
r9_religionHinduism                      -0.2432085 0.03068613  -7.925682  2.323144e-15
r9_religionIslam                         -0.5424992 0.03726868 -14.556436  6.908533e-48
Extremely Vulnerable|Moderate Vulnerable -1.5141502 0.03678710 -41.159819  0.000000e+00
Moderate Vulnerable|Pandemic Prepared     0.4169645 0.03586470  11.626042  3.382922e-31

#Test of parallel regression assumption
library(brant)
brant(olr_2) # Probability supposed to be more than 0.05 as I understand

----------------------------------------------------
Test for        X2  df  probability
----------------------------------------------------
Omnibus         168.91  4   0
r1_genderMale       12.99   1   0
r2_merginalisedOthers   41.18   1   0
r9_religionHinduism 86.16   1   0
r9_religionIslam    25.13   1   0
----------------------------------------------------

H0: Parallel Regression Assumption holds

# Similar test of parallel regression assumption using car package
library(car)
car::poTest(olr_2)
Tests for Proportional Odds
polr(formula = cat_ci_score ~ r1_gender + r2_merginalised + r9_religion,
  data = hh18_u_r, Hess = TRUE)

                    b[polr] b[>Extremely Vulnerable] b[>Moderate Vulnerable] Chisquare df Pr(>Chisq)
Overall                                                                            168.9  4    < 2e-16 ***
r1_genderMale           0.398                    0.305                   0.442      13.0  1    0.00031 ***
r2_merginalisedOthers   0.664                    0.513                   0.700      41.2  1    1.4e-10 ***
r9_religionHinduism    -0.243                   -0.662                  -0.147      86.2  1    < 2e-16 ***
r9_religionIslam       -0.542                   -0.822                  -0.504      25.1  1    5.4e-07 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Kindly suggest whether this model satisfies the parallel regression assumption? Thank you
Answer: It tells you the null hypothesis (H0) is that it holds. Your values are statistically significant, which means you reject the null hypothesis (H0). It wasn't showing you that to say the assumption was met but rather it was just a reminder of what the null is.


Do I have to expose front and back ends with ngrok for MERN stack for CRUD ops to work?

Question: I am developing a MERN app on my local machine.
The front end is on localhost:3000
The back end is on localhost:3003
I have in my front end code a request, like so:
axios.get('localhost:3000/comments', params)
Now, I use ngrok to expose the app, like so:
ngrok start front_end back_end
and my .yml config file looks like:
tunnels:
    front_end:
        proto: http
        addr: 3000
        subdomain: fakedomaintest
    back_end:
        proto: http
        addr: 3003
        subdomain: fakedomaintestback

My question was, do I have to expose the back end in a different way, or am I splitting the stack wrong?
When I expose localhost:3000 and localhost:3003, I edit the CRUD lines in the front end code to match the ngrok URL, like so:
axios.get('fakedomaintestback.ngrok.io/comments', params)
and upon accessing fakedomaintest.ngrok.io it works....
But is there an easier way wherein I do not have to edit the CRUD lines on the front end everytime I want to use ngrok for a remote prototype?
What am I missing here?
Answer: If your app is running at localhost:3003 then your axios call should be axios.get('localhost:3003/comments', params)
To address the url switching:
You could use dotenv to set up environment variables for your application.
https://www.npmjs.com/package/dotenv
How it would work is you would create a .env file in the root folder of your react application containing the following:
BACKEND_HOST=localhost:3003

Then in your code you could change all your network calls to the following:
axios.get(`${process.env.BACKEND_HOST}/comments`, params)

When you want to switch to using ngrok, you can simply change the value in the .env file.
If you happen to be using Create React App, .env files will already be supported, but you'll have to prefix all your variables with REACT_APP, so BACKEND_HOST would become REACT_APP_BACKEND_HOST
Comment: This totally answers the question of having to change the value in the front.

But just to be clear, exposing the back is always necessary if I'm tunneling into my app?
Comment: You would only need to use ngrok if you want to expose your app to the external internet. If you're only using it on your local computer, just using `localhost:3003` is fine
Comment: It does if configured correctly. If you use `create-react-app` it comes with it included


How to migrate require import to es6 import with currying

Question: I am migrating a node/express server to typescript. I could now use import syntax instead of require. However, I used to apply currying to shorten imports. How to translate these imports into es6 imports?

const app = require("express")();
const server = require("http").createServer(app);
const io = require("socket.io")(server);
socketManager(io);
Answer:     1. add "type": "module" in package.json
    2. start using
          import {Name} from './index.js';

For your example :

import express from 'express';
import http from 'http';
import { Server } from "socket.io";

const app = express();
const server = http.createServer(app);
const io = socketIO(server);
app.set('socketio', io);

Comment: Could you please elaborate your example with a clear translation of the imports above?
Comment: Thank you! Just a last question: why do you use `app.set("socketio", io)`? I have written `app.locals.io = io` to access the io instance everywhere. Is there a difference?


What happens when you use a name tag on a strange weapon?

Question: If I use a name tag on a strange weapon in Team Fortress 2, does it keep the kill count and name changes? So that it becomes "strange description"+"name"
Or does the name tag over write the name changing properties so that it will always be what you name it? So that it is always "name"
Answer: According to the TF2 Wiki...

The Strange quality was introduced alongside the Über update, available through unboxing a series 19 and onward crate. They have a kill count that shows the total amount of kills obtained with the weapon. The items will have their default name changed dependent on how many kills the weapon has. For instance, after getting ten kills the weapon will change from 'Strange' to 'Unremarkable'. Renaming a Strange weapon hides its prefix, even if it levels up after that.

It appears that it will keep the kill count, the name will simply stop updating.
Comment: Don't know why this hit the front page, but it did, so I'll chime in here.  It doesn't entirely hid the name.  My flamethrower, "Ink Spots" lists the name in orange, and underneath that says "Spectacularly Lethal Flamethrower - Kills: 353" in a darker grey.  It still shows the strange name, just not on the main line.


upstream connect error or disconnect/reset before headers. reset reason: connection failure | GRPC web Envoy

Question: I am facing this error with envoy proxy :
upstream connect error or disconnect/reset before headers. reset reason: connection failure | 503 service unavailable.
This is my envoy.yaml
admin:
  access_log_path: /tmp/admin_access.log
  address:
    socket_address: { address: 0.0.0.0, port_value: 9901 }

static_resources:
  listeners:
  - name: listener_0
    address:
      socket_address: { address: 0.0.0.0, port_value: 9000 }
    filter_chains:
    - filters:
      - name: envoy.filters.network.http_connection_manager
        typed_config:
          "@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
          codec_type: auto
          stat_prefix: ingress_http
          route_config:
            name: local_route
            virtual_hosts:
            - name: local_service
              domains: ["*"]
              routes:
              - match: { prefix: "/" }
                route:
                  cluster: position_service
                  max_grpc_timeout: 0s
              cors:
                allow_origin_string_match:
                - prefix: "*"
                allow_methods: GET, PUT, DELETE, POST, OPTIONS
                allow_headers: keep-alive,user-agent,cache-control,content-type,content-transfer-encoding,custom-header-1,x-accept-content-transfer-encoding,x-accept-response-streaming,x-user-agent,x-grpc-web,grpc-timeout
                max_age: "1728000"
                expose_headers: custom-header-1,grpc-status,grpc-message
          http_filters:
          - name: envoy.filters.http.grpc_web
          - name: envoy.filters.http.cors
          - name: envoy.filters.http.router
  clusters:
  - name: position_service
    connect_timeout: 2s
    type: logical_dns
    http2_protocol_options: {}
    lb_policy: round_robin
    load_assignment:
      cluster_name: cluster_0
      endpoints:
        - lb_endpoints:
            - endpoint:
                address:
                  socket_address:
                    address: localhost
                    port_value: 3000

I already to remove http2_protocol_option. It didn't worked.
My GRPC client and server are in different container, same network.
I also tried to connect to my grpc server with a Go client and it worked.
Answer: I mess up with the endpoint address. I replace localhost with the name of my container and I rebuilt my container after that because the file was copied to the container thanks to my dockerfile.


Office 365 Outlook Encrypt not functioning

Question: I want to encrypt my email to prevent email forwarding. I try to enable Options > Encrypt > Connect to Rights Management Servers and get templates. But it is not functioning. No wait cursor, no any error message. And the email sent out still can be forwarded.

Anybody have same problem? Any idea?
BTW, I'm using Microsoft Office 365 ProPlus desktop version on windows 10.
Answer: It's working after few days later I check it again. Perhaps it is because of system restart. Don't know why. Anyway it works now.


How to debug Spark application on Spark Standalone?

Question: I am trying to debug a Spark Application on a cluster using a master and several worker nodes. I have been successful at setting up the master node and worker nodes using Spark standalone cluster manager. I downloaded the spark folder with binaries and use the following commands to setup worker and master nodes. These commands are executed from the spark directory.
command for launching master
./sbin/start-master.sh

command for launching worker node
./bin/spark-class org.apache.spark.deploy.worker.Worker master-URL

command for submitting application
./sbin/spark-submit --class Application --master URL ~/app.jar

Now, I would like to understand the flow of control through the Spark source code on the worker nodes when I submit my application(I just want to use one of the given examples that use reduce()). I am assuming I should setup Spark on Eclipse. The Eclipse setup link on the Apache Spark website seems to be broken. I would appreciate some guidance on setting up Spark and Eclipse to enable stepping through Spark source code on the worker nodes.
Thanks!
Answer: It's important to distinguish between debugging the driver program and debugging one of the executors.  They require different options passed to spark-submit
For debugging the driver you can add the following to your spark-submit command.  Then set your remote debugger to connect to the node you launched your driver program on.
--driver-java-options -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005

In this example port 5005 was specified, but you may need to customize that if something is already running on that port.
Connecting to an executor is similar, add the following options to your spark-submit command.
--num-executors 1 --executor-cores 1 --conf "spark.executor.extraJavaOptions=-agentlib:jdwp=transport=dt_socket,server=n,address=wm1b0-8ab.yourcomputer.org:5005,suspend=n"

Replace the address with your local computer's address. (It's a good idea to test that you can access it from your spark cluster).
In this case, start your debugger in listening mode, then start your spark program and wait for the executor to attach to your debugger. It's important to set the number of executors to 1 or multiple executors will all try to connect to your debugger, likely causing problems.
These examples are for running with sparkMaster set as yarn-client although they may also work when running under mesos.  If you're running using yarn-cluster mode you may have to set the driver to attach to your debugger rather than attaching your debugger to the driver, since you won't necessarily know in advance what node the driver will be executing on.
Answer: You could run the Spark application in local mode if you just need to debug the logic of your transformations.  This can be run in your IDE and you'll be able to debug like any other application:
val conf = new SparkConf().setMaster("local").setAppName("myApp")

You're of course not distributing the problem with this setup.  Distributing the problem is as easy as changing the master to point to your cluster.
Answer: When you run a spark application on yarn, there is an option like this:
YARN_OPTS="-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5455 $YARN_OPTS"

You can add it to yarn-env.sh and remote debugging will be available via port 5455.
If you use spark in standalone mode, I believe this can help:
export SPARK_JAVA_OPTS=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005

Answer: I had followed the same steps to setup a spark standalone cluster. I was able to debug the driver, master , worked and executor JVM's.
The master and the worker node is configured on a server class machine. The machine has 12 CPU cores. Source code for Spark -2.2.0 has been cloned from the Spark Git Repo.
STEPS:
1] Command to launch the Master JVM:
root@ubuntu:~/spark-2.2.0-bin-hadoop2.7/bin#
    ./spark-class  -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=8787     org.apache.spark.deploy.master.Master

The shell script spark-class is used to launch the master manually. The first args are JVM args launching the master in debug mode. The JVM is suspended and waits for the IDE to make a remote connection.
Following are the screenshots showing the IDE configuration for Remote Debugging:
2] Command to launch the Worker JVM:
root@ubuntu:~/spark-2.2.0-bin-hadoop2.7/bin# ./spark-class -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=8788 org.apache.spark.deploy.worker.Worker spark://10.71.220.34:7077

Same as master, the last argument specifies the address of the spark master.  The debug port for worker is 8788.
As part of the launch the worker registers with the master.
Screenshot
3] A Basic java app with a main method is compiled and wrapped in an uber/fat jar. This has been explained in the text "learning spark". Basically an Uber jar contains all transitive dependencies.
Created by running mvn package at the following directory:
root@ubuntu:/home/customer/Documents/Texts/Spark/learning-spark-master# mvn package

The above generates a jar under ./target folder
The screen shot below is the java application, which would be submitted to the Spark Cluster:
4] Command to submit the command to the standalone cluster
root@ubuntu:/home/customer/Documents/Texts/Spark/learning-spark-master# /home/customer/spark-2.2.0-bin-hadoop2.7/bin/spark-submit --master spark://10.71.220.34:7077

--conf "spark.executor.extraJavaOptions=-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=8790"

--conf "spark.executor.extraClassPath=/home/customer/Documents/Texts/Spark/
learning-spark-master/target/java-0.0.2.jar"

--class com.oreilly.learningsparkexamples.java.BasicMapToDouble

--name "MapToDouble"

./target/java-0.0.2.jar

spark://10.71.220.34:7077 → Argument to the java program →

com.oreilly.learningsparkexamples.java.BasicMapToDouble

·   The above command is from the client node that runs the application with the main method in it. However the transformations are executed on the remote executor JVM.
·

The –conf parameters are important. They are used to configure the
executor JVM's.
    The Executor JVMS are launched at runtime by the Worker JVM's.
·    The first conf parameter specifies that the Executor JVM should
be launched in debug
   mode and suspended right away. It comes up on port 8790.
·    The second conf parameter specifies that the executor class path
should contain the  application specific jars that are submitted to
the executor. On a distributed setup these jars  need to be moved to
the Executor JVM machine.
·    The last argument is used by the client app to connect to the
spark master.

To understand, how the client application connects to the Spark cluster,
we need to debug the client app and step through it. For that we need to configure it to run in the debug mode.
To debug the client, we need to edit the script spark-submit as follows:
Contents from the spark-submit
exec "${SPARK_HOME}"/bin/spark-class -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=8789 org.apache.spark.deploy.SparkSubmit "$@"

5] After the client registers, The worker starts an executor at run-time on a different thread.
Screenshot below shows the class ExecutorRunner.scala
6] We now connect to the forked executor JVM using the IDE. Executor JVM would run the transformation functions in our submitted application.
 JavaDoubleRDD result = rdd.mapToDouble( → ***Transformation function/lambda***
      new DoubleFunction<Integer>() {
        public double call(Integer x) {
          double y = (double) x;
          return y * y;
        }
      });

7] The transformation function runs, only when the action "collect" will be invoked.
8] The screenshot below displays the Executor view, when the mapToDouble function is invoked in parallel on multiple elements of the list. The Executor JVM executes the function in 12 threads as there are 12 cores. As the number of Cores was not set on the command line, the worker JVM by default set the option: -cores=12.
9] Screen shot showing the client submitted code [maptodouble()]
running in the remote forked Executor JVM.
10] After all the tasks have been executed, the Executor JVM exits. After the client app exits, the worker node gets unblocked and waits for the next submission.
References
 https://spark.apache.org/docs/latest/configuration.html
I have created a Blog that describes the steps on how to debug these sub-systems. Hopefully, this helps others.
Blog that outlines the steps:
https://sandeepmspark.blogspot.com/2018/01/spark-standalone-cluster-internals.html
Comment: Welcome to SO! Although your answer may be 100% correct, it might also become 100% useless
if that link is moved, changed, merged into another one or the main site
just disappears. Therefore, please [edit] your answer, and copy
the relevant steps from the link into your answer, thereby guaranteeing
your answer for 100% of the lifetime of this site! **;-)** You can always
leave the link in at the bottom of your answer as a source for your
material...


laying out a jpanel with multiple custom components using swing

Question: I'm trying to set up a JPanel using a BorderLayout in such a way to create a chart. For this, I have an axis component in the west & south regions and the chart itself in the center region. The problem is.. when I add my 'graph' component (basic class extending Component) and draw things onto it, this overlaps with the other axis areas.
I'm wondering how I can set things up in such a way that the reference for 0,0 from each component refers to it's particular starting point and not have all of them reference the same point (as is happening now).
Hope this explanation isn't too difficult to understand. Thanks in advance.
Comment: Swing components should never overlap when added to different areas of the BorderLayout. You must be doing something strange. Post your SSCCE (http://sscce.org) that demonstrates the problem. Start with something simple first like adding a red panel to the west a green panel to the south and a blue panel to the center and you will see this is not a problem. Then try replacing the center panel with one that does some custom painting to see if you have a problem. In other words isolate which component is causing your problem.
Answer: If your graph really extends Component, note that you generally can't mix AWT and Swing components that way. Try extending JComponent instead.
Alternatively, consider JFreeChart
Addendum: Even with a JComponent in the CENTER of a BorderLayout, WEST and SOUTH generally won't meet at a point, as seen in the API diagram.
Can you amplify on why JFreeChart isn't sufficient? It's never let me down, but you might also look at this simulation's Histogram class for another approach.
Comment: That didn't seem to make any difference. Unfortunately JFreeChart isn't close enough to what I want for it to be viable. Thanks for the help regardless.
Comment: @dylan: I've added more above.


After adding a disk ubuntu wont start normally (sda<->sdb)

Question: In my notebook are 2 disks: mSata appears as sdb and SATA appears as sda. I did a fresh install on the mSATA (sdb) including GRUB. All is fine. But when I remove the SATA the mSATA becomes sda and Ubuntu boots but only only in some maintenance command lines. I tried it the other way around: Installed Ubuntu on mSATA as sda (no SATA connected), all is fine but when I add the SATA this gets the name sda and my mSATA is sdb now and I have the same trouble. I wonder that this is in UUID times still an issue and would be happy about a helpful hint. The SATA disk contains only data and I use it also in different machine. I use Ubuntu 16.04.
Answer: What is in your fstab file?
You can check it using
sudo nano /etc/fstab

(you can replace nano with gedit, or any other text editor)
Each line should start with UUID=xxxx and you shouldn't see any reference to /dev/sda or /dev/sdb
If you need to know the UUID, run this command to list them
blkid

Comment: Thanks for your answer, but my (fresh Ubuntu 16.04) /etc/fstab does not contain any references to sda or sdb, only UUID is used.


Update query needed based on the condition

Question: i need a stored procedure which will update the error message column on the table based on the condition, if dob is null or greater than current date then error message column should be updated as 'invalid dob' and also based on the id it has to be updated, if the dob is lesser than current date and it is not null, then the error message column should not be updated. I need a update statement for this query, i tried it but it update all the columns without checking the condition. so please provide the solution for this query,Thank you.
Comment: Can you please post some sample data, expected output and whatever you have tried?
Comment: update e  set errormsg='invalid dob' from emp e where  eid = eid and
 exists (select 'x' from emp where dob>getdate() or dob is  null)
Comment: Please update in the Original Post. Also post the expected output.
Comment: selva, but the above query update all the columns.
Comment: Why do you have an error message column in your table? How would you handle multiple errors? This seems like a constraint to me.
Comment: @SeanLange because there is an error message report for this report that error message field values are used.
Answer: Strange requirement but it is really simple.
update SomeTable
set ErrorMessage = 'Invalid DOB'
where DOB is null
or DOB > getdate()

Comment: if i use the condition eid = eid , then it will update all the columns without checking the condition, why it is happening ?
Comment: Why would you include that predicate? That is like saying 1 = 1. ALL rows meet that criteria. Unless you want all rows to be updated, use the where clause to only allow the rows you want updated to be updated.
Comment: This code is set based. It will update all the relevant rows in a single pass with no looping or cursors.
Answer: Try something like this,
create table TestEmployee (ID int, DOB DateTime, ErMsg varchar(20))
insert into TestEmployee (ID,DOB)
values (1, '10/02/2013'),
(2, null),
(3, '1/1/2016')

UPDATE TestEmployee SET ErMsg = 'Invalid DOB'
WHERE ID = @ID AND --This should based on your condition
DOB > GETDATE () OR DOB IS NULL

SELECT * FROM TestEmployee

Sql Fiddle Demo
Comment: i inserted the value to that table, using loop condition, so instead of using @id, can i define something like id = id , directly ?
Comment: Please post your entire SP here.
Comment: @Ram why are you using a loop for an update like this?


Can't install wireshark on ubuntu 18.04.1 LTS

Question: I created a brand new Ubuntu vm with beaver GUI but can't install wireshark on it.
I used the steps provided on this answer to get wireshark from ppa, but I get errors of dependencies or something...
STEPS:
$ sudo add-apt-repository ppa:wireshark-dev/stable
$ sudo apt-get update
$ sudo apt-get install wireshark

ERRORS:

EDIT 1:
I tried to install wireshark-qt but I get the same type of error...

EDIT 2:
I tried solutions from this post, but none seem to help my case.
$ sudo apt-get autoremove
$ sudo apt-get update

Comment: Possible duplicate of [Unable to correct problems, you have held broken packages](https://askubuntu.com/questions/223237/unable-to-correct-problems-you-have-held-broken-packages)
Comment: I tried the many solutions provided by your link, but without success... `$ sudo apt-get autoremove` and `$ sudo apt-get update` didn't change a thing.. ): Thanks for your help! I'll keep looking for a solution.
Answer: You're trying to install from the Wireshark development PPA. It probably needs resources that are not available on 18.04.1.

Update #1:
There could also be a problem with "Beaver GUI"... I'm not familiar with it. Sounds like GNOME desktop.
This originally started as a server install, and other resources may be missing that are required for Wireshark.

Remove or disable the PPA.
Then checkmark the following Ubuntu repositories... and reload the databases on quit...

Then install Wireshark from Synaptic, the Software Center, or...
In terminal...
sudo apt-get update # update the software databases
sudo apt-get install wireshark # install wireshark
Comment: @LoukMo That's probably GNOME desktop. Was/is your installation originally a server install?
Comment: @LoukMo ah... that's why you needed to install ubuntu-desktop. There may be other resources missing in server that are required for Wireshark. Is Wireshark working for you now?
Comment: So the problem is coming from the PPA repo. Thanks for the quick help! (:
Comment: @LoukMo also check your "Beaver GUI".
Comment: The "Beaver GUI" I'm referencing to is (I think) the basic one you get from doing [this post](https://askubuntu.com/questions/53822/how-do-you-run-ubuntu-server-with-a-gui)'s commands... `sudo apt-get install ubuntu-desktop` I thought it was called beaver because there's a beaver as default wallpaper... hahah
Comment: I used the `ubuntu-18.04.1-live-server-amd64.iso` as base for my vm. You can see the steps I used to make the vm at the start of [this post](https://askubuntu.com/questions/1095521/cant-build-gst-rtsp-server).
Comment: Hi @heynnema, can you help with [this proxy question](https://askubuntu.com/q/1161956/439867) where  Wireshark was suggested?
Answer: Try this:
sudo apt --fix-broken install
sudo apt-get update
sudo apt-get upgrade

Then install with:
sudo apt-get install wireshark


What type of effect has been used in this site?

Question: The website --> http://inspiredm.com is using an effect of hover in their post images . What kind of effect it is? It is a CSS3 or jquery effect and how to do similar effects ?
Comment: Have you tried viewing the site's source code?
Comment: @Brandon - my comment was meant for the OP.
Answer: It's the opacity propriety on css, It doesn't work on ie8!
you may create this effect like this:

a:hover {
background:#fff;
}

a:hover img {
opacity:0.7;
}

edit:
if you are referring to the post image load delay as you scroll the page, it's probably like lazy load plugin from jQuery:
http://www.appelsiini.net/projects/lazyload
Comment: And it becomes difficult to manage very, very quickly (thanks to inconsistent positioning between browsers). Sometimes you have to make compromises - unless your client considers fading images to be business critical! (and I've had those)
Comment: Opacity isn't as standardized as it should be. Try { -moz-opacity:.50; filter:alpha(opacity=50); opacity:.50; } in your CSS to make it work across most browsers.
Comment: i mean, will it work with moz-opacity then? :) i tested with @RafaelMoni -'s solution . it works :) or to be sure should i use moz-opacity ?
Comment: actually there isn't a full-cross browser solution for this situation, moz-opacity should be used together with opacity to work on firefox 3.6 or older version, as well as webkit-opacity (not sure about sintax) to work with older version of chrome too, filter:alpha(opacity=60); should be used to work on ie8 and older version, that's a matter of time and critical business as Art Hanzel said!
Comment: -moz-opacity will work on earlier versions of Firefox and Mozilla-based browsers (FF2, seamonkey, songbird...). Opacity is (to the best of my knowledge) supported by every new browser (including IE9, but I can't vouch for <= 8), and the filter is for earlier versions of IE. I don't think the filter is animatable using jQuery - you'd have to use a 3rd party library for that.
Comment: Whoops, looks like Rafael beat me to it!
Comment: ok . have to do more research about the effect . though i will barely need support for IE older than 8 :-)
Answer: They appear to be adding the class "imgHover" to the  tag that surrounds the image. This is done via JavaScript. Then in their stylesheet, they have .imgHover img {opacity:0.7}
So that site is using a combination of JS and CSS. It could also be done in pure css using the :hover pseudo-class (i.e. img:hover {opacity:0.7}), or by setting the opacity more directly with JavaScript. With jQuery, that would look something like:
$('img').hover(function(){
    $(this).css('opacity', 0.7);
}, function(){
    $(this).css('opacity', 1);
});


Nestjs validation pipe not working with Graphql

Question: I am new to nestJS and I have added a ValidationPipe() to main.ts
app.useGlobalPipes(new ValidationPipe())

Now I am using class-validator decorators inside my DTO's but nothing is working right now.
I am using GraphQl but as I have already configured the pipe globally it must work.
Is there any more configuration that needs to be done and I am missing that?
Please help.
Comment: Honestly, that should be all that's necessary. And specifying the type in the route handler, just as you do with REST. Can you provide a minimum reproduction? Or access to your code? Show what isn't working.
Comment: Did you resolve this?
Answer: Try with transform:
app.useGlobalPipes(new ValidationPipe({ transform: true }));

Answer: This is working for me:
import { Module } from '@nestjs/common';
import { APP_PIPE } from '@nestjs/core';

@Module({
  providers: [
    {
      provide: APP_PIPE,
      useClass: ValidationPipe,
    },
  ],
})
export class AppModule {}


Invalid Left Side Assignment

Question: line 1 :
var span = document.getElementById("spanPBBestEst" + rowNum);

line 2 :
span.innerHTML = parseInt(document.getElementsByName("formFLEDetail.frmRepEst" + rowNum).value) + parseInt(document.getElementsByName("formFLEDetail.frmClubEst" = rowNum).value);

I get ReferenceError: Invalid left-hand side in assignment in line 2
Comment: "formFLEDetail.frmClubEst" = rowNum <-- You fat fingered it
Answer: You fat fingered your string concatenation.
span.innerHTML = parseInt(document.getElementsByName("formFLEDetail.frmRepEst" + rowNum).value) +
parseInt(document.getElementsByName("formFLEDetail.frmClubEst" = rowNum).value);
                                                              ^^^

The equal needs to be a plus...BUT once you fix that, you have another error. getElementsByName returns a collection and you act like it returns one value. You need to reference the index you want to read the value of.
parseInt(document.getElementsByName("formFLEDetail.frmClubEst" + rowNum)[0].value)
                                                              ^^        ^^^

Invalid Left Side Assignment


Dual cone of a $L^1$ norm cone?

Question: I am listening to convex optimization lectures and I hear that dual cone of a $L^1$ norm cone is a $L^{\infty}$ norm cone. Can anybody please explain how? I understand that every point in the dual cone must have an non-negative inner product with any point in its corresponding cone.
How does that bring a diamond shaped $L^1$ norm to a square shaped $L^{\infty}$ norm?
Answer: Let $C$ be a cone and $C^*=\{y:\langle x,y\rangle\ge 0 \ \forall x\in C\} $ its dual cone. If a point $y$ satisfies $\langle x,y\rangle\ge 0$ for all extreme rays of $C$, then it satisfies this inequality for all rays of $C$. Therefore, we can restrict attention to the extreme rays of $C$. Each of these rays determines a half-plane $\{y:\langle x,y\rangle\ge 0\}$.
The above may be easier to visualize for bounded convex sets than for cones. (The geometry of a cone is determined by its base.) For example, the $\ell_1$ unit ball in $n$ dimensions is diamond-shaped with $2n$ extreme points $\pm e_j$. The half-planes corresponding to these extreme points form $2n$ faces of the $\ell_\infty$ ball, which is a cube.

Dual cone of a $L^1$ norm cone?


css key-frames animating dynamic height

Question: Hello I have the following css for my sub-menus.It is used in order to open them when the page loads.It works great, however I noticed that if at the end state of the animation I set height:auto; then the animation is not being executed.This is an issue for me because in my site I have many sub-menus with n amount of children in them so I must populate the height of the sub-menu dynamically. Is it possible ?
   @-moz-keyframes slidemenu {
        0% {
            height: 0px;
        }
        100% {
            height: 90px;
        }
    }

    @-webkit-keyframes slidemenu {
        0% {
            height: 0px;
        }
        100% {
            height: 90px;
        }
    }

    #side-menu > li.active > ul.sub-menu{
        -moz-animation-delay:0.5s;
        -moz-animation-name: slidemenu;
        -moz-animation-timing-function: ease-out;
        -moz-animation-duration: 0.5s;
        -moz-animation-iteration-count: 1;
        -moz-animation-fill-mode: forwards;

        -webkit-animation-delay:0.5s;
        -webkit-animation-name: slidemenu;
        -webkit-animation-timing-function: ease-out;
        -webkit-animation-duration: 0.5s;
        -webkit-animation-iteration-count: 1;
        -webkit-animation-fill-mode: forwards;
    }

PS: I'm interested in a pure css solution.
Comment: Can you put together a fiddle and include your html in the question?
Comment: http://jsfiddle.net/xv2BK/ this demonstrates the problem I've set the 100% state of the animation to height auto in order to replicate the issue
Answer: Instead of animating height, try animating transform: translateY() as follows (you will get a true sliding effect):
@keyframes slideDown{
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

Comment: But this wouldn't push elements underneath down as it expands.
Answer: @keyframes pageLoadSubnavDropdown {
    0% {
        max-height: 0px;
    }
    100% {
        max-height: 300px;
    }
}

This worked for me but there is still a guessing game as the max-height has to still be over what the max height of all the elements would be. The higher the second number the faster the animation travels no matter how many elements are in the dropdown.
This would be a good fix for a specific range of elements, not so much a fully dynamic range of elements.
Comment: This is generally the best available non-JS solution. However, it would be simpler to use the basic CSS `transition: max-height 0.5s` instead of writing a keyframe.
Answer: I think this might work as well
#slide-menu {
    background: primary;
    height:100%;
    -webkit-animation: slideDown 3s;
}

//try to declare the keyframes after the #slide-menu
@keyframes slideDown {
    from {
      transform: translateY(-100%);
      opacity: 0;
    }
    to {
      transform: translateY(0);
      opacity: 1;
    }
}

you can change the background: primary to any color depends on what you want, example background: white

css key-frames animating dynamic height


ILogger does not write to console using serilog

Question: I'm trying to use serligo as my main logging utilitie but I can't seem to get it to work correctly.
In the Program.cs file, I configure the logger and also log a startup message, this message gets outputted to the console.
I also have, in one of my controllers, an ILogger<HomeController> instance that logs information when a certain action is called. These logs are not outputted to the console, and I cannot understand why.
Startup.cs
public class Program
{
    public static void Main(string[] args)
    {
        Log.Logger = new LoggerConfiguration()
            .WriteTo.Console()
            .CreateLogger();

        try
        {
            Log.Information("Starting up version {version}", Defaults.Version); // WORKS
            CreateHostBuilder(args).Build().Run();
        }
        catch (Exception ex)
        {
            Log.Fatal(ex, "Application start-up failed");
        }
        finally
        {
            Log.CloseAndFlush();
        }

    }

    public static IHostBuilder CreateHostBuilder(string[] args) =>
        Host.CreateDefaultBuilder(args)
            .UseSerilog((hostingContext, loggerConfiguration) => loggerConfiguration.ReadFrom.Configuration(hostingContext.Configuration))
            .ConfigureWebHostDefaults(webBuilder =>
            {
                webBuilder.UseStartup<Startup>();
            });
}

Controller
public class HomeController : Controller
{

    private readonly ILogger<HomeController> _logger;

    public HomeController(ILogger<HomeController> logger)
    {
        _logger = logger;
    }

    public IActionResult Index()
    {
        _logger.LogInformation("Home/Index"); //Does not work
        return View();
    }

}

appsettings.json
"Serilog": {
    "Using": [ "Serilog.Sinks.Console" ],
    "MinimumLevel": {
      "Default": "Verbose",
      "Override": {
        "Microsoft": "Warning",
        "Microsoft.AspNetCore": "Warning",
        "System": "Error"
      }
    },
    "WriteTo": [
      {
        "Name": "Async",
        "Args": {
          "configure": [
            {
              "Name": "Console",
              "Args": {
                "theme": "Serilog.Sinks.SystemConsole.Themes.AnsiConsoleTheme::Code, Serilog.Sinks.Console",
                "formatter": "Serilog.Formatting.Compact.RenderedCompactJsonFormatter, Serilog.Formatting.Compact"
              }
            }
          ]
        }
      }
    ]
  },

Answer:
.UseSerilog((hostingContext, loggerConfiguration) => loggerConfiguration.ReadFrom.Configuration(hostingContext.Configuration))

The issue relates the above code, in this part of code, you should also configure it to write to the console.
Modify the code as below:

.UseSerilog((hostingContext, loggerConfiguration) => loggerConfiguration.ReadFrom.Configuration(hostingContext.Configuration).WriteTo.Console())

Then, the output like this:


How to get project workspace details

Question: To get project names and followers I can use:
https://app.asana.com/api/1.0/projects?opt_fields=name,followers
However it doesn't let me get the workspace:
https://app.asana.com/api/1.0/projects?opt_fields=name,workspace
Only the project ids and names are listed. I have tried using opt_expand as well. Is it possible to get the workspace when listing projects?
Answer: (I work for Asana)
You are correct, this should be possible. It appears to be a bug. We should have this fixed for you later today.
Comment: Thanks! It is working now :) I can't believe how quickly you guys fixed that.

How to get project workspace details


Why sudo could not get the right PATH environment?

Question: I run command sudo hadoop fs -ls /, it said hadoop command is not found. But I have already set it in /etc/profile, and also I verify it by switch to user root.
What happens here ?
Comment: What does 'which hadoop' return?
Answer: You might want to make a sudoers.d file for sudo to permanently keep your environment variables.

CAUTION! This method uses the sudoers file, you might get locked out by sudo if anything goes wrong. Proceed with caution.

cd ~/Desktop
touch 'myfile'
Open the file in an editor.
Add these lines (both blank lines mentioned below are very important):
<This must be a blank line>
Defaults env_keep += "your_variable_name_within_quotes"
<This must be a blank line>

sudo chmod 440 'myfile'
sudo mv 'myfile' '/etc/sudoers.d/myfile'
Now open : '/etc/sudoers' and make sure there's the line: #includedir /etc/sudoers.d
If it isn't there, DO NOT EDIT IT, instead do sudo visudo
Append the line at the end and press Ctrl+X to save it.
Restart and try a sudo command with that environment variable.
Answer: cron uses its own default PATH, something like /bin:/usr/bin. See the cron(8) and crontab(5) man pages.


Can a casual, 'bad' player compete with other casual, 'bad' players around the same skill?

Question: Is there any way or skill system in League of Legends to challenge people around the same skill level?
Basic story:
My friends and I get together for gaming once a week for a couple hours. Normally, this is the only time we play video games due to getting old, having a wife, kids, job etc.  The few times we try to play League of Legends to relive the glory days we are stomped so hard our team k/d ratio is 1/20ish.
Will the system eventually pit us against other players of somewhat similar skill levels as we are just playing un-ranked mode or does skill of players not get calculated in this game?
Comment: That is in theory the whole ***point*** of matchmaking; so the game matches you with players of similar skill. Whether League's works correctly has been up for debate pretty much since the game launched.
Answer: In every game mode you have a hidden MMR (Matchmaking Rating). It is based on the Elo System but as already said: It's hidden. Now the most accurate this MMR gets is by calculating your Win/Loss ratio. In-game stats may be important but they aren't reliable. A Toplaner with 0/3/0 Can still win a match and be the deciding factor in a lategame teamfight. May it only be because he's behind and getting focussed first instead of the ADC. The system can't really look at your actual skill since there are other factors than a KDA that win a game.
Since you were talking about these "Glory Days" I assume you guys used to be better at league as you are now. If you don't play for a while your real skill will get worse, maybe your League points in ranked may even drop but your MMR remains the same. This can be a real problem. I experienced this myself (I didn't play league for a month or so and after that I dropped from plat 1 to plat 5). Basically: You have to continue to lose until your MMR gets rebalanced.
The only thing that you could actually try is a Ranked 5v5  or 3v3 Team. In this Queue you have a team MMR instead of single ones for each individual player. The only 2 disadvantages to the team method are: You have to play draft-pick and it can be really frustrating since usually players have much higher soloq ratings than team ratings (Most Gold 5 Teams consist of only Platinum/Diamond Soloqueue Players).
Other than that the only thing you can do is Playing until your MMR reaches your skill level (Be it through getting better yourself or just losing alot)
Comment: @Linuxmint which other players will there be who care for the ranking? The opposing team? Your point is valid in solo or duo queue, but we're talking about Ranked Teams. If someone doesn't want his ranking to suffer because of these players, he can just not join the team...
Comment: @Linuxmint I think you are. He's suggesting a 5v5 or 3v3 Team because "In this Queue you have a team MMR instead of single ones for each individual player."
Comment: The other thing you could try is smurf accounts. Just sayin' :)
Comment: "try...a Ranked 5v5 or 3v3" I must disagree here, I strongly encourage players who are trying to learn or relearn LOL to not play ranked, as it is very difficult on the other players where the game counts for their ranking. If you are trying to relearn LOL, and especially if you have a 1/20 KDA ratio, I would recommend using normals (where people are more relaxed, and the loss/win does not count for each players rank), and not ranked (which should be taken more seriously IMO).
Comment: @Linuxmint Lets face it ranked is a joke unless you are plat or above. I have been in bronze, silver and gold, these kinds of levels mainly have people that don't really care to much. Above these levels is where the game gets a bit more serious. Bronze I have found easier to win then normal games, silver can be a pain but still its not overly that hard. Gold starts getting a bit better but 90% of people rage. I feel ranked is the way to go just to sort out the skill level, it is more controlled compared to normal.
Comment: @scenia I may be mistaken, but I think we were discussing Ranked Solo Que and calling it Ranked 5v5 3v3.
Answer: I agree with the answer that Jutschge has given but I would like to go a bit more into the solution of the problem you find yourself in.
Short Answer
You should try to play ranked games as a duo, this system tends to work better overall for player placement and skill level.

A bit more In-Depth
As you are playing normals these tend to be "unreliable" in terms of skill level, I would say I'm a good player and I mainly always have positive K/D in normal games (normally by quite a lot) but I play with a friend and most games this friend has negative K/D. Overall I am I much better player than this friend but I feel as if the system keeps giving us lower skill level opponents than we should be getting. Here is where I think the system does not work, it is hard to tell where a group of 2 should be in a normal game due to the massive skill level differences between the two.
Now moving onto the solution, playing ranked.
Now I know this will seem like ranked is clearly going to be harder and we just want to play for fun, ranked will not provide us with this but I would disagree. Ranked seems to match a lot better with who you should be playing with.
Just a word of warning the first 10 games can be hard and a little stressful as the game is finding out your skill level from these first 10 games. After the first 10 you will be placed in a league tier.
<code>Bronze -> Silver -> Gold -> Platinum -> Diamond -> Challenger
</code>
In each of these (except challenger) have divisions from 1 to 5 (1 being the highest), you will move up and down depending if your winning or losing. (More on this here)
If you play these games with your friend you will be placed with in the same tier and the skill level the game thinks you should be at. Using your team MMR to match you with other players around that. Now the good thing is if you keep losing games it will start dropping you divisions/leagues and you should start noticing a difference in player skill of your opponents.
I would recommend trying this out and see how it does, give it a little bit of time to let the game place you a bit better then just the first 10 ranked games. Feel free to drop back and let us know how it is going.
Hope this helped, please do ask any questions about this if you have any.
Comment: I will give this a try! Thank you, the word 'ranked' always scared me off as a very casual player
Comment: @Quinma I was also like that at one point, I didn't want to go to ranked as I was a casual player. I thought why shouldn't i just give it ago, so I did. Ended up in Silver 3 and to my surprise it was pretty close to my skill level at that time. Ranks to me are no different to normals except more control over players levels. The system doesn't always work but it should sort out overtime if thats the case.
Answer: The point of the matchmaking is to play around people your own skill level.
1)  With glory days, you make it sound like you guys used to play it a lot.  This likely means your MMR is much higher than your actual current skill.  It is trying to match you against those higher levels.
2)  When you play with 1 or more people, it assumes you have some team synergy and so it will actually boost the MMR of your whole team as another effect.
3) Sometimes higher ranked players rarely play normals.  When they do, their normals MMR is often very low and so it places them vs easier opponents.
Between the first 2 points, you are sort of crippling yourself and the match making sounds like it is working correctly along the rules we were given for it.  As for point 3, that's just bad luck.  It's going to happen and there is nothing you can do about it.
Solutions?
1) Create a smurf.  You will quickly get adjusted to your skill level in a shorter number of games, and your first few games might even be a bit easy for you.
2) If you have a full 5, you can create a ranked team for these occasions.
3) Not ideal, but you can simply just continue to play games and losing them.  Eventually your matchmaking will balance out to your current lower skill level.  It just might take a bit of time.
Comment: you are correct, we used to play a lot and used to be much better.  I appreciate the solutions
Answer: Eventually, as you play more games, you will get put against players of your own skill level.
The comments above describe how exactly...
However, if try playing against bots. For beginners, it's the perfect matchup!


How to connect table records with Dialog in Vuetify

Question: How to get dynamic data from tables in dialog in Vuetify. I have table with data

    {{ props.item.id }}
    {{ props.item.title }}
    {{ props.item.quantity }}
     <Dialog :to="'/products/' + props.item.id"></Dialog>

and I have component Dialog.Vue.
How to connect to click to open a specific record in the dialog?
Answer: Dialog should be placed outside table. In table you should have button which trigger dialog. On example @click="dialog_visible = true" and if you need dynamic dialog you can set parameters for dialog in @click method.
Comment:

  This is my new code. I drop dialog tag and add @click listener. Just I need dynamic data from table
Comment: You can pass data as function parameter and sent it to dialog. Something like Open Dialog and then in openDialog function you can tell this.dialog_data = item and you can access selected element from dialog.


Is there a superior leveling system to avoid lippage in tile flooring?

Question: My question is, is there a superior tile leveling system for large format (13x20) floor tile to avoid any lippage?  There are several styles on the market; spacer clips and wedges' spacers and pommels, spacers and caps, spacer clips and rings, spacer straps and caps, and spacer plates and spindles.  Most systems except the pommels and rings require some type of hand tool that utilizes mechanical advantage to tune the system.  Some have a simple one step process for removal post installation.  Most have a reusable component.  Which one does the best job for the least effort and upfront cost?
This info is not necessarily specific to my question, but I am going to be laying a new tile floor in our home entry way, an alcove, and a small half bath.  All surfaces total ~150 sq. ft.  I will be laying the tile with an 1/8" grout line on a diagonal running bond.  I will also back butter the tile.  The sub-floor is a concrete slab and I will be floating a self leveling compound.  I am a DIY'er with no tile experience.
Answer: One of the newest and most comprehensive tile leveling systems on the market that I deal with is the Spin Doctor Tile Leveling System by RTC.  It is tool-less, can be used as spacers in addition to leveling, and is relatively easy to use.  RTC has a video on youtube video showing how to use it: https://youtu.be/NwP1OW1-7L0
Comment: Thank you for the recommendation.  I think I'm going to to give the Spin Doctor a shot.
Comment: Update:  I used the Spin Doctor leveling system and my job looks fantastic. I'll try to get some pictures posted.


Galois Group of $\mathbb{Q}(2^{1/3},5^{1/3},\zeta_{3})/\mathbb{Q}$

Question: Find the Galois Group of $\mathbb{Q}(2^{1/3},5^{1/3},\zeta_{3})/\mathbb{Q}$, for $\zeta_{3}$ being a third primitive root of unity.

It's easy to show this is a Galois extension since it will be the splitting field of some separable polynomial (and one will compute that the degree of the extension is 18 as well). We know as well that $\mathbb{Q}(2^{1/3},\zeta_{3})$ and $\mathbb{Q}(5^{1/3},\zeta_{3})$ are Galois extensions over $\mathbb{Q}$, where the intersection is $\mathbb{Q}(\zeta_{3})$
Then, a characterization of the Galois group of the compositum would be:
$Gal(\mathbb{Q}(2^{1/3},5^{1/3},\zeta_{3})/\mathbb{Q})=\{(\tau,\sigma) \in Gal(\mathbb{Q}(5^{1/3},\zeta_{3})) \times Gal(\mathbb{Q}(5^{1/3},\zeta_{3})): \tau_{\mathbb{Q}(\zeta_{3})} =\sigma_{\mathbb{Q}(\zeta_{3})} \}$
However, I have no idea on how to use the characterization of the compositum in this manner to find explicitly what's the Galois group. It seems like it would be very computational (taking isomorphisms and seeing if they satisy the restriction conditions). What would be a more elegant or simpler way to solve this problem? I'm very curious.
Comment: $P(x) = (1+x+x^2)(x^3-5)(x^3-2)$ and trying to make a minimal polynomial ?
Answer: If you look at the subfield $\mathbb{Q}(\zeta_3,2^{1/3})$, this is Galois over $\mathbb{Q}$ with Galois group $S_3$ generated by $\sigma: \zeta_3 \mapsto \zeta_3^2$ and $\tau: 2^{1/3} \mapsto \zeta 2^{1/3}$ (I've omitted the elements that they fix).
Similarly, we have the subfield $\mathbb{Q}(\zeta_3,5^{1/3})$ which comes with a Galois element $\rho: 5^{1/3} \mapsto \zeta 5^{1/3}$.
Taking the compositum, we find the Galois group is generated by these three elements as this gives a group of order 18, where we take $\tau$ to fix $5^{1/3}$ and $\rho$ to fix $2^{1/3}$; these are all certainly automorphisms.
Checking their actions, we find that $\tau$ and $\rho$ commute giving us a presentation
\begin{equation*}
  G= \langle \sigma, \tau, \rho | \sigma^2, \tau^3, \rho^3, \sigma\tau\sigma^{-1}=\tau^{-1}, \sigma\rho\sigma^{-1}=\rho^{-1}, \rho\tau=\tau\rho \rangle.
\end{equation*}
As a final check, we can check that $|G|=18$ and therefore we have the full Galois group.
Answer: Allowing a bit more theory, one could give a more « sleeky » proof in a more general situation. For an odd prime $p$ , let $K = \mathbf Q(\zeta_p)$, which is Galois over  $\mathbf Q$ with group $\mathbf Z/(p-1)$. Consider a subgroup $A$ of $\mathbf Q^*/ \mathbf Q^{*p}$ generated by $n$ independent classes $a_i$ mod $\mathbf Q^{*p}$, $a_i \in \mathbf Q^*$ ; in additive notation, this means that $A$ is a $\mathbf Z/p$ - sub-vector space of $\mathbf Q^*/ \mathbf Q^{*p}$ with a basis consisting of the classes $a_i$ mod $\mathbf Q^{*p}$. Because $K$ has degree $(p-1)$ over $\mathbf Q$ and $p$ and $(p-1)$ are coprime, the natural map $\mathbf Q^*/ \mathbf Q^{*p}$ --> $ K^*/K^{*p}$ is injective, and $A$ can also be viewed as a sub-vector space of $ K^*/K^{*p}$ of dimension $n$. Let $L = K (… \sqrt [p] {a_i}…)$, which is obviously the normal closure of $k =\mathbf Q (…\sqrt [p] {a_i}…)$.
Write $G = Gal (L/\mathbf Q)$ and $H = Gal(L/K)$. The problem is to describe $G$ as an extension of $G/H$ by $H$. By Kummer theory, $H \cong Hom (A , <\zeta_p >)$, hence is isomorphic to $(\mathbf Z/p)^{n}$ as a group. Since $p$ and $(p-1)$ are coprime, the above extension of groups is split (this is a theorem of Frobenius, I believe), i.e. $G$ is the semi-direct product of  $\mathbf Z/(p-1)$ (identified with $Gal(L/k)$) and  $(\mathbf Z/p)^{n}$. In particular, this answers your question for $p = 3$ and $n=2$ .


In how many points is tangent of $f(x)=\frac{e^x-2}{(e^x-1)^2}$ parallel with $y=x$

Question: In how many points is tangent of $f(x)=\frac{e^x-2}{(e^x-1)^2}$ parallel with $y=x$
I found first derivative and put $$f'(x)=\frac{-e^x(e^x-3)}{(e^x-1)^3}=1$$
I can't solve it. I think that trick is only to find how many solutions are there, not finding exact ones.
Answer: Hint:
Let $y=e^x$.
Then the equation symplifies to a polynomial equation of $-y(y-3)=(y-1)^3$.
Hint2:
You don't need to solve this equation, you only need to show how many solutions it has.
Comment: @RushThaMan You don't need to solve it. You need to count the solutions. I suggest you first try to put it in the form $p(y)=0$, and then try plotting the polynomial $p$. How many zeroes does $p$ have?
Comment: I have that, but can you solve it till the end?
Comment: Just to clarify: this is how many **positive** solutions the polynomial has; because $y=e^x>0$.
Comment: @MartinKochanski True.
Answer: One possibility to show how many solutions an equation has, is to use the intermediate value theorem.
https://en.wikipedia.org/wiki/Intermediate_value_theorem
you know your function is continous and look for points where your new function $g(x):=f(x)-x$ is $>0$ and $<0$; intermediate value theorem says then there must be a solution.
Comment: Yes, you can. But your answer makes it look like IVT is *all* you need to count the zeroes, and this is simply not true.
Comment: IVT only tells you there is **a** solution and cannot actually be used for *counting* them.
Comment: Ok but in combination with monotony and discussion of bend you can use it.