Find the angle that creating with Y axis in degrees

Question: I want to find the Q angle that creating with Y axis in degrees using vectors
Comment: Note, perhaps based on your screen name, I was thinking about computer code here. I went with $\cos^{-1}$ rather than $\tan^{-1}$ so that you would never throw an error due to a vanishing denominator.
Comment: Let me see if I understand the question. You have two points $(x_1, y_1)$ and $(x_2, y_2)$, and you want to know the angle between the $y$-axis and the line they determine. Is that right? (And there is some requirement to "use vectors" in some way?)
Comment: yes that's what i want
Comment: OK. I added vectorial aspect to my answer below.
Answer: Assume the two points are distinct, otherwise the problem is ill-posed.
Let $Y_1 = {\rm max}(y_1, y_2)$ and $Y_2 = {\rm min}(y_1, y_2)$. Then the angle between the line and the $y$-axis is $$\cos^{-1}\!\left({Y_1 - Y_2\over\sqrt{(x_1-x_2)^2 +(Y_1-Y_2)^2} }\right)\,.$$
If there is some requirement to use vectors, then the above expression can be derived vectorially as follows. Letting ${\bf r}_1 = (x_1, Y_1)$ and ${\bf r}_2 = (x_2, Y_2)$, define the unit vector $\hat{\bf r} = ({\bf r}_1 - {\bf r}_2)/||{\bf r}_1-{\bf r}_2||$. The unit vector $\hat{\bf y}$ defining the direction of the $y$-axis is $\hat{\bf y} = (0, 1)$. Now using the dot product, $\cos\theta = \hat{\bf y}\cdot \hat{\bf r}$. Working with components leads to the explicit expression above.
Answer: I don't know how to do with vectors. A simple way is to use $$\tan(90-\theta)=\dfrac{y_2-y_1}{x_2-x_1}$$
Or
$$\tan\theta=\dfrac{x_2-x_1}{y_2-y_1}$$
Take the solution of the above equation s.t. $\theta<\pi/2.$


Calendar data's storage in SQL

Question: Hi I would like to know in which db and table the datas for sharepoint calendar ?
I need to have a reading access to these datas with another application write in php.
Answer: Don't access the data directly in the SharePoint database. The database structure is difficult to workout and also Microsoft will not support your SharePoint environment if you are reading data straight out the database!
As TZHX says use the Web Services or even better use the REST interface or the Client Side Object Model instead. They have been built for the reason that you require.
More information can be found here:-
REST = http://msdn.microsoft.com/en-us/library/ff798339.aspx
Client Side Object Model = http://msdn.microsoft.com/en-us/library/ee537247(v=office.14).aspx
Comment: Best not to use signatures on stack exchange sites - your badge bottom right is your signature - see http://sharepoint.stackexchange.com/faq#signatures
Answer: The calendars are stored as a List in SharePoint, and so the data will be in the Content Database for the Web Application, in the AllUserData table.
Moral of the story, better to use web services than to try and parse these databaess yourself.

Calendar data's storage in SQL


Is bad for a person's 'financial reputation' to have transactions to lottery sites on his/her bank statement?

Question: I want to buy a UK National Lottery ticket using my debit card but I don't want my bank to hold this against me - I don't want to ruin my credit report.
Am I right to worry about this?
Comment: In the US I know that purchases to certain stores do not influence credit score one way or another.   I am not sure if the same system is used in the UK.
Comment: @gnasher729, do you have a cite for that? There are very particular things that are allowed to be noted on credit reports and as far as I am aware, lottery purchases are not one of them. (See eg http://www.which.co.uk/money/credit-cards-and-loans/guides/your-credit-report-explained/what-is-a-credit-report-/ )
Comment: It would be hard to draw a line. Would they start docking credit if they noticed you spend too much on McDonalds and run a higher risk of getting a stroke?
Comment: I deleted my answer, as I didn't notice the UK tag; I'm not sure about credit reporting laws there, in the US holding something like that against you would be illegal.
Comment: Nope, I have done the same once for a month or so and it didn't affect my credit score or report. But I have had good credit, since ever. Not sure if it affects if you have blemishes on your credit report. I would for sure call up my bank or one of the credit rating agencies just to be sure.
Comment: That certainly would depend on the amounts. If you paid out £500 a month, with a growing tendency, the bank would start worrying.
Comment: I can't imagine that being legal... if it were I would be very, very scared to live in a country with that sort of tracking.
Answer: Six years ago I heard a story on US public radio which resulted in an article, Credit Card Big Brother
To summarize, the credit score might not be directly impacted, but the issuing bank doesn't like to see lottery tickets, retreading tires, cash advances, hookers/strip joints, booze in large quantity.
In my opinion, the data mining has gotten out of control. But the original story really got me thinking.
Comment: While I listen to Marketplace regularly, I do so less to find out facts and more to learn what half-researched information is being passed on to an uninformed public by partially-informed news media.  True, Marketplace is generally more partially-informed than, say, CNN, but just because one hears it on their show does not mean it's true.  (I gave up sending them errata emails around 2009 and simply stopped donating to them.)
Comment: @dg99 - excellent point, the fact checking might lag quite a bit at NPR. Such stories do get you thinking, and I wouldn't be surprised to see this actually implemented in the future.
Answer: I don't think you need to worry about this for two reasons:

National Lottery is the state lottery, and would hardly be considered "dodgy" activity.
Data protection laws would forbid a bank releasing your bank account transactions to third parties - so they cannot report what you spend your money on to anyone without your explicit permission.  Even the police need a warrant to get a look at your bank account transactions.

Credit agencies such as Experian can only collect information relating to your debts (including when you ASK for debt), but you have to give permission (usually a condition of borrowing).
Answer: I don't quite share the confidence of @Corone's answer that data protection laws would mean your bank couldn't share details of your transactions with credit reference agencies - they already get an awful lot of latitude to share information without your consent
However, I do know that as a matter of practice they don't do this. It's easy to check what's listed on your credit report by applying for a copy from the three reference agencies (CallCredit, Equifax and Experian) and you'll see that what they hold related to your spending basically amounts to a list of your accounts, the amount you've borrowed on each, and your record of paying on time.
There's some information on how the credit reference agencies operate on the ICO's website.
In theory the place you have your account might directly look at your spending in more detail if you apply for credit directly with them. Also, when applying for a mortgage with anyone they will ask for details of your outgoings, and you would be obliged to answer honestly.
However in both cases it's highly unlikely that a small amount of money spent on lottery tickets would cause any problems. If you have very large outgoings on gambling - e.g. amounting to hundreds of pounds per month - whether on the lottery or other kinds of betting, that might be a different matter.
Comment: +1 for the mentioning the amount being spent as a potential factor
Answer: Having worked for a UK retail bank for many years I can assure you that nobody cares about individual transactions on your account as long as they don't take you overdrawn, or have to be returned (bounced) etc.  It certainly won't affect your credit rating.
The only issue might be if you were suspected on money laundering or some other illegal activity, that would then get escalated via the relevant channels, but even that wouldn't get near to affecting your credit rating.
In the UK there is legislation that forces any bank employee into reporting suspicious activity.


How to move the Search Bar/Div into the Navigation CustomMenu area?

Question: So Far I've done the following;
In catalogsearch.xml I have the following code:
<reference name="topMenu">
            <block type="core/template" name="top.search" as="topSearch" template="catalogsearch/form.mini.phtml"/>
        </reference>

then in custommenu/top.phtml I have the following code:

        <?php echo $this->getChildHtml('topSearch') ?>

The top.html code used to be in header.phtml - so I just copied it.
And the reference code  used to say reference name="header" so I just changed it to topMenu, but it doesn't seem  to work!  Am I missing something?
I know that the top.phtml file is correct because if I type in "WHERE IS THIS TEXT" it appears inside the menu area where I want the search bar to go.
However, I'm not sure I am referencing it correctly -  If I reference Top (it displays the search above the menu) - if I reference top.menu (it displays it below the menu).   So I thought It would be topMenu - but it shows nothing.
Could I be referencing it wrong?  Is it reference:  nav-container, or top-menu, or customMenu or something else?  Any help would be greatly appreciated.
Answer: Use top.menu as reference and it should work like charm.


How would a planet's surface be younger than the planet itself?

Question: Europa, one of Jupiter's moons, is 4.5 billion years old (like Earth.) However, its surface is only 20-180 million years old. What could lead to a planet/moon's surface being younger than the planet/moon itself?
Comment: The surface of our own Earth is younger than Earth itself, with the oldest exposed rocks being about half a billion years younger than the planet. (Which is to be expected. When Earth was formed it was a molten blob, and then we had that big collision which formed the Moon and re-melted the surface in the process.) The greatest part of the surface of the Earth is less than a billion years old, 3.5 billion years younger than the planet, with very extensive areas not older than maybe 600 million years.
Comment: Hi Sky and clouds ☁, this site is here to help you build your own fictional world (you can read more about this in the [tour] and [help/on-topic]). While your question could be considered on-topic here (we do need to build planets once in a while ^^), it helps if you focus on what you're "making", rather than what it "is". indeed, pure real-world questions are off-topic here. Sometimes that can be just a matter of wording things differently : "*How can I make my planet's surface be younger?*". By stating you want to "make" "your" planet, you're a lot more into worldbuilding.
Comment: Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer.
Answer: In short, you need a process that keeps renewing the surface.
One of the reason is plate tectonics. For this very reason also Earth surface is younger than the planet itself, and finding very old rocks is very difficult.
Heavy meteor bombardment can be another reason, rejuvenating the entire surface.
Comment: It doesn'r actually take plate tectonics as witnessed here on Earth, simply having a hot enough core suffices. Venus has been resurfaced despite not having plates as seen on Earth.
Answer: There's a difference between material age and appearance age
@L.Dutch is absolutely right about renewing the surface. (I upvoted his answer). In that case, the material age of the surface (e.g., how long those materials have been on Europa) is the same as the planet, but the appearance age is much younger because the appearance regularly changes. What are the most common causes?

Wind
Plate tectonics
Volcanism
Fluids, especially water

I'd like to address the idea of material age. There are ways to rationalize the idea that the material on the surface is younger than the material in the core. In this case, the less active the planet (ideally, no wind, tectonics, volcanism, or fluids) the easier it is to rationalize a young material age.

Meteors
Cosmic dust
Merging planets (bit catastrophic, this one)

In this case, it's the source of the material that's the bigger issue: a comet that degrades with each pass near its sun, the remains of a planetary body (think, "like our asteroid field") or the sweep of a nebula that hasn't yet been fully consumed during star formation.
Note that we're talking geological time scales here. Nebulae aren't all that dense, but they're quite a bit more dense than open space.
However, your bigger problem is explaining how you know that the surface is younger than the core
Let's assume a planetary body with no atmosphere at all. It's small enough to justify the inability to keep one. How do you know if, e.g., constant bombardment from Leonids-style meteors created a younger surface than the core? Without the chemistry of an atmosphere, it's a bit harder, but not impossible.

Carbon-14 dating is only practical for ages up to about 50,000 years and works because cosmic radiation keeps carbon-14 quantities in the atmosphere fairly constant. In other words, "fresh" carbon-14 is absorbed into things fairly constantly and we can look at its decay compared to "today" to calculate an age. But you need a source of carbon-14 for this to work and with the wrong atmosphere (or without an atmosphere) this solution can't be used. Besides, for the most part, it's only really practical to date things that were once alive.

Potassium-argon dating can date volcanic materials ranging from less than 100,000 to more than 4 billion years old.

Rubidium-strontium dating can be used to determine the ages of items ranging from a few million to a few billions of years old.

Uranium-thorium-lead dating is the most useful for the oldest objects due to long half-lives and predictable degradation to lead.

Luminescence dating exposes long-buried geology to light to determine how long the geology has been buried.

All but the first of those tests could be used to rationalize knowing the age of your surface and core.
It's worth remembering that from a simplistic point of view, all atoms are the same age (kinda)
It's perhaps more accurate to say that all electrons, protons, and neutrons are the same age (at least the word "kinda" is less applicable). Atoms are involved in chemical reactions that changes atomic structure. Thus, in a star hydrogen is slowly turned to iron. But those electrons, protons, and neutrons have (basically) all been with us since the Big Bang.
In other words, you're measuring dates from the last big event. For the age of a planet, the last big event was planetary formation, meaning that a lot of (e.g.) carbon has been sitting there in a big ballish shape for a honking long time. But the stuff that impacts the planet to change the surface's material age has also been around a long honking time... but it wasn't sitting atop all that carbon, etc.
And that makes all the difference.
OK, I've been rambling...
Conclusion
You can change the appearance age by changing the surface without changing most of the mantle (what I've been calling the "core" though this answer... but the core's involved, too).
You can change the material age by depositing mass onto the surface that wasn't part of the original planet-forming process.
Imagine that... even on cosmological scales, things get dusty.
Comment: Actually, in nuclear reactions you can change protons to neutrons or the other way around (expelling electrons or positrons on the way, sometimes also other stuff). When stars burn Hydrogen to Helium, they basically make (via several steps) 4 protons into 2 protons and 2 neutrons (plus positrons and a bunch of neutrinos).
Comment: @PaŭloEbermann I don't doubt that you're right! But I was trying to do too many things at once, one of which was to remind the reader that all matter in the universe is the same age, so it really depends on how one identifies the starting point for the calculation - and I realized in the middle of trying to explain that, that you must look at the universe more basically than the atomic level to judge "age."
Answer: In the case of Europa, but also Io, tidal forces from Jupiter's gravity cause internal heating, leading to increased volcanic and tectonic activity. For instance, Io is the most volcanically active body in the Solar System due to Jupiter's gravitational pull.
Similarly, the tidal forces on Europa lead to significant heating of its interior. This heating is believed to maintain a subsurface ocean beneath Europa's icy crust. The continuous flexing of Europa's surface due to these tidal forces also facilitates the cracking of its ice layer, which explains why the surface is younger than the moon.
You can read more about this phenomenon here.


What is the etymology of 'after' meaning to want something?

Question: Where does this particular meaning of "after" come from? As in

I'm after this product
She was after the money

Is it a reduced form of a phrasal verb such as inquiring after? Chasing after?
Answer: After(preposition) meaning "in pursuit of; wanting, desiring" is probably an extension of the original meaning "behind in place or position; following behind." Its usage dates back to the late 18th century:

He is after her job (1775+)

From: The Dictionary of American Slang, Fourth Edition by Barbara Ann Kipfer, PhD. and Robert L. Chapman, Ph.D.
Answer: There is no "special etymology" of this usage. It comes from one of the original meanings of after. Although a better definition of to be after is

To be trying to get or achieve (something)

(OED).
After has always1 meant

In pursuit of, following with the intent to catch (a person or thing in motion); in the direction of. Also with elision of verb of motion.
In search of, in order to find or get (a person or thing at rest). Freq. with come, go, and send.

These definitions are from the Oxford English Dictionary (OED). Notice that the verb of motion has sometimes been elided or omitted. An example of this elision or omission is from 16272:

He must after them, and smite them, and plucke the spoyle [spoil] out of their teeth.

The OED also has an entry for
to be after

To be trying to get or achieve (something).
To be in pursuit of (a person), esp. with hostile intent; to be trying to get into the company of (a person).
To urge (a person) repeatedly to do something; to nag or harass (a person) about something.

The OED gives an early example of this from 16803:

The French and Dutch have been after our Wooll [wool] since they set up their Woollen Manufactures; why have they and their Agents been lurking on our Coasts..to filch it away for so many years?

Again, notice the 1680 date. There is not any special etymology of this use of after. It expresses one of the original meanings of the preposition.
Hope this is helpful!

1 Since the days of Old English, "the language of the Germanic inhabitants of England, dated from the time of their settlement in the 5th century to the end of the 11th century." Source: Old English Online, The University of Texas at Austin.
2 Ten sermons preached I. Ad clerum. 3. II. Ad magistratum. 3. III. Ad populum. 4. By Robert Saunderson Bachellor in Diuinitie, sometimes fellow of Lincolne Colledge in Oxford. online version. Cited in the OED.
3 Britannia languens (or, A discourse of trade shewing, that the present management of trade in England, is the true reason of the decay of our manufactures, and the late great fall of land-rents; and that the increase of trade, in the method it now stands in, must proportionably decay England. Wherein is particularly demonstrated, that the East-India Company, as now managed, has already near destroyed our trade in those parts, as well as that with Turky, and in short time must necessarily beggar the nation. Humbly offered to the consideration of this present Parliament), by William Peyt. online version.


How do I get the selected object's distance from the camera?

Question: I need to precisely visualize one object's distance in order to properly tune 3D sound properties. How can I measure the distance between me (the camera) and said object?
Answer: To get the distance between two objects in the scene :

setup a driver with the following settings

type : Scripted Expression
expr : var

add new variable 'var' of type Distance
set the targets to the objects of interest
Now the driver value is the distance between these two object
Comment: This was flagged as low quality, can you add more to it. As it is your answer would be useless without the image.


Changing quality of video in iframe to another setting

Question: I am embedding a youtube video into an iframe. Now the video quality has 2 settings: 360p and 240p. Now Youtube chooses 240 as the default everytime, and it looks crap. How can I change the default quality to be the highest possible, 360p in this case?
I tried setting the parameter ?hd=1 at the end of the video link, but it does not work:
like so:

Any ideas? Is it even possible?
I also played around with this developer tool from Google, which is quite cool btw, but no luck with the 380p...
https://developers.google.com/youtube/youtube_player_demo
Answer: You just want to use vq parameter instead of hd:

vq can also be: small, large, hd720, hd1080.


Expression of Bianchi identity in associated bundle

Question: Theorem 5.14.2 of Mathematical Gauge Theory by Hamilton states that the curvature form $F^A_M\in\Omega^2(M,Ad(P))$ satisfies the third form of the Bianchi identity $d_AF^A_M=0$ where $F^A_M$ is the form in $\Omega^2(M,AD(P))$ given by the correspondence between horizontal $k$-forms of type Ad on $P$ with values in $\mathfrak{g}$ and forms on $M$ with values in $Ad(P)$. The proof of this is basically applying this isomorphism to the bianchi identity $dF^A+[A,F^A]=0$. I am interested in how to show that $d_AF^A_M\in\Omega^2(M,AD(P))$ actually corresponds to $dF^A+[A,F^A]$. It has to do with the fact that with respect to a local gauge $s:U\rightarrow P$ we can write $(d_A\omega)_s=d\omega_s+A_s\wedge \omega_s$ and the fact that for $1$-forms the wedge product "is the commutator".
Any help is appreciated
Answer: To answer this question, it is useful to look how the exterior covariant derivative $\mathrm{d}_{A}$ acts on form on $P$ and not on $M$. Let us fix the following data.

A smooth manifold $M$.
A principal $G$-bundle $P$ over $M$ with $\mathfrak{g}=\mathrm{Lie}(G)$.
A finite-dimensional representation $(V,\rho)$ of $G$ and let $E:=P\times_{\rho}V$ be the associated vector bundle.

Let $A\in\Omega^{1}(P,\mathfrak{g})$ be a connection $1$-form. Now, there are two common ways to define the object $\mathrm{d}_{A}$, i.e. the exterior covariant derivative induced by $A$. One approach is to first of all define a connection $\nabla^{A}$ on $E$ using a parallel transport. Then, one defines $\mathrm{d}_{A}$ to be the exterior covariant derivative induced by $\nabla^{A}$. This approach is for example followed in Hamilton's book Mathematical Gauge Theory. However, there is another approach, which can be found in many other books (e.g. Baum's Eichfeldtheorie), which is equivalent. In this approach, one first constructs a natural derivative on forms on $P$, which preserves horizontal forms, and then one induces $\mathrm{d}_{A}$ on forms on $M$ using the usual isomorphism. The connection $\nabla^{A}$ is then recovered as the operator $\mathrm{d}_{A}$ acting on zero-forms.
In more details: First of all, we would like to define a natural derivative on $\Omega^{k}(P,V)$. A natural canditate is to take the usual exterior derivative $\mathrm{d}:\Omega^{k}(P,V)\to\Omega^{k+1}(P,V)$. However, in the language of principal bundles, it is more natural to have an object preserving horizontal vector fields. Hence, we consider
\begin{align*}
        \mathrm{D}_{A}:\Omega^{k}(P,V)\to\Omega^{k+1}(P,V)
    \end{align*}
which we define for all $k\in\mathbb{N}_{0}$ and for all $\omega\in \Omega^{k}(P,V)$ by
\begin{align*}
    (\mathrm{D}_{A}\omega)_{p}(v_{1},\dots,v_{k}):=(\mathrm{d}\omega)_{p}(\mathrm{pr}_{H}(v_{1}),\dots,\mathrm{pr}_{H}(v_{k}))
\end{align*}
for all $p\in P$ and $v_{1},\dots,v_{k}\in T_{p}P$, where $\mathrm{pr}_{H}:TP\to H$ denotes the projection onto the Ehresmann connection $H$ defined by $A$. Now, it turns out that this operator has the following very nice property:

$D_{A}$ maps $\Omega^{k}_{\mathrm{hor}}(P,V)^{\rho}$ to $\Omega^{k+1}_{\mathrm{hor}}(P,V)^{\rho}$. Furthermore, for $\omega\in\Omega^{k}_{\mathrm{hor}}(P,V)^{\rho}$, the following formula holds
$$D_{A}\omega=\mathrm{d}\omega+A\wedge_{\rho}\omega,$$
where $\wedge_{\rho}$ is the natural wedge product $\wedge_{\rho}:\Omega^{k}(P,\mathfrak{g})\times\Omega^{l}(P,V)\to\Omega^{k+l}(P,V)$ defined by the pairing $\langle\cdot,\cdot\rangle_{\rho}:\mathfrak{g}\times V\to V,(X,v)\mapsto \rho_{\ast}(X)v$, i.e. $A\wedge_{\rho}\omega:=\sum_{a,b}(A^{a}\wedge\omega^{b})\langle T_{a},e_{b}\rangle_{\rho}$ for basis $(T_{a})_{a}$ of $\mathfrak{g}$ and a basis $(e_{a})_{a}$ of $V$.

Secondly, thanks to the natural isomorphism
$$\Omega^{k}_{\mathrm{hor}}(P,V)^{\rho}\cong\Omega^{k}(M,E)$$
the operator $D_{A}$ induces an operator $\mathrm{d}_{A}:\Omega^{k}(M,E)\to\Omega^{k+1}(M,E)$. This is the same operator as defined using the strategy of parallel transports used in Hamilton's book. Usually, people denote both $D_{A}$ and $\mathrm{d}_{A}$ by the same symbol, but I wanted to avoid confusions. In particular, you see that under the isomosphism above, you get the following correspondence:
$$D_{A}\omega=\mathrm{d}\omega+A\wedge_{\rho}\omega\quad \mapsto \quad\mathrm{d}_{A}\omega_{M}$$
where $\omega_{M}\in\Omega^{k}(M,E)$ is the form obtained from $\omega\in\Omega^{k}_{\mathrm{hor}}(P,V)^{\rho}$ via the isomorphism above. Now, if you take $(\rho,V)$ to be the adjoint representation $(\mathrm{Ad},\mathfrak{g})$ of $G$ (and hence $\mathrm{Ad}_{\ast}=\mathrm{ad}$), you get the formula
$$D_{A}\omega=\mathrm{d}\omega+[A,\omega]$$
which is a global version of the local formula you very mentioning. In particular, you see that $\mathrm{d}_{A}F_{M}^{A}$ really corresponds to $D_{A}F^{A}=\mathrm{d}F^{A}+[A,F^{A}]$ as you claimed.
Comment: Ok this really really helps, however I am still struggling to see why in the case of the adjoint representation we get the commutator. Following the definition if both $A$ and $\omega$ are written as $A^a\otimes T_a$ and $\omega^b\otimes \omega_b$ we get
$
A\wedge_{\rho}\omega:=\sum_{a,b}(A^{a}\wedge\omega^{b}) \rho_*(T_{a})T_{b}=\sum_{a,b}(A^{a}\wedge\omega^{b}) [T_{a},T_{b}]$
is this equal to $[A,\omega]$?
Comment: Moreover in this approach we have actually \emph{defined} $d_A$ as the composition of $D_A$ with the isomorphism right?
Comment: Yes it is. The notation $[\cdot,\cdot]:\Omega^{k}(M,\mathfrak{g})\times\Omega^{l}(M,\mathfrak{g})\to\Omega^{k+l}(M,\mathfrak{g})$ is the natural wedge product induced by the Lie bracket $[\cdot,\cdot]:\mathfrak{g}\times\mathfrak{g}\to\mathfrak{g}$. By definition, $[\alpha,\beta]=\sum_{a,b}(\alpha^{a}\wedge\beta^{b})[T_{a},T_{b}]$ where $\alpha=\sum_{a}\alpha^{a}T_{a}$ for $\alpha^{a}\in\Omega^{k}(M)$ and similar for $\beta$. (I usually prefer the notation $[\cdot\wedge\cdot]$ to stress that it is a mix of wedge product and Lie bracket.)
Comment: @PunkZebra yes exactly, it is the composition with the isomorphism, or better, the conjugation, i.e. $\mathrm{d}_{A}=I^{-1}\circ D_{A}\vert_{\Omega^{\bullet}_{\mathrm{hor}}(P,V)^{\rho}}\circ I$ where $I:\Omega^{k}(M,E)\to\Omega^{k}_{\mathrm{hor}}(P,V)^{\rho}$ denotes the isomorphism.
Comment: I cannot stress how much you've helped me, thank you (after thoroughly reviewing everything I'll accept your answer)
Comment: @PunkZebra your welcome :-)


What is the difference between fork and thread?

Question: Can anyone explain the difference between a fork and a thread?
Answer: A fork gives you a brand new process, which is a copy of the current process, with the same code segments. As the memory image changes (typically this is due to different behavior of the two processes) you get a separation of the memory images (Copy On Write), however the executable code remains the same. Tasks do not share memory unless they use some Inter Process Communication (IPC) primitive.
One process can have multiple threads, each executing in parallel within the same context of the process. Memory and other resources are shared among threads, therefore shared data must be accessed through some primitive and synchronization objects (like mutexes, condition variables and semaphores) that allow you to avoid data corruption.
Comment: You probably want to refer to "copy of the current process" as a child process.
Comment: The text segment however is often shared (virtually) and even data segment can be copy-on-write.
Comment: Answer: NO
https://stackoverflow.com/questions/10080811/what-happens-to-other-threads-when-one-thread-forks
Answer: Fork
Fork is nothing but a new process that looks exactly like the old or the parent process but still it is a different process with different process ID and having its own memory. The parent process creates a separate address space for the child. Both parent and child process possess the same code segment, but execute independently from each other.
The simplest example of forking is when you run a command on shell in Unix/Linux. Each time a user issues a command, the shell forks a child process and the task is done.
When a fork system call is issued, a copy of all the pages corresponding to the parent process is created, loaded into a separate memory location by the OS for the child process, but in certain cases, this is not needed. Like in 'exec' system calls, there is no need to copy the parent process pages, as execv replaces the address space of the parent process itself.
Few things to note about forking are:

The child process will be having its own unique process ID.
The child process shall have its own copy of the parent's file descriptor.
File locks set by parent process shall not be inherited by child process.
Any semaphores that are open in the parent process shall also be open in the child process.
Child process shall have its own copy of the parent's message queue descriptors.
Child will have its own address space and memory.

Threads
Threads are Light Weight Processes (LWPs). Traditionally, a thread is just a CPU (and some other minimal state) state with the process containing the rest (data, stack, I/O, signals). Threads require less overhead than "forking" or spawning a new process because the system does not initialize a new system virtual memory space and environment for the process. While most effective on a multiprocessor system where the process flow can be scheduled to run on another processor thus gaining speed through parallel or distributed processing, gains are also found on uniprocessor systems which exploit latency in I/O and other system functions which may halt process execution.
Threads in the same process share:

process instructions
most data
open files (descriptors)
signals and signal handlers
current working directory
user and group id

More details can be found here.
Comment: A process can have several threads.  If one of the threads in a process calls fork, does the forked process have a fully duplicated memory, but only the calling thread is in the new process?
Comment: Answer: YES
https://stackoverflow.com/questions/10080811/what-happens-to-other-threads-when-one-thread-forks
Comment: Even though the child process has its own address space, it is an exact copy of the parent address space, this implies if there is a random variable `int a = 10` in the parent process which occupies memory location 1000th in the parent address space, then even in the child process `int a = 10` will occupy the same 1000th memory address. Still, the modification of `a` will be different for parent and child process, each of them can modify `a` without affecting others since it is a copy.
Answer: Dacav's answer is excellent, I just wanted to add that not all threading models give you true multi-processing.
For example, Ruby's default threading implementation doesn't use true OS / kernel threads. Instead it mimics having multiple threads by switching between the Thread objects within a single kernel thread / process.
This is important on multiprocessor / multi-core systems, because these types of lightweight threads can only run on a single core - you don't get much in the way of performance boost from having multiple threads.
The other place this makes a difference is when one thread blocks (waiting on I/O or calling a driver's IOCTL), all Threads block.
This isn't very common nowadays - most threading implementations use kernel threads which don't suffer from these issues - but its worth mentioining for completeness.
By contrast, fork gives you another process which is runnable simultaneously on another physical CPU while the original process is executing. Some people find IPC more suitable for their app, others prefer threading.
Good luck and have fun! Multi-threading is both challenging and rewarding.
Comment: +1 for hitting a nerve: "not all threading give you true multiprocessing"
Answer: Threads are functions run in parallel, fork is a new process with parents inheritance.
Threads are good to execute a task in parallel, while forks are independent process, that also are running simultaneously.
Threads have race conditions and there controls semaphores and locks or mutexes, pipes can both be used in fork and thread.


By buying stocks, am I as an individual measurably affecting the economy?

Question: I know that participating in an IPO is directly helping the company, because my money is going straight into their bank account. I know that the stock market as a whole has an effect on the economy. However, what would be the measurable effect of me buying $1,000,000 of, say, Amazon? They've already IPO'd, so it's just a million of my dollars getting spread out between other random people who were selling regardless of whether or not I, personally, am buying. I guess all it does is create a slight upward pressure on the stock? Can the effect of that upward pressure be quantified in some way that means something to a layman, e.g. "it creates 1 new job in the US" or "it's equivalent to spending a million on arbitrary consumer products"?
Comment: Welcome! This question is likely to be answered with opinions rather than facts and citations. It should be updated so it will lead to fact-based answers.
Answer: From an aggregate level, the only direct income effect is that you will have paid a brokerage fee, which is part of the financial sector's revenue.
After that, all that has happened is a rearrangement of an existing financial asset. If the seller uses the proceeds to purchase goods and services for consumption, that could be attributed to the purchase, although that might be a stretch.
The seller may also pay capital gains tax, and since they need a buyer to sell, that could be pinned on the purchase.
The effect on the price is hard to judge. In the short term, there might be some effect (although it would be negligible for a large cap firm), it will not really matter in the long run, if we assume that prices drift towards the fair value determined by corporate profitability.


Submission of an article from the XXX Medical 'Center' to a journal that requires British spelling

Question: I am editing a scientific paper that specifies British spelling. But the name of the author's research institute is The XXX Center for Medical Research.
Should I change this to Centre?
Comment: This might be a better question to ask on [academia.se]. But I'd advise to leave the name of the center as the actual name of the center.
Answer: No. Proper nouns should retain their spelling, even when this is at odds with the normal style and spelling rules. So, The Atlanta Center for Medical Research is a centre of research into medical matters.


Deploy pyramid/pylons application on shared hosting

Question: I have a locally developed Pylons application. I also have hosting provider with SSH access, python 2.6 and have set a virtual environment on the server. After that using easy_install I have installed Pylons and achieved to execute it on port XXXX. The problem is that the firewall of the server is blocking any port other from 80 (the port of the Apache http). Can I redirect Apache to forward to my Pylons server?
Answer: If you are in jail or virtual container where running your isolate instance of apache, just kill it.
You can see process list  by execute 'top' utility.
Answer: You need to configure a virtualhost in apache so that it uses wsgi.
There's a plenty of topics in stackoverflow about this, such as
Trying to get Pyramid running under Apache + mod_wsgi but it's failing
(you can follow the link in the first sentence).
If you cannot use mod_wsgi, that you can try with mod_rewrite or mod_proxy, which have worse performance. If you cannot change the apache configuration, ask you provider, or start thinking about changing provider.


Dynamic Linq .OrderBy in VB.Net not accepting strings

Question: I'm having a problem implementing Scott G's Dynamic.vb extension at http://weblogs.asp.net/scottgu/archive/2008/01/07/dynamic-linq-part-1-using-the-linq-dynamic-query-library.aspx in my vb solution.  I know there are probably other ways, but this approach would give me such great flexibility.  I've searched StackOverflow (80+ Q&As) and numerous other sites without much luck.  I'm using VS 2010.
I've included Dynamic.vb in a problem with no root namespace, and then added a reference to that project in my main one.  I'm getting intellisense for 4 overloads (rather than 2) so I'm pretty certain that the extension is in scope.
I was having a tough time with clauses, especially the OrderBy as Scott demonstrated.  If I simply pass a string as Scott's VB example did I get the error "Overload resolution failed because no accessible 'OrderBy' can be called with these arguments."
The line of code is:
Dim FilteredComponentList = From Component As MX.Component In ComponentList.AsQueryable _
                                    .OrderBy("Name")

So I found other references that stated to pass a Lambda expression.  So I tried this and at least I get no error, even if the sort function still doesn't seem to work.  Here is the code that compiles and executes.

    Private Sub SortByColumn()

        If Not cmbComponentFilter.SelectedItem.ToString = "All" Then
            Dim FilteredComponentList = From Component As MX.Component In ComponentList.AsQueryable _
                               Where Component.ComponentType.ToString = cmbComponentFilter.SelectedItem.ToString _
                               Order By Component.Name

            Dim OrderedFilteredComponentList = From Component As MX.Component In FilteredComponentList.AsQueryable _
                                               .OrderBy(Function(str) dgvComponents.Columns(e.ColumnIndex).Name)

            bsComponentList.DataSource = OrderedFilteredComponentList
            dgvComponents.DataSource = bsComponentList
        Else
            Dim FilteredComponentList = From Component As MX.Component In ComponentList.AsQueryable _
                                        .OrderBy(Function(str) dgvComponents.Columns(e.ColumnIndex).Name)

            bsComponentList.DataSource = FilteredComponentList
            dgvComponents.DataSource = bsComponentList

        End If

    End Sub

When I interrogate the dgvComponents.Columns(e.ColumnIndex).Name it gives the objects property I wish to sort by, but the sort still isn't working.  I'm concerned why I can't get Scott's implementation to work, but I've heard his keynotes and read his blogs, so I'm guessing the problem lies with my implementation.
I'd like either to work but need to understand why as well.  Why doesn't passing a string work? Isn't the PARAMARRAY declared in the function optional?  I've gotten 8 hours invested in this, and while I could go down other paths, I'm too committed to finding the answer to this approach to give up (suicide pact with an approach.)
Any guidance would be greatly appreciated.  I'm so demoralized that it wouldn't even bother me if it was a silly mistake (which it often is.)
Thanks for any assistance.
r/Jamie
Comment: I think you need something like `Function(str) str.Name`
Comment: Thanks Alvin. The dgvComponents is a datagridview that is bound to an observable collection. When you click the column header, this statement:  dgvComponents.Columns(e.ColumnIndex).Name)  returns the object bound property name.  This would be analogous to added an  Order By objComponent.Name where Name is the column header you clicked on.  In debug, I can see that this portion of the statement is returning the desired string.
Answer: Okay, I'm an idiot.  I forgot to include:
Imports System.Linq.Dynamic

In the class using the extension.  Now that I've done that, this works without the lambda express.  New code that works follows, Lambda's not required:
    Private Sub SortByColumn()

    If cmbComponentFilter.SelectedItem.ToString <> "All" Then
        Dim FilteredComponentList = From Component As MX.Component In ComponentList.AsQueryable _
                           Where Component.ComponentType.ToString = cmbComponentFilter.SelectedItem.ToString

        Dim OrderedFilteredComponentList = From Component As MX.Component In FilteredComponentList.AsQueryable _
                                           .OrderBy(dgvComponents.Columns(e.ColumnIndex).Name)

        bsComponentList.DataSource = OrderedFilteredComponentList
        dgvComponents.DataSource = bsComponentList
    Else
        Dim FilteredComponentList = From Component As MX.Component In ComponentList.AsQueryable _
                                    .OrderBy(dgvComponents.Columns(e.ColumnIndex).Name)

        bsComponentList.DataSource = FilteredComponentList
        dgvComponents.DataSource = bsComponentList

    End If

End Sub

Now that I have the extensions working, I think this approach will add a lot of value and reduce the coding effort to dynically select, sort, filter, etc data based upon user selections.  I hope my troubles might assist others at my level to better understand how to make this work in vb.net.


How can i achieve the effect of this video, focused in the foreground with a blurred background?

Question:

What type of camera or software, do I need to achieve that?
Answer: You need a camera with a relatively large sensor and a fast lens.  What you are seeing is actually a property of optics called Depth of Field.  Only a certain distance from the camera can be in focus at any given point for a given aperture and focal length.  The degree of how out of focus it appears is also relative to the size of the image being projected (thus the distance from the point where the image inverts) and thus, larger sensors show more blur.
Cheap cameras often use very small sensors and thus have a hard time getting a shallow depth of field, however any DSLR will achieve it quite easily, as will any more professional video camera with a larger sensor.  Shoot with the aperture as wide open as possible and try to have the camera relatively close to the subject with the background as far away as possible.
Technically, increasing focal length will also decrease the depth of field, but then you have to move back from the subject which will increase it again.  You want a small depth of field close to the camera so that the background can be significantly out of focus.  If it is too out of focus, you can adjust the aperture or the ratio between the camera, the subject and the background to make it less blurry (by expanding the depth of field).
You can also use many online Depth of Field calculators to figure out a shooting situation with a particular camera prior to trying it in real life.  They won't visualize it for you, but they will give you an idea of what distances will be in focus and which will be out.  There are also lots of great articles on depth of field over on our Photography sister site, though they don't deal with video specifically, but the principal is the same.
In a pinch, you can fake it as well using masks and blurs, but that's really not an ideal way to do it.  In camera always looks better.
Comment: If you can't change cameras, then making sure your aperture (aka Iris) is as wide open as possible will also decrease your depth of field, as mentioned. In some situations a neutral density filter will help, by decreasing the light going into the lens, meaning that the camera will open up the aperture to compensate.
Answer: The simplest way i suggest is to blur the background with video editor after shot by your recorder. It's not hard to operate, check this tutorial about  How to blur Something out in a picture or video with Adobe photoshop.
Comment: Welcome to Audio/Video Professional and thanks for taking the time to answer.  Unfortunately, this does not accomplish the look from the question.  A depth of field blur needs to vary based on how far away something is from the focal plane and needs to keep things sharp.  There are post processing depth of field blur filters available, but they all do fairly poor jobs as they lack the necessary depth information to properly apply the blur.  For a fixed video shot, it could be approximated with a depth mask, but that would have to track anything moving in the shot) in order to update the mask.


Using Disqus, how to stop storing comments in wp database?

Question: I'm using disqus comments system, but it keeps storing the comments in the wordpress database as well. Is there way to disable option to store comments in wordpress database because I don't see any use of it.
Answer: The disqus plugin synchronizes your WordPress comments with the disqus system -- that's it's main purpose (own your own comments, etc). You can get around this by ditching the built in WordPress commenting system altogether, modifying your theme templates (probably just comments.php) to use the stand-alone disqus javascript.
<code><script type="text/javascript">
        var disqus_shortname = ''; // required: replace example with your forum shortname
        var disqus_identifier = '<?php the_guid() ?>'; // globally unique identifier. *should* never change.
        var disqus_url = '<?php echo get_permalink(); ?>'; //link-back to this page
        /* * * DON'T EDIT BELOW THIS LINE * * */
        (function () {
            var dsq = document.createElement('script');
            dsq.type = 'text/javascript';
            dsq.async = true;
            dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js';
            (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
        })();
    </script>
</code>
Comment: Thanks, could you tell me a little what this actually does?
Comment: This code is straight from Disqus' standalone javascript code. Basically you're setting up some javascript variables unique to your site that identify the site and the current thing being commented on. Then Disqus' embed.js is created asynchronously and uses those variables to display the proper comment form.
Answer: Did you already try disabling the sync from Disqus to WordPress?

(This is under plugin settings in the Disqus Dashboard view.)
FYI: The use of storing comments is to protect yourself against data loss if Disqus goes under, or if you want to migrate to a new plugin in the future.
Of course, you can manually sync with a setting as well, so barring an apocalyptic failure/shutdown of Disqus you're probably fine not storing the comments in your database.


Go to the previous wallet address

Question: The computer reinstalled the system, and then downloaded the bitcoin core again. I forgot my wallet, and then the exchange transferred the previous wallet address. Can I still retrieve it?
Answer: It's not possible to recover your coins unless you have a backup of the wallet.dat file. If you had a notable amount of coins, you can try using a file recovery software, although I believe they can't recognize wallet files.

Go to the previous wallet address


How long should I charge a DSLR battery for the first time for best results?

Question: I have purchased a Canon 1200D and am wondering how long I should charge the battery when it arrives. I've heard people say that we need to charge a battery for one day to prevent battery "memory".
Do I actually need to charge the battery for that long, or will two hours be sufficient?
Comment: Have you checked the manual that came with the camera? Especially the 'getting started' section
Comment: I have found a similar question with an accepted answer on superuser http://superuser.com/questions/629106/why-the-first-time-charge-is-important
Hope this helps.
Comment: laurencemadil : in manual its mentioned about charging only, not mentioned about the battery first time and batery memmory details.
Answer: In general I'd recommend charging the battery fully before 'playing'. However this probably isn't necessary with modern lithium ion batteries, which don't suffer from memory effects.
The idea of battery memory and long first charges is a hangover from the day's of NiCd batteries.
When in doubt though read the manual.
Comment: NiMH having any significant battery memory effects? I thought battery memory effects were significantly less of an issue with NiMH than with NiCd. Wikipedia seems to agree, to some extent: [NiCd](https://en.wikipedia.org/wiki/Nickel-cadmium#Memory_effect) and [NiMH](https://en.wikipedia.org/wiki/Nickel%E2%80%93metal_hydride_battery#Loss_of_capacity).
Comment: @Michael Kjörling thanks, my mistake I had NiCd and NiMH confused, I've updated my answer
Answer: The battery charger that comes with your camera indicates when the battery is fully charged. After this point is reached, it will stop charging the battery, so leaving the battery in the charger any longer than this will have no effect.
My recommendation is to simply charge the battery until the charger indicates that it is fully charged before using it for the first time. The manual should give you an estimate on how long this will take. For instance, the battery for my EOS 750D takes about 2 hours to fully charge.
The memory effect of lithium-ion batteries is negligible. The software in your camera may however do some battery calibration, so it may be a good idea to completely discharge and then fully recharge the battery every once in a while.
Comment: @FreeMan Devices running on lithium-ion batteries contain battery regulators which will prevent the battery from being discharged completely. Using a device until it powers itself off due to low battery should be completely safe. You just shouldn't leave it in a drawer like that for a year.
Comment: Even the article in question admits that you need to periodically run laptop batteries all the way down to allow the hardware that monitors the amount of remaining power to recalibrate itself.  This is true for cameras as well.  Otherwise, you'll get down below a certain point and the battery will suddenly stop producing enough power to keep the device running, and it will go instantly dark in the middle of saving an image or whatever when the regulator becomes unable to deliver the required output voltage.
Comment: [Don't fully discharge Li-ion batteries](http://www.howtogeek.com/169669/debunking-battery-life-myths-for-mobile-phones-tablets-and-laptops/) (first section). Otherwise, I agree with you 100%.
Comment: @Jules Did you read FreeMan's reference and note what they say. The issue is not discharge below minimum but discharge to anywhere near minimum. LiIon cycle life and whole of life stored capacity is increased substantially by not discharging to minimum level. Staying at least 10% away is useful and very much shallower discharges more so. Best of all also do not fully charge for longest lifetimes. (The Mars rovers that use LiIon batteries charge them to only 3.6V max (!!!!!!) (Note that that's NOT LiFePO4  but LiIon.]
Answer: You don't need to do this when purchasing a DSLR.
When you get the DSLR, it has probably around 40% charge because that's the optimal charge for long-term storage. If that partial 40% charge doesn't annoy you, you can start shooting immediately. Or, you can charge it immediately if you want to.
DSLR lithium-ion batteries are unlike car lead-acid batteries, they like operation at partial charge. So, actually charging the battery to full reduces its lifetime! So, you get slightly better battery lifetime if you start using it immediately and then charge when the red low charge indicator blinks. But you get only 40% of an additional cycle for free, with battery lifetimes being around 500 cycles, so the benefit in starting to use it immediately without charging are minimal.
To avoid battery problems, you should avoid elevated temperatures at 100% charge. Most laptop batteries spend most of their time at elevated temperatures and at near 100% charge, and they last only a few years. DSLRs do not heat up naturally as much as laptops do, so the only thing you need to keep in mind is to not leave a 100% charged battery in a hot car. Try to avoid storing batteries in freezing temperatures as well. Electric cars have in-built battery heating systems, DSLRs don't.
Also, try to avoid charging obsession (charge to 100%, use until 90% charge left, charge to 100%, use until 90% charge left, ...). So, don't recharge all the time, recharge only when you have used a sizable fraction of the battery capacity (not necessarily draining it to completely empty, as partial cycling may have benefits). The reason is that charging damages batteries the most if it's nearly empty or nearly full*. Try to prefer charging whenever you see the red low charge indicator blinking, instead of using every last percent of the battery charge.
If you need to store a battery for a long amount of time, charge or deplete it to approximately 40% charge level, put it to a plastic sealed ziploc bag, and store it in a refrigerator.
The charging is fully automatic. It will show when it's full and there's no need to leave it in the charger for a longer amount of time. No damage either if you forget the battery in the charger.
With these tips, I'm sure you'll have many useful years of battery operation.
* sources / justifications:

http://blog.evandmore.com/lets-talk-about-the-panasonic-ncr18650b/ shows that Tesla batteries shouldn't be charged to 100% but rather to 90% and that partial cycles have much better life than full cycles
https://batteryuniversity.com/learn/article/how_to_prolong_lithium_based_batteries shows full cycles (from completely empty to completely full and in the other way around) damage li-ion the most
It's well-known that shallow-cycling in Toyota hybrids (although for NiMH, not for li-ion) achieves huge cycle counts, in the hundreds of thousands of cycles
Comment: @flolilo Indeed, partial cycles (from 10% to 90% or so) are the way to go, but unfortunately, DSLR chargers charge to 100%. The repeated 100%->90%->100%->90%->100% may be damaging. I noticed some of my advice was a bit off, so I edited it.
Comment: `The reason is that charging damages batteries the most if it's nearly empty or nearly full.` Do you have a source for that? Every source I know of states that partially charging is the way to go - even to 100% if you don't plan to store the battery in this state for months. Also, the damage charging does depends on the current, not the battery level at the moment of recharging (again according to all sources I know of).
Comment: Nearly full does not damage it; exceeding the Li-ion max voltage per cell does and that means overcharging it. In a similar manner, discharging it more than allowed by the manufacturer can cause damage.
Comment: @Overmind Actually, a Tesla battery charged to 100% lasts for a shorter amount of time than a Tesla battery charged to 90%. This is not overcharging: this is cycle life dependent on state of charge. See the Panasonic NCR18650B link. 500 cycles between 0%/100% and 28000 cycles between 10%/90%.
Comment: Charges must consider per-cell max voltage, not full battery voltage. What you say is valid for smart-phones. They all overchage to 4.35 instead of charging to 4.20. Charging to 80% is the correct charging for them and can increase lifetime even by x5. No 18650 cell will stand 28k cycles in practice. That is absurd.
Answer: Naturally, all batteries have somewhat different characteristics, but as a general rule Lithium-Ion (Li-Ion) batteries will last the longest if you never charge them above 80% and never discharge them below 20%. Should you be anal about that? Naaah, but here are some tips:
1) Don't be afraid to recharge your battery even though it's not depleted.
2) Don't leave your battery in the charger unnecessarily, especially not overnight.
3) Ignore the long first charge suggestion. It is valid, but not for this type of battery.
By the way: All this goes for your mobile phone as well.
Comment: Sorry, had to downvote. Leaving battery in the charger unnecessarily (like for overnight) does absolutely no damage, because li-ion charging is fully automatic.
Comment: @juhist That is correct, most li-ion chargers disconnect after the battery no longer drains sufficient current and an original charger should not overload.
Answer: Most rumours about "battery memory" are somewhat true for NiCD, NiMH and lead acid batteries. Even then, many of these effects are due to dodgy charger designs that take shortcuts on correct charging methods.
NiMH batteries are still commonly used for flashguns, however they haven't been used as a standard power source for DSLRs for at least 15 years. Some truly first generation DSLRs - think Kodak DCS series or the Nikon D1 series - used custom NiMH packs. Some semi-professional DSLRs in the 2000s could optionally take off the shelf NiMH cells in a battery grip. Some vintage gear lovers might still maintain some NiCD or Lead Acid based flashguns. None of this matters for a shrink wrapped DSLR bought today.
Lithium Ion batteries will fail- not degrade, usually FAIL and be unserviceable - if allowed to self discharge far below minimum voltage (due to abuse or being allowed to self discharge in long disuse). So charging any Lithium Ion battery you get as soon as you get it, and storing it charged, is prudent. Do not attempt to revive a Lithium Ion battery that a bona-fide charger refuses to charge at room temperature, there is a reason it refuses to charge it: Such a battery could be succesfully charged but at the same time turn physically unsafe.
A lithium battery that an intact charger announces as fully charged IS fully charged, there is nothing to be gained from leaving it in longer, the charger stopped charging it at that point, and if it tried to charge it more, the battery pack electronics would usually stop it from doing so - also for a reason. Lithium Ion batteries do not tolerate overcharging and will quickly fail from it, sometimes catastrophically and dangerously.


Distinct Log and Trace for each object in .NET

Question: I am dealing with very complex objects in .NET (in my case a finite element model that can consist of thousands of other objects say a Model instance have a large list of Element instance). I would like to add log feature per Model and its only for showing the log to user, not storing it. A very simple way is to add a Status property of type string to model and write status into it. Also can create a more complex type Status but the thing i want to know what is prettier way to this? is there any built in feature in .NET for this purpose?
Comment: [Sharing your research helps everyone](http://meta.programmers.stackexchange.com/questions/6559/why-is-research-important). Tell us what you've tried and why it didn't meet your needs. This demonstrates that you've taken the time to try to help yourself, it saves us from reiterating obvious answers, and most of all it helps you get a more specific and relevant answer. Also see [ask]
Comment: The thing i am searching for is well known Trace tool per object, not a global trace tool at System.Diagnostics.Trace. I need to know does anyone know such pre-coded library.
Comment: library recommendations are explicitly off-topic per [help/on-topic] (it's the same here as at Stack Overflow). See http://meta.programmers.stackexchange.com/questions/6483/why-was-my-question-closed-or-down-voted/6487#6487
Answer: You are probably looking for TraceSource, as opposed to its older sibling, Trace.
It works very similarly, except you create instances of TraceSource with different identifiers.
<code>var source = new TraceSource("foo");
source.Listeners.Add(new ConsoleTraceListener());
source.TraceEvent(TraceEventType.Error, 1, "here be dragons");
</code>
The instances can be configured in code or through (app/web/machine).config files, though most of that is explained in the MSDN link.
As far as showing it to the user rather than storing it - that is just a matter of attaching the right listener.  If a built-in listener type which does what you want does not exist, it is pretty easy to extend TraceListener.  For example, in a small test utility, I created one that raised events when messages were written and then wired the events to display them in the system tray.


Clean white puzzle mat stain

Question:
I'm using CLR with a hose and scrub brush but it's not taking much off. When it dries the stains come back much the same. How should I clean this?
Comment: What is the stain material? If it isn't calcium, lime, or rust, CLR probably isn't the right product.
Comment: I don't know the stain material. How would I know? I don't know the material of the mats either.
Comment: [It's possible](http://blogs.findanyfloor.com/consumer/RubberFlooring/HardwoodStainsDiscolorationfromRubberandFoamFloors.xhtml) that the floor is stained and should be painted.
Comment: Is that a concrete floor? You might need to sand or grind it off. Look to rent a janitor's buffer with abrasive pads or a concrete grinder.
Answer: Muriatic acid (hydrochloric acid) is the best concrete cleaner. CLR is (mostly) phosphoric acid and soap. The problem is, concrete is essentially calcium carbonate which is just holding aggregate/material together.
Calcium carbonate will partially/slowly react with phosphoric acid to produce calcium phosphate... which is probably what the "white stains" on the floor are.
Muriatic acid will quickly react with calcium carbonate or calcium phosphate to produce calcium chloride. After cleaning you will probably want/need to seal the concrete again.
Edit- foam puzzle mats are EVA foam (or Ethylene-Vinyl Acetate copolymer). EVA foam is made using acetic acid (plus oxygen and ethylene). And then the "finished" pellets are rinsed with more or other acids (maybe phosphoric acid, although an acetic acid wash would be more common). Then the pellets are heat melted into mats or other objects. There's actually a good chance that there is some phosphoric or other acid left in the EVA foam, that's causing the staining (reacting with concrete to produce calcium phosphate).
Yeah those mats have should been rinsed clean* by the manufacturer, but costs are against us all.
Answer: A favorite trick of mine with surface stains on concrete, is to take a concrete block and crack it into chunks with a 5 pound hammer, or something.  Then take a chunk of the concrete block and place the flat side down (what was formerly an exterior face of the block) on the concrete and start sanding in a circular motion  (aka Mr. Miyagi's wax on/wax off).
Try it on a small inconspicuous area of your concrete and see what you think.

Clean white puzzle mat stain


Login hours got ovewritten by changeset profile settings

Question: I deployed some new fields and added profiles to the changeset. The production login hours got ovewritten because of that. I add profiles to changesets all the time but never noticed this scenario until now. I looked at this documentaion and they mentioned about overwriting of profile login IP ranges in traget org, but not lgoin hours. Is that a bug or am I understanding it incorrectly?
Comment: Well, see, a while ago, we (as admins) had the exact opposite problem: we had no way to delete IP ranges or login hours by deployment, because deployments with differing ranges or login hours caused all of those values to be combined. I'm pretty sure that they added this as a feature, but unfortunately, I've slacked off on reading the release notes over the past few years.
Comment: I'm pretty sure the documentation is wrong. I started noticing this behavior a few releases ago. Possibly the documentation team hasn't been notified about this? I'd consider asking support.
Comment: Raised a case with salesforce. Waiting for their answer. But, overwriting login hours and IP ranges sounds odd to me. Does Salesforce consider that as a feature? Most of the times they will be different from sandbox. I want to create an Idea to exclude login hours and login ip ranges from changeset overwriting. My perspective could be wrong. what are your thoughts about this?
Comment: Thanks for the inforamtion. I'll refrain myself from opening the Idea.
Answer: I reached out to salesforce customer service and they said the documentation will be updated in the next couple of days. Overwriting of both login IP ranges and login hours is the expected behaviour it seems.


Is it okay to eat gorgonzola cheese mold?

Question: My pack of Gorgonzola came with greenish/blue mold. is it okay to eat that mold? I intend to eat the cheese by itself.
Answer: Gorgonzola, like any other blue cheese, is supposed to have mold. It should have blue mold radiating from "veins" through the middle, like so:

Normally this pre-existing mold actually helps prevent other molds from growing, but if you see more than one type of mold (especially a different colour like green or black), then you should throw it out, because it is a soft cheese. If it's just the blue, it's perfectly fine and expected.
Comment: @Midhat: The colour doesn't have to be a perfect deep blue; as long as it's growing out of the veins and not other spots, and you only see one kind, it's perfectly good.
Comment: thanks. mine's mold looks more green than blue. like this http://www.foodsubs.com/Photos/gorgonzola.jpg (http://www.foodsubs.com/Cheblue.html), and it tastes sooo good. Its from a big supermarket so I dont expect they will keep bad food on the shelf


Using iPhone as a camera

Question: I'm looking for a way by which I can see what I'm seeing while recording on another screen such as Macbook's screen or a monitor. For example, in this following image, I can turn the screen to myself to see myself while it is recording. Similarly, I wish to make the screen as Macbook's screen or a monitor while recording on my iPhone.
Comment: idk whether an iPhone can do this - I do it with my DSLR but it takes 200 bucks of software. The term you're looking for if you search is 'tether' - tethered shooting or tethering.
Comment: @Tetsujin Thanks for the term. Further, what about a program called "Reflector" by Squirrel ?
Comment: I've no idea. It's not something I've ever needed or ever envision needing. I have a DSLR to do this ;)
Comment: @Tetsujin is there any usage example of DSLR ??
Comment: That would be an entirely different question. Let's try not to turn this into a million comments on different topics. Stack Exchange doesn't work that way. https://photo.stackexchange.com/a/117693/57929
Answer: I generally never tend to encourage to buy software not to advertise, however, on Iphone Epoc Cam HD(paid version) does perfectly its job. I've just bought it with somewhat hesitation since its free version seems, at first glance, really shlocky. After some tests with a lightning cable, sound and by setting resolution to 1920x1980, it works like a charm.
Answer: The only native way to accomplish this is as follows (link to the article below):

Connect your iPhone to your Mac
Open Quicktime on your Mac
Select File > New Movie Recording

In the main window, just to the right of the recording icon, there is a dropdown arrow; here is where you should see your iPhone listed as an input option.

That will then mirror your iPhone's display and from there you can choose to press record or just let Quicktime mirror the display.
The only drawback is that you cannot rotate the window on the Mac when you rotate your iPhone. Not a perfect solution, but it's something.
Otherwise, you'll have to go the third-party software route, see Best Way to Mirror Your iPhone to a Mac.

Using iPhone as a camera


Does Kruskal-Wallis test have a non-parametric analogue that isn't sensitive to groups having different variability?

Question: I need a non-parametric test for my project (because I can't be sure that the distribution would always be normal), so I decided to use Kruskal-Wallis test.
But the problem is that Kruskal-Wallis test doesn't return the correct result if the groups doesn't have the same variability.
Does Kruskal-Wallis test has a non-parametric analogue that isn't sensitive to groups having different variability?
Comment: Welcome to Cross Validated! How do you know that KW is returning the wrong result?
Comment: @Dave, I've read on the internet when I could use KW and it was said that I could use it when distribution had the same "shape" (no heteroscadicity)
Answer: As well stated by @Glen_b the K-W test works as advertised in the unequal dispersion setting.  In general it is difficult in such settings to know what estimand to seek or what conclusions to draw.
The K-W test is a special case of the proportional odds ordinal logistic model - one that contains only mutually exclusive indicator variables for the groups.  Unequal dispersion is related to the proportional odds assumption, and you can generalize the model to allow continuous or discontinuous transition in group effects that are analogous to scale changes, using the partial proportional odds model as implemented in the R VGAM and rmsb packages.
Answer: They are assumed to have the same shape and spread under the null. It's not necessarily required under the alternative. You don't know if the null is true so this is also not something you can "check" on the data -- it's an assumption.
While a pure location-shift alternative may be relatively easy to interpret, it's often not realistic. For example, in some situations spread is related to mean. In some situations shape is related to mean. Consider test scores, for example; as the average score gets very high, not only does the variance tend to reduce as the values squash up against the upper bound but they tend to become more (left) skew as well.
The Kruskal-Wallis can work perfectly sensibly on sequences of alternatives that have spread and shape smoothly changing as the location changes.
Note that the Kruskal-Wallis is unaltered by monotonic transformations of the response variable (it doesn't change the ranks). A pure-location shift alternative on one scale will NOT be pure location-shift after such a transformation, but the test behaves just as sensibly either way.

If you're in a situation where you can't assume exchangeability under the null, you won't satisfy the conditions under which a permutation test would be able to "permute" things.
You may still be able to do a (carefully chosen/constructed) bootstrap test (/confidence interval for some effect of interest). In large samples it should have close to the required properties.
Answer: Example: Consider the following fictitious data:
set.seed(2022)
x1 = rgamma(50, 2, .3)
x2 = rgamma(50, 3, .3)
x3 = rgamma(50, 4, .3)
x = c(x1, x2, x3)
g = rep(1:3, each=50)

The three groups have different variances and slightly different skewnesses.
boxplot(x~g, horizontal=T, col=c("maroon","green3","blue"))

Kruskal-Wallis test shows differences with P-value near $0.$
kruskal.test(x~g)

        Kruskal-Wallis rank sum test

data:  x by g
Kruskal-Wallis chi-squared = 42.46, df = 2,
p-value = 6.023e-10

A plot of empirical CDFs (ECDFs) shows that
sample x3 (blue) stochastically dominates x2, which
in turn stochastically dominates x1.
hdr = "ECDF plots of x1 (maroon), x2 (green) and x3"
plot(ecdf(x3), col="blue", main=hdr)
 lines(ecdf(x2), col="green3")
 lines(ecdf(x1), col="maroon")


How to show customer dropdown attribute as radio button in registration page - Magento 2

Question: I have created a customer drop-down attribute from admin, in the registration page i need to show it as a radio button, how can achieve this. is it possible to show its as radio button, if not is there any alternative option?
Thanks
Answer: To display a customer dropdown attribute as a radio button on the registration page in Magento 2, you'll need to create a custom module and perform some customization.
Here's a step-by-step guide to achieve this:
1. Create a Custom Module: Create a custom module in the app/code directory of your Magento installation. Let's call it Vendor_CustomerAttribute.
2. Define the Customer Attribute:
In your custom module, define the customer attribute. Create the necessary files to set up the attribute:
app/code/Vendor/CustomerAttribute/Setup/InstallData.php
app/code/Vendor/CustomerAttribute/Setup/UpgradeData.php
In these files, use Magento's setup scripts to add the customer attribute of the dropdown type.
you can take reference from below links :
How to create customer custom attribute for radio buttons, checkbox in magento 2
3. Modify the Registration Form:
Create a custom layout XML file in your module to modify the registration form layout. This can be done in a file like app/code/Vendor/CustomerAttribute/view/frontend/layout/customer_account_create.xml.
   <?xml version="1.0"?>
   <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">

           <referenceBlock name="customer_form_register">
               <action method="setTemplate">
                   <argument name="template" xsi:type="string">Vendor_CustomerAttribute::form/register.phtml</argument>
               </action>
           </referenceBlock>

   </page>

4. Create the Template File:
Create a custom template file for the registration form in your module: app/code/Vendor/CustomerAttribute/view/frontend/templates/form/register.phtml.
Inside this template, you can customize the rendering of your custom attribute as radio buttons. Here's an example:
   <?php /* @var $block \Magento\Customer\Block\Form\Register */ ?>
   <?php $_customAttribute = $block->getLayout()->createBlock('Magento\Customer\Block\Widget\Gender'); ?>

       <?= $block->escapeHtml(__('Gender')) ?>

           <?= $_customAttribute->setShowAsRadio(true)->toHtml(); ?>

In this example, we're assuming that the customer attribute code is "gender". You should replace it with your actual attribute code.
5. Clear Cache:
After making these changes, clear the cache and test the registration form.


Can you start with no hair or beard?

Question: Yesterday I started a new campaign (Primitive Plus, solo, PS4) and my character began with full hair and beard. Is there any way to start hairless and beardless? I would like to see it growing over time. I know you can (around level 15) craft scissors and cut it off, but I would like to know if I can start that way (which was supposed to be the default, according to some places I read).
Answer: If you start from scratch completely, you'll start no beard, etc. If you have a profile already there, you seem to spawn with a beard.
Comment: But I started from scratch. I even deleted my old save. It didn't work.
Answer: I believe I've figured it out. Apparently, you start with no hair or beard only in "classic" mode. If you play in Primitive Plus you start with full beard and long hair.

Can you start with no hair or beard?


Can I get Alolan Forms of pokemon in Pokemon Sword and Shield?

Question: In the Pokemon: Let's Go games, you could obtain Alolan forms of pokemon by trading with NPCs. Are there similar NPCs in Pokemon Sword and Shield, or some other way to obtain Alolan Pokemon?
Answer: Isle of Armor
In the Isle of Armor DLC, there is a mini-game in which you are tasked find Alolan Digletts throughout the island. By collecting these Diglett, you will be given various Alolan forms (as well as a Kantonian form and Alola starter) as rewards for returning them to their owner.
Base Version
You cannot obtain Alolan forms in the base version of Sword and Shield, but you can by transferring Pokemon into the game via Pokémon Home (as long as the base form exists with in the Pokedex) or by trading with others players who transferred them from Pokemon Home

Alolan forms do existin the Galar region, as Alolan Meowth can be found in one of the camps. This camp is located on Route 7, and is known as "Renee's Camp"
Answer: Alolan ninetails is coded into the game as a raid battle on the island's peak in the lake of outrage but is still currently unobtainable. It most likely will be part of a future event like G-max Snorlax. By that logic you can assume that the others will be too. All Alolans forms have Pokédex entries (excluding cut Pokemon) that talk about their location in galar. Shield stating  " While it will guide travelers who get lost on a snowy mountain down to the mountain's base, it won't forgive anyone who harms nature."


Usage of 125V 20A receptacle for 240V 1A circuit

Question: I need to instal a receptacle in my 240VAC, 3 phase machine for a 12V, 1A adapter. Adapter is good for 120-240VAC input. I happen to have a 125V, 20A duplex receptacle on hand. Is it okay to use it because of low current or is there an insulation or gap requirement for 240V that 125V will not meet. Thanks.
Comment: Is this a three phase Y or Delta system?
Comment: It is delta start Y, unless I have it backwards. That should not matter, I think. I use a 3 phase converter that sends L1 & L2 out as I receive if from utility. T3 that is manufactured only goes to motor. I am using L1 & L2 for this receptacle which is identical to how 240V outlets in the shop are wired, except that they are 240V outlet. This receptacle will be inside electrical cabinet oc the saw so will not be available for anyone to accidentally plug a 120V appliance.
Comment: Got it.  Is there any risk of someone trying to plug something else into this outlet, or is it going to be totally enclosed in this machine?  Electrical code would say that's absolutely not allowed, because if someone tried to plug in a device that expects 120V, it may well catch fire.  But the electrical code is concerned with buildings, and doesn't generally apply to machine internals (though other regulations might).
Comment: I updated my response but you likely answered it before. Yes the outlet is going to be enclosed in the cabinet of the machine.
Comment: @ImranMalik -- why can't you get a 12V/1A chassis-mount PSU and hardwire it in instead?
Comment: "I have a 120V recep on hand" *don't we all*.  "I can just put 240V on that right?" *You know, I've always wondered what possesses people to do that.  It's really as simple as "I got one of those on hand", isn't it?  The safety aspects of doing that just don't occur, do they?*
Comment: @Harper-ReinstateMonica -- there's a somewhat deeper issue here, and that's the factor that you can't even *get* a wallwart that plugs into a NEMA 6 save for very rare exceptions, *despite* universal input wallwarts being a thing for over a decade now
Answer: Use a 12V/1A enclosed chassis mount (or DIN rail mount, for that matter) supply
Your problem here is that you are trying to apply a "wall wart" in an application (inside a control panel of some flavor) where you'd be provisioning a receptacle solely for the wall-wart's use.  This is a waste of a receptacle, and also poses NEMA 5/NEMA 6 confusion hazards, so why not use something more fit for the job instead, such as a DIN rail mounted supply like the one shown below? (It's a CUI PDRC-24-12, BTW, and is fully cULus listed to UL508 for field application in industrial control equipment.)

Of course, more traditional enclosed chassis mount supplies will work, although they don't usually carry a full UL listing the way the supply I linked does.
Comment: Thank you. I got same advice from my woodworking forum. I had no clue they are so cheap. So much better solution than my approach. I have DIN rail in machine so ordered one that will go on it. Thanks again.
Comment: @ImranMalik -- we thank people around here by upvoting and/or accepting their answers :)
Answer: Putting a 120V receptacle on a 240V circuit = future guy's fried 120V appliance when he plugs it in without the knowledge that you have that it's actually a 240V circuit with the wrong outlet type on it.
You need at least a NEMA 6-15R or 6-20R (looks like standard 120V outlets, except the blades are sideways so you can't plug in 120V appliances.
Comment: I just realized even though the wall wart is rated for 240VAC it has two flat parallel prongs. It will not fit in the 240V outlets in my shop as they have one vertical/horizontal opening and the other opening is horizontal. I was just trying to save a trip to town but unless they sell 240V outlets that have two vertical slots this adapter won't even fit.
Comment: This outlet is inside the machine electrical cabinet with a screwed on cover. So outlet is not accessible to anyone.
Comment: OP - Above in the question you said you have a 125V receptacle that you want to install inside your machine where there is only 240V available, presumably by wiring it to available terminals or loose wires already there.   Here in the comment I think you are saying you want to plug it into an existing 240V wall outlet.  It would help if you clarify, in the question, exactly what you want to achieve and what your constraints are.
Comment: Hi Jay, Sorry for the lack of clarity. Yes only 240V in machine and wall wart that is 240VAC capable has prongs that only fit 120V outlet. When I first posted, I was only asking for convenience but then I realized that even if I were to get a 240V outlet (like i have on my shop wall) the prongs of wall wart won't fit. As I commented below, I have ordered a DIN rail mount power supply.
Answer: Can't do that! The reason is keying
The whole point of having different receptacles for different voltages is to provide interlocking so the firestarting thing does not happen.

And it may seem all clever to do this while you're the only person tending the machine. But what's your sunset plan for this?  How do you plan to assure nobody else does something stupid with it?   Do you earnestly plan to tear it out if you sell the machine on Craigslist, or give it to your son, or die in a traffic accident and your estate clears it out?  Honestly your best plan is to say a sentence or two of words for them that they won't remember.  Maybe not you, but somebody is gonna get bit by a 120V socket fed 240V.
And when someone does that, they did everything right. It'd be your fault.
The simple fact is, they make correct receptacles for this.  Just use them.
And if you just won't, then OK, solder two #12 wires (none white!) onto the wall-wart prongs, gob it up with a ton of electrical tape, and land the #12 wire on terminal blocks.  At least that won't be mistaken for anything other than what it is.
However, I agree with ThreePhaseEel.  12V is an absolutely generic, common voltage and they make hundreds of thousands of different models of 12V power supply that input 230/240V (since that's standard house power on every continent except North America). Just get one of them - any of them - Amazon is awash in unapproved cheap Chinese ones, even this would be better than a suicide socket...  many others are RU-Recognized (UL's component certification)... and a few are UL-Listed.
Comment: Thanks for all responses. I got the same suggestion, of using a proper PS, from my woodworking forum, so I ordered one last night. I am an electrical engr but not an electrician. Even though, I did all my electrical in the shop I always check with knowledgeable folks because I am not familiar with the codes. In this particular case, I really wanted to know if there is a fundamental design diff that makes a 240V outlet different than 120V. If they are not then I would have been willing to take my chances as this outlet is inside my personal machine and is inaccessible due to screwed on panel.
Comment: I am new here so missed one response. The sunset comment is convincing. Even though, I planned to permanently notate the outlet, I agree it is not worth it.


Development approches for Blackberry playbook

Question: I am new on development of Blackberry playbook apps. Can we develop whole apps using HTML5,CSS,Javascript ?
Can we develope apps using Java for it?
Answer: You can code whole apps using standard web technologies (HTML5/CSS/JavaScript) - for this, u should take a look at the link to the WebWorks SDK at http://us.blackberry.com/developers/tablet/ (here, also the second approach for app development, namely using Adobe AIR, is mentioned)
Answer: Java - not yet, because both BB OS and Android SDKs haven't been released yet


Historical distribution of the Android platform versions

Question: I am interested in the distribution of the Android platform versions and I thus enjoy the www page http://developer.android.com/resources/dashboard/platform-versions.html. I would like to get hold of historical distribution data. Does anyone know where to find complete data-series stretching from December 2009?
Comment: This doesn't belong here. Voted to move it to http://programmers.stackexchange.com
Comment: I agree it's off topic on SO. I'd suggest asking this on the [android-platform](https://groups.google.com/forum/#!forum/android-platform) discussion group.
Comment: I'd would like to find this data also.
Answer: OK, so I was bored and made this motion chart using Google Spreadsheets. I used http://www.droid-life.com/tag/distribution/ as a reference for the past distributions.
In the upper right hand corner, you can select the bar graph; on the x-axis, you can select "Order: Alphabetical".
The data goes back to 2012. Unfortunately I couldn't find data from 2009. I will update the graph every month.
EDIT: The Motion Chart in Google Spreadsheets is now deprecated. Here is a link to the spreadsheet containing all the data:
https://docs.google.com/spreadsheets/d/1TA4mW6csdLovDuIaQCelc58HPSOzo5CfLUjZvxtJ1MQ/edit?usp=sharing
Comment: Just to complete your answer: http://www.bidouille.org/misc/androidcharts
Comment: Thanks for this! +1 for the chart and including the source.
Answer: I'm also interested into gathering this data. The only place I could find this is with wayback machine
You can there visit the previous data. I will try to get it when I get some time and will report back (unless someone wants to do it first :) )
Answer: I realize that this answer is WAY past the original post, but for those who come across this question, this information is available on Wikipedia here.
Comment: Looks like this only goes up to 2/4/2014.
Answer: There is a chart on wikipedia that is updated regularly. It will give a view of the distribution of various android releases over time.
https://en.wikipedia.org/wiki/Android_version_history


Collection vs ICollection

Question: I have created a dummy projet for testing collection and ICollection.I have a user class and wanted to create a collection.Example -
ICollection<User> users = new Collection<User>();
Collection<User> users = new Collection<User>();

Both code are working fine whether I use Collection or I collection.Now can anyone tell me what is difference between above two line?
Thanks in advance.
Answer: The first line ICollection<User> users = new Collection<User>(); creates a reference to an object (Collection) that implements the ICollection interface whereas the second line Collection<User> users = new Collection<User>(); creates a reference to an object that is a concrete implementation of the class Collection where T = User.
In usage terms you would look to use the ICollection reference where your subsequent code needed to be agnostic about the type of collection it was dealing with, i.e. you could provide any object that implements ICollection and your code would still work. Great if your code is not tightly coupled (which we all want of course).
Using Collection as the reference tightly couples your processing code to Collection class, a specific implementation of ICollection and while you might still only use the methods defined in the interface, you might also use some specific features of the class and then you won't be able to easily replace the collection object with something different. There are good reasons for this but it's bit beyond the scope of an answer here, search for Dependency Injection and Inversion of Control here and I'm sure you'll find loads of background info.
Answer: ICollection is an Interface. Collection implements ICollection, so it works. ICollection is not a class, so this wont work:
ICollection<User> users = new ICollection<User>();

..because you can't instantiate an interface. An interface just describes what a class must implement.
Answer: Collection<T> is just an implementation of ICollection<T>. If someone creates another class that implements from ICollection<T>, you can easily use that one by replacing your first line with:
ICollection<User> users = new MyCustomCollectionCollection<User>();

Later on in the code, you don't have to fix anything since the same interface is still used.
Answer: because users is reference. in both samples it points to same object. behavior is defined by class of object and it is same.

Collection vs ICollection


How to enable and create multiple workspaces in ubuntu 15.04

Question: Is there any way to create and access multiple workspaces in Ubuntu 15.04.
Answer: First you have to enable workspaces in Ubuntu 15.04. To do this:

Click the icon at the very right of the menu bar and select System Settings.
In the Personal section, click Appearance and select the Behavior tab.
Tick the Enable workspaces check box.

Now you can open the Launcher and click the workspace switcher icon near the bottom. By default, Ubuntu shows 4 workspaces, arranged in 2 rows and 2 columns.
If you want to add more workspaces, you can install and use Unity Tweek Tool to add additional workspaces.


Tracking user interaction on a website

Question: I am trying to track user interaction on a website that I manage myself. By tracking I mean, I want to track which button or widget the user pressed and when and also how much time a user spent and etc. Before I dive into coding something up on Javascript, I just to get an idea what are best options to do such things and possible pitfalls.
Comment: I think that your question is a bit broad. You could use different technologies to accomplish your goal. To listen the events is jQuery, to store the data you have options like PHP or Python.
Comment: There are third party js tools like omniture , comscore that allow tracking at a more granular level across the site. I am not sure if this is an option for you
Comment: Thanks ! Well I already have a backend database in MySQL and framework running on Python. I am just trying to get a basic workflow for the tracking. So for example, clicking a button should , maybe, fire an ajax call and carry out the normal task at the same time asynchronously. How do I achieve that. Could you show an example ?
Answer: It's been some time since this question was posted, but I've been working on a simple JavaScript module to do just this.
Rather than using images, it captures event data from user-specified HTML element(s) along side some basic information about the site visitor's browser configuration. The data is then sent to a specified server endpoint using an XHR triggered on the beforeunload event.
Here's a link to the GitHub project and an example page
Regarding the code, here's an example of what the HTML would look like:
<!DOCTYPE html>

        <title>Interaction Tracker Example</title>

The architecture allows you to easily track multiple elements through multiple instantiations, allowing you to customize which endpoints different interactions are sent to. This allows for clean separation of any server-side pre-processing prior to saving the data to a database.
var elementsToTrack = [
    {
        element  : "cssClass1",
        events   : ["mouseup", "touchend"],
        endpoint : "/interactions/c1"
    },
    {
        element  : "cssClass2",
        events   : ["mouseup"],
        endpoint : "/interactions/c2"
    },
    {
        element  : "cssClass3",
        events   : ["mouseup"],
        endpoint : "/interactions/c3"
    }
];

for (var i = 0; i < elementsToTrack.length; i++) {
    var el = elementsToTrack[i];
    new Interactor({
        interactionElement  : el.element,
        interactionEvents   : el.events,
        endpoint            : el.endpoint
    });
}

Finally, it's very lightweight (about 5KB minified) and easily extendable to most needs.
Answer: If you don't need to return any value from server, ajax is a bit overhead - I would use image pings (creating image elements with script as source with any parameter you want to send)
For events, bind them to document and check event target (be aware - blur, focus and change do not bubble)
document.body.addListener(event, function() {
    var i = new Image();
    i.src = 'script.php?target=' + event.target;
}, false);

For time measurement, you could check time that passes between events on elements.
Answer: I would recommend looking into something like mixpanel. It's very simple to integrate and they provide you with the graphic tools to parse large amounts of data. The basic premise is similar to what you said. Fire asynchronous events on specific user interaction, passing along a set of options. You can also integrate it into your Python code, which makes it easy to track when server side actions take place. Example:
$("#my_button").click(function() {
  // This sends us an event every time a user clicks the button
  mixpanel.track("Button clicked");
});

You can explore the docs for yourself. https://mixpanel.com/docs/integration-libraries/javascript
Mixpanel is just one option, but the premise is the same for all. The thing you need to consider is managing that data after it's been collected. Companies like mixpanel provide a nice GUI to make it less of a headache.
Answer: Google Analytics provides a good Javascript library for this:
https://github.com/googleanalytics/autotrack
Of course, it expects you to use Google Analytics in your app, but it has a free version you can use. Check the comparison between their free and paid services.

Tracking user interaction on a website


How can I mix my guitar input to songs I play on iTunes?

Question: I would like to be able to play my guitar along with songs I have in iTunes and listen to a mix in my headphones.  I have an Apple PowerBook, and an M-Audio M-Track interface, but I don't know how to get them mixed together.  I'd rather not have to import a song separately into Garage Band, but rather just play songs in iTunes and be able to play my guitar along with them.
Answer: Just set both iTunes and whatever software you are using to monitor your guitar (DAW, plugin host, software mixer, whatever) to use the same sound card (in this case your M-Track) and same outputs (in this case the ones assigned to the headphones).
For iTunes routing you need to set the whole system audio to use your sound card. You can do it in the system preferences or by alt+click the speaker icon at the top of the system bar in some OSX versions (the one that has the time, date, etc).
The other routing will depend on how you are monitoring your guitar. It should be very straight forward, just check the manual of whatever software you are using.
Comment: @PJNoes You can do it with what you have. Garage Band is your DAW (digital audio workstation), that's what you are using to monitor your guitar. Just set both iTunes and Garage Band to use the M-Audio M-Track and you are done, since it only has one stereo output you don't have to do additional routing. In other words, setting both iTunes and Garage Band to use your M-Track is all you need to do. This is not always possible or as easy in Windows based systems, but in Mac it is very straight forward.
Comment: I'm not sure I understand your answer.  I only have iTunes, Garage Band, and the M-Audio M-Track device.  Are you saying I should have some other software or can I do this with what I've got?