Difference between V7 and Vmaj7 chords?

Question: Im looking at this modal chord chart, and not really sure of the notation. What is s the difference between the 5 chord in the Ionian mode (V7) and the 5 chord of the Lydian (VM7)?
Comment: Comment not an answer - just to point out that for the Ionian chords they can be generated from a normal major scale -  you get them by playing 4 notes from a normal major scale where you play a note and miss a note - e.g in C ... IM7 = CEGB - then IIM-7 = DFAC etc. each time you play one note then skip the next note and play a total of 4 notes. If you start on the root (e.g. C) you get the I chord, start on the next note of the scale (e.g.D ) and you get the II chord etc.
Comment: As you can see from the answers below a major 7th chord on V can be written either as Vmaj7 or VM7. I would include that you could also write V♯7.
Answer: That chart seems to be using a jazz chord convention mixed with Roman numerals for roots on scale degrees.
In that system:

plain 7 means dominant seventh chord where the triad is major and the seventh is understood to be a minor seventh.
-7 or m7 means minor seventh chord where the triad is minor and the seventh is minor.
M7 means major seventh chord where the triad is major and the seventh is major.

It's not clear just from that chart, but the convention is M in M7 is major in reference to the seventh.
It's not part of the diatonic seventh chords of the chart but something like CminM7 is a common symbol. That's a minor major seventh chord. Parenthesis Cmin(M7) can make it clearer the M is for the seventh.
When you see - or lowercase m it a modification for the triad. C- or Cm meaning C minor triad.
Finally, getting back around to V7 we see there are none of the modifiers -, m, or M, but we understand the seventh is minor in a dominant seventh chord. There we can see that plain 7 in jazz chord symbols is a minor seventh above the root by default.
FWIW dim7 is used for fully diminished seventh chords, and m7(b5), -7b5, etc.  is the jazz chord way to say half diminished seventh chord.
Comment: Your penultimate sentence is correct (of course!) but could be misconstrued as *minor seventh chord*. I'm certain it's *minor seventh as an interval within the chord*, but it's ambiguous - to some, I guess!
Comment: @Tim, I made a little edit to line I think you meant...
Answer: To understand the determining factors that constitute what is a V7 chord and what is a VM7 chord, we need to look at the step patterns, half step and whole step, of each individual mode. Because the step patterns are different for each different mode, the major and minor intervals are rearranged within each mode. Looking at the Ionian mode we see the interval between the root or tonic of the mode, and the seventh is a minor interval and is abbreviated as V7. Next we look at the Lydian mode and discover that the interval between the root and the seventh has an extra half step space between the root and the seventh causing it to be a major interval and it is therefore abbreviated as a VM7. The main thing to understand is the V7 has a minor seventh interval and the VM7 has a major seventh interval.
Answer: Let's look at modes from a parent key perspective. You ask about Ionian V and Lydian V. In C Ionian, (taking its notes from key C major) the V consists of G B D F. C Lydian V (taking its notes from parent key G) is G B D F♯. Difference between both is the F note.
In the first, the chord is named G7, a dominant chord in that key. The base triad is a simple major one, but the 7th note itself forms the interval of m7. This is probably the most common of all the 'sevenths', and its name gets shortened to mere '7th'.
Because of the raised note in Lydian, compared with Ionian, C Lydian V has an interval of M7 instead, (G>F♯) making the chord called 'major 7th or M7' - with the same base triad underneath.
Answer: Naming some of the chords like "bIII" in the Dorian mode seems pointlessly confusing.
The third degree is the Dorian mode IS "flat", compared with a major scale (or the Ionian if you like fancy terminology.) It doesn't need to be made more flat!
Similarly for "#IV" in the Lydian mode, etc.
The whole "modal chord" concept in Jazz is an incoherent mess, IMHO.
Answer: If your trained by moveable do you will understand this explanation:
Ionian: I=do and V=so
Lydian: I=fa and V=do
V7 Ionian  = so,ti,re,fa (so-fa = minor 7) in the system of classical harmony this is a Dominant 7, with tension to resolve to do,mi,so.
V7 Lydian = do,mi,so,ti (do-ti = major 7) identical with the  tonic Major 7 of the Ionian 7 and is rather a stable chord in the classical jazz harmony.
It is important to know that minor and major referring intervals will mean that they are large (major) or small (minor).
(A major 3rd, 6th or 7th is a semitone "larger" than a minor ... so don't confuse here the terms with the modes or keys.
https://en.wikipedia.org/wiki/Major_and_minor

Difference between V7 and Vmaj7 chords?


View is not loading after dismissViewControllerAnimated

Question: I have a webView in my firstViewController.
I'm letting the user change some arguments in the url in another viewController(secondViewController).
I'm presenting this second view controller to let the user do this.
When he is done (he is clicking the 'done' button and calling dismissViewControllerAnimated),
I would like to get the url-changes and load it to the view controllers webView. But the webView seems to not be loaded.... thats the problem.
Here's an example.
firstViewController.h:
<code>.......
#import "SecondViewController.h"
.....
@property (strong, nonatomic) IBOutlet UIWebView *webView;
.....
</code>
firstViewController.m:
<code>@synthesize webView;

SecondViewController *csvc = [self.storyboard instantiateViewControllerWithIdentifier:@"second"];
csvc.OLDurlInWebView = webView.request.URL.absoluteString;
csvc.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
[self presentViewController:csvc animated:YES completion:nil];
......
......
......
//I'm calling this method after dismissViewControllerAnimated from secondViewControllerClass
-(void)showInView:(NSString *)str {
    [self view];
    [self loadView];
    [self view];
    [self openURL:[NSURL URLWithString:str]];
    UIActionSheet *sheet = [[UIActionSheet alloc]initWithTitle:@"TEST" delegate:nil cancelButtonTitle:@"TEST" destructiveButtonTitle:nil otherButtonTitles:@"TEST", nil];
    NSLog(@"current:%@ isLoaded:%d",webView.request.URL.absoluteString,self.isViewLoaded); //output 'current:(null) isLoaded:1'
    [sheet showInView:self.view];//this sheet test will not show, the app will crash:'Sheet can not be presented because the view is not in a window:.......'
}
-(void)openURL:(NSURL *)url {
    NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:url];

    NSLog(@"Trying to open %@ in webbrowser", url);

    [webView loadRequest:request];

}
</code>
secondViewController.h:
<code>.......
#import "FirstController.h"
.......
@interface SecondViewController : UIViewController {
NSString *OLDurlInWebView;
.......
}
.......
@property (strong, nonatomic) NSString *OLDurlInWebView;
- (IBAction)doneButton:(id)sender;
.......
</code>
secondViewController.m:
<code>@synthesize OLDurlInWebView;

......
- (IBAction)doneButton:(id)sender {
    [self dismissViewControllerAnimated:NO/*YES*/ completion:nil]; //completion???
}
-(void)viewDidDisappear:(BOOL)animated {
    NSLog(@"SecondViewC didDisappear");
    WebViewController *wb = [self.storyboard instantiateViewControllerWithIdentifier:@"web"];

    NSString *newurl = @"http://facebook.com"; //let the user load facebook as example
    [wb view];
    [wb loadView]; //testing everything, nothing works
    [wb view];

    [wb performSelector:@selector(showInView:) withObject:newurl afterDelay:5];//the webView will not load after 5 seconds. Why?
}
</code>
Ok, from the beginning:
In firstViewController:
I'm presenting the secondviewcontroller.
Now we are in secondViewController:
The user will now change the url, but in this example, he will change the url to facebook.com.
Now we are going to send back this new url (facebook.com) to the firstViewController. The user
clicks the doneButton and dismissViewControllerAnimated will be called.
In attempt to get back to the firstViewController with this new url(facebook).
I have tested everything I know, which is not enough. I have tested to call a normal function in firstViewController from secondViewController. The webView will not be able to load requests.
Then i tested to put the code in viewDidDisappear and giving the view 5 seconds to load, but it doesn't work.
I had this problem a time ago when the my app handles a URL Scheme Link in app delegate.
- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url
for example if you wan't to load another webView/label with a url or text from the URL scheme link?
how to do this from app delegate? this is the same problem as above.
What am I doing wrong/what do I dont know?
How to 'wait' for the view to load and then be able to load for example a webView with a url.?
Answer: Dismiss has to be called on the first VC. You can do it from the second like so:
<code>[self.presentingViewController dismissViewControllerAnimated:YES completion:nil];
</code>
Also, to get information back, you can use delegates, or a property in the first view:
Call before dismissing:
<code>[self.presetingViewController setMyProperty:urlToPassBack];
</code>
Comment: setMyProperty would be a property on the presetingViewController. You would define it when you subclass UIViewController and then use that as the presenting viewController.


Extending a continuous function on the unit sphere to the unit ball

Question: I'm trying to solve a problem in Lee's topology book. In this book, a closed n-cell $D$ is any space homeomorphic to the closed unit ball. Then $\mathrm{Int} D$ , resp. $\partial D$ are the images of the open unit ball, resp. the boundary of the closed unit ball under such a homeomorphism. Given a continuous function $f: \partial D \rightarrow \left [ 0,1 \right ]$, he wants one to show that $f$ extends to a continuous function $F: D \rightarrow \left [ 0,1 \right ]$ that is strictly positive in $\mathrm{Int} D$. Obviously, it suffices to show this for a closed unit ball and I was thinking something like $$\left \|x  \right \|f\left(\frac{x}{\left \| x \right \|}\right) + \dfrac{1 -\left \| x \right \|}{2},$$ but that does not quite do it. Tietze's extension theorem is not in that book (and in fact is a weaker result). Any ideas? Thanks in advance.
Comment: Why does the map not do it?
Comment: Which of his books? Intro to topological manifolds?
Comment: I agree with Stefan H., your proposed $F$ works.
Comment: Dear @user58664, I apologize for the rubbish answer I just deleted. It was late when I wrote it and it adds absolutely nothing to your already fine answer.
Comment: It's far easier if you use Proposition 5.1 first, and then construct the extension.
Answer: F is not defined at the origin. By defining F(0) = 1/2, F becomes a solution to the problem.


How to overcome the dilemma caused by delay in receiving offer letter?

Question: I was recently interviewed by a giant software consulting firm. There were around 8 rounds of interview over phone and face-to-face spanned over 45 days. I attended the last round termed as salary negotiation discussion with HR 2 weeks ago and HR confirmed me that the offer letter will be released within a week. Since then there has been no response from the company's side neither did I follow up with the HR. Should I call the HR to inquire about current status of my application? I ask this because I'm being asked to refrain from doing that by my seniors. The reason put forth was that a slightest urgency shown from my side would be considered as my desperation to get a job, hence will adversely affect the offered salary. Next, since it is a big MNC so processing and approvals before issuing an offer letter takes time, so I should wait. Please guide.
Comment: Let me explain: we can't give you advice about life at large. We also don't answer questions that are higly localized to your situation because they will not be useful for others viewing the site and we can't possibly know all the details. So should you or shouldn't you do something that is highly specific to your company and situation? We don't know. We can't comment in good faith.
Comment: @NoobUnChained a word of warning this is NOT a forum. This is a question and answer site where questions specific to the workplace are asked and answered by those with the knowledge to deal with them. This is not a discussion forum
Comment: @NoobUnChained I'm not saying that you don't have a valid question in there. What I'm saying is that people are probably downvoting because it does not adhere to the format of this site well enough. That is my guess anyway. BTW the question title is totally different from what you have posted as the core of the question in your comment.
Comment: Delays in receiving offer letters are localized? You want me to believe that every other organization barring this one issues offer letters on time? How can this question be specific or localized. If it is then there are scores of open questions floating around here are localized too.
Answer: Should I call the HR to inquire about current status of my application?
Yes, call.
And in the future, always leave an interview (or negotiation) with the question "What is the next step?" If the response is something like "We'll send you an offer letter" you can then ask "when".
In my mind, you are simply trying to make sure that something didn't get lost in the mail (or email), and not acting desperate. As long as you ask only once, it should be fine.
Good luck.


transfer of bitcoin from bitcoin cash wrongly.

Question: i have exchanged my bitcoins with btc on koinex the transiction is done directly from bitcoin to bitcoin cash using destination tag of bitcoin cash  instead of selling the bitcoin and purchasing bitcoin cash, the status of the transiction is showing completed but i have not received in my bitcoin cash wallet. both the transiction is perfomed on koinex. can i pullback the transiction. i have also contacted the koinex customer care there are sayig transiction is sucessfully completed at their end.
Answer: As far as I know that any transactions that are in the blockchain cannot be undone so if it has confirmations then you lost the coins


Uniformly sampling with a constraint on a linear combination of logarithms

Question: Suppose we have $N$ fixed reals $p_1, p_2, \dots, p_N$ satisfying $p_i\in [0, 0.5]$ and $N$ variables $q_1, q_2, \dots, q_N$ in the range $[0, 0.5]$ such that $$\sum_{i=1}^{N}p_i\log (q_i) + (1-p_i)\log(1-q_i) = D$$ for some constant $D$. I am struggling to find ways to uniformly sample from the space of all possible distributions in $q_1\times q_2\times\dots\times q_N$ satisfying this constraint. I've looked around the internet and have found methods for uniformly sampling from convex polytopes, but haven't found anything about nonlinear constraints in general. Any help or links to relevant literature would be appreciated.
Answer: The issue with your case is not that the set is not polytopal: methods like hit and run or rejection sampling are perfectly fine working with any set of full dimension, and are computationally efficient if that set is convex (depending on how its specified to the routines). Instead the problem is that you're sampling from a boundary of the convex set $\{f(q;p) \ge D\}$, which is dimension-deficient (i.e., it's a $N-1$ dimensional submanifold of $\mathbb{R}^N$). This makes vanilla rejection sampling or hit and run fail: e.g., a uniform over the simplex proposal distribution will a.s. never propose a point in the set, and for hit and run, almost all proposal directions are useless and don't lead to any diffusion. Note that this would also be an issue if you were trying to sample from $\{ q: \sum \alpha_i q_i = a\}$.
Nevertheless, given that your set is the boundary of a convex set, there are algorithmic techniques that are viable. One reference I know is Narayanan, Hariharan, and Partha Niyogi. "Sampling hypersurfaces through diffusion. APPROX 2008". There may well be other methods for this, but I guess this should be enough to give you a start into what kind of terms to search for et c. I'll conclude with a quick description of the scheme from this paper.

Here's a description of the scheme: suppose $A$ is a convex set with piecewise smooth boundary, and you have access to a uniform sampler from $A$, and a membership oracle from $A$. In your case $A = [0,0.5]^N \cap \{f(q;p) \ge D\},$ and you can generate an (approximately) uniform sampler via, say, hit and run, and the membership oracle would just evaluate the function and check the level.
Let $\kappa$ be the smallest eigenvalue of $\mathrm{Cov}(X)$ where $X \sim \mathrm{Unif}(A)$, which can be approximated quickly. Then their sampler repeatedly essentially samples $Y = X + \mathcal{N}(0, \sigma^2I),$ where $\sigma^2 \propto \varepsilon^2\kappa/d^2$ and $X \sim \mathrm{Unif}(A)$, until $Y \not\in A,$ and then gives the unique point of $\partial A$ that lies on the line from $X$ to $Y$. Remarkably, this is shown to be $\varepsilon$-accurate in total variation, and to stop in time $O(N^4/\varepsilon).$
There's a small hitch in that instead of a drawing a point uniformly from $A$, you can only do this approximately. This is not a big deal though, because if you can ensure that the distribution of $X$ is $\varepsilon$-close to $\mathrm{Unif}(A),$ then this just increases the error rate of the boundary sample by another $\varepsilon$.


Not able to render a single frame from this scene in eevee, how can I optimize this project for rendering performance without losing quality?

Question: In this EEVEE scene I used Jsplacement to produce a robotic atmosphere. As much as I love the look of it I believe it's eating up all my CPU power and memory. My current PC specs: AMD Ryzen 7 3700X, 16gb of ram and an RTX 3070. I also tried rendering on a PC with 32gb of ram and it maxed out. I tried an add on Normal Groups Master which helped the fps of the rendered viewport but did nothing for actual rendering. I tried to bake my indirect lighting and it crashed. I played around with my render settings while trying not to sacrifice too much quality and couldn't find anything that would render a single frame. There must be something I can do to at least get it to slowly render the scene I just can't figure it out. with the addon i was able to watch the scene in my render viewport so it can't be that heavy? I have bigger plans for this scene and environment, so it would be nice to get it fully optimized.
Download .blend
Comment: Never heard of 'Jsplacement'. I assume that's a third-party addon in which case you'll have to ask the addon author directly.
Comment: @JohnEason its not an add on its a separate free program that generates displacement and color maps in the form of images that i can then add to my image and displacement textures. Im not sure they would actually get back to me but i can see. you can check them out here if you want: https://windmillart.net/?p=jsplacement#:~:text=JSplacement%20is%20a%20cross%2Dplatform,JavaScript%20and%20built%20on%20Electron.
Answer:
Your objects have Subdivision Surface modifiers with a viewport level 4 and level 6(!) for render. Because of that, the scene has already over 9 million vertices when you open the blend file.
Keep in mind that each level of the Subdivision Surface modifier roughly doubles, triples, or even quadruples the number of vertices depending on the geometry. The number is increasing exponentially.
That means at render time you have something like 153 million vertices that require 32 GB RAM.
Here is the result of the stress test. (Don't try this at home ;-)
To recap: Level 4 = 9 million vertices, level 6 = 153 million vertices.

To render the image lower the subdivision levels for the render to 3 or 4, especially when the object is in the background or not visible to the camera there is no need to go crazy with the subdivisions.
Alternatively, you can bake normal maps to fake the displacement.


how optimize CDN without using plugins

Question: i need help for optimizing my wordpress website without using plugins incloding wp-total-cache or wp-super-cache.check this link
https://gtmetrix.com/reports/akhbartop.ir/fF37Flwa
my website needs otimize in Use a Content Delivery Network (CDN) and Configure entity tags (ETags)
also i cant use MAXCDN :) please offer another ways
Answer: You get 94% / 87% so what seem to be the problem?
The only thing i can thing of is the 7.0s load time which is ok but a bit long..
I have also checked your website on Google PageSpeed Insights and the results warn't too bad.

You need better servers, fast servers
Try combining your JS files and codes and load them in the footer before the  tag ends.

TIP:
The only JS file you should keep in your header is the main jQuery JS
Comment: i still have problem with CDN my server is cloud and its good
Answer: Here is one
<code>// Defer parsing of JavaScript files.
function any_page_first_defer_javascripts ( $url ) {
    if ( FALSE === strpos( $url, '.js' ) ) {
       return $url;
    }
    return "$url' async='async";
}
add_filter( 'clean_url', 'any_page_first_defer_javascripts', 11, 1 );
</code>
Here is another one
<code>// Remove Query strings from Static Resources.
function any_page_first_remove_script_version( $src ){
    return add_query_arg( 'ver', false, $src );
}
add_filter( 'script_loader_src', 'any_page_first_remove_script_version', 15, 1 );
add_filter( 'style_loader_src', 'any_page_first__remove_script_version', 15, 1 );
</code>

how optimize CDN without using plugins


What problem does LDAP solve in the web world?

Question: I understand LDAP is the protocol which is used to talk to an active directory system like OpenLDAP.
I also understand OpenLDAP is a kind of database which stores objects in a tree.
My question is: When and for what should I use (if at all) LDAP instead of a relational DB.
Answer: A relational database and a LDAP based database solve different issues. LDAP is strongly focused on fast-read, slow write, it's hierarchical, distributed, and based on authority (like DNS). If your data don't match this assumption, LDAP is not the right choice.
LDAP works well to describe a hierarchy of entities, like for example a company addressbook. While a relational database would require every department to access the big global table with all the addresses, an LDAP solution allows to distribute the responsibility of each department's addressbook to the department itself, while keeping it available for query to anyone else in the company.
LDAP allows you to store any kind of information. The addressbook is the most typical example, but everything that can be intended as hierarchical, authority-focused dataset can be stored in LDAP. Another example: suppose a library is part of a consortium of libraries, and they want to store data about the books they have. The database is hierarchical (each library is authoritative within its borders) and each library is independent from the others. Inside the schema, you can store data about the books, such as author, publication year, title, isbn and so on.
To store data, you represent it using a special file format, LDIF, but APIs exist as well. LDIF, however, is the most easy way to see the information. it's just a plain text file. An example from wikipedia
<code> dn: cn=John Doe,dc=example,dc=com
 cn: John Doe
 givenName: John
 sn: Doe
 telephoneNumber: +1 888 555 6789
 telephoneNumber: +1 888 555 1232
 mail: email@example.com
 manager: cn=Barbara Doe,dc=example,dc=com
 objectClass: inetOrgPerson
 objectClass: organizationalPerson
 objectClass: person
 objectClass: top
</code>
This describes the information about a guy called John Doe. It is under the "realm" of dc=example, dc=com, and has a bunch of other information associated to it (think like a table row). Note that the hierarchy can be (apparently) associated to internet domains, like in this case, but in reality the hierarchy description is very flexible. You can organize hierarchies based on national borders or company departments, or anything you like, as you prefer.
You should use LDAP when you need to manage a data domain where you have

the need for a flexible schema with reduced storage requirements.
reduced write needs, strong read needs
strong hierarchical nature of management and organization of information
authorities and delegation of authoritativeness
Answer: This concise and nice post has very good info relating to this scenario.
If interested further, you can go a bit deeper in here, which is a continuation to the above link.
Answer: LDAP is good for data which is frequently read and rarely written.  For example, LDAP is often  used to store user login or password information.
Answer: LDAP is a centralized user and account management system which can also store some data fields.
Answer: You can use LDAP also as lookup-addressing mechanism to retrieve resources, for example Database-Connections or remote-services.
The nice thing I like about LDAP is, that you can retrieve stuff in directory/URL style. This is quite different to RDBMS where you have to use a dedicated query-language. This often makes sense and is intuitive if things are organized in a hierachical way.


Interpretation of rotating a quantum state

Question: I'm currently taking an introductory quantum mechanics course, where the last covered topic was spin and identical particles. During some reading online, I stumbled across the term "rotating a quantum state" (it was related to the fact that rotating a spin 1/2 state by $2\pi$ let's the state pick up a minus sign). To get to my question: what is meant by "rotating a quantum state"? Is there any intuitive interpretation?
Comment: Related/possible duplicate: https://physics.stackexchange.com/q/167469/50583
Answer: Yes, it means exactly the same thing it means in classical mechanics.
For example, suppose you describe the state of a classical particle with its position $\mathbf{r}$ and $\mathbf{p}$. Then after a rotation, these quantities will be modified by a rotation matrix,
$$\mathbf{r} \to R \mathbf{r}, \quad \mathbf{p} \to R \mathbf{p}$$
where the two $R$'s here have to be the same, because both are vectors. Different quantities can transform in different ways. For example, the energy of particle just stays the same,
$$E \to E.$$
On the other hand, the moment of inertia of a rigid body is a matrix, and it turns out to transform as
$$I \to R^T I R.$$
To perform a rotation on a classical state means to take it to another classical state, the state it would be in if you physically rotated the entire system.
In quantum mechanics, everything works the same way. For example, a point particle might be specified by a position, so its state could be $|\mathbf{r} \rangle$. Under a rotation,
$$|\mathbf{r} \rangle \to |R \mathbf{r} \rangle.$$
That's what we mean by "rotating the state". It's just the result of a physical rotation.
The point at which this departs from classical mechanics is that in quantum mechanics, there are things that can transform very weirdly under rotations, even weirder than $I$ in classical mechanics. For example, many courses spend a lot of time talking about the rotation properties of spin $1/2$ particles. But you shouldn't forget that the principle is the same: we are just cataloging what can happen when you pick up the system and physically rotate it. It's just that in quantum mechanics, there are more and stranger possibilities.
Answer: The simplest way to think about "rotating a quantum state" is to think about rotating the physical apparatus used to measure the quantum state. (For example, you might change the direction of a magnetic field that you are using to measure an electron's spin.) This is a "passive" rotation rather than an "active" one, but they are completely equivalent, and you don't have to think about things like "how do I rotate an electron?"
Answer: A previous question asks about qubits as the Bloch sphere and I point out that a spin-1/2 system in a state $|\psi\rangle = \cos(\theta/2) |0\rangle + e^{i\phi}\sin(
\theta/2)|1\rangle$ is indeed in an eigenstate of an operator that works out to be $\sin\theta\cos\phi ~\sigma_x + \sin\theta\sin\phi~\sigma_y + \cos\theta~\sigma_z,$ so these are spherical coordinates $(\theta, \phi)$ of the direction that the spin-1/2 system is spinning in.
Now let us apply a Hamiltonian proportional to $\sigma_z$ or $|0\rangle\langle 0| - |1\rangle\langle 1|$. The Schrödinger evolution of this is exceptionally simple, it maps for some $\eta$, $$\begin{align}|0\rangle &\mapsto e^{i\eta t}|0\rangle,\\
|1\rangle &\mapsto e^{-i\eta t}|1\rangle.\end{align}$$
In turn the state maps to $$|\psi\rangle \mapsto e^{i\eta t}\left[ \cos\left(\frac\theta2\right) ~|0\rangle + e^{i(\phi - 2\eta t)} \sin\left(\frac\theta2\right)~|1\rangle\right].$$
The key thing to look at here is this expression $\phi - 2\eta t$, which will return to the same rotation $\phi - 2\pi$ when $\eta t = \pi$ due to the periodicity of $e^{i\theta}.$ You can see that under this Hamiltonian the qubit simply precesses about the $z$-axis. Something similar happens for $\sigma_{x,y}$ but the math is a little more complicated so I cheated and took the easiest case.
However we do see that at this time there is also a global prefactor $e^{i\eta t} = -1$ and the state has been mapped to its own negative under this transformation. I mentioned in the comments to that answer to that previous question, such a global prefactor is unobservable in quantum mechanics. But that is true only if it is truly a global prefactor. This setup we have discussed could be applied to a two-qubit system to change either of the two qubits' phase prefactors independently, and that change is indeed observable. So the fact that the one spin-1/2 system maps to its negative when we rotate it by $2\pi$ does indeed have physical consequences and marks that system as a spinor.
Answer: Let $\left\{J_i\right\}_{i=1,2,3}$ a collection of operators such that
$$
[J_i, J_j] = \epsilon_{ijk}J_k
$$
and let $\mathfrak{D}(\theta) = \textrm{exp}\big(-i\theta\mathbf{J}\cdot{\mathbf{n}}\big)$; we refer to such an operator as to "rotations". Given a quantum state $|\psi\rangle$, the state
$$
|\psi\rangle' = \mathfrak{D}(\theta)|\psi\rangle
$$
is the $\theta$-rotated quantum state, given $|\psi\rangle$. By applying the above using the Pauli matrices you end up with a minus sign.
Comment: That does not answer my question. My question was how a rotation of a quantum state is to be understood in the first place.
Comment: What do you mean by _" is to be understood"_? There is nothing to understand, it is just another state obtained applying a linear transformation to the original one. Most you can say is that rotations preserve the norm, but given that as states we take the equivalence classes of rays in the Hilbert space, the norm is unitary anyway.
Comment: @gented You could at least add some vocabulary to the answer, s.t. people can look stuff up. Like Lie group/algebra, or that the angular momentum and spin operators fulfill the Lie bracket constraint. In the end his question boils down to that of "In which space does the rotation happen?", while the reason for the behavior of the spin is SU(2) being a double cover of SO(3) (rotation group), I guess.
Comment: @Paul well, that still wouldn't make the rotation "more understandable", would it? :p
Comment: @gented Well to me it does, at least up to a point. A rotation in 3D position space is sth. one can easily imagine. A rotation in the inner 3D spin space not as easy, but still possible.
Comment: @Paul so you're telling me that double cover of $SO(3)$ is more understandable than applying a linear transformation on a ket? Well, you must have a quite deep understanding of group theory, I imagine :)
Comment: @gented Funnily enough I don't have that kind of understanding, else I would have been able to formulate an answer. I pretty much hoped that you have a better understanding than me, s.t. you can use my feedback to improve on your answer. Also my main point was, if you allow me to rephrase: Writing about rotation w/o mentioning the space in which it operates is somewhat pointless. One also talks e.g. about rotations between the eigenvectors of the strong and weak interaction.
Answer: I think he means, is the particle rotating, or is it really a point particle? What is the intuitive notion behind a spinning quantum particle?
Some might say, the system is not really rotating, but there have been a number of scientists which aren't or haven't been sure about this topic - certainly the behaviour of particles with angular momentum suggests they could be spinning. The thing is, there is no issue, in classical physics - classical physics pretty much predicted a small enough ball would interact like a point. Points don't spin, if an electron could for instance (assuming it really was a point) would have to spin 720 degrees to reach its original orientation - instead of believing that may indicate there is something wrong with viewing an electron as a point particle, we seem to have embraced it, tagging it an ''intrinsic property.'' Interestingly, some scientists attempted to measure the shape of an electron - where there is shape, there is area... they found it was pretty spherical. This spherical picture they built up was in fact a measure of its charge distribution, so maybe electrons, one of the smallest particles in the standard model, may not be pointlike. Likewise, evidence from rotating molecules, called rotational bands suggests that there are real rotation going on for atoms at least.


As a foreigner do I need a permit to spearfish in Australia?

Question: I'll be travelling to Australia soon and I plan to do some spearfishing while there. As a non-Australian, do I need to obtain a permit to spearfish in Australia?
Comment: Keep in mind that there are very strict rules around where you can spearfish, as well as size/bag limits for anything you catch.  Be sure to read into the rules first. These rules are state-based, so they can vary depending on which state you're in.
Answer: It depends on the region and circumstances. For example, for NSW you do require a 'recreational fishing license', which is $7 for 3 days and can be bought online, or through various outlets including Kmart, but if you are fishing on a charter boat / hire boat or with a guide, they may already have a license which will cover you.  (Reference)
Obviously you should also check what the local regulations in terms of allowable equipment, permitted areas, etc, as these might also vary. You should be able to find specific regulations for the areas you're planning to visit without too much trouble.
Comment: How about permits for the other states?


My own IPv6 tunnel

Question: I have a load of IPv6 addresses on my VPS which are not tunneled they are provided by the VPS host. But my ISP at home BT, has no plans yet to allocate IPv6 addresses to even business customers. I don't want to use a tunnel broker that gives me a dynamic IPv6, I want to be able to tunnel into my VPS and assign one of its IPv6 addresses to my home computer. BTW i'm all ubuntu linux.
Comment: "a load of IPv6 addresses" is way too vague. You must at least specify if it is a /64 or bigger allocation. This changes everything.
Comment: Why not use a tunnel broker that gives you a permanent address?  Using tunnelbroker or sixxs you can get a permanent tunnel that will have a permanent /48 or /64.
Answer: A high level answer ...
You will have to setup a 6to4 tunnel from your home computer to your VPS.  One of the machines in your VPS will have to act as the tunnel endpoint.
Your home computer will need a public routable IPv4 address.  One of your VPS machines will need a public routable IPv4 address.
You will then setup a tunnel, setup routes between the tunnels, setup router-advertisements or manually setup your local IP's.  Lots up manual networking.
To me, it would seem simpler to setup a permanent tunnel to one of the tunnel brokers.  This way you only have to configure your side of the tunnel which is very well documented.

My own IPv6 tunnel


How to Calculate the Disk Space Required to Store Googolplex?

Question: Given the googolplex number and that 1 gigabyte = 1 073 741 824 bytes. How would I calculate the amount of disk space required to store the googolplex number?
Answer: Googolplex is $10^{10^{100}}$. Now, the number of bits required to store the number $n$ is $\lg n$ (that is, $\log_2 n$). We have:
$\lg 10^{10^{100}}=10^{100}\cdot \lg 10$
A byte contains $8=2^3$ bits, and as you said, a gigabyte contains $2^{30}$ bytes. So a gigabyte contains $2^{33}$ bits. Hence you need $\frac{10^{100}}{2^{33}}\lg 10$ gigabytes overall.
This is around $3.867 \times 10^{90}$ gigabytes.
Now, of course, there is a much easier way to store googolplex and similar numbers: You can represent them as $a^{b^c}$ with $a,b,c$ small, and only need the bits to store $a,b,c$ and the information of your specific storage method (it's something around 14 bits). You can also represent googolplex by a single bit if you'd like, but then your number-representation algorithm will be rather specific...
Comment: I think it's amusing that we claim we need so many gigabytes to store this number, but we reference it so casually in the same sentence! Taken literally, to store the information contained in the word "googleplex" we need enough space to store the expression $10^{10^{100}}$. Of course, if we wanted to store a number on the order of one googleplex that had random digits with full accuracy, this question becomes more relevant.
Answer: In the sense of information theory, you just need to store any program that will calculate a googolplex, which can be written in a few hundred bytes.  I once saw one on the web, along with a suggestion that it not be run for 567 years.  The justification was that by Moore's Law, you shouldn't run any program that takes more than four years to run-you should wait two years for speeds to double and then run it then.  The program needed a factor of $2^{283.5}$ to meet that.
Comment: I think that was referring to a googol only. :-)
Comment: @ThudanBlunder:  As far as I recall, it was "calculating" a googolplex, which it really did by "outputting" a googol of zeros (which it then cautioned should not be sent to a display as they are much slower).
Answer: If you use the trivial approach to store the number in its binary representation then you have to calculate the length of the number in base 2 to get the amount of bits you need to store it. Then you can convert the number of bits into bytes (1 byte = 8 bit). The amount of bits is equivalent to the number of digits in base 2 which is given by the $D_2$ function I referenced here.
So in total:
Number of bytes to store $x = D_2(x)/8$
Answer: The best thing to due is attack where the system is more relaxed and handle's more simple computations.In the actual final configuration of a googolplex so unknown it is not easily recognized, and as for software programs capable of rendering a number so larger was shipped with the first version of Windows operating system MS Paint and MS Word pad, which used in continual contrast in conjunction with nano spec pint font's (so even the fact of a googolplex    being such a large number it still has to be magnified of visual recognition) carried upon ten to the power of 10 nano spec's of a half pint font (so definitely going to need cyber space to store such large quantities) because both wordpad and paint were built to handle poster collages on a co-lasso scale because in a single 72 pint font character it can be stored one trillion billion nano spec's of a 0.01 pint font thus significantly reducing the size off the known universe with the accumulation of a googolplex units in quantity which is the equivalent of trying to find a needle in a hay stack. Another great googolplex units retrieval method know to have worked reflective imagery which tackles the high unification of numbers to the power simply by reflecting it'self, https://plus.google.com/photos/104235935005231527262/albums/5773073029403960097


Is it possible to use coordinates to modify the floor into a polygon in Webots?

Question: I'm using Webots to model an irregular polygon floor for a coverage problem. I want to define the floor using the coordinates of the vertices.
So far I have been able to generate an irregular polygon with desired coordinates using polygons.wbt. But I'm not sure if this would function correctly as the "floor" or "ground" for the robot to go over.
Answer: Webots offers defaults of some object floors in the <code>~/projects/objects/floors/protos/</code> directory from your Webots HOME directory. These however don't give you the option to modify the floor on the basis of coordinates.
To do what you have asked, however, will require you to create a new PROTO file that you can do by playing around with the instructions as given here. Another stack user had a question regarding changing the coordinates of the origin of the floor and you may want to check that out too.
Answer: I would recommend you to use (or take inspiration from) the UnevenTerrain proto included in the recent versions of Webots. See a demo on webots.cloud. This proto file will generate a random uneven terrain, suitable for robots to move on. If you want a pre-defined, e.g., non random terrain, you can probably take inspiration from this proto to create your own from a Solid node containing an ElevationGrid node with custom size and height values.
Note: polygon.wbt is not the best example for this as it relies on the IndexedFaceSet node which is not the best option to create terrains, because the quality and efficiency of collisions is not as good as with the ElevationGrid.


How do you implement Rel=next & rel=prev in infinite scroll for SEO?

Question: Based on this article
I have a SERP that does infinite scrolling to load results greater than 10.
How do I go about implement rel=next & rel=prev for that?
Answer: The first page in the sequence should not have any rel next or rel prev, the second page should have:
<link rel="next" href="http://www.example.com/article?story=abc&page=2"/>

and
<link rel="prev" href="http://www.example.com/article?story=abc&page=1"/>

And so on through the sequence until it finishes.
Since your page infinitely scrolls and these tags are designed to go into the  of the page I don't think it's possible to implement these tags in your case - as there is actually only a single page.
Answer: I assume you already have an alternative conventional pagination mechanism set up for users who can't run JavaScript or who have it turned off.  Just remember that search engines also belong in that group of users, and set up your rel=prev and rel=next links accordingly.
The only slightly tricky bit may be integrating your conventional and endless pagination methods seamlessly, so that, for example, a user who follows a link to a page in your conventional navigation scheme and has JS enabled will be shown the appropriate page in the endless scrolling navigation.  The actual tricky part is doing that smoothly and efficiently, so that e.g. following a link to page 100 in the results won't crash my browser.
You might also want to make your infinite scrolling list make use of "hash-bang" URLs, so that a) your users can save links to specific points in your infinite list, and b) search engines that encounter such links can find their way to the appropriate page in the conventional list.  For more information, see e.g. "How To: Allow Google to Crawl your AJAX Content".


Do "resolution" and "definition" differ? If so, how?

Question: Particularly in the context of the usage of "high definition" and "resolution", as in quality of digital sound, picture, and/or video. My question is spurred by my description of and under an image, where I say, "Links to higher resolution, original upload." I struggled with deciding which term to use.
Answer: Resolution is a technical term pertaining to the pixel count of an image, while definition has more to do with image clarity (seeing more details) - although in most cases they are used interchangeably in practice.
Assume you had a heavily compressed version of a screenshot, that was the same dimensions (say 1280x960) as the original but much smaller file size and also a corresponding loss in detail. This blurry version would be the same resolution but a lower definition than the original source.
In Hi-Def TVs, the increase in picture resolution enables output that has higher definition as well, hence the name.
Comment: notbad.jpg. Seems sufficient, but I'll let the question sit for maybe another day before I accept it. A source would be nice.


Switching Portfolio back to the new version

Question: My portfolio in SFMC was switched to Classic content but I'd like to go back to the most recent version.  I can't seem to find a way to do this.  Does anyone know?
Answer: Switching back to the content uploaded as part of the newer Content Builder can be accessed through the Content Builder link in Email Studio.

If you are referring to upgrading the portfolio within Classic Content, this to be done through support. I did this recently and they were a bit confused by what I meant, so pro-tip: Ask to activate the business rule Enhanced Portfolio Access.


subdomain on route53 private hosted Zone

Question: I have been trying to setup a Private Hosted Zone in route53 with current associated VPCs in eu-west-1 and will soon add more. I have conformed that my VPC has DNS resolution option set to yes and necessary DHCP option sets are also created. I have added a DNS record under the domain.local domain and it works fine. However, the issue comes when I tried to created a sub-damain dev.domain.local and tried to associate with the same VPC.  I see the following error
"A conflicting domain is already associated with the given VPC or Delegation Set."
My intention is to have one parent private zone as zorotools.local and several subdomain such as dev.domain.local, staging.domain.local, prod.domain.local etc.
I would then associate ec2 instances with these DNS names.
So, please let me know what mistake I am making and how should I proceed.
Answer: Just create records with the remainder of the FQDN filled out. So in this case create "server1.dev" and it will resolve to "server1.dev.domain.local".


Any plants that work as a racoon repellent?

Question: I saw 4 raccoons in my vegetable garden,  doing what they do best with people's gardens.
Please let me know if I could plant anything in or around at the borders to my vegetable garden that would work as a racoon repellent.
I don't want to use chemicals.
Comment: Snipers, one "p". You plant them in a nice, deep hole with a thermos full of coffee (or tea), some rations, a rifle and ammunition - it's inadvisable to fill in with any dirt, as it makes them grumpy. Translation - shoot the raccoons - they are certainly not going to be impeded by mint. You can either kill them, or you can attempt to keep them out - they happen to be **very** hard to keep out, so shooting is far more efficient.
Comment: Plant snipers, or aggressive dogs.  Not much else is going to work. You can have a fun time trying to create an electric fence they won't figure out how not to get shocked by.
Comment: What are plant snippers and I don't want to build an electric fence it will be I will be getting electrocuted probably most of the time if I plant mint leaves wouldn't make the raccoons
Comment: I think [How do I prevent raccoons from eating my corn?](http://gardening.stackexchange.com/questions/3122/how-do-i-prevent-raccoons-from-eating-my-corn) covers most of the possible territory for this question.
Comment: Joseph-thanks so much for caring about both the plants and the backyard visitors. It can be tough to grow things with those gorgeous guys around, but it's awesome that you want to do that rather than hurting them. I hope you get some help and find something that works. As @stormy said, thanks again, and let us know!
Answer: Get a wire fence around your garden.  There's 'field fencing' with smaller openings at the bottom that get a bit larger towards the top. Once these little brainiacs have found what they want, you have to get fencing.  I have a problem with them as well as bunnies.  Well, not any more.  My greenhouse and outdoor garden all have this 'bunny fence' installed.  Have to dig a 6" trench so they can't dig underneath.  You might have to find a mesh to pull over the top as well.  Bunnies don't hop over but raccoon (sp) are far more intelligent!! I adore raccoon!!  Bunnies, too...well, all animals.  Trick is to live in harmony.  Killing anything NEVER SOLVES A PROBLEM.  Never.  Tide rolls out, tide rolls in.  Lots more to take their place.  Poison...interestingly...actually causes animals such as rodents, raccoon, squirrels, bunnies...to have larger litters. This fence is inexpensive, easy to install and you'll be able to sleep at night!!  You could also FEED your raccoon somewhere distant from your garden...stuff like your vegetable scraps.  I know others are flipping out with this but I feed bunnies, raccoon, raven and deer with stuff that would normally go into my compost and I live in total harmony.  I also have dogs (I would never allow to chase and kill) but the fact their smell and presence is obvious, makes a huge difference.
Comment: Found someone who uses Repel All or Repel something or other that they said they thought worked!!  They said the smell is horrid...I am sorta into good smells...bad smells ruin any ambiance of a garden.  Dissipates after awhile so worth trying if desperate.   Let us know if you find something that works for you and your 'neighborhood'...again, Thank YOU!!
Comment: No flipping out here-I love your attitude! We kill nothing, feed everything, and enjoy the beauty of every creature. In fact, we've only ever seen one raccoon at a time, but last night there was a whole family-mama, papa and three youngsters-frolicking in the trees and tipping over bird feeders! Today we put out a tub of water in case they might be thirsty after emptying the birdbaths, but it looked deep enough to drown the chipmunks, so we won't risk it :)
Comment: Oh!!  I LOVE you!!!  Dang, I am impressed with your thinking...maybe our species WILL make it...grin!!  That water is important but you are so correct about keeping a big tub of water around.  I've found chipmunks, baby birds learning to fly in my horse troughs.  Not cool.  I always throw a log or branch that they can escape to...shallow bowls just need more maintenance.  If only more people were like you...thank you, thank you!
Comment: OH very funny.  Here is the comment I was alluding too, my face is a bit red...!
Comment: stormy, I'm confused-my normal state-about which comment you were alluding too. I thought it was partly for me, telling me you loved me, a huge compliment that made me so happy! :))  You're the awesome, inspirational one! I love YOU and wish there were more people like YOU! You're a friend, cheerleader and teacher, and make us feel like our gardens really matter to you! If it wasn't meant for me, I'm the one with the red face, and am sorry!!!! No need to respond, just glad I got a chance to publicly thank you for loving ALL creatures! Cool idea to put a branch in the water :).
Answer: There is actually an all natural alternative that I have found to be extremely helpful. There are no harmful chemicals used, however a putrid odor will accompany the use for a day or two. The product is called Repels-All.
I only do organic (natural) gardening for my family and this stuff has saved my strawberries, blueberries and tomatoes. Again, the stench is enough to drive some humans away but lessens after a few days. I prefer liquid applications, but the granules can be easily dissolved in a water solution.
Comment: This stuff works in your experience?  Huh.  I will look into this stuff...it would be nice to have to power to encourage harmony by just adding a foul smell.  Thanks, Charlotte!
Comment: Yes. I applied an initial dose ("heavier" than recommended, but since I can tolerate the stench it was not a bother). We reapply after every heavy rains and have had great success. If you check out [their website](http://www.bonide.com/best_solution/index.html) you can read up on their other products. If you read the reviews on from the initial answer post you'd have see that most of the dissatisfied customers were dealing with deer. They have a separate line of products specifically for deer and rabbits. I hope it works for you too!


Temperature controlled fan using LM358

Question:
According to the circuit diagram image and below video I uploaded, voltage between the motor is not stable. What can I do? In Proteus the simulation of motor runs differently so to fix this, any option available? Changing voltage difference is mentioned in this video.
https://streamable.com/w8vk5v
Answer: Operating an opamp in open loop like you do is practically never the right thing. So, what you should do is have a look at some standard opamp circuits, and pick one that describes your use case.
I'd recommend one, but I'm not 100% sure what you want to do, so I can't advise. I simply can't infer what you want your circuit to do – its implementation seems wrong in multiple ways: not only do you have no feedback, you're feeding Q1 without a base resistor; Q1 is almost certainly not the thing you want to drive a motor, unless that motor is very small, and even then, you'd want a flyback diode.
Answer: It's not clear to me why the simulation is doing that- whether it's simulating some effect or just not working properly.
However, you are overloading the output of the op-amp (which is being used as a comparator) by omitting a series base resistor. Try that in the simulation, something like 2kΩ between pin 1 and the transistor base.
In practice (when you get around to building it) you might want to add a bit of positive feedback so the fan switches cleanly from off to on and back again. For example, a resistor from pin 1 to pin 3 of the op-amp to give something like 1-2°C of hysteresis.
The pot connection is a bit unorthodox but it may work for you depending on what you're trying to accomplish.
For all LM358/LM324 applications this relatively recent application note is very useful, including comparator applications (pp24-26) and what to do with unused amplifiers in the same package. Kudos to TI for continuing to support a part that is 50 years old and still used in enormous quantity.
Answer: I recall building one of these circuits in my past.
First note: Op amps are never used as comparators for stability, noise, and precision reasons. Comparators like an LM393 are cheap and commonly available, so I suggest designing the circuit with one of those.
If that isn't possible, here are some quick solutions:
Regarding an unstable voltage, there are multiple things to consider:

Is the spice software you are using have the correct IC model and
characteristics? Are you building this circuit physically and testing
it?
Is the Op Amp chip you ordered a fake? Is it damaged?
How much current is the base of your NPN transistor drawing from the op amp?
Is there noise/debounce when the op amp comparator switches states? Maybe add a capacitor on the inverting pin (-) and output of your op amp (on the order of maybe 10nF - 100nF) to reduce any noise.

Suggested additions:
I would add a resistor, probably a 2.2k ohm resistor, between the output of your Op Amp and base of that NPN BJT. The reason for that is because a large current draw from the op amps output can cause instability and undesired (or even unexpected) results. Check the op amp datasheet for the maximum current output and stay below that.
Also, the potentiometer could be reconfigured as a rheostat and you can connect the inverting pin of the op amp to the junction between the potentiometer and NTC thermistor, this should make tuning the temperature in easier.

simulate this circuit – Schematic created using CircuitLab
Answer: This is a simple on/off controller.  The opamp is acting as a comparator.  The advantage to using an opamp is that it has an active pull-up in its output stage, so you do not need an external pull-up resistor to turn on Q1.  The LM358 is a good part for this because its output stage swings low enough to turn off Q1 without other components.
Besides a base current limiting resistor for Q1, I recommend adding hysteresis to the circuit so it does not vacillate rapidly between on and off when the temperature is right at the trip point.  A 22K resistor from pin 1 to pin 3 should quiet the circuit.
In the video image there is 3.35 V across the Q1 base-emitter junction.  This is not correct.  It can vary based on the transistor, but it should be somewhere between 0.5 V and 1.0 V.

Temperature controlled fan using LM358


How to set MANPATH without overriding defaults?

Question: I have added extra directories to $PATH by exporting PATH=/my/dirs:$PATH
But I am not sure if I should do the same to MANPATH. Because default MANPATH is empty yet man command works. I found a command called manpath and its manual says If  $MANPATH  is set, manpath will simply display its contents and issue a warning.. Does this mean setting MANPATH is not the right way to add directories for man command to search for manual pages?
Answer: If you simply set MANPATH, it overrides the default and you lose access to the standard man pages. For example, man ls works before setting MANPATH, but does not work afterwards.
To append a search directory without overriding the default, prefix a colon to MANPATH like this:
export MANPATH=":/path/to/custom/man"

Adding the colon gives you access to both the standard system man pages and the custom pages referenced in the MANPATH variable.
This answer brought to you by manpath(1):

If  $MANPATH  is  set,  manpath displays its value rather than
  determining it on the fly.  If $MANPATH is prefixed by a colon, then
  the value of the  variable  is  appended  to  the  list determined
  from the content of the configuration files.  If the colon comes at
  the end of the value in the variable, then the determined list is
  appended to the content of  the  variable. If  the  value  of  the
  variable  contains  a double colon (::), then the determined list is
  inserted in the middle of the value, between the two colons.
Answer: While the title specifically mentions the MANPATH variable, I believe what the original author of the question was partly alluding to was whether there is a way to "add" a manpage to the system without touching the MANPATH variable in the first place.
Therefore, in addition to the accepted answer, I would point out that, in a standard configuration, the manpage command also seems to look at directories in your PATH.
I have not come across the relevant documentation for this, but from personal experimentation, I think the way this works is as follows:
Assume you have a directory in your PATH called /dir1/dir2/dir3/dir4.
Then, dir4 as well as its parent (i.e. dir3) will be searched by manpath, and if one of those directories contains a sub-directory called man or share/man, then the 'man' directory in question will be added to the output of the manpath command.
In practice this means that, e.g., if /home/user/.local/bin is in your path, and you also have a directory called /home/user/.local/share/man, any manpages contained there will be picked up. Similarly, if something like /opt/nano/bin is in your path, then /opt/nano/share/man will be picked up.
Note that by "picked up", I mean that the manpath command will include that directory in its output! The content of those directories still needs to be compatible with man for man to pick up valid manpages from within them. In other words, your home/user/.local/share/man directory should contain a man1 directory containing lots of .1 files, a man5 directory containing lots of .5 files, etc, in groff format.
UPDATE: As per the comments below, the manpath man pages now fully document this behaviour as of man-db 2.10.0.
Comment: In response to that bug report, there's now a dedicated section for this (https://manpages.ubuntu.com/manpages/jammy/en/man5/manpath.5.html#search%20path) and the other manual pages in man-db refer to that.
Comment: `man 5 manpath` for the documentation.
Comment: @ReubenThomas thanks Reuben, but that page still doesn't mention the above. The closest thing `man 5 manpath` hints at is that you can have 'fixed' path-to-manpath conversions. I haven't seen any documentation regarding 'relative' conversions as shown above. Not sure why; it's an incredibly useful mechanism!
Comment: Indeed, and I have filed a bug requesting this documentation: https://savannah.nongnu.org/bugs/?61862
Comment: @ReubenThomas excellent! I'll follow it too! :)
Answer: You should add your custom directories at the end of your PATH:
PATH=$PATH:/my/dirs

This is so your custom directories do not override system binaries and libraries, which could cause a security issue.
You set MANPATH the same way (MANPATH is empty by default):
MANPATH=$MANPATH:/my/dirs

You should not need to set a MANPATH with well behaved packages, so if it is not broken don't fix it. If it is broken, perhaps you are better filing a bug report ;)
Add this to ~/.bashrc:
export PATH=$PATH:/my/dirs
export MANPATH=$MANPATH:/my/dirs

Comment: Typo in the second statement?  `MANPATH=$MANTPATH:/my/dirs`  Maybe should be: `MANPATH=$MANPATH:/my/dirs`
Comment: What do you mean by "well behaved packages"? I have a whole set of tools that are not installed in the usual places (HPC clusters often put things in /opt). How should they register their man pages without using $MANPATH?
Comment: "well behaved packages" are written to use standard paths and environmental variables. Poorly behaved packages use non standard, at least to Ubuntu, paths such as /opt or do not use environmental variables and thus lead to your observation " I have a whole set of tools that are not installed in the usual places (HPC clusters often put things in /opt)"


Package and Activity name

Question: Good day. I'm working on an android program which is application manager. I want to call the application of "Dictionary.com" but in my code, I should include the package and activity name of this application. Can someone post here the Package name and Activity name of this Application? Please. THANK YOU!!!
Comment: Also, the "Translate free" application. PLEASE. I really need this. This kind of application manager is my PROject. Thank You
Answer: Application name is something that visible to the user. So put some user friendly name such as "Digital PocketDictionary"
Package name should be unique. It is recommended if you can use your domain in reverse version. As an example, if you have your own hosting or a website related to this app such as www.digitaldic.com you can use com.digital.dictionary as the package name. Make sure all the letters are simple.
Answer: It's a little difficult to get what you are asking for, specially the activity name. But here's what you could do to get the package name.
Install the required apps on your phone and then connect it to your computer and in your Eclipse, go to the "DDMS" perspective. In the devices window, click on your phone's entry. On the right, go to the File Explorer.
Go to system/app. You should see the name of the .apk file. You'll get the name of the package in the "info" column.
Getting the name of the activity might be difficult. you could contact Dictionary.com to get the info, coz I doubt you will be able to start the activity, if Dictionary.com doesn't allow it.
Answer: I just tried this code and it works without having to include the activity's name:
<code>PackageManager pm = this.getPackageManager();
Intent i = pm.getLaunchIntentForPackage("com.example.test3");
if (!i.equals(null)){
    startActivity(i);
}else{
    System.out.println("too bad (-*-)");
}
</code>

Package and Activity name


Teaching LaTeX to visually disabled

Question: I will teach a blind person how to use LaTeX this week. Has anyone any hints for me or package recommendations?
Comment: Not sure whether this includes output considerations. If so, see [LaTeX to Braille](http://tex.stackexchange.com/q/32609/5764).
Comment: Here some comments on the course. There were three students, two of them seeing. The blind student used a netbook with a Braille display and audio output attached. As editor he used TeXniccenter and got along quite well with it.
Answer: (Disclaimer: I am not visually impaired, nor have I ever taught someone who is to use LaTeX.)
Here are the things that I would do:

Get on the blindmath mailing list.  There are a lot of very knowledgeable and (importantly!) very helpful people there, both visually impaired and sighted, and some have been in the situation you're in.  Whilst the focus is more on teaching the mathematics, LaTeX is a common topic and a common choice of medium.  I believe that there is quite some discussion on editors and screen readers and how they react to LaTeX - start by searching the archives, but also don't hesitate to ask questions.
Take a look at Access 2 Science.  Some of the people behind that (maybe all) are on the Blindmath mailing list, and are involved in accessible technology.
Keep notes and answer your own question so that others who are in a similar situation later can benefit from finding the information here.
Answer: Trying with a voice synthesizer could help, I think.
Comment: Welcome to TeX.SX! You can have a look at [our starter guide](http://meta.tex.stackexchange.com/q/1436) to familiarize yourself further with our format.
Comment: I don't understand how this would help. Like text-to-voice, would you translate/synthesize code? Or would you synthesize regular notes on LaTeX?
Comment: Actually the student was using a synthesizer, at three times the standard speed. I didn't understand a single word...

Teaching LaTeX to visually disabled


I can't send a picture attachment within a text message - using NET10 (Motorola ATRIX 2)

Question: I can't send a picture attachment within a text message - using NET10 (Motorola ATRIX 2) - have only had the service for a month and this is the first time I've tried sending a picture
Comment: Why can't you? What have you tried? What were you missing / were did you get stuck? Is an APN for MMS set up on your device? SMS themselves cannot handle pictures -- they are text-only and limited to 160 chars.
Answer: For some reason Net10 is famous for this issue - happened to me too. I ended up using a free third party messaging app (Handcent works for me) and I can send and receive picture messages now with no problems. Download one of these messaging apps, and you will not really tell that it is not the messaging app that came with the phone originally; they work and integrate that well.
Answer: I also recommend a third party app, but I'd recommend hello bc in addition to sending photos, it handles group text messages the best, another big issue with android text messaging in my opinion.


What statistic test apply to a cell count time line?

Question: I am a PhD student with some difficulties about what test to choose to verify an experiment. Hope you can give me some help!
My experiment:
I am counting the number of a subset of cells in Drosophila overtime.
I have a mutant and a wild type control. I dissect the flies at different time points: just eclosed, 1 day after eclosion, 3 dae, 6 dae, 9 dae, 12 dae and 15 dae. For each time-point I have a n number of around 50 for sample. The sample number has a range of 0-9, depending on the day and if mutant or wildtype.
The problem:
What happen with these cells is that in the wild type population the number of cells does not decrease overtime, while in the mutants it does. Moreover the wild type population has an average of around 6 (in all the dissection days), while the mutant starts with 4 and goes down to 2. If they were the same amount initially I could have used an anova test with a posthoc test (like tukey) to show the difference between wild type and control for each day, but in this scenario an anova would tell me only that all the wild type are different from the same dae dissected mutant (even at eclosion!) because of the basic difference they have, or that for example mutant dae15 is different from mutant dae0,1,3. Moreover, what I would like to test against is not that the wild type is different from the mutant at a particular timepoint, but that the mutant numbers decrease in a different way compared to the control numbers.
Possible solutions:
One possibility would be to do an anova on a normalized sample: I could divide every number (and I mean the single numbers of the count, not the average) I get for the average of the eclosion day, and do an anova on that ratio (so I would have like normalised the two populations to the eclosion day and it would not matter anymore that their raw numbers are different), but something tells me I would mess up all the statistics: I am not sure if this approach is statistically correct.
Another possibility I was thinking is to use some kind of correlation or regression analysis, but in the example I found I never found this approach on my kind of experiment, so i am not sure how to work this out. In the various handbook it always show this kind of approach to smaller experiments, like comparing blood pressure and coffee assumption, and with much less numbers, so I am not sure what I would end up with blotting 600 different points together.
Another possibility would be to compare the slope of the two different lines, but I am not sure how I could do this considering all the different counts and not only the final average.
Someone suggested to to a Keplen Maier test, but I cannot see how to apply this kind of tests (logrank) considering all the count that compose one timepoint and not only the final average.
How I am going to do this if I do not find better solution is: just do an anova (yes, one single set of counts is normally distributed) on the raw numbers and show that while Wt Day0 and Day15 are not statistically different, while the Day0 and Day15 from the mutant are statistically different (or even the Day0 from Day12 etc). Maybe this would be enough and I am just over-thinking the problem, but somehow it does not seem to fully describe what I am analysing.
If you have any idea how this problem could be solved, I would be grateful!
Comment: I ended up calculating the slope for linear regression of the two timeline; once done so I compared the two slopes with a t-test and obtained my result
Answer:
Someone suggested to to a Keplen Maier test, but I cannot see how to apply this kind of tests (logrank) considering all the count that compose one timepoint and not only the final average.

While your problem feels like a survival analysis problem, and you could show what you want to show with a set of KM curves, I think it may be a flawed approach. In order to do a survival analysis, one of two things would have to be true:

You know all the cell counts for all flies at each sampling point. Since you have to dissect them, and only dissect a portion, this isn't true.
You might be able to ignore this if you could credibly say "the undirected flies all have counts identical to the dissected ones", but I have no idea if this is true or not, and if you have any variability in your data, likely won't be true.

I might indeed go with a regression approach, showing the slope of the line of number of cells over time drops for the mutants, but not for the wild type. Don't worry about having too much data - the folks here regularly run regression problems on thousands, tens of thousands and higher amounts of data. Your books likely don't cover it because it's really easy to see what's happening with small amounts of data, but the technique can handle plenty.
My best advice is to find someone in your department, or a related department, that does regression on a regular basis, and talk to them about how to approach your problem, but it doesn't seem too difficult on the surface.


Can an Indian citizen holding resident visa in UAE with sales designation travel with visit visa to kuwait?

Question: I have a valid two years resident card in United Arab Emirates, however i have seen that to enter into Kuwait with even visit visa i should have my designation specific(Like Engineer, Doctor etc..). But, in my resident visa of United Arab Emirates my designation is "Sales". Now, if i apply for Visit Visa to Kuwait can i be able to enter into Kuwait if i apply for visa in online and not going to Kuwait embassy.
Answer: The official Kuwait e-visa site says that your GCC residence document must show one of the specific list of professions.

Consultants
  Doctors
  Engineers
  Lawyers
  Judges&Members of Public Prosecution
  University Teachers
  Press&Media Staff
  Pilots
  System Analysts & Computer Programmers
  Managers
  Businessmen
  Diplomatic Corps
  University Graduates – Owners, Managers and Representatives of Commercial Companies and Establishments

Based on the information available, it doesn't appear that you can qualify for the e-visa. But "Businessmen" seems very generic to me. Perhaps it has some special meaning on a GCC residence permit, or perhaps it is just general and any sort of businessman would qualify.
If you want to be completely safe, apply for the regular visa from the embassy. If you want to take a bit of a risk, you can try to apply for the e-visa. You might be approved. If you're declined, then you can go back to apply for the regular visa. But the reason this is risky is that even if you are approved, the immigration officers might decide at the border that you didn't qualify, and issue a fine and/or refuse entry. It is up to you to decide whether this risk is worth taking.


Is there such thing as an Ubuntu Certification Program, which guarantees compatability?

Question: Is there a list or repository which I can refer to so I can see the options of laptop brands or models which are safe to buy?
Comment: With a laptop in particular, I would suggest keeping the windows hard drive intact and installing a new drive.  If you look at the samsung case you'll have warranty difficulties if anything breaks using anyway, so after testing everything under windows you can swap out the drive (also you can get something that suits you better e.g. SSD).  That's what I did on my Acer netbook (maxing out the RAM at the same time).  The only issues I had (which are common on laptops and can be solved with patience) are the laptop-specific function keys (such as internal/external monitor, touchpad on/off).
Answer: Ubuntu has a list of devices that are certified compatible
One day, when I can afford it, I'll buy a system76 laptop.
Be cautious when considering a Samsung. (see here: Linux blamed for Samsung laptop deaths)
If you plan on also using Windows, it's much easier and safer to install Ubuntu along-side Windows 7. Some people have experienced issues installing dual-boot along with Windows 8.
ASUS, HP, and Dell have released models with an Ubuntu OS option:

HP 255 Notebook PC
Asus Eee PC 1225C
Dell XPS 13 Laptop, Developer Edition

I believe Dell has Ubuntu pre-installed on other models as an option but there is no option to opt-out of windows unless you buy the XPS. Dell linux laptops.
Comment: You should probably move the link to ubuntu.com/certification to the top of the post, as it is the exact answer to the question :)
Comment: Samsungs are okay as long as you install recent versions of Ubuntu (13.10+). I am running 14.04 on a Samsung Series 9 perfectly fine.
Comment: I will say that samsung is known for replacing laptops with Ubuntu installed when allot of other manufacturers would just try to say that using linux voids the warranty http://askubuntu.com/questions/510456/boot-repair-or-ubuntu-grub-somehow-stopped-bios-setup
Answer: In my experience Acer laptops run it pretty well, though there is a list of compatible computers that run perfectly with it on Ubuntu Certified hardware webpage.
system76 has it installed by default, but have varying tech support success and helpfulness.
Overall, if you have some time you can run it on pretty much anything.
Answer: According to Canonical:
Canonical works closely with Lenovo to certify Ubuntu on a range of their hardware.
A lot of developers see value in Lenovo Thinkpads for four main reasons:

Trackpoint Functionality.
Business Aesthetic.
Road Warrior (Durable, good battery life).
Comfortable keyboard.

http://www.ubuntu.com/certification/make/Lenovo/?page=1
Comment: I work with Lenovo machines everyday. I can absolutely recommend them for Ubuntu - they work very well with no need for any proprietary drivers (other than NVidia for such equipped GPU's). The Haswell-based machines in particular (X240, T440, W540, etc).
Comment: Every time I visit their site; I make sure to bug them about making an "Install with Ubuntu" Default option.


conjure-up openstack zfs

Question: I have installed the openstack one machine with conjure-up,
in the start up guide "http://conjure-up.io/docs/en/users/#getting-started" said the localhost recommend "250G SSD with a seperate block device for ZFS. Our recommendation for that device is 100G." , how to setup the 100G ZFS block device to be used in openstack?
Answer: Don't know if this helps; but I've found useful informations at
https://www.howtogeek.com/175159/an-introduction-to-the-z-file-system-zfs-for-linux/
If you have a second HD (say /dev/sdb) without any partition table and you want tp create a pool named "geek1" this is the command you have top use:
sudo zpool create -f geek1 /dev/sdb
Answer: After installing conjure-up, you need to tell lxd to use the ZFS.
You can do it by running
sudo lxd init

You can also point it straight at blockdevice /dev/sdb, if sdb1 doesn't exist. It will create the partition and pool automatically.
Comment: got following error:

$ sudo lxd init
Do you want to configure a new storage pool (yes/no) [default=yes]?
Name of the new storage pool [default=default]:
Name of the storage backend to use (dir or zfs) [default=dir]: zfs
error: The requested backend 'zfs' isn't available on your system (missing tools).
Answer: If you are only configuring ZFS because you think you need to do it for a minimal dev install of Openstack, you can skip that.
From a clean install of Ubuntu 16.04.2:
sudo snap install conjure-up --classic

Then you can pretty much go "next next finish" through getting Openstack to run inside LXD.  It takes a while to run.  Note the Openstack URL on the last page of the procecss.  Also, from the main host,
juju gui

is a helpful command.
If not a clean install of Ubuntu, you might have to clean up juju, lxd, or conjure-up.  I prefer the wipe/reinstall method.  But a derivative of the following could be useful:
sudo apt-get remove --purge juju
sudo apt-get remove --purge conjure-up
sudo apt-get remove --purge lxd

conjure-up openstack zfs


Browser with find regex support

Question: Is there a good browser with regex and javascript support? Sometimes I have to search stuff using regex
Comment: Instead of a completely new browser I would look for an extension to your current one.
Answer: The only browser with native support for Regex searches I was able to find is Konqueror. It's available onley for Linux systems.
You should rely on a plugin, for example:

Chrome Regex Search extension for Google Chrome
found nothing for Safari
Regex Search add-on for Mozilla Firefox

You can use RegEx search in Google Chrome DevTools, typing Ctrl + Shift + F on Windows or Command + F on Mac, but it will search in the code and not for the page content only.

Browser with find regex support


Jelly Bean and setBeamPushUris()

Question: I am playing with JB and Beam.
I used the example code giving by android but I filled my uri array like this :
NfcAdapter m_adapter = NfcAdapter.getDefaultAdapter(this);
Uri uri1 = Uri.parse("http://www.effinnov.com")
Uri myuri[] = new Uri[] {uri1};
m_adapter.setBeamPushUris(myuri, this);
and I get this error :
E/NFC     ( 3101): Uri needs to have either scheme file or scheme content
Can someone give me some advice?
Furthermore i am not sure what to think about that :
"
Android Beam™ now supports large payload transfers over Bluetooth. When you define the data to transfer with either the new setBeamPushUris() method or the new callback interface NfcAdapter.CreateBeamUrisCallback, Android hands off the data transfer to Bluetooth or another alternate transport to achieve faster transfer speeds. This is especially useful for large payloads such as image and audio files and requires no visible pairing between the devices. No additional work is required by your app to take advantage of transfers over Bluetooth.
"
=> does it means that transfer do not use NFC anymore? or it uses NFC it contents is small and bluetooth oterwise?
Answer:
Can someone give me some advice?

You can beam local files. You cannot beam the contents of Web pages directly from an http:// URL.

does it means that transfer do not use NFC anymore?

AFAIK, it will not use NFC for beamed content, where by "beamed" I mean stuff like setBeamPushUris(). The NFC radio is used to initiate the transfer, including setting up the Bluetooth connection. NFC is also used for non-beam scenarios, such as reading an NFC tag.
Comment: So if i understand it well, when using setBeamPushUris() NFC radio only initiate the blutooth transfer so it differs from setNdefPushMessage() where the whole transfer is done by NFC radio.
Comment: @Luciflore: Correct. `setNdefPushMessage()` and `setNdefPushMessageCallback()` also limit you to NDEF messages, not arbitrary files.

Jelly Bean and setBeamPushUris()


reductio ad absurdum vs. argument by lack of imagination

Question: A reductio ad absurdum is a correct way to argue. An argument by lack of imagination is an informal fallacy.
But if a reductio ad absurdum is applied outside of a highly formalized setting like mathematics, how do we distinguish it from an argument by lack of imagination?
Isn't stating that something is absurd the same as stating that you can't imagine it to be true?
Comment: You can push the question back one step, using possible world semantics, and say that some state of affairs is absurd if it is not possible which means it does not obtain in any possible world. The question then becomes "is a lack of the ability to imagine this state of affairs obtaining in a possible world proof that there is no possible world in which it obtains?" There is discussion of this in the metaphysics/modal logic literature but I apologize that I cannot remember the name of the specific paper I'm thinking of. It's something like "Is imagination good enough for ___" or something.
Comment: You are interpreting the words Wrong.  Reductio ad absurdum refers or expresses an argument that has a blatantly problematic conclusion. So the method of arguing like this leads to absurdity referring to the method of argument. The absurdity of the argument, if proven, will be the reason to reject the argument conclusion. That is the truth will be the falsity of said conclusion. So if my conclusion is p then the rejection of p being a blatant false proposition must mean that NOT P IS TRUE. This method works outside of mathematical logic. Classical logic uses this method  as well.
Comment: Logical fallacies express that the conclusion does not logically follow from the premises. The fact someone can't understand how x could happen is not a logical factor but a personal issue. The reductio ad absurdum form of argument forces the conclusion & shows that the given conclusion is inconsistent -- that is the conclusion has false instances--- & this is why the given conclusion value must be reversed.
Comment: It does not matter whether there is reductio-ad-absurdum involved, considering anything proved relies upon a lack of imagination (or, more properly, accepting that a given level of imagination is mere whimsy and no longer relevant).  If you applied more imagination, you could contrive more sophisticated counterexamples and edge cases, and hunt down more suppressed premises, whether or not there is any negation or contradiction involved.  The two concepts are not really related in any way.
Comment: I assume "lack of imagination" refers to false dichotomy. Similar concern can be raised about any informal inference, they are all strictly speaking invalid. But absurd and unimaginable are still two different things: the former means one can present plausible arguments for the exhaustiveness of alternatives, not just appeal to imagination. How plausible, how convincing? Well, in the end informal reasoning always rests on judgment calls.
Comment: @Conifold `Well, in the end informal reasoning always rests on judgment calls.` true, but there seems to be something *especially* problematic in the reductio vs. lack-of-imagination case.
Comment: I do not see it, but that is a judgment call as well :) [Conceivability/imaginability/possibility](https://plato.stanford.edu/entries/zombies/#4) distinction is a big item in the philosophical zombie discussions, for example.
Comment: @Conifold yeah, ok. It seems for any valid way to argue there's a closely related informal fallacy. Someone should make a list about that.
Comment: Toulmin investigated this in Uses of Argument, he notes that formal standards make logic useless in practical situations. So-called informal fallacies are materially valid inferences, either misapplied, or taken beyond their range of applicability, or used as warnings that certainty/universality expectations set up by the formal are naive. But the key point is that material warrants that back substantive inferences are field and context specific, your question is just not answerable in this generality. Did you have some particular reductios in mind?
Answer: Reductio ad Absurdum is simply showing that an argument results in a false conclusion.
In mathematics, that's a formally proven false conclusion.
In an "informal" setting, all that is required is that both parties agree that the conclusion is false. The purpose isn't to show that something is false merely because it is absurd, but to show that an argument, when its premises are followed through, results in an absurd (and patently false) conclusion, thereby demonstrating that the original argument was a bad one.
Simply, put, if there is a premise, and I show that it results in an absurd conclusion (that we both agree is a false conclusion), then we also must both agree that the premise is false.
Now, on the other hand if there's a dispute about whether the "absurd" conclusion is actually false, and you say it isn't, and I say that it is, purely because it's absurd, in that case I'm just making an argument from a lack of imagination.  But that's not the point of an "informal" reducto ad absurdum, the point is to show that we arrive at a point of mutually agreed falsehood
 &
super informally:
valid:

person 1 : I think A is true because B is true
person 2 : but if B is true then C is true.  And if C were true, then D would be true.
person 1 : But D is clearly absurd (and false)!
person 2: Exactly, and if D is false, then B must also be false (and therefore is not a valid supporting argument for A)

As opposed to:
not valid:

person 1: A is true
person 2: but if A were true, then B would be true, and if B were true, then C would be true, and C is clearly absurd!
person 1: B and C are also true, and if you would allow be to finish, I can demonstrate why
person 2: but they're absuuuuuuuuuurd
person 1: you may feel that way, but I think if you consider the...
person 2: absuuuuuuuuuuuuuuuuuuuuuuuuuurd


HTTP file download with Javascript

Question: Is there any way (in Javascript) to download a remote website (i.e. like with Curl), read it into a string variable and further process it?
Answer: You can only download a file from the same domain, as per the Same Origin Policy. You can download content from the same domain though, using the XMLHTTPRequest object:
 var xhReq = createXMLHttpRequest();
 xhReq.open("GET", "page.html", true);
 xhReq.onreadystatechange = onResponse;
 xhReq.send(null);
 ...
 function onResponse() {
   if (xhReq.readyState != 4)  { return; }
   var serverResponse = xhReq.responseText;
   ...
 }

There are ways to circumvent the policy, some of them listed in the same Wikipedia page. But it's a hack at best and illegal at worst.
Answer: Sure- The url must be from the same domain, unless the url has a cross domain policy or you create a server side proxy script.
The following code is an example of an ajax call to any domain through a proxy PHP script:

var xmlhttp =  new XMLHttpRequest();
xmlhttp.open("POST","http://localhost/proxy.php?url=http://google.com", true);
xmlhttp.onreadystatechange = function() {
    if (request.readyState == 4 && request.status == 200) {
      // ensure we have a response...
      if (xmlhttp.responseText) {
         var html =  xmlhttp.responseText;
         // do your processing here...
      }
    }
};
xmlhttp.send();

You then would make your proxy.php script connect to the given url via Curl (or whatever url library your sever side language has) and then simply echo the content from your domain...

<?php

// proxy.php

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL,$_GET["url"]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
$result=curl_exec ($ch);
curl_close ($ch);
echo $result;

?>

hope that all makes sense.
Answer: You can use the Yahoo Query Language to query any page on the web.
For example, if you want the full source of the Google homepage, you could use:
select * from html where url="http://google.com" and xpath='/html' limit 1

You'd have to use their JSON callback and reserialize the returned object, but you'd be able to get a full view of the page.
Comment: YQL is way cool. I'm not sure where I'd use it yet but it's still a fascinating tool.
Answer: Mostly you won't be allowed. Javascript will prevent you doing this for security reasons. However, you can request json data from other domains using jQuery. Here is an example from the jquery docs that gets some cat pictures from flickr...
$.getJSON("http://api.flickr.com/services/feeds/photos_public.gne?tags=cat&tagmode=any&format=json&jsoncallback=?",
    function(data){
      $.each(data.items, function(i,item){
        $("").attr("src", item.media.m).appendTo("#images");
        if ( i == 4 ) return false;
      });
    });

You can find this code in the jQuery Docs. As you can see, this makes a request, gets the data back and updates some image tags in the DOM with the cat pictures...

HTTP file download with Javascript


SQL job using SSIS package takes a long time to run especially in the evenings

Question: I have a SQL job that runs an SSIS package and it basically pulls records from staging table and dumps it into the master table. It used to take around 8 hrs. to run but in these last 10 days or so the run duration has increased and I would like to know if there is a way I can find out where the job is spending more time and what it is waiting on either running a profiler trace or running a tsql script inside a job to capture anything useful. It runs every day except Sat at 11p est.
Comment: Take a look at [this question and answer](https://stackoverflow.com/questions/15004109/can-you-monitor-the-execution-of-an-ssis-package-in-bids-as-it-runs-on-the-ser). While not really a direct duplicate of your question, I think it provides an answer for you - using the logging capabilities of SSIS. Since you're using 2008, you'd be doing it "the hard way", but you should be able to track when you enter and leave certain states for each task in your package.
Comment: Note that you'll be able to tell where the job is spending its time today - but unless you already have such information from (say) two weeks ago, you won't be able to tell where there's a *difference* in how its spending its time. Also, don't neglect standard troubleshooting: any new (or updated) jobs start running two weeks ago or so? Any change in the amount of data to be processed?
Comment: I totally get that and there are some days when the data load is not that heavy and it completes quickly whereas the same is not true for other days and it takes longer to complete. However, I do need a way to figure out where exactly in the process it spends a lot of time waiting on that the run duration increases so drastically.
Comment: 8 hours is a longtime for any integration or etl job. How many rows/gb are we talking about. How much longer is it now taking?
Comment: Yup...8 hrs. is long by any means. Currently, it is close to 100,000 records per hour.
Comment: Post pictures of your SSIS package + control flow + the source and destination. We'll probably need the schema from source/destination but those screen shots should provide me with a good idea of where to look
Answer: Though not really enough info here to give a full answer these steps are how I would approach trouble shooting this...

check the execution logs for the package. Take note of the timings on steps. It should he obvious which takes longest.
execution plans are helpful once you know which to look at. If it's stored procs or a fairly static query the should be in the query plan.
change the package to manually log individual steps and information that you can clearly analyse later it will help identify the slow running points. Add row counts to see if you can quantify if a per row metric to calculate run time. Even run a query to log current connections and transactions to see if it's clashing with other tasks.

This being said 8 hour sync between staging and live is huge unless we're talking about 100s of millions of rows. The run time could suggest missing indexes on staging but the execution plans should tell you that.


Structural Equation Modeling Step 2 - Model Identification

Question: How would I begin to determine if my model is "identified" in SEM process?  I've already completed step 1 for model specification where I have created the path diagrams showing connections between observed and latent variables. I'm not sure how to do the second step, model identification.
Answer: Model identification is a pretty complex area.
The first thing to check is to count the degrees of freedom. Count parameters, count covariances (and mean)s. There should be fewer parameters than covariances (and means).
Then there are rules that you can learn - Bollen's book 'Testing structural equation models' covers them.
One problem is that there is model under-identification, and empirical under-identification. A model might be identified with one dataset, but not identified with a different dataset.
Here's a very simple example:
The simplest thing to do is to run the model. 99% of the time [wild guess there] the model will fail, with an error that says that the model is not identified.
The way to be sure that the model is identified is to rerun it with slightly different starting values. An identified model will always converge at the same place. A non-identified model won't.


Bottom point being at rest in pure rolling

Question: We know that,in rolling without slipping,the point of the disc of radius $r$ which is in contact with ground,has two velocities acting on it. One is the linear velocity of center of mass $v_{\mathrm{CM}}$. The other is the tangential velocity $\omega r$. The two act in the opposite direction and the condition for pure rolling is $v_{\mathrm{CM}}=\omega r$. But since this makes the bottom point at rest, then what causes that point to rotate again with the disc? Is it inertia or something like that which makes that bottom point in motion again? Which phenomenon is responsible for this?
Comment: I think that the external force (or torque )   at the center of mass  causes that point to rotate again with the disc
Answer:
But since this makes the bottom point at rest,then what causes that point to rotate again with the disc?

Even though it is instantaneously at rest there are still forces acting on it. There is it's weight, the contact force from the road, and the internal forces from the rest of the wheel. These forces combine to result in the observed acceleration.
Comment: @Not_Einstein the question wasn't about the motion of the wheel as a whole, it was about the motion of one point on the wheel. The internal forces do not cancel out on a single point on the wheel. They are internal to the wheel but external to the point
Comment: What do you mean by internal forces from the rest of the wheel and why not mention friction between the wheel and ground?
Comment: @Not_Einstein friction is part of the contact force that I did mention. Inside the wheel there are forces of each part of the wheel pushing and pulling on its neighboring pieces. These forces occur between different parts of the wheel and hence are internal to the wheel
Comment: But don't those internal forces cancel out and hence have no effect on the motion of the wheel?
Comment: @Dale the contact force is in this case constraint force ?
Comment: @Eli yes, it could be considered a constraint force


Break a single entry into an arbitrary number of pages?

Question: The documentation describes using separate fields to create pages for an entry. But how can I create pages arbitrarily? There are multiple reasons I don't want to create a separate field for each page. The Simple Pagination plugin looks like what I want, but it isn't available anymore.
Answer: I am not aware of either a built feature or an add-on that will let you break a long entry in to smaller chunks in a way that will let you spread these across several pages, but others might.
There are possibly ways that you could achieve this result within EE without an add-on, but they would be non-trivial solutions to implement.
I suspect it would be easier to do this within the page using javascript / css (i.e. send the whole entry to the page, and do the chunking of the entry into blocks in javascript, or simply use CSS to allow the text part to scroll on that window within its block etc.
HTH