How can I retrieve my bitcoins when the client crashes as soon as it begins synchronizing

Question: As soon as the client begins synchronizing it crashes. It's stuck at 139,500 blocks left. I am brand new to bitcoin and sent $300 to an address on this client.
Comment: Can you give more details?

Try running the client from the command line.  Does it report any errors?
Answer: The quickest way is probably to import the private key of the address to which you sent the bitcoins into blockchain.info's web wallet service.

obtain the private key for the address which holds your bitcoins
visit https://blockchain.info/wallet/
click 'start a new wallet' in the top left
type a password twice, solve the captcha, and click 'continue'
copy/paste the long url (https://blockchain.info/wallet/random-stuff-...) and keep it safe
visit the url you just copied, and log in using the password you just chose
click the import/export tab, then click 'continue'
paste your private key into the 'import private key' box and click 'add private key'
now you should see your balance, and can spend it from the blockchain.info web wallet

Alternatively, if you want to keep using the satoshi client, you might find it useful to download a recent snapshot of the blockchain and let it update from there.


Need help identifying insects in home, Morgan Hill CA

Question: The creature in the attached photos just started appearing in small numbers in various locations inside my home. Would like to positively identify.
Comment: Yeah, I think you've got it. Lots of farmland around here, and it has been very hot lately (like everywhere else).
Answer: This is a true bug (Heteroptera), likely a nymph of the family Rhyparochromidae. Until recently, this family was part of the Lygaeidea ("seed bugs"). As their colloquial name reveals, they (mostly) feed on seeds (one exception would be the predatory Geocoridae).
Distinctive characteristics of (almost) all true bugs which are visible on the photos, are the rostrum and the scent glands (which are located dorsally in nymphs and abdominally in adults). The position of the scent glands, thus, indicates that it must be a larvae. Another indication is that its wings are still in pockets.
Determining true bug larvea to the species level is tricky and rarely done. But with some experience, it is possible to tell the families apart. Lygaeid bugs (and thus, also rhyparochromid bugs) are elongated with compact legs and antennas. Often, they have a pointed nose (a long head) and relatively large eyes. All charactericstics match with the specimen on the photo, which makes me think it must be a rhyparochromid bug.


cotangent complex of a trivial extension

Question: Let $k$ be a field of characteristic zero, $A$ a simplicial commutative k-algebra, and $M$ a simplicial $A$-module. Consider the trivial square-zero extension $A\oplus M$ as an $A$-algebra.
Is it true that the relative cotangent complex of $A\oplus M$ over $A$ (i.e the cotangent complex of the map $A \rightarrow A\oplus M$) is isomorphic to $M$ (say in the derived category of $A$-modules) ?
This might be easy but thanks anyway for any suggestion or reference.
Comment: Unless I'm mistaken, this already fails in the discrete case. Take A = k, and M = k. Then B := A + M is k[e]/(e^2), and the cotangent complex of B/A (computed using the transitivity triangle for k -> k[e] ->> B) is quasi-isomorphic to the 2-term complex given by multiplication by d(e^2) = 2e on B. In particular, it has two non-zero homology groups as a complex of k-vector spaces.
Comment: Thanks a lot Bhargav. I am such an idiot! I guess I was computing the case $A=k$ and any $M$, but I was computing the $H^0$ i.e. the Kahler differentials. Sorry about being so sloppy. By the way, do you have a guess for a general answer?
Comment: I think one possible general answer is that L_{B/A} (with B = A + M) has good connectivity properties if M does so. These issues were discussed in what used to be Lurie's DAG IV, and I suspect can also be found in his "Higher Algebra" book (but I did not look).
Answer: I think if we are in characteristic $0$  (i.e., $A\supset\mathbb Q$), and $M$ is flat, there is an explicit formula for the cotangent complex:
$$L_{A\to A\oplus M} = (\mathcal C_A(M[1])[-1] \otimes_A (A\oplus M), d) , $$
where $\mathcal C_A$ is the free (graded) Lie super-coalgebra over $A$ and $d$ is obtained by the natural map $\mathcal C_A(M[1])\to\mathcal C_A(M[1]) \otimes_A M[1]$ given by the Lie co-bracket.  (You can of course get rid of the "co-" by dualizing everything.)
If you restrict to $\operatorname{Spec}A\subset\operatorname{Spec}(A\oplus M)$, you get $\mathcal C_A(M[1])[-1]$ with zero differential.
This can be deduced from what's called "Koszul duality for operads" between commutative and Lie algebras.
(and if $M$ is not flat, you have to replace it with projective resoljtion and apply this formula, with a term added to $d$ coming from the differential in the resolution)


Cohomology of the Koszul-Tate complex for an irreducible symmetry vanishes in degree $-2$

Question: There must be something really obvious that I am missing here but any help is appreciated.
Suppose I have a theory with some action $S$ on some fields $\phi$ such that any function vanishing on-shell has the form $\frac{\partial S}{\partial\phi^i}F^i$ for some $F^i$ functions of the fields. Assume that an irreducible complete set of gauge symmetries of $S$ is given by the functions $R^i_a$ of the fields. Completeness means that if some functions $\lambda^i$ of the fields satisfy $\frac{\partial S}{\partial\phi^i}\lambda^i=0$, then $\lambda^i=R^i_a F^a+\frac{\partial S}{\partial\phi^j}F^{ij}$, for some functions $F^a$ and $F^{ij}=-F^{ji}$ of the fields. Irreducibility means that if a gauge transformation is trivial, that is, if we have functions $\lambda^a$ and $\mu^{ij}=-\mu^{ji}$ of the fields such that $R^i_a\lambda^a=\frac{\partial S}{\partial\phi^j}\mu^{ji}$, then there are functions $\nu^{ai}$ of the fields such that $\lambda^a=\frac{\partial S}{\partial \phi^j}\nu^{aj}$.
Accourding to Quantization of Gauge Systems of Henneaux and Teitelboim, the Koszul-Tate complex is defined by adding a bosonic antifield to a ghost $c^*_a$ and a fermionic antifield $\phi^*_i$, in degrees $-2$ and $-1$ respectively, along with a differential $\delta$, which is the degree $1$ vector field defined by
$$\delta\phi^i=0,\quad\delta\phi^*_i=\frac{\partial S}{\partial\phi^i},\quad\delta c^*_a=\phi^*_iR^i_a.$$
It is claimed that the cohomology in degree $-2$ should vanish. I don't see how this is the case.
A general closed element is of the form $c^*_aF^a+\frac{1}{2}\phi^*_i\phi^*_jF^{ij}$, for functions $F^a$ and $F^{ij}=-F^{ji}$ of the fields, satisfying
$$0=\delta\left(c^*_aF^a+\frac{1}{2}\phi^*_i\phi^*_jF^{ij}\right)=\phi^*_j\left(R^j_aF^a+\frac{\partial S}{\partial\phi^i}F^{ij}\right),$$
i.e., such that the gauge transformation $R^j_aF^a$ turns out to be trivial and, in fact, equal to $-\frac{\partial S}{\partial\phi^i}F^{ij}$. What we want to show is that every such element is exact. This means that it can be written in the form
$$\delta\left(\phi^*_iF^{ia}c^*_a+\frac{1}{6}\phi^*_i\phi^*_j\phi^*_kF^{ijk}\right)=\frac{\partial S}{\partial\phi^i}F^{ia}c^*_a-\phi^*_i\phi^*_jF^{ia}R^j_a+\frac{\partial S}{\partial\phi^i}\phi^*_j\phi^*_kF^{ijk},$$
for some functions $F^{ia}$ and $F^{ijk}$ (completely antisymmetric) of the fields. Equivalently, we want to find such functions for which
$$F^a=\frac{\partial S}{\partial \phi^i}F^{ai},\quad F^{ij}=F^{ja}R^i_a-F^{ia}R^j_a+2\frac{\partial S}{\partial\phi^k}F^{ijk}.$$
The existence of a function $F^{ai}$ satisfying the equation for $F^a$ is a direct consequence of irreducibility of the gauge transformations. However, I do not see how one can tune such a function to ensure that the second equation is also satisfied. Any help is much appreciated.

So, I thought I solved it. From the irreducibility of the gauge transformations there is an $M^{ai}$ such that $F^a=\frac{\partial S}{\partial \phi^i}M^{ai}$. Then we have
$$R^j_a\frac{\partial S}{\partial \phi^i}M^{ai}=-\frac{\partial S}{\partial\phi^i}F^{ij}.$$
Then completeness of the gauge transformations guarantees the existence of $N^{ij}$ and $T^{kij}=-T^{ikj}$ such that ($\star$)
$$R^j_aM^{ai}+F^{ij}=R^i_aN^{aj}+\frac{\partial S}{\partial \phi^k}T^{kij}.$$
Antisymmetrization with respect to $i$ and $j$ then yields
$$F^{ij}=F^{ja}R^i_a-F^{ia}R^j_a+2\frac{\partial S}{\partial\phi^k}F^{ijk},$$
with $F^{ia}=(N^{ia}+M^{ia})/2$ and $F^{ijk}=(T^{ijk}+T^{jik})/2$. The problem would then be solved if
$$\frac{\partial S}{\partial\phi^i}M^{ai}=F^a=\frac{\partial S}{\partial\phi^i}F^{ai}.$$
This would be true if
$$\frac{\partial S}{\partial\phi^i}N^{ai}=\frac{\partial S}{\partial\phi^i}M^{ai}.$$
However, I don't see why this should happen.
Answer: So, to complete the half solution in the answer one need only notice that multiplying the $\frac{\partial S}{\partial\phi^i}$ the expression for $F^{ij}$ in terms of $F^{ia}$ and $F^{ijk}$, one is left with
$$\frac{\partial S}{\partial\phi^i}F^{ij}=-\frac{\partial S}{\partial\phi^i}F^{ia}R^j_a.$$
However, recall that this trivial gauge transformation was precisely $-R^j_aF^a$. Therefore, we have
$$R^j_a\left(F^a-\frac{\partial S}{\partial\phi^i}F^{ia}\right)=0.$$
Then, linear independence of the gauge transfromations gives us
$$F^a=\frac{\partial S}{\partial\phi^i}F^{ia}$$


Solve $f(x) = \lambda \int\limits_{0}^1(\max(x,t)+xt)f(t)dt$

Question: I need to solve this: $\ f(x) = \lambda \int\limits_{0}^1(\max(x,t)+xt)f(t)dt$.
Rewriting it as: $\ f(x) = \lambda(\int\limits_0^x x(t+1)f(t)dt + \int\limits_x^1 t(x+1) f(t)dt)$.
1st derivative: \begin{align*} f'(x) &= \lambda\left(\int\limits_0^x (1+t)f(t)dt  + x(1+x)f(x) - xf(x) + \int\limits_x^1 tf(t)dt -  x^2f(x)\right)\\
&=\lambda\left(\int\limits_0^x f(t)dt + \int\limits_0^x tf(t)dt +  \int\limits_x^1 tf(t)dt\right)\\
&=\lambda\left(\int\limits_0^1 tf(t)dt + \int\limits_0^x f(t)dt\right)
\end{align*}
2nd derivative: $\ f''(x) = \lambda f(x)$
so $f(x) = c_1 e^{\sqrt{\lambda}x} + c_2 e^{-\sqrt{\lambda}x}$
How can I find $c_1$ and $c_2$?
Comment: Did you try substituting your answer back in to the original equation? It looks like $c_1$ and $c_2$ may be free parameters (assuming $0 \leq x \leq 1$).
Comment: No, they are not free.  In fact there are no nonzero solutions for all but one value of $\lambda$, and only a one-parameter family for that one.
Comment: @DavideGiraudo done.
Comment: @Robert can you explain?
Comment: Substitute the answer back into the original equation with $x=0$ and $x=1$ to solve for $c_1$ and $c_2$.
Answer: Your integral equation (IE, for short) is of the type:
$$\tag{1} (I-\lambda T) f =0$$
with $I$ the identity operator and $T$ given by:
$$Tf(x):= \int_0^1 \big( \max \{x,t\}+xt\big)\ f(t)\ \text{d} t\; ,$$
which is a bounded, compact linear operator on $C^0([0,1])$.
The Fredholm alternative applies to your IE, hence there are two possibilities: either A) (1) has only the trivial solution $f(t):=0$, or B) there exists a linear space of nontrivial solutions. In case A one says that $\lambda$ is a regular value for $T$; on the other hand, in case B one says that $\lambda$ is a singular value for $T$.
It is also known that the singular values of a compact operator form a sequence, say $\{\lambda_n\}_{n\in \mathbb{N}_0}$, such that $|\lambda_n|\to \infty$ and that $\{\lambda_n\}$ has no finite accumulation point.
Your computations show that any $C^0$ solution of (1) is actually of class $C^2$ and  solves the second order linear ODE $f^{\prime \prime} -\lambda f=0$; moreover, it is not hard to see that any solution of your IE satisfies also the Robin boundary conditions $f(0)-f^\prime (0)=0$, $f(1)-f^\prime (1)=0$ (to prove this, it suffices to plug $x=0,1$ into the IEs for $f$ and $f^\prime$); therefore each solution of (1) is also a solution of the BVP:
$$\tag{2} \begin{cases} f^{\prime \prime} (t)-\lambda f(t)=0 &\text{, in } ]0,1[ \\ f(0)-f^\prime (0)=0 \\ f(1)-f^\prime (1)=0 \end{cases}$$
which is an eigenvalue problem for the differential operator $\tfrac{\text{d}^2}{\text{d} t^2}$ under the given boundary conditions.
On the other hand, I think one could prove that the eigenvalue problem (2) is in fact equivalent to (1), in the sense that any $C^2$ solution of (2) is also a solution of (1) (in order to prove this, I bet some integration by parts and other elementary tricks have to be used).
Thus if you have to solve (1), then you have to look for the eigenvalues of (2).
To find the eigenvalues of (2) one has to distinguish three cases:

$\lambda >0$: in such a case one can plug $\lambda =\omega^2$ with $\omega >0$ into the ODE to get the general integral:
$$f(t):=A e^{\omega t} +B e^{-\omega t}\; ;$$
then either (2) has only the trivial solution, or $\lambda =\omega^2$ is an eigenvalue of (2): the latter eventuality occurs iff the homogeneous linear system:
$$\begin{cases} f(0)-f^\prime (0)=0 \\ f(1)-f^\prime (1)=0 \end{cases} \quad \Leftrightarrow \quad \begin{cases} (1-\omega) A+(1+\omega) B=0 \\ (1-\omega )e^\omega A+(1-\omega)e^{-\omega} B=0 \end{cases}$$
possesses nontrivial solutions, i.e. iff $\omega =1$ and $\lambda =1=:\lambda_0$.
If $\lambda=\lambda_0$, all the eigenfunctions corresponding to $\lambda_0$, i.e. the nontrivial solutions of (2), are in the form:
$$f_0(t):=Ae^t\; .$$
$\lambda =0$: in this case the general integral of the ODE is $f(t):=A+Bt$ and it is easy to see that there are no nontrivial solutions of (2).
$\lambda <0$: one can set $\lambda =-\omega^2$ (with $\omega >0$) into the ODE to get the general integral:
$$f(t):= A\cos \omega t+B\sin \omega t\; ;$$
then either (2) has only the trivial solution, or $\lambda =-\omega^2$ is an eigenvalue of (2): the latter case occurs iff the homogeneous linear system:
$$\begin{cases} A-\omega B =0 \\ (\cos \omega +\omega \sin \omega) A + (\sin \omega -\omega \cos \omega)B=0\end{cases}$$
has some nontrivial solutions, i.e. iff $\omega =n\pi$ and $\lambda =-n^2\pi^2=:\lambda_n$ with $n\in \mathbb{N}$.
If $\lambda=\lambda_n$, all the eigenfunctions corresponding to $\lambda_n$ are in the form:
$$f_n(t):=n\pi B \cos \omega t + B \sin \omega t\; .$$

Finally, summing it up, you have the following result:

The integral equation
$$\tag{1} f(x) = \lambda \int_0^1\big(\max \{x,t\} +xt\big)f(t)\ \text{d} t$$
has only the trivial solution $f(x):=0$ iff $\lambda \notin \{ \lambda_n\}_{n\in \mathbb{N}_0}=\{1,-\pi^2, -4\pi^2,\ldots ,-n^2\pi^2,\ldots \}$; it has also nontrivial solutions in the form:
$$f_0 (x) := Ae^x \qquad \text{(} A\text{ an arbitrary constant)}$$
iff $\lambda =\lambda_0 =1$; it has also nontrivial solutions in the form:
$$f_n(x) =n\pi B \cos (n\pi x)+ B \sin (n\pi x) \qquad \text{(} B\text{ an arbitrary constant)}$$
iff $\lambda =\lambda_n =-n^2\pi^2$ for some $n\in \mathbb{N}$.
Answer: This is not a complete answer and too long for a comment.
If $f$ is a so is a constant multiple of $f$, therefore you need at least one more condition on $f$ for a unique solution.
We get two constraints on $f$ by putting $x = 0$ and $x = 1$ in turn. that gives
us $$f(0) = \lambda \int_0^1 tf(t) dt \mbox{ and }  f(1) = \lambda\left\{\int_0^1 f(t)dt + \int_0^1 tf(t) dt\right\}.$$
Now, we break the problem into three cases.
If $\lambda = 0,$ then $f$ is identically zero.
If $\lambda = - k^2$ is negative then write $f = A \cos kx + B \sin kx.$
use $\int_0^1 \cos kt dt = \frac{\sin k}{k}, \int_0^1 \sin kt dt = \frac{1-\cos k}{k}$ and
$\int_0^1 t\cos kt dt = \frac{k\sin k + \cos k - 1}{k^2}, \int_0^1 t\sin kt dt = \frac{\sin k-k\cos k}{k^2}$. I hope I have not made any errors in evaluating these integrals.
Now put these back in the constraints and demanding non trivial solution for the pair $A, B$ will give a relation connecting $k$ and $\lambda.$
depending on the uniqueness of condition on $f$ should now provide the eigenvalues $k.$
I have not done the case of positive $\lambda$ which would involve hyperbolic sine and cosines.


Who owns a research question and data if a research partnership splits up?

Question: Two people form a research partnership to investigate a specific research question.  Person A comes up with the question draws up a plan.  Person B joins and advises on the approach and assists in data collection (a significant enough contribution to be a co-author).  They both run the analysis together but have a difference of opinion on how to write up the study.  They can't agree and the research partnership dissolves.  Person A and Person B both want to pursue the question independently using the data they jointly collected but neither will consent to the other submitting first.  Does the research question and data dissolve with the partnership or is there a way forward I can't see?
Comment: Seems as if Person A and Person B discussed the issue, all sorts of outcomes are possible.
Comment: Unfortunately the relationship has deteriorated and no discussion is likely.
Answer: In as much as you are asking about "ideas", no one owns them and anyone is free to follow up on them.
But if you are asking about who owns the product of joint work, work worth of authorship, then everyone contributing IP has a stake and that stake can't be claimed by others. If you can't come to any agreement, then you are stuck and anyone can potentially prevent publication or force a withdrawal. So, your best option, if you want to continue, is to come to some accommodation.
It is, however, possible in principle to start over, discarding all previous work, based only on ideas. That is risky, however, as it is difficult to do it "cleanly" without generating complaints from others.
Comment: Thanks for answering the question.  I would have thought that there was some IP in the research question but interesting to hear that that's not the case.  That will help in mediating a path forward.
Comment: The whole idea of there being any general thing called "intellectual property" is itself debated. Stallman (of the GNU) project, for examples, argues that the term conflates a group of vastly different legal constructs (including patents, copyrights, and trademarks) that have different legal origins and different legal purposes.


Extraterrestrial Sacrifices

Question: I have heard that it is forbidden to bring a sacrifice to HaShem anywhere on Earth other than the Bait HaMikdash. But what about space? Other planets, say Mars?
Comment: I thought this question was going to be about sacrificing aliens.
Comment: That answer says nothing about Earth specifically.
Comment: Where did you hear this?
Comment: I think I have heard it at several times in many places over the years. http://judaism.stackexchange.com/a/8884/2177
Comment: Where do we find the Issur being about Earth? The Issur is outside of the Beis Hamikdash. On the other hand,I guess ירושלים של מעלה is permitted. Doesn't it say that מיכאל המלאך brings Karbanos up there?
Comment: Depends on whether mitzvos apply in outer space http://judaism.stackexchange.com/questions/9250/when-does-somebody-living-in-space-e-g-iss-observe-shabbat/23402#23402
Answer: While I cannot say for sure without checking it up I believe the halachah is once the beis hamikdish was built one is not allowed to bring a sacrifice anywhere else; on this planet or on another.
Comment: Unfortunately, although you may be right, this answer is less valuable than the question (which is valuable only for entertainment and wild speculation).
Comment: @seth j assuming sciencetific progress continues after moshiach comes it won't be a irrelevant question. Several nations have plans to have a moon colony by 2030 so it would become relevant.
Comment: That wouldn't transform this answer into a higher quality answer, nor the question into a higher quality question. Edits to each would do that.

Extraterrestrial Sacrifices


I m looking for best practice related to configure content delivery server and content authoring server in production Env

Question: I looked into sitecore documentation below.
https://doc.sitecore.net/sitecore_experience_platform/setting_up__maintaining/xdb/configuring_servers/configure_a_content_delivery_server
Is this list comprehensive or we have anything more to take care. Please help.
Answer: In regards to server configuration, there is also the equivalent documentation for configuring a content management server.  Make sure you are reading the documentation relevant to the version of Sitecore you are using the version selector dropdown in the right hand column.
You should also look into the Security Hardening Guide (on https://sdn.sitecore.net, you will need to log in) and the new Security Hardening section for your production environments (and really, for your other environments as well).
If you have any modules (eg. EXM / WFFM / FXM) you should read the module-specific documentation as they sometimes have different configuration necessary for CM and CD servers.
In regards to architecture options there are a number of other pages (for example the architecture overview) but it sounds like you're after more specific configuration.
Answer: Sorry for the link-heavy answer, but there's a lot of different options we have:
Looking at the Sitecore configuration, you can find the details for Content Management server here, and the Content Delivery server here.
Find the details for configuring a reporting server here, and the details on the processing server configuration can be found here.
Find here a downloadable Excel file showing which .config files should be enabled and disabled on Content Management, Content Deliver, Processing or Reporting server.
However, keep in mind this is only Sitecore 'role' configurations, not touching on hardware, infrastructure and the like, or even things like Security (see Jason's answer), caching or xDB configuration.


How to attach a scroll bar from tool box to a panel so that it expands in relation to the form/panel?

Question: I have dragged a scroll bar on a panel on my form. Now i want to bind that scroll bar with the form. such that whenever i expand my form the scorll bar expands and remains at the right (incase of vertical scroll bar) and at bottom(in case of horizontal scroll bar).
What is happening right now is that the scroll bar remains at the place where i had positioned it even if i resize or maximize the form. Help!
Answer: You have to handle the Size events of the form.
When the form size changes, you move your scrollbar so it stays flush right, and change the length of the scrollbar so it's always correct.
Comment: It would be great if you could explain a bit more there.


How can I quickly create files for all of my templates?

Question: I'm working on a site with hundreds of templates that were all saved in the database. If I run a query to change "save_template_file" to "y" and then run synchronize, will that work? Any horror stories around doing this?
Comment: I'd imagine this would work just fine.
Answer: The query you'd use to change all templates to be saved as files is:
UPDATE `yourDBname`.`exp_templates`
SET `save_template_file` = 'y';

And if you wanted to limit it to only a certain group you'd use the following:
UPDATE `yourDBname`.`exp_templates`
SET `save_template_file` = 'y'
WHERE `exp_templates`.`group_id` =X;

Change out yourDBname for your actual database name in both cases and change X for the number which equals your template group_id number in the second case.
You could run this direct from the SQL tab in PMA (phpMyAdmin) or using a tool like Sequel Pro or Navicat etc.
Make sure you have a DB backup first of course!
Answer: Does running the query & sync create the files? In the past I've had to export all the templates. That will create a default_site.zip open that, dump that into where I'm saving templates and then run the query to change save_template_file to 'y'
Comment: Yea, I ran a test on a group and changed the "save_template_file" to "y" and it seemed to work as expected. Going to try it on a few more groups and see if there are any issues.

Edit - Wow, I had no idea the export worked that well.  It did indeed create all of the templates and it was extremely fast. I was mostly worried that doing 500+ templates would cause some issues.  Thanks for that tip!
Comment: Just a note, that just because they aren't saved to file, DOESN'T mean that they were all managed through the control panel. You can directly mount the database templates as files, using Mountee or other add-ons. That's my preferred method.
Comment: yeah, was only a recent discovery for me as well on a large build I took on. That said, most of the templates were crap!
Comment: haha, yes, we are trying to deal with 500+ templates that are ALL managed in the CP. I have no idea how organizations can get anything done this way, esp with so many embeds. As they say on Reddit, have an upvote, my friend!


Mouse hover detection in .NET MAUI

Question: I want to detect mouse hovering over visual elements in .NET MAUI ( like buttons ). I cannot find any "onmouseover"/"ismouseover" events for this. How can I implement this.
Answer: All requests for "desktop" style control of keyboard and mouse have been consolidated under Maui issue: Desktop platforms: Mouse and Keyboard.
jfversluis' comment (at that issue or a related issue) indicates that no work in this area has yet been planned.
That issue is the place to discuss the topic (express interest in, or add any specific requirements or use cases), until there is a plan.
Until then, the work-around is generally to write Windows-only code in the Windows folder of your Maui project.
Unfortunately for mouse, that only gives window or desktop-relative mouse information. AFAIK, There currently is no easy way to interact with individual UI elements while the mouse moves. (Because Maui started as Xamarin started as mobile cross-platform code; touch devices don't have concept of cursor being moved around screen.)
A crude hack is to use AbsoluteLayout: position UI elements at exact positions, so you know where they are, then write (Windows-only) code that does your own "detection".
The next level of sophistication would be to write code that traverses a window's "visual tree" of UI elements, to detect what control the mouse is over. Maui must have such logic internally somewhere, to handle touch events. Unless it relies on each platform's UI code to decide that. TBD.
For now, Maui makes sense for apps that can live with a "touch" paradigm, rather than a "desktop" paradigm.
Answer: This isn't an answer per say, but as a suggestion you could try and determine when the mouse would be over the VisualElement and then use StateTriggers to actively apply a VisualState.
MAUI Triggers
Comment: It's really great helping others. But same time, having vauge answers make it harder for those who are looking for help.
In your case, question is asking a suitable way to trigger the event. But you are suggesting how to do something else after triggering the event. Please re read the question.
Comment: While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference.  Link-only answers can become invalid if the linked page changes. - [From Review](/review/late-answers/32666270)
Comment: @GayanKavirathne - While I agree this answer would be improved if it had a code snippet in it, I disagree with your understanding of the question. The question says **detect** mouse hovering. And mentions `onmouseover`, which would be **code executed when** the mouse hovers. There is nothing in the question about **triggering** mouse hover. In fact, it is **impossible** to "trigger" mouse hover; the mouse hovers when it does, it is not something under programmer's control.
Comment: I understand the mistake in my comment. It was a misunderstanding of the question I read it first

Mouse hover detection in .NET MAUI


Customized Bootstrap into Less format

Question: Is there anyway to download a customised version of twitter boostrap (where you can edit the colours, grid widths etc) that gives you the css in .less format?
Answer: Bootstrap is in Less: https://github.com/twbs/bootstrap/tree/master/less (as of 3.0.0)
There is a SASS version here: https://github.com/jlong/sass-twitter-bootstrap
Edit: You can "fork" one of those versions, & add your own edits to it.  You can use GitHub for free if you do not mind if your fork is available to others publicly.
Comment: The first link is now dead. (Probably since Bootstrap 3 was launched.)
Comment: ty @beporter; actually they changed repositories.
Answer: The bootstrap package comes with the less sheets already included so you can download the whole package from GitHub and start working right away. You can also modify most of the styles on the bootstrap by customizing your download over at the Customize section on the Bootstrap documentation page that will also render the changes you make in less.
Here is the bootstrap less documentation.

Customized Bootstrap into Less format


Frontend suddenly showing code

Question: We now have 'code' on our frontend. See image. Please advise
Comment: First...clear the cache. If that doesn't work....looks to me like you have translate inline enabled. Go to the backend Stores->Configuration->Advanced->Developer->Translate Inline and set `Enabled for Storefront` to `No`. Be careful. It might be set at website or store view level, not only for default settings.
Comment: Cleared, flushed cache a thousand times. It was in production mode when this happened without any now about. So no inline translation available there.
Answer: So I think I know what was the issue.
- Sites were in development. Inline translation was on.
- Developer at 'go live' did put sites on 'production' (but apparently did not switch inline translation off)
All still looked good from that time.

Then we put a 'nl_NL.csv' file in the theme after a week and ran
php bin/magento setup:static-content:deploy nl_NL -f and compiled

Then it all went wrong, sites go down.
After deleting all 'nl_NL.csv' from files sites came back alive but looking like origineal image.
Then we put sites back to 'development' mode. Then switched off inline translation.
Again, then we could force language to local language, complie, etc. Then back to 'production.
In short. Never put Magento 2 on production  mode when inline translation is still on.

Frontend suddenly showing code


Standalone IE6 gets its version from IE7 and gets the wrong CSS

Question: I have an odd question related to how IE6 gets its version info with respect to conditional comments.
So far I had been successfully using a standalone IE6 inside a custom directory, which I had gotten from (I believe) either MS or evolt - to fix my current issue I also tried to download IE6 from MS (using the instructions from here) to override IE7 but the MS connection keeps breaking - also the files from evolt (the other solution) have disappeared.
Today while running IE7 I did try to install the MS developer toolbar and clicked on 'repair current developer toolbar' when offered. To make a long story short, this affected my IE6 install, as now IE6 still looks (and renders) like IE6, but lists '7.0.xxx' as its version, just the same as IE7. When I looked at the IE6 dir, only one file was marked as modified: IEXPLORE.EXE.local (0 bytes).
The result seems to be that IE6 responds to conditional comments aimed at IE7, which override the * html hacks used to fix IE6 css bugs - pages that previously were fixed are broken since the change.
So, my question: how does one make IE6 take its version information from the 'right place'? There is a version.txt file inside IE6 dir, but obviously isn't useful to the binary. I also tried deleting the IEXPLORER.EXE.local, and also tried to copy it to the IE7 install, but that didn't work.
Microsoft REALLY knows how to irritate developers as well as customers (sorry, saying that makes me feel better)...
I am hoping there is a simple fix. I list all the files inside the IE6, below.
<code>version.txt
xpsp2res.dll
urlmon.dll
mshtml.dll
mshtml.tlb
inetcpl.cpl
shdocvw.dll
brwseui.dll
vbscript.dll
jscript.dll
dispex.dll
iexplore.exe
IEXPLORE.EXE.local
</code>
Thanks for any suggestion!
KC
Answer: It's in the registry.
Check this and read this blog post.


How is Gauss's divergence theorem related to Gauss's law?

Question: I have been reading a bit about vector fields and how it relates to the EM field. However, I am confused about the nature of Gauss's law. As far as I understand, it is supposed to relate flux of the lines over a surface to the net charge inside the closed surface. But how is that relationship achieved? Gauss's divergence law allows one to find the divergence through a closed surface, but how is that connected to the charge of the surface?
Comment: Divergence is the microscopic version of Gauss's Law where the volume becomes a differential volume (like $V \rightarrow dV$).  if no one else does, i will write an answer that will be more conceptual and won't include Green's theorem.
Comment: Honors, it's gonna take awhile before i can organize it.  maybe tonight.  in the meantime, look up [inverse-square law](https://en.wikipedia.org/wiki/Inverse-square_law), [Gauss's law](https://en.wikipedia.org/wiki/Gauss%27s_law), and the concept of [flux](https://en.wikipedia.org/wiki/Flux) and **flux density**.  the divergence equation is another way of stating the behavior of *"flux"* of some physical quantity, and if that quantity is *conserved* in some manner, the inverse-square law comes out of that notion.  And Gauss's law says the same conservation of flux more directly.
Answer: Mathematical Explanation
Gauss's divergence law states that
$$\mathbf{\nabla} \cdot \mathbf{E} = \frac{\rho}{\epsilon_0}  $$
So, let's integrate this on a closed volume $V$ whose surface is $S$, it becomes
$$ \iiint\limits_{V(S)}\nabla \cdot \mathbf{E}\,\textrm{d}V = \frac{Q}{\epsilon_0} $$
where $Q$ is the total charge in $V$. However, Green-Ostrogradski theorem states that
$$ \iiint\limits_{V(S)} \nabla \cdot \mathbf{F}\,\textrm{d}V = \iint\limits_{S}\mathbf{F}\cdot\mathbf{\textrm{d}S}$$
for any field $\mathbf{F}$, so in particular
$$ \iiint\limits_{V(S)} \nabla\cdot\mathbf{E}\,\textrm{d}V = \iint\limits_{S}\mathbf{E}\cdot\mathbf{\textrm{d}S} = \Phi_S(\mathbf{E})$$
where $\Phi_S(\mathbf{E})$ is the flux of $\mathbf{E}$ through $S$. Finally, we got
$$ \Phi_S(\mathbf{E}) = \frac{Q}{\epsilon_0}$$
which is Gauss's theorem.
Intuitive Explanation
The previous explanation demonstrates the link between Gauss's divergence law and its theorem, yet we don't really understand why it works. However, once you've understood what the divergence of a field is, it will appear easy to understand.
Let's start from a possible definition of the divergence of a field $\mathbf{F}$:
$$ \nabla \cdot \mathbf{F} = \lim\limits_{\delta\tau\rightarrow 0} \frac{\iint\limits_{\delta S}\mathbf{F}\cdot\mathbf{\mathrm{d}S}}{\delta \tau}$$
where $\delta \tau$ is the volume delimited by $\delta S$. Well... this definition isn't really simple. Let's rewrite it as a physicist would do:
$$\nabla \cdot \mathbf{F}\, \delta \tau = \Phi_{\delta S}(\mathbf{F})$$
where $\delta \tau$ is small enough.... So here, we can see that the divergence of $\mathbf{F}$ is how much of $\mathbf{F}$ goes out of a small volume per unit time. So, if we integrate this over a big volume, we will get what comes out of this big volume per unit time (since when we cut this big volume into many small volumes, everything that goes out of a small volume goes in one of its neighbours, except for the extreme small volumes). But what goes out of this big volume is $\Phi_S(\mathbf{F})$, so we can say that
$$ \Phi_S(\mathbf{F}) = \sum\limits_{\delta \tau \in V} \Phi_{\delta S}(\mathbf{F}) = \sum\limits_{\delta\tau \in V} \nabla\cdot\mathbf{F}\,\delta \tau = \iiint\limits_{V}\nabla\cdot\mathbf{F}\,\mathbf{\textrm{d}V}$$
To a possible understanding of Gauss's law
Everyone starts electrostatic with Coulomb's law, that is two charges $q_A$ and $q_B$ with a distance $r$ between them undergo a force
$$ F_e = \frac{q_A q_B}{4\pi \epsilon_0 r^2}$$
Now, let's consider a charge $q$ in $O$. It creates a field $$\mathbf{E} = \frac{q}{4\pi\epsilon_0 \| \mathbf{OM} \|^3} \mathbf{OM}$$
Consider a small surface $\textrm{d}^2 S = r^2\textrm{d}\theta\textrm{d}\phi$ in $M$, where $\|OM\| = r$. The flux of $\mathbf{E}$ through $\textrm{d}^2 S$ is $\textrm{d}^2\Phi = \mathbf{E}\cdot\textrm{d}^2\mathbf{S}$ where $\textrm{d}^2\mathbf{S} = \frac{\textrm{d}^2S}{r}\mathbf{OM}$. This finally gives
$$ \textrm{d}^2\Phi = \frac{q}{4\pi\epsilon_0 r^3}\mathbf{OM}\cdot\frac{r^2\textrm{d}\theta\textrm{d}\phi}{r}\mathbf{OM} = \frac{q}{4\pi\epsilon_0}\textrm{d}\theta\textrm{d}\phi$$
Now, let's consider a closed surface $S$. If $O$ is in this surface, then
$$ \Phi = \iint\limits_S \frac{q}{4\pi\epsilon_0}\textrm{d}\theta\textrm{d}\phi = \frac{q}{4\pi\epsilon_0} \int\limits_{\theta = 0}^{2\pi}\int\limits_{\phi = 0}^{\pi} \textrm{d}\theta\textrm{d}\phi = \frac{q}{\epsilon_0}$$
Now, focus on the case were $O$ is outside $S$. Let $S_{+}$ (resp. $S_{-}$) be the part of $S$ where $\textrm{d}^2\Phi \geq 0$ (resp. $\textrm{d}^2\Phi < 0$), then
$$ \iint\limits_{S} \textrm{d}^2\Phi = \frac{q}{4\pi\epsilon_0}(\iint\limits_{S_{+}}\textrm{d}\theta\textrm{d}\phi  - \iint\limits_{S_{-}}\textrm{d}\theta\textrm{d}\phi) $$
However, since $S$ is a closed surface, a drawing can convince you that the preceding sum is null (the solid angle of $S_{-}$ is the same as the one of $S_{+}$...). Then, when $O$ is outside of $S$, $\Phi$ = 0.
Since the electrostatic field is linear, we can generalize this idea with the following equation:
$$ \Phi_S(\mathbf{E}) = \frac{Q}{\epsilon_0} $$
where $Q$ is the net charge inside $S$.
Comment: Thank you for your answer, but I was hoping for more of a conceptual explanation because I'm not too hot on the math. I think what I'm really confused on is how the connection between charge and divergence is established.
Comment: Actually when you calculate the divergence of E due to point charge that equals 0 and volume integral of it then vanishes . I know we explain it with Dirac Delta function , but could you explain it without that , because Lagrange or Gause would have done it in 1800s before Delta function came into existence.
Comment: I understand the nature of the divergence over the area now, but how is one able to see that the amount of charge must be determined by this divergence? Is it because the flux represents the charge in a field, and since Gauss's divergence theorem is flux over an area, the net charge must be dependant on that?


Necessary ports to talk to a validator (devnet) for deployment

Question: I teach at a university where I plan to introduce students to Solana blockchain development. I can deploy programs normally to devnet when running my laptop at home (anchor deploy), but when connected through the university network the same laptop/solana install always stay at 0.0%, retries 5 times and expires. Querying account balance with "solana balance" works normally. It seems that deployment uses ports that are blocked by the University firewall. What are the ports that should be opened in the University firewall to make it work? Are there other options that doesn't need to open non-standard ports? Like deploying using only standard SSL ports etc?
Answer: Program deployment makes use of a few connections, making it pretty complicated. To send the transactions, the tool uses QUIC, which is built on top of UDP, so perhaps outgoing UDP is blocked.
Otherwise, transaction confirmation goes through WSS, which is just built on TCP, which should be ok.
So be sure to check on the UDP settings first.


Nikon p900 Bracketing and Timer

Question: I have a Nikon p900.   I want to use bracketed exposures along with either a timer or remote shutter.   Activating anything off the timer menu, either a 2 second timer or selecting the shutter remote turns off bracketing.   Is there really no way to use bracketing with a timer or remote?  Thanks
Answer:
Is there really no way to use bracketing with a timer or remote?

No, there isn't. When using the self timer or remote control, with regard to Continuous/Exposure bracketing, page 47 of the P900 Reference Manual states:

When self-timer/remote control is used, a single image is shot even if Continuous H, Continuous L, Pre- shooting cache, or BSS has been set. If Intvl timer shooting is set, shooting finishes automatically after one image is shot.
Exposure bracketing is not available.
Answer: I was also frustrated by the inability to shoot a bracket set with a timer or remote control on Nikon DSLRs. I started using my compact Lumix LX10 for HDR bracket sets which will shoot the bracket set using the 2 sec delay.  Come on Nikon! The solution for Nikon I found was to use a wired remote. It works as if it was the shutter button on the camera, ie hold down and it will shoot the bracket set and stop.  The Nikon one is crazy expensive but you can find them very cheaply on Amazon or the like for around $10 to $45. The latter being an intervalarometer too if that is required. Importantly the basic function of shutter release is actually powered from the camera via the connection.  Check with the unit you buy and do your research but the cheap single function ones probably won't need batteries to do what you want. It's essential just a switch. I bought a multi function one with interval functions which requires batteries but it will still fire the shutter without the batteries. It cost around $25. I hope this helps.

Nikon p900 Bracketing and Timer


How do I output an entry author's data

Question: I have a blog. I want to output an entry author's first and last name. What is a good method to accomplish this?
Comment: Is "author" a reserved term in Craft CMS? I made a field called "author" but it is returning my name (I'm the one who typed the entries in) instead of the author of the article I'm entering.
Answer: For each entry, you can get the username of the author by simply using {{ entry.author }} (assuming entry is the variable containing the blog entry).
If you want to display Full name, first name and/or last name for one entry, you'd use:
<code>{{ entry.author.fullName }}
{{ entry.author.firstName }}
{{ entry.author.lastName }}
</code>
For a list of entries and their authors, you'd use:
<code>{% for entry in craft.entries.section('your-section').find() %}
    {{ entry.author.fullName }}
{% endfor %}
</code>
Answer: <code>{{ entry.author.firstName }} {{ entry.author.lastName }}
</code>

How do I output an entry author's data


Does anyone know where I can watch a good quality of Magi Adventures of Sinbad English dub

Question: I have been trying to look for it but they are all bad quality and have too may add or are not English.
Comment: How have you found _any_ that are in English? The Adventures of Sinbad OVAs haven't been dubbed.
Answer: We have a list of Legal Streaming Sources here. considering that Aniplex licensed Magi for the states their streaming channel has Season 1 and Season 2, assume that the Magi you have tagged is the same as the one you mention in the title. (as Season 1 is called Magi: The Labyrinth of Magic and Season is is called Magi: The Kingdom of Magic)
I am unable to confirm whether or not these episodes are dubbed in English as Geo-blocking prevents non US users from viewing the videos (i am in Australia), however considering DVD Set 1 has English listed as a spoken language and it's publishing is listed as Aniplex of America i would suspect that the episodes on their streaming channel are English Dub
EDIT: Thanks to senshin's comment i have come to realize that the series and Aniplex of America has aren't what you are looking for. looking on Wikipedia and Anime News Network neither lists any english distributors/companies/licencees for the either the 2014 OVA or the current Adventure of Sinbad anime adaptation of the manga of the same name. this leads me to suspect that it is not officially released outside Japan at this time (17/04/2016) so i would suspect a dub for these does not exist.
That being said generally when a company like Funimation or Aniplex gets the licenses to stream/distribute a series there is a high chance that they will also get any new season (though there are some exceptions). so at this time it's probably best to keep an eye on Aniplex of America for if/when they post up the dubs for the series your looking for. checking the other sites in the list i posted wont hurt either just incase
Comment: "Magi: Adventures of Sinbad" is a different thing (a side story) from "Magi: The Labyrinth of Magic" and "Magi: The Kingdom of Magic".


understanding projection matrices

Question: Let us look at two linearly independent vectors $v_1$ and $v_2$, which span a plane in $\mathbb{R}^n$ through the origin. Let us form a matrix $V$ out of these vectors so that the first column of $V$ is the vector $v_1$ and the second column is the vector $v_2$. Show that the the matrix $P=V(V^TV)^{-1}V^T$ projects all vectors $x\in\mathbb{R}^n$ orthogonally onto the plane spanned by $v_1$ and $v_2$.
Comment: what have you done? you need to show two things: (1) when you multiply $x\in\mathbb{R}^n$ by the matrix $P$, you get a vector in the plane, i.e. $Px\in\text{span}(v_1,v_2)$, and (2) the dot product of $Px$ with $x-Px$ is zero (so they are perpendicular).
Comment: @Martin: yes there is a reason: the vectors are assumed independent
Comment: You are right,  my bad.
Comment: I could use some help in proving (1)
Answer: Hint: You need to show two things.

$P\mathbf{x}$ is in the plane, i.e. $P\mathbf{x}\in\text{span}(\mathbf{v}_1,\mathbf{v}_2)$, for all $\mathbf{x}\in\mathbb{R}^n$
$P\mathbf{x}$ (the projection) and $\mathbf{x}-P\mathbf{x}$ are perpendicular, i.e. $\langle \mathbf{x},\mathbf{x}-P\mathbf{x}\rangle=0$.

To help you get started on (1), the point is that we need to find scalars $c_1$ and $c_2$ so that $\mathbf{x}=c_1\mathbf{v}_1+c_2\mathbf{v}_2$. (That is what it means for $\mathbf{x}$ to lie in the plane spanned by $\mathbf{v}_1$ and $\mathbf{v}_2$.) But $$c_1\mathbf{v}_1+c_2\mathbf{v}_2=V\begin{pmatrix}c_1\\c_2\end{pmatrix}=V\mathbf{c}$$ where $\mathbf{c}$ is the vector $(c_1,c_2)\in\mathbb{R}^2$.
So we want to solve the equation $$V\mathbf{c}=\mathbf{x}$$ for $\mathbf{c}$. Now you have to be a little careful: the matrix $V$ is not square...
Answer: To show $(1)$, note that $V=[v_1\ v_2]$. Then
$$
[Pv_1\ Pv_2]=PV=V(V^TV)^{-1}V^TV=V=[v_1\ v_2].
$$
So $Pv_1=v_1$, $Pv_2=v_2$.
Answer: Let $\{ v_1, v_2, w_1, \dots, w_{n-2} \}$ be a basis for V. By Graham-Schmidt, we can choose the $w$'s to be orthogonal to the $v$'s. We can write any x in V as:
$\textbf{x} = (a_1v_1 + a_2v_2) + (b_1w_1 + \dots + b_{n-2}w_{n-2})$.
Or in matrix notation:
$\textbf{x} = V \left( \begin{smallmatrix}
a_1 \\ a_2
\end{smallmatrix} \right) + W \left( \begin{smallmatrix}
w_1 \\ \vdots \\ w_{n-2}
\end{smallmatrix}\right)$
where W is $[w_1 \dots w_{n-2}]$.
Hence $P\textbf{x} = (PV) \left( \begin{smallmatrix}
a_1 \\ a_2
\end{smallmatrix} \right) + (PW) \left( \begin{smallmatrix}
w_1 \\ \vdots \\ w_{n-2}
\end{smallmatrix}\right)$
by linearity and associativity of matrix multiplication. But $PV = V$, and $V^TW$ is zero because it's formed by taking the dot products of v's with w's, which are orthogonal. This makes PW a zero matrix, as well. So
$P\textbf{x} = V \left( \begin{smallmatrix}
a_1 \\ a_2
\end{smallmatrix} \right) = a_1v_1 + a_2v_2$, which is the orthogonal projection.
Answer: I found this approach helpful so I would like to share it.
Useful results, if $P$ is a projection matrix then:

$ P\circ P = P$ , i.e projector $P$ projects the kernel onto itself.
$ Pv=v\ \forall\ v\in V$ where $V=\mathrm{null}(P)$, direct consequence of $1.$
$ Pu=\emptyset\ \forall\ (u \mid u.v=\emptyset\ \forall v\in V) $
$ P^{\dagger}=P $, iff $P$ represents an orthogonal projection.

using $(2)$ it is clear that $V$ is spanned by the eigenvectors of P which correspond to eigenvalue $\lambda=1$. Let $w1,w2$ be the eigenvectors for $\lambda=1$, we know that $W=(w1,w2)$ would diagonalize the matrix $P$. Thus,
$W^TPW=1$ or $P=WW^T$ this is what one would call an orthonormal basis.
Now we want to change the basis from $W$ to $V$ giving $W=S^{-1}V$ and
$S=VV^T$ which would give you a good starting point.
One way to see it is to notice that $(V^TV)^{-1}$ is a kind of normalization factor.

understanding projection matrices


Determination of solid bed fluidisation

Question: How would one determine if a fluidised bed (with liquid flow) is determined to be a stable fluidised bed, which subsequently doesn't form a plug or bed at the top of a column (bounded by frits), when under pressure?
Answer: Use flow (which is a product of pressure).
If a single solid will be entrained at the flow rate then it will plug.
If the bed has a packing factor of 50% then flow velocity in the bed is twice pipe flow velocity. As the bed fluidizes the packing factor goes down as does flow velocity.
VelocityPacking = VelocityPipe / (1 - packing)
The smaller particles will be lost (plug) first.
Comment: Thanks for your answer. Do you mean flow in the bed should be set to double the standard pipe flow, assuming no packing,  or that at a flow rate x, the experienced bed flow will be 2x?

Determination of solid bed fluidisation


Observer pattern implementation using Spring dependency injection

Question: I'm trying to develop an application where in the people will get notified if there is any change in the PartNumber. Its a Spring based application. Following is the code snippet.
I've abstracted the storing mechanism here in SaveSubscriptionIF. The actual details of storing and retrieving are in the implementation class of this interface. The implementation class will be injected by Spring.
The external application calls my setState() method- passing the new information.
The store.getObservers() method returns me the Map which have the Observers and the corresponding info to update.
So far so good. Am struck in the implementation part of store.getObservers(). This method implementation needs the state data - i.e the new information passed from the external application.
How do i pass the 'state' data to an implementation class of 'SaveSubscriptionIF'??
public class PartNumberSubject implements Observable {
     private SaveSubscriptionIF store;
     private Object state;
     @Override
     public void addObserver(final ObserverIF o, final Object subscriptionDetails) {
      store.addObserver(o, subscriptionDetails);
     }
     @Override
     public void notifyObservers() {
      @SuppressWarnings("unchecked")
      final Map<ObserverIF, List<PartInformationVO>> observers =(Map<ObserverIF,List<PartInformationVO>>) store                 .getObservers();
  for (final Entry<ObserverIF, List<PartInformationVO>> observer : observers
                        .entrySet()) {
     observer.getKey().update(observer.getValue());
     }
    }
    @Override
    public void setState(final Object state) {
     this.state = state;
     notifyObservers();
    }
    }

Comment: @Karthik: The Observer interface is not java.lang's. I've created my own interface here.
Answer: I think I understand what you mean.
Normally in the observer pattern, the value that changed is passed out as a parameter in the Event object that is created.
So, for example, you could create a StateChangedEvent class which had a value in it - state.
Then, your setState method would look like this:
public void setState(final Object state) {
    this.state = state;
    notifyObservers(state);
}

And notifyObservers:
public void notifyObservers(Object state) {
    StateChangedEvent event = new StateChangedEvent(state);
    // Pass this event into each observer which you have subscribed...
}

I'm sorry if I've misread the question but this seems to be what you're asking.
Answer: Passing data to observers is done via the observer's methods. So modify your interface:
public ObserverIF {
    void update(List<PartInformationVO>, Object state);
}

Comment: Actually, i need it only getObservers() method. Because, while fetching the observers list, i need to do some filtering - comparing old and new values. The update() method is fine so far - whatever the info needs to be know, am passing that - List


How to estimate variance components with lmer for models with random effects and compare them with lme results

Question: I performed an experiment where I raised different families coming from two different source populations. Each family was assigned one of two treatments. After the experiment I measured several traits on each individual.
To test for an effect of either treatment or source as well as their interaction, I used a linear mixed effect model with family as random factor, i.e.
lme(fixed=Trait~Treatment*Source,random=~1|Family,method="ML")

so far so good,
Now I have to calculate the relative variance components, i.e. the percentage of variation that is explained by either treatment or source as well as the interaction.
Without a random effect, I could easily use the sums of squares (SS) to calculate the variance explained by each factor. But for a mixed model (with ML estimation), there are no SS, hence I thought I could use Treatment and Source as random effects too to estimate the variance, i.e.
lme(fixed=Trait~1,random=~(Treatment*Source)|Family, method="REML")

However, in some cases, lme does not converge, hence I used lmer from the lme4 package:
lmer(Trait~1+(Treatment*Source|Family),data=DATA)

Where I extract the variances from the model using the summary function:
model<-lmer(Trait~1+(Treatment*Source|Family),data=regrexpdat)
results<-VarCorr(model)
variances<-results[,3]

I get the same values as with the VarCorr function. I use then these values to calculate the actual percentage of variation taking the sum as the total variation.
Where I am struggling is with the interpretation of the results from the initial lme model (with treatment and source as fixed effects) and the random model to estimate the variance components (with treatment and source as random effect). I find in most cases that the percentage of variance explained by each factor does not correspond to the significance of the fixed effect.
For example for the trait HD,
The initial lme suggests a tendency for the interaction as well as a significance for Treatment. Using a backward procedure, I find that Treatment has a close to significant tendency. However, estimating variance components, I find that Source has the highest variance, making up to 26.7% of the total variance.
The lme:
anova(lme(fixed=HD~as.factor(Treatment)*as.factor(Source),random=~1|as.factor(Family),method="ML",data=test),type="m")
                                      numDF denDF  F-value p-value
(Intercept)                                1   426 0.044523  0.8330
as.factor(Treatment)                       1   426 5.935189  0.0153
as.factor(Source)                          1    11 0.042662  0.8401
as.factor(Treatment):as.factor(Source)     1   426 3.754112  0.0533

And the lmer:
summary(lmer(HD~1+(as.factor(Treatment)*as.factor(Source)|Family),data=regrexpdat))
Linear mixed model fit by REML
Formula: HD ~ 1 + (as.factor(Treatment) * as.factor(Source) | Family)
   Data: regrexpdat
    AIC    BIC logLik deviance REMLdev
 -103.5 -54.43  63.75   -132.5  -127.5
Random effects:
 Groups   Name                                      Variance  Std.Dev. Corr
 Family   (Intercept)                               0.0113276 0.106431
          as.factor(Treatment)                      0.0063710 0.079819  0.405
          as.factor(Source)                         0.0235294 0.153393 -0.134 -0.157
          as.factor(Treatment)L:as.factor(Source)   0.0076353 0.087380 -0.578 -0.589 -0.585
 Residual                                           0.0394610 0.198648
Number of obs: 441, groups: Family, 13

Fixed effects:
            Estimate Std. Error t value
(Intercept) -0.02740    0.03237  -0.846

Hence my question is, is it correct what I am doing? Or should I use another way to estimate the amount of variance explained by each factor (i.e. Treatment, Source and their interaction). For example, would the effect sizes be a more appropriate way to go?
Comment: The treatment factor has 40x as many degrees of freedom as the source factor (pseudoreplication?). This is undoubtedly driving down the treatment P-value.
Comment: https://stat.ethz.ch/pipermail/r-sig-mixed-models/2010q1/003440.html
Answer: One common way to determine the relative contribution of each factor to a model is to remove the factor and compare the relative likelihood with something like a chi-squared test:
pchisq(logLik(model1) - logLik(model2), 1)

As the way that likelihoods are calculated between functions may be slightly different, I typically will only compare them between the same method.
Comment: shouldn't it be `1-pchisq(logLik(model1) - logLik(model2), 1)` ?


Are submodules of finitely generated free modules always free?

Question: I don't believe it's true that all submodules of a finitely generated free module are free just based on results from google. Is there a canonical simple example of a finitely generated free module with a submodule that is not free?
Comment: Haven't you considered accepting an answer?
Answer: If $R$ is a ring which is not a principal ideal ring, then usually its ideals are not free. But they are submodules of $R$, which is free and finitely generated.
For example, the ideal $(x,y)$ in the ring $\mathbb C[x,y]$ is not free.
Answer: The following result is relevant to your question:
A submodule of a finitely generated free module over a principal ideal domain is free. (For example, we can use the structure theorem for finitely generated modules over principal ideal domains.)
In particular, we need to think about commutative rings that are not principal ideal domains in order to answer your question. The polynomial ring in two variables over a field is a good example of such a ring.
Let me expand on Mariano's nice example. I shall do this by introducing a sequence of exercises:
Exercise 1: Prove that $\{x,y\}$ is not a $\mathbb{C}[x,y]$-basis for the $\mathbb{C}[x,y]$-module $(x,y)$.
However, it is a little trickier to prove that $(x,y)$ is not a free $\mathbb{C}[x,y]$-module. We need to show, in this context, that there does not exist a $\mathbb{C}[x,y]$-basis for $(x,y)$, which is more difficult than showing that a particular tuple of elements of $(x,y)$ is not a $\mathbb{C}[x,y]$-basis for $(x,y)$.
Exercise 2: Prove that $(x,y)$ is not a free $\mathbb{C}[x,y]$-module. (Hint: tensor over $\mathbb{C}[x,y]$ with the fraction field $\mathbb{C}(x,y)$ of $\mathbb{C}[x,y]$. What is the dimension of $(x,y)\otimes_{\mathbb{C}[x,y]}\mathbb{C}(x,y)$ as a $\mathbb{C}(x,y)$-vector space?)
Finally, if you have seen the (important) notion of flatness, then the following exercise might serve as good practice with this notion:
Exercise 3: Can you prove that $(x,y)$ is not even a flat $\mathbb{C}[x,y]$-module? (Hint: do you remember the equational criterion for flatness (cf. the first theorem in chapter 2 of Hideyuki Matsumura's Commutative Algebra)?)
Commutative algebra and algebraic geometry are closely connected branches of mathematics and thus it is always a good idea to interpret results in commutative algebra in the geometric context:
Exercise 4: If you know some algebraic geometry (e.g., Hilbert's nullstellensatz), then interpret Exercises 1 - 3 (and their answers) geometrically. (Hint: flatness is a little difficult to interpret geometrically but is very natural in the geometric context; if you are not aware of the geometric interpretation of flatness, then please look it up.)
Exercise 5: Can you generalize Exercises 1 - 4 to an arbitrary field in place of the complex field $\mathbb{C}$?
I hope this helps!
Comment: Sorry to revive, but to show that (x,y) is not free don't we only need to consider cases (?): (i) Our generating set, $S$, cannot consist of any element in $\mathbb{C}$ (ii) $S$ must contain at least, $kx$ and $k'y$, $k,k' \not=0 \in \mathbb{C}$ to generate $(x,y)$. (iii) But then we obtain non independence.
Comment: Dear Amitesh, what do you have in mind with exercise 4 and what has Hilbert's Nullstellensatz got to do with it, especially since the result has absolutely no relation  to  algebraic closedness of the base field? And what interpretation of flatness do you want the OP to look up? (Let me add that,  these remarks notwithstanding, I like your answer and upvoted it.)
Answer: A very simple example is $\mathbb{Z}_6$ as a $\mathbb{Z}_6$-module is free (generated by $[1]$) and its ideal (regarded as a submodule) $2 \mathbb{Z}_6=\{[0],[2],[4]\}$ has no basis since $[2][3]=[4][3]=[0]$
Answer: A simple example is consider $\mathbb{Z}_2^{\mathbb{N}}$ as ring and as a free module over itself and $\mathbb{Z}_2$, and a simple argument of cardinality do the job, a free module is direct sum of copies of the ring.
Comment: How do you proof that $ \mathbb{Z}_{2}^{\mathbb{N}} $ is free ?
Comment: The ring is free as module over itself.


Computing correlation between two image collections in GEE

Question: I have two image collections with 744 images each (and the same resolution and extent), covering the whole Earth.
I need to compute the correlation between the image collections for each pixel.
Answer: I don't think there's a way to do this on all the pixels at once.
For a single image pair you can first fuse them into one two-band image, and then use reduceRegion() with the reducer ee.Reducer.pearsonsCorrelation to return an r-value and a p-value.  If there are an equal number of pixels in each image pair, then you could iterate this procedure across the image collections with a .map() function, and average all the r-values together at the end.
(If not you could construct a combined reducer including pearsons and 'count', and then weight your averaging by the number of pixels in each image.)
Answer: Even though there is no ready-made function for calculating pixelwise correlation in Earth Engine, you can write the code manually to achieve this. This code will help you calculate the pixelwise correlation between the two image collections, assuming they have the same resolution and extent.
<code>// Load the two image collections you want to calculate pixelwise correlation for

var collection1 = ImageCollection1; // Replace with your own collection

var collection2 = ImageCollection2; // Replace with your own collection

// Calculate the mean of image collections

var meanCollection1 = collection1.reduce(ee.Reducer.mean());

var meanCollection2 = collection2.reduce(ee.Reducer.mean());

// Subtract each image in the collection from its mean

var subtractedCollection1 = collection1.map(function(image) {
  var meanImage = meanCollection1;
  return image.subtract(meanImage);
});

var subtractedCollection2 = collection2.map(function(image) {
  var meanImage = meanCollection2;
  return image.subtract(meanImage);
});

// Create an empty list to store the multiplied images
var multipliedImages = ee.List([]);

// Iterate through each image in the collections and multiply them

for (var i = 0; i < 744; i++) { // Adjust the loop range as needed
  var image1 = ee.Image(subtractedCollection1.toList(744).get(i));
  var image2 = ee.Image(subtractedCollection2.toList(744).get(i));
  var multipliedImage = image1.multiply(image2);
  multipliedImages = multipliedImages.add(multipliedImage);
}

// Convert the list of multiplied images back to an ImageCollection

var multipliedCollection = ee.ImageCollection.fromImages(multipliedImages);

// Reduce the multiplied collection to a single summed image

var summedImage = multipliedCollection.reduce(ee.Reducer.sum());

// Define a custom function to square each image

var squareImage = function(image) {
  return image.multiply(image); // This squares the image
};

// Use the map function to apply the custom function to each image in the collections

var squaredSubtractedCollection1 = subtractedCollection1.map(squareImage);
var squaredSubtractedCollection2 = subtractedCollection2.map(squareImage);

// Reduce the squared subtracted collections to single summed images

var summedSquaredImage1 = squaredSubtractedCollection1.reduce(ee.Reducer.sum());
var summedSquaredImage2 = squaredSubtractedCollection2.reduce(ee.Reducer.sum());

// Multiply the summed squared subtracted images

var multipliedSquaredImages = summedSquaredImage1.multiply(summedSquaredImage2);

// Use the map function to apply the square root function to the multiplied images

var sqrtMultipliedSquaredImages = multipliedSquaredImages.sqrt();

// Calculate the pixelwise correlation

var correlation = summedImage.divide(sqrtMultipliedSquaredImages);
</code>


flowchart connectors between user controls in silverlight

Question: I'm trying to make connecting paths between various user controls, possibly with multiple connections emerging from a single user control, and preferably paths composed of only horizontal and vertical elements.  I haven't been able to figure out a good way to do this exclusively in xaml, especially if the user controls span different panels (ie stackpanels and wrappanels) for formatting reasons.  Has anyone found a good free solution, or have a good suggestion of how to make my own?
Comment: Are you talking on like a static fixed layout, or created dynamically?
Answer: You could take a look at Sukram's series: http://www.codeproject.com/script/Articles/MemberArticles.aspx?amid=65924
Although this is for WPF, most of it can easily be ported to Silverlight.
Note that for the routing of the connections - in your case this is called 'orthogonal routing', this may require more sophisticated solutions, depending on your exact usecase.
Of course there are commercial solutions available for Silverlight that can do this. For yFiles there are online demos available that show the edge routing capabilities in action. This library (as most good implementations) allows for using any Silverlight controls as 'nodes'. The organziation chart demo under the above link shows this capability nicely. Disclaimer: I work for the company that created the above mentioned commercial library, however on Stackoverflow I do not represent my employer.


How to determine the sample size of a Latin Hypercube sampling?

Question: I am designing an experiment with 5 variables. Some of the variables have 2 and others have 3 levels. The method that I am going to use is the Latin Hypercube, but I do not not what the sample size should be for a valid experiment?
Comment: Can you say more about your situation, your setup, your variables & your goals? It is going to be impossible to answer this question in the abstract. To help you formulate your question, you may want to read our [FAQ](http://stats.stackexchange.com/faq) & this blog post: [how to ask a statistics question](http://www.statisticalanalysisconsulting.com/how-to-ask-a-statistics-question/).
Comment: See also http://stats.stackexchange.com/questions/24604/are-non-square-latin-hypercubes-viable
Answer: The total number of sample combinations you have is $2\times 3 \times 2 \times 3 \times 3 = 108$ (or what ever). Depending on your experiment (and the difficulty of taking samples), you should ideally just sample everything. If not, there a a few other options.
You can't technically do standard LHC sampling, or orthogonal sampling, because it requires each dimension to have the same number of levels. However, you can do LHC if you use $6n$ (lowest common multiple of 3 and 2) levels, and then map that to your 2- and 3-level spaces.
The number of samples you choose is up to you, but more samples will give you more reliable results, and will also help avoid correlation between variables (you should check this when you decide what your samples are, before you actually take them). If you expect that your effect size is going to be small relative to noise, then choose a larger sample size.
Another method that might be sensible is to use a Low-discrepancy sequence, like the Sobol sequence. Basically, you take a sequence over the real space $[0,1]^5$, and then map each dimension to your variables (so if you get something in the lower half of your $[0,1]$ dimension for your first 2-level variable, then you choose level 1, etc.). This has the advantage over LHC that you can decide to add more samples later, while retaining relatively even sample coverage, and low correlations between variables. Also, you're not restricted to sample sizes of $6n$. I successfully used this method with sample sizes as low as 25.


What's the size of EOS block header? and How is the "420 MB/ year" data derived?

Question: I read the technical whitepaper and want to know estimate the total size of block header in a year. Thanks , it's important for me  " Tracking all block headers (420 MB/year) will keep proof sizes small"
https://github.com/EOSIO/Documentation/blob/master/TechnicalWhitePaper.md
Answer: Updated (11/30/2020)
In original post, I calculated the size of extensions_type (header_extensions) field as 4 bytes, but it is an alias name of std::vector<std::pair<uint16_t,std::vector<char>>>, and it is serialized to 1 byte when it has no elements. Thus, the size of block header will be 116 bytes instead of 119 bytes. (I updated original post below)
Original
I'm not sure on which version of code technical whitepaper is based, but it's a little different from my calculation.
namespace eosio { namespace chain {

struct block_header
{
   block_timestamp_type              timestamp; // 4
   account_name                      producer; // 8
   uint16_t                          confirmed; // 2
   block_id_type                     previous; // 32
   checksum256_type                  transaction_mroot; // 32
   checksum256_type                  action_mroot; // 32
   uint32_t                          schedule_version; // 4
   optional<producer_schedule_type>  new_producers; // 1
   extensions_type                   header_extensions; // 1
};

} }

Each block header consumes 116 bytes and 63,072,000 blocks are generated every year. (2 blocks/sec * 60 * 60 * 24 * 365) Roughly, 6977.4170 MiB/year is necessary to store all block headers. (It would be larger, because the size of new_producers and header_extension grow when they aren't empty)
Comment: thanks, i also think 7157.8674 MiB/year is the correct result, and it's important because the storage cost can be large different based the data above.


How to find the position-specific weight matrix (PSWM) for a list of genes having different sizes?

Question: Wiki has the algorithm for finding position-specific weight matrix (PSWM) for a list of nucleotide sequences having an equal number of nucleotide. How do we find the PSSM for a list of nucleotide sequences having different sizes?
Answer: If your sequences are different lengths, this implies a gapped alignment with insertions/deletions. This is not possible with a regular PSSM, so you have to create a separate PSSM for each group of homologous sequences of the same sequence length.
The alternative is to use a different approach that allows gaps like profile HMMs (as implemented in HMMER3 or HH-Suite3).


Actionscript 2.0 External SWF loaded and resized into Movieclip problem

Question: Even if I loaded for dozen times an external swf into a movieclip... I dont know how to resize (layout) the targeted movieclip. I dont mean the quality... Let`s say the external SWF has 400 X 300 px and I want it to be loaded into a movieclip container about 200X100. How to resize the external SWF file prior to be loaded? Please HELP ! I know that in AS 3 there is some code with x/y variables... But my external SWF and the main page (in whic I want the swf to be loaded) are in AS 2. Anyone pls Help :) Thanks!
Answer: Lets call the container SWF mc_a and the SWF to be loaded mc_b.
Create another container SWF inside of mc_a.  We'll call it mc_c for this discussion.
At runtime, set the visibility of mc_c to false.
Load mc_b into mc_c.
mc_c will assume the width and height of the loaded SWF, mc_b, but it will be invisible at this point.
Set the width and height of mc_c according to what you want.
Set the visibility of mc_c to true.
That should do it, or some similar variation of that.  You could also forgo the inner container, mc_c, and just set the visibility of mc_a to false at runtime, load mc_b into it, resize mc_a accordingly, and then set mc_a's visibility to true.
The inner container method presumes you might have some other content in mc_a that you would not want resized.  When using the inner container method you might have to adjust the x/y of mc_c as well since it will scale anchored at the top left corner.
Comment: ok thanks man...I`ll try this... Hope that works. Ill notice you about that


Finding mass with an estimated gravitational force

Question: As asteroids orbit the sun, they experience gravitational force exerted on them by the sun, and they in turn exert a very minute force back on the sun. Because of their small size, asteroids don't tug on the sun a measurable amount, so therefore you cannot determine the gravitational force acting upon them. However, there are asteroids with known masses, and known gravitational forces (such as Ida) which have been visited. Since asteroids are so small their gravitational forces are negligible, could the gravitational force of an average asteroid be extrapolated to the rest of the asteroids in its family? And using this average force you could then find the masses of the nearby asteroids with Newton's law of gravitation? Or would the gravitational forces be too different to produce a meaningful result?
Answer: You ask:

could the gravitational force of an average asteroid be extrapolated to the rest of the asteroids in its family?

But the question is what properties the members of a family have in common. You could argue that all the asteroids in a family will be made up from the same material and will have the same density. That means as long as you can measure the size and shape with a telescope you can calculate the volume and thereby the mass. But this seems a risky approach as there may be cavities and voids in the asteroids that can't be seen, and your calculated masses would just be an upper bound.
Historically asteroid masses have been determined by observing their interaction with other asteroids. For example the first ever determination of an asteroid mass was in 1966 when the mass of Vesta was estimated by measuring how much it deflected the smaller asteroid 197 Arete. More recently we've been able to fly spaceships to asteroids and measure their mass that way, but the majority of known asteroid masses have been measured by their interactions with other asteroids.
Comment: I had heard that asteroids were typically grouped by orbital elements, and not by their physical characteristics (because these properties are unknown), but I'm wondering whether you could treat the gravitational force the sun exerts on them as the same.
Comment: @Sigismund: the gravitational **acceleration** produced by the Sun would be the same, but we can't measure the force just from the orbit so we can't obtain the mass.
Comment: That's true, but if an asteroid with a very similar orbit has a known force could that force be used for other asteroids nearby?
Comment: @Sigismund: no, because the force depends on the mass. All we can say is that nearby asteroids will have the same (or very similar) **acceleration**. There is no connection between the proximity of other asteroids and the relative **forces** acting on them.
Comment: I see, and since you don't know the mass you can't use f=ma to find the force either, so you're back at square one...
Comment: @Sigismund: yes, exactly.


Car Dealership says I have no credit history, but I do?

Question: My fiance and I went to Chrysler Dodge Jeep dealership to lease a car, nothing fancy just a Jeep under 30k. During an appointment we were told that I have absolutely no credit history, which is very strange as I have 6 credit cards since 2013 and 690 credit score report based on annualcreditreport.com. While, it's true that I never owned a car in the US before and did not have loans or mortgage, I always utilized credit cards. They recommended to contact credit bureau. I couldn't get trough to Experian but TransUnion said that they see no issues and it's dealership's system problem. However, the dealership keep saying that their hands are tied. I don't know what to do? I don't want to get a co-signer. Would you have any recommendations?
Comment: Have you tried other dealerships?  Either Jeep dealerships or dealerships in general.  If this issue is limited to the one dealership, and your heart isn't set on that specific Jeep, then this seems like *their problem,* not yours.
Comment: Is your credit history from outside of the US only? The way you phrase the statement 'I never owned a car in the US before' implies that your credit history might be from elsewhere. This can prevent your history from 'carrying over' into the US.
Comment: Just a side note in case this gets resolved but they see a different score: Dealerships may use a different scoring system. There is a FICO Auto Score which is affected by your history specifically with car loans. It shouldn't be a big difference, and likely Bacon's question is the correct path to investigate. Just be aware that with no auto loan history, your 690 might be a lower value for a dealership.
Comment: @Grade'Eh'Bacon I read that as having had credit cards in the US.
Comment: Anastasia: If they're finding "_absolutely no credit history_" instead of "_just not a good-enough history_", have you double-checked that the dealership are using your correct details? Have you ever varied the name you use? As in... someone's official name might be "Fred Arthur Bloggs" but prefer to be known as "Arthur" in everyday life. If they forget and enter their name as "Arthur Bloggs" on some documents, that _might_ not get linked to "Fred Arthur Bloggs".
Answer:
690 credit score report based on annualcreditreport.com

AnnualCreditReport.com itself does not provide or entitle you to credit scores. Did you purchase your FICO score from one of the bureaus while obtaining your reports? What did the reports themselves show?

TransUnion said that they see no issues

Does this mean you do have data in your TransUnion credit report, including the expected 6 credit cards? Note that a given lender may pull your report from only one bureau and it may not be TransUnion. Did the dealership say which bureau(s) they used? Did you get the corresponding report from AnnualCreditReport.com?


Longest time before a Number One Single?

Question: Who managed the longest period between their first ever release & their first number 1 single?
Answer: Louis Armstrong made his first recording as bandleader in 1925. His single Hello Dolly reached number 1 in 1964.
Answer: Looks like, in the US it was Santana with 'smooth':

The record for the longest wait from an artist's Hot 100 debut entry to its first #1 belongs to Santana, with 30 years between the time he first cracked the Hot 100 with "Jingo" (October 25, 1969) and the first of 12 weeks at #1 with "Smooth," featuring Rob Thomas (October 23, 1999).

From Wikipedia
In the UK I couldn't find that stats for that but the longest between number 1's is The Hollies at 23 years:

The Hollies went 23 years between their first top hit "I'm Alive" in 1965 and their next top hit, the re-release of "He Ain't Heavy, He's My Brother" in 1988. They had eleven other singles in the top 10 in that interim time, including three singles to reach the number 2 spot.

From Wikipedia
Comment: Beats the one I had in mind - Elton John, who's first [solo] number 1 in the UK was Sacrifice, 1990, 22 years after his first release. I'll give it a couple of days before hitting the 'tick' just in case anyone finds a surprise.
Answer: A bit outside the requirements (single -> #1), but you can maybe consider anyway :
<code>"Sugar Man" by Sixto Rodriguez
</code>
This song wasn't released as a single but was part of an album in 1970... and didn't really reach number 1 in 2012, but I think almost everyone heard it then on the radio/tv!
You can see why by watching the movie Searching for Sugar Man
 (I can't sum it up... it would spoil the movie & that fascinating story)
Answer: In 2022 we have to add Kate Bush to this list.
First UK hit 1978 with Wuthering Heights.
Running Up That Hill, first released in 1985, eventually made the top slot in 2022, due to its popularity gained from the TV show Stranger Things.
That makes 44 years.
Oh, I just realised it doesn't count, because Wuthering Heights also went to No 1. I'll leave this here as an honorable mention.


Watermark on aspx page

Question: I want to add a image as a watermark on my website. I have prepared a master page and I want to include it on the master page it self so it can be implemented in entire website.
I want to put in such a way that while scrolling the image should stay steady while the content is moving with the scroll.
What I did basically
in my css
.Watermark
{
    position:   absolute;
    left:       expression(this.offsetParent.scrollLeft + 180);
    top:        expression(this.offsetParent.scrollTop + 320);
    z-index:    99;
}

and in master page's content holder

Answer: You should use position: fixed
Comment: Arrangement of the image tag is proper?

Watermark on aspx page


SMAPI mod loader for android questions?

Question: heyy i tend to us the SMAPI mod loader for android alot, it works fine, but it seems as if Stardew Valley Expanded doesn't work. does anyone know why it dosnt, spacecore has errors and i dont know how to change them.
Comment: What version (number) of the game are you playing?
Answer: Some complicated mods (like Stardew Valley Expanded) might not work correctly on Android.

Double-check if you have all depending mods. Look here for more info.
Mods are primarily coded for PC, and may not work correctly on Android if they use special libraries or similar.
It might be a bug regarding SMAPI or any of the mods, though this is unlikely.

Ask around on the Official Stardew Valley Discord and see if anyone else has the same problem, perhaps they might be able to help.

SMAPI mod loader for android questions?


Stop a workflow

Question: SharePoint 2013, on Prem environment.  I have a scenario where the client has to complete a form and it kickstarts the workflow for approvals from different stakeholders.  Now there is a requirement that anyone involved in the workflow should be able to cancel the workflow and it needs to send out an email to all involved that the workflow has been canceled.  How will I achieve that and is it possible?
Answer: Is it a OOB workflow or a custom workflow ? For OOB workflow i am not sure if it is feasible.
For custom workflow, there is a stop workflow action in 2010 platform workflow. You can add the action to your approval process for the condition when when a approver reject or other required situation. For 2013 platform workflow, you can add if condition in the transition to stage part. Use a certain stage to just end the workflow. And use if conditions to transit your workflow to an end on required conditions. I hope the description is not too abstract.

Stop a workflow


Mold Growing on Top of Exterior Door

Question: I am not that knowledgeable with mold. On my exterior front door by the head and the door stop I have mold growing. I checked the drywall and it doesn't seem to have any water damage. I was thinking to wipe away the mold but I thought it might comeback twice as worse so I wanted to check and see what the community had to say.
Comment: What kind of mold?
Answer: Background Information
There are really only four things necessary for mold growth:

Mold Spores
Mold Food (Organic Substance)
Appropriate Temperatures
Considerable Moisture

Resources
The best way to control mold growth, is to control moisture. One good resource available to you is the Brief Guide to Mold, Moisture and Your Home from the US EPA. The US CDC has the following recommendations for decreasing mold exposure:

Never mix bleach with ammonia or other household cleaners. Mixing
bleach with ammonia or other cleaning products will produce
dangerous, toxic fumes.
Open windows and doors to provide fresh air.
Wear non-porous gloves and protective eye wear.
If the area to be cleaned is more than 10 square feet, consult the
U.S. Environmental Protection Agency (EPA) guide titled Mold
Remediation in Schools and Commercial Buildings. Although focused on
schools and commercial buildings, this document also applies to other
building types. You can get it by going to the EPA web site at
http://www.epa.gov/mold/mold_remediation.html.
Always follow the manufacturer's instructions when using bleach or
any other cleaning product.

Advice
As a Certified Indoor Air Quality Technician, I can tell you that bleach will in fact make mold worse. Bleach is very effective in removing the discoloration but leaves the microflora that will enable the mold to return in exactly the same spot when conditions are right. The most effective means of destroying molds, are biocides and anti-microbial solutions.
Recommendation
As far as your door is concerned, specifically:

Check the weather stripping and insure a good seal.
Check the serviceability of your HVAC system. Air Conditioners are
also dehumidifiers.
Keep the doors clean of organic substances - mold can even grow on
dirt.
Ask an IAQT to test the mold spores and determine the type of mold.
Clean the area with rubbing alcohol, or a solution with 60%-90%
alcohol.
Comment: No biocides or anti-microbial solutions are EPA registered for use as a fungicide on wood substrates.
Answer: Clorox and a hand pump tree soaker/sprayer. Then pressure wash. You will never 'win' with mother nature, but you can sack her behind the line of scrimmage and force a punt.

Mold Growing on Top of Exterior Door


Development site is connecting to production database (DB Error: insufficient permissions)

Question: I updated CiviCRM on Drupal 7 to the latest version (5.70.0) in Production. I then copied the production environment into a development URL on the same server, and updated /sites/default/civicrm.settings.php as well as /sites/default/settings.php to point the Sandbox to the development database.
CIVICRM_UF_DSN, CIVICRM_DSN, $civicrm_root, and CIVICRM_TEMPLATE_COMPILEDIR all now point to the development database.
The development site loads fine a web browser, and when I update data from Drupal, that data gets updated in the Dev database with no problem. But when I try to update something in CiviCRM, such as enable or disable an extension, create a new contact, or even when I go to manually run the cron job against the development environment, I get the following error:

DB Error: insufficient permissions

Then when I go to check the log, I see something like the following, which is clearly using the Production (not the Dev) database user:

[nativecode=1142 ** TRIGGER command denied to user 'production-user'@'localhost' for table 'civicrm_contact']"`

I have cleared caches several times, having deleted files in /sites/default/files/civicrm/templates_c. I have grepped the entire Development codebase for the production-user, and it is nowhere to be seen.
I have tried to rebuild the triggers by going to civicrm/menu/rebuild?reset=1&triggerRebuild=1, but that produces the same error. I have also tried to rebuild the menu & clear the cache from the web UI, but that also produces the same error.
How can I track down why the Development copy of this website is still somehow trying to use the Production database user (and is it still somehow trying to connect to the prod database too)?
Answer: You will need to export the database without triggers and import them back and rebuild the trigger
mysqldump -umysqlusername -p --skip-triggers dbname > dbname.mysql

drop database dbname;

create database dbname;

mysql -umysqlusername -p dbname < dbname.mysql


Example of a markov chain with transient and recurrent states

Question: As the title says, I can't come up with an example of a markov chain with all possible states (transient, positive recurrent and null recurrent). I know that the state space must be infinite, otherwise all recurrent classes are positive recurrent. Any suggestions?
Comment: you can have a markov chain that goes from $i$ to $i+1$ with probability $p$ and to $0$ with probability $1-p$
Answer: Consider a state space $\mathcal S=\{0\}\cup \{\delta\}\cup A\cup B$, where $A=\{a_1,a_2,\ldots\}$ and $B=\{b_1,b_2,\ldots\}$, and transition probabilities
$$
P_{ij} =
\begin{cases}
\frac13,& i=0, j\in\{\delta, a_1,b_1\}\\
1,& i = j = \delta\\
\frac13,& i=j=a_1\\
\frac23,& i=a_n, j=a_{n+1}\\
\frac13,& i=a_{n+1}, j=a_n\\
\frac23,& i=j=b_1\\
\frac13,& i=b_n, j=b_{n+1}\\
\frac23,& i=b_{n+1}, j=b_n.\\
\end{cases}
$$
Then $0$ is transient, $\delta$ is absorbing, $A$ is null recurrent, and $B$ is positive recurrent. (Draw the transition diagram.)


Order of a certain finitely generated group

Question: Suppose I am looking at the group $W=\langle s_\alpha, t_\beta \rangle$ where $s_\alpha$ and $t_\beta$ are reflections in $\mathbb{R}^2$ coming from two vectors $\alpha$ and $\beta$ making an angle of $\pi/m$ between their perpendicular hyperplanes $H_\alpha$ and $H_\beta$, where $m \geq 2$. I need to show that $s_\alpha \cdot t_\beta$ has order $m$ and $W$ has order $2m$. It is easy enough to show for $m=2$, but I am not quite comfortable dealing with presentations of groups yet. However $W$ ought to be the dihedral group somehow, and therefore have order $2m$ by definition.
Answer: Your intuition is correct: what you get is indeed the dihedral group of order $2m$. One way of showing that $s_{\alpha} t_{\beta}$ has order $m$ is to represent it by a suitable matrix. Your element should correspond (in the expected dihedral group) to a rotation of angle $2\pi /m$. Hence it remains to find a suitable basis of your two-dimensional real space such that the matrix of $s_{\alpha} t_{\beta}$ with respect to that basis is the matrix of a rotation of order $m$.
For simplicity, set $s=s_\alpha$, $t=t_\beta$. Once you have proven that the order of $st$ is $m$, since $s$ and $t$ have order $2$ you get the so-called "braid relation" $$s t s \cdots = t s t \cdots,$$
where there are $m$ factors on each side. But since your elements $s$ and $t$ have order $2$, any relation involving the generators $s$ and $t$ is of the form $$s t s \cdots = t s t \cdots,$$
where is there are $n_1$ factors on the left and $n_2$ on the right, $n_2+n_1$ is even (otherwise both end with the same letter $s$ or $t$ which you can simplify). But you can then rewrite your relation as $(st)^{\frac{n_1+n_2}{2}}=1$, hence $\frac{n_1+n_2}{2}$ is a multiple of $m$ since $st$ has order $m$, and you get no new relation. This means that your group has two generators $s$, $t$ and relations $s^2=1$, $t^2=1$ and the braid relation $sts\cdots = tst\cdots$, which is exactly the presentation of a dihedral group of order $2m$.


High performance ASP.NET setup

Question: I would like to ask you what is the best setup for a following application:
ASP.NET 3.5 Web site - used as a presentation layer, a lot of AJAX and JS. Will not hit the server a lot.
ASP.NET WCF - sevice providing all data to the application. It's responsible for validation, data modeling / preparing and communication with the DB Server.
Database - SQL Server 2005 Std, some logic is coded on the server side as stored procedures. Some of the logic can be a bit time consuming. In my opinion it's the most resource consuming part of the app.
The website can have up to 1000 users per minute. We can have up to 4 servers in the following configuration: Intel Bi Xeon Quad 8x 2.00+ GHz, 16 GB RAM, SSD or RAID drives.
What is the best way to place parts of the application on the physical servers? Will they handle this kind of load?
Comment: You might get some more responses if you ask this on [serverfault](http://serverfault.com/) too.
Answer: The less scalable place in any application is database server, you can add more web and application servers but you can't replicate DB with the same ease so you will benefit in a long run if DB will not contain any logic especially any long running logic. In a lot of the applications limiting factor is not cpu but memory think about user sessions if you store 1mb of data per user you applications will be able to support 64,000 silmantanius user sessions with you machines it may be sufficient or not. Both problems can be mitigated by using application level caching but this can cause it own set of problems because now you faced with stale data. To scale session based sites you will need to use smart load balancer solution that supports sticky sessions, for your loads most likely you will need hardware load balancer.
Answer: In the application you describe, I suspect that thread management is going to be a big issue.  Throwing hardware at the problem may not be the best approach.
In terms of partitioning, it depends on whether you can leverage things like caching and cache notifications.  If every call to the app has to hit the DB and run a lengthy stored procedure, then you may want to have more DB machines and fewer front-end web servers.
This is a big subject.  In an attempt to provide a reasonably comprehensive answer to exactly this kind of question, I ended up writing a book about it:  Ultra-Fast ASP.NET: Build Ultra-Fast and Ultra-Scalable web sites using ASP.NET and SQL Server.

High performance ASP.NET setup


Virtual online Minyan for daily Kaddish?

Question: I haven't been observant in almost 20 years, but recent events make me yearn to say Kaddish for those who died on October 7th, and for those IDF soldiers that are dying now. For various reasons, and in-person Minyan is currently impossible for me. Are there any virtual Minyans for saying Kaddish?  I would strongly prefer an orthodox-led Minyan, but a conservative one will do as well.
Comment: @Damin By all means if you feel that saying Kaddish is a good thing to do then go for it, and having that connection to a minyan may help you, but I'd also suggest to simply sincerely speak to God in your own words wherever you are to ask him to protect the IDF, return the captives, heal the injured, elevate the souls of those who have died and to grant us peace.  You always have a direct connection to Him, wherever and whenever you want, and your sincere prayers will have an effect, irrespective of whether you are observant or not.
Comment: [Welcome to MiYodeya](https://judaism.meta.stackexchange.com/a/3887/11501) Damin and thanks for this first question. Great to have you learn with us!
Answer: Thank you for coming here.
I'm looking at the calendar of DC's Ohev Sholom Synagogue; it looks like they assemble a traditional minyan in-person, but also (on weekdays) keep a Zoom camera on for others to pray along. I'd suggest you contact them.
There's certainly been a lot of loss and mourning going on, and your instinct to react with prayer is a welcome one. Still, Kaddish is usually said by those mourning an immediate relative, or those appointed by mourners to do so. But I'd suggest that you contact Ohev's rabbi and ask him how he feels about you saying Kaddish.
(I don't know if the Zoom session mutes the remote attendees' microphones; or if you want to say Kaddish along with them and keep your mic muted, I can't see any harm in it, and it sounds like it might help you.)
Whether you do or don't say kaddish, just planning to pray along with a minyan (even if you're on Zoom and they're in-person) sounds like a significant step for you and a way of connecting with your faith and your people at this difficult time; maybe give that a try?
Good luck, and may we hear better news.
Answer: There are currently Conservative ones going on as a cultural hangover from the pandemic.  You will not find an Orthodox one because they do not consider such a concept to be legitimate.  I hope you understand if I do not provide a zoom link and password to a stranger in a public posting.  If you are serious about this, contact a Conservative rabbi, ideally in your area, and work through them.  Good luck and I hope it is meaningful.
Comment: while most Orthodox minyanim would not allow the ten people for the quorum to be assembled via Zoom, once there is an in-person quorum, reciting or answering Kaddish by Zoom, telephone, etc. is much less clear and may be allowed
Comment: There probably still are a very few orthodox minyanim that are still broadcasting on zoom, but it is certainly way way way fewer than non orthodox ones.


How to sort a large list of elements where everything is sorted but k elements?

Question: Assuming the list is very large, and $k$ is very small, what's the fastest algorithm to sort this list?
Answer: Here is an $O(k \log k + n)$ Algorithm. Assuming we are dealing with an ascending order. We assume $A$ is a linked list, an hence removing elements can be done in constant time. Given an array instead, we can preprocess it in linear time building a linked-list out of it.
<code>Let A be a given list of n elements.
Let B be an empty array.
For x in A do
- Let y be the element following x.
- As long as y < x then
- - Add x to B.
- - Add y to B.
- - Remove x from A.
- - Remove y from A.
- - If x was the first element,
- - - then break from the inner loop.
- - Set x to the previous element of x.
- - Set y to the following element of y.
Sort B with any efficient sorting algorithm.
Unify A and B in the array C efficiently.
Return the array C.
</code>
If an element $x$ is greater than the following element $y$, then at least on of them must be one of the $k$ elements, because else they must be sorted. Hence, we do not remove more than $2k$ elements from $A$. Since with each visit of the inner-loop except for the last one, we remove two elements from the array, and since we do not remove in total more than $2k$ elements, the total number of visits of the inner loop is at most $2k+n$. The size of $B$ is at most $2k$, since it only has the elements removed from $A$. Using quick-sort, we can sort $B$ in running time $O(k \log k)$ (note that $B$ is an array and not a list). Unifying two sorted arrays/lists in a new sorted list can be achieved in linear time using sliding-window.
The total running time is $O(n + 2k + k \log k + n + k) = O(k \log k + n)$.
Comment: If the array is initially $[M,\ldots,M+k-1,1,2,3,4,\ldots]$ where $M$ is a large number, then your algorithm will have $B=[M+k-1,1]$. Sorting $B$ and unify it with $A$ is not enough to sort the whole array.
Comment: You have to be more careful. After you removed two consecutive elements x and y, you must then recheck the element before x. In xskxzr's example, you would remove (M+k-1) and 1, then (M+k-2, 2) and so on.
Comment: @gnasher729, you are right, I will update the solution. However, the running time stays the same with a simple counting argument. Thanks for the note :)
Answer: If you start with a sorted array, and then k array elements are modified, the best would be to keep track of the array indices of the modified elements as they are modified, extract them into a separate array and sort them, then merge both arrays.