Good Quantum numbers in $L$-$S$ coupling

Question: I'm having a hard time understanding a few things about L-S and j-j coupling in 2 (or more) electron atoms. What I picked up from our lectures is the following:
The Hamiltonian can be "broken up" into 3 parts, a Central field part, a residual electrostatic part and a Spin-Orbit part:
$$\hat{H} = \hat{H}_{CF}+\Delta\hat{H}_{RE} + \Delta\hat{H}_{SO}$$
where we can treat $\Delta\hat{H}_{RE}$ and $\Delta\hat{H}_{SO}$ as small perturbations. Which of these terms has to be tackled first is decided by their relative size, so that $\Delta\hat{H}_{RE} > \Delta\hat{H}_{SO}$ leads to what we call the LS-coupling scheme, where we treat $\Delta\hat{H}_{RE}$ first, and $\Delta\hat{H}_{RE} < \Delta\hat{H}_{SO}$ gives us the jj-coupling scheme, where $\Delta\hat{H}_{SO}$ is treated first.
In the LS-coupling scheme we find that in order to diagonalise $\Delta\hat{H}_{RE}$ we have to pick a basis of eigenstates labeled by the quantum numbers $|L,M_L,S,M_S\rangle$ as these diagonalise the perturbation $\Delta\hat{H}_{RE}$. This then leads to energy shift, which depend on $L$ and $M$, $\Delta E_{RE} = \Delta E_{RE}\left(L,S\right)$, and the introduction of term symbols.
Now we treat the smaller perturbation $\Delta\hat{H}_{SO}$. According to our lectures the following is true:
$$\Delta\hat{H}_{SO} = \sum_i \beta_i \underline{\hat{l}}_i \cdot \underline{\hat{s}}_i$$
and also that:
$$ \langle \underline{\hat{l}}_i \cdot \underline{\hat{s}}_i \rangle \propto \langle \underline{\hat{L}}\cdot \underline{\hat{S}}\rangle = \frac{1}{2} \langle \hat{J}^2 - \hat{L}^2 - \hat{S}^2 \rangle $$
This seems to imply to me that, actually, the basis states of $|L,S,J,M_J \rangle$ would diagonalise both the Residual Electrostatic perturbation and also the Spin-Orbit interaction at the same time.
This must obviously be wrong as if it was possible to diagonalise both perturbations at the same time using the same set of eigenfunctions, there would be no need to distinguish between the two cases of L-S coupling and j-j coupling.
I'd greatly appreciate it, if someone could explain to me where I went to wrong, or was able to point me to some resources explaining this in more detail.
Answer: Spin-orbit coupling is not coupling the total $L$ and $S ,$ but rather it is coupling the (lowercase) $l$ and $s ;$ i.e. it couples the spin angular momentum and the orbital angular momentum of each electron individually, not the total $L$ and $S .$


What if the swift code is correct but wrong bank account number?

Question: I ended up paying to an account number which i am not sure is of the receipient. However other details like swift code and bank name etc were correct. The party hasn't received the payment. I should have gotten the payment back???
Comment: You say you aren't sure whether the account number was that of the intended recipient. Can you verify that one way or another?
Comment: Out of curiosity, how did you end up paying to an account number you are not sure of is the right one?
Answer: If the account number is not of beneficiary, but is a valid account number, it would get credited to someone else account.
If the account number was invalid, it would be returned. This takes few weeks at times.
Best is raise a query with your bank saying beneficiary is claiming non receipt of funds (BCNR). Your bank would investigate with beneficiary bank and confirm if transfer was made and give evidence or track the refund.


Retrieve and Deploy a workflow using ANT

Question: I am working on some customization for a CPQ product and I have created a workflow to populate some of the fields. I would like to deploy this workflow from the developer sandbox to our fullcopy sandbox using ANT. However, I am not seeing any example on how to retrieve and deploy a workflow using the ANT migration tool. The force.com migration tool guide says that workflow is a container which contains several elements like WorkflowTask, WorkflowRule etc, but no example.
Can some one help?
Answer: For adding things to a package.xml file, you need two pieces of information:

The metadata type name
The fully qualified name of the thing you're trying to retrieve/deploy

For finding the metadata type name, I find the metadata api types documentation to be a good resource.
The metadata type name is exactly what you use in between <name></name> in your package.xml file, and I believe it works for everything except the metadata types listed in unsupported metadata types. In this case, if you want to deploy an entire workflow, the metadata type name that you'd use is Workflow
Although the documentation only provides one example (which is rather unfortunate, I think), the general format that you'll use for including a workflow in a package.xml file is documented on the documentation for the Workflow metadata type

<types>
        <members>*</members>
        <name>Workflow</name>
  </types>

Finding the fully qualified name is a bit trickier. For some metadata items, like Apex Classes, it's simply the name of the thing you want to deploy. For others, like fields or validation rules on an object, you use the object name as a prefix. In rarer cases, like email templates and reports which can be organized into folders, you need to use the folder names and forward slashes much like you'd do if you were typing a url.
For workflow, the fully qualified name is the API name of the object the workflow is for. Adding this to a package.xml file would look like this:
<types>
    <members>Opportunity</members>
    <members>My_Custom_Object__c</members>
    <name>Workflow</name>
</types>

To me, this makes sense because the current structure of Salesforce's metadata includes workflow as part of the metadata for CustomObject (which contrary to its name encompasses both standard and custom sObjects). If you dive into the metadata that gets retrieved when you retrieve nothing but workflows, you'll notice that the folder structure you get is

working directory -> package name-> Objects > (list of objects that you're retrieving workflow for)

instead of

working directory -> package name -> Workflow -> (list of workflow that you're retrieving)

+edit:  after taking a second look, I don't believe the above is true for Workflow, it is true for other things like ValidationRule though. Workflow is tied to an sObject though, so using it as the fully qualified name still makes sense to me here.
As the documentation notes, the Workflow metadata type itself can contain other metadata types, and you can use these to deploy individual workflow rules (WorkflowRule), email alerts (WorkflowAlert), field updates (WorkflowFieldUpdate), etc...
The fully qualified name for individual parts of a workflow use the API name of the object the overall workflow is on, a dot (period/full-stop), and the API name of the workflow component that you want to retrieve/deploy.
An example is:
<types>
    <members>Opportunity.Update_Field_On_Condition</members>
    <name>WorkflowRule</name>
</types>
<types>
    <members>Opportunity.My_Workflow_Field_Update</members>
    <name>WorkflowFieldUpdate</name>
</types>

It should be noted that you may run into issues deploying individual parts of a workflow rule, because the order in which things does matter (the workflow needs to exist before you can add/change/remove rules, field updates etc...)
Comment: Somehow my retrieval of workflow rule like that didnt work. I'm wondering is it because my  parameter has space in workflow rule name like "Opportunity.Update Field On Condition"
Answer: Nice info..
FYI - The WorkflowRule member should be the rule's label not api/developer name. (and in urlEncoded format if any special characters)
<members>Opportunity.My Custom-Field %28Closed%29%</members>

Here is some sample apex to help generate the label w/ url encoding:
  string nm = 'My Custom-Field (Closed)';
  system.debug(EncodingUtil.urlEncode(nm, 'UTF-8').Replace('+',' '))

Result:
My Custom-Field %28Closed%29

Answer: It was not that difficult. All I had to do is to include the below snippet to do a retrieve.
<types>
    <members>CustomObject</members>
    <name>Workflow</name>
</types>

The above code snippet in the package.xml retrieved all the workflows of the CustomObject under the workflows folder. I did not change anything, but used the same package.xml to do the deploy and it worked. I guess if I have to do a selective deploy on a workflow of a custom object, I can edit the CustomObject.workflow file to get rid of the unwanted workflows and then do the deploy.
Hopefully this will work. Let me know if it doesn't.
Comment: Removing workflow rules from your object.workflow file (the ones that are unrelated to the current deployment) does not delete them from your org when you deploy - which was something I was wondering. I verified this in my sandbox.


Compatibility of monoid and comonoid structures when monoidal product is a product

Question: Let $\mathcal{C}$ be a category with finite products.  Then $\mathcal{C}$ is a braided monoidal category with the product as the monoidal product and terminal object as the monoidal unit, and braiding $\tau_{A,B}$ the unique isomorphism $A\times B \cong B\times A$ induced since both of sides are the product of $A$ and $B$.  For every object $A$ in $\mathcal{C}$, $A$ has the unique structure of a comonoid with comultiplication given by the diagonal map, $\Delta$, and counit the unique map to the terminal object. Now suppose $A$ is a monoidal object with multiplication $\mu$.  I'd like to show that the monoidal and comonoidal structures are compatible in the sense that $\Delta$ is a monoid morphism.  This is part of the justification for calling Hopf algebras "group objects" in braided monoidal categories.  I'm stuck trying to show that $\Delta\circ\mu = \mu\times\mu\circ(\text{id}\times\tau\times\text{id})\circ \Delta \times \Delta$.
Comment: By Yoneda Lemma (olr evalutation by representables) you can put $\mathcal{C}=Set$, now a monoid is a usual algebraic monoid, and is trivial see that $\Delta$ is a monoid morphism.
Answer: This has very little to do with monoidal categories and much more to do with the properties of the cartesian product (and, very specifically, $\Delta$). Observe:
$$\begin{split}
\Delta(\mu(x, y)) & = (\mu(x, y), \mu(x, y)) \\
& = (\mu \times \mu) (x, y, x, y) \\
& = ((\mu \times \mu) \circ (\textrm{id} \times \tau \times \textrm{id})) (x, x, y, y) \\
& = ((\mu \times \mu) \circ (\textrm{id} \times \tau \times \textrm{id}) \circ (\Delta \times \Delta)) (x, y)
\end{split}$$
You can interpret $x$ and $y$ as generalised elements $U \to A$.
Comment: Thank you for your answer.  I've never heard of generalized elements before.  Are you saying that we can use generalized elements to reduce the problem to a proof that the property holds in the category of sets with Cartesian product?  I tried looking online on Wikipedia and nLab, but so far haven't been able to understand how generalized elements work yet.  Is there a good reference for this?  Is it in Maclane?
Comment: -ish. Roughly speaking, what we are doing is taking the Yoneda representation of a category. Then a morphism $U \to A$ genuinely is an "element" – specifically an element of the representable presheaf $\textrm{Hom}(-, A)$. Mac Lane does a special kind of generalised element in Chapter VIII. Lawvere and Rosebrugh [_Sets for mathematics_] also discuss generalised elements a bit.


What's #pragma comment (lib, "lib/glut32.lib")?

Question: I saw the code on the top of a GLUT demo and I'm curious about its functionality.
Why would someone want to write a #pragma instead of just including the library?
Comment: See also: http://stackoverflow.com/questions/1685206/pragma-commentlib-xxx-lib-equivalent-under-linux
Answer: This pragma allows the library author to define library imports based on a range of criteria that can be analysed at compile-time. For instance, you can link against different libs, based on whether you want to link with:

multithreading on or off;
the shared or static version of the library in question;
the shared or static version of the standard runtime library;
the debug or release library;
the 32-bit or 64-bit library.

With the pragma form, all this can be decided via #ifdef preprocessor tests in one of the library's header files.
Answer: The #pragma is useful if you're distributing a library. Especially if you have different compiled .libs for different build settings (e.g. debug vs. release, multi-threaded C runtime vs. single-threaded, DLL vs. static library, etc). You can use #ifdefs in your code to select the correct .lib file, rather than requiring your users to set up their build environment to select the correct one.
It reduces support time because your users cannot choose the wrong .lib file.
Answer: It's an MSVC-specific pragma that means the named library will be automatically included at link time. The rest of your question about "just including the library" suggests that you're not appreciating the difference between headers and libraries: the header (GL/glut.h) describes what functions the compiler can expect at link time. The library (lib/glut32.lib) provides the implementation of these functions.
As the other answers have explained, it can be convenient, but I personally consider it a terrible idea to use this because it adds another barrier to writing portable code (other platforms and compilers may not support it). This question (thanks, @martin clayton) explains why it's not a good idea for portable code.
Comment: Is there no equivalent for other (popular) compilers?  Does GCC have anything similar?


Expansion file error, "Download failed because the resources could not be found."

Question: Basically:
For a few days we are trying to download an expansion file for our apk.
But it keeps saying "Download failed because the resources could not be found."
While debugging, we found that the responseCode in LicenseValidator.verify is ERROR_NOT_MARKET_MANAGED.
Is there anyone having the same problems?
Steps taken so far:

App added to Google Play's developer account in "draft". Also added 1 Expansion file.
Uploaded a couple of days ago.
Saved, not published.
main.1.our.package.name.obb created with Zip. Files are not compressed, just stored.
Also created obb file by using JOBB.
AndroidManifest.xml: versionCode=1, added all permissions from guide.
Copied license code from console to Service script (provided by android SDK)
fileSize is set in bytes (336467473L) appr. 328 MB.
Google play accounts on test devices are set to correct developer account.
Enough free space on devices. Restart hardware and software many times.
Time of devices are not in the future.
Cleared cache and local files of Google play App and Installed app.
Several ways of running and installing the apk file by:

Running apk directly from Eclipse.
Export and sign apk in Eclipse and install it manually on devices.
Use adb to install apk on device (signed and unsigned apk)

Signing is done by keytool.
Used zipalign to align the apk file.
Test devices are Galaxy Tab 10.1 (4.0.4), Galaxy Tabpro 10.1 (4.4.2)
Allow installation of apps from unknown sources is checked on device
Comment: Duplicate: [apk expansion issue- Download failed because the resources could not be found android](http://stackoverflow.com/q/23865804/456814).
Answer: Problem is fixt! After publishing an alpha release in Google play's developer console and waiting a few ours the download started...


grep list each file once

Question: I'm looking some text in files , but three are a lot of files and searched text appears several times in one file, how can I receive a list of files that contains searched text with every file listed only once?
Answer: grep -l xyz file*

where xyz is the search pattern , and file* is the list of files to be searched in
Answer: grep -l LIST PATTERN is the way to go. Alternatively one could use xargs to do the same thing:
xargs grep "My Search Pattern"  < input.txt

xargs is particularly useful when you  would want to use grep on several filenames passed from a pipe, for instance:
find ~/Documents ~/bin -print0 | xargs -0 grep 'Search Term'

grep list each file once


What is a bolo roast.

Question: I'm trying to make bultong (South African meat jerky) for a friend from there and he said I need bolo. What cut of meat would this be in America?
Answer: The information provided by both Paparazzi's answer and logophobe's comment is correct. The bolo is from the forequarter of the cow, specifically from the shoulder area.
I don't know of one single whole cut in the US that would encompass the whole bolo roast. However, we have three cuts that make up the three primary parts of the bolo roast.

Round bolo = mock tender roast
Shoulder bolo = shoulder roast
Side bolo = boneless blade roast

This picture shows it quite well. (Cropped to remove ads.)

And this picture shows the three pieces together as a whole bolo roast:
Answer: Bolo

The bolo (triceps muscle) is the muscle, which lies posterior to the
  shoulder joint and ventral to the spine of the scapula. The thick end
  of the bolo commencing at the meat inspection cut includes all muscles
  overlying the first natural muscle division and the thinner end
  includes all the muscles overlying the rear portion of the blade bone
  (scapula).
Comment: This is a tricky one because there doesn't appear to be a direct equivalent American beef cut. It's somewhere in-between (or overlapping) part of the bottom chuck and the flat brisket.

What is a bolo roast.


Subclass another application's control?

Question: Is it possible to subclass another application's control so that my application could do something before the other application executes it's code and receiving the lParam and wParam? Ex: subclassing notepad's Edit control and when the user types, being able to know what the user typed? would SetWindowSubclass work if I provide the hWnd of Notepad's edit control? And would I receive the lParam and wParam of all its messages?
Thanks
Answer: No, it's not that simple. The warning on the MSDN page for SetWindowSubclass says explicitly:

Warning You cannot use the subclassing helper functions to subclass a window across threads

This article outlines the process for injecting code into another process, but to summarise, you basically need to:

Use CreateRemoteThread and LoadLibrary, or
Set up the AppInit_DLLs registry key appropriately

Once you've got code running in the remote process, you can use SetWindowLongPtr to subclass the window and then use regular IPC techniques (named pipes, etc) to communicate with your process (if needed).
Answer: Yes, that is easily possible, if your code is running in the application's process. You can do that with a DLL. You would simply use GetWindowLongPtr with GWLP_WNDPROC to get the application's window function, and use SetWindowLongPtr to set your own. In your window function you check for the message that you would like to alter, and call the application's window function with the altered values. In case of any other message, you will have to call it straight. Use CallWindowProc to call the window funcion, because the default windows function is not a pointer.
Another way would be to use the CallWndProc hook function. Call SetWindowsHookEx with WH_CALLWNDPROC to have it installed. Haven't tried this one yet though, but you won't need to have to be in the process's space, IIRC.

Subclass another application's control?


Adjusting Craftsman Garage Door Motor Height Travel

Question: Just bought a new garage door opener and it opens about 6 inches short than what I want it to.  I read about adjusting the travel screws, but this model has no travel screws on it. The model number is 139.54930. What is the proper way to increase the height of the door?
Answer: Here's the manual. On page 29 it shows the following:

On page 30 it describes how to check and adjust the reversal mechanism. I suggest that you do so.
Comment: RTFM, always the best answer.
Answer: The instructions for this garage door opener are readily available online if you don't have a copy.  The adjustments are done electronically using the control panel on the opener.  See the instructions for detailed directions on how to do this.


How come air units cause two drones even if they're in the home base?

Question: In Alpha Centauri, with Social Engineering -5 Police states: two extra drones for each military unit away from territory. Why do I get two drones per air unit even if they're in the home base?
Answer: All offensive air units are considered out of territory no matter where they are. BUT this does not apply to defensive air units like interceptors (planes/choppers with the air superiority ability). See this article for more info: http://alphacentauri2.info/index.php?action=articles;sa=view;article=33
Answer: If I remember correctly, some unit types (apparently including air units) don't count as being home for the purposes of police duty. I cannot remember whether this applies to copters, but I seem to remember it applies to needle jets.
Comment: Sometimes, it applies to copters as well, but I haven't found a rule yet.


trouble passing data between tabs

Question: I am writing a program which passes data between tabs. Fill a UITextField in the 1st tab, select the 2nd tab and see it displayed.
The data to be passed is stored in a var in the 2nd tab in the viewWillDisappear method of the 1st view. It is retrieved in the viewWillAppear method of the 2nd View.
But there seems to be a race condition. In the debugger I see the viewWillAppear is invoked BEFORE viewWillDisappear. The sequence is: view2.viewWillAppear -> view1.viewWillDisappear.
Am I using the correct methods?
I am writing for iOS5 target in Xcode 4.2.1. This version no longer creates a MainWindo.xib, so I am bit confused as to how to wire the AppDelgate to the Tab Bar Controllers. Can anyone tell me how to access the TabBar Controllers in XCode 4.2.1. ?
I'm happy to clarify/provide code. Trying to keep this post brief.
Answer: You can check your tab bar implementation is it is custom. or as a workaround You can use  Singleton class (like in app delegate or your own custom Singleton. Set your value in Singleton retrieve in any class.

trouble passing data between tabs


Does lost mode goes into effect once iPhone is turned on

Question: My iPhone is lost/stolen and I didn't have a password on it, lost mode is on pending due to the phone being off and cell data is off as well being that I'm in another country. Will lost mode goes into effect once the phone goes on? Are they able to see all my pics and data being that it was not password protected?
Comment: Should just wipe phone immediately, they can't do much with an iCloud locked device. They are most likely going to turn off and erase phone before even looking at your pictures.
Answer: If the phone ever gets an internet connection again it will go into effect, yes.
However if your phone was stolen, you risk that the thief will wipe it and sell it off - probably as parts - and your lost mode setting will be for nothing.
As you have no pass code on the phone, they will be able to see all your pictures and data, yes.


Why is $\frac{1}{(1+x)} \approx 1-x$ for small x?

Question: As part of derivation in a book I'm reading, it is claimed that for small $x$,  $\frac{1}{(1+x)}$ is approximately equal to $1-x$. This is easy to very for specific small values of $x$.
How does one prove this?
Comment: How about looking at $1/(1+x)-(1-x)$?
Answer: Check out this general formula
$${1\over 1-x}=\sum_{i=0}^\infty x^i$$
(Think why we can neglect powers of x greater than or equals $2$)
Answer: $$\frac{1}{1+x}=\frac{1-x}{(1+x)(1-x)}=\frac{1-x}{1-x^2} \approx 1-x $$
$\big($ Since $x\to 0 \implies 1-x^2 \to 1 \big)$
Answer: Here is a short answer followed by a more considered one:
Certainly the two quantities are each slightly less than $1$ for small positive $x$ and slightly greater than $1$ when $x$ is negative but small. And $$\frac1{1+x}-(1-x)=\frac{x^2}{1+x} =\frac{x^2}{1+x}$$ which is much closer to $0$ than either of the two is to $1.$ So that is a result for a while range of $x$ and not just a specific value . In other words, if you can tell me that $|x| \lt 0.01$ then I can assure you that $\frac1{1+x}-(1-x) \lt 0.000102$ However $$\frac1{1+x}-(1-x+x^2)=\frac{-x^3}{1+x}$$ so if you can tell me that $|x| \lt 0.01$ then I can assure you that $-0.000001 \leq \frac1{1+x}-(1-x+x^2) \lt 0.00000102.$

But perhaps it is important to decide what it means to say that it is a very good approximation before proving that it is. After all, $\frac1{1+x} \sim 1$ is a pretty good approximation! It is better than any other constant approximation $c \neq 1$ in that $|\frac1{1+x}-1| \lt |\frac1{1+x}-c|$ for all small enough $x.$ In the same sense, $1-x$ beats any other linear approximation $ax+b.$ You can see that graphically by drawing the curve $y= \frac1{1+x}$ and the tangent line $y=1-x$ at $(0,1)$ (then imagine drawing any other straight line.) However proving it mathematically requires some manipulation of inequalities. As remarked by others, $1-x+x^2$ is the best quadratic approximation $ax^2+bx+c.$
A number of answers essentially say that $1$,$1-x$ and $1-x+x^2$ are the Taylor series (at $x=0$) of $f(x)=\frac1{1+x}$ truncated after $n=1,2,3$ terms and hence the best polynomial approximations of their degree. That is an accurate statement of a theorem which holds for any reasonably behaved function $f(x)$ but maybe not helpful in understanding this one particular approximation. In parricular, it assumes understanding of what is meant by best. A helpful detail is that each is the only polynomial of it's degree with error below $x^{n+1}$ for all small enough $x.$
Answer: 1/1+x is the Taylor's series solved by Newton
Expansion
1/1+x =  1 - x + x^2 - x^3.....
As x is a small number higher powers can be neglected and the equation reduces to 1-x.
Comment: It would be *really* helpful if you formatted your answer with [MathJax](https://math.meta.stackexchange.com/questions/5020/mathjax-basic-tutorial-and-quick-reference).
Answer: $$1-x+x^2-x^3+\cdots=\frac{1}{1+x}$$
For small $x$ you can neglect higher order terms on L.H.S
Answer: In what follows, I'll assume that $x$ is positive, but it's not hard to also deal with negative $x$ close to zero.
If $x$ is small, then so is $x^2$, and in fact so are all higher powers. To be more specific
Let
$$0 < x < 1$$
Then, multiplying by $x$ we get
$$0 < x^2 < x$$
Thus
$$0 < x^2 < x < 1$$
Similarly,
$$0 < x^3 < x^2 < x < 1$$
Etc.
Subtracting that inequality from 1 gives us
$$1-0 > 1-x^3 > 1-x^2 > 1-x > 1-1$$
Or
$$0 < 1-x < 1-x^2 < 1-x^3 < 1$$
So if $1 - x$ is close to 1 then $1 - x^2$ is even closer. Also note that  $1 + x^3$ is even closer to 1, although (for positive $x$) it's greater than 1. So we can extend that chain to
$$0 < 1-x < 1-x^2 < 1-x^3 < 1 < 1+x^3$$
Now simple algebra shows that
$$(1 + x)(1 - x) = 1 - x^2$$
and
$$(1 + x)(1 - x + x^2) = 1 + x^3$$
Let's combine that with our inequality chain
$$0 < 1 - x^2 < 1 < 1 + x^3$$
Dividing through by $1+x$ we get
$$0 < 1 - x < \frac1{1+x} < 1 - x + x^2$$
Thus $\frac1{1+x} \approx 1 - x$, and is, in fact, between $1 - x$ and $1 - x + x^2$.
Answer: Well it could also be taken as a limit where it can be proved that $ \lim_{x \to 0} \frac {1}{1+x} - 1-x = 0$
Comment: This just gives a 1st order approximation: the $-x$ part doesn't give any information since you let $x$ go to zero. The correct way to go is via Taylor approximation.


Cant handle CPU Max Clock!

Question: Hello Masters of Android! I am using Galaxy S5(SM-G906S)(Qualcomm SnapDragon 801). I have a problem. The problem is that I can't handle CPU Max Clock.. Available Max Clock is 2457Mhz but system always set to 1728Mhz.. It causes some lags... How can I Solve this.. I already did factory reset using Kies...
Comment: Your CPU governor used by kernel would most likely be the issue. Are you using stock or a custom kernel? If custom one, which kernel is it? What are you using to detect the clock speed? Have you used anything to change governor or clock speed? What is it? Actually, which governor is the device currently using? We can assume that the device is rooted, right?
Comment: @Fitelord Yes, I rooted. And I am using Stock Kernal. I am using Device Manager & Kernal Aduitor app to control Cpu clock... I donot know what is wrong..
Answer: Actually, even if you know that a kernel can allow you to overclock your CPU to a certain speed, there's a little file which consists of a frequency limit.
This file is to be found into /sys/kernel/cpufreq, and its name is hardlimit. Inside it, you'll find the maximum frequence, defined in Hz. For instance, and for your case as well, its content will be 1728000, which is equal to 1728MHz.
By using a root file editor, which usually integrates a text editor feature, you can edit this limit to the desired frequence (in your case, 2457000. Please notice that, even if you succeed in editing it, the file may be rewritten after a reboot. Given that, make sure to check if your kernel supports init.d, and, if yes, write a little script to change the file at boot.
Comment: It was just throttling

Cant handle CPU Max Clock!


Showing a portfolio is a self financing portfolio

Question: I'm having some trouble understanding how you are able to use Ito's lemma to show in the example I've attached it's equal to $d\pi = 2BdB$ because I can't collapse the $dt$ term I've attached the Ito's lemma I'm using and I can't grasp what is the $a(X,t)$ term or $b(X,t)$ term, any help will be much appreciated
Comment: Check your application of the Ito formula to compute $\mathrm{d}B_t^2$ again. You should get $\mathrm{d}B_t^2 = 2 B_t \mathrm{d}B_t + \mathrm{d}t$. Thus the $\mathrm{d}t$ cancels out in the differential of $\Pi_t$. I am voting to close this question for being too basic.
Answer: $$ d\Pi_t=d(B^2_t-t)=d(B^2_t)-dt=2B_tdB_t+dt-dt=2B_tdB_t $$
Your question is why?
Let $f(B_t, t) = B_t^2 -t=\Pi_t$, then Ito's Lemma tells us that:
$$ df = (\frac{\partial f}{\partial t}+\frac{1}{2}\frac{\partial^2f}{\partial x^2})dt + \frac{\partial f}{\partial x}dB_t=(-1+1)dt+2B_tdB_t. $$
Make more sense now?
Comment: Thank you for your help, I understand most of it now, however, I am just a bit confused on how d(B2t) = 2BtdBt+dt through ito's formula is it possible that you can expand on this part?
Comment: I've done so. You version of Ito's lemma get's short since a = 0 and b = 1. If you're happy with this, please accept answer.


php.ini display_errors not respected OS X Server

Question: I am running an 10.6.8 OS X Server. It acts as a web server using the built in PHP and Apache.
PHP is at 5.3.4
Apache is at 2.2.17
I am trying to disable the reporting or errors to end users with a server wide setting.
I have tried the following:
in PHP.ini
error_reporting = E_ALL & ~E_DEPRECATED
display_errors = Off
display_startup_errors = Off
log_errors = On
log_errors_max_len = 1024
ignore_repeated_errors = Off
ignore_repeated_source = Off
report_memleaks = On
track_errors = Off
html_errors = Off
error_log = /dir/php_errors.log

The display_errors = Off is not being respected. When calling a php file that requires a string to be passed with it I will get error such as:
Notice: Undefined index: username in ......

I am able to suppress the error by adding the following code to the top of the php file being called:
ini_set("display_errors" , "0")

I have also tried adding variables to various apache .conf and .htaccess .files with the following code:
php_value display_errors 0

Errors are being written to my specified log correctly. Using phpinfo() I see that I am using the correct php.ini file, and display_errors is showing off.
Any ideas?
Answer: First off using a phpinfo()... check the location of the php.ini file. It may be referencing a different one from the one you think it should be.
Comment: Using phpinfo() I see that I am using the correct php.ini file, and display_errors is showing off.


Is it ok if I use early callbacks with restore best weights?

Question: Does anyone know, if it is ok if I use early callbacks with restore best weights? The metric measured by the early callback is validation loss. I was afraid that if I restore the best weights of the NN when the val_loss is minimum, my model will somehow basically learn on the validation dataset. Is this a good practice?
Answer: This seems fine to me. Yes, you are using your validation dataset in the training process, but that is no different from using your validation dataset in other parts of the training process, such as hyper-parameter tuning or early stopping. This is one of the reasons to use a validation dataset and so isn't a problem - assuming you also have a separate test dataset, which you only use to evaluate the final model.
Answer: This is exactly what validation does. You do not panic when choosing a model with the best val_loss that your choice affects the performance of the model, right? Stopping early just does what you should have done earlier on your own.
Answer: Yes, it is a common and good practice to use early stopping callbacks with restore best weights. This approach helps to prevent overfitting on the training data.
When you use early stopping, the training process is halted once the model's performance on the validation set stops improving for a specified number of epochs (the "patience"). This helps to ensure that the model doesn't overfit to the training data by continuing to learn noise or non-generalizable patterns.
The "restore best weights" option means that the model's weights are rolled back to the state where it had the best performance on the validation set. This is typically what you want, as these weights have so far provided the best generalization performance.
This doesn't mean that your model is learning from the validation set in the same way it learns from the training set. The validation set is only used to monitor the model's performance on unseen data and to make decisions about when to stop training and which weights to keep. The model's parameters are not updated based on the validation set during the training process.
Answer: take a look here: https://medium.com/@doleron/never-use-restore-best-weights-true-with-earlystopping-754ba5f9b0c6
it is not so good to restore best weights.


10MHz reference vs 1 PPS vs GPSDO

Question: In the context of Software defined radios (SDRs), what are the differences between using an external 10MHz reference versus using a GPSDO? Why/when would you use one over the other? And how does the 1PPS relate to all this? Is the 1PPS only used for system time? What happens if you don't use a 1PPS?
Answer: A GPSDO is a way of providing a 10MHz reference. A GPSDO can be an external device, but some SDR devices are also able to "host" a GPSDO so that you don't need an external unit in its own box with its own power and its own cable for the 10MHz; you just buy the GPSDO option, plug a GPS antenna into the port for it, and go. Other sources of 10MHz are available, of course, and if you have one of those you might prefer the simplicity of an external reference input.
PPS is another signal commonly available from GPSDOs and similar devices. Yes, it's usually synchronized to top-of-second, which means that it's useful for deriving time as well as frequency. In some radio applications that's not needed at all, but some systems (such as LTE) require participants to have good absolute time, and 10MHz won't give you that.
In theory 1PPS will give you frequency as well as time, but disciplining frequency from 1PPS is much slower (and much more demanding of oscillator stability) than using 10MHz, so if you have 10MHz available you will almost always use that, and if you need time and frequency you will use both.
Comment: Not just "usually synchronized" -- it is **by definition** top-of-second. It is used both for timekeeping and precision navigation, as described [here](https://electronics.stackexchange.com/a/325933/11683).
Comment: @DaveTweed Unless the device has been told to introduce an offset, subject to the *precision* of the device firmware, and subject to the *accuracy* of the constellation's idea of UTC. All else being equal, I've observed stable discrepancies of the order of 10 nSec between the American, European and Russian systems, of of the order of 100 nSec between those and the Chinese system.
Comment: @MarkMorganLloyd: The offset is used to compensate for antenna cable length, and the rest reflects the current state of the art accuracy of the various systems. None of which negates what I said.
Comment: @DaveTweed PPS at top of second is conventional, and required for a bunch of industrial applications, but it may be configured differently. And consider a receiver where the timepulse and/or the nav rate can be configured for rates other than 1Hz. Modern uBlox has separate messages `NAV-TIMEGPS` (for exact specification of nav TOV) and `TIM-TP` (for exact specification of the next "PPS" pulse).

10MHz reference vs 1 PPS vs GPSDO


Is チョンボ commonly used to mean mistake (outside of conversations about 麻雀), even by people who don't play it?

Question: I heard someone say チョンボを犯した in a situation where they could not possibly be talking about 麻雀. I don't know if he plays 麻雀 or not, but it made me wonder, how common is using チョンボ to mean mistake among people who don't play 麻雀?
Comment: This can be a very touchy subject...
Comment: Why would that be?
Comment: 「ぼ」を抜けた時の差別用語のためですか?
Comment: Probably, because it depends on the person. People who like 麻雀 may use it, but people who don't know 麻雀 may not know it.
Comment: That wouldn't warrant calling it a touchy subject...
Answer: Yes, チョンボ can be used in non-mahjong situations. As you know, it is originally a mahjong term, but its meaning of "making a mistake" has been carried over to everyday usage. It is even in dictionaries.
As for how common, I don't hear it all too often, but enough for me not to automatically assume it's about mahjong just by hearing it.
Note that there are many mahjong terms that have made it into everyday use. テンパる、メンツ、リーチ、安牌、ワンチャン are ones I still hear used a lot.
Comment: Outside of the Mahjong world, I don't hear/see it used nearly as often as I did in the 80's.  In fact, I rarely hear/see it used in public nowadays.
Comment: ^ そうですね、私も、「チョンボ」って、年配のかたが使ってるのしか聞いたことないです。最初は意味が分からなかった。。
Comment: Well, I feel old now. It is true I only really hear it from my mahjong buddies... The other mahjong terms feel more common, but then again, my experience is skewed since I still play it.


How to delete a group, of which I am not an owner, in a subsite

Question: I have created a subsite in my site and then the owners group for that subsite. I was a member of that group and I believe the owner was set to the group itself. Then I deleted myself from the group, so now I am not an owner any more. Is there a way to delete this group via UI?
Answer: The only way to delete it from the UI is if you are a site collection administrator or get yourself put back into the Owner group that was managing that group.


How are solar oscillations detected?

Question: While reading through a page on beginner Helioseismology, I occasionally came across the terms p-modes or g-modes, which I know are caused by pressure and gravity.
I wanted to know how do satellites used to study the sun detect these solar oscillations.
Answer: This field of study is called helioseismology.  Solar oscillations can readily be detected using special telescopes on earth, or by instruments in satellites. Here is how.
Solar oscillations manifest themselves as zones of the sun's photosphere (what we think of as the "visible surface" of the sun) which bulge up and sink down like waves in the ocean. A zone which is rising up towards the earth along our line-of-sight to it has a positive component of velocity along that line of sight and a zone which is sinking inwards is moving away from us and has a negative velocity component.
You can deduce those velocities by measuring the doppler shifts created by those line-of-sight velocity variations within those moving zones as functions of position all across the "surface" of the sun. Those doppler shifts are detected with special lens systems and optical sensors, and the raw data is then subjected to processing on powerful computers. the result is then a global map, tracked minute by minute, of all those rising and falling zones.

How are solar oscillations detected?


Fungus in a cavern/cellar

Question: "B" movie from '50s or '60s: House with a cellar connected to cavern.  There's a fungus that turns people into monsters if they touch it.  Several people have been "eaten" or "absorbed" by the fungus.
Answer: "The Unknown Terror" (1957)?
Here is a plot summary from IMDb.

A woman leads an expedition into a remote jungle to find her long-lost
  brother, but instead finds a mad scientist who has created a fungus
  monster that feeds on the local inhabitants.

Here is the complete movie from YouTube.

Fungus in a cavern/cellar


fuzzy c means in matlab

Question: I am clustering some data in matlab using the builtin fuzzy c means algorithm which returns C the cluster centers, U fuzzy partition matrix. So I know what the cluster centers are from C but how can I figure out which cluster center each data point belongs to? using the fuzzy partition matrix or some other way?
Answer: I know it is a very old question but someone else might find helpful if I give the answer.
The following example is from the Matlab help. There are 2 clusters in the example.
index1 is the indices of the data point that belong to the cluster 1, and index2 is similar. So, using this info what you need is easily obtained.

<code>data = rand(100, 2);
[center,U,obj_fcn] = fcm(data, 2);
plot(data(:,1), data(:,2),'o');
maxU = max(U);
index1 = find(U(1,:) == maxU);
index2 = find(U(2, :) == maxU);
line(data(index1,1),data(index1, 2),'linestyle','none',...
     'marker','*','color','g');
line(data(index2,1),data(index2, 2),'linestyle','none',...
     'marker', '*','color','r');
</code>

fuzzy c means in matlab


Setting Firefox hot keys to be like in Windows

Question: I have been using Firefox for years on Windows and I do a lot with keyboard. For example, Ctrl-Y shows the downloads. And now on Ubuntu all this is broken. I need an easy way to set Windows-Firefox keyboard shortcuts for Ubuntu-Firefox.
Comment: I hate it when it comes to this silly fight about shortcuts on the SAME application.
Microsoft translates shortcuts (e.g. bold = ctrl + b in italian is grassetto = ctrl + g): that's just crazy.
Answer: There is a KeyConfig extension. it seems to be the least painful way to assign shortcut keys.
See this page: Change Firefox Keyboard Shortcuts

Although it does not contain preconfigured bindings for Windows.
Answer: Apart from the KeyConfig extension, there is an extension that is available on the Ubuntu extensions website and needs no Firefox restart: Customizable Shortcuts. It adds a shortcuts-tab in the preferences dialog and presents shortcuts grouped on theme.
Check the Mozilla Support support website for the shortcuts as used on Windows.
Answer: Use the keyconfig plugin. You can install it here.
Press Ctrl+Shift+F12 to bring up the dialog and set new keyboard shortcuts.
Answer: First of all the shortcuts for firefox in ubuntu an d windows are a lot different (*example for downloads in ubuntu the shortcut is ctrl+shift+y)
you should refer for documentation in ubuntu firefox help menu or use internet resources
Comment: I need a quick way to make keyboard shortcuts in Ubuntu-Firefox to be the same as in Windows-Firefox. If I was unclear in my post, please correct me
Comment: visit this link it may help http://support.mozilla.com/en-US/kb/Keyboard%20shortcuts?s=customize+shortcut&r=0&as=s(I was not able to find how to make custom shortcut)


Get request host in PHP

Question: I'm developing a website by Zend.
Some people create a html file imitate my login view. Action in form point to my controller to submit.
I don't other login outsite from my websites. So how can I prevent other domains submit form to my controller?
I tried to get request host name of "requester pages" to compare theirs domain with mine, then return error if user login from other sites.
Answer: Check the ZF manual for CSRF protection, which is the standard, built-in way to solve this problem.
Answer:
you could check the refferer if it is in your domain (or empty)
add a hidden input field an generate a token on every display. if the token is wrong, don't continue and redirect them to your login page.
Be sure that every token can only used once, by one user (same session/ip) and only for e.g. 1 hour

EDIT: see https://www.owasp.org/index.php/Cross-Site_Request_Forgery_%28CSRF%29_Prevention_Cheat_Sheet
Answer: there would be easiest way to prevent out side users to login into your site

user zend captcha to generate every time new code to login session

you can use below link as reference to use in login page
http://mnshankar.wordpress.com/2010/06/01/zend-form-element-captcha/

Get request host in PHP


Why do md5 and sha-* only use alphanumeric characters in their hash result?

Question: I understand not wanting to use '\0', but all the rest in the extended ASCII range is usable right?
Wouldn't this provide a much better/secure/"less coliding" hash?
Answer: You're starting from false premise -- they produce a result that can (does) include all 8-bit values from 0 to 255. Just for example, one of the test vectors for SHA-256 is an input of "abc". The result from this (in hexadecimal) is:
<code>ba7816bf 8f01cfea 414140de 5dae2223 b00361a3 96177a9c b410ff61 f20015ad
</code>
Just within that test, the result includes bytes with values from 0x03 to 0xff.
For display, that may be (often is) rendered in something like hexadecimal. For transmission in email they're often encoded with something like MIME or UUENCODE. The hash itself, however, is not limited in this way.
Transforming the result this way makes no difference to collision resistance -- you still have 160/256/whatever bits of actual data, but the representation is expanded.
Answer: In fact, those hash algorithms are outputting numbers, not strings. They use only letters a-f in combination with numbers 0-9, which makes the output a hexadecimal number.
Answer: The result is just hexadecimal encoded to be better readable.
Answer: MD5 produces an 128 bit hash. (16 byte)
sha, depending of whether is sha1 or sha256 produces either 160 bit (20 byte) or 256 bit (32 byte) hash.
Note that I'm talking about binary length/strength. The longer the less likely a collision occurs.
The fact that most users stick it into a DB field or whatnot makes it convenient to convert it to ASCII using varions binary-ascii conversion algos. This should not influence the strength of collision probability at all since you'll end up with a larger ASCII string.
FWIW I've been using SHA1, SHA256 in crypto products in binary form for over 5 years and I'd recommend choosing hashes in this following order, from the strongest to the weakest: SHA256, SHA1, MD5. There is a website that can "reverse" MD5 so I'd strongly suggest against it.
Comment: In light of other answers, if it's a hex-encoding you'd end up with MD5 -> 32chars, SHA1 -> 40chars, SHA256 -> 64chars. Strength is the same as binary in this case.


Is "element of" an a Relation with two Parameters?

Question: Is "element of" a relation with two Parameters in propositional logic like for example father(X,Y) ?
Comment: @manooooh I don't understand what you're saying here. The right analogue of "father(x,y)" isn't "$1\in\mathbb{N}$" but, well, "$x\in y$," which is exactly as undetermined.
Comment: @NoahSchweber I didn't mean they are analogue but opposite. I don't think "father(x,y)" *is* equivalent to $x\in y$. One would usually say "father(Peter, Ana)", meaning that "Peter is the father of Ana" or "Ana is the daughter of Peter". Ana is not a set but a constant, so $y$ is not a set (as you mention) but a variable.
Comment: "element of" is usually used with $\in$ e.g. $1\in\Bbb{N}$ so it says "$1$ is an element of the set of positive integers" (which is true). $\operatorname{father}(x,y)$ is a predicate, which DOES NOT have a truth value. It says "$x$ is a father of $y$" which depends on $x$ and $y$.
Comment: Do you have any reason to doubt it is? The only intuitive one I see is that the element and the set "are not of the same level" contrary, for example, to equality between 2 numbers, 2 sets or 2 functions. But the definition of relation does not depend on this.
Answer: Yes.  A relation on $n$ sets is ANY subset of the Cartesian product (set of all $n$-tuples) of those sets.  Frequently for a relation on 2 sets the sets will be the same ($<$, $\subseteq$, etc), but for $\in$ the first set is whatever domain the elements of the second set come from (such as the integers) and the second set is the powerset (set of sets) of that domain.
Symbolically, $"\in"\subseteq A\times\mathcal{P}(A)$ where $A$ is the domain and $\mathcal{P}(A)$ the powerset.


Hard navy beans - will blending soften them?

Question: ok i've soaked my rather old navy beans for around 10 hours, then  cooked them on stove top without any salt  or other things. Boiled and simmered for an hour or more, added a can of carrots, chopped celery  and some onion, cooked  another hour, no salt yet ( might be some in the carrots)  and still hard. I  read that the skins are the culprit. well, what if i  put them in the blender   briefly to chop them up? if the skin is the problem,  maybe that will  help?  yes it would make them no longer whole, but might be better than hard beans. Anyone ever do this? How did you soften hard beans that didn't soften easily?
Comment: Does this answer your question? [Why won't my beans soften?](https://cooking.stackexchange.com/questions/44992/why-wont-my-beans-soften)
Comment: I don't see this as a duplicate. Repurposing non-softening beans into a puree is something different from asking why they don't soften.
Answer: I have in the past had some success with slow cooked beans that had barely softened, just enough to be edible.  This was a mixed bean chilli, with onion, spices etc.,  but I hadn't added tomato.  It was when I went to do so that I realised they hadn't softened.
I drained off the liquid and put the beans in the food processor for long enough that they were largely pureed with some part bean lumps and used them to make bean burgers (adding some flour of some sort to make them stickier).
Comment: You might also be able to continue cooking them in the ground up state until they're fully soft, then turn them into refried beans… but that would also require regular stirring to keep it from sticking and getting scorched.


On Minecraft Bedrock Edition, how do I make it so people can't build at spawn?

Question: I know using barrier blocks makes it so people can't break stuff, but how can I make it so players cannot place stuff at spawn?
Answer: You could use 2 repeating command blocks. One that sets all nearby players' gamemode to Adventure then one that sets players outside of that nearby radius to Survival.
Make sure they're near one another.
Command block 1: gamemode a @a[r=<your radius>]
Command block 2: gamemode s @a[rm=<your radius>]
After checking the wiki there seems to be some sort of volume selector which you could use to create a custom shape.
https://minecraft.wiki/w/Target_selectors#Target_selector_arguments
Answer: Mine down a bit and clear an area below spawn. Run the command /give @s deny
Place these deny blocks at whatever Y level you want, under any blocks you don't want interacted with. That's all you need to do!
To a player who is not op'ed, and in survival, it will be like they are in adventure mode. There are no Commands required, and they can interact with the rest of the world like normal. You can place these where ever you want and nothing above the block can be broken or placed.
These are better than commands because you don't need to really on ping, the shape is easily customizable, rather than having a specific radius.
Any blocks under your deny blocks can be interacted with as per usual based on the player's regular permissions, but above them, nothing.
Answer: You could try using /clone x,0,z x,255,y 30000,0,30000   to copy the area somewhere else then using a repeating command block /clone 30000,0,30000 30000+x,255,30000+y x,0,z the area back in every few seconds so it will delete what they have built.


How to get Myriad Pro as font in ArcMap

Question: I have an ArcPy script tool that exports a map with appropriate labels (10.1 SP1) and my coworker who made the original mxd that I'm basing it on is using Myriad Pro as the font for the text elements. How might I get this font in my mxd? Or could I simply get her to create the mxd which the tool will reference?
Comment: You don't have this font currently, and you are trying to add it into ArcMap?
Comment: Correct, also we both have Acrobat if that is helpful
Answer: Refer to this help page. You are going to need the true type font file for Myriad Pro, a .ttf file. Following those steps will add the font to ArcMap and allow you to use it in your .mxd
Answer: Fonts are part of the Windows OS, not specifically ArcMap.
In order to add a font to your system, typically you would have a .ttf (TrueType Font, seems to be the most common) or.otf file. To install it, you simply double-click the file and follow the prompts. I think Myriad Pro is bundled with Adobe Reader and the files are located in the Reader install dir, under Resource/Font. You could install them from there. However, as far as I know, this is a commercial font. You should consult any EULA or other licensing documentation you can find that came with Reader to see if you are allowed to use the font the way you intend to.
The font does need to be installed on the computer you are opening the MXD on, otherwise it will probably just be replaced by one that is installed in that computer, even if your coworker sets up the MXD with a different font.

How to get Myriad Pro as font in ArcMap


Can I use my Xbox 360 controller to play PC games?

Question: I bought the Prince of Persia trilogy games yesterday at a garage sale and I want to play them asap! I remember them being great on the PS2.
Can I use my Xbox 360 controller with my laptop? Would I need to buy a converter of some kind? I'm automatically assuming I need to use a wired controller, so share any info on that.
Comment: Wired = Buy one thing for ~$40, wireless = buy 3 things (controller, receiver, charger) for ~$40-60 each.
Answer: Wired Xbox360 controllers can be used on your PC simply by plugging them in.
Wireless controllers can be used on your PC if you buy a Wireless Gaming Receiver. (You can't use a Play and Charge cable, unfortunately. They only power/recharge the controller, they don't carry data.) One receiver lets you use up to four controllers.
Comment: You only need one Wireless Gaming Receiver. It supports up to 4 Wireless Controllers.
Comment: most recent PC games with controller/gamepad support will usually use Microsoft's [DirectInput or XInput](http://en.wikipedia.org/wiki/DirectInput), the later being the same API used in the 360 which allows for near identical control setup in 360 games ported to the PC
Comment: It's worth mentioning that both setups allow the gamepad to show up as standard game controllers in Windows. The headset appears as an audio device. I've got no idea how it works on the Mac.
Comment: Does that apply to *all* XBox 360 controllers? Or just the official Microsoft produced ones? Are they any problems with using a generic XBox 360 controller on the PC?
Comment: @Wjousts I've never tried it, but I imagine third-party wireless controllers would work, since they use the same wireless communications protocol that the official XBox 360 controllers do.
Answer: If you have a wired Xbox 360 Controller, it can be used by both Windows and your Xbox 360. You should install the software:
http://www.microsoft.com/hardware/gaming/productdetails.aspx?pid=091
As far as I know, you don't need the specific "PC" version of the Xbox 360 controller--they're actually the same hardware.
Then either play a game that supports the controller directly (many of the newer games stamped with "Games for Windows") or you will need to install a 3rd party program to "emulate" a typical joystick from your Xbox 360 controller, such as Pinnacle Game Profiler.
Check out a guide here:
http://www.wikihow.com/Use-Your-Xbox-360-Controller-for-Windows
Answer: There are drivers available from Microsoft that allow 360 controller use, but I dont know how this has to interface with the games.
For more information on using the 360 controller with games see this post.
Also, there is an Xbox style control, built by Microsoft that is made for PC. That is more than likely easier to set up for this purpose, but again I have never personally used one to know for sure. See here for more info.
Answer: You can use a regular xbox controller if you splice the wires at the end and wire up a usb end to plug into the pc. You also need to download software to make the pc recognize the controller.


Why one cannot download the drivers of the Android OS like we do in our pc's

Question: I know that i sound kind of a noob but i had this question from the day i started tweaking my phone .I know that without kernel sources it is very hard to get drivers for the phone for the sake of custom ROM support but my question is why can't i just download the drivers from the manufacturer website as i download for my pc .i can install the desired android version i want and if the driver is available for the respective Android version i could simply install it as an application as i would do it in my PC.what exactly the kernel sources contain.
Comment: PC or Windows OS?
Comment: linux users don't bother about the drivers because they are already embedded in it.
Answer: sadly if it was an application like on the PC there would be billions of pirated versions and you would have to bother to search through all of them to find the official one. If there is an update for your phone it will appear as a notification and it will inform you that it is available.
Comment: Not the answer i was looking for ,First of all Android is a open source so why couldn't google follow the desktop way of installing the OS in any smartphones with minimum requirements.for drivers, what i mean is that if i had to find the drivers for my camera i could simply go to the manufacturer website,enter the sensor model and download the drivers for it so that there is no need for the binaries from the OEM side which will easily eliminate the poor camera performance after installing custom ROM's such as cyanogenmod which basically doesn't have very good image processing algorithm .
Comment: Android is an open source, I agree but the drivers are sent to the user when they are available and custom ROM's can make the camera's perfomance go from bad to absolute dog sheit. There is a way to install drivers via PC tho. You will need to plug your usb cable into the pc then to your phone, download the drivers onto the pc and then transfer to the phone and run them from the phone, or you could try finding the pc companion for that phone and install drivers for your phone on the pc.
Answer: @vishalaestro
Android doesn't work like that, many if not most "drivers" are closed source proprietary binaries and shared libraries, as well as some firmware files in kernel sources. You can't flip drivers on Android devices like you can in Windows as those "drivers" are tightly built into the Android system, tied to numerous sevices and many standard libraries as well. Your customization options without rom hopping or upgrading API level [if that firmware exists],
comes with rooting your devices, dumping you stock recovery, disassembling the image and beginning to construct your device tree , then getting hold of android source code build system and having a ball!
Should be doesn't factor into it. it is what it is.
BUT, getting hold of the kernel source and "correcting" shortcomings has alot more possibilities. check out the forums on xda [the good ones anyway]
and you'll see what goes into the process.


header2.el: insert header between second and third row?

Question: I customized my own header and want it to be inserted between the second and the third line of the document. Unfortunately I'm not very used to Lisp, therefore I have a hard time trying to find the corresponding lines in header2.el. Any ideas on how to proceed?
Answer: As the Commentary of header2.el says:
;; To have Emacs update file headers automatically whenever you save a
;; file, put this in your init file (~/.emacs):
;;
;;   (autoload 'auto-update-file-header "header2")
;;   (add-hook 'write-file-hooks 'auto-update-file-header)
;;
;; To have Emacs add a file header whenever you create a new file in
;; some mode, put this in your init file (~/.emacs):
;;
;;   (autoload 'auto-make-header "header2")
;;   (add-hook 'emacs-lisp-mode-hook 'auto-make-header)
;;   (add-hook 'c-mode-common-hook   'auto-make-header)

If you want the header to contain two lines of your choice as its first two lines then just define a function that inserts those two lines, and put that function at the beginning of option make-header-hook.  E.g.:
(defun insert-my-first-two-lines ()
  (insert "MY FIRST LINE")
  (insert "MY SECOND LINE"))

M-x customize-option make-header-hook

Click INS in Customize at the beginning of the default value of make-header-hook, to insert insert-my-first-two-lines:
INS DEL insert-my-first-two-lines

Save your customization.
Automatic updating of the header, by update-file-header, will do nothing to those first two lines (which I guess is what you want).  It changes only lines for which you have defined an updating action using register-file-header-action.


Replacement guide for different cleats?

Question: I'm planning to replace my wellgo 6 degree float to look keo grip 9 degree float. I've searched for cleats replacement guide online but most of them only caters to replacing identical cleats. I'm pretty sure these 2 cleats have some minor differences. How should I go about it? Or should I go to a bike fitter for cleats fitting again? The latter is probably my last resort as it will cost a lot just for cleats fitting.
Answer: Wellgo make a variety of aftermarket replacement cleats and pedals for various systems, including Shimano's SPD and Look Keo.  They should be (almost) completely compatible with the equivalent system's branded cleats.  I've personally used Wellgo Keo-compatible cleats as a replacement for Look-branded cleats, and there were no issues at all.
Assuming you're talking about these Wellgo 6-degree cleats then the Keo equivalent 9-degree float should be a drop-in replacement.
The way I change cleats is to take a Sharpie and trace around the base (the heel-facing end) of the old cleat before removing it, and then align the new cleat to that line when installing the new ones.  It shouldn't require a fitter, since the plastic is as identically shaped as they can make it.
(Just to be clear, trace along where the cleat meets the shoe, as indicated in this picture.  This shape is dictated by the shape of the pedal, and any compatible cleat must have this exact shape here.)
Comment: Oops, wrong link.  That's the exact link I intended to have in my post, so yes, it's the same. :)  I'll fix.  I don't change my cleats often, but I always carry [cleat covers](https://www.competitivecyclist.com/look-cycle-keo-cleat-cover) in my pocket when riding and put them on every time I dismount.  They'll still get wear from stepping down at stops, but much less.  And if you're like me and you habitually step down on the same side, you can swap the cleats between sides when the one is about 75% worn.
Comment: My shoes are both black-soled so sharpie doesn't show up.  I use an old bottle of white-out fluid.  One could also use short pieces of tape temporarily.  If you're super-confident of your placement, then scratch the outline into your shoe so its permanent.
Comment: Thank you for the answer.

I'm using https://www.chainreactioncycles.com/wellgo-r096-cleats-look-keo-compatible-/rp-prod110505

Not sure if it is the same since it doesn't say grip. Also, off topic, did you have to change up the look grip cleats often and if so, what is your walking habit?

Replacement guide for different cleats?


Is it technically feasible to make a solar hang glider?

Question: Is there any hang glider with solar sheets on top that can charge the e-trike or the e-Lift's battery in flight ? Just like the Sunseeker...
Answer: I think you've got your terminology crossed here (but it's not your fault - your sources don't seem to clear on it either).
A hang glider is by definition a solar vehicle: They're non-motorized, and the pilot keeps them aloft by seeking thermal lift (created by the sun shining on the ground and heating it up) or ridge lift (created by wind striking the side of a mountain/hill (ridge) and being deflected up.
Both of these rely on the sun (either directly heating the local ground, or unevenly heating various parts of the Earth's surface, ultimately creating wind).
What you're referring to would be a solar-powered ultralight aircraft -- basically a hang glider with a motor strapped to it, or possibly an electric powered paraglider.

One could conceivably create a solar-powered ultralight using flexible solar cells on the wing  - in fact a little Googling reveals that it has apparently been done with an electric paramotor (a type of powered parachute) (A little more Googling reveals this wasn't as cool as I previously thought - they seem to have been using a support vehicle to recharge their battery packs (with solar cells).
As far as I'm aware no such vehicle is commercially available at this time (May 2014), but the materials and technology to construct such a vehicle are certainly available (the folks over at the Experimental Aircraft Association could probably provide guidance on building something like this), and it wouldn't surprise me if commercial or kit-build solar ultralights become available at some point in the future.
Comment: @AyanMullick I did a little digging and it turns out that solar paraglider isn't as cool as I thought it was (they didn't mount panels on the wing or cage - they hard a support vehicle doing the charging).  The principle of solar cells on the wing still seems sound though (effectively making the vehicle a motor glider - charge the batteries while the motor isn't running, draw from them when it is).
Comment: @voretaq7, I think the definition is that conversion is allowed as long as it is _happening on board_, which sounds reasonably self-consistent to me.
Comment: I wish they had posted a clear image of the solar paraglider...
Comment: @voretaq7: i'm trying to define the relation between a paraglider and solar energy. Is the definition of solar vehicle actually correct? [Wikipedia defines a solar vehicle](https://en.wikipedia.org/wiki/Solar_vehicle)  as one that can use solar energy **directly**. A hang glider or a paraglider can't directly convert the sun energy. It happens on the earth's surface.
Comment: @mxlian I *am* deliberately using the term imprecisely in my answer, but if you want to get really pedantic about the definition I would argue that the Wikipedia article is wrong in its premise: The only true "solar vehicles" are [ones using solar sails](https://en.wikipedia.org/wiki/Solar_sail). Anything else is doing some kind of conversion (and if conversion is OK at that point we're just artificially constraining the definition so it doesn't include an engine powered by Jet-A refined from oil made from dinosaurs that ate plants that grew because of sunlight millions of years ago :) )
Comment: By your definition a hang glider would simply fall to earth at 32 feet per second squared as soon as the sun set.
Answer: I don't believe it can be done. The area of a tandem wing isn't large enough. With solar power at 1kW per square meter that will be 15 horse power but the conversion efficiency is not 100%. It is more like 20% so you are looking at 3 horse power. A typical trike needs a minimum of a 25 horse power motor. For example the electric Icaro uses a 10kW motor and it's not even Tandem. The wing area would only be enough to provide 20% of the needed power.
Answer: Solar power on Earth peaks at somewhere between 400W and 1.3kW per square metre, in theory, at midday.
In practice, we can typically expect more like 40-70% of this to be available due to inefficiencies in the solar panels and the fact the wing wouldn't be pointing directly at the sun. This is discounting clouds, and only at midday. At any other time, the amount available is lower.
Taking the best case scenario (1.3kW at midday at the equator, 70% available) then we still only have ~910 watts, or a little over 1.2 horsepower, per m^2
Let's take a typical hang glider: a Wills Wing Alpha 210 has 19 square metres of wing area. That would give 17 kW, or 22.5 BHP. In theory, that's more than enough to get a microlight into the air, if you can keep the weight of the battery, motor, and solar panels down.
In practice, though, are you really going to be flying at the equator, with your wings perfectly level, at midday?
And more importantly, are you really going to get a 17kW motor, 20 m^2 of solar panels, wires, and a battery (pretty much required) into the weight of a hang glider that weighs, itself, less than a typical person?
It's theoretically possible to make some kind of small ultralight type aircraft solar powered, but probably not until we find a way to make lighter motors and lighter solar panels that can take advantage of the wing area without causing weight/stability issues
Comment: If you're just looking to use the battery to extend the range then that's more feasible - but the weight of batteries, solar panels and motors, even if the solar panel area required is reduced, would still be significant. Hard to say exactly, but I'd still put it under the 'not quite feasible yet' category
Comment: By solar hang glider I mean ;

1. the hang glider would take off on its fully charged battery
2. It'd have solar panels on the wing that would charge the battery while one is soaring with the engine off and also in normal cruise flight.

How substantially would that improve the endurance of that machine..
Comment: Even with these [light weight flexible panels](http://www.vgloryenergy.com/sell-1862641-5w-flexible-solar-panels-for-rv-boat-etc-sunpower-solar-panels.html)....?
Comment: Even if we believe their claims on the capabilities of those panels, which seem... Astounding... You'd still need well over 100 of their largest panel to power an ultralight
Comment: But with just the wing area with solar panels; wouldn't that charge up the battery considerably while the pilot is soaring with the motor turned off for a couple of hours...?
Answer: If you only need a few minutes prop power to gain altitude and have flexible lightweight panels on top charging the batteries for several hours then you could theoretically travel anywhere without an aerotow or hill thermal to get you up each time. The others replying here seem to be assuming continuous power capable of supporting the engine at full revs is necessary when actually you only require a few minutes to reach enough altitude. Then you can catch thermals and only fall back on the motor if you lose too much height.

These small motors taken from model aircraft give 10 minutes of thrust but can be used intermittently for hours. Combined weight of 4.4kg I think including the batteries. That is without adding a 1.8kg flexible 100 watt panel.
Comment: Welcome to [aviation.se]! Please expand on your answer with technical details to help it move from being a comment (and downvoted/deleted) to an actual self-contained answer.


Webform as a block only

Question: When I crate a Webform I do have an option to make it available as a block as well. But in this case it creates a node as well.
How can I create a Webform as a block only?
Answer: You will need to create a webform as node. Edit the node and navigate to:
Webform tab -> Form Settings tab -> Advance Settings (located at the bottom of the page).
Check the checkbox for Available as block and your webform will be a block.
Comment: Correct. But in this case I will get a node and a block for this Webform. But I need only a block. I don't need people get on node of this Webform...
I hope I explain clarify enough :)
Comment: @user126902 To what I am aware of using the Webforms module you will need to create a node.  Perhaps you can create a new content type and set permissions that don't allow users to view the node page.
Comment: Enable contact module, and get form URL **contact**
Answer: I'm not aware of a solution different from the "create a webform as node" (+ make available as block).
However, to avoid anybody would want to visit that "node of the webform" (cfr. your "I don't need people get on node of this Webform"), you migt want to consider a variation of the approach detailed in the answer to my question "How to specify a Rules event like "Content is 'going to be' viewed"?". All you'd need to change to that "rule" is:

the actual path to be checked (matching the path of your node of the webform, instead of node/*).
and the no_access path (replace it by an appropriate path in your site).

Webform as a block only


Golden Calf: Moshe had a Golden Answer to Hashem. Why didn't he say it?

Question: Rabbi Lazer Ginzburg seems to say the greatest thing a Jewish leader can do when his people are causing Gds anger, is to say to Hashem: "It's because of me that the yidden are sinning!" (he supports this idea). With this idea by the sin of the golden calf, why didn't Moshe accurately take the blame for the sin and say to Hashem: "It's because of my delay in coming to them that they made the golden calf"..? This seems to be the greatest response Moshe could have said and he didn't. Why not?
Comment: Where does Rabbi Lazer Ginzburg seem to say that?
Comment: Wouldn't that be a lie? Moshe didn't delay. He told them 40 days and meant a full 40 days. They miscounted.
Comment: I don't understand your suggestion. True Moshe arrived later than expected but that hardly justified making a golden calf and all that followed.
Comment: https://www.torahanytime.com/#/lectures?a=179190
Answer: I bumped into Reb Ginzburg today. He answered that because Moshe is an Ish emes, he didn't tell Hashem its because of my delay the yidden sinned. The Gemara says the satan caused yidden to do the chet hagel and it wasn't because of Moshes delay in coming to them on day 40 etc..
Comment: Could the idea be applicable to Exodus 32:7?
https://judaism.stackexchange.com/questions/99321/was-moshe-punished-for-converting-the-erev-rav
Comment: When announcing the death of the firstborn, they told pharaoh it would occur "around midnight" so a few minutes of perceived inaccuracy wouldn't give Pharaoh something to save face with. If Moshe can be concerned with a few minutes, he should also be concerned with a perceived delay of a few hours to a day.
Answer: That which is properly called accurate is true, and that which is true is accurate: it is never a righteous thing to lie to God—true humility does not involve or consist in pious lying, but rather the virtue of humility consists in the ability acknolwedge the truth about oneself, regardless of how little or big it makes you feel or look: this is real humility. Therefore, Moses who "was more humble than any man on earth" (Bemidbar 12:3), would never lie in order to seem what he was not.
Moses, who was as outraged at the infidelity of Israel as God Himself, could not 'admit' what was not true, namely, that he was himself at fault somehow, since Aaron his brother was the leader of the people while Moses was gone: Moses could not at once attend the people and God. If not so much as a goat was allowed to set foot on the mountain, how is Moses who dictate to those at the bottom? He cannot.

Shmot 32:15 And Moses returned from the mount, carrying the two tables of the testimony in his hand, written on both sides, and made by the work of God: the writing also of God was graven in the tables. And Joshua hearing the noise of the people shouting, said to Moses: The noise of battle is heard in the camp. But he answered: It is not the cry of men encouraging to fight, nor the shout of men compelling to flee: but I hear the voice of singers. And when he came nigh to the camp, he saw the calf, and the dances: and being very angry, he threw the tables out of his hand, and broke them at the foot of the mount: and laying hold of the calf which they had made, he burnt it, and beat it to powder, which he strowed into water, and gave thereof to the children of Israel to drink. And he said to Aaron: What has this people done to thee, that thou shouldst bring upon them a most heinous sin? And he answered him: Let not my lord be offended: for thou knowest this people, that they are prone to evil.

As we can read, Moses and Aaron were both against the idolatry; Aaron was weak and gave into what he ought not to have as a Mosaic leader, and Moses' successor, but Moses was fully against and in no way responsible for what they who were at the bottom of the mount did while he waited at the top for God to write the law on the tablets of stone, and blamed Aaron for his inexcusable indolence or cowardice in the face of apostasy from the only true and living God.


Crowdsale end time

Question: Question about setting crowdsale end time. Is it possible to have an adjustable end time? Meaning there's no end time set, and admin can end the crowdsale any time once the crowdsale started.
Comment: Yes, this is possible. If you run into trouble while implementing it, please feel free to ask a specific question with code.
Answer: This is just a transaction that set a variable to a specific value, nothing special:
<code>uint endTime;
address admin;

modifier isAdmin() {
    require(msg.sender == admin);
    _;
}

function setEndTime(uint timestamp) public isAdmin returns (bool) {
    // Do check stuff you want
    endTime = timestamp;
    return true;
}
</code>

Crowdsale end time


Loose self extracting crankset

Question: I have a near new bike only ridden a handful of times, it has a self extracting crankset I believe which uses a pin spanner, the drive side crank is now slightly moving side to side. This isn't happening on the non drive side crank, why is this? How do I tighten it and what tool do I need?
See pictures below.
Comment: In addition to @WeiwenNg's answer, you may find you need to use a thread locking compound like blue Loctite no matter how tight you make the retaining bolt.
Comment: We can see clearly a clockwise arrow on the inner race saying "tight " You need to keep trying hex tools till someting engages with the visible splines.  Try a 10mm and see what happens?
Answer: Chances are you tighten the crankset using an 8mm hex wrench. I'm not sure if any cranks take 10mm wrenches, but I believe most or all are 8mm.
I'm not sure exactly what the object with the pinholes does. On older self-extracting cranks that I'm familiar with (square taper or Shimano Octalink), the self-extractor had pinholes in it. When you undid the hex bolt that secured the crank, the bolt would push against the self-extractor and push the crank out. In that arrangement, the bolt was basically a captive bolt unless you took out the self extractor with a pin spanner. Speaking of that, a crank needs to be tightened down pretty hard - 40 Newton meters is a common spec I've heard, and it's quite hard, and it's definitely much more force than you could possibly exert with a pin spanner.
You do want to tighten down that crankset as soon as possible. If it's ridden loose, you could be stripping the splines on the crank that keep the spindle mated to the drive-side arm. If you rode a square taper crank with one side loose, after too long you'd deform the broached opening in the crankset (the square taper spindle was almost certainly steel, and if not that it was titanium, either of which are harder than the aluminum that cranks are made of, so it would be the crank that died). A prior answer alluded to that, but it was presumably deleted because this isn't a square taper crankset, and we can't be certain that this has happened yet anyway.
Comment: The pin spanner holds the cover over the crank-bolt in place. The crank is tightened to the spindle with that 8 or 10 hex. When untighening the hex bolt pushes against said cover to extract the crank.
Comment: Thanks, I will go try with a hex wrench, I havent ridden it like this at all.
Comment: I tried using an 8mm but it simply slided through, I looked on park tools youtube channel and I saw Calvin mentions using a pin spanner or 8mm on mine there is no fitting for an 8mm.
Comment: @user57888 Well, if 8mm slid through, then it's probably a 10…
Comment: I'm Googling. 9mm hex bolts exist, and there are some applications in the automotive space. But they're rare. In bicycles, I don't know of anyone using 9mm for anything. No tool sets have 9mm wrenches. So, it more or less has to be 10mm unless the 8mm key fit really, really loosely in the bolt.

Loose self extracting crankset


Is intrinsic spin conserved?

Question: In general, we have total angular momentum, which is the sum of spin angular momentum and orbital angular momentum, and we know that in isolated systems the total angular momentum is conserved. Now, what can we say about spin angular momentum? Is that conserved?
Comment: I'm not sure what you mean by "intrinsic spin". For example, what is the intrinsic spin of a system with two electrons?
Comment: Total angular momentum $J$ is always conserved in a rotationally-invariant system, but $L$ and $S$ individually need not be. An example is a system of a photon and an atom, in which the photon is absorbed by the atom and the photon's one unit of spin angular momentum becomes one unit of orbital angular momentum of an electron in the atom.
Comment: I meant that if we have total angular momentum which is the sum of spin angular momentum and orbital angular momentum and if we know that in isolated system, total angular momentum is conserved, now what can we say about spin angular momentum? is that conserved?
Comment: Also, even the question of whether a generic EM field can always be decomposed into orbital and spin angular momenta is a somewhat thorny issue, see for example http://iopscience.iop.org/article/10.1088/1367-2630/16/9/093037/meta .
Answer: The (intrinsic) spin has a meaning but only in the rest frame of the particle. In particular most 1-particle states can be classified as representations of the Poincaré-group by its mass and its  (intrinsic) spin. In that case (rest frame of the particle), I guess, the spin is conserved. In case the particle is moving, the (intrinsic) spin looses its meaning as the spin operator no longer commutes with the Hamilton operator. However, the projection of the spin on the axis of motion $\bf{s}\cdot\bf{n}$ still is conserved. Therefore this quantity got its own name "helicity".
Answer:
Is intrinsic spin conserved?

Generally speaking, yes. It's conserved like angular momentum is conserved. See the Einstein-de Haas effect which "demonstrates that spin angular momentum is indeed of the same nature as the angular momentum of rotating bodies as conceived in classical mechanics". Also see Hans Ohanian's 1984 paper what is spin? Note this bit: "the means for filling the gap have been at hand since 1939, when Belinfante established that the spin could be regarded as due to a circulating flow of energy".
That's referring to the Poynting vector, which Feynman mentioned in his lectures: "Suppose we take the example of a point charge sitting near the center of a bar magnet, as shown in Fig. 27–6. Everything is at rest, so the energy is not changing with time. Also, E and B are quite static. But the Poynting vector says that there is a flow of energy, because there is an E × B that is not zero. If you look at the energy flow, you find that it just circulates around and around. There isn't any change in the energy anywhere - everything which flows into one volume flows out again. It is like incompressible water flowing around. So there is a circulation of energy in this so-called static condition. How absurd it gets!" Only it isn't absurd.

In general, we have total angular momentum, which is the sum of spin angular momentum and orbital angular momentum, and we know that in isolated systems the total angular momentum is conserved. Now, what can we say about spin angular momentum? Is that conserved?

Generally speaking, yes. The positron has the opposite chirality to the electron. When they annihilate their spins cancel. So spin is conserved like charge is conserved. However don't forget that a flywheel can shatter, with pieces flying outwards in all directions. There appears to be no angular momentum any more. There may be some way to do something similar in particle physics, and black holes are a little counter-intuitive. So I hesitate to say spin angular momentum is always conserved in every conceivable situation.
Comment: I believe you have this somewhat backward. The Einstein-de Haas effect shows that change of spin along some direction can be converted into change of angular momentum along that direction. This implies that they are *not* separately conserved, contrary to your first statement.

Is intrinsic spin conserved?


is it appropriate to use "was being" when referring things that happen in the past

Question: I am looking for clarification: can I use "was being" to refer to things that happen in the past? If so, please give example in a sentence.
Comment: Hi and welcome to the site. When asking a question it is best to follow this advice from the FAQs: "Remember to make an effort to research your question before posting it, and be sure to add as much detail as you can when explaining your problem. The more you can tell us, the better answers you'll receive!"
Answer: Yes, you can do this.

Sue was being an idiot.

Now, compare to:

Sue was an idiot

This second example implies that a trait of Sue was her idiocy in the past. The first implies that Sue acted like an idiot for an ongoing period of time in the past.
Most of the time this doesn't matter, and the "was" is preferable to the "was being."
Interruptions

Jack was being an idiot when I dragged him away from the fusebox.
Mark was being a buzzkill when I grabbed the phone from him.

In this case, you need the "was being" because the state/actions associated with the state were ongoing when the interruption happened.
Answer: Past Continuous Tense is used when you want to emphasize the development or process of things or things or the time when things or things happen ...
The use of past tense continues
Usage Example
Expressing what is happening at a time in the past:
When my sister got there, it was 8 p.m.
Expressing two concurrent actions in the past: While I was taking a bath, she was using the computer.
While I was driving home, Peter was trying desperately to contact me.
Expressing the action in progress, another action interferes:
I was listening to the news when she phoned.
I was walking in the street when I suddenly fell over.
They were still waiting for the plane when I spoke to them.
Repeated actions in the past and disturbing others:
My mom was always complaining about my room when she got there.
She was always singing all day.


How to fix macOS Sierra language switching bug?

Question:
Changing languages input does not work, you can see the video.
Comment: I have the same problem in 2021. The only thing that works is restarting. Imagine paying 3000 dollars and you cant change the damn input language
Comment: Fixed for me by using "select previous input source" instead of "next", as suggested by Yahuen Yakimovich below. Did not change Siri settings or anything else, FWIW. (On Mojave)
Comment: happens once in a while, have to restart OS.
Answer: Go to system preferences/Siri and turn off Siri and make sure that the keyboard shortcut is set to None, and then restart.
Comment: 2021 and it still present in Big Sur / Apple Silicon
Comment: 2019 and it still present in Mojave...
Comment: 2020 and it still present in catalina
Comment: Thank you so much!!! I almost started to hate my laptop, but now this annoying problem is finally fixed!
Comment: almost the end of 2022 and still running into this
Comment: it's amazing to see that this is still the solution. I encountered this issue again, and landed on this solution from Google search. Apparently I already upvoted this.
Comment: apparently OP doesn't have Siri.
Comment: @georgexsh why do you think that?
Comment: hmm, it is possible, I was wrong.
Comment: Delete the input source and add it again, if something still not working after this fix.
Comment: october 2023 and still there
Answer: Had a similar problem with the variation that I needed to change focus of the window (deactivate and activate currently focused application window by using command+tab, very annoying).
I am extending the solution with Siri (which I am not certain about if that is really solving the problem but I don't use it anyway) with what has worked for me:

Turn off Siri in System preferences (reboot as explained by Tom)
Use method with Select the previous input source.
Don't use Select next source in Input menu

The difference in how those two methods (2) and (3) are implemented causes only (2) to work properly, since it shows a menu popup where user can loop over languages. This results in missing defocus/focus step.
Hope that helps!
Comment: Thank you! Using "Select previous input source" instead of "next" solved this for me. I did not do anything else, like turning off Siri. (Mojave)
Comment: Also the only suggestion that worked for me
Answer: Had this happening to me every once in a while. Console did emitted an error when I attempted to switch the keyboard layout:
TypingFocusDebug senderProcess is non-trustable, senderProcessPID is 6171 typingFocusProcessPID is 35651 -> msgID = -1

The senderProcessPID was /System/Library/PrivateFrameworks/LocalAuthenticationUI.framework/Versions/A/XPCServices/localAuthenticationRemoteService.xpc/Contents/MacOS/localAuthenticationRemoteService
Killing it did helped to get rid of the non-switching input source problem:

sudo killall -9 localAuthenticationRemoteService

Hope this helps others who are having the same issue.
Comment: only this `sudo killall -9 localAuthenticationRemoteService` was enough to make it work on my side
Answer: killing of this process will be enough
/System/Library/Input Methods/PressAndHold.app/Contents/PlugIns/PAH_Extension.appex/Contents/MacOS/PAH_Extension

if this will not help, try kill these processes as well
/System/Library/CoreServices/TextInputMenuAgent.app/Contents/MacOS/TextInputMenuAgent
/System/Library/CoreServices/TextInputSwitcher.app/Contents/MacOS/TextInputSwitcher

update:
sudo killall -9 PAH_Extension TextInputMenuAgent TextInputSwitcher

Comment: this one worked for me with disappeared popup upon switching!
Answer: I have similar issues. As shown in the video or another one where instead of having n+1 languages I suddenly can only switch between 1 language even though I have n+1.
It seems the process freaked itself out or whatever.
To fix it I went into keyboard preferences -> shortcuts -> deselect "Select the previous input source" or "Select next source in Input menu" whichever you are using.
Afterwards close preferences and reopen it. Go to shortcuts again and enable the option you like to use.
Seems that restarts the process.
Comment: For OSX Catalina users, these options can be found like so: `System Preferences -> Keyboard -> Shortcuts -> Input Sources`. Be sure to use the `Input Sources` shown in the side bar of the `Shortcuts` window, NOT the the tab directly next to `Shortcuts`.
Comment: Which IS the correct ANSWER !
Comment: Would be nice to know which process we need to restart so there is a general solution though.
Comment: I did not have to restart any process, the update simply had a bug to not be able to "remember" my shortcuts preferences ... so the simple re-applying of the preferences worked for me ...
Answer: I had same issue. As english layout I had ABC.
So I added US layout instead ABC and after removing ABC problem has gone.
Comment: Interesting!  What language were you switching with?  Russian like Sato?
Comment: @TomGewecke Yes, Russian <-> US
Answer: On my Mac (Catalina 10.15.3), it usually happens after authenticating with Apple Watch when editing Safari's stored Credit Cards and in some other cases that require an authentication.
In order to fix it, just run the command:
sudo killall -9 localAuthenticationRemoteService

This will restart the Authentication Remote Service, the one that causing the problem.
Answer: If you added an alternative keyboard layout, remove it and then re-add it (i.e. the layout that the os keeps switching away from).
I tried 90% of the solution here, and this was the only one that worked (Monterey 12.0.1).
(Credits to DanSkeel for pointing this out in a comment to a different answer).
Answer: Yes. I have had different issues with inputs since El Capitan. I frequently switches between Japanese and English. I don't know about Korean but in Japanese, you've got Katakana and Hinagana so I basically have 3 input turned on (but I don't think that's why I got the issue).
And every now and then either Japanese or English input stops working. The flag at the right corner did change with keys. But the inputs themself don't.
for example. If I'm using pages, and switching between chrome and pages when I type something in English on chrome then switch back to pages to type something in Japanese, the language won't change even if the icon changed. and if this issue happened it stays.No matter what the icon is the actual input would be either English or Japanese.
I have to reboot the mac to fix it, but it comes back a few hours after the machine is heavily used.
Answer: I finally found a satisfactory way to temporarily fix this on my computer (running Sierra 10.12.6) WITHOUT REBOOTING!  Even opened an account on StackExchange to share :)
First, my symptoms: at some point the keyboard stops switching between English and my OtherLanguage. It doesn't matter if I use a keyboard shortcut for switching or try to switch in the menu bar. What happens is I BRIEFLY see the flag of my OtherLanguage, and then when I try to type, it switches back to English.
However... I noticed that this behaviour is application-specific. Some "cooperative" applications (in my case Terminal) still allow me to switch (using any method) AND STAY with the OtherLanguage layout. This gives me some hope...
Unfortunately, in my case rebooting is not an option, so I kept experimenting. First, I quit the applications that were "uncooperative" (Safari, Mail, Skype, Slack). Brought them back again - no effect.
Then I quit them again, switched to my trusty Terminal, CHANGED THE INPUT SOURCE and only then restarted Skype - Skype gave me my OtherLanguage back! Repeated the same with Slack - it worked too! Repeated with Safari - it worked again! Repeated with Mail - no way :(
However I can live with that for the time being. For example, I can type my text in another application and just paste into my Mail as a temporary fix.
Hope it helps someone out there!
Answer: In my case, running Big Sur on an M1-powered Macbook Air, the globe/fn key randomly stops responding.
In System Preferences / Keyboard / Shortcuts / Input Sources I found these:

Select the previous input source: [control]-Space
Select the next source in input menu: [control]-[option]-Space

The first key combination doesn't actually seem to do anything I can notice, but the second not only switches between language keyboard layouts like the globe/fn key should, but it also makes the globe/fn key start working again.
Comment: This really has no connection with the question from 5 years ago.  It belongs with this other topic:   https://apple.stackexchange.com/questions/411715/keyboard-fn-function-key-switchusing-language
Comment: @TomGewecke: Hmm that one well eluded my multiple search efforts. This one here seems to actually cover several separate problems. I'll take a look at the other one.
Answer: This bothered me for almost a whole year. It turns out a very bad and messy design plus bugs caused the widespread frustration.
Solution is to only use the correct behaviors (hereafter quoted as below):
In input settings, I enabled switching input method by Caps-lock key. When everything works fine, here are the behaviors should be:
Correct behaviors
Using caps-lock to switch Chinese input method and English. That means:

when using Chinese, press caps-lock will turn input method to English
when using Chinese, long press caps-lock will turn input method to Capital English, green light will be on in Apple Magic Keyboard.
when using English, long press caps-lock to switch to Capital English, long press caps-lock to go back
when using English(whether Capital or not), press caps-lock to switch to Chinese

Incorrect behaviors
first(very common)

pressing caps-lock does switch input method, but the indicator in menubar doesn't change accordingly at all.

second(very common)

pressing caps-lock does not switch input method any more. But cmd+space still works. menubar indicator works as well.

third(less common)

press caps-lock and cmd+space both don't work. I have to use mouse to click the menubar indicator to switch input method.

fourth(rare)

press caps-lock and cmd+space both don't work. Even more, when I use cmd+space, I could see only the English input method or the Chinese input method was gray. Both were gray in cmd+space and in menubar indicator.

The original link: https://forums.macrumors.com/threads/is-there-a-bug-with-language-switching-in-sierra.2020165/#post-24054565
Comment: I don't understand the "solution".  You are just cataloging how it is supposed to work and then how if often does not work.  When it does not work right, what are you supposed to do to fix it?   Using "correct behavior" is not an option when you are faced with "incorrect behavior".
Comment: Your stuff is really addressed to Apple, not to anyone with a concrete problem to solve.  Instead of posting it here, send it to http://www.apple.com/feedback
Comment: @TomGewecke agree, but IMHO sort out things is a bit more helpful than a unrelated "solution".