neg_mean_squared_error in cross_val_score

Question: The string "mean_squared_error" appears to be deprecated in cross_val_score now, and it's saying to use neg_mean_squared_error. Is this metric literally just the negative of the MSE?
Answer: You are right, neg_mean_squared_error is simple -1 * mean_squared_error. This is because a convention in the Scikit-learn api that all the scorers follow.
According to scikit-learn documentation (some emphasis added):

For the most common use cases, you can designate a scorer object with the scoring parameter; the table below shows all possible values. All scorer objects follow the convention that higher return values are better than lower return values. Thus metrics which measure the distance between the model and the data, like metrics.mean_squared_error, are available as neg_mean_squared_error which return the negated value of the metric.
Comment: When it says "higher return values are better than lower return values,"  does this mean "higher in MAGNITUDE?" If not, then for negative values, smaller in magnitude would mean "higher."
Comment: You cannot have negative values in the mean squared error by definition ``mean(y - y_hat)**2`` will always be positive, so in principle, the higher the worst the model is, when multiplied by -1 the magnitude is inverted so that higher values will imply a better fit, and as above states, this is only for metrics that measure the distance between the model and the data


Binomial Random Variable Multiplied by a constant

Question: I have a Binomial(n,p) random variable that is multiplied by a constant, specifically 1/n. I know for some random variables multiplying by a constant doesn't change the distribution, i.e. the Normal, but for others it does, i.e. the Poisson. I can't find anything about the Binomial when it is multiplied by a constant. I know the expected value and variance but what I'm really interested in is whether this is a valid (i.e. not improper) random variable for all constants or just for some. I would appreciate any guidance.
Answer: It's a valid random variate for all constants, even zero (for which the probability of observing zero equals 1.)  It's just a Binomial random variate multiplied by a constant; that doesn't change the fact that the probabilities are all nonnegative and sum to one.
Let us denote the constant by $c$ and the random variate itself by $x$.  The original, binomial, random variate is multiplied by $c$ to get $x$.  The probability distribution of $x$ is:
$$p(x;n,p,c) ={n \choose x/c}p^{x/c}(1-p)^{n-x/c}$$
except for $c=0$ of course.  This works because $x/c$ transforms $x$ back to the original Binomial variate, which, in the case of discrete random variables, is all you need.
Comment: The support would be $\{0, 1/n, 2/n, \dots, 1\}$ if $c = 1/n$.  You don't have to have an integer value for a discrete random variable, just a countable number of possible values; whether they are integer values or not is irrelevant.
Comment: Thanks for your answer. How did you derive the pmf, it would be great to see how that was done? Also, one of the values that got me thinking about this was c=1/n. For this case would the support only be x=1, because if c=1/n I would have n choose nx and I can only choose n objects out of n objects. I'm just having a hard time understanding this for constants that are fractions.


How to add the date/time on the file name of Nikon D3200

Question: Right now, every picture I take are named like this DSC_0237.JPG
As a result, When I try to put the pictures in the same folders as other Nikon pictures, the filenames overlap.
How to add the date and time in this naming format automatically?
Something like: DSC_0237_20180302_131525
Comment: If you want the naming to be done in camera, you can't.
Comment: You'll have to use a helper app/tool to rename the files. I'd recommend exiftool.
Comment: Possible duplicate of [How do I prevent a Nikon D3100 from resetting the file image numbering each time?](https://photo.stackexchange.com/questions/11589/how-do-i-prevent-a-nikon-d3100-from-resetting-the-file-image-numbering-each-time) which will stop the counter resetting. You then only have to change DSC to DSD, DSE etc every 10, 000 shots. I know of no way to make it add a date.
Comment: No, I know of this feature but I want to put the date/time or even a short random string. The goal is to differentiate the file to other Nikon filename
Comment: That method will differentiate your first ten thousand images. Further differentiation is done by changing the prefix to something other than DSC - https://www.nikonusa.com/en/learn-and-explore/a/tips-and-techniques/using-the-file-naming-feature-in-a-nikon-dslr-camera.html
Answer: There is no option to change the file name in camera. Users can only change the file number sequence method, as @Tetsujin noted. For the record:
In Setup Menu, change File Number Sequence to On. The camera will continuously number images and give them all a unique filename. After 999 images, use the Reset option in File Number Sequence to go back to 001. See the D3100 manual for more details.
Changing the name for each shoot has to be done outside of the camera. The import tool in your digital asset management program will have an option for that. Alternately, use a free-standing app for bulk file renaming.


Volume of parallelpiped question?

Question: I need to find the volume of a parallelpiped. The volume is spanned by 3 vectors $$\begin{cases}a=(-5,-3,2), \\ b=(1,0,2), \\ c=(2,-1,3), \end{cases}$$ so I tried with the formula $(a \times b) \cdot c$, to find $a \times b$ I got $$\begin{bmatrix} -3 & 2 \\ 0 & 2 \end{bmatrix}, - \begin{bmatrix} -5 & 2 \\ 1 & 2 \end{bmatrix}, \begin{bmatrix} -5 & -3 \\ 1 & 0 \end{bmatrix},$$ and then I calculate this and it gives me $-6-0 , - (-10-2) , (-5 \cdot 0)-1\ \cdot (-3)$ and that's $$\begin{bmatrix}-6 & 12 & 3 \end{bmatrix}^t \cdot \begin{bmatrix}2 & -1 & 3 \end{bmatrix},$$ this is just $c$ :). I get $-12-12+9=-15$ so basically my volume is negative? I don't know if that's the way its supposed to be or if I have done anything wrong, any tips/solutions? :)
Comment: Your answer is correct. The negative sign is accounting for a orientation change. When you compute volumes using determinants you compute an oriented volume, which in your case means your three vectors are not compatible with the right hand rule.
Comment: Do you know the right hand rule?
Comment: Okay, so we have a starting point. The right hand rule tells you the sign convention: whenever you can align vectors following it the orientation is positive. If you compute $a \times b$ using the right hand rule you will get an opposite vector regarding the rule, hence the negative. This is an orientation reversal.
Comment: Yes, the volume magnitude is 15. You should probably explain somewhere about the orientation.
Comment: The volume gets multiplied by corresponding factors. If you magnify one vector it gets magnified by that factor, if you magnify all vectors then it gets magnified by the product of the factors. In the first case it gets magnified by $k$, in the second by $k^3$. Compute the explicit example for $k=2$ to see how this happens. =)
Answer: The volume is determined by the absolute value of (a×b)⋅c.  Also, you can create a 3x3 matrix with your given vectors then find it's determinant (which turns out to be the same operations you've already performed); and once again the volume is determined by the absolute value of the determinant.

Volume of parallelpiped question?


UICollectionviewCell Animations

Question: I want to animate the collectionview cells,the animations should be like this:
First Cell Appear and then after some delay second cell will appear with some animations,this will go on like this for all the cells.
How to achieve this?
Answer: A solution would be to create the datasource incrementally so you add a cell after a set timed delay. Once added, insert
Make a call to set up a timer to add to your dataSource with whatever delay you like
[NSTimer scheduledTimerWithTimeInterval:0.05 target:self selector:@selector(addToDataSource:) userInfo:nil repeats:YES];

Then within this method that will hit every 0.05 seconds (in this example)
-(void)addToDataSource:(NSTimer*)timer{

    [self.yourMutableDataSourceArray addObject:OBJECT]

    NSInteger arrayCount = self.yourMutableDataSourceArray.count;

        [self.collectionView performBatchUpdates:^{
            [self.collectionView insertItemsAtIndexPaths:@[[NSIndexPath indexPathForItem:arrayCount-1 inSection:0]]];
        } completion:^(BOOL finished) {

        }];

    //Once you have reached the desired count cells you wish, remember to invalidate the timer

}

The performBatchUpdate will mean the collectionView will be reloaded with animation.
I hope this helps
This is in objective-C, though same principles apply if you're writing this in swift
Comment: @Elan Do you mean where to call 'NSTimer'? You can call it from your viewDidLoad, or set it to call from an IBAction should you wish.
Comment: @ Jim Tierney  what i want is it should like scrolling from up to down but it looks like fade in or out.....is there any solution for that?
Answer: The other solution here is using willDisplayCell:forIndexPath delegate
Here is a sample how i do it.
func collectionView(collectionView: UICollectionView, willDisplayCell cell: UICollectionViewCell, forItemAtIndexPath indexPath: NSIndexPath) {
    if (!loadedIdx.contains(indexPath.row)) {
        let cellContent = cell
        let rotationAngleDegrees : Double = -30
        let rotationAngleRadians = rotationAngleDegrees * (M_PI/180)
        let offsetPositioning = CGPoint(x: collectionView.bounds.size.width, y: -20)
        var transform = CATransform3DIdentity
        transform = CATransform3DRotate(transform, CGFloat(rotationAngleRadians), -50, 0, 1)
        transform = CATransform3DTranslate(transform, offsetPositioning.x, offsetPositioning.y, -50)

        cellContent.layer.transform = transform
        cellContent.layer.opacity = 0.2

        let delay = 0.06 * Double(indexPath.row)
        UIView.animateWithDuration(0.8, delay:delay , usingSpringWithDamping: 0.8, initialSpringVelocity: 0.5, options: .CurveEaseIn, animations: { () -> Void in
            cellContent.layer.transform = CATransform3DIdentity
            cellContent.layer.opacity = 1
        }) { (Bool) -> Void in

        }

        loadedIdx.append(indexPath.row)
    }

}

The loadedIdx is an array to mark cell as loaded ( not animate in the next time appear)
Comment: I have tried using that but when i reload my collectionview it doesnt works
Comment: Did you `removeAllObject ` inside loadedIdx array when reloading?
Comment: yes i have removeAllObject but still it doesnot work as i want
Comment: Am following Jim approach now,collection rows are coming after delay but problem is it doesnt look like scrolling from up to down rather it looks like fade in and out.

UICollectionviewCell Animations


Is the speed of propagation of Einstein's gravitational waves unique?

Question: The LIGO Scientific Collaboration and Virgo Collaboration have announced that on the 14th of September 2015, at 09:50:45 UTC, they detected a transient Einstein gravitational wave, designated GW150914, produced by two merging black holes forming a single black hole. They stated that the speed of propagation of the gravitational wave is the speed of light. Is the speed of propagation of Einstein's gravitational waves unique or arbitrary?
Comment: Possible duplicate of [speed of gravitational waves](http://physics.stackexchange.com/q/107798/)
Comment: Can you clarify what you mean by "unique" as opposed to "arbitrary"? All gravitational waves propagate at $c$ in GR, if that's what you mean.
Comment: Possible duplicates: http://physics.stackexchange.com/q/5456/2451 and links therein.
Comment: I've deleted some replies to a deleted comment.  @StephenJ.Crothers, if you'd like to post links to your viXra publications, I suppose you could use your [user profile page](http://physics.stackexchange.com/users/106212/stephen-j-crothers).
Answer: On top of John Rennie's answer:
Summary: Nothing propagates faster than the speed of light according to GR. According to general relativity, gravitational waves propagate at the speed of light. From what I understand, this applies even when adding corrections to the weak field limit, although then the question becomes how to decompose the curvature into two parts (background + gravitational waves).
Why LIGO people are interested: If one believes in gravitons and GR, measuring the speed of gravitational waves offers a way to constrain general relativity.
For more information on the derivation of the wave equation
Answer: Just to add to the other answers - the non-linear theory predicts that gravitational waves propagate isotropically in vacuum with speed $c$, as in the linear theory (see here for a mathematical answer, also you can find this in Hawking & Ellis). In other words, the causal domain for events related through gravitational radiation is identical to the causal domain of electromagnetic radiation (light cone), though this is seldom discussed in physics GR books for reasons I don't understand.
It is a really amazing property of general relativity that this is true - the non-linear nature of the field equations could easily have meant that waves (solitons) behave topologically non-trivially. In modified theories of gravity, with field equations even infinitesimally different from GR, gravitational waves can acquire massive modes which modifies the dispersion relations and tweaks the phase speed (see here for linear and here for non-linear in one such theory, at the risk of self-promotion). Therefore, one such test of GR is to try and find GWs with propagation speeds different from $c$.
Answer: A partial answer: the analytical approach to gravitational waves normally uses the weak field limit of the Einstein equations. In this limit it's easy show that the wave vector of the gravitational wave is null i.e. it travels at the speed of light (proof available on demand but it's not terribly interesting). More precisely the local speed of propagation is always $c$.
I say this is a partial answer because I'm not sure what happens when the gravitational waves are intense enough for the non-linearities to become important. While this is never going to be an issue for the waves detected by LIGO it would be important very near to the colliding black holes.
Comment: There is a simple analytical metric solution describing an arbitrary strong *plane wave* solution to the Einstein's equation :  the *Peres metric* : https://en.wikipedia.org/wiki/Peres_metric.  This solution describes a classical and easy to understand monochromatic plane gravitational wave, propagating at speed $c$.  The amplitude is arbitrary.
Comment: In the case of sufficiently strong radiation for non-linear coupling, I'm not sure it would make sense to describe the effect as "gravitational radiation" (this seems to me to imply the weak-field 1/r falloff, etc)
Comment: @AGML: there would presumably be some intermediate regime where the wave was recognisably a wave but wasn't described by the usual linearised metrics? It just struck me that this seems a simple question but I have never heard the matter addressed.
Comment: There definitely is such a regime and my point of view is to some extent a matter of taste. It's just that a lot of the theory of gravitational radiation depends on the waves being perturbations on asymptotic infinity and would fail to describe such situations.
Comment: The local speed of propagation is always c because we define it so. We use the loca motion of light to define the metre and the second, and then use them to measure the local speed of light. It's a tautology.
Comment: No Mr. Rennie, the speed of propagation of Einstein's gravitational waves is coordinate dependent: Crothers, S.J., A Critical Analysis of LIGO's Recent Detection of Gravitational Waves Caused by Merging Black Holes, Hadronic Journal, Vol. 39, 2016, http://vixra.org/pdf/1603.0127v4.pdf
Comment: @StephenJ.Crothers: What I said was **the wavevector is null**. That means the GW travels along the same trajectory that a light ray travelling alongside it does, because light follows null geodesics. The **coordinate** velocity of both the GW and light will depend on what coordinates you choose, but all observers will agree that it is following a null geodesic.
Comment: "_The statement made in the answers above is that gravitational waves have a null wavevector. Null wavevectors are null in all coordinate systems so your statement that gravitational waves may travel at speeds different from light is simply untrue._"  John Rennie.  **No, Mr. Rennie, you are wrong. See Appendix of: Crothers, S.J., A Critical Analysis of LIGO's Recent Detection of Gravitational Waves Caused by Merging Black Holes, Hadronic Journal, Vol. 39, 2016, http://vixra.org/pdf/1603.0127v4.pdf**
Answer:
Is the speed of propagation of Einstein's gravitational waves unique?

No. As per all waves, the speed varies according to the properties of the medium. Moreover a gravitational wave is a propagating transient change in the  properties of the medium, space, such that optical clocks run slower whilst the wave is passing through. Do note that the speed of a wave also depends on the type of wave. For example seismic waves might be longitudinal P-waves or transverse S-waves. The latter propagate at circa 60% of the speed of the former.

The LIGO Scientific Collaboration and Virgo Collaboration have announced that on the 14th of September 2015, at 09:50:45 UTC, they detected a transient Einstein gravitational wave, designated GW150914, produced by two merging black holes forming a single black hole. They stated that the speed of propagation of the gravitational wave is the speed of light. Is the speed of propagation of Einstein's gravitational waves unique or arbitrary?

It varies, as does the speed of light:

None of the answers others have given to this question are correct. The speed of propagation of Einstein's 'gravitational waves' is arbitrary because it is coordinate dependent.

IMHO you should employ the CMB reference frame here. When you do, you will still find that the speed of a gravitational wave varies. It goes slower when it passes through a region of low gravitational potential, such as a galaxy.

There is no unique speed of propagation. Select a certain set of coordinates then the speed is that of light.

We can't be totally confident that the speed of gravitational waves is the speed of light. I know that's what Einstein said, but the proof is in the pudding, and I'm not totally convinced about the LIGO result.

Select a different set of coordinates then the speed is entirely different to that of light. The claim by the LIGO-Virgo Collaboration that the speed of propagation is the speed of light is patently false.

I don't think it's patently false, in that they had two waveforms at two locations, with a delay that was in line with propagation at c.

Furthermore, General Relativity cannot localise its 'gravitational energy'.

It can. The energy density of space where a gravitational field is, is higher than the energy density of free space.

Consequently there are no 'gravitational waves'.

A wave is a propagating field variation, or a field is a standing wave. If you can have a field, you can have a wave.

Indeed, General Relativity violates the usual conservation of energy and momentum for a closed system and is thereby in conflict with a vast array of experiments.

It doesn't violate conservation of energy. The ascending photon doesn't lose any energy. The descending brick doesn't gain any.

As for the mathematical theory of black holes, it violates the rules of pure mathematics. It is therefore false. LIGO did not detect gravitational waves or black holes. All this has been explained in detail in my paper here: Crothers, S.J., A Critical Analysis of LIGO's Recent Detection of Gravitational Waves Caused by Merging Black Holes, Hadronic Journal, Vol. 39, 2016, http://vixra.org/abs/1603.0127

I'll take a look at it. As I've said before, I think you should reserve your accusations for the incorrect interpretation of GR rather than GR itself.


Women wearing pants

Question: I am a 14 years old girl who wants to use baggy pants but my father said that I couldn't use any pants because that would be mutashabihat! Did Allah or the prophet said that women couldn't wear pants?
Comment: See if this answers your question: https://www.islamweb.net/en/fatwa/5521/conditions-to-be-met-when-a-woman-wears-pants
Answer: Salaam sister. Your father is absolutely correct. Women can wear pants but only at home not outside. Women are diamonds in Islam and these diamonds can only be uncovered in front of her mahrams. You can wear pants at home infront of your Brother and Father because they are your mahrams. But outside world is not your mahrams. Well their is no proper hadith about women wearing jeans. Many muslim girls do this but they don't know the truth. If you really want to wear pants outside then their are laws. Such as The clothes should be loose and shouldn't be tight. The private parts such as the the back side should be fully covered and visible to nobody outside because they are non mehrams. Easy way is to wear a skirt type of shirr in which parts are covered above the knees. But remember. It will be haram to reveal your private parts to anyone in the outside. Take care.
Answer: Jummah Mubarak
Assalamu alaikum sister,
First of all your father is correct.
There is a ruling that the clothes a woman wears has to meet some conditions if worn in front of any man unrelated to her, or related (ie cousin) but by law can marry that woman (non-mahram men) as not to cause any lustful desires towards her and thus protect her from such as she is precious.
These are the conditions that must be met:
The clothing should cover the whole of the body whilst hiding the body's shape and skin color (ie baggy thick clothes). It should be unattractive clothing as not to attract the non-mahram men's gaze to it (ie clothes decorated with embroidery should be avoided), it should not be perfumed. It shouldn't appear masculine. It should be different clothing to what would be associated with disbelievers and should not promote fame towards the woman wearing it.
Allah says (interpretation of the meaning):
"And tell the believing women to lower their gaze (from looking at forbidden things), and protect their private parts (from illegal sexual acts) and not to show off their adornment except only that which is apparent (like both eyes for necessity to see the way, or outer palms of hands or one eye or dress like veil, gloves, headcover, apron), and to draw their veils all over Juyoobihinna (i.e. their bodies, faces, necks and bosoms) and not to reveal their adornment except to their husbands, or their fathers, or their husband's fathers, or their sons, or their husband's sons, or their brothers or their brother's sons, or their sister's sons, or their (Muslim) women (i.e. their sisters in Islam), or the (female) slaves whom their right hands possess, or old male servants who lack vigour, or small children who have no sense of feminine sex. And let them not stamp their feet so as to reveal what they hide of their adornment. And all of you beg Allaah to forgive you all, O believers, that you may be successful" [al-Noor 24:31]
So, from this ayah of The Qu'ran we can see that we should do everything in terms of the clothes we wear to deter non-mahram men's gaze from us (ie not attract them at all to our clothes or us). The reason for no perfume and the other rules mentioned above. Now on to wearing baggy pants it 1) resembles the clothes of a man (masculine) and 2) reveals the shape of the woman's legs. However if wearing the pants under a jilbaab that doesn't show what is underneath it and is baggy and wide, concealing the body, then it is lawful to do so as it's more to do with covering and protecting the body from these lustful desires of the non-mahram men
Shaykh 'Abd al-Razzaaq 'Afeefi (may Allaah have mercy on him) said: If a woman wears pants and puts over them a wide garment then she will not be resembling men, so long as she wears them underneath her garments. (Shaykh 'Abd al-Razzaaq 'Afeefi. Page 573)
Shaykh Ibn 'Uthaymeen (may Allaah have mercy on him) said: I think that the Muslims should not follow these fashions and kinds of clothes that come to us from here and there. Many of them are not in accordance with proper Islamic dress which involves covering the woman completely, like the short or very tight or thin clothes. That includes pants, because they show the size of a woman's legs, as well as her stomach, waist, breasts, etc. Wearing it comes under the description given in the saheeh hadeeth: "there are two types of the people of Hell whom I have not seen: people with whips like the tails of cattle, with which they strike the people, and women who are clothed yet naked, walking with an enticing gait, with something on their heads that looks like the humps of camels, leaning to one side. They will never enter Paradise or even smell its fragrance, although its fragrance can be detected from such and such a distance." Narrated by Muslim, 2128.
The ruling is not to wear clothing which is too long out of pride but for it to reach the ankles or even further passed the ankles.
Al-Tirmidhi (1731), al-Nasaa'i (5336), Abu Dawood (4117) and Ibn Maajah (3580) from Ibn 'Umar (may Allaah be pleased with him) who said: The Messenger of Allaah (peace and blessings of Allaah be upon him) said: "Whoever lets his garment drag out of pride, Allaah will not look at him on the Day of Resurrection." Umm Salamah said: "What should women do with their hems?" He said: "Let them down by a handspan." She said: "But then their feet will be uncovered." He said: "Then a cubit, but no more than that." This hadeeth was classed as saheeh by al-Albaani in Saheeh Sunan al-Tirmidhi.
And Allah knows best
Assalamu alaikum

Women wearing pants


Notification Count Badge in App overflow

Question: What should be the maximum count for a notification badge in a app and what about when its overflow.
Comment: Can you provide a little more context? How urgent are the notifications? How frequently are they generated? Why do your users care (or not care) about knowing the exact number? What would you hope to gain by introducing a maximum count?
Comment: Can we use 99 as a maximum count and after that stick to 99+ ?
Answer: I think you need to answer the questions that @graham-herrli asked to really decide what is the correct maximum number of notifications you should show.
About the overflow: an optional implementation is to change the count to a symbol that will represent the overflow.
Example: google chrome on mobile changes the tab count to a laughing emoticon ":D" when you have more than 99 tabs open.
Answer: There are no hard rules for the max count display. Gmail shows '99+' and outlook shows the actual count, something like '278'.
It is completely dependent on the kind of design you are proposing and limitation of the page real estate. It could be rare scenario where the numbers of digits exceeds more than 3. It depends on the app you are building and the average notifications per day a user receives.
The below illustration is a reference for badge shape and count only. Probably, you can adopt this wherever required, but again based on your page real estate.


I'm trying to find my father's birth & death certificate in Poland

Question: My dad was born 1947 in Poland and died in 1997 in Poland. He migrated to the US and became a naturalized US citizen in the 1970s and also served on the polish army but I can't find the town. My parents were also married in Poland in the same town and came back to the US. He had a brother and sister in Poland and married my mother in Poland. I have pictures of their wedding but I don't know who everyone is. I'm trying to get his birth and death records and military records.
Comment: So if I don't read or write polish and I live in the US how do I go about asking the polish embassy in the US to help me?
Comment: I suggest using Google Translate.
Answer: For a person living after World War 2, all those documents can be obtained online, from the state. However, this requires one to a) read and write Polish b) have an online Polish government identity. You can also apply for those via a post letter, though overseas mail takes quite some time. It's also easier if you do know your father's PESEL (identification number). There's a small fee to pay, around $5.
Other options are

asking a family member in Poland to apply for those for you (there's a field on the form to authorize someone else to act in your name)
asking the Polish Embassy/Consulate in the USA for help - this should be a fairly routine thing for them

Regarding military service, it seems like one can only obtain their own record, not for someone else, even a close family member, and archives available currently end at the end of World War 2.
Comment: Once someone has died family mebers can indeed obtain the dead relative's Military Record.


Blackberry AppWorld webframe

Question: I want to build a webframe application in Java for Blackberry AppWorld. I need an app page that will show a website without leaving the application. In iOS, this would be a UIWebView or in Android, this would be a webframe.
Answer: You want to use a BrowserField.

Blackberry AppWorld webframe


Question about (lLack of) Risk Neutral Bond Pricing in Duffie & Lando (2001)

Question: I have been reading this famous paper of Duffie & Lando (2001) and I have a question regarding how they calculate the price of a bond (the reader of this post will not have to dive deep into the details, but it would certainly be helpful to be familiar with the paper). In particular, they fix a probability space on which an asset $V_t$ follows geometric Brownian motion with drift $\mu \equiv m + \sigma^2/2$ and volatility $\sigma$ and compute the price of their bond (under a filtration which is a strict subset of the filtration of $V$) without changing to the risk neutral measure (see equation (29) and equation (26), specifically). Why is this valid, or am I just missing something entirely?
Answer: In the model setup, they state that all agents are risk-neutral, which would mean $\mathbb{P}=\mathbb{Q}$.


How to repair damaged Android 4.2.2 on tablet?

Question: While deleting apps to free up storage, I removed important system
functions (display touchscreenscanning).
How can I replace the system with a fresh version of Android 4.2.2?
Answer: You need to find a complete ROM for your tablet and flash it. Basically:
1. Search Google for " stock ROM" if you want the exact same system. Make sure you get the "gapps" (Google Apps) for that version of Android.
2. You will need a custom recovery, so search Google for " custom recovery" (TWRP and CWM are 2 common recoveries).
3. Find the instructions to flash your tablet
Comment: OP specified he wants to "replace the system with a complete new Android v4.2.2", so I believe he means "repair" instead of "upgrade" in the title.
Answer: If your goal is to have a fully-functioning device again, you should be able to do a factory reset to return to a factory image. If you did not root, then your system image should be ok.
Navigate to Settings > Backup and Reset > Factory data reset and proceed from there. This will delete all data on the device, but your installation of Android 4.2.2 will be fresh, just when you started using it.


"Das Frauenwahlrecht hat in großen Teilen Europas bereits eine lange Geschichte" - Why not "im großen Teil"

Question: I think with Teil (English - part) it would never be something with plural, but here it is "den Teilen", so why is the grammar here like that?
Thanks.
Comment: "In large parts of Europe" is possible in English; I think it would emphasize that it's made up of several unconnected pieces. In any case, there are many expressions where German and English don't agree on details, so you can't infer that German will follow a given pattern from the fact that English does.
Answer: You can alternatively say "in einem großen Teil Europas". The sentence "im großen Teil Europas" is grammatically correct, but it does not sound nice.
Comment: @LeNguyen Grammar books usually do not focus on language style. Thus you need experience which you can only get by speaking, listening and reading. And things are often not really clear-cut. Even native speakers do not always agree what is *good practice*.
Comment: so it is the matter of "sounds nice", which is something gained through exposure and intuition, right? Because I don't think this is mentioned in any of my grammar books.
Answer: It's in plural because it translates to large "parts" of Europe. And the plural dative form is den. Hence "in" and not "im" and "Teilen" and not "Teil". Hope this helps and feel free to upvote and accept my answer :)
Comment: if one would want to use singular, one would probably phrase it like "Im Großteil Europas..."
Answer: I agree with the comment of rdbury in the interpretation, that plural is used since legal measures are typically made on country level. When looking on a map the relevant countries are more likely than not disconnected.
If talking about a mere percentage share, this could be re-phrased to:

.. in einem großen Teil Europas...

but Im does not reflect this indefinitve article quality required for the meaning.


Overriding or Creating Custom Pages for record detail of specific objects

Question: I am using the Napili Salesforce Community Template and I want to modify just the record detail page for a specific custom object. Is that possible? I see how I can go into Community Builder > Page Editor > Record Detail and edit all record detail pages but I don't see how I can edit it only for specific objects such as a myObject__c custom object. Or, alternatively is there a way to re-direct it in the community when it does to that specific page?
Answer: Yes, it is possible to modify just the record detail page for a specific custom object, but you'll need to create that page first.
When you are in Community Builder, go to Page Manager > + > Create Object Page > [Choose your Object] > Create. Check the screenshot for the first 3 steps.

Now you can go back to Community Builder > Page Editor > OBJECT_NAME Detail and edit the record detail page layout for only this specific object.
Answer: This article should get you your answer - View and Create Record Detail Pages in Napili - releasenotes.docs.salesforce.com
Also, in case you need to customize the record detail further - like to move the field around in the detail layout - create a new page layout in Salesforce for your object and assign it to the profiles which have community access. This new layout will be used when displaying the record detail page.


In Windows Azure, is it possible to have a load balanced endpoint that's only accessible by traffic from a connected virtual network?

Question: I have a Cloud Service that is connected to a LAN through a virtual network. I have a web role that machines on the LAN will be hitting for tasks like telling the cloud service that data needs to be refreshed. It it possible to have and endpoint that's load-balanced, but that only accepts traffic through the virtual network?
Answer: Well... you have a few things to think about.
You could set up your own load balancer in a separate role, which then does the load balancing. You'd probably want two instances to deal with high availability, and if there was any stateful/sticky-session data you'd need to sync it between your two load balancers. OR...
Now: If your code needing load-balancing lived in a Virtual Machine, rather than in a web/worker role, you could take advantage of the brand-new IP-level endpoint ACL feature introduced at TechEd. With this feature, you can have an endpoint that allows/blocks traffic based on source IP address. So you could have a load-balanced endpoint balancing traffic between a few virtual machines, and you could then limit access to, say, your LAN machines, and even add your existing Cloud Service (web/worker) VIP so that your web and worker role instances could access the service, all through the endpoint without going through the VPN. This way, you'd get to take advantage of Azure's built-in load balancer, while at the same time providing secure access for your app's services.
You can see more details of endpoint ACLs here.
Answer: No. The load balancer for a cloud service is public only. You can't predict the ip addresses of the individual instances on the virtual network, so you can't even hook them into your own load balancer. Yes, you can do it with VMs (as David recommends) — but then you're doing old-school IIS, not a cloud service. I went through this in November 2012, and was unable to find a decent solution.


Are the mightstone and the drogbar related to trolls?

Question: In World of Warcraft:Legion, we run into vrykul, tauren, and other races that are related to other known races.  However we run into different 'tribes' of a race of large bulky humanoids that have tusks (Similar to the troll berserkers)  Is it ever revealed whether they are a type of troll, or are they a completely new species?
Comment: My personal headcannon is that they're juiced-up troggs (underground dwellers, affiliation with earth elements, posture/build similar), but I haven't seen anything confirming that yet one way or the other. I see a lot of theories floating discussing "dark trolls" though, but trolls are usually more clever.
Comment: troggs sounds good to me, the trolls are an "old" race so they probably dont have an origin from another race like the young human race
Comment: We don't appear to have any concrete evidence yet. I'll update you if I find any later!
Comment: fyi did a quest, the drogbar were servents of nefarian 10,000 years ago, you see their ancestors(who look the same) during highmountain flashbacks.
Answer: Nothing official has been revealed about the Drogbar race origins yet.  That's kind of unusual, given that there was even an explanation for the Broken Isle's variant on Tauren (yes, moose-antlers have an explanation).  So there are plenty of guesses being bandied about.
The more common theory is that the Drogbar are a remnant of a troll clan labeled dark trolls, which are a lore remnant of an underground race that could fit.  I don't personally give this much credit, because we've yet to meet a troll clan that consisted entirely of bulky berserker type trolls, and we've yet to see a "small" Drogbar, or anything else that resembles an actual typical troll.  Trolls also tend to be fairly clever even among more savage tribes, which is something not seen from the Drogbar.  Possibly the final nail in the coffin of this idea, dark trolls are revealed in Chronicle, Vol. 1 to be a more peaceful and harmonious variety of troll that existed in prehistory, and upon moving near the Well of Eternity and soaking up it's energies, slowly became the first night elves.  If dark trolls or their descendants did still exist, they would have more in common with elvenkind, not with the brutish drogbar.
The closest fit that I've been able to come up with would be troggs, which are also bestial subterranean creatures, with roughly the same brutish appearance.  They also happen to be devolved earth elementals which would explain some of the Drogbar powers quite nicely, and the name even lightly fits in a corrupted language sort of way.  The only problem is troggs are far far stupider, and much weaker looking.  My counter-thought is that proximity to Neltharion - a giant source of Earth magic, before he got nasty - may have pushed them back in the other direction, giving them just enough wit to assemble a basic society and packing their form with muscle.  This is, unfortunately, still a guess, and it's also a guess that could be stretched and applied to just about any race that happened to wander in.
There are some other theories linking them to goblins, but given we've already seen muscled-up goblins (the drudges they sometimes call hobgoblins) I doubt that's in the cards either.


Special Issue abstract acceptance

Question: A prestigous journal was calling abstracts for a special issue. I was informed by the guest editor that my abstract was accepted with final paper due dates. I completed my submission and have been waiting almost two months. I was wondering if it is common for rejection in situations like my case.
Comment: I would think that even though an abstract has been accepted, the complete manuscript will still undergo peer review, a process that is often very long. Two months of review time is quite normal.
Comment: Are you sure that was a prestigious journal? I get special issue invitations from predatory / fake journals almost every day. Always a good idea to check with experienced colleagues before signing any publication agreements.
Comment: What is your field?
Comment: Energy and environment is my field.
Comment: Usually the editors send an expected timeline for the process when there is a special issue. Did you see one in the initial call or when you were informed that you made it past the abstract stage?
Answer: Acceptance or rejection isn't predicted by the delay. The editors have asked for reviews from trusted reviewers. They will make a decision on individual papers near the time that the production department needs clear instruction. I'd guess that most rejections will come near that time as the editor(s) consider the relative "worth" of each paper to the whole. But the "production deadline" might be a bit fuzzy in some cases.
I'd also assume that if a paper is definitely rejected you will be notified relatively quickly to avoid requests for information becoming too much of the workload.
And, I'd guess that after two months, editors are still collecting reviews, assuming that the production deadline isn't imminent. Things take time because people are busy with other tasks.
But, no one can predict what is in the minds of the editors or what their work process is. Patience is advised.
Answer: I have a hard time believing that a prestigious journal would accept contributions based on an abstract only, but according to your question they did, because they asked for the final version. I think it is more likely that

As Ian said in a comment, the journal is not prestigious, but they used a very similar name as the journal you thought you were interacting with.

OR

They did not ask you for a final version but for a final submission, as Buffy assumes. In this case, they might have a way for you to look at the status of your submission. I have no idea why they were doing a pre-screening of articles based on abstracts, but you should be able to determine this from reading the call for papers. In this case, two months is not a long time. The journal needs to give reviewers enough time and they might not have sufficient reviewers standing by.

OR

The journal is the journal you are thinking about but they were looking for contributions for non-refereed or "lightly refereed" articles, which would not go on your CV among "reviewed journal articles". In this case, they have all they need and this special issue would come out sometimes soon. If you can find the invitation to which you reacted, you can find out what this issue is. However, in my experience, journals are very careful about not mixing refereed
and lightly refereed articles without very clear labeling.
Comment: Thank you for your answer! I did get the chance to go back to the posting after your advice. The guest editor primarily accepted abstracts and I received an invitation to submit the final paper through the journal's elsevier page. The posting and abstract acceptance letter stated that the abstract acceptance is not an acceptance of the article and that the article would follow the journal's procedures of review and publication. So, I am able to view that my manuscript is with the guest editor and I guess I just need a bit more patience! Thanks again!

Special Issue abstract acceptance


Is it illegal to state facts I got from othere sources and get paid for it?

Question: I'm making a video project based off the beta of a certain video game for You Tube. I got some history from a website and I want to get paid for my video with ads. Am I allowed to do this if I got my info from another site, even if I credit them?
Answer: It depends what exactly you are doing. First, check if you are under any legal restrictions. If you received a beta version of a video game, it is quite possible that there are restrictions what you can do with it. If you got the information indirectly, and your source wasn't allowed to publish what they published, then this is legally dubious. Legally dubious means you can get sued which might be expensive, no matter whether you are right or wrong, if what you are doing annoys the makers of the video game enough.
Using images from the video game may quite likely be copyright infringement. You would have an excuse if you do something like writing a review, or creating a parody. If you use copyrighted images to make money, you most likely have no excuse.
On the other hand, if you create something yourself that is inspired by that video game and doesn't actually copy anything, you should be fine. Important is always: You will get sued if you annoy people enough to sue you. (If you have tons of money, you can get sued because people want your money. A video game company will not sue you for that reason unless you are Bill Gates posting anonymously here)


is it recomended to install 3/8" travertine stone tile directly onto drywall for a kitchen back splash

Question: I am have a debate with a client and partner as to whether we need to install a hardy board over the existing drywall ( including with screws and adhesive ) before installing travertine for a kitchen back splash. the tile is a porous  finish 3/8"thick travertine tile  on 12'x12" sheets, the space to cover is about 18' x 30', the dry wall is pre-painted and about 15 to 20 years old
Comment: If the client feels more comfortable with the extra money being spent then don't debate it - do the work and nod that you will do it as they wish. It will not hurt anything but their wallet to do more work, they will feel better about it.
Answer: The kitchen splash hardly ever gets wet enough to do anything to the drywall behind it. Travertine, since it is very porous, should be sealed to keep cooking grease, food splatters etc, from staining or discoloring the tile. The sealer will help prevent water passing through as well.


How do I configure Dropbox to automatically delete the pictures from my phone that have already been uploaded via camera upload?

Question: I use the camera uploader to back up all my photos but i don't want them in my phone after they have been uploaded. I would like to configure Dropbox to automatically delete the pictures that have been uploaded.
Answer: It would be great if Dropbox could add auto-delete after upload.
They way that I get around this limitation and still use Dropbox is to:

Disable autoupload to Dropbox in preferences
Connect your iPhone and launch "Image Capture"
In the lower left corner of Image Capture choose "delete after import."
Choose your Dropbox Photo folder and after import your phone will be cleared of the images and Dropbox will have your photos.

If Drop Box needs more inspiration they could look at Eye-Fi to see how Endless memory is setup to do the same thing.
Comment: It really is insane that nobody has come up with a way to automatically delete photos from the iphone once they are backed up to icloud or dropbox. When my wife wants to take any pictures on her iPhone 4 we have to switch back and forth between dropbox and camera roll, manually comparing photos one-by-one until she has room to snap a few more. It is a constant job. - posting this as its own question and asking lifehacker.
Answer: This is not currently possible.


Does circular motion cause centripetal force OR does centripetal force cause circular motion?

Question:
Does circular motion cause centripetal force, or does centripetal force cause circular motion, or are they both occurring hand in hand together instantaneously?
One more question: If I project a body in such a way that an attractive force is being perpendicular to the velocity with which I projected the body, then would the body undergo circular motion?
Comment: Note that in working *exercises* the phrase "[object] moves on a circular path" implies the existence of a centripetal force which may be of use in solving the problem. If your instructor has been talking about causation in that order if may be he was explaining the problem solving methodology.
Answer: If no force acts on a body it moves in a straight line. To make the body deviate from a straight line you have to apply a force to it. Therefore applying the centripetal force to the body is what makes it move in a circle.
If you apply a constant force at right angles to the direction of motion then your object will indeed move in a circle.
Answer: Physics does not have a proper, rigorous concept of causation. There are the terms locality and causality, but they are technical terms with precise meanings that do not occur in Newtonian physics.
Nevertheless, Newton's law, $\vec F = m \ddot{\vec x}$ is often seen to embody causation in a certain sense: You are given, as external circumstance, the total force $\vec F$, and you solve the equation for $\vec x$, so the force was there "before" the motion, or "causes" it.
All you need to know to describe the world is that whenever there is circular motion, there is a centripetal force, and that whenever there is a centripetal force, there is circular motion. But that is a tautology, because "centripetal force" is the force defined as the force acting such that the body it acts on follows a curved/circular path!
For the second question, not every attractive force will produce circular motion, but the usual forces with square laws like gravity or electromagnetism will produce circular/elliptical motion (unless you crash into the central body), as will forces that are constant and perpendicular to the velocity.
Answer:
In a way centripetal force causes circular motion, centripetal force that accelerates a body to undergo circular motion. If you imagine a ball on a piece of string: when the ball is spun around the centripetal force will be tension, the tension of the string pulls the ball as it spins to cause it to move in a circle. Without the string, the ball will just go in a straight line; but without the motion of the ball, the tension of the string will still be there but the ball won't be moving in a circle which is why the statement that centripetal force causes circular motion is only partially true.
If you project a body in such a way it will only move in a circular motion if the force is of a certain magnitude and is coming from a stationary source. If your force is a rocket on the side of your ball, so the force moves with the ball, then you won't get circular motion. The magnitude of the force must be in accordance to this equation:
$$
F_c=mv^2/r
$$
Where Fc is the force, m is the mass of your ball, v is the tangential velocity of your ball and r is the radius of your circle (from the source of the force to the ball).
If these conditions are met, then you will get circular motion.

An example of this is an orbit, if you have your ball with mass and a planet of mass M then to get the ball into orbit using the force of gravity to act as the centripetal force you must find conditions in which the force of gravity is equal to the centripetal force. Gravitational force is given by:
$$
F_G=GMm/r^2
$$
Where FG is the force of gravity, G is the gravitational constant, M is the larger mass (the mass of our planet), m is the smaller mass (the mass of our ball) and r is the distance from the planet to the ball. Using this equation and the centripetal force equation, we can work out under what conditions the force of gravity is equal to the centripetal force and therefore where we can get a circular orbit.
$$
mv^2/r=GMm/r^2
$$
$$
mv^2=GMm/r
$$
$$
v^2=GM/r
$$
$$
v=\sqrt(GM/r)
$$
Answer:
The force causes the change in velocity, not the other way round. It's how we define it. If you found in nature something that is under circular motion without any known forces being applied to it, we would have to examine the problem and define a new force.
What can cause confusion is that sometimes, it is easier to solve problems using a circular motion inertial frame. In such a system, no forces mean circular motion, and the centriFUGAL force is trying to get the object out of the motion.

Yes. The quintessential example is an moving electron in a magnetic field, as it is subject to a force perpendicular to both its velocity and the direction of the magnetic field:


What if Bonferroni correction is too conservative for 3 correlations on same group of people?

Question: I use Pearson's correlation to calculate association between Test A and performance on 3 subtests of test B. If I use Bonferroni correction for multiple comparison then alpha is 0.05/3
. we found significant r for one subtest of test B (p=0.02). But this will be rejected as per Bonferroni correction. Is there another way to do multiple comparison correction that is not as conservative for my data?
These correlations are for the same group of people
1st correlation- Test A and Test B.1(r=-0.03, p=0.9, 95% CI= -0.45 to 0.4),
2nd correlation-Test A and Test B.2 (r=0.08, p=0.7, 95% CI= -0.35 to 0.49)
3rd correlation- Test A and Test B.3  (r=0.48, p=0.02, 95% CI= 0.08 to 0.74).
Answer: It seems that by "too conservative" what you mean is that it's not giving you the significance you want. Thinking of a method as too conservative "for your data" is incorrect. The conservativism of the method should be evaluated relative to the research question, not to the data. Waiting until the p-values have been computed and then choosing the multiple-testing method that gives you the answer you're looking for is not how good science is done. It might be better to be honest about the fact that you are in the early stages of researching the question and aren't prepared to draw conclusions from the data. You can follow up with a better-planned study.
Answer: A somewhat less conservative method for controlling family-wise error (probability of a false alarm/type 1 error) is to use a sequentially rejective method like Rom's Method. From the p values you've given, Rom's Method would declare the 3rd correlation significant, but the other 2 correlations would fail to reject. Chapter 13 of Rand Wilcox's Modern Statistics for the Social and Behavioral Science is a good source for these type of multiple comparisons procedures.
That said, trying out multiple-comparisons techniques one after another and going with the one that produces significant p-values is likely to produce false alarms/type 1 errors at a rate higher than the 5% that might be expected from your significance threshold. Here, the issue is less of a concern since there are only a few tests, but its still something to think about.


Where do I put my URL routes to prevent an IIS restart?

Question: I am writing this code in global.asax to save routes
RouteTable.Routes.Add("Profile", new Route("Profile/{ID}", new ProfileHandler("~/Member/Profile.aspx")));

and then writing this in the handler
 var display = BuildManager.CreateInstanceFromVirtualPath(_virtualPath, typeof(Page)) as Profile;
 //Setting Page Parameters
 display.MemberId = Convert.ToInt32(requestContext.RouteData.Values["ID"]);

But I don't like this code. First I am writing hard coded values, and second what if my website is online and I want to republish it? I'll have to stop IIS. Any other ideas to save them?
Answer: I've written a whole blog with my own implementation of editable routes. I should make this into a NuGet package. My blog post covers how to have editable routes without requiring an app domain restart.


What key does the chord progression E, D, C#, B, E, D, C#, G belong to?

Question: I noticed while playing guitar recently that the chords E, D, C#, B, and then E, D, C#, G sound good together although to my knowledge those chords can't be in the same key because of the E and the C#. What key is this in?
Comment: Does it loop back from the end to the start? (Or, if not, what happens after the G?) A problem I have in understanding it is that C# major is followed by G major. C# sounds like Db, and Db major followed by G major is a conventional bII V in c minor, but c minor is remote from all the other chords.
Answer: Why does it sound good? In this case, it just does. Perhaps we could construct an argument around the root movement, or around parallel motion between voices creating a pattern the ear can follow. Regardless, as you suspected, it's not in a key. Here's why.
If you lay out all the pitches involved, they constitute nearly the entire chromatic scale, excepting only C and A#/Bb.
Here are all of the chords.
X:0
K:none
M:none
L:1
"E"[E^GB] "D"[D^FA] "C#"[^C^E^G] "B"[B,^D^F] "G"[GBd]

And here are all of the individual pitches (E# = F), in ascending order.
X:0
K:none
M:none
L:1
B,^CD^DEF^FG^GA

So that eliminates there being only one (diatonic) scale involved. Nevertheless, the song as a whole, could still be in a key. To be "in a key" means two things:

There is a tonal center (i.e., the "key")
There is a primary mode (i.e., scale)

A piece in the key of X need not stay in that key the entire time. It's simply that the construction of the piece leads the ear in the overall direction of X.
In the case of your chord progression, one could make a reasonable case that it's centered around E (the pitch, not the chord), as each half is rooted in that pitch, and you could add an E chord at the end to round things out.
However, it can't be said that there's a primary mode. Essentially every chord changes the pitch center and associated scale, so the ear never creates mode-like ("functional") relationships between the chords. That lack of clear modal commonality between the various chords is what prevents interpreting the piece as being "in a key".
Comment: I disagree with the "it just sounds good" explanation. Anything that sounds good, sounds good for a reason. And imagining a tonic is not too far-fetched, or writing a key signature for it. :) It depends on the melody of course, but saying it's in E and writing a key signature of four sharps is completely reasonable IMO.
Answer: Note-wise, all the roots of all the chords come from E and its parallel key, E minor.
It's quite common to 'borrow' from parallel keys - pop music does it frequently.
It's not a given that every piece has to be in a key. There are many atonal pieces which obviously aren't. That's why they're atonal. However, the vast majority of pieces are in a key - or perhaps two or three keys - modulating between them.
So whilst it's unusual, it happens.
There's no 'rule' that all chords must be diatonic - in fact, in such music, there's often so much expectation from the listener, that it is predictable, with no nice surprises, which are what makes some music exciting.
So, if we were charged with putting a key signature on this tune, where do we go? As already said, the chords are from E - major and minor. It will depend more on what the melody consists of for evidence of a key, and that's denied at the moment. It could easily be a blues type number, which breaks the 'rules' anyway, often written in major, but using minor notes (and that ♭5), so, if pushed, I'd go for writing it in E - E major.
Answer: The home chord seems to be E major.
We could talk of 'borrowing'. D and G are not diatonic in E major.  They are in E minor.  OK, that grants us permission to use them.  (But we have 'permission' to use any chord, there's no 'must be diatonic' rule in music.  I guess finding a 'borrowing' connection tells us these 'outside' notes aren't TOO outside.)
Why did you choose to use THESE particular non-diatonic chords?   Maybe because so much of today's popular music derives from the Blues.  You've picked chords rooted on two of the most characteristic notes in the Blues, the ♭3 and ♭7.  That could be a lot of why you found those chords attractive.
The C♯ chord is a teaser.   That's a bit more 'outside' E major.  But a bass line that walks by step is a very strong musical element.  And a string of adjacent chords of the same shape (these are all major triads)  has unity.    Try C♯m instead.  That fits too, in a 'keep it diatonic' sort of way.
(See what's happening?  We're finding excuses for the G, D and C♯ chords to exist in a basically E major environment.  But there's no causation involved.  There's no place where one of those SHOULD be the next chord, where we'd be surprised if it wasn't.  Not like the expectation of a tonic E after a dominant B7.)
Right.  You've written something that sounds good.  We've established that E major will do as the overall key and given you a selection of justifications for the non-diatonic chords.  Put them in your bag of 'good musical things to do'.  I think that's all sorted?
Answer: To me it sounded like being "in E", but ultimately, it is whatever key you can make it be in. The first chord is always very important, because it makes the first impression and starts to establish things. The next chord will be compared to what happened before it. The order of things that happen and my immediate reactions to them are, along with scales that are easy to imagine being suitable in each situation:

E ... Ok, this is in E. Scale: E major.
D ... oh, it's E Mixolydian style, probably A is the next chord. Scale: E mixolydian (or A major).
C# ... a little surprise - it didn't go to A, but it's still in E or C#m (relative key), but secondary dominant going to maybe F#m next. Scale: F# melodic minor.
B ... another surprise, no F#m but it got back to E - this is V chord of E. Scale: E major.

then the next round:

E ... yeah, we got back to home chord
D ... ok, nice, I know this already
C# ... ok, nice, I know this already
G ... nice surprise! jazz trick, modal interchange, switching between E major and E minor. Scale: G major / E natural minor

All of this goes nicely to an "in E" category in my mind.
Why it's so good is, it has a good combination of familiar and surprising things, which makes it interesting. Staying strictly inside one single key and mode tends to be boring!
Here's a little 80s pop melody over riding over the chords:

The melody jump from the C# chord to the B chord is A - D#, which makes the B chord a B7 really, strongly suggesting that the next chord will be the assumed home chord E. Which it is.
In the end there's an extra surprise - it ends in B. :)
Answer: Short answer: E major.
To me this sounds like a rock progression borrowing from Coltrane. 'Trane's harmonies lean on chord substitutions based on minor third intervals. So for example, if you liberally substitute chords removed by a minor third, E D C# B, E D C# B is a jazz(ish) substitution for E B E B, E B E E. Simple as anything.
If you're interested in those minor third substitutions (and who wouldn't be; they can really spice up an otherwise insipid, tired rock trope), dive way into Giant Steps. It's a seemingly incoherent progression until you grok Coltrane's minor third substitutions. With that concept, they're absolutely sensible.
I have lost track of it but somewhere there's a book named something like Minor Thirds: the Harmonies of John Coltrane. I heard of it in a jazz seminar at Stanford around 1990. If anybody can find a link to that, please let me know!
Answer: This looks a lot like a 2516 in D - like, what you would find in "Autumn Leaves."
Comment: Nothing like it, in reality.
Answer: It's a modulation. It changes scales.
It's not E major because it has D and G
Neither E minor because it has G# from the first chord (E)
Comment: We don't even know what notes are involved in the melody.
Comment: Chromatic chords don't necessarily mean a modulation.
Comment: These letters are chords. They have 3 notes.


Non-abelian magnetic field interaction

Question: Consider the magnetic part of a non-Abelian field. I want to know if we can define Hamiltonian for the interaction of this sector with the spin (something such as Hamiltonian of interaction of magnetic moment and electromagnetic field.)
Comment: You asked about magnetic part of **non-abelian** interaction like strong interactions. Color charge interactions can be decomposed into chromoelectric and chromomagnetic fields like explained in https://physics.stackexchange.com/questions/426507/what-are-chromoelectric-and-chromomagnetic-fields. You later ask about Hamiltonian interaction of magnetic moment and electromagnetic field which is **abelian**. Please charify this confusion.
Comment: @OrdinarySuperhero I mean if the spin can interact with the non-Abelian magnetic field? For example if we can define Hamiltonian for the interaction of the electron spin with the chromomagnetic field?
Answer: As Lorentz invariance is inherently followed in a quantum field theory, we ususally encounter quantities that are 4-vectors. But in some cases like NRQCD, it is more convenient to resolve the Yang-Mills field strength tensor into terms like what we have in classical EM field theory.
When we integrated out the hard scale of mass, $m$ from the full QCD lagrangian, we get the effective field theory of NRQCD.
The heavy quark part of the NRQCD lagrangian is given as:
\begin{equation}
L_\psi = \psi^\dagger \Biggl\{ iD^0 + c_k^{(1)} \frac{{\textbf D}^2}{2m_1} + c_4^{(1)} \frac{{\textbf D}^4}{8m_1^3} + c_F^{(1)} g \frac{\sigma \cdot {\textbf B}}{2m_1}
 \end{equation}
\begin{equation}
+ c_D^{(1)}  g\frac{{\textbf D} \cdot {\textbf E}- {\textbf E} \cdot {\textbf D}}{8m_1^2}
+ ic_S^{(1)}g\frac{\sigma \cdot({\textbf D} \times {\textbf E}- {\textbf E} \times {\textbf D})}{8m_1^2} \Biggl\} \psi
  \end{equation}
\begin{equation}
+ (\mathrm{terms \; for \; heavy \;light \; quark \; local \; interaction})
  \end{equation}
where,
$\quad$ $\sigma$ are the Pauli matrices,
$\quad$ $\textbf{D}=\nabla-ig\mathbf{A}$,
$\quad$ $\textbf{E}^i=F^{i0}$ is the chromoelectric field
$\quad$ $\textbf{B}^i=-\varepsilon_{ijk} F^{jk}/2$ is the chromomagnetic field.
$\quad$ $F^{jk}$ is the spacial part of the full QCD field strength tensor, $F^{\mu\nu}$.
$\quad$ $c$ terms are the Wilson coefficents of the EFT.
The bracket term is the free field part plus the coupling to soft gluons. In this EFT heavy quark-antiquark pairs cannot be created anymore, so it is convenient to use non-relativistic Pauli spinors ($\psi$) instead of Dirac spinors for the heavy quark spin states.
The term with $\sigma \cdot {\textbf B}$ is remenicent of quark spin interaction with chromomagnetic field.
So, it is possible to invoke chromoelectric and chromomagnetic field description for non-abelian gauge theory, but it is suitable only for some non-relativistic systems.
Reference:
page 26, Effective Field Theories of QCD for Heavy Quarkonia at Finite Temperature, Jacopo Ghiglieri,arXiv:1201.2920 [hep-ph]

Non-abelian magnetic field interaction


Canada: Entry by vehicle

Question: I renewed my enhanced driver's license. However, it has not arrived yet, and I'm supposed to drive to Canada tomorrow. If I have my old enhanced license with a temporary one attached to it, plus a birth certificate, will I be able to get in and out of Canada?
Comment: What is your nationality, citizenship, residency?
Comment: Yes, but it might take a little longer than usual to cross the border.
Comment: Does the temporary license have your picture on it?
Comment: I am a U.S citizen. My temporary license does have my picture on it.
Comment: In addition to Dennis' response, having ID isn't the only thing that will allow you into Canada. http://cbsa-asfc.gc.ca/travel-voyage/ivc-rnc-eng.html#a3 Ensure you meet requirements such as restricted goods, drugs, convictions, etc
Comment: If you travel to Canada frequently, consider getting a NEXUS card.
Answer: You are probably good to go, though you might be harassed a bit more than usual.
For the trip into Canada across the land border what is required of a US citizen is proof of citizenship and a photo ID identifying you as that citizen. Your birth certificate and the (expired) enhanced driver's license provide evidence of your citizenship, while the temporary license and (expired) enhanced driver's license associate your face with your name. If you happen to have any other photo ID you could carry that too for extra insurance, but what you have should be sufficient.
The trip back to the US may be more of a problem since you are required by regulation to have a WHTI document to reenter the US by land, which your enhanced driver's license is except it is expired (or was cancelled?). The saving grace is that they cannot deny entry to a bona fide US citizen and there is no particular penalty for not having a valid WHTI document, so if the primary inspection is unwilling to accept the expired EDL and the temporary DL (showing that the renewal is in the mail) as meeting the requirement the worst that can happen is that they'll send you inside to secondary to "investigate" your citizenship. This may take some time and they may give you crap for traveling like that, but ultimately they'll let you go home.
This isn't perfect but if you need to travel you should be okay in both directions.
Comment: You may want to (and should) get a passport - this is the best ID for entering foreign countries, and for returning home.  That way, if your enhanced driver's license is being renewed, you also have a secondary option.  If you're a US citizen, the US also has passport cards, which can only be used for land crossings between Mexico, the US, and Canada.

Canada: Entry by vehicle


Porter: five forces and value chain combination

Question: Is it possible and useful to combine Porter's five forces model with his value chain model? Or is it not useful to combine these two?  I want to have a basis to analyze a fictional Mergers & Acquisitions case (will/could it be successful). Until now, I find it difficult to get these two models into one useful construct.
Answer: The two approaches typically target different areas. The five forces model appears to be best suited to understanding an entire industry, while the value chain is primarily a tool for understanding and analyzing the activities of a business that works within that industry, although it can be applied generically at the industry level. That said, an understanding of the five forces model should prove very valuable to ensuring that the value chain is not omitting anything obvious.
The Wikipedia article on the five forces model suggests that it should be used as a checklist and entry point, with the value chain approach following. From Wikipedia:

Strategy consultants occasionally use Porter's five forces framework when making a qualitative evaluation of a firm's strategic position. However, for most consultants, the framework is only a starting point or "checklist" they might use " Value Chain " afterward. Like all general frameworks, an analysis that uses it to the exclusion of specifics about a particular situation is considered naїve.

In your M&A case, I'd imagine it would be best to explore both models for both companies and see where they complement each other effectively.
Answer: I suppose you can...

From a Value Based Management point of
  view, the Five Forces model
  (Market/Industry Attractiveness) of
  Porter can be seen as one of two
  dimensions in maximizing corporate
  value creation. The other value
  creation dimension is how well a
  company performs relatively towards
  its competitors (Relative Competitive
  Position), for which two other
  Porter-models are frequently used: the
  Value Chain framework and Porter's
  Competitive Advantage

more info can be found here


No effort to learn and improve over time under a A Day in the Penalty Box

Question: Under  "A Day in the Penalty Box", there is a condition for "No effort to learn and improve over time" which specifies "The user never gives anything back to the community, but only takes". If for example, the user is a member of Cross-Validated and Stackoverflow, and the user posts the questions on both SO and CV, but answers the others questions only on SO, is this condition still applicable? OR, Is it applicable when the user doesn't answer any question on both the forms but simply posts the questions. Also, when we are referring over time, are we saying time greater than one year or is there any rule of thumb to indicate that?
Comment: I don't think we actually suspend anyone for exclusively asking questions without ever providing answers.
Comment: Note that asking *good* questions is giving back to the community just as giving good answers are.
Comment: just as a personal opinion, I would see asking good questions as "giving back"
Comment: @BoltClock'saUnicorn there's the question ban that people often get into.
Comment: Thank you for all for your opinion.
Answer: Although you're reading it in the right order, your interpretation of this suspension reason is backwards.
Notice that the primary reasons are either:

No effort to learn and improve over time, or
Disruptive behavior

All of the other items listed are simply examples of characteristic behaviors by users that fall into one of these two general patterns of problematic behavior.
One of the ways we know that you're making no effort to learn and improve over time is because you never try to give anything back to the community. It's also worth pointing out that we mean "learn and improve over time" in the context of the particular Stack Exchange community. It isn't the moderators' problem if you never learn anything about programming or improve as a programmer.
We are willing to cut you some slack on rule violations if you show that you are willing to comply with our guidelines and making attempts to improve over time. One of the ways to do that is to give back to the community, effectively "making up" for your early mistakes.
A day in the penalty box is designed to deal with serious problems. So no, we're not going to ban people who just ask questions without posting answers. Good questions are as vital to the health and function of a Q&A site as are good answers. You wouldn't have any good answers if you didn't have questions.
Beyond that, it's worth noting that really big, active sites like Stack Overflow have quality filters enabled that step in and automatically block users who repeatedly post low quality questions or answers from continuing to do so. So it's rare that moderators have to intervene manually for content issues.
Comment: @ Cody: Thank you for the nice explanation.
Answer: I wouldn't look at a user's activity on other sites before placing them in the penalty box for "No effort to learn and improve over time."  Just because someone is a contributor on one site doesn't mean we can let them be a help vampire on another.

Also, when we are referring over time, are we saying time greater than one year or is there any rule of thumb to indicate that?

On Stack Overflow there are automatic bans for low-quality questions or answers.  If we'd let people violate the first three bullet points under "No effort to learn and improve over time" for a year, odds are they were already banned.

This user does not put reasonable effort into the questions they ask of the community.

There is little or no evidence of this user learning over time, either in the topic itself or in the community norms on the site.

This user intentionally spams the site with the same question or very similar questions, over and over.

If we can see a pattern of this kind of behavior emerging, it's better to just send a warning to the user and/or temporarily place them in the penalty box before it gets them into an auto-ban.
Comment: @ Bill: Thank you for the opinion.
Answer: This is just my take on it...

There is little or no evidence of this user learning over time, either
  in the topic itself or in the community norms on the site.

Refers to users who, even after many corrections, continue to post in an inappropriate manner. I'm thinking that moderators will tend to be more lenient with new users who simply "don't get it yet" and less so with repeat offenders.
<code>The user never gives anything back to the community, but only takes.
</code>
Is a little more subjective but, I think it refers to users who only post to meet their own needs. Their questions are overly simple, often duplicates, and are unlikely to be of any value to future visitors to the site.
Comment: @ apaul34208: : Yes, that is too subjective and hence my question here.


Is it possible to upgrade, without rooting, to a version not specifically released for the device?

Question: I have inherited an Android mobile and would like to upgrade it to the latest version of Android. Having come across posts such as is it possible to upgrade the android OS on all phones?, it appears I won't be able to. However, I am unsure what the definition of carrier is especially if the phone has been imported from overseas. Is there a way I could upgrade without jailbreaking the mobile phone? My question is applicable to all mobile phones running Android.
Comment: Normally some kind of branding should be apparent, whether physically on the phone, in the apps or themes on the device, or in the Settings (e.g., About Phone).  It's unlikely to come from the manufacturer directly if it's a phone, at least in North America.  No hard and fast rule, really.  You could probably search for your build number (in About) online to see if it comes up with more info.
Comment: Note that the terminology is generally "rooting" rather than "jailbreaking" for Android devices.  The carrier that's relevant will be the original network operator that released the software running on the device; the actual network you use the device on (if any) is irrelevant :)
Comment: @Matthew Read - Thanks Matthew. Wasn't aware the term `rooting` is used. Will bear that in mind. Also how do I know it came from a network operator and not directly from the manufacturer?
Comment: @Matthew Read - Thanks Matthew. I had a look at the apps and themes as well as settings and there is no mention of a carrier of any sort. The phone seems to have come from Taiwan directly. It is a HTC.
Answer: Most phones can't upgrade (officially) without a signed firmware package designed to upgrade from the existing version of Android that's already on the phone.  In those cases, you can't upgrade without rooting and/or unlocking your bootloader and/or flashing a custom recovery, which all void your warranty.
Some phones may not be as limited; for example, the original software on the original Galaxy S devices allowed unsigned updates to be flashed without needing to unlock the device.  Theoretically you could try to flash a firmware package from a different region; it's hard to say how that would affect your warranty (and besides, that's really off-topic here :P).  You could also of course flash a custom ROM with a newer version of Android, which again will void your warranty just like rooting.
Comment: Thanks. Are there security disadvantages of not upgrading?
Comment: @PeanutsMonkey Probably.  It's certainly been the case that security issues have been fixed in newer versions of Android, and 4.0 has filesystem encryption whereas 2.3 did not, and so on.
Comment: Makes no sense at all to me why upgrades would be restricted to devices and why I have to root a device to get updates.


Can I apply for a spouse visa for my husband when I am his second wife?

Question: I am a citizen of Pakistan and currently hold an Australian Student Visa subclass 500. I want to apply for a spouse or sponsorship visa for my husband.
We both applied for a student visa but unfortunately his visa application was refused. Before leaving Pakistan I registered our marriage in Pakistan.
I am the second wife of my husband and in Pakistan it is legal to have more than one wife for a man.
I need your kind assistance regarding visa application, and let me know if I can apply or sponsor a Spouse visa for my husband?
Comment: This has been asked and answered already: https://travel.stackexchange.com/questions/105669/can-having-a-second-wife-affect-my-australian-visa-processing-stay
Comment: That's not a duplicate. That is someone asking if having two wives will invalidate a visa they would otherwise be eligible for. This is about whether someone with a valid student visa can bring their multiply-married husband with them.
Answer: Your marriage will not be recognized in Australia.
This page on the recognition of foreign marriages in Australia  says:

An overseas marriage is generally recognised in Australia if it

was a valid marriage in the overseas country, and

would have been a valid marriage here

Your marriage would not be valid in Australia because your husband was already married.
It's not out of the question that there is a loophole  I am unaware of. You should consult a lawyer if you want to try to find one.


Does overfitting show that the model has reached its best performance?

Question: Let's say you design a CNN model and it starts overfitting at e.g 70% accuracy during training. Does that mean that 70% is the best accuracy that I can get out of that model design even if I add regularization? Or in other words, can regularization improve the performance of a model?
Comment: Are you talking about validation or training performance? Are you really referring to accuracy or at loss?
Comment: Welcome to CV.  There are methods that look for an inflection point in validation error as an indication of parameters for a final model.  If error on validation, which it has never seen, go up, then it is starting to overfit.  This is an older method, but it works.  Personally, after the parameters have been dialed in, I like to use all the training and validation data to make the final model, and then run it against the test (second holdout) to see what plausible performance looks like.
Comment: during the training after a few epochs, I see that the training accuracy is much higher than the validation accuracy, i.e overfitting my model to the training data. My model is a cnn without any regularization (dropout or any other). My question is if I add dropout, will I be able to achieve more accuracy (than 70% here), or this is the best that I can get out of this model?, and in order to get a better performance, I will have to change the model architecture for example?!?
Comment: Validation accuracy around 70%, training accuracy around 80%.
Comment: no, there is phenomenon known as double descent where model have to first overfit and after overfitting the performance gets better
Answer: There is no way to tell without knowing more about your situation. Yes, you may have hit a plateau.

Or there may be hidden structure in your data that will only become apparent with (much) more data.
Or some of your predictors may need to be predicted themselves, and you may be able to do a better job at that.
Or you may not have included a hugely relevant predictor that can increase your validation accuracy to 90%, simply because you don't have the domain knowledge.

In general, it is very hard to say whether we have reached the end of the flagpole. See How to know that your machine learning problem is hopeless?
Answer: Actually your last question, does regularization improve model performance, is a bit off. regularization is a way to reduce overfitting, not to check if you hit a plateau yet.
As overfitting means your model try to fit even to noise in training data and not the real underlying pattern, the model will likely to perform bad on test data. That's why regularization helps to improve performance, as it is adding a term to penalise models which are sensitive to noise.


Was Jonathan Archer really going to be called "Jeffrey Archer"?

Question: I've seen in quite a few places a claim that when Star Trek Enterprise was being written, the character of Captain Archer was going to have the first name Jeffrey, and it was only because a British person on the team said, "You can't call him that!" that it was changed. (For the benefit of non-UK readers, Jeffrey Archer is the name of a British peer who is a prolific author and crook.) Is this true, or is it an urban myth?
Comment: According to the Guardian newspaper, yes; https://www.theguardian.com/media/2001/jul/23/pressandpublishing.broadcasting
Comment: Wouldn't be the first time something like this had happened. Al Pacino's character in *Heat* was called Vincent Hanna, a name well known in the UK at the time as that of a respected political journalist.
Answer: This one seems to have the slight ring of truth about it. The character of the captain of the Enterprise was originally going to be "Jackson Archer" but was likely changed because the name was not sufficiently either widespread or unique

An early casting call sheet acquired by TV Guide reveals that the
fifth series in the Star Trek franchise will be a prequel about the
infancy of the Federation that predates the time of Kirk and Spock by
100 years
Trek's usual emphasis on ethnic and intergalactic diversity will be
evident in the other characters, including Capt. Jackson Archer, a
bold rule buster with a grudge against the Vulcans; Lt. Joe
Mayweather, an African-American helmsman with more experience than his
captain; Ensign Hoshi Sato, who can imitate alien sounds; Dr. Phlox,
an exotic alien who specializes in New Age medicine; and Chief
Engineer Charlie "Spike" Tucker, a Southern good old boy. Now that's
the real McCoy.
TrekToday - Brannon Braga Registers 'Enterprise' Domain

The article points out that these may simply be net rumours, but in hindsight, given the accuracy of the article, it's much more likely that they had the real casting sheet.

Some two months later, it was stated that the name had been changed from Jackson to Jeffrey, a common enough name in the US, but one that would come up immediately on a websearch for the UK politician. It's not especially surprising that they changed it again.

Industry trade magazine Broadcasting & Cable, which originally
revealed the Enterprise name, reported that Bakula has been "cast as
[the] Enterprise skipper," and said the actor was in final negotations
with Paramount. The paper's sources said that executives at UPN have
been wanting to announce the new series for months now, and that the
actual announcement could be expected by the end of this week.
This was confirmed by television executive subscription service TV
Tracker, which updated its listing for Enterprise Tuesday. The site
said that Paramount was still in negotiations with Bakula for the
role, which it was now referring to as Jeffrey Archer. The original
casting sheet referred to the character as Jackson Archer, but it is
of course possible that he underwent a slight name change.
TrekToday: Scott Bakula: Is He In Or Out?
Comment: That casting sheet is awesome! I'd watch that Enterprise.
Comment: I think they should have made a sterling effort to be bolder with their casting.
Comment: Hoshi's bio is kind of weird though. The Hoshi we ended up with was fine.


Bitcoin transaction not confirmed since 3 days ago

Question: Hello I might sound stupid but it's been three days since I issued bitcoin transactions, all unconfirmed so far. I use Blockchain.com to manage my wallet and have done everything normally (I think, as I usually do).
How long does it take for the blockchain to cancel unconfirmed transactions?
I am discredited in the face of my buyer and this situation may create problems for me in the days to come, I will leave the TXs of the transactions if u good will could help me that would make me very happy.
Here are the TXs:
e122bccd8ccbfe19f0263afb33b5458fa951d4c6ea71743e1bad9baabdbf3904
b51723ef74039503d966f2c90b05cf71774bbc12968ef60276996141ef561293
Answer: You set the fee rate to 6 sat/vbyte. That's very low, median fee in recent blocks has been 30-70 sat/vbyte. See mempool.space.
You could wait until the weekend when the mining difficulty is expected to drop by more than 25%. This will decrease fees as more blocks can be mined per hour. The difficulty drop happens around 1AM UTC on Saturday.
Alternatively, you could bump the fees. You have RBF disabled, but you could do CPFP (child-pays-for-parent). How you do this depends on your wallet. But it would basically spend the UTXO from your second TX (b5172...) again, but this time with a much higher sat/vbyte. Miners could then decide to include your 3 transactions in their blocks.
Given that you already created a descendant transaction, your new fee has to pay for a total of 3 transactions. So I would set it higher than the median fee rate from mempool.space.


State of the Art for Clojure Documentation Tools

Question: Over the last year or so I've seen various announcements on the Clojure discussion list and other places about tools for documenting Clojure code. These range from full-on literate programming systems like Marginalia, and the tool being used to create the book "Clojure in Small Pieces" (or even emacs org-mode), to more conventional Javadoc-style solutions like Autodoc, and Javadoc itself which reportedly can be used with Clojure.  A google search turns up various others, perhaps a few that deserve more attention, and for sure some that are just personal utilities for generating docs. My question is what are the best documentation tools, and what are their comparative strengths and weaknesses based on your experiences using them?  I have not used any documentation tools to date, and am interested in experimenting with one or more.
Comment: Just as a point of note, Marginalia is not a full-on literate programming tool.  It does in many ways facilitate a literate style, but it does not in any way understand how to deal with out-of-order code commentary like the system used on "Clojure in Small Pieces". org-babel-clojure, or Knuth's CWEB.  It's just a nice tool to facilitate code reading.
Comment: It sounds like both Autodoc and Marginalia are doc-string driven, and both have good integration with Leiningen, but the main difference is that Marginalia generates richer output, whereas Autodoc is more basic. Thanks!
Answer: I really like Marginalia if you want to take something like a literate programming approach.  Marginalia traverses your source code, and produces an html formatted version with comments set beside code in a very clear text.  Comments can be markdown formatted, making for a very readable final document.  When reviewing source code that I've written some time ago, I find Marginalia really helps. Here's an example made from the Marginalia source itself.
Note that this differs from the original literate programming workflow, where you would write a file and source code is generated from that.  With Marginalia, you write a regular source code file, and it's the documentation that's pulled out of that.  The output is similar to what one might expect from literate programming, but this way you can still expect syntax highlighting in an editor, without any special literate programming support.
It interoperates with Leiningen, and I believe cake, though I haven't tried that myself.
Comment: I like marginalia too. One problem is that it doesn't make a very good indexed reference. Then again, that's not really it's purpose.
Comment: @Andrew some sort of indexing is in the plans.  :-)
Comment: @fogus - oh neat! that'll be extremely usful.
Comment: The marginalia example has moved.
Answer: Codox is a more recent documentation generator for Clojure.
Comment: I'll vouch for this as a good alternative. Marginalia is impressive for presenting the code alongside the docs but has a bit too much 'personality', which I find distracting. Codox supposedly also has support for parsing inline html and possibly markdown, but ironically, the documentation is too sparse for me to figure it out (and not even codox output!)
Answer: Autodoc is an easy place to start and is what Clojure core and Clojure contrib produce.
Easy to use with Maven.  I'm not sure if plugins exist for Leiningen or Cake.
Comment: Looking at the link provided for [Autodoc](http://tomfaulhaber.github.com/autodoc/), there's a section on the lein plugin for autodoc: [Building Autodoc with Leiningen](http://tomfaulhaber.github.com/autodoc/#building_with_leiningen)
Comment: My project doesn't use a `clojure.main` main class and autodoc bails out because of this: `Error: Could not find or load main class clojure.main`. I haven't been able to find a way of specifying my own main class in a Maven POM.
Answer: If you want to go fully literate you should give org-babel-clojure a look. org-bable is a literate programming extension to the emacs org-mode.
If you want to use nrepl the following should be added to your .emacs:
<code>(defun org-babel-execute:clojure (body params)
  "Execute a block of Clojure code with Babel."
  (let ((result-plist (nrepl-send-string-sync (org-babel-expand-body:clojure body params) nrepl-buffer-ns))
        (result-type  (cdr (assoc :result-type params))))
    (org-babel-script-escape
     (cond ((eq result-type 'value)  (plist-get result-plist :value))
           ((eq result-type 'output) (plist-get result-plist :value))
            (t                        (message "Unknown :results type!"))))))
</code>
Comment: org-babel-clojure works great nrepl. I have edited my reply above to reflect my current usage.
Comment: Now that swank-clojure has been deprecated in favor of nrepl, is there an update or alternative to org-babel-clojure?  I'm investigating noweb for LP, but it would be great to have a repl during writing / development.


alternative for localStorage and sessionStorage in IE10

Question: I know localStorage and sessionStorage is not permitted in IE10 for local files (i.e) file:/// protocol. but what is the alternative to store datas locally and retrieve them for local files? is there any other ways or plugins available?
Answer: This question has several fallback solutions listed. However, it's a few years old, so whether or not this will work with IE10... hm.
Aside from something like this or some sort of hackish behavior, it looks like your best bet is to just install a local stack. Somethings like XAMPP is really easy to get going for development purposes.


When using Swift Mailer, how can I get control over the line breaks in the text/plain version of the message?

Question: I'm using Swift Mailer (version 4.1.7, which shouldn't matter for this topic), and I have a very basic question.
A "modern" email message typically repeats the content twice -- once in HTML, which most people read in their fancy browser-based mail reading apps, and once in plain text for those people using old or simple readers.  In Swift, it's easy to create both versions as follows:
$message->setBody($plaintextMessage, 'text/plain');
$message->addPart($htmlMessage, 'text/html');

The problem I'm having is that my plain text message ($plaintextMessage above) is being broken into lines while ignoring the newlines already present in $plaintextMessage.  This is appropriate if there are no newlines in the message.  Example, if I feed it this:
$plaintextMessage = 'This is a long-ish line, which we expect to be broken after about 72 characters.  It is a good behavior, appropriate in most instances.';

then I get this:
This is a long-ish line, which we expect to be broken after about 72 cha=
racters.  It is a good behavior, appropriate in most instances.

This is fine, expected, and so on.  However, if I do something like this:
$plaintextMessage = implode("\n", array('This is a series',
                                        'of short lines',
                                        'which should not be broken.',
                                        'They include their own',
                                        'newlines, which should be respected',
                                        'and preserved'));

then there are already perfectly fine newlines in the message.  Unfortunately, Swift seems to ignore them and outputs this:
This is a series
of short lines
which should not be broke=
n.
They include their own
newlines, which should be respecte=
d
and preserved

Of course, I realize that a modern mailer will remove the extra line breaks and equals signs, but the whole point of having a plain-text version of the message is that people using older mailers that don't understand this syntax should still be able to read the message without too much ugliness.
Is this a setting in Swift?  So far, the only thing I've thought to do is set the line length to a really high character count (longer than my message) as a workaround, thus preventing Swift from doing any kind of line breaks.  It seems to me, however, that Swift should be resetting its character count to zero every time it finds a line break already in the message.  Is it possible to induce this behavior?
Comment: why not removing all new lines then use your own function?
Answer: It is not respecting the existing hard wraps in the text when calculating line length for soft-wrapping. That was changed with a pull request on Swiftmailer 5.x last year.