Bent ring finger. Problem in playing guitar

Question: it seems like I am anatomically disadvantaged for playing guitar. I have been doing on and off practice due to tight schedules. But I have still not got hold of a lot of chords. As you can see in the picture, my ring finger bends towards middle finger while closing the fist. I can't stretch my finger towards my pinky finger. It's physically impossible for me.
I don't know what to do. It makes me think I will never be able to play guitar perfectly even if I dedicate all my time to this. Any suggestions are welcome.
Comment: Look up Django Rheinhart for an informative answer.
Answer: 'Play the guitar perfectly...' There aren't many people who do that! I don't really think it's an issue for most. If they can play to whatever standard they do, it's enough. We (most of us) never reach the point where we can honestly say we play perfectly.
As humans, we are pretty adaptable - look at a lot of disabled - and become successful despite our shortcomings. There will be ways in which you can fret notes and chords which are possible 'non-standard'. So what? As long as they work for you. You may need to press two or more strings with one finger. You may have to leave a note out, or mute it, in order to play a chord cleanly. It really shouldn't be an issue. If you are relying on youtube type videos for lessons, they will generally address 'normal' (whatever that is!) people. Which, maybe, doesn't include that many of us!
Bear in mind that even the simple open D major chord has 12 different fingerings for it. There must be at least one that will work for you.
Bottom line - find a teacher!
Answer: A couple things, your nails are too long and that is a bigger issue than the bend in your ring finger.  Second, how are you planting the finger on the string?  That would be a better way to judge than just looking at your "claw".  Post another pic of your hand on the instrument.
Nobody's body is shaped perfectly.  We all have odd deviations.  As long and your finger isn't broken or you have severe arthritis you can learn to work with what you have.  You many not be able to play certain chords or scale patterns exactly as texts indicate but you will be able to find a way around that issue.  You need to learn what works for you and your body and posture will adjust the best it can.  Once the basics are comfortable and you understand what you are doing you can make judgement calls about how to change the things you can't play.
To tell you the truth in the pic your finger doesn't look too much different from mine.  If I claw my hand like you are my ring and middle fingers touch.  I've been playing for 45 years and professionally for less time.  I have my own obstacles.  One in particular is that even though I'm tall and have large hands the web in my fingers is longer than I'd like it to be making my stretch shorter than other guitarists. As a result I cannot ever hope to do these ridiculous 8 fret stretches from index to pinky like Paul Gilbert and Steve Vai.  But my shifting is ridiculously fast.  I compensated with another technique.
Comment: I remember learning to play an E7 chord in open position. You can play it with the pinky on the D, and leave the middle finger on the e or lift the middle finger to get a second d. I couldn't believe how hard it was to leave that middle finger down and get my pinky to the 3rd fret. Still can't do it, so, yeah, I just lift the middle finger and call it a day. It's all good.
Comment: I agree. I think you will be fine. If you are having trouble with some particular thing you will find away around it (different voiceing, open tuning, etc). Every beginner looks at a chord shape tries to play it and says what the heck is wrong with my fingers, this is impossible. Keep going. You'll get there.
Comment: @b3ko, two words... Ted Greene.  Make anyone's fingers want to quit.
Answer: I don't think that should be a problem but I understand you might feel this way. For any beginner fingering any chord is difficult no matter what is their anatomic finger "layout". But our brain and body quickly adjusts with regular practice and also you will adjust choice of fingers for chords ect. strategically to whatever feels best for you.
Aside from classical guitar there's no one established way of playing things and no canonical technique (many would probably argue that it's also true in the world of classical guitar but definitely to lesser extend). Actually the guitar greats are the living catalogue of "non optimal" or "not ergonomic". Gary Moore, a blues virtuoso played most of his fast runs using only two fingers. For already mentioned Django Reinhardt it wasn't even the matter of choice. Pat Metheny picking technique is super awkward.
To sum up. Experiment with different hand positions, keep practicing and stretching the fingers and in a few month's time you'll most likely either forget about it or find out the best strategies to make fiends between your hand and the fretboard.
Answer: Put the ringfinger at first. Think to fix it there like it was nailed on the fret. Draw your wrist along the neck in direction to the point where you have to put the other fingers - without moving the ringfinger! Lift your wrist as high as possible by turning your ellbow away from your body.  Then put the index finger and the middle finger.
This will help.
Comment: May work, but a lot of chords don't need the ring finger anyway. And chords in particular need all fingers down simultaneously, otherwise it's all too slow.
Comment: In finger picking you start with the bass, so it can be practiced here. (I have similar problems).  And in those chords that don't need the ring finger I can't see any problem. Yes, and perfectly what ever this means, I can't play no instrument.
Answer: Following Tim, I'm not sure there's "perfect" when playing guitar. There's playing the music you want to play and playing the music you can play.
Django Reinhardt, Jerry Garcia, Phil Keaggy and Tony Iommi are four musicians I can name who went forward after their hands were damaged. I'm sure there are a number of others with just as inspiring stories.
If you can't play that chord according to Mel Bay, you have options. Alternate tunings. Barre shapes. Power chords. Capos. All of it is in service of getting the music out; there's no such thing as cheating. And if you straight-up can't do a thing on guitar, there's nothing saying you have to do it.
Best of luck.


How to add an Divider in Lists Flutter

Question: How can I add a divider in this list like to divide them all from a small horizontal line Screen in phone
Also How can I add a text in the space on Top. When I tried to add an text there I get an error. My code is below,
body: TabBarView(
                children: [
                  new ListView(
                    padding: EdgeInsets.fromLTRB(10.0, 250.0, 10.0, 0.0),
                    new Text("Hello"),
                    controller: controller,
                    children:
                      List.generate(100, (int i){
                        return ListTile(
                          leading: CircleAvatar(
                            backgroundImage: AssetImage("assets/images/avatar.jpg"),
                          ),
                          title: Text("List Index is $i"),
                        );
                      }),
                  ),

Comment: you can use ```ListView.separated()```
Comment: Please add the error you got when adding a text above your list.
Comment: This question should be improved to be helpful for others. Here is a good resource on how to write a good question [ask] and the importance of a minimal reproducable example [repro]. Community members please use "flag"/"close" votes to improve this question.
Comment: I added the ```ListView.separated()``` I got an error as "Error: No named parameter with the name 'children'.". And when I add the text I got an error as "Error: No named parameter with the name '#1'."
Answer: There are multiple ways to achieve what you want but the easiest one is shown below:-
return TabBarView(
        children: [
ListView.separated(
      separatorBuilder: (context, index) => Divider(),
      itemCount: 100,
      itemBuilder: (context, index) => ListTile(
        leading: CircleAvatar(
          backgroundImage: AssetImage("assets/images/avatar.jpg"),
        ),
        title: Text("List Index is $index"),
      ),
    ),]);

Comment: "Error: Unexpected token 'return'". Can You like add the code from the TabBarView onwards?
Comment: Which point should I add it on my code. It gives me an error because it's TabBarView
Comment: Nope I just checked with tabBarView. It is working completely fine and not causing any error. Can you please mention the error that you get.

How to add an Divider in Lists Flutter


Explanation about a proof regarding the standard topology

Question: I don't understand the argument at 26:00-27:14. Where did he use the definition of the standard $\mathbb{R}^d$ topology? It seems that the empty set is in any family of sets by that proof which is clearly nonsense.

A youtube snapshot is helpful - compare the definition of $\mathcal U$ on the left side of the board to the right side where he proves  $\emptyset \in \mathcal U$.
Comment: If $P(S)$ is of the form $\forall p \in S : \ldots$, then yes. If the property has a different form, then $\varnothing$ may or may not have that property.
Comment: I couldn't follow all of it because I find the definition of "the standard R[sup]d[/sup] topology".  But it appears that what he proves (at time 26 minutes into the lecture) is that the empty set is a **subset** of any set, not that it is a member of a specific collection of sets.
Comment: I would realy like to see some explanation before the down vote. What is wrong with the question?
Comment: I didn't downvote, but I would expect someone of your reputation to do your best to make questions self-contained. If that video goes down, this question becomes far less useful to others.
Comment: @user247327 This is not what he proves here. I'm not sure why you think that. He proves that the empty set is an element of the topology.
Comment: The proof shows that the empty set belongs to every family $\mathscr{F}$ of sets *that is defined by a condition* $S \in \mathscr{F} \iff \bigl(\forall p \in S : \text{whatever}\bigr)$.
Comment: I'm talking about the indicated part of the video that you linked. $\mathcal{O}_{\text{st}}$ is defined by $U \in \mathcal{O}_{\text{st}} \iff \bigl(\forall p \in U : \exists r \in \mathbb{R}^+ : B_r(p) \subseteq U\bigr)$. The proof shows — though that's not quite explicitly stated — that the empty set belongs to every family of sets defined by such a condition. (Because the part after "$U \in \mathcal{O}_{\text{st}} \iff \bigl(\forall p \in U :$" isn't used at all; $\forall p \in \varnothing : \ldots$ is vacuously true.)
Comment: So if I define some family $F$ of sets  with property $P$ then $\emptyset$ is in this family because $∀p∈\emptyset$:… is vacuously true @DanielFischer
Comment: Yes, this make sense now. He actually proved that emptyset is open for much larger class of families no just family made in standard $R^d$ topology. He could mentioned that and there would be no confusion (for me of course). Also proofs with contradiction (which are equivalent to EFQ) are much easier to understand.  Thanks@DanielFischer Can you please write this comments as an answer.
Comment: This reminds me of the fact that the number of bijective mappings between the empty set and itself is equal to $1$. Can anyone say $0! = 1$.
Comment: See also [Base and empty set of a topology](https://math.stackexchange.com/a/490276/432081).
Answer: On the left hand side of the board, the standard topology on $\mathbb{R}^d$ is defined by: A subset $U \subseteq \mathbb{R}^d$ is in the standard topology, if and only if $\forall p \in U: \exists r > 0$ s.t. $B_r(p) \subseteq U$.
With this definition, the empty set is indeed in the standard topology. We just need to check that $\forall p \in \emptyset: \exists r > 0$ s.t. $B_r(p) \subseteq \emptyset$. However, this is trivially true, since there are no $p \in \emptyset$.
More precisely, the statement is true since we have
$$\forall p,\exists r > 0: p \in \emptyset \Rightarrow B_r(p) \subseteq \emptyset$$
However, this means that for every $p$ we have $\text{false} \Rightarrow \text{something}$, which by Ex falso quodlibet, is a true sentence.

Also, the proof does not show that the empty set is in any family of sets. This is not true. For example, consider the following collection of subsets of $\mathbb{N}$ defined via $S:= \{U \subseteq \mathbb{N} \vert 1 \in U\}$. It does not contain the empty set.
However, the proof does show that for any collection $A$ of sets defined by $U \in A$ if and only if $\forall p \in U: \text{something}$ the empty set is a member.


Convergence of sequence including binomial coefficients

Question: While investigating the risk consistency of a particular machine-learning algorithm, I encountered the following convergence problem.
I would appreciate it if someone could point me in the right direction.
Given the function
$$
a_{pq}: \mathbb{N} \rightarrow \mathbb{R},\quad n \mapsto \sum_{m = 0}^{n - 1} \sum_{k = 0}^{n - m - 1} \binom{n}{m} \binom{n - m}{k} p^m (1 - p)^{n - m} q^k (1 - q)^{n-m-k} \text{,}
$$
I want to prove that $\lim_{n \rightarrow \infty} a_{pq}(n) = 1$ for all choices of $p \in [0, 1)$ and $q \in [0, 1)$.
My current idea is to show that $a_{pq}(n) \leq 1$ and there is a simpler function $b_{pq}(n) \leq a_{pq}(n)$ with $\lim_{n \rightarrow \infty} b_{pq}(n) = 1$.
Then, $\lim_{n \rightarrow \infty} a_{pq}(n) = 1$ follows naturally.
I am not successful in finding such a function, though.
A second idea is to express $a_{pq}$ as a hypergeometric function for which there are many results on convergence.
Example: For $p = 0.2$ and $q = 0.2$, $a_{pq}(1) = 0.64$, $a_{pq}(2) \approx 0.87$, $a_{pq}(3) \approx 0.95$, and $a_{pq}(4) \approx 0.98$.
Thanks a lot.
Answer: For any $x,y$ and $N\in\mathbb N$, the binomial theorem implies
$$\sum_{k=0}^{N-1}{N\choose k}x^ky^{N-k}=(x+y)^N-x^N.$$
Using this, it follows
\begin{align}
a_{pq}&=\sum_{m=0}^{n-1}{n\choose m}p^m(1-p)^{n-m}\sum_{k=0}^{n-m-1}{n-m\choose k}q^k(1-q)^{n-m-k}\\[.5em]
&=\sum_{m=0}^{n-1}{n\choose m}p^m(1-p)^{n-m}(1-q^{n-m})\\[.5em]
&=\sum_{m=0}^{n-1}{n\choose m}p^m(1-p)^{n-m}-\sum_{m=0}^{n-1}{n\choose m}p^m\big(q(1-p)\big)^{n-m}\\[1em]
&=(1-p^n)-\big((p+q(1-p))^n-p^n\big)\\[1.2em]
&=1-(p+q(1-p))^n.
\end{align}
Since $p,q\in[0,1)$ we have $0\leq p+q(1-p)<p+(1-p)=1$, this implies $(p+q(1-p))^n\to0$ and therefore $a_{pq}\to1$.
Comment: Thanks a lot :)
Comment: @Tobias No problem!


Android Lollipop Toolbar vs Custom view

Question: I just read about the new Toolbar in Android Lollipop.
It inherits from ViewGroup.
Why are the advantages of using the new Toolbar over, say, a LinearLayout
to place your own views?
Comment: its already built and you dont have to reinvent the wheel. If you need something specific then by all means use your own custom method to display what you want
Comment: Was there anything else you needed help with?
Comment: No, I understand now why the Toolbar was made this way and how it can be reused for various design patterns! Thanks!
Answer: Explanation:
You should start using a ToolBar instead of the ActionBar. This is directly taken from the Android Developer documentation. It allows more flexibility than the normal ActionBar; however, retains some the more prominent features such as adding a Logo, supports "up" Navigation, inflating menus and actionviews such as the SearchView.
Tutorials:
Implement yourself(by Chris Banes)
Collapsing Toolbar, FloatingActionButton, NavigationView, Snackbar(by Chris Banes)
Documentation:
Normal Toolbar(API 21+)
AppCompat Support v7 Toolbar(API 7+)

A standard toolbar for use within application content.
A Toolbar is a generalization of action bars for use within
  application layouts. While an action bar is traditionally part of an
  Activity's opaque window decor controlled by the framework, a Toolbar
  may be placed at any arbitrary level of nesting within a view
  hierarchy. An application may choose to designate a Toolbar as the
  action bar for an Activity using the setActionBar() method.
Toolbar supports a more focused feature set than ActionBar. From start
  to end, a toolbar may contain a combination of the following optional
  elements:
A navigation button. This may be an Up arrow, navigation menu toggle,
  close, collapse, done or another glyph of the app's choosing. This
  button should always be used to access other navigational destinations
  within the container of the Toolbar and its signified content or
  otherwise leave the current context signified by the Toolbar.
A branded logo image. This may extend to the height of the bar and can
  be arbitrarily wide.
A title and subtitle. The title should be a
  signpost for the Toolbar's current position in the navigation
  hierarchy and the content contained there. The subtitle, if present
  should indicate any extended information about the current content. If
  an app uses a logo image it should strongly consider omitting a title
  and subtitle.
One or more custom views. The application may add
  arbitrary child views to the Toolbar. They will appear at this
  position within the layout. If a child view's Toolbar.LayoutParams
  indicates a Gravity value of CENTER_HORIZONTAL the view will attempt
  to center within the available space remaining in the Toolbar after
  all other elements have been measured.
An action menu. The menu of
  actions will pin to the end of the Toolbar offering a few frequent,
  important or typical actions along with an optional overflow menu for
  additional actions. In modern Android UIs developers should lean more
  on a visually distinct color scheme for toolbars than on their
  application icon. The use of application icon plus title as a standard
  layout is discouraged on API 21 devices and newer.

Android Lollipop Toolbar vs Custom view


How to set the opencpu default port for single user

Question: I am working with opencpu. I installed the opencpu as a single user mode. When the session is expired the link is down and sometimes the port number is changing dynamically. I would like the port to be constant during every run even the current session is expired.
Answer: You can set the port when you start the single user server:
<code>library(opencpu)
opencpu$stop()
opencpu$start(1234)
</code>
This will start opencpu on port 1234. I recommend you try the cloud server, which always runs on port 80 (http) and 443 (https).
Comment: I need another help from you Jeroen
Comment: is there any way to change the default configuration at `.opencpu.conf`?


Assigning new region in a display suite layout does not show contents placed inside newly created region

Question: // rmch-content-2.tpl.php
<?php
/**
 * @file
 * Display Suite RMCH Two Column Header template.
 *
 * Available variables:
 *
 * Layout:
 * - $classes: String of classes that can be used to style this layout.
 * - $contextual_links: Renderable array of contextual links.
 * - $layout_wrapper: wrapper surrounding the layout.
 *
 * Regions:
 *
 * - $header: Rendered content for the "Header" region.
 * - $header_classes: String of classes that can be used to style the "Header" region.
 *
 * - $left: Rendered content for the "Left" region.
 * - $left_classes: String of classes that can be used to style the "Left" region.
 *
 * - $right: Rendered content for the "Right" region.
 * - $right_classes: String of classes that can be used to style the "Right" region.
 */
?>
<<?php print $layout_wrapper; print $layout_attributes; ?> class="<?php print $classes;?> clearfix">

  <?php if (isset($title_suffix['contextual_links'])): ?>
    <?php print render($title_suffix['contextual_links']); ?>
  <?php endif; ?>

      <<?php print $content_left_wrapper; ?> class="ds-content-left <?php print $content_left_classes; ?>">
        <?php print $content_left; ?>
      </<?php print $content_left_wrapper; ?>>

      <<?php print $content_right_wrapper; ?> class="ds-content-right <?php print $content_right_classes; ?>">
        <?php print $content_right; ?>
      </<?php print $content_right_wrapper; ?>>

   <<?php print $content_right_wrapper; ?> class="ds-content-footer <?php print $content_footer_classes; ?>">
        <?php print $content_footer; ?>
   </<?php print $content_right_wrapper; ?>>

      <?php print render(block_get_blocks_by_region('page_links')); ?>

</<?php print $layout_wrapper ?>>

<?php if (!empty($drupal_render_children)): ?>
  <?php print $drupal_render_children ?>
<?php endif; ?>

So I have added new footer region in the .inc for the layout
    rmch_content_2.inc

/**
 * @file
 * Display Suite RMCH Header 2 col, Content 2 col
 */

function ds_rmch_content_2() {
  return array(
    'label' => t('RMCH Content 2 col'),
    'regions' => array(
      'content_left' => t('Content Left'),
      'content_right' => t('Content Right'),
      'footer' => t('Footer'),
    ),
    // Uncomment if you want to include a CSS file for this layout (rmch_two_column_header.css)
    'css' => FALSE,
    // Uncomment if you want to include a preview for this layout (rmch_two_column_header.png)
    'image' => TRUE,
  );
}

I have added new region footer which is visible in the screenshot and added Links field inside Footer
When I add Links field in the Content Left , it displays links but when I add  it in the footer it does not show up and the variable
print $content_footer; inside tpl.php file turns out to be empty completely.
What should I do the make sure blocks or fields added inside newly created regions show up.?
Answer: You've made a footer definition but printing $content_footer. Try printing $footer or changing the name of the region to be consistent with the others (content_). Clear cache to see your changes.


Positivity of principal eigenvalue for $L\phi=-\triangle \phi + \nabla \cdot( u \phi )$

Question: EDIT: This question is still unresolved as of April 18, 2014. The two answers provide useful work in the right direction, but neither resolves the question. A counterexample should have $u \in C^1(\overline{\Omega})$.
I am reading this paper and in section 2 the authors explicitly state "We do not assume in this section that the flow $u(x)$ is incompressible." They immediately proceed to consider $\mu_1[u]$ and $\eta(x)$ the principal eigenvalue and normalized positive eigenfunction of the problem
$$
-\triangle \eta - \nabla \cdot (u \eta) = \mu_1[u] \eta
$$
in $\Omega$ and $\eta=0$ on $\partial \Omega$. Here $\Omega$ is any smooth bounded domain.
The authors then make the cryptic remark: "Note that $\mu_1[u]>0$ as the operator $-\triangle + u \cdot \nabla$ has no zero order term."
I see that $-\triangle + u \cdot \nabla$ is the adjoint of the operator in question. But how exactly does this tell me that $\mu_1[u]>0$? I know that a sufficient condition is that $\nabla \cdot u \leq 0$, (e.g. here), but the authors of the paper I am reading make no mention of any sort of divergence assumption.
Comment: We discussed a vaguely similar problem [here](http://math.stackexchange.com/q/379227/8157), HTH.
Comment: Do you require $u$ bounded on $\Omega$?
Comment: @user7530 I am assuming $u$ is Lipschitz and $\Omega$ is bounded so $u$ is bounded.
Comment: Although the linked paper doesn't seem to make any such assumption, so if you have a counterexample feel free to post it.
Comment: Please replace `\triangle` by `\Delta`.
Comment: @nullUser Shameless self-plug here, but i am interested in knowing if you see an immediate error in the argument provided in my answer below?
Answer: The following counterexample is not fully satisfying ($u$ is unbounded, and $\mu$ is not strictly negative) but perhaps serves as a start:
Take $\Omega$ to be the unit disk and set $u(r,\theta) = \left(\frac{3r^2}{1-r^3}, 0\right)$. This vector field diverges as $r\to 1$ but is differentiable on the interior of $\Omega$. But for $\eta = 1-r^3$, we have that
$$-\Delta \eta - \nabla\cdot (u\eta) = 9r - \nabla\cdot (3r^2,0) = 9r - 9r = 0,$$
so $f$ is an eigenfunction of the differential operator with nonpositive eigenvalue $\mu=0$.
Answer: Let us try to obtain a counterexample. We assume that $u$ is sufficiently smooth.
Let us write the variational definition of the first eigenvalue:
$$
\mu_1[u] = \inf_{\eta \in W_0^{1,2}(\Omega)}\frac{\int_\Omega |\nabla \eta|^2 \,dx - \int_\Omega \nabla \cdot (u \eta) \, \eta \,dx}{\int_\Omega |\eta|^2 \,dx}, \quad \left(  \eta \not\equiv 0 \right).
\tag 1
$$
For the second integral in the numerator we have
$$
\int_\Omega \nabla \cdot (u \eta) \, \eta \,dx =
\int_\Omega (\nabla \eta \cdot u) \, \eta \,dx +
\int_\Omega \eta^2 (\nabla \cdot u) \,dx.
\tag 2
$$
Auxiliary, we note that integration-by-parts formula gives us
$$
\int_\Omega \eta_{x_i} u_i \, \eta \,dx =
-\int_\Omega \eta \, u_i \, \eta_{x_i} \,dx - \int_\Omega \eta^2 (u_i)'_{x_i} \,dx,
$$
(here we used the fact that $\eta = 0$ on $\partial \Omega$).
Therefore,
$$
\int_\Omega \eta_{x_i} u_i \, \eta \,dx = -\frac{1}{2}\int_\Omega \eta^2 (u_i)'_{x_i} \,dx.
$$
Using this equality, for the first integral on the rhs of $(2)$ we derive
$$
\int_\Omega (\nabla \eta \cdot u) \, \eta \,dx = \sum_{i=1}^n \int_\Omega \eta_{x_i} u_{i} \, \eta \,dx = -\frac{1}{2} \int_\Omega \eta^2 \sum_{i=1}^n(u_i)'_{x_i} \,dx =
-\frac{1}{2} \int_\Omega \eta^2 (\nabla \cdot u) \,dx.
$$
Hence, for $(2)$ we have
$$
\int_\Omega \nabla \cdot (u \eta) \, \eta \,dx = \frac{1}{2} \int_\Omega \eta^2 (\nabla \cdot u) \,dx \geq \frac{1}{2} \min_{\Omega} (\nabla \cdot u) \int_\Omega \eta^2 \,dx = C \int_\Omega \eta^2 \,dx.
\tag 3
$$
Finally, for $(1)$ we obtain
$$
\mu_1[u] \leq \inf_{\eta \in W_0^{1,2}(\Omega)} \left( \frac{\int_\Omega |\nabla \eta|^2 \,dx - C \int_\Omega \eta^2 \,dx}{\int_\Omega |\eta|^2 \,dx} \right) =
\inf_{\eta \in W_0^{1,2}(\Omega)} \left( \frac{\int_\Omega |\nabla \eta|^2 \,dx}{\int_\Omega |\eta|^2 \,dx} - C\right) = \lambda_1 - C \leq 0
$$
for any $C \geq \lambda_1$ (it is possible, due the fact that we have no a priori assumptions on $\nabla \cdot u$). Here $\lambda_1$ is the standard first eigenvalue of the Dirichlet Laplacian in $\Omega$.
(Note also that the first inequality is true, since it is true for any $\eta \in W_0^{1,2}(\Omega)$).
Using the inverse inequality for $(3)$ we obtain the condition for the strict positivity of $\mu_1[u]$:  $\max_{\Omega} (\nabla \cdot u) < 2 \lambda_1$. (consequently, if $\nabla \cdot u \leq 0$, as you wrote.)
P.S. Actually, I can not figure out right now is the variational characterization correct. But in any case, if we assume that the first eigenfunction is "normal", then the construction above holds (without taking $\inf$).
Comment: Unfortunately, the last sentence "...if we assume that the first eigenfunction is "normal", then the construction above holds (without taking $inf$)" is not correct, since $\eta$ depends on $u$.
Comment: I'm afraid that I was wrong with variational characterization $(1)$. The derivative of $(1)$ don't give us the weak form of the original equation.
Answer: Simple Special Case: $u=\nabla\phi$
We have
$$
\nabla (e^{\pm \phi/2}\psi)=e^{\pm\phi/2}\left[\nabla\psi\pm\frac{u}{2} \psi\right].
$$
In particular, $\left[\nabla+\frac{u}{2}\right]=e^{-\phi/2}\nabla e^{\phi/2}$ is injective, and we have
$$
\mu_1e^{\phi/2}\eta=e^{\phi/2}\left[-\nabla\right]\cdot\left[\nabla+u\right]\eta=\left[-\nabla+\frac{u}{2}\right]\cdot\left[\nabla+\frac{u}{2}\right]e^{\phi/2}\eta.
$$
It follows that
$$
\mu_1\lVert e^{\phi/2}\eta\rVert^2_{L^2}=\lVert \left[\nabla+\frac{u}{2}\right]e^{\phi/2}\eta \rVert^2_{L^2}.
$$
Since the operator $\left[\nabla+\frac{u}{2}\right]$ is injective, we find
$$
\mu_1=\frac{\lVert \left[\nabla+\frac{u}{2}\right]e^{\phi/2}\eta \rVert^2_{L^2}}{\lVert e^{\phi/2}\eta\rVert^2_{L^2}}>0.
$$
General case
Let $\eta^*>0,\mu^*_1>0$ be the principal eigenfunction and principal eigenvalue of $L^*=-\Delta+u\cdot \nabla$. Since $\eta^*>0$ and $\eta>0$, we have $\langle \eta^*,\eta\rangle>0$. But then
$$
\mu_1=\frac{\langle \eta^*,L\eta\rangle}{\langle \eta^*,\eta\rangle}=\frac{\langle L^*\eta^*,\eta\rangle}{\langle \eta^*,\eta\rangle}=\mu_1^*>0.
$$
Answer: Let $L$ denote the operator
$$L\eta:= -\Delta \eta - {\rm div}\big( u(x) \eta \big)$$
and consider the adjoint
$$L^t\xi = -\Delta \xi + u(x) \cdot \nabla \xi.$$
Consider now the eigenvalue problems
$$
(1)_{\lambda}
\left \{
\begin{array}{rccl}
L \eta &=& \lambda \eta & \text{ in } \Omega\\
\eta &=& 0 & \text{ on } \partial\Omega
\end{array}
\right.
\quad \text{and} \quad
(2)_{\lambda}\left \{
\begin{array}{rccl}
L^{t} \xi &=& \lambda \xi & \text{ in } \Omega\\
\xi &=& 0 & \text{ on } \partial\Omega.
\end{array}
\right.
$$
By the Fredholm alternative, we have that:
(A) $(1)_{\lambda}$ has a unique solution (which is $\eta \equiv 0$) if and only if $(2)_{\lambda}$ has only the trivial solution $\xi \equiv 0$.
(B) Moreover, $(1)_{\lambda}$ admits nontrivial solutions if and only if $(2)_{\lambda}$ admits nontrivial solutions, and the dimension of the solution space of each problem coincides.
Let $\Sigma_{L^{t}} \subseteq \mathbb{C}$ denote the set of eigenvalues of $L^{t}$ (that is, the set of $\lambda$'s such that $(2)_{\lambda}$ admits nontrivial solutions).
By the above, we have that $(1)_{\lambda}$ admits nontrivial solutions if and only if $\lambda \in \Sigma_{L^t}.$
From the elliptic theory we know that $L^{t}$ has a smallest real eigenvalue $\lambda_1$ such that the solution space of $(2)_{\lambda_1}$ is one dimensional and, moreover, is generated by a positive function
(for instance, see the book of Evans:Theorem 3, section 6.5, for details).
By the maximum principle, we even know that $\lambda_1 > 0.$
Then, by the Fredholm alternative,
for
$(1)_{\lambda}$
to admit solutions, we must necessarily have ${\rm Re} \lambda \geq \lambda_1,$
and we also know that $(1)_{\lambda_1}$ has a one-dimensional space of solutions.
It remains to show that this space of solutions may be generated by a positive function.
However, I do not know how to show this at the moment (in the self-adjoint case, one uses the variational characterization of the eigenvalue, and in the non self-adjoint case the proof in Evans uses the maximum principle, which is not available for $L$)
Edit: It seems that the positivity of the principal eigenfunction already follows from the Krein-Rutman Theory. I was aware that, for $L^{t}$ with a maximum principle, the theory implied the positivity of the first eigenfunction, but Theorem 1.1. here implies that it is also the case for its adjoint $L$.


Is it allowed to average annual frequencies to make a time series evenly spaced?

Question: I have a time series with observations that were collected quasi fortnightly over several years. However, there are between 23 and 26 observations per year. The time series is not equidistant, due to bad weather or holidays where no sampling occurred. Is it legitimate to average these observations to obtain a frequency that can be used in a R time series object?
To illustrate, here is some code (time series of pH values in rain water):
Data <- read.table("http://dl.dropbox.com/u/2108381/Data.txt")
Data.col <- data.frame(Time = Data[1:122,1], Value = Data[123:244,1])
Dat.num <- as.numeric(Data.col$Value)
pH.TimeSeries <- ts(Dat.num, start = c(2006,2), frequency = 24.4)
pH.decomp <- decompose(pH.TimeSeries)
plot(pH.decomp)

Is it allowed to approach time series analysis like this? Can I make the decomposition like this? And, is it allowed to average the frequencies over the years?
The "decompose" plots make sense since there is a seasonal peak and an upward trend in pH in the summer.
Any direct answer to this challenge or linkage to other websites/posts is greatly appreciated. Some google-fu from my side was to no avail. Please let me know if there are ways to improve this question.
Answer: My first thought would be that you can't average out your frequency like that. I think it will introduce frequencies that aren't really there.
Could you aggregate things to create a monthly (average) reading and do something on a monthly basis? Or is that not good enough?
EDIT: Now that I've thought about it, I'd basically create a time series with a frequency of 24, aggregating (averaging bins) data into half-months: Jan1, Jan2, Feb1, Feb2, ..., Dec1, Dec2. If there are no readings in a bin, enter NA.
If you end up with NA's, use StructTS, which allows NA's. Otherwise, I'd try stl in preference to decompose.
I'm also wondering if you could use loess or approx or package akima's interp to interpolate your data to a regular (half-months) series and go with that. But I suspect it would introduce artifacts.
Comment: It might be a good idea to create monthly averages. This still should be good enough. I can still make the decomposition then, right? Thanks for your time.
Comment: I'd wait on other answers and votes before taking action. I work with time series, but am not a time series guru, so there may well be other options that might help you preserve some of the detail you got. (From your example, you did get more than two readings per month, though not a regular every-two-weeks reading.)
Answer: Read the CRAN Task View on Time Series - you might want to try storing your data as a zoo object, or an xts object (these allow irregularly-spaced time series).
As for the analysis, well you should figure out what question you want to ask and then work from there. Don't run the functions you've got (decompose) and then say 'ooh what does that tell me' (okay, maybe when working in exploratory mode, but at some point you might have to write a model down).
http://cran.r-project.org/web/views/TimeSeries.html


Is 7 string guitar a must have for lower tunings?

Question: Note that I'm familiar with the post Why Move to a 7-String Guitar? but it doesn't quite answer my question.
My question is can you get to lower tunings such as C standard, drop B tunings without damaging the guitar and getting a good sound for rock and metal music. I was inspired by Kurt Cobains "buying junk" kind of thinking. Basically he used anything he could get his hands on.
What factors are important for this?
Answer: A seven string guitar is not needed. There are bariton guitars that are specifically made for lower tunings.
Detuning a normal six string guitar is also very common. Since detuning usually means putting thicker strings on the guitar, one thing to look out for is the nut. The slots might need to be widened to accommodate the thicker strings. Another issue might be intonation. The longer scale on a bariton guitar is to allow for intonation with lower tunings. For normal six string guitars, a Fender type scale of 25.5" is preferable over a Gibson which is 24.75". That said, I have seven string guitars with 24.75" scale where I don't have an issue with intonation.
The tuning machines might not be made for thicker strings either. One can use a small file to increase the size of the holes, or peel away the smaller wire wound around the string in order to just let the core of the string pass through.
So there's nothing stopping you from experimenting with this. The death metal sound of the early 90s is partly due to detuning six string guitars while not changing string gauge, making the strings very loose. If it works, it works...
Comment: What makes a longer scale length as in Fender preferable over a shorter scale? With suitable guage strings on each, there won't be any difference, will there?
Comment: @Tim, the difference in gauge makes a big difference in how it feels to play in different tunings.
Comment: I understand that - I've been guitaring for 60 yrs! What I don't understand is what difference sgale length will make to intonation, as each neck/frets is for its own particular scale length. The two have to go together.
Comment: @Tim I'm probably missing your point, but at some point you won't be able to intonate due to the scale length being too short. A1 or E1 for the sixth string would likely be hard on a normal scale.


How can you print the decision tree of a RandomForestClassifier

Question: Recently, I have noticed that there is a method sklearn.tree.export_graphviz documented here.
However, I do not know how I can apply it to a RandomForestClassifier.
I have tried the following naive code but it does not work, and I do not know how I can get one of the trees from a RandomForestClassifier:
print('Training...')
forest = RandomForestClassifier(n_estimators=100)
forest = forest.fit( train_data[0::,1::], train_data[0::,0] )

print('Predicting...')
output = forest.predict(test_data).astype(int)

if sys.version_info >= (3,0,0):
    predictions_file = open("myfirstforest.csv", 'w', newline='')
else:
    predictions_file = open("myfirstforest.csv", 'wb')

tree.export_graphviz(forest, out_file='tree.dot')

Answer: Your RandomForest creates 100 tree, so you can not print these in one step. Try iterate over the trees in the forest and print them out one by one:
from sklearn import tree
i_tree = 0
for tree_in_forest in forest.estimators_:
    with open('tree_' + str(i_tree) + '.dot', 'w') as my_file:
        my_file = tree.export_graphviz(tree_in_forest, out_file = my_file)
    i_tree = i_tree + 1

If you want to know the actual parameters of the trees like splitting attribute (feature), splitting value (threshold), node samples (n_node_samples) etc., you can use print getmembers(tree_in_forest.tree_) in the for cycle. To use one of these parameters, eg. threshold, use this: tree_in_forest.tree_.threshold It returns with a list.
Comment: What is `getmembers`?
Comment: @Jarad It's from `inspect` but you don't really need it here.


Translatable strings and Drupal primary language

Question: I use a lot of modules and templates, in which I have to print a lot of display markups.
My website has primary language FR, but whatever I do, each time I use a translatable string, it's always EN that is set for that t('whatever').
I'd like to be able to write all my custome code in French, and then translate strings into english in the interface.
Is it any way to achieve that?
Answer: No unfortunately, strings passed to t() should always be in English.


Como retirar caractere ponto e vírgula com excel

Question: Estou tentando usar uma fórmula do excel para retirar o ponto e a vírgula, mas mesmo com a linha da fórmula correta não estou conseguindo resolver.
O que tenho agora é isso:
=SUBSTITUIR(SUBSTITUIR(K2;".";"");",00";"")

Estou tentando substituir os valores que estão assim: 2.000,00 para 2000 de forma que a coluna toda seja modificada, mas o valor fica 0,00
Uma imagem da coluna.
Comment: Esse ponto que você esta vendo na coluna não existe. O excel mostra o conteúdo dessa maneira após a formatação, por isso que você não consegue substitui-lo.
Comment: Formate a coluna como GERAL
Answer: Use a fórmula TEXTO para reconfigurar a formatação dos números. Já que vc quer retirar os pontos (separadores de milhar) e as vírgulas (casas decimais), a sua fórmula vai ficar assim:
=TEXTO(K2;"0")

...ou, caso não queira ocultar os decimais diferentes de 0:
=TEXTO(K2;"Geral")

No seu caso, SUBSTITUIR só funciona quando vc está lidando com textos mesmo!
Comment: Agradeço a ajuda @Tash_Riser, facilitou muito.
Answer: Altere a formatação de células para remover o separador de milhar e reduzir o número de casas decimais para zero.


Visual Studio - Source Control

Question: I am pretty new in source control installation and inner workings, although I already had worked with TFS, I have no clue about how to make it work from scratch.
Basically I want to have some source control in my personal VS2010 projects, so I may see the code evolution, rollback and etc. but I am a little lost about how may I set it up...as far as I can see, I have to have a Team Foundation Server running, so is it possible to install one in my PC? Is it free? Or there is a better way for doing it?
I just want some simple tips like "hey man, here are the steps you should follow" or "this is impossible, you have to have a server" or "follow this tutorial"
Thanks a lot guys!
Comment: Team Foundation Server definitely does have a free offering. In fact, it has two.  TFS Express is the on premises free offering and tfspreview.com is the hosted free offering.  You can read more about TFS Express here: http://blogs.msdn.com/b/bharry/archive/2012/02/23/coming-soon-tfs-express.aspx
Comment: Just use [git](http://git-scm.org).
Comment: possible duplicate of http://stackoverflow.com/questions/3244320/source-control-in-visual-studio-2010 I would agree with SLaks and recommend going for git or something like svn.  Team foundation is more suited to when you have multiple authors
Comment: Team Foundation Server is definitely NOT Free. I use Subversion and the AnkhSVN subversion plugin for visual studio. Works great for  personal stuff
Answer: [Disclaimer: I work on TFS and tfspreview.com]
If you are looking for ease of set up and a free offering then I would highly recommend tfspreview.com.  While it is still in "preview" mode, it is certainly usable and safe. The site itself also has a great "learn" section to help you get started. The best part is that it has features available that haven't even been released in the on-premises product yet and the development team is consistently adding new features.
If you have any questions about the service, I'd be glad to answer them.
Oh, one other note, to connect to the hosted service you will need to install the VS 2010 compatibility GDR but that is free also.
Comment: Thank you for the tip Taylor! Since you work on TFS, you probably is one of the best people I can ask this question, but sorry if its a little too "polemic", but since I am starting to lear more about source control, I want to know more about the tools out there...so the question:

"Why should I use TFS? Which are the advantages of the service? And what are the differences between TFS and GIT in a con/pro perspective?"

Thanks a lot!
Comment: Taylor I was following the website's instructions to use VS2010:
"You can use Visual Studio 2010, but you'll need to install Service Pack 1 and KB2581206 first."
but the KB2581206 link is broken :/
Comment: +1 - also, you can point the Git-Tf bridge @ tfspreview (or any TFS).  This allows you to work in a distributed fashion or by yourself to checkin, checkin (offline) then push to the cloud.  http://gittf.codeplex.com/
Comment: What a really wanted was a QUICK and SMALL comparison between Git, Hg, and TFS, like pro/cons, but everything I am finding over the internet is just too huge or metaphorical (like Git is MacGyver and Hg is James Bond ), could anyone do a quick and simple explanation?
Comment: Sorry about the late reply. I am fairly versed on Git and TFS but not much on Hg so I am going to leave that out.  Also, TFS and Git have some avid followers who would always swear their solution is better in all cases.  I'll try to avoid having this turn into a flame war.  Here is some high-level pros and cons for each:

Git: Pros: Distributed, Offline Checkin, Simplified Merging, Very Easy to set up. Cons: Can be complicated and unintuitive, Limited Windows Tooling, No free closed source hosting on GitHub, Doesn't scale with huge projects, No path based permissions

Need more comment space
Comment: TFS: Pros: Great Windows tooling, Scales with the largest projects in the world, It is part of a full ALM suite where Git is just a source control solution.  That is, it has first-class integration with Work Items, Build, Agile/Scrum/Kanban processes, etc.  Has Path based permissions.  Cons: Not as easy to set up or get started with as Git, although tfspreview.com has improved this.  Merging has more features but can also get more complicated.  No offline checkins or history.  No support for distributed version control.
Comment: The comparisons for these two systems could go on for days and not everyone will agree on every point.  These are high level points without much details.  If you have questions or specific areas where you would like to see comparisons, I can help with that.
Comment: Taylor, Thank you for the explanation! Could you just make a simple explanation about the terms:

1- Distributed
2- Offline Checkin (isnt this some part of distributed?)
3- Scale with huge projects
4- Path based permissions

(Some of the terms are probably easily explained with examples).

I thought TFS had Histoy, at least there is the "View History" and "Get specific version" options. Thanks again!
Comment: @TaylorLafrinere are you still busy? :)
Comment: 1. Distributed: You can find a good discussion between distributed and centralized version control here: http://stackoverflow.com/a/111076/1023608

2. Offline Checkin: This comes with a distributed version control system by definition but nothing precludes a centralized system from building it.
Comment: 3. To work with a Git repository. When you clone a Git repository, you clone the entire thing, including all of its history. To work with a TFS repository, you only download the latest versions of the portions you want. Git repositories are optimized for fast writes and slow reads. TFS repositories store much more metadata but can do both relatively fast.  TFS can scale to millions of files with years of history and a database size > 1TB.  Git repositories are not meant to scale that high. Instead, you would want to break projects that size into many different Git repositories.
Comment: 4. Security in Git is managed at the repository level.  In general, you can either read or write to the whole repository or you can't. With TFS, you can manage permissions within a repository in path space.  That is, you can say developer 1 can read and write everything under $/project1/foo, can read everything under $/project1 and can't read anything under $/project2.

5. In TFS, you can certainly view the history of the entire repository and get specific versions but you have to hit the server to do this.  Above, I meant that TFS does not support "offline" history.
Comment: @TaylorLafrinere Thank you very much for the explanation! You have been very helpful
Answer: GIT is a brilliant source control that has allot of easy to use functionality. In fact that have an extension for VS2010 as well. Check under the extensions menu and install the GIT extension. You can them commit and update from within VS itself. Super easy to use!
Enjoy :)
Comment: Actually, I am profoundly unimpressed by the GIT SCC extension (but I don't have time to fix it)
Comment: where may I find a quick and easy tutorial about GIT? I tried before to learn more about it, but all the material I found was huge.
Comment: Sorry about the wrong link. I fixed it. mFeinstein do you want tutorials on the VS 2010 plugin for GIT? Or just GIT in general. The extension is much easier to use instead of their command line interface which does take some getting used to.
Comment: I just wanted a quick and easy tutorial about Git...I am trying to figure how things work before make them work, so this way I can compare the different solutions out there (TFS, Git, Hg, etc)

Visual Studio - Source Control


Unable to enter credit card payment information

Question: I just noticed that I'm unable to enter credit card payment information (card number, expiration date, CVV) when going through the Drupal Commerce checkout processing using the Square Connect payment gateway. This was working fine in the past; I'm not sure when it stopped working but it might be related to the newest Commerce Core release on 19 October 2022. The fields are there, but I can't enter text in any of the text boxes. They're blank and read-only. What might have changed, and how can I fix it?
These are the modules I'm using:

Commerce Core 8.x-2.32 (released 19 October 2022)
Commerce Square Connect 8.x-1.5 (released 13 April 2022)
Answer: This is due to an API deprecation by Square that the module was not prepared for in advance. Please test the following patch and comment on the issue if it works for you. Thanks!
https://www.drupal.org/project/commerce_square/issues/3231283#comment-14772813
Comment: Thanks, Ryan! I've added some comments to the issue.


Upgrade windows server 2016 to 2019 , Evaluation ISO is not prompt for a license key during the installation

Question: Is there a way to upgrade from windows server 2016 standard license ( no EVALUATION) to windows server 2019 using ISO method without the need to activate it in a second moment once the upgrade is over?
During the Upgrade/Installation Wizard, no prompt for a license key is shown !! and if I go further, I'm not able to keep my files/apps and the only option is to do a clean installation/upgrade. And I need to keep the previous installation !!
Both windows servers 2016-2019 got a license key.
Comment: Does this answer your question? [Windows Server 2012/16/19 upgrade](https://serverfault.com/questions/1100845/windows-server-2012-16-19-upgrade)
Comment: As I stated in my answer to your previous question, you can't upgrade to an Evaluation Edition. - https://serverfault.com/questions/1100845/windows-server-2012-16-19-upgrade
Answer: I had the same issue and I resolved it by mounting the ISO and changing the edition.
After copying the ISO files to a folder I ran the following:
dism /mount-wim /wimfile:c:\ISO\sources\install.wim /mountdir:c:\mount /index:2
dism /image:c:\mount /get-currentedition
dism /image:c:\mount /get-targeteditions
dism /image:c:\mount /set-edition:ServerStandard
dism /unmount-wim /mountdir:c:\mount /commit
Then I ran the setup file and it still listed eval under the options, but then it allowed me to choose to keep my files.
Answer: what you are looking for should be described in the link on the Microsoft website:
https://docs.microsoft.com/en-us/windows-server/get-started/upgrade-2016-to-2019
Comment: Please provide the relevant steps from the link to resolve the problem.
Comment: Thank you for your reply !
Where can I find a Windows server media non Evaluation version ?
Comment: You can use the Evaluation media, and you can change the version from PowerShell using following command and setting the License Key:

`DISM /online /Set-Edition:ServerStandard /ProductKey:XXXXX-XXXXX-XXXXX-XXXXX-XXXXX /AcceptEula`

I suggest however to do a full raw copy of the whole disk to be safe and avoid surprises, before any upgrade.
Comment: I'm already aware of this option , What I need is to do the update of the Operating System (wile keeping the files/apps to test the integrity of the already installed app/configurations on the new S.O) . I don't need to do a clean upgrade and reinstalling the previous apps/configurations ! What I'm looking for is a licensed installaion media (ISO) and not an Evaluation version ( Having already the license key to insert during the upgrade process )
Thank you for sharing , much appreciated.
Answer: You can't use the Evaluation-ISO to upgrade. Did you buy a retail copy with DVD included?
Otherwise you could grab one from MSDN, if you have an active subscription.


Is it possible to use Firebase database with non-ssl Heroku hosted site with a custom domain?

Question: I'm planning to host a website for a class in school on Heroku. I've bought a custom domain to be used with it but I would rather not pay the extra cost for having that domain use an SSL certificate through Heroku. I hope to use Firebase database with it for its real-time capabilities and ease of use.
Is it possible to use Firebase with a website hosted on Heroku that is accessed using the non-SSL custom domain?
Answer: The Firebase Database can only be access through SSL. But a web app accessing the Firebase Database can run on non-secure HTTP.
You might want to consider using Firebase Hosting though, since that includes HTTPS hosting for free.


Can a Recurrent Neural Network degenerate to a Feed-Forward Neural network?

Question: Suppose I have a task X which is perfectly solvable by a Feed-Forward Neural Network.
When I apply a Recurrent Neural Network to the same problem, may it "loose" it's internal loop-/backward-links (setting them to 0-weight during learning), basically becoming a Feed-Forward Neural Network?

Is a Recurrent Neural Network with very few or very low-weighted backward-links an indicator, that a Feed-Forward Network might solve the problem just as well, with fewer links to compute (no backward-links need to be considered)?
Comment: Usually RNN would have much less parameters then dense network, so could you clarify what kind of architecture you have in mind?
Answer:
When I apply a Recurrent Neural Network to the same problem, may it
  "loose" it's internal loop-/backward-links (setting them to 0-weight
  during learning), basically becoming a Feed-Forward Neural Network?

It really depends on what your training algorithm is doing, but generally the answer to your question is yes.
In the absence of more information regarding the topologies your are comparing when referring to recurrent and feed-forward neural networks, a Recurrent Neural Network is a topological superset of a Feed-forward network.
However, in practice, neural networks must be trained. This is effectively a curve-fitting exercise (or an optimisation problem) and is at risk of overfitting. By using a Recurrent network instead of a feed-forward network to solve problems perfectly suited to the former, you are increasing the degrees of freedom in your model and, therefore, the risk of overfitting.
An RNN might therefore be less apt at solving a problem than a feed-forward network (with a simpler topology).


MahApps.Metro Message and Progress connect

Question: I would like to create a logic with MahApps which looks like this:
ShowScreenCommand = new Command(async () =>
{
    var window = Application.Current.MainWindow as MetroWindow;
    if (await window.ShowMessageAsync("Are you sure to remove it?", "Removal", MessageDialogStyle.AffirmativeAndNegative) == MessageDialogResult.Affirmative)
    {
        await removePatientTask();
    }
});

private async Task removeTask()
{
    var window = Application.Current.MainWindow as MetroWindow;
    var controller = await window.ShowProgressAsync("Please wait...","Process message",false,new MetroDialogSettings());

    await Task.Delay(5000);
    await controller.CloseAsync();
}

Problem is, that there is a gap between Message and Progress dialogs. One dialog hides, second one shows. This is not looking perfectly.
Is there a way to remove this gap? I mean, to replace one dialog with another?
Comment: Why do the messages change language?
Comment: ups :) I forgot to change that :)
Answer: Try removing the closing animation of the ShowMessageAsync method:
await window.ShowMessageAsync("Are you sure to remove it?",
                              "Removal",
                              MessageDialogStyle.AffirmativeAndNegative,
                              new MetroDialogSettings
                              {
                                AnimateHide = false
                              });

Maybe you'll have to remove the showing animation of the Progress as well, it's basically the same code, but replacing AnimateHide by AnimateShow.
Comment: After that, to go further, you can implement a `CustomDialog` and make the two dialogs in "one".


HTML5 Audio onLoad

Question: How can I get a callback when the audio tag is ready to play. (to tell the user, when implementing my own controls)
Using Chrome.
Answer: Have only done this on the video element but it should work for audio.
Firstly, you can't bind the event, I don't know why that doesn't work. So you have to use setTimeout.
Example using jQuery:
$(function(){
    var audioReady = function(){
        if (youraudioelement.attr('readyState')) {
            alert("it's ready!");
        } else {
            setTimeout(audioReady, 250);
        }
    }
    audioReady();
}

More info: http://www.w3.org/TR/html5/video.html#the-ready-states
Comment: Just checked the 'loadeddata' event and it works well in the latest versions of IE, Chrome and FF. Haven't tested older browsers or mobile  yet.
Comment: Not optimal, but I suppose there's no other choice... Thanks
Answer: Can you not bind to the onloadeddata event? It works for me. W3C Reference
Comment: This is the better anwser
Answer: Have you looked at the canplaythrough event?

HTML5 Audio onLoad


Windows server 2003 R2 supported guest operating system

Question: In this link it is mentioned like window server 2012 can be used as guest OS in window server 2008 R2
Can I run windows 8 or window 7 as guest OS in window server 2003 R2 as virtual machine? Even though window server 2003 r2 is old does it support it?
I have purchased Windows server 2012 separately (With new hardware parts). But I want to utilise existing server 2003 R2 license and its CALs (In my existing old server hardware). I have another desktop PC with TFS 2012 running on windows 8. But TFS 2012 cannot be installed to win server 2003 r2. So i have planned to install win server 2003 in one of my server and then create a virtual windows 8 in that. So i can install TFS for that virtual PC. Whether my plan is workable?
Although i cannot install TFS on my main server which has windows server 2012 because of performance issue and accessibility for my employees.
Comment: A guest VM using what virtualization tech?  Virtualbox?  VMWare Workstation?  Bob's Virtual Express Millennial Edition?  What have you tried or what issues are you running into setting it up?
Comment: After your edit...again I don't get the true gist of your question.  Were you hoping for a "Sure...you can do that...go forth and conquer!" answer?  I'm assuming you didn't know the experts here would come down on you for wanting to do this...but why didn't you simply try it in a test environment and see if it worked for you.  Forget best practices, etc.  You don't seem to care about those regardless, so why not just test and see if running TFS 2012 on a Win8 VM on VBOX on a 2003 R2 server in production works for you?
Comment: If someone hasn't mentioned it yet [Hyper-V Server](http://technet.microsoft.com/en-US/evalcenter/dn205299.aspx) (a separate product from the Hyper-V Role in Server 2008 and newer) is a FREE virtualization Operating System from Microsoft. All the virtualization goodness of Hyper-V, no cost.
Answer: The post you've linked to is for Hyper-V. Server 2003 doesn't have Hyper-V. That launched with 2008. So, no, you can't virtualize anything with the native Windows virtualization platform. You can install some type 2 hypervisor, like VirtualBox, but that's bad for a production environment.
Server 2003 R2 only has about a year of support left at this point. Upgrade.
Comment: For the love of $deity, don't use VB in production. Can't you install 2012 on the server over 2003 and then use Hyper-V in 2012?
Comment: @ITresearcher maybe you should hire someone with experience to give you some help?
Comment: This virtual pc will be used for production purpose. (TFS 2012 will be installed in this pc)


Event Mysql não executa no horário determinado

Question: Criei um evento no mysql para que todos os dias no horário 00:05:00 iniciando no dia 18/07/2021, ele execute um update em uma tabela, só que ele não está executando no horário determinado, o que pode estar acontecendo? Segue o script que utilizei para criação do Event
OBS.: Ele até fez a primeira execução (no dia que criei o evento), mas não repetiu nos demais dias, mesmo configurado como um evento recorrente.
CREATE DEFINER=`root`@`localhost` EVENT `EventStatusUpdate`
    ON SCHEDULE
        EVERY 24 HOUR STARTS '2021-07-18 00:05:00'
    ON COMPLETION PRESERVE
    ENABLE
    COMMENT ''
    DO BEGIN

UPDATE usuario
SET   status = 1
WHERE status = 0;

END

Comment: Mysql não é meu forte, mas sugiro que dê uma olhada a fundo na documentação [CREATE EVENT Statement](https://dev.mysql.com/doc/refman/8.0/en/create-event.html) principalmente em relação ao `CURRENT_TIMESTAMP`
Comment: Obrigado por responder @gleisin-dev, já havia verificado isso e também o timezone estão corretos.
Answer: "iniciando no dia 18/07/2021" esse deve ser o problema, se tentar criar um evento com uma data retroativa ele não vai funcionar, o STARTS deve sempre ser uma data posterior.
Por exemplo, no momento dessa resposta é "20/07/20121 15:00", portanto só pode agendar (no caso do seu exemplo) para iniciar a partir de "21/07/20121 00:05:00".
Crie o evento com o STARTS para o dia a seguir e vai funcionar.
Pode também mudar o EVERY 24 HOUR STARTS para EVERY 1 DAY STARTS
Por fim, não esqueça de a seguir confirmar se o evento foi criado corretamente e também se o scheduler está ativo, senão ele não vai iniciar o evento na próxima vez.  Para confirmar use o comando SHOW PROCESSLIST, veja se na lista aparece seu evento e o "event_scheduler", que é o agente que inicia os eventos agendados.
Comment: Obrigado por responder Ricardo, na verdade quando eu agendei para o dia 18/07/2021 para iniciar 00:05, eu criei antes disso, criei no dia 17 umas 23 hrs e fiquei aguardando pra ver se ele iria executar mesmo, daí executou... achei que tava tudo certo, mas aí nos demais dias ele não fez mais.

Já havia testado também com o EVERY 1 DAY e também não funcionou, já tenho 2 dias procurando uma solução na internet... também já dei um SHOW EVENTS e ele está criado e habilitado, também olhei a variável event_scheduler se estava ativa, me perdoe faltou passar também essas informações
Comment: Vi agora o SHOW PROCESSLIST, apareceu isso aqui:

Id User  Host db Command Time State Info
"5" "event_scheduler" "localhost" \N "Daemon" "36560" "Waiting for next activation" \N
"8" "root" "localhost:52082" "db_sistema" "Query" "0" "starting" "SHOW PROCESSLIST"
"9" "root" "localhost:52083" \N "Sleep" "5" "" \N

Não entendo muito desse comando, teria que aparecer aí uma linha com o nome do evento que criei?
Comment: Observei aqui que ontem o evento executou no horário certo (00:05) e hoje já não executou novamente, que loucura...


How to disable core dumps on Debian 8

Question: I pretend I've already tried everything out there, but my Debian 8 keeps creating core dumps when something crashes. It's happening about once or twice in a month. It's a production server for a few websites, with packaged Apache 2.4, php5-fpm and mysql. I suspect it's php5-fpm crashing because I get the dump file in the DocumentRoot folder. The file I get is named "core" and it is somewhere in the order of gigabytes in size.
Here is what I've already done to disable core dumps, without success:
ln -s /dev/null /etc/systemd/coredump.conf

and then rebooted. No dice.
echo '*               hard    core    0' >> /etc/security/limits.conf
echo "fs.suid_dumpable = 0" >> /etc/sysctl.conf
sysctl -p

and then rebooted. Still no dice. I've NOT set kernel.suid_dumpable to 0, because I found it later but when I found it I also read that zero is its default. These settings should not make any difference anyway, because php5-fpm is not setuid. The same goes for Apache and mysql, just in case it's not php5-fpm crashing.
For the time being there is a script that looks for core dumps and deletes them. Crontab does the rest, but it is not the best solution.
How do I globally and unconditionally disable core dumps in Debian 8?
Answer: After Michael Hampton's comment to the Froggiz' answer, I noticed that Debian seems to lack a coredump.conf manpage, so I've looked for it on the internet and found it. That manpage contains a lot of useful informations and I wonder why Debian ships without it (maybe Debian is shipping without the whole systemd-coredump thing?).
However from that manpage and the systemd-coredump manpage it seems that the core files I get do not come from systemd, because systemd puts them in /var/lib/systemd/coredump or in the journal depending on the Storage option, but never in the working directory of the crashed process. Moreover the systemd-coredump manpage (also missing in Debian) says that for the core dump functionality to work, you need to configure the kernel.core_pattern sysctl parameter to make the kernel actually hand the core dump to systemd-coredump.
I've then looked at Debian value for kernel.core_pattern: Debian comes with that parameter set to "core" by default, which happens to be exactly the name of the core dump files I get.
I now suppose that setting
kernel.core_pattern=|/bin/true

(or /bin/false for that matter) in sysctl.conf as per the core(5) manpage will solve the problem.
I'm going to evetually accept my answer in a few weeks if I notice the server stops creating core files. I'm sorry I can't accept Michael's comment as answer, but many thanks to him for pointing me in what I believe is the right direction.
EDIT: I've found here a way to test the configuration without having to wait for a spontaneous crash and I confirm this is the correct answer.
Comment: Debian is kind of a bizarre distribution. They make strange and usually ill-considered changes to upstream packages all over the place. I can't recommend using it, or anything derived from it.
Comment: This is not really a point of view. It's _important_. When a package doesn't behave as expected because the distribution changed how it behaves, you have a recipe for frustration at the very least.
Comment: Points of view. I like it a lot, though I admit it is sometimes cryptic to understand.
Comment: There actually isn't any custom behavior here. It's just a default kernel configuration. The Debian systemd does behave as expected and so does the Debian kernel. It seems Debian does not use systemd-coredump at all, and I can only support such a choice, because a quick "systemd-coredump" google search brings up mostly people trying to disable it.
Comment: `systemd-coredump` is shipped in a different package that is not installed by default
Comment: @Bigon that was not the case in Debian 8 (Jessie), which is what my question targets
Comment: For what I can see, it was not even enabled in the version released in debian 8 (215-17). According to the change log it was disabled in version 43-1 and re-enabled (and put in a different package) in 227-3, see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=744964
Answer: You can try this :
https://wiki.archlinux.org/index.php/Systemd#Disabling_application_crash_dumps_journaling

Disabling application crash dumps journaling Edit the file
  /etc/systemd/coredump.conf by adding this line:  Storage=none
and run:   systemctl daemon-reload to reload the configuration.
Comment: @LucioCrusca Because getting rid of the file does not stop core dumps. The file's absence only tells systemd to use its built-in defaults (which _do_ generate core dumps). This was documented in the `coredump.conf` man page.
Comment: How is that supposed to work, since I've already overridden any default coredump.conf with a symlink to /dev/null? I ask because each thing I try takes quite some time to test, so I prefer trying things only if I know they make sense.

How to disable core dumps on Debian 8


Symmetric Distribution of Difference of Random Variables

Question: Assume that $ X$ and $Y $ are i.i.d continuously distributed random variables with the same probability density function, i.e $ f_X(x)=f_Y(y)$. If $Z=Y-X $, then $Z $ is symmetrically distributed around $ 0$.

I know I need to show that $f_Z(-z)=f_Z(z) $ for all $z\in
\mathbb{R} $, but after writing the pdf of $ Z$ using convolution I'm struggling to see how that result would follow.
Answer: We have
$$f_Z(z) = \int_{-\infty}^\infty f_X(x)f_Y(z+x) \, dx$$
By doing the substitution of $y=-z+x$ in the second equality below  and using the property that $f_x(t)=f_y(t)$ (Note this is different from what you wrote, the argument is the same on both sides of the equality).
\begin{align}
f_Z(-z) &= \int_{-\infty}^\infty f_X(x)f_Y(-z+x) \, dx\\
&=\int_{-\infty}^\infty f_X(y+z)f_Y(y) \, dy\\
&=\int_{-\infty}^\infty f_Y(y+z)f_X(y) \, dy\\
&=\int_{-\infty}^\infty f_Y(x+z)f_X(x) \, dx\\
&= f_Z(z)
\end{align}


NgRx store for lists and detail data objects

Question: I'm very new to NgRx and am trying to wrap my head around it.  I understand the objective is to have a data store where different types of state reside.  I'm trying to understand how to work with lists of data.
Scenario 1:
user first navigates to a list in which case an effect fires to retrieve list from backend/API.  On success, the list is saved to the store and the UI component responds to the observable via | async and renders the list.  The user clicks on an item to view the detail.  We can either store the selected item's Id in the store then simply use a filter mechanism to retrieve the detail data from the list array in the store.  Or, we can make another effect call to server for detail payload.  I'm assuming the decision point here is if the list contains all of the data needed for the details page?
Scenario 2:  assuming the list in the store contains all of the data required for the detail page and user clicking on an item in the list simply saves the selected item's id to the store then navigates to the detail page where the detail data is simply filtered from the list based on the selected item id in the store, what happens when the user refreshes the browser URL on the detail page?  When this happens, the list is no longer in the store and neither is the selected item's id.  However, the selected item's id is in the URL and route.  How do you handle this scenario?  Do you rebuild the list in order to retrieve the detail record?
Scenario 3: what's the best approach for handling a scenario where you have different subsets of data from the entire list.  Perhaps you need to see a list of items that are 'pending' and another list of items that have been created this week, etc.  It seems very inefficient to download all records into the store as the master list then simply filter out the ones needed for different views.  I've read tutorials where you have the master list in store then simply have Ids in another part of the store that make up the different slices.  This seems very heavy and a duplication of the database onto the client.  What is the best approach for having filtered lists within a store?
Thanks for your help and insight.
Comment: "I'm assuming the decision point here is if the list contains all of the data needed for the details page?" what did you decide? Did you have 1 store or 2 stores (one for the list and one for the detail view)?
Answer: Scenario 1: You're spot on!
Scenario 2: It depends.

you can store the data in localStorage for example
the list has to be fetched via the backend API

Scenario 3: keeping your state normalized is key here (you'll work with IDs). Also we don't have to load all entities at once, this can be done partially. The redux docs has a performance section that you can read.


Create multiple users roles and views at the same time

Question: I'm using D7, I need to create views and user roles, when I'm using the interface mode, it takes me too much time, how can I do that using code? or could you please suggest to me a module to install, that can create, for example 10 roles at the same time, or cloning a view 5 times at the same time.
Answer: If you set up Drush, which is is a command line shell and Unix scripting interface for Drupal, then you can create a role with the command:
drush role-create
This command accepts and requires 2 arguments, the first one defines the machine name of the role and the second one the human readable name. For example:
drush role-create 'my_new_role' 'My New Role'
Would create the role 'My New Role' with a machine name 'my_new_role'
Drush can also be used to quickly create views. Due to the variety of possible setups depending on your use case, it is probably best to start by looking at the documentation on https://drushcommands.com
Answer: The best way to programmatically create roles (and ideally set permissions for those roles), as well as create a view via code would be to use the features module. Views can be exported to an array of settings which can then be added with a feature.


Unresolved overloaded function type when attempting to pass a function as an argument

Question: I receive the following error when attempting to compile a lone C++ testing file under G++ with C++11 in place.
spike/cur_spike.cpp: In function 'int main()':
spike/cur_spike.cpp:60:44: error: no matching function for call to 'callFunctionFromName(<unresolved overloaded function type>, std::__cxx11::string&)'
     callFunctionFromName (outputLine, param);
                                            ^
spike/cur_spike.cpp:49:7: note: candidate: template<class funcT, class ... Args> funcT callFunctionFromName(funcT (*)(Args ...), Args ...)
 funcT callFunctionFromName (funcT func(Args...), Args... args) {
       ^
spike/cur_spike.cpp:49:7: note:   template argument deduction/substitution failed:
spike/cur_spike.cpp:60:44: note:   couldn't deduce template parameter 'funcT'
     callFunctionFromName (outputLine, param);
                                            ^

Here's the code.
#include <iostream>
#include <string>

template <typename T>
void outputLine (T text) {
    std::cout << text << std::endl;
}

template <typename funcT>
funcT callFunctionFromName (funcT func()) {
    return func ();
}
template <typename funcT, typename... Args>
funcT callFunctionFromName (funcT func(Args...), Args... args) {
    return func (args...);
}

int main () {
    std::string param = "Testing...";
    callFunctionFromName (outputLine, param);

    return 0;
}

I'm currently building this on a Linux system using G++, this code snippet contains all code related to this issue. I'm particularly intrigued about the fact that the compiler is unable to deduce the template parameter funcT for some reason, even though the outputLine function has a clear return type of void.
Setting a pointer of outputLine using void (*outputLinePtr)(std::string) = outputLine and using the pointer as the argument instead does nothing. Any help would be much appreciated.
Answer: You can manually set template argument.
callFunctionFromName (outputLine<std::string>, param);

Comment: Well, uh, that worked. I have no idea why though. May you give me a link or some reference I can read concerning this `<>` syntax? I'm new to C++ so sorry for the seemingly ignorant question. Thank you!
Comment: @Wintro it's just explicit instantiation of function. You tell compiler, that you want use `outputLine` for type `std::string`.
Comment: Aha, alright thank you. Is there no way though to make it stay generic, i.e. if I wanted to pass in a value to `outputLine` through the `callFunctionFromName` that I did not know it's type until the moment of passing?
Comment: @Wintro compiler doesn't know what function is outputLine, it's just ``. Why you cannot manually specify function type in call site?
Comment: Oh, so the compiler cannot figure out what the function is exactly unless I specify which overload I want? I get it now. Thank you. I can specify the type, but I was asking just as a general question.
Comment: @Wintro not exactly. Compiler cannot choose what the function you want, if it's template function (or overloaded function) and you send this function to another template function.


How does a natural change flats and sharps?

Question: If we have a G flat a natural gives a G, if we have a G sharp it gives a G, but what if we have a G double flat or double sharp? Especially if we are working in a key where G is already a flat or a sharp.
Comment: Oh, a бекар is a natural! Please edit your question to use English names, as a Google search does not find _becar_ written in the Latin alphabet. I was lucky to guess that it was Russian and ran it through a translator.
Comment: What is a becar?
Comment: ♮ unicode symbol could be most international way to do it
Comment: To answer a question adjacent to yours: If you have a Gbb and want the next note to be a Gb, just put a single flat sign next to the next note.
Comment: A double natural doesn't make any sense. One natural cancels out all other accidentals, including double sharps and double flats. One natural is the same as an infinite natural.
Comment: Can there be a double natural?
Answer: A natural sign always completely cancels any accidental that may be or have been on a note, and the note is played natural.
A G natural that comes after a G# is played as a G natural. A G natural following a G double sharp (Gx) is also played as a G natural.
Note that all the accidental symbols are treated the same way: they are absolute. A G# written after a previous G# is not played as a Gx, it's just played as a G#.
Comment: @SovereignSun Sorry, no. A natural sign *also* cancels out the key signature. If you see a natural sign, you **always** play the completely **natural** note. Again, if a note has no accidental at all (a natural is an accidental) the you go back to the key signature or any previous accidental in the measure, if there is one. As soon as you put any accidental on, it immediately cancels out **any** prior accidentals and you play exactly the note written.
Comment: @SovereignSun No. One would never write Gxb. That doesn't make sense. If you want a musician to play G#, write G#. No matter what notes come before a note written G#, if it's written G#, it should be played G#. The **only** time the note we play is based on a previous accidental is when there is *no accidental on the note*. If there's no accidental at all, then we go with the previous accidental within the measure or the key signature. As soon as you put any accidental on a note, that accidental overrides **everything** from before it.
Comment: @SovereignSun Do you have any kind of teacher? This is a bit complicated to try to explain over the internet. All accidentals only last as long as the bar they are in. Once the bar ends, any further notes should be played as specified in the key signature, unless there are new accidentals in the next bar.
Comment: @SovereignSun - Yes, the NEXT barline, exactly as I said. ANY accidental in the previous barline is cancelled by that barline after it. Unequivocal. You nee the same note (accidental) again - you must write it in again. I respectfully suggest, judging by a lot of your questions here, that, if a teacher is unavailable, you furnish yourself with some ABRSM theory books, probably among the best for simple explanations. Grades I-V will help enormously. Then - please ask away, but you'll be asking with a lot more substance behind you, so answers will make more sense to you.
Comment: No, a natural makes a changed note into a note of simple letter name. So a former Gx,Gbb,G#Gb will be played as G natural when there's a natural before it. Even if there's a G# in the key sig. Also remember the next barline reverts ANY accidental to the key sig - which is different, maybe.
Comment: @SovereignSun It's complex everywhere, that's why teachers can charge as much as they do. You should definitely spend time playing pieces that have hardly any accidentals and fairly simple key signatures so you get the feel for how it works. With the more simple pieces, you will usually hear it if it sounds wrong.
Comment: @SovereignSun Uh.. let's leave time signatures out of this. They have nothing to do with key signatures. Yes, when a new bar begins, everything goes back to the key signature.
Comment: It's fairly clear that @SovereignSun is a beginner and talking about the current "standard" of musical notation, but just for completeness, some of his/her "mistakes" about the meaning of accidentals actually *were* "standard notation" in the 16th and 17th centuries, and that fact has caused quite a bit of confusion trying to interpret some old manuscripts and music text books.
Comment: What if we double sharp a G and it becomes an A and then we want to play G# (Ab) do we place a flat after Gx?
Comment: So a natural basically reverts a note to the original key signature note?
Comment: @Tim Any bar line does it? The first occurrence?
Comment: @ToddWilcox No. I'm trying to learn everything myself. Teachers are rather expensive. I have books but It's always so complex there!
Comment: @ToddWilcox So if we have a 4/4 bar and we place an accidental anywhere in that bar once a new bar of any other time signature starts the accidentals are all reverted to either the original key signature or a new one should it be defined?
Comment: @ToddWilcox I'm more of a composer rather than a player. I write my own music in Guitar Pro. Anyway I got your point. Am not silly learn quickly!
Comment: Please update answer according to new comments.
Comment: @alephzero I Wouldn't say that I'm a beginner it's just that I never stumbled upon this before. I've been learning theory for many years with very little time for that but I don't learn it A-Z instead if I stumble upon something I look it up and read and ask about it. Most of what I recently stumble upon is really not much of a practical think as for I don't play so much really.
Answer: This paragraph in the Lilypond (notation software) docs might be relevant:

In accordance with traditional typesetting rules, a natural sign is
  printed before a sharp or flat if a previous double sharp or flat on
  the same note is canceled. (To change this behavior to contemporary
  practice, set the extraNatural property to f in the Staff context.)

(the first measure corresponds to the "traditional" behaviour, the second to the "contemporary" - the played notes in both measures are the same, and they don't depend on the key)
This implies that:

To turn a double flat into a single flat (regardless of the key) the traditional practice is to use a natural-flat pair.
Alternatively (and more contemporarily), the natural can be ommited: a single flat is enough.
A single natural sign always produces the natural note (regardless of previous accidentals or key)
Comment: @supercat I would say that a single flat is more readable, but I guess not everyone agrees
Comment: Incidentally, without the context, I would read "contemporary practice" as meaning "the practice at the time the music was written" rather than "modern practice".
Comment: In many printing fields there's a tendency to minimize "redundant" information without regard for whether it might make things more readable.  Is there any real advantage to the second approach above (using a single flat to cancel a double flat) besides saving ink?
Comment: Excellent point! This old/modern method also applies to key signatures.
Answer: Remember your order of flats/sharps and that a flat or sharp is a "half tone" step.
The order for flats is
B E A D G C F
Sharps are backwards
F C G D A E B
Among other things this can be used as a guide of rarity. Under normal circumstances, to have a B# sound good, you need to also be playing F#, C#, G#, D#, A#, and E#.
Now when applied to say a Piano, there is no B# key. Half a "step" up from a B is a C. So to play a B# you would just play a C.
Now back to your question, it's rare but not unheard of to have a "double" accidental on pieces that are transposed poorly, or as a way of shoving more voices in the same staff.
So an F## would be played as  G (F + two half steps up).
I have never seen this in a well transposed piece. (Cramming more voices on a staff, or using F## instead of a G)
What is more Common is something like a A♭ major scale. B, E, and A are flat (order of flats)
So you get something, special in beginner pieces like
B♭, C, D, E♭, F, G, A♭, B♭
If written as

These are not double flats, there just reminders to play flats.

Also in the second measure these are not double flats.

Here in this example we have double flats.
C♭♭ is really a B♭ while the B♭♭ is really a A natural
C down half is a B down half is a B flat
B down half is a B♭ down half is a A natural
Lastly, I have seen, though rare, writing like this.

These two measures sound the same, but the first, is in some opinions easier to read. Keep in mind the second double flat isn't needed, I just included it for demo purposes.
Normally when people write music in this style (example 3) it's due to a beleife that all As in a A flat major piece should be flat, but the music calls for a an A natural. i.e. It's a writing style, not a totally new note. This is fairly common. Even more so in keys that have many flats, but music that needs a "lesser" (more common) flat to be played neutral.
A more contrived example would be something like

In the last measure, notes 3,4, 7, and 8 are all natural, while, 1 is flat because of the key signature, and note 5 had to have the flat reapplied to cancel out the natural from note 3.
All accidentals apply to the rest of the measure unless otherwise changed. So if we take out the naturals, You would play A♭, G, G, G, A♭, G, A♭, A♭.
Comment: Double sharps arise from chromatically raising notes that are already "sharp", e.g. Fx is F# chromatically raised. Likewise double flats. They are correct spellings in some contexts; they do not necessarily arise from transposing poorly. If a composer wanted to shove two voices onto a stave, that would not excuse spelling notes wrongly -- some sheet music contains wrong spellings, but IME never merely in order to have two voices on one stave.
Comment: Taking into account you last image: It's Ab, A, Ab, A and the second measure is also Ab, A, Ab, A because of the naturals and the 3rd 4th flat note is just a reminder?
Comment: Yep, exactly. 1 2
Comment: https://musescore.com/user/5379876/scores/3242531  You can hear it here.
Comment: This answer is better than mine. I was thinking of editing in examples but you've already done it. Well done coming into Music.SE and posting so much great content.
Comment: I did not mean that they come only form poor transposing. I mean that I have seen, though very rarely, poor transposing result in them. And that it's far more common that they result from a writing style (but are still correct).
Answer: The raising and lowering by half step for sharps and flats applies only when relative to a natural tone. So, if you started with a G♮ and then added a sharp G♯, the change is a half step ascent.
That is just a basic definition. It is especially applicable when first explaining the staff pitch letters and key signatures.
When you get into double sharps/flats we find out that accidentals are literal. You don't add/subtract by half steps with accumulated accidentals. Also, I don't think "cancel" is quite the right word, because that implies canceling to go back to a previous value. You just take the pitch letter from the staff and apply the accidental regardless of anything else around the note.

In those examples...

the accidentals apply regardless of the key signature
the accidentals apply regardless of preceding accidentals
the two blue notes (notes on beat two) are G natural and G sharp
enharmonically the first bar is a descent of two half steps (the natural sign did not merely lower by one half step)
enharmonically the second bar is an ascent of three half steps (the sharp sign did not merely raise by one half step)

Don't accumulate, or add/subtract, half steps.
Just play literally what the note says: the pitch letter and its accidental.


Question on definition of series of modules.

Question:
My professor gave the above definition for a series of modules.
I have a few questions:
1) He defined $n$ to be the length of the series. But then he proceeds to say that $n$ equals the number of factors. However, given that he has not imposed any conditions on the submodules apart from the fact that they are subsets, its possible that some of the factors could be the same. Does that mean that $n$ includes multiplicities i.e. same factors or possibly isomorphic factors i.e the factors are different based solely on the indices of the submodules.
($\frac{M_{i+1}}{M_i}=\frac{M_{j+1}}{M_j} j\neq i$ even though both factors could be same isomorphically i.e. $0$ quotient modules.)
2) My second question relates to the first. His definition of equivalence includes a bijection between the sets of factors. Hence, in a set of factors are the factors distinguished solely on the indices of the submodules as described above or are multiplicities not allowed.
Answer: First, often we consider the factors as a sequence $\frac{M_1}{M_0},\frac{M_2}{M_1},\ldots,\frac{M_n}{M_{n-1}}$ rather than a set, which completely bypasses the possible problem of multiplicities.  In this context, an equivalence of two series is given by a permutation of $\{1,2,\ldots,n\}$ such that the permuted factor sequence is isomorphic, element-wise, with the other factor sequence.
Not much is lost if we consider them as sets, though, since the only time we have true duplicates is when $M_{i-1} = M_i = M_{i+1}$.  When we talk about the set of factors modulo isomorphism, however, yes, we need to count multiplicities.


PLU (LUP) decomposition failed with zeros on main diagonal

Question: I am trying to write PLU (LUP) decomposition using Gaussian elimination. I found this article with this algorithm:
def plu(A):

    #Get the number of rows
    n = A.shape[0]

    #Allocate space for P, L, and U
    U = A.copy()
    L = np.eye(n, dtype=np.double)
    P = np.eye(n, dtype=np.double)

    #Loop over rows
    for i in range(n):

        #Permute rows if needed
        for k in range(i, n):
            if ~np.isclose(U[i, i], 0.0):
                break
            U[[k, k+1]] = U[[k+1, k]]
            P[[k, k+1]] = P[[k+1, k]]

        #Eliminate entries below i with row
        #operations on U and #reverse the row
        #operations to manipulate L
        factor = U[i+1:, i] / U[i, i]
        L[i+1:, i] = factor
        U[i+1:] -= factor[:, np.newaxis] * U[i]

    return P, L, U

With normal matrix it's running well but when on main diagonal appears 0 it breaks. For example with this matrix:
[[1,  0,  26, 10],
 [60, 0,  75, 50],
 [45, 90, 31, 100],
 [30, 45, 10, 0]]

P
[[1. 0. 0. 0.]
 [0. 0. 1. 0.]
 [0. 1. 0. 0.]
 [0. 0. 0. 1.]]
L
[[ 1.  0.   0.          0.]
 [60.  1.   0.          0.]
 [45.  0.   1.          0.]
 [30.  0.5  0.13501684  1.]]
U
[[1.  0.   26.     10.        ]
 [0.  90.  -1139.  -350.        ]
 [0.  0.   -1485.  -550.        ]
 [0.  0.   0.      -50.74074074]]

Multiplication of PLU will not give the original matrix.
So I tried to fix the algorithm: when rows swapping they are swapping only in P and U, so I add L[[k, k + 1]] = L[[k + 1, k]] in the inner loop to swap it in the L too. Also I changed the initialization of L: in the start I fill L with zeros L = np.zeros_like(A) and add identity matrix in the end L += np.eye(n, dtype=np.double).
But fixed version of algorithm give wrong result when top left element is 0. Any ideas what I'm doing wrong?
Comment: I would go with Numerical Recipes instead of a Wikipedia article: http://www.it.uom.gr/teaching/linearalgebra/NumericalRecipiesInC/c2-3.pdf
Answer: I think I fix it.
def get_plu_decomposition(A):
    n = A.shape[0]
    U = csr_matrix(A.copy())
    L = csr_matrix(np.zeros_like(A))
    P = csr_matrix(np.eye(n, dtype=np.double))

    for i in range(n - 1):
        index = np.argmax(abs(U[i:, i]))
        if not U[i:, i][index] != 0:
            continue
        index += i
        if index != i:
            U[[index, i]] = U[[i, index]]
            P[[index, i]] = P[[i, index]]
            L[[index, i]] = L[[i, index]]
        factor = U[i + 1:, i] / U[i, i]
        L[i + 1:, i] = factor
        U[i + 1:] -= factor * U[i]

    L += csr_matrix(np.eye(n, dtype=np.double))
    P = P.transpose()

    assert (np.allclose(A, (P@L@U).toarray()))

    return P, L, U

The problem was in swapping rows and transposing P matrix


Aligning radio tag to the image next to it

Question: I want to align my radio tags to the image next to it.
The image is width="260" height="88" and the tag are contained in a table
I tried this but it did not have an affect:
form input[type="radio"]{
    vertical-align: middle;
    margin-right: 10px;

}

This is the table:

            <input type="radio" value="">

Answer: You need to add vertical-align: middle to the image as well. Moreover, since you don't have the <form> tag wrapping the radio button, you only need input[type="radio"] to apply styles to the radio button using CSS.

input[type="radio"] {
    vertical-align: middle;
    margin-right: 10px;
    margin-top: 0px;

}

#image {
    vertical-align: middle;
}

            <input type="radio" value="">