Is one allowed to ask for compensation for their witness testimony?

Question: Bob witnesses a murder, so reports the crime to the police. Later, lawyers representing the state/jurisdiction come to Bob, asking him to provide witness testimony. But Bob values his time, and doesn't want to spend hours at the court out of the goodness of his heart. Is Bob allowed to ask for monetary compensation to serve as a witness for the crime? Or does that create a conflict of interest ("I paid this witness $1000, now listen to them support my argument")?
Answer: A witness who is under a subpoena cannot condition their appearance or testimony upon being compensated.
Usually, a "lay witness" who is not offering expert testimony and instead just testifying about their personal knowledge of the facts of the case, is entitled to a statutory witness fee when appearing pursuant to a subpoena to be paid by the lawyer or law firm or government agency issuing the subpoena. But, this minimal amount is basically only enough to pay for mileage to get to the court house, parking, and perhaps lunch. It is even more minimal than the tiny compensation paid to jurors.
It is not unethical for an attorney to pay reasonable actual expenses of testifying to a lay witness to encourage them to cooperate with the process and as a courtesy to avoid inconveniencing them beyond the statutory witness fee.
For example, paying the cost of a hotel and dinner the night before if it is a long trip to court so that the witness doesn't have to leave home to go to court at 3 a.m. would not be unethical, even if it exceeds the statutory witness fee. But, it generally isn't proper to pay a lay witness simply to testify.
As an example, the statutory witness fees for federal court witnesses in Denver, Colorado, which is one of the most generous sets of witness fees, in part, due to the high cost of living there (state courts are usually less) is as follows:

Witness fee per day   $40.00
Witness mileage, round-trip (per mile)    $0.655
Witness subsistence reimbursement (Denver) (seasonal, Nov. 1 - Dec.
31, 2022 = $232; Jan. 1, 2023 - March 31, 2023 = $241.00;) for an
overnight stay $278.00
Witness subsistence reimbursement (Denver) for last day of travel
(See General Services Administration per diem website page for
seasonal changes [also lists of per diem rates for other Colorado
locations], and GSA mileage website page.) $79.00

An "expert witness" testifying on matters of opinion arising from their expertise unrelated to the facts of a particular court case, is entitled to reasonable compensation and normally would testify voluntarily when not under subpoena, pursuant to a retention agreement upon which the expert may be cross-examined at trial to show a potential source of bias.
Sometimes a "non-retained" expert witness will testify under subpoena rather than voluntarily (e.g. someone who performed an autopsy on a body in a murder case) because they have knowledge of facts from their personal knowledge that are relevant in addition to having that knowledge enhanced by their professional expertise. Such witnesses generally are compensated at a reasonable rate for their services, but the analysis is different and is governed by the applicable civil procedure statutes and rules in the place where the trial is conducted.
Comment: Re: "Statutory witness fee" - any chance of a link to, and a quoted summary from, a reputable source please?
Answer: Expert witnesses routinely receive compensation for their professional analysis, report-writing, and testimony at trial. The courts do not compel an expert to perform an analysis of some pertinent facts. The courts do compel eye witnesses to testify. This provides incentive to the witness to do as they were told by the court.
An attorney cannot pay a witness to provide their eyewitness testimony. However, it is never illegal to ask. Therefore, the simple answer is "asking questions" is legal. There is a federal law against bribing witnesses, 18 USC 201 which punishes one who

directly or indirectly, corruptly gives, offers, or promises anything
of value to any person, or offers or promises such person to give
anything of value to any other person or entity, with intent to
influence the testimony under oath or affirmation of such
first-mentioned person as a witness upon a trial, hearing, or other
proceeding, before any court, any committee of either House or both
Houses of Congress, or any agency, commission, or officer authorized
by the laws of the United States to hear evidence or take testimony,
or with intent to influence such person to absent himself therefrom

and state analogs. This is about paying a witness for their testimony, and not a blanket prohibition against paying a witness: here's a brief note on navigating the unclear waters about paying. For instance, the witness can be compensated for travel expenses, because the compensation is not for the testimony, it is for the travel that makes the testimony possible.
Answer: Bob is certainly allowed to ask for money in exchange for his testimony, but that doesn't mean he is entitled to receive that money or to skip the trial if he doesn't get it.
A witness like Bob will likely be subpoenaed to appear at trial. This means that it doesn't matter how much he thinks his time is worth; he will almost certainly have to show up to testify.
However, Bob will also likely be paid for appearing as a matter of course. Most witnesses are entitled to some payment for each day they spend in court, and they may also be entitled to compensation for traveling to the court. This fee will likely be much less than Bob thinks his time is worth, but it is generally not negotiable. In federal court, for instance, 28 U.S. Code § 1821 establishes the fees to which a subpoenaed witness is entitled, which will generally be $40 per day plus travel expenses. The fee schedule for appearance in state courts will vary from state to state.
I don't know that the prosecuting attorney is prohibited from paying Bob still more money to appear, but doing so would certainly be unusual and set off alarm bells. Further, the prosecutor would likely be required to disclose those payments so the defense could use them to suggest to the jury that Bob's testimony is less credible
Comment: Re: "Most witnesses are entitled to some payment" - any chance of a link to, and a quoted summary from, a reputable source please?
Comment: @Rick Added. See above.
Answer: england-and-wales
Bob would be classed as an Ordinary Witness
and can claim expenses etc (below) payable the Crown Prosecution Service (CPS) which is:

responsible for paying allowances and expenses to witnesses who are called to give evidence in prosecutions conducted by the Service.

An 'ordinary witness' is:

a witness to fact - a witness who is neither a professional nor expert and who gives evidence based on their first-hand knowledge of events relevant to the case.
Ordinary witnesses may receive compensation towards:

Travelling expenses

Money spent on refreshments and meals

Overnight subsistence

Financial loss (e.g. loss of earnings)

*Other expense incurred (e.g. childcare)
There are limits on the amounts payable:

Bus and train fares (standard fare) should normally repaid in full

Travel by motor vehicle is paid at a rate per mile

Childcare will normally be reimbursed within a maximum daily amount. However, discretion should be applied where childcare cost exceeds the rate. An official receipt from a registered child carer must be provided.

Taxi fares are allowed in exceptional circumstances. Discretion should be applied for incidents such as:

Where this was the only form of transport available
If a witness is registered disabled or infirm.
If the witness is vulnerable

This should normally be agreed in advance and receipts must be provided.

Set limits apply to refreshments and meals

Maximum daily amounts apply to loss of earnings and other financial losses

Overnight subsistence
The CPS will normally arrange the hotel accommodation for ordinary witnesses and pay for it. The overnight allowance covers an absence of 24 hours. Where the witness has had to arrange their own overnight accommodation the CPS will reimburse actual rates up to the maximum overnight rate, where receipts are provided.
Where a meal is also included, ordinary witnesses will be entitled to a fixed Personal Incidental Allowance. If no evening meal is included ordinary witnesses are additionally entitled to a Night Subsistence Allowance. This is a fixed amount towards the cost of meals, refreshments and other expenses where a witness has had to stay away from home.
Witnesses who stay with family or friends in place of the above will receive a single fixed payment. See 'Current rates' for Ordinary and Professional witnesses.


Is there a lower bound on the average diamond norm of two uniformly random unitaries U1 and U1 of dimension D that are sampled from haar measure?

Question: I could not find any lower bound on the diamond norm for two uniformly random unitaries of dimension D sampled from the haar measure.
Answer: This answer won't actually give you a bound, but will provide some information that may help you in your search. You may be able to find an answer in the random matrix theory literature if you translate the question into different terms, as I will describe.
First, suppose that $\Phi_0(X) = U_0 X U_0^{\dagger}$ and $\Phi_1(X) = U_1 X U_1^{\dagger}$ are any two unitary channels. In this special case, the diamond norm distance between these two channels can be expressed as follows:
$$
\|\Phi_0 - \Phi_1\|_{\diamond} = 2 \sqrt{1 - \delta(U_0^{\dagger} U_1)^2},
$$
where $\delta(A)$ denotes the minimum absolute value taken over the numerical range of a given operator $A$. That is,
$$
\delta(A) = \min_{|\psi\rangle} |\langle \psi | A | \psi\rangle|,
$$
where the minimum is over all unit vectors $|\psi\rangle$.
Now, if you're interested in $U_0$ and $U_1$ being Haar-random, then you might as well set $U_0 = I$ and $U_1 = U$ for $U$ Haar-random, by the fact that the diamond norm is unitarily invariant. To understand the distribution of the diamond norm distance, you therefore need to understand something about the numerical range of a Haar-random unitary. Because unitary operators are normal, their numerical range is the convex hull of their eigenvalues, so you're essentially trying to understand something about the eigenvalues of a Haar-random unitary. This topic has been studied extensively in random matrix theory.
I do not know enough about this topic to give you precise bounds, but it is clear that as the dimension $D$ grows, the probability that the diamond norm distance equals the maximum possible value 2 (which means the two channels can be discriminated perfectly) approaches 1. Indeed, in order to have diamond norm distance strictly less than 2, all of the eigenvalues of $U$ (or $U_0^{\dagger} U_1$) must fall within an arc on the unit circle having length strictly less than $\pi$, which is extremely unlikely for large $D$ (surely the probability is exponentially small in $D$).
Comment: Eigenvalue distributions of random unitary matrices https://link.springer.com/article/10.1007/s004400100186
Answer: The result you're looking for is effectively Proposition 19 of the paper: Almost all quantum channels are equidistant; which I'm rewriting here for convenience:
Let $U, V \in \mathcal{U}(d)$ be two independent random variables, at least one of them being Haar-distributed. Then, with overwhelming probability as $d \rightarrow \infty$, the quantum channels $\Phi(X)=U X U^{\dagger}$ and $\Psi(X)=V X V^{\dagger}$ become perfectly distinguishable: for $d$ large enough,
$$ \mathbb{P}\left[\|\Phi-\Psi\|_{\diamond}=2\right] \geq 1-\exp \left(-\frac{\log 2}{2} d^{2}\right) $$
If you're familiar with typicality results, then this is an example of concentration of measure phenomenon.
Note that this result is general than the one you're looking for since it requires only one of the channels to be Haar. Moreover, it fits nicely with the insights that John Watrous provided above; and the rest of the paper has generalizations to random matrix theory.
Comment: Thank you. The reference has some really nice results. And indeed the unitary invariance property of diamond norm indicates that one needs to choose only one unitary to be haar random while the other can be fixed to show perfect distinguishability with exponentially high probability. Do you know if one can also expect perfect distinguishability when the distinguishability is defined via any other shatten-p norm, instead of diamond norm?
Comment: I'd think so, yes. Off the top of my head, some simple bounds on the Schatten 1-norm follow just from the properties relating the 1-norm to the diamond norm (see, for example, Watrous' notes: https://cs.uwaterloo.ca/~watrous/TQI/TQI.3.pdf; page 171). Moreover, the 1-norm can be bounded using the other p-norms in turn. Would that suffice or are you looking for tighter bounds?


How to use units for a slope calculation?

Question: Simple question: is the result of a slope calculation in Python (say, stats.linregress() function) in units of radians, or unitless (e.g. what's 18 deg or 0.314 rad would be equivalent to 0.2 in the function output)?
Comment: Not at all, I have no idea what you're talking about. I can't read your mind. You should make it easy for others to help you.
Comment: There's no "slope calculation in Python". You're probably using a library, and thus you should read its documentation.
Comment: slope would be rise/run  - for example: if 2 units up (y) gives you +1 x unit, then the slope would be 2.
Comment: Split hairs much? Here's the doc [scipy.stats.linregress](https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.linregress.html), it doesn't state whether or not there or units for slope.
Comment: The complete calculation that `stats.linregress()` makes can be found here: https://github.com/scipy/scipy/blob/v0.18.0/scipy/stats/_stats_mstats_common.py#L11-L102.  It's merely 50 lines of python code (not counting the comments).
Answer: scipy.stats.linregress returns the slope in terms of rise over run. As Stephen C. Steels answer says, the units of the resultant slope is the units of the y-axis multiplied by the inverse of the units of the x-axis (eg if y-units are metres, and x-units are seconds, then slope's units will be metres/second).
If you want the angle of slope (in radians and degrees), use arctangent:
import math
from scipy.stats import linregress

slope = linregress(xs, ys)[0]  # slope in units of y / x
slope_angle = math.atan(slope)  # slope angle in radians
slope_angle_degrees = math.degrees(slope_angle)  # slope angle in degrees

Answer: Slope and angle both measure how "not flat" something is, but they do so very differently. For instance, if you have a board that's not flat, the angle between the board and the ground measures how much you would rotate the board to make it flat, while the slope measures the height of the board divided by its horizontal length. They are related by slope = tangent(angle), but they are different concepts with different units. Also, while slope makes sense for any two dimensions, angle makes sense only when the dimensions are in the same space. So, for instance, 50 miles per hour can be interpreted as the slope of the graph of a car's position, but it would not make sense to try to convert that into an angle.
While there are ways to encode units in computer programs, as a general rule computer programs simply do not work with units. It's up to whoever uses a program to deal with units. The stats.linregress() function takes no units as inputs, and gives no units as outputs. If, rather than "what are the units of the output", you mean "what units should I add to the output for a physical interpretation", then you should add the units of y divided by the units of x. Note that if your input has multiple features with multiple units, then each coefficient will have different units. (This is why features are generally normalized before regularizing; regularization involves taking the sum of the coefficients (or their squares), and adding numbers with different units doesn't make sense.)
Comment: "as a general rule computer programs simply do not work with units'. This is a bad general rule, as there is tons of design and engineering software that use units, and every professional financial software on the planet uses units, only called currency in that context.
Comment: @whatsisnane I suppose it depends on what one means by "program", "unit", and "work with". Units are generally only part of the UI. All the program knows is that it's been told to print ASCII character 36 ($) before the number.
Answer: The library calculates the numerical value of the slope given the numerical values of your coordinates. It interpretation as a quantity (that is, a numerical value combined with units) is up to your program. Unless the library function is doing something very strange, the units for the slope through a set of points (x, y) would be unit of slope = (unit of y)/(unit of x).
So, for example, if x and y are both distances expressed in the identical units, the slope would be dimensionless. However, if x is a time in seconds, and y is a voltage in volts, then the slope would be in volts/second.


Gypsy Jazz style violin vibrato notation

Question: The way vibrato is used in gypsy jazz violin, like Stephane Grappelli is a bit different from normal classical playing. Typically only used on long notes and developing after the note has sounded, possibly a bit wider too. Is there a way of notating this, and would it be difficult for a player who is not used to it? This is for a string quartet with a bit of gypsy/balkan influence
Comment: Why not just add a note at the beginning of the piece explaining what you want (i.e. the explanation from your question). Notating vibrato explicitly is overkill.
Comment: @PiedPiper True in general, but for pedagogical purposes one might need explicit instructions. As in *"Do this drill/exercise, but put this special kind of vibrato on these notes"*. Or *"switch back and forth between these different vibrati* (vibratos? vibratoes?)". I dunno, but surely there's someone out there who thought of notating this...
Answer: Just to clarify, you're describing an out-of-the ordinary vibrato used as an ornament only on certain notes, not simply an unusually wide variety of the "switch it on, leave it on" vibrato common to modern practice. I've seen Mark O'Connor elaborate on this idea of a extremely wide vibrato ornament, a sort of "vibrato trill," in which he actually shifts his hand rapidly up and down roughly one position, allowing his finger to actually slide up and down the string in an oscillating glissando (unlike normal vibrato, in which the finger stays anchored in place and merely "rocks" back and forth). Considering that Mark O'Connor studied with Stephane Grappelli, he might well have inherited the technique. (This isn't the best example, but you get the idea:

Short answer: No, there isn't a standardized notation for such an ornament. I'd suggest inventing one and explaining in a text note at the outset. Maybe the horizontal wavy line used to extend trills, with something like vib. at the beginning of it? Or w.v. for "wide vibrato?"
Comment: I'd go further, and suggest that the vibrato is pretty normal — what's different is its _absence_ from the starts of notes! (Vibrato is a bugbear of mine; I prefer much less than is commonly used, both in instruments and voices, and I find its widespread indiscriminate use off-putting, obscuring the pitch, and often more about compensating for poor intonation, or just habit, than for any musical reason.)


How is Acts 7:48 reconciled with omnipresence doctrines?

Question: Some verses seem to indicate that God is indeed not omnipresent such as Acts 7:48, "The Most High dwelleth not in temples made with hands". How is this specific verse reconciled with the doctrine that God is omnipresent?
Comment: For this site, we can ask about this specific verse and how it is reconciled with omnipresence doctrines. I'll make the edit for you, but you can change it after that if you want.
Comment: In other words, ya can't CONTAIN God. It's an impossibility simply BECAUSE he is omnipresent. Moreover, as vast as the first and second heavens are (i.e., the firmament and outer space), not even THEY can contain God. As Stuart Hamblen put it: How big is God, how big and wide is His vast domain? To try to tell these lips can only start, He's big enough to rule His mighty universe
Yet small enough to live within my heart (see http://www.hughsnews.com/lyrics-to-song-how-big-is-god-written-by-stuart-hamblen). Don
Answer: 'Dwelling' does not simply mean to 'be present'. It means to reside or inhabit. If you go into a shop, you are not 'dwelling' in the shop, but you are present there. If you say "I do not dwell in the shop" it doesn't mean you never go in there, or that you are not there now.
The point is that God is above 'dwelling' in places that humans have made. He has his own 'dwelling places (in so far as he dwells anywhere), but has no need of human temples.
Comment: It is clear in the OT that God dwelt in the temple in Jerusalem.
Comment: It is NOT clear in the OT, however,  that God dwelt EXCLUSIVELY in the temple in Jerusalem. Cf. Psalm 139 (138 Vulgate) 7-13, wherein the Psalmist writes, in part, "If I ascend to heaven, thou art there! If I make my bed in Sheol, you are there! If I take the wings of the morning and dwell in the uttermost parts of the sea, even there thy hand shall lead me, and thy right hand shall hold me."


Runescape : I do not earn exp

Question: I have a big problem, my combat level is 57 and I just got level 25 att,def and str. And the problem is that i dont get anymore exp by killing creatures, or anything. Pls help me out!
Comment: I haven't played Runescape for years, and this isn't a proper question, but let's diagnose this. Each point of damage you do contributes 1 xp to your health experience and 4 xp to attack or defense or strength depending on the style you're using. I don't know how styles have been affected by the recent combat rework, so look at your health skill. How much experience do you have there now? How much experience do you have after killing one enemy? Did it go up?
Comment: Yes, My health went up, and the attack skill too, but defense and strenght aren't going up...
Comment: Yup, this is because you are using an accurate style. Try changing your attack type.
Comment: Yeah maybe, i always use the battleaxes... I'll try But thanks :)
Answer: Since the Evolution of Combat update, there is a separate interface for choosing what skill to gain combat experience in. When you are in game, click on the combat interface panel by clicking on the crossed swords icon.

If you click the circular button labeled "XP", there will be an interface that lets you choose what skill(s) to gain experience for melee combat, ranged combat, and magic combat (note that you always gain constitution experience regardless of your choice).

Note that choosing "Attack, Strength & Defence" does not increase the experience you gain, it just splits the experience between the three skills.
Comment: OMG, it helped so much THX ;)  reaaly thx
Comment: By anonymous "Choosing Attack, Strength & Defence does not increase the xp you gain, it just splits it between the three skills."
Answer: After RuneScape 3 update, click on the three bluish orbs icon, then choose whichever kind of exp you want.

Runescape : I do not earn exp


How do I compute the average power from the PSD plot attached?

Question: I want to calculate the average Power from the Power spectral density plot I have here. Any help would be greatly appreciated.
Comment: Is there no option that calculates this on your average value? I've never used this measuring device but surely should be an averaging calculation feature. I don't think it's possible to calculate a generated PSD without knowing \$F(\omega)\$, per se.
Answer: There's no simple, accurate way to do it from a graphical plot.
The two alternatives are (a) simplest, set the RBW to 3 kHz, which will encompass essentially all the power in the signal, now read the marker
or (b) hard work, get a numerical dump of the display, and use anything from Excel to your favourite computer language to integrate the power across the display.
However, by eyeball, the marker is at -51dBm in a 300Hz RBW. The power has dropped by 10dB by +/- 500Hz from the centre, and you get precious little extra power after that. So your total power will be slightly more than -51dBm, maybe -50dBm, maybe -49dBm.
Answer: You simply increase RBW to include the spectrum for which to want the PSD.
Estimate what it your think it should be by this graph , before you increase it towards the VBW=100kHz to exclude noise to get about -50 dBm @3kHz or 10kHz and see how close yours and my estimate is.
You can also go to zero span at centre f with RBW=30kHz and compute from the time trace the Average and the peak power and compare with the PSD Power for your education on quasi-peak detection of PSD results.
Any good SA or external output to a DSO can compute any of these from the zero span matched signal BW time trace output.


Silverlight and Windows Phone 7 dll compatibility

Question: Is a library built for Silverlight compatible with a Windows Phone 7 application?
Answer: It depends, Windows Phone 7 runs on Silverlight 3 with some added features.
For a more in depth list of the differences between, Silverlight "proper" and Silverlight for the phone, check this page Differences Between Silverlight on Windows Phone and Silverlight on Windows.
Also have a look at this page for Class Library Support for Windows Phone, it outlines pretty well what's supported and what's not.
For some basic info about this sort of stuff, you can also have a look at this quick start tutorial
Answer: If you are asking whether the compiled library is compatible, the answer is no. You cannot build a .xap file or a .dll for Silverlight web and deploy it to the phone.
On the other hand, if you are asking whether you can rebuild it for the phone, the answer is very close to yes, especially if the program is pretty simple.
I demonstrate that idea here, but it is important to point out that they are not the same platforms; and once you get past a pretty simple application the differences become a bit more noticeable.
Thanks
-jesse
Answer: Provided you don't call API's in the dll that aren't supported by the platform, you can do this.


Emailing Report - Automation Studio

Question: Is there a way to Email a Scheduled Report (created using SQL) in Marketing Cloud Automation Studio?
Answer: This can be hacked with the following steps:

Create a Data Extension with the Report Headers
Write a query and to extract the information and place in the the DE from Step 1.
Data Extract: Create A Data Extract Activity to extract the DE from Step 2 to a location on the SFMC FTP.
Combine Steps 1-3 in an automation via Automation Studio.

Important Considerations

Emphasis should be placed on the naming patterns in the data extract. Depending on the frequency at which the report is required, I would advise using file naming patterns that reflect this ( eg. %%DD%%%%MM%%YYYY%% %%HH%  - for hourly reports)
The Reports (Extracted Data Extensions) will remain in the FTP for 30 days, after which they will be deleted. This is because the FTP is a temporary storage solution.
Comment: thanks @data_kid! i assume we can build the email functionality by writing a script to fetch the file from the FTP and send an email?
Answer: Is this a complex amount of data, or is it something you could display in the body of an email?
I have several reports that go out daily to my team summarizing activity on our various recent sends (both triggered and ad hoc).
I have automations that run daily to produce the data (query, query, query, etc., ui) and then I have emails that just read from those DEs and present right in the email.  No attachments necessary.

Emailing Report - Automation Studio


Django endless pagination with a request.method == 'POST'?

Question: I'm trying to get Django Endless pagination to work on a search form.
All the examples and tutorials I've seen online show how to do it with a simple .all() queryset, but I need to filter out by the search results that I've had in the POST.
Here's how my view looks like for now:
@page_template("core/search_box.html")
def search(request,template = "core/search.html",page_template = "core/search_box.html",extra_context = None):
if request.is_ajax():
    #template=page_template()
    #users = Skill_User.objects.filter(skill__name__icontains=content).order_by('-level')
    #return render_to_response( template , {'page_template': page_template,'menu_home_active':True, 'form':search_form, 'result':users} , context_instance )
    return HttpResponse("AJAX")
elif request.method == 'POST':
    search_form = SearchForm( request.POST )
    # If Form is Valid
    if search_form.is_valid():
        type  = search_form.cleaned_data['type']
        content  = search_form.cleaned_data['content']
        print 'CONTENT ' + str(content)
        if (type == 'O'):
            users = Skill_User.objects.filter(skill__name__icontains=content).order_by('-level')
        elif (type == 'G'):
            users= {}
    return render_to_response( template , {'page_template': page_template,'menu_home_active':True, 'form':search_form, 'result':users} , context_instance=RequestContext(request) )
else:
    return HttpResponse("NOT OK")

So the search is done on POST. But how can I pass this search POST thingy to the ajax query that's done by the endless-pagination plug-in ? I commented out everything in the request.ajax() part, I just need "users" to be filled by the same data as after the POST request.  Basically, for now when I scroll down I have "AJAX" showing up, and I'd like the rest of my query as well.
Any ideas? I haven't found anything obvious online about that. I come from a PHP background, and I would think about $_SESSION[] variables. Is there something similar in Django?
Answer: Ok, it's doable with a simple request.session[""] object.


4 equations 3 unknowns

Question: If I have 4 equations and 3 unknowns, I could solve for the 3 unknowns using the first 3. How does it ensure that the 4th equation is also satisfied? In this case, what should be the usual strategy to solve for the unknowns?
Comment: The solution you got from first 3 equations must also satisfy the 4th equation, otherwise the system is inconsistent.
Comment: There is no guarantee that the 4th equation will be satisfied. I'm sure you can write down an example where such a system has no solution.
Comment: Just to be clear, are you dealing with four linear equations?
Comment: If you have more equations $(M)$ than variables $(N)$, if you pick randomly $(N)$ equations among $(M)$, you would get a solutions. But there is absolutely no reason that the remaining equations be satisfied (except if they are linear combinations of the selected).
Comment: Yes, the equations are linear.
Comment: @ClaudeLeibovici I don't agree with you, the system $x+y = 1, \ 2x+2x= 2, \ 3x+y = 3,$ has a solution but if you pick the two first equations then you won't get a solution.
Comment: @Surb. I8 totally agree with you. What I supposed was that the selected equations were linearly independent. Thanks for pointing. Cheers :-)
Comment: @Surb. The first picture in your profile is my most favored piece of art !
Comment: @ClaudeLeibovici I really love it too :).
Answer: With the general solution to the (sub)system of the first three equations in hand, one can simply substitute this solution in the fourth equation and see for which values it is satisfied. Since there are more conditions than unknowns, we should expect that generically there are no solutions.
Procedurally, given a system
$$a_{i1} x + a_{i2} y + a_{i3} z = b_i, \qquad i \in \{1, 2, 3, 4\},$$
we can solve the system by forming the matrix
$$ [A \, | \, b] =
\left(\begin{array}{ccc|c}
a_{11} & a_{12} & a_{13} & b_1 \\
a_{21} & a_{22} & a_{23} & b_2 \\
a_{31} & a_{32} & a_{33} & b_3 \\
a_{41} & a_{42} & a_{43} & b_4
\end{array}\right)$$
and row-reducing to echelon form. The system admits no solution iff at any point during the reduction the matrix has a row of the form
$$\left(\begin{array}{ccc|c}
0 & 0 & 0 & \ast \\
\end{array}\right)$$
with $\ast$ nonzero (because this corresponds to the insoluble equation $0 = \ast$).
Finally, notice that the existence of a solution is equivalent to the fourth column in $[A \, | \, b]$ being in the span of the first three columns. In this case, the columns are linearly dependent, and so $\det [A \, | \, b] = 0$. Thus, $$\det [A \, | \, b] = 0$$ is a necessary (but, as you can easily show, not quite sufficient) condition for the existence of a solution to the linear system. (Whether this is useful depends on your tools, the matrices, and your purpose, as computing a $4 \times 4$ determinant can be labor-intensive, and in the case where there are solutions, this computation doesn't tell you what they are).
Answer: My approach to this would be to put the first three equations in echelon form by starting a Gaussian Reduction. For example :
$$
\begin{alignat*}{4}
 x & {}+{} & 3y & {}+{} & 2z & {}={} & 13 \\
  & {}{} &  y & {}+{} &  z & {}={} &  6\\
 & {}{} &   & {}{} & 3z & {}={} & 10
\end{alignat*}
$$
Then, I would express the left side of the fourth equation in terms of the first three ones. It's easy since the three equations are in triangular form. Start to find the coefficient in front of the first one (the only one which contains an $x$), then the second one, then the last one.
Then calculate the right side to know which number it should be equal to. If the combination of the first three equations and the fourth equation yield the same result, your system is consistant. If they don't, it's not.
Answer: For equations:
$$\begin{cases}a_1x+b_1y+c_1z+d_1=0\\a_2x+b_2y+c_2z+d_2=0\\a_3x+b_3y+c_3z+d_3=0\\a_4x+b_4y+c_4z+d_4=0\\\end{cases}$$

How do one ensure that that all equation are consistent?

You need to check if:
$$\begin{vmatrix}a_1&b_1&c_1&d_1\\a_2&b_2&c_2&d_2\\a_3&b_3&c_3&d_3\\a_4&b_4&c_4&d_4\end{vmatrix}=0$$
Or you need to check:
$$a_2 b_4 c_3 d_1-a_2 b_3 c_4 d_1-a_1 b_4 c_3 d_2+a_1 b_3 c_4 d_2-a_2 b_4 c_1 d_3+a_1 b_4 c_2 d_3+a_2 b_1 c_4 d_3-a_1 b_2 c_4 d_3+a_4 (b_3 (c_2 d_1-c_1 d_2)+b_2 (c_1 d_3-c_3 d_1)+b_1 (c_3 d_2-c_2 d_3))+a_2 b_3 c_1 d_4-a_1 b_3 c_2 d_4-a_2 b_1 c_3 d_4+a_1 b_2 c_3 d_4+a_3 (b_4 (c_1 d_2-c_2 d_1)+b_2 (c_4 d_1-c_1 d_4)+b_1 (c_2 d_4-c_4 d_2))=0$$

4 equations 3 unknowns


Anyone using Naiant Gear?

Question: I'm thinking of getting the new Naiant Littlebox when it comes out and am considering picking up a mic or two of theirs. Has anyone here used any of the Naiant gear and what do you think about it?
http://www.naiant.com/naiant.html
Answer: Sorry to bump this thread, but im surprised you have got no answers on this yet!
I bought these:

(source: naiant.com)
X-S Miniature Omnidirectional Condenser Microphone, with XLR adaptor cable & windscreen, each, $39
I was really impressed with the sound from these little fellas.
I have used the X-S Miniatures on my acoustic guitar through a Profire2626 and got quite a nice sound.
I think for sound design use its great to have some of these around as extra mics, It could be useful to use them in situations where you wouldn't want to use a really expensive mic (i.e. somewhere near explosions etc) as the loss of one wouldn't be the end of the world financially. or as extra angles on sources if you have the inputs?
Saying that though, they are hand built with lots of obviously lots of care and attention and I'd feel awful using them as if they were disposable :(
Comment: Thanks for that. Ended up not getting anything from them, but may do so in the future.

How's the handling noise on your Naiant mics? In terms of using them as a disposable mic, I wonder how they compare to the Oktavas. For effects recordings, I know people use the Oktavas MK-012 as a alternative to their Schoeps so they won't feel too much of a heartache if it blows.
Answer: Interesting stuff, never seen them before. Dirt cheap and some models have a pretty decent noise level as well. Probably not the best mics one could ver own and not the straightest frequency curve I've seen. But hey most of them cost around 50$. At that price it really isn't worth the hassle of doing DIY disposable mics.
So how do they sound?
Comment: Ill do a recording session and get back to you with some samples :)

Anyone using Naiant Gear?


external hard drive won't let me edit files

Question: I have a 1TB HardDrive and I went to run a .jar file, it didn't work because it wasn't labeled as "[/] Allow executing file as program" and I changed the file and it reverted the file back. So how can I fix this? I tried "[Change Permissions for Enclosed Files...]" on the drive and that didn't work. I've look all over the internet and found nothing, so if anyone knows how to fix this in any way possible please tell me.
Comment: If the external drive uses a non-Linux filesystem (such as NTFS or FAT) then the issue is likely the same as this one [.exe file permission fail](http://askubuntu.com/questions/18052/exe-file-permission-fail)
Answer: Try using chmod to change the rights of the file.

Use ctrl+l to copy the folder location from Nautilus
In the terminal, use the following code to add execution rights to your account and the group (it is easiest to paste the folder location using right-click): chmod u+x g+x path/to/folder/file.jar

See the Ubuntu website explaining how file permissions work and can be changed.


What can be done about a vanity top that doesn't sit tight to cabinet base?

Question: We purchased a new vanity top to replace our 12 year old builder grade piece, however, it does not appear to sit tight on the base. It doesn't really sit "in" the cabinet, and only the back sides seem to make contact. It's a standard vanity top size (49 x 22"), and my cabinets are standard also. What can I do about this? It appears to be fine from the top, but when she open the doors or look under the vanity top from inside the cabinet, you can see the issue. Any help would be greatly appreciated.
Comment: Opening the doors is a reasonable place to be concerned with how it looks. Anyone who is looking up at the underside from inside the cabinet needs to find something useful to do with their time and attention.
Comment: FYI, "flush" in carpentry means two adjacent surfaces at the same level. For example, two boards of equal size laid next to one another would be flush on top. If your countertop was the same length and depth as your cabinet, it would be flush on the sides and front.
Comment: Thanks for that! All this is new to me. I'm more of a furniture makeover DIY slowly learning how to do minor home renos here and there.
Answer: In my experience the normal, common way to attach such a top also fills any gaps, since it's good old silicone caulking - White or brown would seem like a good choice here. You can also attach by other means if you like and then caulk to seal and conceal. And you certainly should shim (or sand/grind the high spots on the base) to get it level. If the gap is larger than it seems in the pictures, use backer rod and caulking.
Comment: I'd use clear. It transmits the adjacent color and is almost always less conspicuous than solid colors (especially with toilet bases).
Comment: I'll try out some shims and see how that works for me. Sanding/grinding seems a bit intimidating for someone of my skill level when it comes to these things. Thanks for  your help!
Answer: Shims are your friend :-) .  Since what you really want is for the countertop to be perfectly level, get some shims (and a good bubble level) and adjust the shim positions until the top is level.  Then glue or clamp or whatever you're planning.
If you then have a cosmetic problem, i.e. the shims or some gaps visible, you'll need to get some luaun or other veneer material and cut (and paint) to match.
Comment: Thanks! I found some pine shims at Canadian Tire, so I'll pick a couple packs of those up. Since only the back two corners make full contact with the cabinet edge, and there is a huge gap in between the back centre...do you suggest I just shim the sides and the front for level?
Comment: @hartes if the top were granite, I'd say you should shim all sides for support.  You don't *need* that for your composite, but it might help stave off any sagging 10 years from now.


Wiring Help Lutron Diva Dimmer and Claro 3-Way with Claro First in Line

Question: I am having trouble figuring this out.  Attached is a diagram, best I could do given the tools I have. Please remember I am not an electrician so explain like I am 5 please.  In a nutshell, the 14/2 hot from the breaker comes into the electrical box where the Claro 3-way switch is located.  The Claro has 4 screws -- copper, ground and 2 silvers.  Out of that box goes the 14/2 to the light fixtures and the 14/3 to the other side of the room where the Diva Dimmer is located.  The Diva has 4 wires already attached - black, red, red/white and green.  Now ground goes to ground so that part I have figured out, but I am unsure of the correct setup here.  All the diagrams I can find have the Lutron dimmer first or are just for two conventional 3-way switches and that is confusing me for this setup.  Thanks for any help that can be given or if someone has a diagram for this. -Alan
Answer: In many 3-way diagrams you will have the feed come in to one switch, and the outgoing wire to the light at the other switch.  You have the feed and the output in one box, so you need an extra hot wire to go between the two boxes.  Because you have a green wire, I think you might have conduit.  If that is the case, the best option is to run another colored wire between the two switches to act as the common wire to the Diva.
If you cannot run an extra wire, you can use the white wire as the common return, and you note that by marking the white wire with black tape (because it will be a hot wire in this scenario).
In either case, the wire connections should be as follows.  On the Claro, connect the black wire that is the power into the box to the different-colored screw on the outlet.  The red and black "travelers" that go from box to box will connect to the other two screws.  The whites from the feed and the output to the light should be connected together.  The common return (new wire or black taped white wire) will get connected to the black wire that goes to the light.
In the Diva box, the taped white wire will go to the different-colored screw, and the red and black get connected to the other two screws.  And of course, all grounds get tied together and attached to the two switches.
Comment: Thanks.  One clarification.  On the Diva, the wires are already there.  Black, Red, Red/White and Green. Green is ground so I have that covered.  So given your advice above, it sounds like the Red and Black travelers will go to the Diva's Red and Red/White wires.  And my taped White (white with black) will go to the Black (which I assume is hot).  Does this sound correct?  Also, can't run another wire.
Comment: I also added a picture that comes from the Lutron website where it is to walk me through the setup.  Thanks again.
Comment: Ok, looking at that picture, the black taped white will go to the black pigtail, and the red and black travelers will attach to the red and red/white pigtails.  Just to reword what you said...
Comment: Thanks!  Gonna go give it a try!
Answer: You have chosen just the right set of products for this to work. The Claro appears to be a plain 3-way switch with a fancy handle.  The Lutron was deliberately chosen to be neutral-less.
Mark the wires
Normally I say mark the pair of travelers yellow, and switched-hot red.  However, that would mean marking every wire in your setup, so instead let's just say 2 reds are travelers, and black is switched-hot.
In the /3 cable, mark the white wire black. This is mandatory. This is not a "Harper"ism, it's NEC.  You have to do it.
Also in the /3 cable, mark the black wire red - that's a "Harper"ism.  "Wait, why didn't we just ..." because NEC.
On the Lutron dimmer, mark the red-white wire just red.
Hook it up
At the left switch (Claro 3-way), hook the common to the lamp hot (black).  Hook the 2 travelers to the 2 red wires.  (remember we remarked /3 black).
Also in that box, connect supply hot (black) to the /3 black wire (the white which we remarked). We're done there.
The right box has black-red-red, as does the Lutron.  (taking remarkings into account, of course). Match em up 1:1 just like that!  Done.
Answer: The thing that worked for me was to follow these instructions https://webapiaw1proddat01st01.blob.core.windows.net/assets/documents/0301710_Caseta_Advanced_Instructions.pdf
But even then it didn't work. What DID work was to switch the claro from the location it was intended to where the rocker I didn't want replaced was.
Comment: Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer).


Use the sufficient conditions for differentiability to determine where the function $f(z) = e^{z^2}$ is differentiable

Question: I know that the exponential function satisfies the condition of Cauchy-Riemann and is differentiable but how to tell where the function is differentiable specifically?
Sufficient Conditions for Differentiability in this case are: If the real functions u(x,y) and v(x, y) are continuous and have continuous first-order partial derivatives in some neighborhood of a point z, and if u and v satisfy the Cauchy-Riemann equations at z, then the complex function f(z) = u(x, y) + iv(x, y) is differentiable at z
Comment: Just the phrase "f is differentiable" with no conditions means it is differentiable **where**?
Comment: Do we have tell the values of x and y at which it differentiates or something else?
Answer: That function can be naturally expressed as the composition of two differentiable maps (the exponential function and $z\mapsto z^2$). Therefore, it is differentiable. You don't need the Cauchy-Riemann equations here.


Can I still play on after activating FLAG is END in Baba is You?

Question: I can see that in 'A Way Out?' I can win the level with WIN but I can also make the flag END. I want to do END but I can tell I have much more content left and I don't want to get locked out of my 30+ hour save file. It seems to be impossible to tell if this is the case without running into spoilers, since I don't want to see the ending before I beat the game. If I activate FLAG is END will I be able to keep playing on that save file?
Answer: Yes!
I tested it by copying my save file and getting the ending and after the credits I could still play on that save file.
Answer: Yes. You can always go back to a level that you've previously been able to reach. This is true whether you win the level or do anything else that might cause you to exit the level.
The only things that can't be undone are consequences of winning a level: you can't re-lock any levels that it unlocked, un-mark the level as won, reduce your win count...
In the late game, (mild spoiler — vague wording that doesn't actually reveal any surprises)

 there are times when it's not trivial to return to a prior level. But it's always possible. This thread explains the mechanics of one such case.


Can I claim a ship abandoned if a friend exchanges his ship for a crashed ship?

Question: My friend has an exotic that he doesn't want. I absolutely love it but I don't want him to abandon it it for nothing. So I thought well if he exchanges it for a crashed starship, would I be able to claim it once he exchanges it since it would then be considered abandoned? Just to clarify if he found a crashed ship and exchanged his exotic for it would I be able to swoop in and claim it for myself?
Comment: @Mumford451 There is a limit to how many ships a person can posess, maybe the person who want's to get the new ship already has the max of ships and wants to trade it in.
Comment: @Wouter After digging around a bit, I cannot find anything specific to the "Beyond" update for NMS regarding how many ships you can possess, so as far as I know, it is still 6.  If I end up finding more info I may turn it into a Question on here and submit the answer.  Good Q though!
Comment: I believe... In the current version you are not able to "Abandon" a ship once you fix and claim a Crashed Starship.  Your only option is to Claim and Add to Collection (or something like that).  The ship that you found the Crashed Starship with is still yours and you may switch ships as you would like.
Answer: I do not believe so. Abandoned ships are not claimable. They are an artifact left over from the previous owner exchanging it for another ship and are no longer really in the game.
Though you can still seem them, you cannot interact with them, so have no way to claim them.
The behavior may have been different in older releases, but at least in the Beyond update, this is the behavior I have experienced.


Time series animation problem

Question: How to create time series animation with unequal time interval in the data in ArcGIS? for eg I have population data for the years 2013,2012,2010,2004,1990,1950,1900, so how can I create time series animation with this kind of unequal time interval?
Comment: Are you trying to set an unregular time step interval ?
Or simply to display your datas at all years, no matter if they're displayed longer when the time period is bigger (1900's datas displayed for 1910, 1920, 1930, etc, for example) ?
Answer: There are two ways to animate data like you're talking about. The first is the Time Slider, which relies on time attributes in the data to create the span of the animation. You can make overall adjustments to playback, but it relies a constant, regular time interval - for instance show each year for one second. For this reason, it won't work well for what you want to do. 1900 would be shown for 50 seconds, then 40 seconds of 1950, 14 seconds of 1990, and so on. You can change what the interval is (days, years, months), but it has to be regular based on time.
The second way is actually several options/variations on the main them of using the Animation Toolbar (or an outside program). One method is simply to create a map for each year, save it as an image, and bring it into an outside program to turn into a video (or even a timed 'power point' type presentation). You then control how long each image is shown.
Within Arc the easiest way to do this is a group layer animation. I'll assume your data is all in one shapefile. You have some geometry (points, polygons) with an attribute for each year. You'll add that same shapefile multiple times to your document - once for each year. Symbolize each layer using the different year attributes; likely with the same symbology but based on different attributes so they maintain a consistent look and the change in the data is what stands out. You don't want one year red and one year blue unless you're showing them at the same time, adding more and more to the map as time progresses. This also works if each year is it's own file. If all in one file, a shortcut is to add it once, set up the symbology, then copy the layer and just alter which field (year attribute) the symbology is based on.
Once you have all the layers symbolized, in the animation track window you control when each layer is visible for the animation. As one turns off another turns on (or you turn them on in sequence if you want to go that route). The animation track controls how long they're visible for, whether they fade in/out, cross-fade, etc. The help file linked above should cover all the details.

Time series animation problem


Can I place books as a block?

Question: In Minecraft, I created a church and made a solid golden altar. I typed up The Book of Matthew in a book and quill and then signed it. Can I place this on the alter so it can be read? Can I even place a book at all? Is there a mod that would allow me to do this?
Comment: Maybe with Mystcraft, but the standard vanilla way is just to leave it in a chest.
Comment: for looks use an enchantment table, for readability use item frame.  for mods, use bibliocraft
Comment: You could use an enchant table as the "for show" book, and then an item frame/chest with the actual book somewhere else.
Answer: There is no vanilla way to place books in the world (except in a chest as MBraedley says).
Bibliocraft however has various ways of storing books in the world, the best looking way for a single book would probably be something like the desk:

The desk will keep one book open (it can store up to 9 at a time in the latest version of Bibiliocraft) and right clicking on that book (if it is a book and quill or a written book) will allow you to read from the book directly. It will also store the page you were reading from when you exit the book.
Comment: Bibliocraft is *wonderful*. It is one of the most well-crafted mods out there. It's worth saying that the desk lets you read the book without picking it up.
Comment: @SevenSidedDie I wasn't sure you could read it while it was in the table, I'll edit my answer.
Answer: You can place an item frame, then place the book inside it. This will allow players to come up and see the book in the frame, then click it to take it into their inventory and read it.
Note that as of the latest snapshots, clicking an item frame once will give the item, and clicking an empty item frame will remove it from the wall. This lets you keep the item frame in place when the book is removed.
Comment: When I put the book in the frame, it only puts a picture of the book and the book remains in my inventory.  If I otherwise dispose of the book (e.g. put it in a chest) when I try to take the book from the frame it just disappears and does not go into my inventory.
Answer: I understand that this is an old question but here is how I would do it in vanilla minecraft. Make an enchantment table and place it somewhere where the altar would be, then make a chest nearby and place the book in it. Although this wouldn't let you read the book from the enchantment table but it will seem as though the book is there since the texture is practically the same. The enchantment table will also add a little cool thing where whenever you go near it the book will open and flip through. So if you think of it, it would look as though you are reading the book from the table but in reality it is in your hands.
Answer: It will work if you place a book and quill on a lectern (which looks like a pulpit if you ask me).
Comment: Welcome on Arqade SE. You could (and should) improve your answer by using screenshots and/or add links to these elements (like a link to the wiki page or something like that).
Answer: there is no legit way in minecraft vanilla (as of 1.6.2) to read a book without holding it
although as said above you can get a mod for that (best place to get forge mods is http://www.skydaz.com/)
Comment: Skydaz is sketchy at best. They don't appear to ask for permission to repackage modders' hard work.
Answer: You can WITHOUT mods or hacks place the book in an item frame or a chest or one of the different kinds of chests.
Comment: This does not add anything to already existing answers.  Please don't duplicate information in existing answers.

Can I place books as a block?


Becoming a monk and having to give up electronic devices

Question: When becoming a monk one has to give up most worldly stuff. I have saved hundreds of Buddhist PDF files and on my Kindle app I have bought all of Ven. Bhikkhu Bodhis books (translations on the Pali canon) so I can use those when becoming a monk and having to learn and study the Dhamma. What if I purchase myself an iPad before becoming a monk - can I then use that iPad with my books after I become a monk? If not, then how should one get access to the Dhamma?
Comment: Evidently some monks have access to the internet, for example. But (I don't know) perhaps they don't own those devices as their own personal property.
Comment: Thanks ChrisW. Since there are still some years before I'm able to ordain I will just study the Tipitaka until then so I'm less reliant on this issue.
Answer: Lord Buddha's preachings have no time period. Those teachings can apply past present and future. Buddhism is a philosophy that needs to deal with consciousness. It has nothing to do with physical items.
Using Ipad or Phone or Laptop is totally a deal that you make with your consciousness. If you use them to learn Dhamma with the permission of your teacher there is no wrong.  But you get the permission from the teacher to learn buddhism and you start watching movies or songs or gossips then you are breaking rules.
Being honest to "Sila" and to your heart consciousness you can use them in a valuable way to the society. You use them for the purpose and keep them aside physically. Mentally totally give up the ownership that makes ego which is very harmful for your future activities.  so mentally let it go. its just another collection of Ultimate realities just like you me tables trees. It has Chitta - 01[89 or 121 in activities], Chaithisika - 52, and Matters - 28, which comprises 5 aggregates [ Rupa Updana Skandha, Vedana Upadana Skanda, Sagna Updana Skanda, Sankara Upadana Skanda, Vinnana Upadana Skanda ].
They are not permanent. keep on changing and decaying. As a translator of buddhist books i feel you understand what I mentioned here. In Sri Lanka monks can use those with the permission of the Master Teacher.
May Triple Gem Blessed You.
Comment: Dear Sanath, thank you so much for this answer. That is exactly what I needed. I will only use the ipad to study the Pitakas that I've bought on it and have in my Kindle app. Thank you for telling me about the permission from the head monk or preceptor. That is the info I was looking for. I hope I can ordain in 2-3 years from now. May you be well and happy.
Comment: Actually I forget to tell you one thing this is the rule if you are ordain under Theravada Buddhism Temple and this is practising in Sri Lanka.  Because I know few of my friends ordain and staying remotely in meditation Centers ["Yogashrama"] while learning Thripitaka.  Their Teachers allow them to use those after classes.  Because this is a real deal with our heart consciousness. To gain a profit for us not to anybody.  So as we need to be honest to ourselves not to anybody.  May Triple Gem Blessed You!!!
Answer: If your primary interest is in reading books, particularly electronically, then just stay a lay person.
If you want to become a monk, choose a monastery where you know the resources exist to learn the Dhamma. If they don't have those resources (either through the people there or through a library), then you should find a different place.
Answer: Whether gross physical or electronic, one going forth neither takes from households with him on the path, the more abstains taking and using from what's not personal given to him.
Good to abound the traded and also thieved Dhamma and receive Dhamma in proper ways by one's preceptor and ancestors of this tradition, and proper given, rightly obtained, good householder.
Comment: Good householder Chris, although one might be able to receive such, one should be clear not having easy possibilities to maintain, burden to carry and carry a broad desired danger (as others might like to get such) with one. Sure better to place such into a community possession and never carry such along.
Comment: Is a monk allowed to take what someone offers them, for example a mobile phone? Or is such a thing perhaps given to a monastery and so available for monks there to use, but not possessed by any monk?
Comment: The iPad is gifted to myself by myself. So I can use it when I become a monk. Is that okay?
Comment: Is it ok if one leaves home to take such with one as one going forth, householder Daydream? My person would give someone much space, who left for higher and took refuge and a preceptor, yet not willing to let go of his house and all the dirt in and around it. But certain common under just common, seeking to build their next home with the noble traditions shelter. If having ipad and traded Dhamma as refuge, why burden those with faith into the Gems, and the Gems?
Comment: Keys, contracts, debts, relations, faults, stores, maintaining connection to the world... (hardly ever get it clean and proper obtained) all such are signs of householder.
Comment: @user24130. Okay I understand. Thank you very much for the answers.
Comment: Thank you, Venerable, for answering.
Answer: Not at all. I lived in India as a Vedic monk and we had a dozen of most advanced computers and electronic devices for studying and distributing Dharma. We didn't feel the burden of having advanced electronic devices because the were properly utilized. Monks can benefit from technology and use it to advance in spiritual life.
Comment: Thank you very much for your answer dear friend.


Tracking Google Analytics Page Views with AngularJS

Question: I'm setting up a new app using AngularJS as the frontend. Everything on the client side is done with HTML5 pushstate and I'd like to be able to track my page views in Google Analytics.
Comment: @webdev5 A new version of angulartics is out. Try it out at: http://angulartics.github.io/
Comment: angulartics is deprecated.  Use [angular-google-analytics](https://github.com/revolunet/angular-google-analytics)
Comment: Try angulartics http://luisfarzati.github.io/angulartics/
Answer: If you're using ng-view in your Angular app you can listen for the $viewContentLoaded event and push a tracking event to Google Analytics.
Assuming you've set up your tracking code in your main index.html file with a name of var _gaq and MyCtrl is what you've defined in the ng-controller directive.
function MyCtrl($scope, $location, $window) {
  $scope.$on('$viewContentLoaded', function(event) {
    $window._gaq.push(['_trackPageView', $location.url()]);
  });
}

UPDATE:
for new version of google-analytics use this one
function MyCtrl($scope, $location, $window) {
  $scope.$on('$viewContentLoaded', function(event) {
    $window.ga('send', 'pageview', { page: $location.url() });
  });
}

Comment: I would use

    `$rootScope.$on('$routeChangeSuccess', ...)`
Comment: If you're using the GA new script, it's `$window.ga('send', 'pageview', { page: $location.path() });` instead of the `$window._gaq...` part. Also, you may want to remove `ga('send', 'pageview');` from your original GA code to prevent duplicates when you first land on a page.
Comment: FWIW it should be `_trackPageview` and not `_trackPageView` ... spent 10 mins of head scratching :)
Comment: @DavidRivers Hm, it's been a while, but just from glancing at this answer and my comment, it would seem that applying it to `$rootScope` would guarantee that it will not be removed by some other event or DOM change, and using `routeChangeSuccess` will fire every time the location bar changes, instead of just ever time you change your view source template. Does that make sense?
Comment: @dg988 during a $routeChangeSuccess event, you may NOT know upfront the page's title (which, for example, could be set inside a controller after it finished processing data from a RESTful service). This way alone with the URL of the page Google Analytics will track  a title of the previous page.
Comment: @Tarkus What I do is attach the title to the route config (since you can add any other data) and update it on $routeChangeSuccess before I track GA.
Comment: the correct code should be $window.ga('send', 'pageview', { page: $location.url() });. For the page parameters google documentation says 'The page path and query string of the page'
Comment: @dg988: Why? Please elaborate.
Comment: Nothing in this entire post works for me anymore! Active Page in GA is always `/`, even with this answer. Anybody have insight?
Comment: Is it good to use `$location.url()`? I'm currently sending `$route.current.loadedTemplateUrl`, which has less fidelity but I feel like including the URL parameters would be overkill. What's best practice for GA?
Comment: If page title is set dynamicly using for instance ngMeta you can specify the page title with `$window.ga('send', 'pageview', {page: $location.path(), title: $rootScope.ngMeta.title});`
Comment: How do we do this with Typescript? I get the error that $window.ga is not defined in ng.IWindowService
Comment: I would use `$rootScope.$on('$stateChangeSuccess', ...)`.
Comment: Hopefully somoene will see this nestled deep in the comments, but I had a few controllers and I did some tracking. As you navigate, the listener triggers more and more becauseits loaded every time a controller is initialised. You need to check if you've already added the listener to the `$rootScope`, and then not do it again.
Comment: I think I'm doing something wrong here. Where do I put the MyCtrl function and where do I call it from?
Answer: When a new view is loaded in AngularJS, Google Analytics does not count it as a new page load. Fortunately there is a way to manually tell GA to log a url as a new pageview.
_gaq.push(['_trackPageview', '<url>']); would do the job, but how to bind that with AngularJS?
Here is a service which you could use:
(function(angular) {

  angular.module('analytics', ['ng']).service('analytics', [
    '$rootScope', '$window', '$location', function($rootScope, $window, $location) {
      var track = function() {
        $window._gaq.push(['_trackPageview', $location.path()]);
      };
      $rootScope.$on('$viewContentLoaded', track);
    }
  ]);

}(window.angular));

When you define your angular module, include the analytics module like so:
angular.module('myappname', ['analytics']);

UPDATE:
You should use the new Universal Google Analytics tracking code with:
$window.ga('send', 'pageview', {page: $location.url()});

Comment: The other thing to note here is you need to include the "analytics" service somewhere.  I did mine in app.run.
Comment: @Designermonkey It should work if you include just in your main app module. If you have a totally independent module though which does not require your main module, you may need to include that again. Cheers!
Comment: Would this need including in every module, or just the initial app?
Comment: If you're using a service, you should define your functions with the "this" keyword: [source](http://tylermcginnis.com/angularjs-factory-vs-service-vs-provider/#comment-20762). For example, within the service it would be `this.track = function($window.ga('send', 'pageview', {page: $location.url()});` This will allow you to use `googleAnalytics.track();` within your **app.run()** function
Answer: app.run(function ($rootScope, $location) {
    $rootScope.$on('$routeChangeSuccess', function(){
        ga('send', 'pageview', $location.path());
    });
});

Comment: Note: If you use minimzation/compilation you need to specify the parameter names:
`app.run(["$rootScope", "$location", function(...`
Comment: Not so great if you have async code that dynamically changes your title, else its great.
Comment: This solution is excellent if you don't want to include GA code in every controller.
Answer: Just a quick addition. If you're using the new analytics.js, then:
var track = function() {
 ga('send', 'pageview', {'page': $location.path()});
};

Additionally one tip is that google analytics will not fire on localhost. So if you are testing on localhost, use the following instead of the default create (full documentation)
ga('create', 'UA-XXXX-Y', {'cookieDomain': 'none'});

Comment: Using ui-router you can send page views like this: `$rootScope.$on('$stateChangeSuccess', function (event, toState, toParams, fromState, fromParams) {
  ga('send', 'pageview', {
    'page': $location.path(),
    'title': toState.name
  });
});`
Comment: Make sure you use `$window` to access the window (`ga` alone inside Angular is very likely to be `undefined`). Also, you may want to remove `ga('send', 'pageview');` from your original GA code to prevent duplicates when you first land on a page.
Comment: To add: If you are using search parameters in your app you can track those using `$location.url()`
Comment: I upvoted this answer since using .path() is better than .url() because you normally want to exclude query string params. See: [Google Analytics Configuration Mistake #2: Query String Variables](http://cutroni.com/blog/2006/09/21/google-analytics-configuration-mistake-2-query-string-variables/)
Comment: Oh man, thanks. I was getting weird errors, and noticed my snippet didn't even have _gaq in it, hehe. Silly Google: updating their code and all that! Haha.
Answer: I've created a service + filter that could help you guys with this, and maybe also with some other providers if you choose to add them in the future.
Check out https://github.com/mgonto/angularytics and let me know how this works out for you.
Answer: Merging the answers by wynnwu and dpineda was what worked for me.
angular.module('app', [])
  .run(['$rootScope', '$location', '$window',
    function($rootScope, $location, $window) {
      $rootScope.$on('$routeChangeSuccess',
        function(event) {
          if (!$window.ga) {
            return;
          }
          $window.ga('send', 'pageview', {
            page: $location.path()
          });
        });
    }
  ]);

Setting the third parameter as an object (instead of just $location.path()) and using $routeChangeSuccess instead of $stateChangeSuccess did the trick.
Hope this helps.
Answer: I've created a simple example on github using the above approach.
https://github.com/isamuelson/angularjs-googleanalytics
Comment: Not all routes are different pages and GA treat each route as different page. By converting the route to query string, you have the option to ignore parts of the query string.
Comment: I added a fix to better report the path.
so now if you have the route of `/account/:accountId`
aka path is `http://somesite.com/account/123`
it now will report the path as `/account?accountId=123`
Comment: @IBootstrap what is the benefit of putting the route params in query string?
Comment: @IBootstrap I have the same question, what is the benefit of putting the route params in query string ?
Answer: In your index.html, copy and paste the ga snippet but remove the line ga('send', 'pageview');

I like to give it it's own factory file my-google-analytics.js with self injection:
angular.module('myApp')
  .factory('myGoogleAnalytics', [
    '$rootScope', '$window', '$location',
    function ($rootScope, $window, $location) {

      var myGoogleAnalytics = {};

      /**
       * Set the page to the current location path
       * and then send a pageview to log path change.
       */
      myGoogleAnalytics.sendPageview = function() {
        if ($window.ga) {
          $window.ga('set', 'page', $location.path());
          $window.ga('send', 'pageview');
        }
      }

      // subscribe to events
      $rootScope.$on('$viewContentLoaded', myGoogleAnalytics.sendPageview);

      return myGoogleAnalytics;
    }
  ])
  .run([
    'myGoogleAnalytics',
    function(myGoogleAnalytics) {
        // inject self
    }
  ]);

Comment: I can't remember TBH but by looking at it I would say it leaves flexibility for other actions or logging additional stuff elsewhere, and may be more accurate by explicitly telling ga of the current page, so ga can continue to functiona accurately, rather than JUST logging a pageview for some "arbitrary" page url.
Comment: I like that selfinjection stuff :) Up
Comment: Just out of curiosity, why do you set the `page` with the current path, and then submit it as a `pageview`? What is the difference of doing it that way instead of just `$window.ga('send', 'pageview', {page: $location.url()});`?
Comment: If you want realtime analytics to work in Google you should do "set". For why see documentation reference: https://developers.google.com/analytics/devguides/collection/analyticsjs/single-page-applications#overview
Comment: 'set' is recommended so that every single hits being sent on the same page (like GA Event to track user interactions) is sent with the same Page path value. Nothing to do with Realtime analytics. see https://developers.google.com/analytics/devguides/collection/analyticsjs/single-page-applications
Answer: The best way to do this is using Google Tag Manager to fire your Google Analytics tags based on history listeners. These are built in to the GTM interface and easily allow tracking on client side HTML5 interactions .
Enable the built in History variables and create a trigger to fire an event based on history changes.
Answer: I found the gtag() function worked, instead of the ga() function.
In the index.html file, within the  section:

In the AngularJS code:
app.run(function ($rootScope, $location) {
  $rootScope.$on('$routeChangeSuccess', function() {
    gtag('config', 'TrackingId', {'page_path': $location.path()});
  });
});

Replace TrackingId with your own Tracking Id.
Answer: If someone wants to implement using directives then, identify (or create) a div in the index.html (just under the body tag, or at same DOM level)

and then add the following code in the directive
myApp.directive('googleAnalytics', function ( $location, $window ) {
  return {
    scope: true,
    link: function (scope) {
      scope.$on( '$routeChangeSuccess', function () {
        $window._gaq.push(['_trackPageview', $location.path()]);
      });
    }
  };
});

Answer: For those of you using AngularUI Router instead of ngRoute can use the following code to track page views.
app.run(function ($rootScope) {
    $rootScope.$on('$stateChangeSuccess', function (event, toState, toParams, fromState, fromParams) {
        ga('set', 'page', toState.url);
        ga('send', 'pageview');
    });
});

Answer: If you're using ui-router you can subscribe to the $stateChangeSuccess event like this:
$rootScope.$on('$stateChangeSuccess', function (event) {
    $window.ga('send', 'pageview', $location.path());
});

For a complete working example see this blog post
Answer: Use GA 'set' to ensure routes are picked up for Google realtime analytics. Otherwise subsequent calls to GA will not show in the realtime panel.
$scope.$on('$routeChangeSuccess', function() {
    $window.ga('set', 'page', $location.url());
    $window.ga('send', 'pageview');
});

Google strongly advises this approach generally instead of passing a 3rd param in 'send'.
https://developers.google.com/analytics/devguides/collection/analyticsjs/single-page-applications
Answer: Developers creating Single Page Applications can use autotrack, which includes a urlChangeTracker plugin that handles all of the important considerations listed in this guide for you. See the autotrack documentation for usage and installation instructions.
Answer: I am using AngluarJS in html5 mode. I found following solution as most reliable:
Use angular-google-analytics library. Initialize it with something like:
//Do this in module that is always initialized on your webapp
angular.module('core').config(["AnalyticsProvider",
  function (AnalyticsProvider) {
    AnalyticsProvider.setAccount(YOUR_GOOGLE_ANALYTICS_TRACKING_CODE);

    //Ignoring first page load because of HTML5 route mode to ensure that page view is called only when you explicitly call for pageview event
    AnalyticsProvider.ignoreFirstPageLoad(true);
  }
]);

After that, add listener on $stateChangeSuccess' and send trackPage event.
angular.module('core').run(['$rootScope', '$location', 'Analytics',
    function($rootScope, $location, Analytics) {
        $rootScope.$on('$stateChangeSuccess', function(event, toState, toParams, fromState, fromParams, options) {
            try {
                Analytics.trackPage($location.url());
            }
            catch(err) {
              //user browser is disabling tracking
            }
        });
    }
]);

At any moment, when you have your user initalized you can inject Analytics there and make call:
Analytics.set('&uid', user.id);

Answer: I am using ui-router and my code looks like this:
$rootScope.$on('$stateChangeSuccess', function(event, toState, toParams){
  /* Google analytics */
  var path = toState.url;
  for(var i in toParams){
    path = path.replace(':' + i, toParams[i]);
  }
  /* global ga */
  ga('send', 'pageview', path);
});

This way I can track different states. Maybe someone will find it usefull.
Answer: I personally like to set up my analytics with the template URL instead of the current path. This is mainly because my application has many custom paths such as message/:id or profile/:id. If I were to send these paths, I'd have so many pages being viewed within analytics, it would be too difficult to check which page users are visiting most.
$rootScope.$on('$viewContentLoaded', function(event) {
    $window.ga('send', 'pageview', {
        page: $route.current.templateUrl.replace("views", "")
    });
});

I now get clean page views within my analytics such as user-profile.html and message.html instead of many pages being profile/1, profile/2 and profile/3. I can now process reports to see how many people are viewing user profiles.
If anyone has any objection to why this is bad practise within analytics, I would be more than happy to hear about it. Quite new to using Google Analytics, so not too sure if this is the best approach or not.
Answer: I suggest using the Segment analytics library and following our Angular quickstart guide. You'll be able to track page visits and track user behavior actions with a single API. If you have an SPA, you can allow the RouterOutlet component to handle when the page renders and use ngOnInit to invoke page calls. The example below shows one way you could do this:
@Component({
  selector: 'app-home',
  templateUrl: './home.component.html',
  styleUrls: ['./home.component.css']
})
export class HomeComponent implements OnInit {
  ngOnInit() {
    window.analytics.page('Home');
  }
}

I'm the maintainer of https://github.com/segmentio/analytics-angular. With Segment, you'll be able to switch different destinations on-and-off by the flip of a switch if you are interested in trying multiple analytics tools (we support over 250+ destinations) without having to write any additional code.
Answer: Merging even more with Pedro Lopez's answer,
I added this to my ngGoogleAnalytis module(which I reuse in many apps):
var base = $('base').attr('href').replace(/\/$/, "");

in this case, I have a  tag in my index link:
  <base href="/store/">

it's useful when using html5 mode on angular.js v1.3
(remove the replace() function call if your base tag doesn't finish with a slash /)
angular.module("ngGoogleAnalytics", []).run(['$rootScope', '$location', '$window',
    function($rootScope, $location, $window) {
      $rootScope.$on('$routeChangeSuccess',
        function(event) {
          if (!$window.ga) { return; }
          var base = $('base').attr('href').replace(/\/$/, "");

          $window.ga('send', 'pageview', {
            page: base + $location.path()
          });
        }
      );
    }
  ]);

Answer: If you are looking for full control of Google Analytics's new tracking code, you could use my very own Angular-GA.
It makes ga available through injection, so it's easy to test. It doesn't do any magic, apart from setting the path on every routeChange. You still have to send the pageview like here.
app.run(function ($rootScope, $location, ga) {
    $rootScope.$on('$routeChangeSuccess', function(){
        ga('send', 'pageview');
    });
});

Additionaly there is a directive ga which allows to bind multiple analytics functions to events, like this:


"Merging" Entities?

Question: In a recent Video video I watched, about creating smooth elevators in 1.9, the first step he took was to merge a falling sand block with a shulker mob, and then to put that falling sand/shulker entity as the head of a named armorstand. I saw someone commented on his video this same question, but there was no answer (at least not yet). Any Ideas on how this works?
Answer: The Passengers list tag in 1.9, previously Riding compound tag in 1.8, holds a list of entities riding a host. These entities will appear at the same height when within the same depth.
Example, where the armor stand is the host and the FallingSand and Shulker are riding it at the same depth:
/summon ArmorStand ~ ~1 ~ {Passengers:[{id:"FallingSand",Block:"minecraft:stone",Time:1},{id:"Shulker",NoAI:1b}]}

Example, where the Shulker is at a lower depth (within the Passengers tag of the FallingSand, which is similar to what Riding was restricted to prior):
/summon ArmorStand ~ ~1 ~ {Passengers:[{id:"FallingSand",Block:"minecraft:stone",Time:1,Passengers:[{id:"Shulker",NoAI:1b}]}]}

Note that the stacking order is reversed from Riding, in that the host is at the root (ArmorStand) while the top-most entity is at the top (Shulker). Riding would cause the deepest-nested entity to be the host instead, while the root was on top.
Comment: Great, thanks. Is there anyway to make the falling sand appear as another block though? In the video I out in my original question, the guy did exactly what your command did, but it appeared as an iron block. Any ideas?
Comment: @SMILIECHICKEN The `Block` string tag specifies the name ID of the block that the FallingSand should look like. I've edited my answer to include the tag.

"Merging" Entities?


Word for someone unaware they are different or disabled

Question: There is a word that describes someone who is unaware that they are different or disabled.For example, someone who can't smell but is unaware of what smelling is so they think they are the same as everyone else. What is this word?
Comment: This word does not mean stupid, or even ignorant. It is very specific.  Ignorant of their disability is what this word means.
Comment: *incognizant, innocent, insensible, mindless, misinformed, moronic, naive, nearsighted, neglectful, oblivious, thoughtless, unaware...* It's too open-ended.
Comment: Is there in fact anyone on the planet who's *"unaware of what smelling is"*? If you know exactly what concept you're after, could you not come up with a better example - one that might actually *have* a real-world referent for comparison?
Answer: EDIT:
Anosognosia: a condition in which a person who suffers disability seems unaware of the existence of his or her disability.
or as previously suggested:
Oblivious: not aware of or not concerned about what is happening around oneself
Comment: OED defines **anosognosia** as *unawareness of or **failure to acknowledge one's hemiplegia** or other disability* (Hemiplegia: injury to one side of the brain). I thought at first the question was too open-ended, but now it seems Too Localised!
Comment: @Kris: I just mean *anosognosia* looks like a highly specialised medical term that's probably hopelessly inappropriate in any other contexts. If *oblivious* had been what OP was looking for, it would have been a reasonable question. But as it is, I just feel ELU is being used as a human-assisted medical dictionary lookup facility.
Comment: It's more specific, like "oblivious that they have a disability"
Comment: Anosognosia, that is what I was looking for.  Thanks!
Comment: @FumbleFingers A case of not being aware of one's own shortcomings, perhaps?


How do I duplicate a mail template

Question: I have an existing email template I have made and now I want to repurpose it for another use while keeping the basic layout. How can I duplicate my original template please?
Answer: You can click on the button to display the source code and then copy all.
Open a new template, click on the (same) button to display the source code, and paste what you have copied. Then click on the button again, and voilá, you have copied an email template!

How do I duplicate a mail template


Extract udf (latest version) blu-ray iso?

Question: How can I extract udf blu-ray iso with fast speed? It seems like rar and 7z can't read the file format. I know that you can mount it and then copy the files, but it's terribly slow for me (10MB/s on a drive with 125MB/s speed), which is also the reason why I can't use it directly (have to wait to buffer every 2-5 seconds).
Comment: Is the image perhaps residing on the same disk you're trying to copy its contents to? Is this a HDD ("spinning rust")?
Comment: @DanielB No. I tried copying to another disk. This is a HDD disk.
Answer: There is only ONE valid answer:
DVDisaster

Please search for a download on some trusted tech site of yours. I remember sourceforge putting unwanted stuff into their downloads.

It's Open-Source and available for Linux as for Windows. If you want, you can even create a backup of the filesystem structure. Most of times, the data might be flawless, but you don't get them displayed, because of errors in the file system.
Comment: It might be worth talking about what OSes this supports, where to find this application and how to use it
Comment: Oh sorry. I already migrated to Linux a long time, ago. For me all StackExchange sites - i use - are bout Linux. :)


Is division of matrices possible?

Question: Is it possible to divide a matrix by another? If yes, What will be the result of $\dfrac AB$ if
$$
        A = \begin{pmatrix}
        a & b \\
        c & d \\
        \end{pmatrix},
        B = \begin{pmatrix}
        w & x \\
        y & z \\
        \end{pmatrix}?
$$
Comment: see for example [here](http://www.mathwords.com/i/inverse_of_a_matrix.htm). You'll have to distinguish between $AB^{-1}$ and $B^{-1}A$.
Comment: To add various types of brackets around entries of a matrix, you can use pmatrix or bmatrix or other variants. See [tutorial at meta](http://meta.math.stackexchange.com/a/5023/).
Answer: For ordinary numbers $\frac{a}{b}$ means the solution to the equation $xb=a$. This is the same as $bx=a$, but since matrix multiplication is not commutative, there are two different possible generalizations of "division" to matrices.
If $B$ is invertible, then you can form $AB^{-1}$ or $B^{-1}A$, but these are not in general the same matrix. They are the solutions to $XB=A$ and $BX=A$ respectively.
If $B$ is not invertible, then $XB=A$ and $BX=A$ may have solutions, but the solutions will not be unique. So in that situation speaking of "matrix division" is even less warranted.
Answer: There is a way to perform a sort of division , but I am not sure if it is the way you are looking for. For motivation, consider the ordinary real numbers $\mathbb{R}$. We have that for two real numbers, $x/y$ is really the same as multiplying $x$ and $y^{-1}=1/y$. We call $y^{-1}$ the inverse of y, and note that it has the property that $yy^{-1}=1$.
The same goes for different algebraic structures. That is, for two elements $x,y$ in this algebraic structure we define $x/y$ as $xy^{-1}$ (under some operation). Most notably, we have a notion of division in any division ring (hence the name!) . It turns out that if you consider invertible $n \times n$ matrices with addition and ordinary matrix multiplication, there is a sensible way to define division since every invertible matrix has well, an inverse.  So just to help you grip what an inverse is, say that you have a 2x2 matrix $$A= \begin{bmatrix} a & b \\ c & d \end{bmatrix}.$$
The inverse of A is then given by
$$A^{-1} = \dfrac{1}{(ad-bc)} \begin{bmatrix} d & -b \\ -c & a \end{bmatrix}$$
and you should check that $AA^{-1}=E$, the identity matrix. Now, for two matrices $B$ and $A$, $B/A = BA^{-1}$.
Comment: I know this is not the most eloquent answer, but why the downvote?
Answer: Normally, matrix division is defined as $\frac{A}{B}=AB^{-1}$ where $B^{-1}$ stands for the inverse matrix of $B$. In the case where the inverse doesn't exist the so called pseudoinverse may be used.
Answer: We can say $$\frac{A}{B}=A\times B^{-1}$$ where $B^{-1}$ is inverse matrice of $B$
Comment: if $\ \cfrac AB = A \times B^{-1}$ then what is $B^{-1} \times A$?
Comment: That is an other possibility since product of matrices is not commutative.So division of matrices can not be defined in an unique way
Answer: There are two issues: first, that matrices have divisors of zero; second, that matrix multiplication is in general not commutative.
To give meaning to $A/B$, you need to give meaning to $I/B$ (because then $A/B=A(I/B)$. Now, no one ever writes $I/B$, people actually write $B^{-1}$. Anyway, what is $B^{-1}$? It should be a matrix such that multiplied by $B$ gives you the identity. Now, there exist nonzero matrices $C$, $B$ with $BC=0$. If $B$ had an inverse $B^{-1}$, we would have
$$
0=B^{-1}0=B^{-1}BC=C,
$$
a contradiction. So such a matrix $B$ cannot have an inverse, i.e. "$I/B$" does not make sense.
The invertible matrices are exactly those with nonzero determinant. So, if $\det B\ne0$, then $AB^{-1}$ does make sense.
In you case, that would be the condition $wz-yx\ne0$. In that case,
$$
\begin{bmatrix}w&x\\ y&z\end{bmatrix}^{-1}=\frac1{wz-yx}\begin{bmatrix}z&-x\\ -y&w\end{bmatrix}
$$
The second issue is a non-issue, because it can be proven that, for matrices,  if $B^{-1}A=I$, then $AB^{-1}=I$.
Answer: Do you know why matrix multiplication is defined in such a weird way ? It is defined thus, so that the effect on a column vector of left-multiplying it by one matrix, and then left-multiplying the result by another matrix, is exactly the same as the effect of left-multiplying by a single matrix that is the product of those two matrices. That is, matrix multiplication corresponds to composition of linear operators. If you didn't know that already, then you should try to convince yourself that it's true, in a simple class of special cases. I would recommend trying a 2 by 1 column vector with variables for entries, and two 2 by 2 matrices, also with variables for entries. So "dividing by" a matrix would correspond to "undoing" the effect of a linear operator. For instance, rotating the plane clockwise by a certain angle "undoes" the anticlockwise rotation of the plane by the same angle. However, there are plenty of linear operators that can't be undone (because they have squashed something flat), and the matrices representing these operators (with respect to any given basis) must therefore be not-dividable-by. This is unlike the situation with the real numbers, for instance, in which there is only one of them by which you can't divide, namely zero.
Answer: Element-wise division is frequently used to normalize matrices in R o MatLab. For instance, in R if dtm is a contingency matrix counting occurrences of something, you can normalize the rows so that all the rows sum 1.0 as:
dtm.proportions <- dtm / rowSums(dtm)

Or normalize the columns transposing the matrix first:
dtm.proportions <- t(t(dtm)/colSums(dtm))

Is division of matrices possible?


Undoing Content Changes Made with Admin Panel

Question: I administer an existing site, and accidentally changed some of the formatting on our homepage.  In the past, I have been able to press "back" on my browser to undo changes, but for some reason it's not working this time.  Does anyone know of a way I can "undo" changes I made to the website under the admin panel?
Comment: i dont think you can "undo", but it will work if you have a DB backup or Git Repo based on your dev env.
Answer: Your ability to undo changes depends on what you changed and how your site was set up. Some components of Drupal can be reverted, like if you have revisions enabled on your nodes. A more advanced set-up may have "Features" which allow you to revert all sorts of things. It really depends.
For most changes you make in the admin panel, you need to find the setting you adjusted and change it back to its original value. It would help if you described your issue in more detail, like what settings were being adjusted and what version of Drupal you were using.
Comment: @bryanbruan Thanks for your help!!! I think I accidentally deleted a div container on our front page. There were three boxes lined up in a row, and now the left-most one has no box and is above the others. I am using Drupal 6.
Comment: If your div was in the body of a node and you aren't sure how to correct it, I'd check to see if there are revisions for that node. More information on that here: https://drupal.org/node/320614. If revisions aren't set up, I recommend turning them on for future protection. As for the div, maybe you can compare the html markup for the first box to the other two boxes to see if you can find (and replace) what's missing.


Is it OK to teach banking related subjects in school?

Question: Is teaching interest based banking system in school allowed for a Muslim teacher?
Answer: Yes, if the teacher doesn't teach in a way which promotes haram banking system.
For example if the teacher just teaches how the banking system works in a way which doesn't promote the haram banking system then it's okay. And if the teacher says something like you should take interests Blah blah blah, then teaching that subject will be haram for him. And the teacher should teach his students about disadvantages of taking interest and how it makes the poor more poor then it will be definitely halal for him because he is telling his students to stay away from haram things.
Comment: Would be better to add some references/quotation of scholars or citation from Quran and Hadith that say **"teaching/learning about haram is haram"** .
Answer: In my opinion, practising something makes haram and knowing it doesn't make haram. So I think teaching banking concepts will not be haram. Educating people about the concept along with why it is prohibited makes the teaching wholesome.
Experts shall add comments if I am right.
Answer: Why not? Before judging if Haram or Halal one has to understand what is interest and how financial institutions use it.
In my experience it is better to wait for students to be at least 15 years old.
Yes, the banking system is Haram. If you read history, you will understand that all market krach were caused by the actions of banks. In 2008 and 2009 the financial markets had a krach because the banks sold bad investments to investors telling them that these investments were good and safe. They lied, that is haram. They stole money from millions of innocent people when they cheated, that is also haram.
But the original question was not about banking or interest based banking system, the question was about teaching the banking system.
One cannot love without knowledge. Why is interest considered haram? If you love your children, teach them, show them why interest is Haram and why Allah tells us, with love, that we should not deal with people who use interest to profit by lying and changing the balance they use in the markets.
It is not appropriate to talk about these things when a child is too young. I did teach my children about interest and Haram but only when they were old enough to understand the reason behind. I showed them because I love them I did not want their faith in Allah to be blind. Now my children can accept and love the very words of wisdom that Allah gave us about interest.
Comment: He is talking about school kids not his own children I guess. I am not sure if the school would like him to preach about what is haram and not in the school. Also banks and banking system aren't haram.. It is riba that is.
Comment: @Kilise one would argue banking could possibly be haram as they create money out of thin air.
Answer: As Salaamu 3laykum,
In my understanding it would not be alright to teach a subject that is impermissible. So let's say for example alcohol. You start teaching others how to make alcohol. One might say I am not creating the alcohol but you are passing on forbidden knowledge. The Quran and hadith are all about light and enlightening our lives and not to bring darkness , delusion , deception into our lives.
Inshaa ALLAH there must be something else you can teach that would be alright to do.
And ALLAH (Glory Be to HIM) knows best.