Can I enter the USA as a tourist if I have been approved for a visa but don't have a visa stamp?

Question: My petition for an O-1 visa was approved whilst in the USA on another visa. I have not yet left the USA to return to my home country to get it put into my passport and do the interview etc.  I have a flight to a different country in Asia (not my home country), which would mean I would be returning to the USA without having stamped my new visa.  Can I enter the USA on a tourist visa for the sole purpose of changing onto a plane to my home country in order to activate my visa?  Or will I be refused entry to the USA as I have not activated my new visa yet?
Comment: If the visa has been approved, what is the interview you have to do?
Comment: @DJClayworth Because the petition had been approved but until the consular interview the stamping doesn't happen.
Comment: Can the visa be declined if the interview doesn't go well?
Comment: Yes, you can transit on a B-1 or B-2 visa.
Answer: Not sure exactly what you mean by activation. Assuming you have already received the visa, you simply need to leave the United States for at least 24 hours. Then you can come back in under the new visa.
Also, depending on your nationality, you may qualify for a transit visa waiver. See http://travel.state.gov/content/visas/english/other/transit.html for more information about that.


Is there a support methodology for UAT?

Question: For quality assurance engineeres supporting the UAT phase of the customer, is there any defined methodology to track support issues, communicate, define roles and responsibilities while communicating?
Comment: I'm 100% sure this was intended for the main site, not for the meta site. My concern is whether to migrate it there, or whether or not this is a fleshed out enough question to migrate.
Comment: Yes, it is. Should it be migrated?
Comment: I'll migrate it. I don't know enough about UAT methodologies to know what questions to ask, but I suspect those with more expertise than I will have followup questions to get you to expand this question to make it more answerable.
Answer: There is no defined methodology for UAT support as such. However you can follow what we do. We are an Agile Team following Scrum. One iteration is dedicated to UAT support and we have a different test strategy for UAT support defining the roles, responsibilities, risk mitigation and escalation path. We do have QA on call support for 24*7 for these two weeks and the client is billed accordingly.
In UAT support we support them with configurations, data setup and other issues. Hope this helps
Answer: Sure,
There is always a support methodology for everything, even for UAT. The only problem is that it is always context dependent. There is no one size fits all rule for such a thing. You have to identify the needs and requirements and develop a support methodology for UAT depending on the context of the SUT(system/software under test). For this you can take help from various stakeholders, specially the user/client, since they are the one's for whom you will be doing User Acceptance Test - UAT.
Answer: There is no absolute defined methodology to track issues, communicate, etc. But you can see some samples that suit for your needs.
As examples:

Issue Tracking: The very simple is by creating on a spreadsheet, just list one by one what's you need, and then review, review, and review again, until you satisfied. You can also ask someone who understand about what will be checks whether by technical or functionality.
Communication: I think your requirement is related between "Communicate" and "Define roles and responsibilities while communicating". So, just create a communication plan, put all needed roles, available PIC (can be person, division, etc). Then draw a flow that describe when there is an issue come so what they should do what you should do? You may put some hint such as balloon to describe a responsibilities and step number. Same as an issue tracking, just review, review, and review again (just manage your time to design, create, and review). It is good to draw on presentation form rather than a spreadsheet form.

Is there a support methodology for UAT?


What is the difference between engagement and promise?

Question: If I have a previous appointment, what can I say instead of appointment?
Previous engagement? Promise?
And I wonder exactly what they both mean.  (I thought they were similar.)
Answer: Besides the expression already discussed above, here are a few alternative expressions I tend to use in the situation:

I already have plans for the evening(or day)
I have prior committments for the afternoon

If you plan to use "promise" in a more informal manner, you could. But then you'd have to probably be more specific on what's keeping you occupied at the time.
For eg., I tend to say:

I would love to, but I already promised to run an errand for my mom
Ah - but I've promised my friend I'd volunteer for the charity event
on friday.

Hope this helps.
Comment: "I already have plans" means that you would rather follw those plans than accept the invitation, while "I have a previous engagement" means that you can't get out of your previous commitment, much though you'd love to accept this one (which may be a white lie).
Answer: Previous engagement is more correct. In this context, it refers to a specific time of promise: a promise to be at a particular place at a particular time.
Promise is a general commitment made by someone. You can promise not to eat someone else's lunch, for example, but you wouldn't refer to that kind of promise as previous engagement.
Answer: The definition given for promise from the NOAD is the following:

promise |ˈprɑməs|
  noun
  a declaration or assurance that one will do a particular thing or that guarantees that a particular thing will happen.
   - What happened to all those firm promises of support?
   - [with clause] He took my fax number with the promise that he would send me a drawing.
   - [with infinitive] I did not keep my promise to go home early.
  • the quality of potential excellence_: he showed great promise even as a junior officer.
  • [in singular] an indication that something specified is expected or likely to occur: the promise of peace.

For engagement the definition is:

engagement /ɪnˈgeɪdʒmənt/ /ɛnˈgeɪdʒmənt/
  noun
   1. a formal agreement to get married.
  • the duration of such an agreement: a good long engagement to give you time to be sure.
   2. an arrangement to do something or go somewhere at a fixed time: a dinner engagement.
  • a period of paid employment.
   3. the action of engaging or being engaged: Britain's continued engagement in open trading.
   4. a fight or battle between armed forces.

Promise is not the correct word to replace appointment (the fact you went to an appointment doesn't implicate you did a promise to go); engagement is a better choice, but who listens could understand you are using the meaning 1 or 3.


Is there any possibility of dissecting a microchip to get data from its internal memory?

Question: There are many devices that perform various cryptographic operations inside their microchips. One of their key feature is that the secret keys are stored inside of the hardware and never leave it. Since it is possible to reverse engineer a chip, I am wondering if it is also possible to get at the chip's internal memory as well to steal the data stored in it?
Comment: You might find these interesting: http://reverseengineering.stackexchange.com/q/128/187, http://reverseengineering.stackexchange.com/q/1698/187
Comment: The answer might depend on the chip you'd like to reverse engineer. If possible, could you specify the chip or family you'd like to know about?
Comment: @CamilStaps The question is purely theoretical at this point. The hardware that would be interesting to me has not been finalised yet. Later down the line I would be looking at Bitcoin hardware wallets and Mint Chip, but I don't think any hardware prototypes or specifications have been released for any of those.
Answer: In general yes that is possible. For example a guy called Christopher Tarnovsky managed to tap the inner data paths of a Trusted Platform Module. He used acid to remove the encapsulation, rust remover to get rid of some mesh and then managed to probe the circuit and intercept internal communications.
Obviously on such a small scale it is a non-trivial excercise, but there is no theoretical reason I'm aware of why you couldn't disconnect the address and data bus of an on-chip ROM for example and read back the contents once you have physical access to it.
Comment: Someone did it for the Gameboy too, related to an open-source/hardware gameboy recreation project. A search on hackaday might find it.
Answer: Nothing is 100% safe.
That being said, the time and effort needed to 'crack' a chip can range from trivial to exponentially beyond feasible.
I personally like how Microchip summarizes the matter at the beginning of their PIC and dsPIC datasheets (especially the last bullet point - emphasis mine)

Note the following details of the code protection feature on Microchip devices:
• Microchip products meet the specification contained in their particular Microchip Data Sheet.
• Microchip believes that its family of products is one of the most secure families of its kind on the market today, when used in the intended manner and under normal conditions.
• There are dishonest and possibly illegal methods used to breach the code protection feature. All of these methods, to our knowledge, require using the Microchip products in a manner outside the operating specifications contained in Microchip's Data Sheets. Most likely, the person doing so is engaged in theft of intellectual property.
• Microchip is willing to work with the customer who is concerned about the integrity of their code.
• Neither Microchip nor any other semiconductor manufacturer can guarantee the security of their code. Code protection does not mean that we are guaranteeing the product as "unbreakable."
Code protection is constantly evolving. We at Microchip are committed to continuously improving the code protection features of our products. Attempts to break Microchip's code protection feature may be a violation of the Digital Millennium Copyright Act. If such acts
  allow unauthorized access to your software or other copyrighted work, you may have a right to sue for relief under that Act.


Global Sections of the Identity Component of Neron model

Question: Let $A$ be an abelian variety over a number field $K$ and consider the Neron model $\mathcal{A}$ of $A$ over $X=Spec{\mathcal{O}_K}$. If $\mathcal{A}^0$ is the identity component of $\mathcal{A}$, then $\mathcal{A}^0$ is an open subgroup scheme of $\mathcal{A}$ that fits into a short exact sequence
$$0 \rightarrow \mathcal{A}^0 \rightarrow \mathcal{A} \rightarrow \Phi_A \rightarrow 0$$
over $X$. Considering these smooth group schemes as sheaves for the flat (fpqf) topology over $X$, the associated long exact sequence of flat cohomology groups begins
$$0\rightarrow\mathcal{A}^0(X)\rightarrow\mathcal{A}(X)\cong{A(K)}\rightarrow\Phi_A(X)\rightarrow\ldots$$
where the indicated isomorphism follows from the Neron mapping property. Now, we know that $A(K)$ is finitely generated i.e. it has a free part (copies of $\mathbb{Z}$) and a torsion part (which is finite). Since $A(K)/{\mathcal{A}^0(X)}$ is contained within $\Phi_A(X)$ (which is finite), it follows that the group $\mathcal{A}^0(X)$ of global sections of $\mathcal{A}^0$ must contain all of the free part of $A(K)$. My question is - is it possible in this general scenario to determine how much of the finite part of $A(K)$ is captured by $\mathcal{A}^0(X)$ or do we need additional information on $A$?
Answer: First, a remark: the free part of $A(K)$ is a quotient, not a sub, and so it is possible that a point of infinite order in $A(K)$ could have non-trivial image
in $\Phi_A(X)$.   Probably what you mean is that $\mathcal A^0(X)$ and $A(K)$ have the same
free rank.
Regarding torsion, my interpretation of your question is that you are asking
about the map $A(K)_{tors} \to \Phi_A(X)$, and are curious is to whether or not it
can have a kernel (so that some part of $A(K)_{tors}$ is contained
in $\mathcal A^0(X)$).
As far as I know, this varies a lot depending on the particular abelian variety,
but in particular cases it has been quite intensively studied.  For example, if $p$
is prime and $A =J_0(p)$ is the Jacobian of the modular curve $X_0(p)$, then Mazur showed
in his Eisenstein ideal paper showed that the map $A(\mathbb Q)_{tors} \to \Phi_A(
\mathrm{Spec}\ \mathbb Z)$ is an isomorphism.  I generalized this to subabelian varities
$A$ of $J_0(p)$ in my paper here.
For an example in some sense opposite to this, see this paper of Conrad, Edixhoven, and Stein,
in which they show that if $A = J_1(p)$ (again $p$ is prime), then
$\Phi_A(\mathrm{Spec}\ \mathbb Z)$ is trivial, so that $\mathcal A^0 = \mathcal A$.
Comment: Dear Saikat, Given the geographical location given in your profile, you probably know Amod Agashe's work.  But just in case, the discussion preceding the statement of Thm. 1.1 in [this paper](http://www.math.fsu.edu/~agashe/math/tor1.pdf) of his suggests that the answer to your question about torsion subgroups is *yes*.

Regards, Matthew --- P.S. I fixed the broken link.
Comment: Indeed, both have the same free rank. Thanks for the correction. I'm aware of Mazur's result (which I think he proves in the appendix of the Eisenstein ideal paper) as well as yours (the link to the second paper appears broken), but haven't gone over all the details of the proofs. Is it reasonable to expect that such isomorphisms might also hold for more general square-free conductors? Putting it differently, for abelian subvarieties $A$ of $J_0(N)$ where $N$ is square-free, can we expect the torsion subgroup of $A(\mathbb{Q})$ to be contained within the cuspidal subgroup of $J_0(N)$?
Comment: Thank you so very much for reminding me about Amod's paper. In fact, as I now recall, he did briefly discuss the contents of that paper with me about two years ago as a prospective research topic. However, I never got around to reading the paper and started working on visibility instead.
Answer: I will have to wait for a more reasonable hour to give a complete answer, but I believe this paper of mine -- joint with X. Xarles -- is relevant to your question.  Most of it works in the case of an abelian variety over a local field -- in this case we get fairly definitive results and you can see what's happening.  In the case of a global field, what one has is mostly the Szpiro Conjecture and its analogues.  See $\S 6$ of the paper for a (brief, breezy) discussion of such conjectures for abelian varieties over number fields.
Comment: Thanks for the paper and also for referring to the relevant section within it.


Does classical simple harmonic motion violate thermodynamics?

Question: If SHM allows for motion to occur forever, we can consider it perpetual motion, does this imply that the second law of thermodynamics is violated? Or does the presence of an external force act on the system? However, there should be still a loss of energy, causing, for example, a pendulum to stop moving eventually.
Answer:
However, there should be still a loss of energy, causing, for example, a pendulum to stop moving eventually.

The pendulum will stop moving eventually, if there is loss of energy (like friction). Hence real simple harmonic oscillators always damp out.
Idealized SHOs will continue in motion forever, but there is no prohibition against objects moving forever. For example, two objects can remain orbiting each other forever (neglective gravitational waves). The second law prohibits a perpetual motion of a different kind:

A perpetual motion machine of the second kind is a machine that spontaneously converts thermal energy into mechanical work. When the thermal energy is equivalent to the work done, this does not violate the law of conservation of energy. However, it does violate the more subtle second law of thermodynamics (see also entropy). The signature of a perpetual motion machine of the second kind is that there is only one heat reservoir involved, which is being spontaneously cooled without involving a transfer of heat to a cooler reservoir. This conversion of heat into useful work, without any side effect, is impossible, according to the second law of thermodynamics.
Comment: @user1007028 there is no law that stops 'perpetual motion' and if someone taught you that, they are wrong. The thing that is impossible is a machine that *produces work* indefinitely, since that violates energy conservation. Simple motion without producing work is not impossible.
Comment: I assume, this is a form of 'perpetual motion', is this not the case? Having motion that goes forever is not 'perpetual motion'?
Comment: @user1007028 it's perpetual motion, but perpetual motion is not prohibited by the second law.
Comment: Is there a law that stops this 'perpetual motion'? It's simply that we were taught that 'any device that undergoes perpetual motion breaks the rules of the first or second law, does it violate the first, or is it that in reality we cannot make a machine without violating either?
Comment: Even if there is no friction the pendulum will emit radiation right? But the thermal energy (related to random motion) that is taken out of the pendulum shouldn't affect its motion right? It would just make it colder.
Comment: @Anton yeah, but those are minor effects.
Answer: No, a simple harmonic oscillator does not violate any of the laws of thermodynamics. However, it does represent an idealized system with no dissipation that cannot be exactly realized in Nature.
First law. The total internal energy of an isolated system is conserved (assuming there is no work done on the system and no heat transfer).
This law is not violated since energy is conserved in simple harmonic motion (and we are assuming there is no work done or flow of heat).
Second law. The entropy of an isolated system never decreases.
The entropy of an oscillator undergoing simple harmonic motion does not decrease. The oscillator is in a single microstate, specified by the initial position and momentum. Therefore the entropy is always $0$ (the log of the number of microstates, since $\log 1 = 0$).
Third law. The entropy of a system approaches a constant value as the temperature approaches zero.
The harmonic oscillator's ground state is unique, therefore the entropy at zero temperature is $0$.
Comment: @user1007028 Essentially, yes. In more detail, what is forbidden by the laws of thermodynamics is a machine that returns to its original state after having performed nonzero work on its environment -- in other words, you can't have a machine that runs forever without any energy input and from which you can extract useful work. If you attach the oscillator to a system so that it does work, then the work done will extract energy from the oscillator, and the oscillator will lose energy and (if enough energy is extracted) come to a stop.
Comment: I was taught that any 'perpetual motion' machine must break these laws, is it simply because it is idealized, and to make any device in practice must break one of the laws?
Comment: I see, so perpetual motion itself does not break any laws, only perpetual motion machines that do work, but it is generally not possible in reality except in idealized systems or large orbits (even then the classical view is not realistic),
Comment: @user1007028 Yes, I agree with your conclusion. It's only possible for idealized systems. Even objects orbiting each other due to gravity will lose power to gravitational wave emission and inspiral.
Answer: Every harmonic oscillator is doomed to halt eventually. The force driving the oscillation, be it gravity, electromagnetism, or whatever force, involves radiation. Gravitational waves (gravitons) or EM radiation (photons) will take energy away. Two black holes orbiting will send out a considerable part of their energy into the universe which we can even detect here on Earth. Only in a stable, non radiating state, like of an electron around a proton, no radiation follows. But this ain't an oscillator, of course. The only true oscillator is the virtual field of particles. But then again, that's virtual...
Comment: This answer misses a central point of the question: The part about the second law of thermodynamics. Also I am not sure what "The only true oscillator is the virtual field of particles." is even supposed to mean.
Comment: A perfect periodically process doesnt exist precisy because o the fact its an non-reversible process. You can see which direction time goes by looking at it. The quantum vacuum doesnt have this feature. Its composed of perfect oscillators.
Answer: Thermodynamics applies to macroscopic systems, i.e., systems large enough to allow negligible fluctuations around the average values.
Moreover, although some concepts of thermodynamics can be applied to systems made by a small number of degrees of freedom, the fundamental concept of thermodynamic equilibrium requires some efficient mechanism to have a mixing dynamics. Integrable systems like one or more harmonic oscillators are not suitable for a thermodynamic description.
Comment: yeah, using these laws makes more sense with control volumes and heat engines etc, I was confused between *perpetual motion* and *perpetual motion machines* the latter would generally be macroscopic.


Efficiently check if removing an edge splits a strongly connected component

Question: I have a strongly connected component (SCC) of $n$ vertices. Let $n_1n_2$ be an edge between two vertices $n_1$ and $n_2$ in this SCC. Is there an efficient algorithm to check if removing the edge $n_1n_2$ splits the SCC into two SCCs or not? The graph I am using is a directed graph.
Answer: An arc is said to be a bridge if its removal increases the number of connected components of the graph. Further, an arc is a strong bridge if its removal increases the number of strongly connected components. In your case, you are likely interested in finding all strong bridges in a digraph.
A simple $O(n+m)$-time algorithm, where $n$ is the number of vertices and $m$ the number of arcs is given in [1] which identifies all strong bridges. Section 4 of the paper gives the algorithm.

[1] Italiano, Giuseppe F., Luigi Laura, and Federico Santaroni. "Finding strong bridges and strong articulation points in linear time." Theoretical Computer Science 447 (2012): 74-84.
Answer: Yes, there is a linear time algorithm.
After removing $e=(n_1,n_2)$ we run DFS twice as follow
First, run DFS from $n_1$ and check, $n_2$ reachable from $n_1$ or not.
Second, run DFS from $n_2$ and check whether $n_1$ reachable from $n_2$ or not.
If after running DFS twice, $n_1$ reachable from $n_2$ and $n_2$ reachable from $n_1$ we conclude that removing edge $e=(n_1,n_2)$ can't change our  SCC, but otherwise SCC changed and number of SCC has increased that you can compute SCC again from scratch in linear time. So the running time of DFS is linear and finding  SCC is linear, total time is $\mathcal{O}(E+V)$.
Comment: Note that this can be costly in practice if the goal is to identify all such arcs.
Comment: Yes, i know that it's costly, if we remove multiple edges, but the question is about one edge. On the other hand we can't do better than linear time in that problem.


How to remove or hide the BCC option in the SendEmail page layout?

Question: Requirement is to remove or hide the BCC option in the SendEmail (From) page layout. We don't want to allow users to click on the BCC option when sending an email from Salesforce.com.  There is a Process Builder that will update the personal email setting of AutoBCC field to false for specific user profiles, but it does not prevent the user from manually clicking on the BCC link and entering an email address manually. What can we do to remove the BCC action link that appears on the SendEmail From section of the email page layout?
Answer: The email quick action does allow change in layout of the action. Additionally, You can predefine the values of the fields in the action.
Just remove the BCC field from the layout action and you can restrict users from putting values in it.

Reference: -
Create Additional Email Actions in Lightning Experience


On iOS, why does setting a layer's sublayerTransform turn itself to act like CATranformLayer?

Question: It is known that the zPosition of the layers only determines which layer cover up which layer.  Whether it is a zPosition of 10 or 1000 won't affect its position.
That is, unless if we use CATransformLayer to contain those layers, then the zPosition of those layers will affect the layers' position.
However, the following code running in iOS 5.1.1 does make the zPosition alter the position of the layers... you can try it in a new Single View App, and add the following code to ViewController.m.  If the zPosition of layer2 is changed from 88 to 188, we can see that the layer moves accordingly.  So no CATransformLayer is in the code; why will it behave like that?  (Please quote Apple docs or any reference).
Also related is, if the line self.view.layer.sublayerTransform = transform3D; is changed to self.view.layer.transform = transform3D;  then the zPosition will have no effect on the position.  But according to the Apple docs, transform and sublayerTransform only differ in whether self is transformed or not:

Two layer properties specify transform matrices: transform and
  sublayerTransform. The matrix specified by the transform property is
  applied to the layer and its sublayers relative to the layer's
  anchorPoint. [...] The matrix specified by the
  sublayerTransform property is applied only to the layer's sublayers,
  rather than to the layer itself.

So it is strange that why changing that will cause self.view.layer to act like a CATransformLayer.
-(void) viewDidAppear:(BOOL)animated {

    CATransform3D transform3D = CATransform3DIdentity;

    transform3D.m34 = -1.0 / 1000;

    transform3D = CATransform3DRotate(transform3D, M_PI / 4, 0, 1, 0);

    self.view.layer.sublayerTransform = transform3D;

    CALayer *layer1 = [[CALayer alloc] init];
    layer1.zPosition = 33;
    layer1.frame = CGRectMake(100, 100, 100, 100);
    layer1.backgroundColor = [[UIColor orangeColor] CGColor];

    [self.view.layer addSublayer:layer1];

    CALayer *layer2 = [[CALayer alloc] init];
    layer2.zPosition = 88;
    layer2.frame = CGRectMake(100, 120, 100, 100);
    layer2.backgroundColor = [[UIColor yellowColor] CGColor];

    [self.view.layer addSublayer:layer2];

}

Answer: we can think the layer as a coordinate layer , when we make a layer transfrom3D, it coordinate become 3D,but its subLayer still show as 2D,but when set sublayer transfrom3D,the layer will make its all sublayer show as 3D.it is the same as the rotation


On recurring billing, is it possible to get declined payments back?

Question: In our system we use Automated Recurring Billing for our members. We check our users subscription status from Recurring Billing API. We check failed payments from Transaction Reporting API and it appears that some of the subscriptions status code return "active" from API even not charged. Let me give a scenario about it :
A user has an ARB monthly subscription which payment cycle is 14th of every month. User has been successfully charged for 3 months. But on 4th payment, we saw that the payment failed and response code from API is "this transaction has been declined". We think that credit card expiration info may be failed and user may update it. So we put the user in a grace period(two days) and let user update credit card information. If user updates credit card information in two days we call API to update subscription with new credit card info. Let's say this update subscription request is done on 16th of the current month. Can we get the payment which has passed on 14th ? Or has user been charged on 16th which update subscription request is sent and is ARB payment cycle changed from now on ? Or user will be charged on the next month and we can not get failed payment ?
I could not find any details about failed transactions payment flow when credit card info is updated. Thanks in advance.
Answer: A failed subscription payment won't be retried after you update the customer profile.  However, you can use the updated custer profile to make your own one-time payment.


Wins 7 Installation and Activation

Question: The product key on the sticker supplied by the manufacturer is for Windows 7 Home Premium 64-bit. Would a fresh installation if the Windows 7 Home Premium installation supplied not from the manufacturer but from Microsoft be activated if the key is provided from the manufacturer?
Comment: now that's anyone's guess :)
Comment: To clarify; are you asking if the OEM-key on the bottom of the laptop will activate a retail installation? If so, then no, as Molly says. Why can't you use the key included in the retail copy? ("from Microsoft")?
Answer:
Would a fresh installation if the
  Windows 7 Home Premium installation
  supplied not from the manufacturer but
  from Microsoft be activated if the key
  is provided from the manufacturer?

in a word, no
from Microsoft you will get retail and volume license builds, these cannot be activated with an OEM license.
Answer: This really depends.
Windows serial keys have come a long way since Windows XP where it was highly restricted.
I can confirm that the following will work with inputting a plain off the shelf OEM key. However, I am not 100% sure if it will work with a key from a large OEM (HP, Dell etc.)
All Windows 7 disks (any edition) are pretty much the same with a single file that locks it to the version which the disk says.
If you download the Windows Automated Installation Kit, you can build an answers file with your serial key inside it, You can put this on a USB stick and put it in before Windows PE (the installation environment) has loaded.
The settings on the USB stick will overwrite any other settings files, and you should be able to install any version, however, if you have an OEM key, you will only be able to activate if performing a fresh/full installation.
Comment: Microsoft is extremely touchy when it comes to Product Activation, you tamper with that stuff and you may end up with a 'stained' license and find yourself answering to some serious questions if you want to rectify the issue with a Microsoft representative.
Answer: Update: Maybe I have not made my question clear, but I used the sticker provided by my manufacturer Lenovo as the product key. It initiated me to do to the phone activation, and I twice confirmed that through that phone activation, windows 7 indeed activated into a genuine product.

Wins 7 Installation and Activation


Change the number of returned results in a taxonomy item list?

Question: Clicking a taxonomy term in a Node leads to a URL like taxonomy/term/7 with a list of nodes with that taxonomy term. However, my Drupal installation is only showing 3 nodes/page in that list. Is there a way to customize the number of results the default taxonomy term search shows?
Answer: The Views module has a default View for that page. If you enable it you can adjust it the way you want like you would normally do with Views.

Without Views: see comments.
Comment: Thanks! That works for me since I already had Views installed. I presume there's no way in core to do this? No template file for my theme I could create?
Comment: Without Views: the number of nodes to show is saved in a variable called "default_nodes_main", the default is 10. You could change the variable using code, drush, ... See [taxonomy_term_page](http://api.drupal.org/api/drupal/modules%21taxonomy%21taxonomy.pages.inc/function/taxonomy_term_page/7) for more info.
Answer: The root cause of your problem is because of a setting found here: admin/config/system/site-information. This is the admin page for setting 'site' information, such as the site name, email address, etc.
One of these settings is called 'Number of posts on the front page'. Changing this value changes not just the front page but ALL taxonomy term display pages.
This is why you were only seeing 3 posts. Using the Views option to override the default Drupal taxonomy term pages is a good option, but it does have some side effects. For example,
I'm not sure in D7, but in D6 I noticed that I lost the ability to filter terms on these pages when using the Views override. In D7, I lost the ability to display on the term page any fields including the term description associated with that taxonomy term.


Looking for an old short story about an ultra smart boy with an alien/robot babysitter

Question: I am looking for a short story about a young problematic ultra smart boy, with fighting parents, that gets a robot/alien babysitter/guardian.
Comment: When did you read this, was it a long story or short story in an anthology?
Comment: Your description is too skimpy. Please tell us ***everything*** you can remember about the story and the book you read it in. How old was the boy? 19 years? 2 years? How was he behaving badly? Was he running red lights, setting cats on fire, highlighting books, walking through doors marked "no admittance"? Was the story set on earth, in space, on another planet? Was the anthology in hard cover, trade paperback, or mass market paperback format? Was it a general anthology or did it have a theme, like "robot stories" or "bratty kid stories"? Did it have interior illustrations?
Comment: The description is rather short, I can think of a South Park episode that fit exactly this description. Care to elaborate ? Also welcome to Scifi&Fantasy SE.
Comment: yeah it was in an old anthology. I remember the boy was genetically modified to be very smart and pretty and was behaving badly - and his parents were forced to take on this creature, i also remember the creature taught the boy discipline and to pity his kind of narcissistic parents
Answer: Just looking at the title instantly gave me the answer because I remember reading it as a child.
It is Benjamin McFadden and the Robot Babysitter:

When Benjamin's parents go out and leave him in the care of his robot
  Babysitter, the mischievous boy becomes bored with its rigid ways and
  reprograms it for "fun." Things get quickly out of hand, and Benjamin
  is in for more "fun" than he can handle.
Comment: Outside of the robot babysitter, how does this match the OP's description? (1) Short story in an anthology? (2) The boy was genetically modified? (3) Fighting parents? (4) The babysitter (robot or alien) taught the boy discipline?
Comment: Mischievous boy? The robot tried to teach the boy it was better to go to bed and obey his parents, but Ben reprogrammed the robot because he was super smart.


Preserving formatting of Scales & Legends in Templates

Question: My QGIS templates don't seem to preserve the formatting of my scales or legends. Is there a way to save these so they don't have to be redone each time? (I'm doing a series of maps that will be the same scale and have the same legends.)
Thanks
TVZ
Answer: This happens here in 1.8. Print composer templates work as they should in the current Master (Ubuntu). N.
Comment: I'm sorry, nhopton, I need to have things spelled out. Are you saying that QGIS Version 1.8 is not the most current, or best? If so, how should I update mine?
Thanks.
Comment: The current development version of QGIS (1.9.x) is called 'Master'. If you wanted to, you could install this using OSGeo4W or from one of the links on the QGIS download page. But just at present there are problems with Master and some of its functions don't work properly. I have to use Master for its print composer, but I couldn't recommend it to anyone else as it stands today.
Answer: What i tend to do i create a different project for each client.
Create a new print composer.
Load from templates. (presume you have already made a template and all your text boxes will be the same).
Create new print composer for each map and simple copy and paste legend across to the next.
Before closing, open composer manager and rename each composer to what you want. you can then open and switch between each.
If you save project and dont close the composer window it will open again where you left it at the save.
So basically do templates and work from there.
Comment: Thanks Gerald. However, I must be missing something silly. I can't see how I copy or paste items in a print composer!
Comment: Sorry I should have said. Just Select it with the select tool (I will add the image above if i can) then use the keyboard shortcuts. For copy ctrl+c and for paste ctrl+v.


Forecasting of multiple related time series

Question: I would like to know if there are any methods to forecast multiple time series that are related ? I heard of LSTM but of what I can see it's more to forecast one time series and not several at the same time but I'm not sure. Any ideas are welcome, thanks :)
Answer: You could use vector autoregressive models to do this, please see the following resource: 11.2 Vector Autoregressive models VAR(p) models
This model is used for multivariate time series, and works by using each variable as a previous lag of itself as well as other variables.
In this regard, you could choose to model the multiple time series using statsmodels as per this example: statsmodels: Vector Autoregressions tsa.vector_ar
Comment: Thanks and sorry for the late reply but I'm definitely going to give it a try


How to use Bayes Theorem to solve following problem?

Question: The life insurance company issues standard and preferred policies.
Of all policyholders: 60% have standard policy and probability of 0.01 of dying next year.40% have preferred policy and probabilty of 0.08 of dying next year.A policyholder dies in the next year. What is the conditional probability that a deceased having a preferred policy?
I know this could be solved via Bayes Theorem, but I am completely confused where to plug all the number at. Thank you!
Answer: The Bayes Theorem states that:
$P(A|B)=\frac{P(B|A)*P(A)}{P(B)}$
Now for your case let's define $A$ as the event of a person having a preferred policy.
And let's define $B$ as the event of a person dying next year.
From the Bayes Theorem we have:
$P(A|B)=\frac{P(B|A)*P(A)}{P(B)}=\frac{0.08*0.4}{0.08*0.4+0.01*0.6}=\frac{32}{32+6}\simeq 0.84$
Here is a way(not the most mathematical perhaps) to think of it if it confuses you:
You have 1000 people.
600 of them have standard policy. 400 have preferred policy. The ones that are going to die next year are 600*0.01 from the ones with standard policy and 400*0.08 from the ones with preferred policy. So a total of $600*0.01+400*0.08$ people are going to die next year. So given that someone died, the probability of him/her being from the ones with preferred policy is
$\frac{400*0.08}{600*0.01+400*0.08}$
That is what the Bayes Theorem actually says here.
Answer: First define your events, and use them to express what you have been told and seek in symbols.
Let $S$ be the event of a (specified) policy holder having a standard polity, and $D$ the event of that policy holder dying.  You are given:
$$\begin{align}\mathsf P(S)&=0.60\\\mathsf P(D\mid S)&=0.01\\\mathsf P(S^\complement)&=0.49\\\mathsf P(D\mid S^\complement)&=0.08\end{align}$$
You seek $\mathsf P(S\mid D)$ and may now find it with the above using Bayes' Rule, and the Law of Total Probability.


What is the correct verb for 'driving' a ferry?

Question: The captain of a ferry appears to steer or drive it. What is the correct verb for this?
Answer: Captain is a verb; and pilot is a possibility too, although that has a specific meaning with regard to ships [a shipping pilot is usually someone who is locally skilled and will successfully negotiate hazards around a harbour].

captain
verb
  [with object]
  be the captain of (a ship, aircraft, or sports team):
     all the boats are captained by professional sailors
noun
  the person in command of a ship
pilot verb (pilots, piloting, piloted)
  [with object]
  be the pilot of (an aircraft or ship):
     he piloted the helicopter from Paris to Deauville
noun
  a person who operates the flying controls of an aircraft
[ODO]

A captain (as well as captaining) navigates (guides it over its route):

navigate verb
2 [with object] sail or travel over (a stretch of water or terrain), especially carefully or with difficulty:
     ships had been lost while navigating the narrows
     the drivers skilfully navigated a muddy course
    • [no object] (of a ship or boat) sail; proceed:
        [with adverbial of direction]:
        we sailed out while navigating around large icebergs
    • guide (a vessel or vehicle) over a specified route or terrain:
        she navigated the car safely through the traffic
[ODO]
Comment: A *ferrier* is the guy in command of a ferry, perhaps more commonly called a *ferryman* — who is not to be confused with a *farrier* (from Old French *ferrier*), who puts ***iron*** shoes on horses.
Comment: @tchrist Or with a *furrier*
Answer: In addition to the other answer's "captain", I would add "helm" to refer specifically to the person and act of operating the steering controls - a captain may be moving around the bridge for a better view, giving instructions to the helm.
Comment: If by a ferry the OP means mean something like a modern car ferry, then yes there are at least three roles: a captain who is responsible for the ship (in that sense the driver, if it crashes it's the captain's fault); (at least in complex waters) a pilot who is an expert in the sea of that area who may suggest to the captain "such-and-such a bearing" (and a captain is usually well to agree); and a helmsman who holds the wheel. If you mean an old chain ferry across a river or the ferry across the Styx, the guy is the ferryman.
Answer: While I agree with the other answers, there is nothing wrong with steering a ferry. At least, it sounds right to me and the Free Dictionary seems to agree with me (emphasis mine):

steer v. steered, steer·ing, steers v.tr.

To guide by means of a device such as a rudder, paddle, or wheel.
a. To direct the course of. See Synonyms at conduct. b. To maneuver (a person) into a place or course of action. See Synonyms at guide.
v.intr.
To guide a vessel or vehicle.
To follow or move in a set course.
To admit of being steered or guided: a craft that steers easily.

The word's etymology also supports nautical usage (emphasis mine):

steer (v.)
"guide the course of a vehicle," Old English steran (Mercian), stieran (West Saxon), from Proto-Germanic *steurijanan (cf. Old Norse
styra, Old Frisian stiora, Dutch sturen, Old High German stiuren,
German steuern "to steer," Gothic stiurjan "to establish, assert"),
related to *steuro "a rudder, a steering" (cf. Old English steor
"helm, rudder," German Steuer and first element in starboard), from
PIE *steu-ro- (cf. Greek stauros "stake, pole"), from root *sta- "to
stand" (see stet).
The notion is of a stiff, upright pillar or post used in steering.
Answer: There is more to driving a road vehicle than steering it and there is more to controlling a boat or ship than steering it too, it is also necessary, at least, to specify the speed and the forward or backward direction of travel.
In the case of a road vehicle or a powerboat where one person is in direct control of all aspects of the operation (speed, gears, direction, safety, compliance with regulations and so on) the term driver is used almost exclusively. British Waterski and Wakeboard certainly think that the people controlling their towing craft are drivers and the Royal Yachting Association also think that powerboat operators are drivers.
In the case of larger vessels such a ferries (which are large enough to be considered ships) the control is more devolved, there will be a helmsman (helmswoman?) who steers the vessel; there will be engineering crew who are responsible for the speed of the engines; there may be lookouts who are watching for other vessels and hazards; and there may also be crew members who are responsible for operating car deck doors, placing fenders and handling ropes when the vessel docks. All these functions are part of what a driver does but they are devolved to different people.
The captain or skipper of such a vessel must decide where the ship is to go, what speed she is to make and the direction of travel (forwards, backwards or even sideways if thrusters are employed) but will not, usually, be touching any of the controls directly. Thus the captain is commanding or possibly skippering the vessel but is not driving it.


Trouble with Texlipse and creating index

Question: I have my project configured in Texlipse to create an index and I am issuing the \printindex command towards the bottom of my root TEX file. I have my files organized in a tree structure as indicated in my question here. When the project builds, the IDX file is properly generated and contains the terms I have placed in the index. The tool places the file however not in the intermediate folder but in the same folder where my root TEX file resides. I could live with that but, unfortunately, no index appears in the compiled document. Is this possibly a bug in Texlipse or do I need to do something else in order to include the index in my output document?
Comment: Do you (or TeXlipse, automatically) run `makeindex` on the `.idx` file?
Comment: @TorbjørnT. I don't run it manually; I assume that TeXlipse is supposed to do that. It has an option for "Make Index Style File" in the project properties that I have set to "texfiles/makeidx.sty" which lives in my project but other than that I don't see any other makeindex options other than the path to the EXE which I have specified in my environment settings.
Comment: Well, I'm not familiar with TeXlipse, so I'm afraid I cannot help.
Comment: Does TeXlipse do the required multiple runs? If you are not sure, remove the index file, run it once to make sure it generated the index file, then leave all the auxiliary files, and rerun.
Answer: The makeindex problem in TeXlipse is well-known. I guess that it is a bug in TeXlipse.
I found a solution in my environment: Clean your project, here is important that no output.pdf file exits after that! Than build it again, for some unknown reasons now I have a index in my new pdf.
Another solution is to replace the pdflatex.exe in your build settings with an batch-script witch calls pdflatex - makeindex - pdflatex. There you can control witch files are used but of course it is not the right way to bypass TeXlipse here.
EDIT
I found another nice way to run additional programs during the build process in this
Question: https://tex.stackexchange.com/a/52549/11363
You can use it to run a makeindex manually for several conditions.
Comment: solution 1 does not work for me.  for solution 2, how do you replace pdflatex with a batch script in TeXlipse?
Comment: You can find the Texlipse Builder Settings in the Eclipse Prefereces. There you find a list of programs and can replace the "PdfLatex program" with the batch script by editing its program-path.
Answer: It's not clear where the .idx file is created. When xelatex is called with the option
xelatex -output-dir=./subdir file

then the .idx file is created inside subdir.
You should configure the call to MakeIndex to look for the file inside subdir:
makeindex -s mystyle.ist -o ./subdir/filename.ind -t ./subdir1/filename.ilg ./subdir/filename


Can't Mount CIFS Share in Ubuntu 17.04 32bit Server

Question: I can't seem to mount a share that worked just fine in Ubuntu 16.04 32bit Server, but I get a mount error(13): Permission denied error in Ubuntu 17.04 32Bit Server.  There are number of reasons why I can't downgrade back to 16.04, so that isn't an option.  Did something change in the cifs-utils package, or some change in the kernel that's preventing me from accessing this?  I'm out of ideas, and have searched relentlessly trying to find an answer.
I have my username=<username> and password=<password> in a .smbcredentials file, which worked in 16.04.  Then in /etc/fstab:
//<share_name>.net/Projects/BuildsArea /Volumes/Projects/BuildsArea cifs credentials=/home/admin/.smb/.smbcredentials,uid=1001,gid=1001,file_mode=0777,dir_mode=0777,_netdev,mand,nounix,noserverino 0 0

Where the share_name is just a host name to a fileshare that I've used previously.  Any ideas on what's going on here?  Running sudo mount -a -v just shows the permission error, and then spits out the mount.cifs kernel mount options.  I've tried every sec= option, as well as using vers=3.0, but I don't think either of those options are going to help.  If there is other information that would be helpful, just let me know.  I've also made sure that the .smbcredentials file has is owned by the admin user account.  Thanks in advance!
Answer: For anyone wondering, in my .smbcredentials file, I needed to have the domain=<domain_name> key as a separate key. Not sure why this is different in 17.04, maybe I'm missing something obvious?  Regardless, it works.


If I cancel a PS+ subscription, will I still have access to downloaded saves from the cloud?

Question: So, I borrowed a friend's PS4 in order to play an exclusive game and I loved it so much that I went out and bought my own PS4 so I could play the game more. I know you have to have a PlayStation Plus membership to transfer over save data, but I'm wondering if once I download that save data to my new PS4 if it will stay there if I cancel the PS+ subscription? I'm not very tech-savvy and I'm having trouble finding the answer to this question anywhere else.
Answer: Cancelling your PS+ subscription will not affect save files on your PS4 hard drive.
You don't need PS+ to transfer save data per say, you only need it to back up save data to the cloud.
You can transfer the data from your friends PS4 with a USB stick and you won't ever need to worry about PS+.
If you have already managed to get your save files from the cloud on to your PS4 hard drive they will not be affected by the PS+ subscription. (Other than no longer being periodically backed up to the cloud)
Also worth noting is that save files are tied to your PSN account so you will need use the same account that you played the game on originally otherwise the save files will not transfer. Hopefully you created your own account when you borrowed the PS4.


Quarterback conduct after a game

Question: It seems that at the end of every NFL game the two opposing QBs meet in the field, hug, and chat for a few minutes. My question is, has the league ordered or encouraged them to do this, or is it totally spontaneous each and every time?
Answer: Most sports have a tradition of opponents shaking hands or even hugging at the end of a competition, but the meeting between opposing quarterbacks usually seems to get more attention than the other 120+ people meeting on the field at the end of games. The quarterback is usually a captain of the team and the face of the franchise (as well as the highest paid player on the team most often), so we are naturally drawn to their interactions. To directly answer your question, the National Football League has no mandate for players meeting each other on the field after the game. This interaction is simply ingrained in the game and players from a young age.
This SB Nation Article from a few years ago gets into the tradition and how much attention is paid to when this interaction doesn't occur, but confirms it is permissible to skip it.

Quarterback conduct after a game


Story where father's books became reality

Question: I am trying to think of the title of a great fantasy novel I read in the 1980's. The plot is a little fuzzy - the adult son of a very famous and beloved author realizes that he has found the rather surreal town and characters his father created -- essentially that his father was such an incredible writer with such a vivid imagination that his books have become reality in this one place. I believe that the town was in the midwest somewhere. Some of the characters were rather odd - imagine Lewis Carroll with a darker bent. I believe he starts an affair with one of the townspeople, and things turn VERY dark when it's revealed the characters believe he has the power to keep creating and expanding his father's work, and they try to keep him in the town. The cover art features one or two bull terriers -- they are among the creations and I think they can talk? The novel ends with him back home, slightly crazy, waiting  to kill one of the creations who has followed him home and is about to turn the corner. The I think the title has the word "laughing" or "laughed" in it. I'd love to read this again and pass it on to my kids -- Please help!
Comment: Interesting - that (in general, at least) is part of the basic premise of the *UNWRITTEN* comic series. Except Dad's books are more along the lines of the Harry Potter books. And fictional characters from other works turn up as well. Actually, cross this with the Jasper Fforde "Thursday Next" novels....
Answer: I think it may be Land of Laughs by Jonathan Carroll.  Not a perfect match, but pretty good. The dating is about right, as is the "laughs".
From Wikipedia (https://en.wikipedia.org/wiki/The_Land_of_Laughs):

In a used book store, Thomas Abbey, an avid fan of Marshall France, a
  deceased writer of unique children's books, has a chance encounter
  with Saxony Gardner, another enthusiast of that reclusive man.
  Together, they set out to the fictitious town of Galen, Missouri, to
  meet Anna France, the writer's daughter, in order to obtain her
  permission to write Marshall France's biography. Prepared for
  rejection, they are warmly welcomed and settle into the community and
  their literary endeavor.
However, they find an uncanny resemblance between the town of Galen
  and its inhabitants, and the literary world of their idol. Figures
  from Marshall France's books are alive in Galen, and Thomas and Saxony
  begin to question if the books were patterned on Galen, or if the
  writer's magic created Galen. Equally disturbing is Thomas' role as
  biographer, who appears to create reality by his writing, and begins
  to question the motives of Anna and the inhabitants of Galen. Events
  reach a crisis point when Thomas' biography reaches the time of
  Marshall France's arrival in Galen.
Comment: Yes!!!  I can't believe you had the answer that fast! I clearly misremembered a lot of the plot details but you answered a question that's been nagging at me for a while. Thank you!


Why does Urchatz begin with a Vov?

Question: In the passover Haggadah (in the schedule) the only word that has a Vav is Urchatz. Why? And if its connected to Kadesh why is it listed after Kadesh since usually you wash before kedusha?
Comment: Note that there are numerous variations of this poem.
Comment: Because the meter requires two syllables, which precludes רחיצה, for example, which wouldn't rhyme with יחץ anyway.
Answer: Rav Yisroel Reisman writes,

In the deeper meaning of Kadeish Ur'chatz it seems to be an inverted
  expression. If we pride ourselves in the Seder of this evening then
  Kadeish would mean to make yourself holy and Ur'chatz would mean to
  wash yourself off of the Tumah that you have. If you want to clean
  something you first get rid of the dirt and then you apply the shine.
  It should be R'chatz V'Kadeish? We say Kadeish first and Rechitzah
  second. That is Seder.   People think that to reach levels of Kedusha
  that they must rid themselves of the Yeitzer Horas and get rid of all
  the things that drag them down. We say on Pesach, no, just jump into
  the Kedusha. Even if you feel unworthy and that the Yeitzer Hora is
  dragging you down, Kadeish just jump into the Kedushah. Why?   That is
  what happened on Pesach. Klal Yisrael still in the Mem Tes  Sharei
  Tumah just jumped into Kedushah. There was no big Teshuvah movement at
  the time. We see this from the Yam Suf where it is said Halalu Ovdei
  Avoda Zorah V'halalu Ovdei Avoda Zorah. We know that a Shifcha at
  the Yam Suf saw more of a prophecy than Yechezkel Ben Buzi. By
  Pesach we tell people do what your forefathers did, just jump into the
  Kedushah. After you jump into the Kedushah you can worry about
  Ur'chatz the getting rid of your Yeitzer Horas.

Rav Reisman seems to be saying the vav in Ur'chatz is connecting it directly with Kadesh. Specifically say Kadesh without getting rid of the things which can drag a person down. Then after jumping into the Kedusha (Kadesh) you can work through Ur'chatz.
Answer: Maybe it's alluding to the fact that the washing should take place immediately after kiddush so that there's no hefsek and it still qualifies as kiddush bmakom seudah.
(There is in any case a long period of time until the matzah is eaten, but it seems that the seder itself is not considered a hefsek in this regard. And perhaps this point was singled out as a potential hefsek because this is the point where many families do tend to take a break during the rest of the year).
Comment: During the rest of the year there's also a concern for makom seudah
Comment: @DoubleAA I didn't mean that the rest of the year it's okay to take a break, just that many unfortunately do. If there was a poem for the rest of the year, it would also call it "urchatz" according to this theory.

Why does Urchatz begin with a Vov?


Order of Finitely Generated Group of Prime Exponent

Question: Consider the finitely generated group $G=\langle g_1,g_2,...,g_n \rangle=\{g_1^{r_1}g_2^{r_2}...g_n^{r_n}\mid r_i\in\mathbb{Z}\}$. The exponent of $G$ is
$$\exp
G=\text{lcm}\left(\left|g_1^{1}g_2^{1}...g_n^{1}\right|,\left|g_1^{1}g_2^{1}...g_n^{2}\right|,...\right),$$
For some prime $p$, if $\exp G=p$, would $\left|g_1^{r_1}g_2^{r_2}...g_n^{r_n}\right|=p$ for all $r_i\in\mathbb{Z}\backslash\{0\}$ (excluding the identity $e$ with order $1$)? Also, what could be concluded about the order of $G$ (i.e. must $G$ be finite)?
Comment: See [here](https://math.stackexchange.com/a/145594/742). You'll need something like $g_{j_1}^{e_1}g_{j_2}^{e_2}\cdots g_{j_k}^{e_k}$, etc. Note also your explicit description of the set in the exponent of $G$ omits $g_1$, $g_2$, etc.
Comment: Since you are defining the exponent as the lcm, clearly the order of any element divides the exponent, in the case $p$. No, $G$ need not be finite: [Tarski monsters](https://en.wikipedia.org/wiki/Tarski_monster_group?wprov=sfti1) are $2$-generated infinite groups of exponent $p$.
Comment: PS: your description of $G$ is incorrect. For example, your description excludes $g_2g_1$, which is clearly an element of $G$. Unless you somehow forgot to tell us $G$ is supposed to be abelian.
Comment: @ArturoMagidin Thank you for your comments and reference to the Tarski monsters. I can see now that I have incorrectly assumed $G$ is abelian. What would be a correct definition for a nonabelian $G$? Also, is my definition of the exponent as the lcm of the orders of each element correct or are there alternatives?
Comment: If I remember correctly, Lang uses 'for some $S\subset G$, if $G$ is the intersection of all subgroups $H$ of $G$ containing $S$, then for all $s\in S$, $s$ is a generator of $G$ and $G$ is finitely generated if there exists a finite $S$.'
Answer: As noted in comments:

Your description of $\langle S\rangle$ is incomplete/incorrect. Because we are not assuming $G$ is abelian, you can't assume the generators will occur in order. So you want something like the set of all elements of the form
$$g_{j_1}^{e_1}g_{j_2}^{e_2}\cdots g_{j_k}^{e_k}$$
where $k\geq 0$, $j_i\in\{1,\ldots,n\}$ for all $i$, $1\leq i\leq k$, and $e_i\in\mathbb{Z}$.

Your description of the set of elements to take the least common multiple is also incorrect, as even in the abelian case it would be missing $g_1$, $g_2$, $g_1g_3$, etc.

There are conflicting definitions of "exponent of a group". Note that we say that an element $g$ is of "exponent $n$" to mean that $g^n=e$, not to mean that $n$ is the least positive integer for which $g^n=e$ (that's called the "order of $g$"). But "order of $G$" is the size of the underlying set. So some people say that $G$ is "of exponent $n$" to mean that $g^n=e$ for all $g\in G$ (so, every element is of exponent $n$), and others say that "the exponent of $G$ is $n$" to mean that $g^n=e$ for all $g\in G$, and $n$ is the least positive integer with this property. This coincides with the least common multiple definition you give, provided such least common multiple exists. In this case, some people also say "$G$ is of exponent $n$" (but in the first meaning one does not usually say "the exponent of $G$ is $n$" because the singular definite article would imply that it is unique).

If a  group $G$ is of exponent $n$ (in either definition), then for every $g\in G$ we necessarily have that $|g|$ divides $n$. In particular, if $G$ is of prime exponent $p$, then every non-identity element of $G$ must have order $p$.

Tarski monsters are an extreme example of finitely generated groups of exponent $p$ that are not finite. In fact, a Tarski monster is an infinite group that has the property that every nontrivial proper subgroup is of order $p$. They exist for every sufficiently large prime $p$. For $p=2$ and $p=3$ we know that a finitely generated group of exponent $p$ is necessarily finite. This is related to the Burnside problem.


What do scriptures say about transgenders?

Question: Are there any references to transgenders or transgenderism in any of the Hindu scriptures? Is it supportive, or is it against it? What do they say about their way of living?
Comment: FYI, Kinnara aren't transgenders if you're talking about them.
Comment: Scripture is not a book on biology or customs of any particular age.
Comment: @TheLittleNaruto sorry then.
Answer: Disclaimer.: My intention is not to hurt the sentiments of any community or gender. I am just proving what already mentioned in our scriptures. No hard feelings.
This answer is a reproduction of this deleted answer of mine after doing sone re-editing and fixing if some errors in it. Prd..
Transgenders are normally termed as Napunsak Linga in Sanskrit. Anyways, they are sometimes also called as Kinnars, in local language.
Mahabharata Udyoga parva chapter 188.:

"Duryodhana said, 'Tell me, O grandsire, how Sikhandin, O Ganga's son, having before been born a daughter, afterwards became a man, O foremost of warriors.' "Bhishma said, 'O great king, the eldest and beloved queen of king Drupada was, O monarch, childless (at first). During those years, king Drupada, O monarch, paid his adoration to the god Sankara for the sake of offspring, resolving in his mind to compass my destruction and practising the austerest of penances. And he begged Mahadeva, saying, 'Let a son, and not a daughter, be born unto me. I desire, O god, a son for revenging myself upon Bhishma.' Thereupon, that god of gods said unto him, 'Thou shalt have a child who will be a female and male. Desist, O king, it will not be otherwise.' Returning then to his capital, he addressed his wife, saying, 'O great goddess, great hath been the exertion made by me. Undergoing ascetic austerities, I paid my adorations to Siva, and I was told by Sambhu that my child becoming a daughter (first) would subsequently become a male person. And though I solicited him repeatedly, yet Siva said,--This is Destiny's decree. It will not be otherwise. That which is destined must take place!'

Some more examples of changing one's own genders are due to curse or changing forms, etc.

Arjuna becoming eunuch due to curse of Urvashi in his Agyatwaas as Brihannala.
Indra got yonis all over his body due to the curse of sage Gautama in Ahalya episode which were later turned Into eyes.
Lord Vishnu's Mohini form and later giving birth to Lord Ayappa.
Aruna changing into Aruni and giving birth to Sugreeva and Vali.
Narada becoming woman due to Maya and marrying a king and giving birth to his children.

Trans means in between and gender means Linga (Sign). So, by definition those who are neither male nor female properly are transgenders. Surgical implementations are new concept. So, here I am counting hermaphrodite or someone having Klinefilter syndrome. In India , in local language we call them kinnars, hizra, etc.
Linga Purana says that the avyakta (Pradhana Prakriti) which comprises this universe is the 'Linga' of Shiva. This is logically true because Shiva is beyond creation and he again manifests as the creation, but to denote him who is attributeless, what could be a more appropriate sign than his creation itself? Hence Linga Purana says – 'Pradhana (Prakriti)' is the linga (sign) through which Shiva is denoted. In other words, Shiva who is the attributeless Supreme Being is known by the Prakriti, hence Prakriti is his symbol (linga).

"The non-charecterized (i.e., one without a sign or linga) is the root of the charecterized (i.e., one with a sign or linga). The avyakta (manifest Prakriti) is the charecterized (linga), while Shiva is without sign (alinga), but the one with sign or linga (i.e., prakriti) is said to be related to Shiva".(Linga Purana 3:01).

8. Beyond the Avyaktam is Purusha, all-pervading and devoid of linga (indicative mark), whom knowing the mortal is freed and attains immortality. (Katha Up. Verse 2.3.8).

Shankara's Commentary.:

Com.—Beyond the Avyaktam is Purusha all-pervad-ing, being the cause of all akasa, etc., which is all-pervading. Devoid of linga ] that by which anything is reached (known) is linga such as intellect, etc. That does not exist in him; so he is devoid of linga. The meaning in effect is devoid of all the attributes of samsara. Him knowing, both from the preceptor and the sastras, the mortal, even during life, is freed from the knots of the heart, such as ignorance, etc., and even when the body falls, attains immortality. This clause is connected with the previous one thus. He is the Purusha beyond the Avyaktam, etc.

Now, a question arises is that, whether alinga = napungsak linga.?
Now, the answer as per my opinion is kinda No and Yes both. As, Alinga Symbolises Brahman and Napungsak Linga symbolises human. But, as Brahman is everything so even a Napungsak is also a Brahman.

O deities! Know that in this entire universe, there is none other than me (Shiva). I'm the non-dual one. I'm the ancient one. I'm the one who is eternal and I'm the non-eternal too, I'm the one who is blemishless (sinless). I'm the one called as Brahmanaspati. I'm all the directions. I'm savitri, I'm Gayatri. All these male, female and eunuchs also are me. I'm the Thrishtup, Jagati, Anushthup, Pankti chandas. I'm the one known through Vedas, I'm the truth, I'm peace, and I'm respect. I'm the lord of the universe, I'm the oldest, I'm the lord of all, I'm the Bhagawan (supreme personality of godhead), I'm the Lord, I'm the divine light. I'm the Itihasa, and Purana. I'm the Kalpa (eon), I'm the Upa-Kalpa (manvantara), I'm the one who create these Kalpas, I'm the knowledge, I'm in the hymns of Upanishads, I'm mantra, and I'm the Vyakhyana (commentary) also. I'm the sacrificial offerings, I'm the donor, I'm the donation, I'm Ihaloka (this material world where jiva takes birth), I'm Paraloka (world where Jiva goes after departure), I'm Akshara (imperishable) and I'm kshara (perishable) too, I'm all these creatures. Self-control, serenity, and secrecy are also me. I'm the one having faces everywhere. I'm the end, and middle, I'm the door, I'm outside, i'm inside, I'm the front and back as well. I'm the imperishable one. I'm light and also i'm darkness, I'm the Indriyas (organs) and the Tanmatras as well. I'm the mind, intellect and ego. I'm the Vishayas (subjects) also. I'm Brahma, I'm Vishnu, I'm Maheshwara, I'm Uma, I'm Skanda, I'm Vinayaka. I'm Indra, Agni and Yama also. I'm Nairuti, varuna and Vayo (anil). I'm Kubera, I'm the fourteen worlds. I'm the Sun, I'm the moon, I'm stars and planets as well, I'm all these creatures, I'm the Prana(soul), I'm the time, death, and eternity. I'm the past, present and future. I'm everything indeed! (Sri Shiv Gita 6.11-26).

In Rig Veda (10:5:7)., states Agni as an Androgynous Purusha.:

"aghnirha naḥ pra thamajā ṛtasya pūrva āyuni vṛṣabhaścadhenuḥ ",
"Agni, our first-born of Holy Order (rita), the Milch-cow and the Bull in life's beginning."

Again, In Mahabharata, though Napungsak are called as the creature who are not from these 3 worlds.

"Brahma has for his sign the lotus, Vishnu has for his the discus, Indra has for his sign the thunder-bolt. But the creatures of the world do not bear any of the signs that distinguish these deities. On the other hand, all creatures bear the signs that mark Mahadeva and his spouse. Hence, all creatures must be regarded as belonging to Maheswara. All creatures of the feminine sex, have sprung from Uma's nature as their cause, and hence it is they bear the mark of femininity that distinguishes Uma; while all creatures that are masculine, having sprung from Siva, bear the masculine mark that distinguishes Siva. That person who says that there is, in the three worlds with their mobile and immobile creatures, any other cause than the Supreme Lord, and that which is not marked with the mark of either Mahadeva or his spouse should be regarded as very wretched and should not be counted among the creatures of the universe. Every being with the mark of the masculine sex should be known to be of Isana, while every being with the mark of the feminine sex should be known to be of Uma. This universe of mobile and immobile creatures is pervaded by two kinds of forms (viz., male and female)". (MBH 13:14:231-233).

I hope this clarifies your queries. Prd..
in India, a kinnar, hizra, etc in local language it means transgender only. Plus, these kinnars also do singing and dancing in marriage ceremonies and child birth ceremonies, etc. The translation of the word 'Kinnar' is given by Google Translate as 'transgender.'

Additional Info.:
Kinnars are celestial beings fond of music and are kind of a hybrid beings. Different scriptures portrays them differently. Like half male-half female, half human-half bird or animal, etc.
I know, Wikipedia is not a good source material. But as the verse is said to be from Adi Parva of Mahabharata and also in block quote so it have to be authentic, i guess. So, i am citing the verse as it seems both beautiful and poetic in nature.
Mahabharata, Adi Parva.:

We are everlasting lover and beloved. We never separate. We are eternally husband and wife; never do we become mother and father. No offspring is seen in our lap. We are lover and beloved ever-embracing. In between us we do not permit any third creature demanding affection. Our life is a life of perpetual pleasures.

Conclusion.: It's a rough and unclear territory. Though Shikhandi was considered as a Man in the war but Bhishma considered her as Amba (female) only. So, it's a cliche. So, there's no real Conclusion to this question. The pronoun of that person varies from person to person. I guess.
I hope this helps. Prd..
Comment: Oop sorry I thought this was another post where I saw someone supporting it based on Budh will delete comment.
Comment: I don't think it does in these cases they didn't change gender by choice, but by force ie a curse, or for a purpose of duty. Vishnu didn't change gender willy nilly he had reason to. Also, Indra was more likely covered in the burn marks of a yoni versus actual yoni. It is a practice done for adulters.
Comment: And yoni can also mean womb or any place where life starts.
Comment: Yes, i know it's different from today's ideology. Those were curses, etc. No relationship with today's circumstances. People should understand this. Prakriti Purusha concept is not gender related. Prd..
Comment: It's ok. No issues.. ...


confusion about the angle between two vector in cross product.

Question: The magnitude of cross product is defined of vector A⃗ and B⃗ as |A⃗×B⃗|=|A⃗||B⃗|sinθ where θ is defined as the angle between the two vector and 0≤θ≤π.the domain of θ is defined 0≤θ≤π so that the value of sinθ remains positive and thus the value of the magnitude |A⃗||B⃗|sinθ also remain positive (magnitude cannot be negative). But if A⃗=1i^ and B⃗ =-j^ then the angle between these vector would be -π/2 but the magnitude of |A⃗×B⃗|=|A⃗||B⃗|sinθ where the domain of θ is defined 0≤θ≤π.how can this angle(-π/2) be incorporated in the formula so that the magnitude of cross product of these vectors could be found. In general, how can the θ whose value is π≤θ≤2π incorporated in the formula so that the magnitude of the cross product of the vectors can be calculated.
Comment: just take $\theta = \frac{π}{2}$. draw a diagram of the two vectors and you'll understand why.
Comment: The angle between  vector A⃗ and B⃗ can be θ=π/2 if we measure anti clockwise (From vector  B⃗  to A⃗  and θ=-π/2 if we measure the angle clockwise(from vector A⃗ to  B⃗ ).how can I say which angle to pick.
Answer: $\theta$ can be measured in either a clockwise or counterclockwise direction, and you want to take the positive value of the smaller of the two angles. Your $\theta=-\frac{\pi}{2}$ should be plugged into the formula as $\frac{\pi}{2}$. The difference will manifest itself in the direction of the normal vector, $\vec{n}$, which is the resultant of the cross product. The rule of thumb is: "counterclockwise up, clockwise down."


What are all the different Force-using organizations?

Question: So you have the Jedi and the Sith and those monks that guard the Kyber crystals, but what other organized groups of people are proficient in the Force?
Comment: But what do you want kyber crystals user or force users?
Answer: There used to be a lot more, but they're now mostly Legends. In Canon, we only have a few:

The Jedi (duh)

The Sith (ditto)

The Nightsisters of Dathomir. They were a group of all-female dark side users, who used spells, potions, and incantations to work with the Force. Asajj Ventress was a Nightsister in her youth, and Maul was the son of one of their leaders.

The Bendu (perhaps). Star Wars: Rebels introduced us to a character named Bendu, an ancient and enormous force-wielder who rejected the dichotomy of the Light Side and the Dark Side, and instead sought balance. Bendu always introduced himself as the Bendu, making it unclear whether this was a name or a title. In Legends,  there was an order of monks called the Dai Bendu, who had similar beliefs.

The Dagoyan Masters were very powerful Force users from the planet Bardotta who, like the Bendu, eschewed Light and Dark and sought to serve the whole of the Force. The Bardottan species were strong with the Force, but did not send younglings to the Jedi, instead keeping them to be trained as Dagoyan Masters. Early in their history the Jedi attempted to take Bardottan younglings, but...it did not end well.

The Force Priestesses were an unknown species or group or...something of mysterious Force-using entities who held the knowledge of how to preserve the consciousness after death. Whether they were physical entities at all is unclear. They lived on an unknown world called the Force Planet, or the Wellspring of Life, apparently the original homeworld of the midichlorians. They trained Qui-Gon Jinn and Yoda to preserve their consciousness after death as Force Ghosts, training that Yoda and Jinn passed on to Obi-Wan and, eventually, Anakin.

Whether the Force Priestesses were connected to the Whills is currently unknown.

The Church of the Force. We know little about these people, other than that Lor Sen Tekka was a member, and they had sacred villages. It has been said in supplemental material and comments by filmmakers that the Church of the Force consists of people who cannot use the Force, but still honour it.

The Guardians of the Whills, the monks who guarded the kyber crystals on Jedha, are not known to have been Force users. From what we know of them from Rogue One, they believed in the Force, they trusted and worshipped the Force, but they did not use the Force the way Jedi did.

The Knights of Ren are generally assumed to have been Force users who grew out of the chaos after the fall of the Sith in Return of the Jedi, but since the only one of their members we have seen is Kylo Ren we can't be certain that they were all Force users.

Other organisations are known to have existed that sought to follow or understand the Force in their own ways. The novelisation Rogue One gives us the following:

What is the Force of Others? to ask this, you must ask one question and a thousand.
To a cultist of the Huiyui-Tni, you must ask "what is the exhalation of the true, amphibious god?" To a Jedi, you must ask "What is it that binds and defines all life?" To a child of the Esoteric Pulsar, you must ask "Show me the secret pages of the Book of Stars".

To my knowledge, these are the groups that have been mentioned; there may well be others. It's clear that the New Canon is trying to expand our understanding of the Force into more than just Jedi and Sith, and to give us different perspectives on it.
Comment: Would you consider [the Ones](http://starwars.wikia.com/wiki/The_Ones) to be an "organization" until their deaths? They make a prominent appearance in *The Clone Wars* series.
Comment: @Ellesedil The Ones are debatable, but I'd generally fall on the side of 'not an organisation'. I see the Ones as more like forces of nature, beyond mortal concepts like 'organisation' - they couldn't control their natures any more than a star could stop fusing hydrogen by willpower. The Force Priestesses are on the upper end of what I'd consider an organisation, but they did seem to have roles separate from their individual identities.
Comment: I'm not really married to the idea of the Ones as an "organization" either. However, they did attempt to recruit a specific applicant into their fold that one time. Of course, it ended up leading to all of their deaths, but.... Anyway, just thought I'd toss that up for consideration.


How do I know if I'm able to use LPV minimums on a GPS approach?

Question: Many GPS approaches have lower descent minimums labeled LPV. How do I know if my aircraft is equipped to allow me to fly to those LPV minimums? And while we're at it, it would be good to know which minimums to use from the whole array of minimums found on GPS approaches.
Comment: Related questions [here](http://aviation.stackexchange.com/q/1087/62) and [here](http://aviation.stackexchange.com/q/14407/62)
Answer: There are many websites / blog pages that compare and contrast the different approaches. All you need to do is google a bit.
That said, if your plane can fly LPV approaches you'd know that. It requires WAAS-quality GPS receiver, and to install that requires at least a logbook entry.
Note that it's not only a matter of equipment. Even when the plane is equipped to fly LPV approaches, there can be certain conditions when you can't use LPV minimums (satellites, etc.) If you CAN use LPV minimums, the GPS unit MUST show you "LPV" in the annunciator window. It's possible that you're LPV-equipped, but your annunciator window shows you only "LNAV", for example.
So, check your documents, talk to your mechanic, you wouldn't really NOT know if your plane was ever upgraded for LPV approaches. If it's your own, you'd know and have discussed it and most likely given the mechanic the task to upgrade it. If it's a rental, or you're just buying it, look at the logs and ask the seller. And keep in mind, the annunciator window will show you the lowest GPS approach type that it senses is safe. Usually on an LPV-equipped plane that will be "LPV", but it's entirely possible it will only show "LNAV", or something else. For you to use LPV minimums also depends on the actual flight condition.
Answer: The previous answer nailed it on the regulatory/technical capacity to fly LPV, but then we have the operational capacity.
LPV approaches are the most stringent for SBAS/WAAS usage. They depend not only on having enough GPS satellites in view but also that those satellites have the top accuracy status (which is dynamic and depends on how many ground stations are seeing the satellite and if the satellite is operating in perfect health).
Its possible to do a predictive WAAS status prediction to find out if LPV accuracy should be available at your estimated time of arrival. Meaning if the GPS satellite constellation is expect to be good, excluding satellites which are bad or planned maintenance outages. But this doesn't assure something unexpected won't happen by the time you actually fly the approach.
LPVs can also be downrated from their published minima to 250DH minima if the geometry is good enough for 250DH but not for the actual DH (assuming of course the DH is lower than 250ft).
I suggest looking at the http://www.nstb.tc.faa.gov site. It's an official FAA site that has a realtime LPV200/LPV/VNAV plot (http://www.nstb.tc.faa.gov/RT_VerticalProtectionLevel.htm). This is what's going on right now. LPV200 is the full LPV down to 200DH if a approach allows (inside the yellow contour line). LPV is the downrated 250ft DH LPV (between the yellow and red contours).
We also have the daily (past) plot of:
http://www.nstb.tc.faa.gov/24Hr_WaasLPV200.htm - LPV200
http://www.nstb.tc.faa.gov/24Hr_WaasLPV.htm - LPV250
http://www.nstb.tc.faa.gov/24Hr_WaasLP.htm - LP
LPV is highly dependent on the iono correction grid. If there's a severe problem in the ionosphere, LPV200 and 250 could be disrupted. This is very rare and more likely up in Alaska.
For instance its normal to have outages in the California cost for a few minutes nearly every day. Its the result of instants when there are enough satellites in view, but the reference stations don't have enough satellites to properly calculate the iono grid for the nearby ocean (iono grids are used for the region where the signal travels through the ionosphere rather than for your ground location, which changes quite a bit for satellites closer to the horizon or even on a 45 degree angle).
In the future dual frequency and multi constellation SBAS will pretty much put this to end permanently. Instead of using only US GPS, Europe Galileo, Russian Glonass and others will be allowed, as well as having the receivers do the iono calculations by themselves using L1+L5 (GPS/Galileo) and L1+L3 (Glonass). This will require new receivers for most GA aircraft but is not expected to be mandated since LP/LPV already works extremely well. But it would enable LPV/LP in Hawaii, 100% of Alaska, as well as all of Central/South America.


How to bake chips in microwave using grill?

Question: Is it possible to prepare tortilla chips using the grill in a microwave? Can I bake anything for example, Indian version of samosa in a microwave using a grill rack? Here is a picture of a microwave with a grill rack:
Comment: Erm... tortilla chips are normally deep fried, which is not something you would do in a microwave.   There may be a language problem here.  What do you mean by grill?  Neither the US nor UK meaning of that term makes sense in the context of a microwave oven.  Can you try clarifying and rephrasing your question?
Comment: Grilling in a microwave is about equal to trying to get a tan at night. Like installing solar panels inside a dark cave. BTW, what did you mean when you said "I just saw while browsing" as a response to request for more information by SAJ14SAJ?
Answer: According to Consumer Reports, these microwaves typically have traditional heating elements in addition to microwave heat, or they're combo convection/microwave ovens. The rack is to move food closer to the grill element, or to allow better airflow for convection models.
In that case, you'd use the microwave like a small grill or convection oven rather than a traditional microwave - see the instruction guide for your make and model (typically available on the manufacturer's website.) In this way, you can prepare crispy items like oven-baked tortilla chips or samosas (I prefer oven-baked samosas over fried myself! Mmm.)
Answer: The microwave is actually a great tool for making chips of any sort, its ability to quickly dehydrate food is what makes this possible, here is an example of parsley chips:
http://www.youtube.com/watch?v=a8DkQeMxz3E
And here is Nathan Myhrvold making kale chips:
http://www.rachaelrayshow.com/recipe/12945_Nathan_Myhrvold_s_Microwave_Kale_Chips/index.html
The basic idea is to get a thin food that can quickly dry out, spray it with oil, and microwave it.
I have a very powerful microwave (1300W), so in my experience, the plastic wrap usually melts, but you can lower the power if that happens. You can use the grill in your microwave instead of the plastic wrap, the only purpose of the wrap is to make sure that the water in the food can steam out of it without getting trapped next to it.
You can also make puffed grains too, for those, you need to put parcooked grains that have been dried in the microwave, inside a paper back, and spray them with oil. I made crunchy chickpeas this way.


Generate State Diagram from VHDL Code?

Question: Is there a tool which generates State Diagrams from VHDL code? Also is there an easy way to indent VHDL code like in Visual Studio if I press ctrl + i it indents.
Comment: emacs has a "beautify VHDL" mode which is absolutely great.   key combo.
Comment: if you use Quartus and your code is written in a state machine template you go to RTL viewer, state machine.
Answer: Look into doxygen + graphviz to document your design. The graphviz / dot package lets you describe directed graphs (nodes + edges) which can be useful for drawing state diagrams. (If you're using verilog instead of VHDL, check out doxverilog.) I've recently started using this tool to document state machines in code I've inherited from another engineer.
However, I don't know of any tool to automatically reverse-engineer (recognize and extract) "state machine code" as distinct from just plain RTL code and localparams not meant to be a state machine. Even if you could reliably extract the possible states and their transitions, understanding what each state is intended to do still requires a human. So it's still up to you to understand the HDL code you're trying to document.
Answer: Both the (no-cost) Altera and Xilinx webpack tools will do state diagrams for you, so long as your HDL actually infers a state machine. They are an enormous download though, and not especially welcoming to the beginner.
For Altera, run "RTL Viewer" after the analysis phase and navigate the hierarchy down to the state machine.
The editors in both tools are poor - for smart indent I'd recommend a decent programmers editor. Sublime Text 2 has VHDL/Verilog plugins that might do it.

Generate State Diagram from VHDL Code?


How can authors choose a different display name?

Question: I am looking to add to the create user feature to allow or display a drop down and or a text field that would allow the user to create a custom display name to associate with the post he or she would be creating.
Answer: While this doesn't allow for someone to choose their name per post, it does allow for someone to have a username and a "realname" http://drupal.org/project/realname
You could also just add a text field to nodes where they can fill out any name they want. Then plug that field into your theme instead of the username.
Answer: I don't know of any module etc. that would create this functionality.
This doesn't mean that it can't be done.
One way of doing this, would be to add a field on nodes, where the user could enter the author name. If present, you could then change the default author name with the value entered by the user.


Commutator of two functions

Question: I want to compute the commutation relation between a function of momentum and a function of space in Quantum Mechanics. I know the commutation relation between momentum and a function of space but how can I compute the commutation relation between functions of momentum $p$ and space $x$? Some thing such as
$[f(x),g(p)]$
Answer: There are dozens of tricks to do this, but most of them reside in phase-space quantization, with which you are likely unfamiliar if you are asking this, so I'm staying out of it. Let's skip the hats for operators, set $\hbar=1$ for simplicity, non-dimensionalizing, and work in the coordinate representation, so, essentially, p is shorthand for $p=-i\partial_x$.
You are then seeking $[g(p),f(x)]$.You already said you have
$$
[p,f(x)]= -i f'(x),
$$
from which you may compute the following
$$
[p^2,f(x)]=p[p,f]+ [p,f]p \\ = -ipf'(x) -i f'(x) p = -f''(x)-2if'(x)p,
$$
and likewise for all monomials in p, whence all polynomials, by linearity of the commutator.
I assume you are familiar with the combinatoric tricks for monomials, which mathematicians like, but this is a bit barking up the wrong tree; most of them don't get their hands dirty in our messy world, nor have they any interest in that.
The  key point is to convince your self that, for a c-number y (not operator like p),
$$
[e^{iy p}, f(x)] = \bigl(f(x+y) -f(x)\bigr) e^{iyp},
$$
by virtue of the  fundamental Lagrange shift, with which you are familiar from the translation operator.
But every function g(p) is a linear combination of such exponentials, by virtue of its Fourier transform,
$$
g(p) = {1\over \sqrt{2\pi}}\int\!\! dy ~~e^{iyp} \tilde g(y)~~~~\leadsto \\
\tilde g(y)= {1\over \sqrt{2\pi}}\int\!\! dp ~~e^{-iyp}  g(p).
$$
Consequently
$$
[g(p),f(x)]= {1\over \sqrt{2\pi}}\int\!\! dy ~~ \tilde g(y)~~[e^{iyp},f(x)]\\= {1\over \sqrt{2\pi}}\int\!\! dy ~\bigl (f(x+y)-f(x)\bigr )~ \tilde g(y) e^{iyp},
$$
a numerical integral of functions in coordinate space when acting on a constant or translationally invariant state.
Comment: Can you swap the roles of $g$ and $f$ here and derive a similar expression involving an integral over $\tilde{f}(y)$ and $g(p + y) - g(p)$?  If so, and if these two expressions are equal up to sign, it might be an interesting statement about Fourier transforms.
Comment: Yes, mutatis mutandis: *x* and *p* are dual; they are canonical transforms of each other up to signs... same quantity proportional to $\int \!\!dk \tilde f(k) [e^{-k\partial_p},g(p)]=\int\!\! dk \tilde f(k) (g(p-k)-g(p))$...
Comment: @Michael Seifert.  ...but when acting on a constant only. when acting on states, they differ, in intriguing ways.
Comment: @modest Thanks. The obvious answer is java-tablet and spellchecker mismatches, and haste! I rarely *see* what renders: only how I imagine my TeXcode renders after decades of habit.
Answer: I don't think you can do it unless You are given what $f(x)$ and $g(p)$ are. If they are given you can use different properties for commutation relation and $[x,p]=i\hbar$ to compute what $[f(x),g(p)]$ will be.

Consider a simple example (More complicated function may not solve this way)
$$[x^2,p]=x[x,p]+[x,p]x=xi\hbar+i\hbar x=2i\hbar x$$
Further generalization can be found here.

Commutator of two functions


How do you custom-format the first word/character from an html-markup MySQL field?

Question: I did the following which works with simple text fields:
$field = "How are you doing?";
$arr = explode(' ',trim($field));
$first_word = $arr[0];
$balance = strstr("$field"," ");

It didn't work because the field contains html markup, perhaps an image, video, div, div, paragraph, etc and resulted in all text within the html getting mixed in with the text.
I could possibly use strip_tags to strip out the html then obtain first word and reformat it, but then I would have to figure out how to add the html back into the data. I'm wondering if there is a php or custom function ready made for this purpose.
Answer: You can use DOMDocument to parse the HTML, modify the contents, and save it back as HTML. Also, find the words is not always as simple as using space delimiters since not all languages delimit their words with spaces and not all words are necessarily delimited by spaces. For example: mother-in-law this could be viewed as one word or as 3 depending on how you define a word. Also, things like pancake do you consider this one word or two (pan and cake)? One simple solution is to use the IntlBreakIterator::createWordInstance class which implements the Unicode Standard for text segmentation A.K.A UAX #29.
Here's an example of how you might go about implementing this:
$html = <<<'HTML'

some sample text here

HTML;

/* Let's extend DOMDocument to include a walk method that can traverse the entire DOM tree */
class MyDOMDocument extends DOMDocument {
    public function walk(DOMNode $node, $skipParent = false) {
        if (!$skipParent) {
            yield $node;
        }
        if ($node->hasChildNodes()) {
            foreach ($node->childNodes as $n) {
                yield from $this->walk($n);
            }
        }
    }
}

$dom = new MyDOMDocument;
$dom->loadHTML($html, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD);

// Let's traverse the DOMTree to find the first text node
foreach ($dom->walk($dom->childNodes->item(0)) as $node) {
    if ($node->nodeName === "#text") {
        break;
    }
}

// Extract the first word from that text node
$iterator = IntlBreakIterator::createWordInstance();
$iterator->setText($node->nodeValue); // set the text in the word iterator
$it = $iterator->getPartsIterator(IntlPartsIterator::KEY_RIGHT);
foreach ($it as $offset => $word) {
    break;
}

// You can do whatever you want to $word here
$word .= "s"; // I'm going to append the letter s

// Replace the text node with the modification
$unmodifiedString = substr($node->nodeValue, $offset);
$modifiedString = $word . $unmodifiedString;
$oldNode = $node; // Keep a copy of the old node for reference
$node->nodeValue = $modifiedString;

// Replace the node back into the DOM tree
$node->parentNode->replaceChild($node, $oldNode);

// Save the HTML
$newHTML = $dom->saveHTML();

echo $newHTML;

Outputs

somes sample text here


How can I export SDL Tridion 2011 sp1 CMS search results to excel?

Question: How can I export SDL Tridion 2011 sp1 CMS search results to excel ?
Comment: Can you confirm your full requirement (e.g. is this a one-off, regular, static search) and what you've tried already (have you tried anything? have you read any articles that are/are not helpful - so we don't just have you try the same thing)?
Answer: your question is very vague, and you should provide some more details like what you want to save etc.
But, as a possible response, this looks like a core services job.
You can create a tridion custom page with a search box, and you can put a small web app behind that which performs a search using core services. An example of how to do this can be found here http://erichuiza.blogspot.be/2012/06/performing-search-queries-with-core.html)
The results of that search query is an xml document. Based on what you need, you can simply loop over these elements, and store the available data in a csv file (that excel can open). Additionally, if you need more information, you can loop over all returned items, open them individually, and get all the data you might need.
Note that this last option might take some time, if you have a lot of results.
Comment: I think it could be done with a GUI extension, using: $display.getView().properties.controls.list in your extension js,  to get the result elements and pass like a param to an aspx and finally export to excel using some .net library (there are a lot to do this).
Comment: Not exactly sure what is the use case for persisting into an excel, but you can also save the search query as a "virtual folder" in CME and then you be able to see what exists for that search query dynamically when you click to open the folder
Comment: Adding to what @Vipin states, as soon as you have a Virtual Folder, you can access that using the Core Service (like any other folder) and save its results (which is the search query results) into an Excel sheet in an application (or Custom Page for that matter).
Comment: Thanks Harald for your inputs, This is what I needed. I have one query here is it possible to extend the existing search functionality of tridion using GUI extensions to add a "Download Excel" button which will generate and download the excel containing the search results ?
Answer: We have implemented an Excel Export GUI extension.
The GUI extension exports all the contents of Organizational items (Folders, Virtual Folders, Structure Groups, Keywords).
It also Exports Search results and the items related to (tagged with) a keyword.
The information provided in the Excel is the same that the Tridion GUI uses (GetlistItems). In one hand, this makes it very fast and useful for all Tridion implementations; in the other hand, the information is limited.
Nevertheless, it has been very useful to us.


Using Video with QR code

Question: I want to set up a digital nature trail with a video of information at each post. The QR code on the post will reference the video. The QR code (URL) must be permanent but the video will change with the seasons. Can I do this using YouTube for the video and URL? If not can you suggest an alternative access solution? We are a small voluntary organisation so free is best!
Comment: Try to find a free URL redirection service that lets you change the target URL. You'll obviously need to register, but I think such services do exist. Or, similar to @rub%c3%a9n's suggestion, point the URL to a server you control and have it redirect to the appropriate video.
Answer: On Youtube each video has its own URL so it's not possible to use the same URL for different videos but you could embed a video on a web page and change the embedded video, so the web page URL will not change, only its content.
For general instructions on how to embed a video on a web page, see Embed videos & playlists. If you want to ask for a software recommendation consider to post a question on https://softwarerecs.stackexchange.com
Comment: I have embedded the video in our website but can't get it to use full screen thus making it small on a smartphone. I used BT Community Kit to build the site. I have also tried embedding the link into my Google Maps trail and then embedding the map in the website - that works but some people with iphones have trouble accessing the My Maps google link.
Answer: Have you considered including a link to a Playlist, instead of a specific video?  Like the other answer mentioned, you can't really change an existing video, but you can add/remove items with a playlist without the playlist URL changing.

Using Video with QR code