Not sure if this is something I am not understanding about WPF or about Catel, but I have a treeview with 3 datatemplates for different node types.  2 of the node types can be bound to a delete button.  The binding of the button command binds to the viewmodel of the parent control (rather than to the node itself) and a command parameter of the node where the button was clicked is passed.  I am providing a small snippet of one of the data templates (the whole thing is too large to enter here):  &lt;Grid Margin="10" x:Name="CriteriaGrid"&gt;    &lt;TreeView ItemsSource="{Binding Criteria}" &gt;      &lt;DataTemplate DataType="{x:Type self:Leaf}"&gt;          &lt;Button Command="{Binding Source={x:Reference CriteriaGrid}, Path=DataContext.DeleteLeaf}"                   CommandParameter="{Binding}"&gt;X&lt;/Button&gt;       &lt;/DataTemplate&gt;    &lt;/TreeView&gt; &lt;/Grid&gt;   ViewModel (again just a small extract):  public class ManageCriteriaViewModel : ViewModelBase {     public ManageCriteriaViewModel()     {         DeleteLeaf = new Command&lt;Leaf&gt;(OnDeleteLeaf, CanDeleteLeaf);     }      private bool CanDeleteLeaf(Leaf leafNode)     {         return (leafNode?.Parent as Group) != null;     }      private void OnDeleteLeaf(Leaf leafNode)     {         // Some code     }      public Command&lt;Leaf&gt; DeleteLeaf { get; private set; } }   The problem is that when the Tree is initially being constructed, the command parameter is always null, and my CanExecute test returns false if the parameter is null.  So when my tree initially displays, all my buttons are disabled.  However, if I click any of the buttons, all of them get re-evaluated and become enabled because now the command parameter is being passed correctly.  I have tried adding:  protected override Task InitializeAsync() {     CommandManager.InvalidateRequerySuggested();     ViewModelCommandManager.InvalidateCommands(true);     return base.InitializeAsync(); }   In an attempt to re-evaluate all the commands after the UI is loaded but this does not seem to work.  What am I missing here?
I have run into an issue with WPF and Commands that are bound to a Button inside the DataTemplate of an ItemsControl. The scenario is quite straight forward. The ItemsControl is bound to a list of objects, and I want to be able to remove each object in the list by clicking a Button. The Button executes a Command, and the Command takes care of the deletion. The CommandParameter is bound to the Object I want to delete. That way I know what the user clicked. A user should only be able to delete their "own" objects - so I need to do some checks in the "CanExecute" call of the Command to verify that the user has the right permissions.  The problem is that the parameter passed to CanExecute is NULL the first time it's called - so I can't run the logic to enable/disable the command. However, if I make it allways enabled, and then click the button to execute the command, the CommandParameter is passed in correctly. So that means that the binding against the CommandParameter is working.  The XAML for the ItemsControl and the DataTemplate looks like this:  &lt;ItemsControl      x:Name="commentsList"     ItemsSource="{Binding Path=SharedDataItemPM.Comments}"     Width="Auto" Height="Auto"&gt;     &lt;ItemsControl.ItemTemplate&gt;         &lt;DataTemplate&gt;             &lt;StackPanel Orientation="Horizontal"&gt;                 &lt;Button                                                  Content="Delete"                     FontSize="10"                     Command="{Binding Path=DataContext.DeleteCommentCommand, ElementName=commentsList}"                      CommandParameter="{Binding}" /&gt;             &lt;/StackPanel&gt;                                 &lt;/DataTemplate&gt;     &lt;/ItemsControl.ItemTemplate&gt; &lt;/ItemsControl&gt;   So as you can see I have a list of Comments objects. I want the CommandParameter of the DeleteCommentCommand to be bound to the Command object.  So I guess my question is: have anyone experienced this problem before? CanExecute gets called on my Command, but the parameter is always NULL the first time - why is that?  Update: I was able to narrow the problem down a little. I added an empty Debug ValueConverter so that I could output a message when the CommandParameter is data bound. Turns out the problem is that the CanExecute method is executed before the CommandParameter is bound to the button. I have tried to set the CommandParameter before the Command (like suggested) - but it still doesn't work. Any tips on how to control it.  Update2: Is there any way to detect when the binding is "done", so that I can force re-evaluation of the command? Also - is it a problem that I have multiple Buttons (one for each item in the ItemsControl) that bind to the same instance of a Command-object?  Update3: I have uploaded a reproduction of the bug to my SkyDrive:
iOS navigation bar item image size A complete picture of the lattice of subfields for a cyclotomic extension over $\mathbb{Q}$. Is there a good general purpose algorithm (batch of theorems) allowing one to determine the intermediate fields between $\mathbb{Q}(\zeta)$ and $\mathbb{Q}$, where $\zeta$ is some primitive root of unity?  Let $p$ be a prime. Consider the case where $\zeta=\zeta_{p}$ is a primitive $p$-th root of unity. Then the Galois extension is cyclic of order $p-1$ and $1,\zeta,\dots,\zeta^{p-1}$ is a $\mathbb{Q}$-basis for the extension. In this case for any subgroup $H$ of $G=\mathbb{Z}/(p-1)$, by considering the sum $$\alpha_H=\sum_{\sigma\in H}\sigma\zeta,$$ we can observe that $\alpha_H$ lies in the fixed field for $H$, and any automorphism $\tau$ not in $H$ (note automorphisms are identified with subgroups of $\mathbb{Z}/(p-1)$ in the natural way), $\tau$ does not fix $\alpha_H$. Therefore we can conclude that $\mathbb{Q}(\alpha_H)$ is the fixed field of $H$.  In this way we can get all of the intermediate fields of $\zeta_p$ for all odd primes $p$.  We also have a theorem that says if we have $n=p^sq^t$, then $$\text{Gal}(\mathbb{Q}(\zeta_n)/\mathbb{Q})\simeq \text{Gal}(\mathbb{Q}(\zeta_{p^s})/\mathbb{Q})\times\text{Gal}(\mathbb{Q}(\zeta_{q^t})/\mathbb{Q}).$$  So what I have yet to understand is  How can one generally find the intermediate fields between $\mathbb{Q}(\zeta_{p^s})$ and $\mathbb{Q}$ for $s\ge 1$? I would like to also understand the case where $p=2, s&gt;1$ though this might turn out to be a separate case.  EDIT: Even the case $n=pq$ is a little murky to me. Even given the isomorphism given by the Chinese Remainder Theorem I don't see a priori how to get all the "product" subfields. My idea is that you can consider the separate subfields under $\text{Gal}(\mathbb{Q}(\zeta_{p})/\mathbb{Q})$ and $\text{Gal}(\mathbb{Q}(\zeta_{q})/\mathbb{Q})$ separately and then consider the pairwise product of the generators of various subfields to see if you get anything new, but my idea is too inchoate. $\|u\|\leq \|u+av\| \Longrightarrow \langle u,v\rangle=0$ Prove that $\langle u,v\rangle=0\Longleftrightarrow \|u\|\leq \|u+av\|$.  So far I can get the $\Longrightarrow$ very easily, but I need some help with the $\Longleftarrow$ implication, any hints would be greatly appreciated.  Please no answers, I just want a small nudge to get me in the right direction, I've been stumped on this for a little bit.  Here's what I have so far:  ($\Longleftarrow$)  Assume $\|u\| \leq \|u+av\|$  $\|u+av\|^2=\langle u+av,u+av\rangle=\langle u,u\rangle+ \langle u,av\rangle+\langle av,u\rangle+\langle v,v\rangle=\|u\|^2+\bar{a} \langle u,v\rangle+a\langle v,u\rangle+\|v\|^2=\|u\|^2+ \bar{a}\bar{\langle v,u\rangle}+a\langle v,u\rangle+\|v\|^2$  Thoughts/ideas? Why was the plan for the Purple Wedding so complicated? Spoilers for A Storm of Swords / Season 4 episode 2 "The Lion and the Rose".  At the Purple Wedding,      Littlefinger and Lady Olenna Tyrell   perform their plan of      poisoning King Joffrey.   A short summary of their plan:  Littlefinger orders Ser Dontos Hollard to give Sansa Stark a beautiful silver hairnet adorned with amethysts. At least some of the amethysts are actually strangler crystals in disguise. Ser Dontos also, still under orders of Littlefinger, urges Sansa to wear the hairnet at the wedding, which she then does. At the wedding, when Lady Olenna greets Sansa, she fusses her hairnet a bit, while secretly taking one of the strangler crystals. Later, during the wedding, Lady Olenna puts the crystal in Joffrey's royal cup, poisoning him.  But why was their plan so complicated? Why couldn't Lady Olenna just bring a strangler crystal with her to the wedding (as suggested in )?  Then they wouldn't depend on Ser Dontos and Sansa who could unknowingly have done something to prevent the success of the plan.  The only reason that I could think of, is Littlefinger and Lady Olenna plan for Sansa (and Tyrion as her husband with her) to take the blame for Joffrey's death.  They put the crystals on her person, so that upon examination it would clearly show that Sansa had the murder weapon on her. But Littlefinger had a plan he did not tell Lady Olenna, namely rescuing Sansa during the chaos ensuing the murder (and thereby leaving Tyrion behind as the only accused).  Is there anything confirming or debunking this theory? If my theory doesn't hold up, is there another explanation for why the plan was so needlessly complicated? Are any fictional worlds available in some GIS format? Is there any fictional world (e.g. ,  etc.) which could be used in a GIS context?  For example, an MBTiles archive and a shapefile or any other format usable with OpenLayers / Polymaps / Leaflet? Lie Algebra of U(N) and SO(N) U(N) and SO(N) are quite important groups in physics. I thought I would find this with an easy google search. Apparently NOT! What is the Lie algebra and Lie bracket of the two groups? What are the units of entropy of a normal distribution? I have a random process that follows a normal distribution. It's parameters are mean = 35 units, std.dev. = 8 units. I've seen from the  for the normal distribution that there is a formula to calculate the entropy. So plugging in the figures as:- $$     .5\log\left(2\pi e^1 8\cdot 8\right) $$ I get a value of 1.52, which I take to be  per sample.  My question is what are these units?  What thing do I have 1.52 of?    is (typically) measured in units of bits, after Claude Shannon's definition.  So can I take it that each sample generates 1.52 bits of entropy?  Clearly recording those samples generates information and therefore occupies a real and discrete amount of storage space. Ergo entropy cannot be unit less. How to flatten a non-planar face to a targeted plane? Let's take a non-planar quad here for a simple example, how to only move one vertex on it, to finally make it planar while keeping the other three vertices still? Sci-Fi book female fighter pilot All I remember about the book is that the protagonist was a human female fighter pilot, she has short hair, not sure if it was blond or auburn and she was involved in making peace with the alien race.  The alien race was invading Earth, but because of her they stopped, surrendered and because of her helped Earth improve its technology. I remember that she melded with something and was starting to sort of think like them and lose a bit of her humanity.  It was set in the not too distant future. I believe I read it in the 90s. I would have expected the correlation coefficient to be the same as a regression slope (beta), however having just compared the two, they are different. How do they differ - what different information do they give? Identifying a thin, black, worm-like creature with a hammer-shaped head I came across the creature shown in the photo below yesterday evening while walking the dogs. At first, I thought it was an earthworm, but a flashlight revealed it to be something I had never seen before.    It is approximately 12 inches (300 mm) in length and about 1/3 of an inch (10 mm) in diameter at its maximum. It is pitch black and very shiny—like piano black. It moves very slowly, using a snake-like motion. It had a very strange head, like a hammerhead shark.  I live in Durban, South Africa, if that helps to narrow down the possibilities.  Can anyone help in identifying this creature? How can I set the location (as it's picked up in CoreLocation services) in the iPhone Simulator? Im asked to prove that a polynomial of an odd degree has a root. Im going to use IVT to prove this, but I'm wondering if I can use the assumption that an odd degree polynomial has either two cases:  $$ \lim_{x\to\infty}h(x)=+\infty \\ \lim_{x\to-\infty}h(x)=-\infty \\ $$ $$and$$ $$ \lim_{x\to\infty}h(x)=-\infty \\ \lim_{x\to-\infty}h(x)=+\infty \\ $$ Then by this there exists numbers $a,b$ such that $$ h(a)&lt;0&lt;h(b) $$ $$or$$ $$ h(b)&lt;0&lt;h(a) $$ Which I think would prove that odd degreed $h(x)$ has at least a root. Or is there a more convincing way to show that there are numbers in $h(X)$ greater than zero and less than zero?  edit: (sorry about the bad limit notation) I was wondering if there is any way to escape a CDATA end token (]]&gt;) within a CDATA section in an xml document. Or, more generally, if there is some escape sequence for using within a CDATA (but if it exists, I guess it'd probably only make sense to escape begin or end tokens, anyway).   Basically, can you have a begin or end token embedded in a CDATA and tell the parser not to interpret it but to treat it as just another character sequence.  Probably, you should just refactor your xml structure or your code if you find yourself trying to do that, but even though I've been working with xml on a daily basis for the last 3 years or so and I have never had this problem, I was wondering if it was possible. Just out of curiosity.  Edit:  Other than using html encoding... SF novel -- the only human on a space station full of aliens Some things I remember:   Pretty sure the author was female The novel had won some award or other The title was one word (I think) and it started with "I" (I think) It would have come out in the mid to late 90s or early 2000s It was a paperback or trade paperback, in English.  The book was originally written in English as far as I know. The cover, if I remember correctly, had an orangish background.   The plot involved a sole human representative to what was effectively an alien "United Nations" type of organization.  There were myriad types of aliens, many of whom were completely biologically incompatible.  Even the ones that could live in the same conditions generally found each other either repugnant or incomprehensible.  The main character ended up feeling incredibly lonely and was "set up" with a superficially similar humanoid female, but found their pheromones were incompatible and it was still difficult to communicate. How is every subset of the set of reals with the finite complement topology compact? While we know that every finite set is compact, how to prove that every infinite subset of $\mathbf{R}$, the set of all real numbers, is also compact in the finite-complement topology (also called the co-finite topology)?   What is the situation in the case of an arbitrary infinite set $X$ with the finite-complement topology? When I click on 'Business Data Connectivity Services' link on 'Manage Service Application' page of Central Administration, I get the following error : "The load balancer is not provisioned. Verify the load balancer was provisioned successfully before retrieving endpoint addresses. " I got a solution from  link, but as per instruction I am unable to install the hotfix for SharePoint 2013. Is there any solution available for this problem? Thanks in advance Proving there is a sequence convergent to a limit point of a set without axiom of countable choice? Often, we use a construction like this: Given a subset $ A $ of a metric space and its limit point $ a $, we know that for every $ \epsilon &gt; 0 $ there is another point $ x $  different from $ a $ such that $ d(x,a) &lt; \epsilon $. So for every natural $ n $ we let $ a_n $ be such a point within $ 1/n $ of $ a $, which gives us a sequence convergent to $ a $.  My question is, is the axiom of countable choice needed for this construction, or is it formally correct just in ZF? If a normal subgroup $N$ of order $p$($p$ prime) is contained in a group $G$ of order $p^n$,then $N$ is in the center of $G$. If a normal subgroup $N$ of order $p$($p$ prime) is contained in a group $G$ of order $p^n$,then $N$ is in the center of $G$.   I want to use induction to prove this:  It is trivial when $G=p(n=1)$, assume $G=p^n$, $N$ is a normal subgroup in $G$ with order $p$. Since $G$ is p-subgroup, $G$ has a normal subgroup $H$ with order $p^{n-1}$,according to assumption, $N \subset C(H)$. But I don't know how to go on, is $C(H)=C(G)$?Can induction work in this case? Modernist Cuisine recommends that for longer sous vide cooking (times greater than 36 hours) that bags are vacuum sealed rather than just using the water displacement method to remove the air from a ziploc bag.  What is the reason for this? Will I be losing something essential if I just use a regular ziploc bag without vacuum sealing?