Single mode fibers

Question: Is it possible to focus white light into a single mode optical fiber? I thought no because in order to focus it should be a solution to the Helmholtz equation but I am not too sure about it. Also since the equation features the wave number, shouldn't it be impossible?
Answer: "White" light is light of multiple frequencies, usually a broad band of different frequencies ranging from ~($390nm$ to $700nm$) though white on your computer monitor consists of only three different frequencies (red green and blue).
It is possible to send multiple frequencies down an optical fiber. However the fiber will act like a prism and diffract the light. Information can be sent down fibers but white light is never used since the faster frequencies reach the end of the fiber before the slower ones meaning that your pulses will broaden and overlap.
Graded index fiber can be used to counteract this. As it slows down the faster frequencies. Effectively acting like an achromatic doublet.
Depending on your range of frequencies what is single mode fiber for one frequency may be multimode for another. There are other ways to couple light into a fiber than just lens focusing it such as fiber couplers.
Comment: Graded index fiber is a type of multimode fiber, not single-mode fiber. Index grading doesn't eliminate chromatic dispersion (wavelength-dependent variation of propagation velocity). Ideally what it does is equalize the propagation velocities of the different modes (of multimode fiber), minimizing modal dispersion.
Comment: All true, tho' for very short runs (e.g. within a lab bench range) the spectral dispersion effects are ignorable.
Comment: White on the monitor consists of considerably higher number of frequencies, namely those corresponding to peaks of a [CCFL](http://en.wikipedia.org/wiki/Cold_cathode#Lamps), or, in modern monitors, a continuous spectrum of a [LED](http://en.wikipedia.org/wiki/LED#Phosphor-based_LEDs). The color filters of the subpixels pass quite wide bands of the corresponding colors.
Answer: The answer is Yes. However the losses will be wavelength-dependent, you will likely get a "ugly" superposition of modes at the output and a dispersed signal as user288447 stated.
You are correct, the mode for each wavelength need to be solution of the Helmholtz equation. For a dielectric waveguide, there is no absolute cut-off wavelength (all wavelength can propagate), but there is a single-mode cutoff (see Normalize Frequency parameter V).
A good reference for all things fibers and laser related is http://www.rp-photonics.com
Answer: Are you concerned that because the properties of the focussed light does not have the same properties (e.g. wavevector) of the fiber mode that coupling is not possible?
It is possible to focus white light into a single mode fiber.  The main criterion is that the angle of convergence of the light must fit inside the angle of acceptance of the fiber.  The efficiency of the transfer of energy will not be 100%, as there will be reflections at the surface, some light will fall outside of the acceptance angle, some light will fall outside the core region.  But some will propagate in the fiber.
Comment: It is feasible.  But whether or not it useful is another question. Is the light modulated or steady?  How long is the fiber?  What is the weakest signal you can tolerate?  Can you tolerate a color shift?  It all depends on what you plan to do.  But, yes, it is feasible to focus white light into a single mode fiber.
Comment: But is this feasible? Or will the losses be too high?
Answer: a need for coupling a white light into a SM fibre had just emerged to me. I remembered vaguely, that there is probably no better means to couple extended source, than stupid butt-coupling. So I took one FT030 SM fiber patchcord and simply put one end near to cellphone photo illumination LED, and some amount (exceptionally high to my poor expectations) passed through: a cone illuminating white canvas from some 10-20cm of distance was visible.
So, the answer is: yes.
Comment: Pictures and diagrams might be useful.
Answer: The answer depends very much on the white light and you will always get some coupling. In general the coupling is very low, simply by the second law of thermodynamics applied to the phase space of light: it becomes the law of increase of Optical Grasp (oka Étendue). Light at one wavelength in a one moded optical fiber at one wavelength is essentially zero entropy light: there is only one possible bound (i.e. propagating indefinitely away from the fiber input) configuration of light, so its entropy $k\,\log \Omega =0$ since $\Omega=1$. Light from an extended source, even when restricted to one wavelength, will have present highly aberrated wavefront to a collector lens, and thus the Strehl ratio at the fiber input is very small. Not so for a non-extended source. White light from a powerful point source (i.e. with diameter much less than the Airy disk diameter for the numerical aperture of the collector system) will have an very high coupling efficiency into the fiber. Light from a white laser likewise, for the same reasons.
An interesting problem is the coupling of sunlight into optical fibers: I have been thinking a bit about this for space exploration purposes. Interestingly, the maximum light you can couple into each mode of a fiber is independent from the distance from the Sun:   as you move away from the Sun, you can increase the collection area to compensate. The reason is that the Sun subtends a nonzero angle at the collection point, so off-axis waves can't couple efficiently into the fibre. You can increase the collection area, but the aberration introduced by the tilt of the off axis waves thwarts any increase in coupling. So, for each distance from the Sun, there is a maximum effective collection area possible. As we move away from the Sun, its angle of subtense decreases, and lets you increase the collection area to compensate for the loss if intensity.
The power that can be coupled into a single mode fiber under any circumstances in the frequency interval $[\nu,\nu+\Delta\nu]$ is approximately constant (independent of fiber modeshape and distance from the Sun) and equal to:
$$P(\nu) = \lambda^2\,\epsilon(\nu) \Delta\nu$$
Where:
$$\epsilon(\nu) = \frac{2\,\pi\,h}{c^2}\frac{\nu^3}{e^{\frac{h\,\nu}{k\,T_\odot}}-1}$$
is the spectral intensity, by the Planck law, in watts per metre squared per hertz emitted from the surface of the Sun. Hence, the total power that can be gathered into a single mode fiber from the Sun is:
$$P_{tot}=\frac{\pi^3\,k^2\,T_\odot^2}{3\,h}$$
which, for $T_\odot = 6000{\rm K}$ works out to be about 11 microwatts, as long as the fibre can be thought of as single moded over the whole range of frequencies where the Sun emits significant power.

Single mode fibers


How to get Adjunct faculty positions in USA as a recent immigrant

Question: I recently immigrated to the USA. I have over 20 years of experience in academia (management and faculty). I have responded to job postings that are online. How can I get my resume and cover letter noticed specially as foreign qualifications and foreign experience is concerned?
Comment: The OP is asking about adjucnting, which accounts for 40-50% of courses taught in the US. The OP is not asking how to write a CV and cover letter in general, but specifically for adjunct positions.
Comment: This isn't really an Academia question. Every job applicant has this question, for academia or not.
Answer: I concur with @ThomasSchwarz that the most important thing to note on the application is that you have already immigrated and have a work visa. Without that, your application is most likely to be ignored.
We hire lots of adjuncts in my department. In terms of qualifications, the most important thing is teaching experience. Everybody thinks they can teach, but few can. We are wary of inexperienced teachers, and when forced to hire one (say, no one else applied), we often regret it. So write your CV around your teaching experience: the exact courses you have taught, if those courses had labs, what was your role (assistant, instructor-of-record, etc.), if you wrote the syllabus, selected textbook, etc., the level of the course (1st year, graduate, etc.) The more details, the better.
A little-used secret in getting adjunct positions is that, if you don't get the position, to tell the department chair to put you on the stand-by list. It often happens that departments need adjuncts last-minute, because of sickness, unannounced retirement, professors moving to another university or taking admin positions, other adjuncts dropping out at the last minute, etc. If you made a comprehensive list on your CV of classes you have taught, chances are you'll get a desperate call in late August asking if you can teach a class starting the following week. Once you prove yourself as an effective teacher, you are almost guaranteed to be called the following semesters.
Comment: That tip is much appreciated. Thank you. My feeling is that there's a lot of  information and presentation that gets left out in a resume or a cover letter which gets covered in an interview. Also the keywords vary from country to country. so maybe the recruiter might not get the right impression from the resume or the cover letter. is it possible to share my resume and cover letter with you so you can give me a more informed judgement. I know its asking a lot and i apologize. i just don't want to make a mistake and be out in the cold for an entire year. Thank you.
Answer: You are already doing the most important thing. Each discipline has slightly different ways of announcing academic vacancies. Also, have you noticed that many academic institutions now advertise vacancies and searches on their website?
(1) Make your visa status very clear on your Resume. While easier than in industry, hiring someone without the equivalence of citizenship / green card is more complicated, requires documentation, and smaller places are not set up to do it well.
(2) Translate your qualifications / job titles yourselves. Most institutions are familiar with foreign qualifications.
(3) Accents are a big worry when hiring someone for teaching. Make sure you include a phone number so that people can hear you talk, if they want to.
Comment: Much obliged Mr Thomas. You are correct about the accent issue. on the accent issue im fine. i was attending the linked in presentations for the past two days and they were adamant that connections make a difference. and i still have to make connections here. thank you for putting my mind at ease about other relevant factors. Much appreciated.


How to add page restrictions for blocks in drupal?

Question: I'm using the drupal administrator menu for the settings
there i have a page called /desert/234234
the block should appear only when the url is /desert/(desert_id)
how can i restrict that
Answer: In Drupal 7 you can use PHP code in the block's "Visibility settings."
Steps

Go to admin/modules and enable the PHP filter module

Go to admin/structure/block and click on "Configure"

Enter the following PHP code (including <?php and ?>) in the Page settings.
Answer: on visibility settings, choose two mode of visibility, for example:

type of content, choose one content type you want your block to show on
on page visibility, you choose hide for listed page, the type /desert/*/*
Comment: This is valid for Drupal 8, 9 & 10. Be sure to add the URL to "Pages" not "Route".
Answer: Make a block appear only when URL is something: On the configuration page of the block go to
Visibility settings -> Pages -> Show block on specific pages, and select "Only the listed pages." Wildcards may be used if needed; for example, desert/* would match any path starting with desert/.
Comment: i can do if it is a static page like desert/xxxxx        but my url is desert/id. here id is an dynamic content
Answer: Drupal 7:
1. Go to: /admin/structure/block
2. Click configure
3. In Visibility settings set "Only the listed pages" and in textarea below insert " /desert/* .
Also remember to activate block - put it in one of regions of the page.
Comment: i can do if it is a static page like desert/xxxxx        but my url is desert/id. here id is an dynamic content
Comment: Wildcard (*) replaces all characters. So url like /desert/* is equal to /desert/123456, /desert/abcdef, /desert/cake/apple and so on.
Comment: let me explain in clear. i'm having two pages desert/(13221)dynamic value and desert/continent.       The block should not display in desert/continent page. how can i restrict?
Comment: Then in the same tab you should switch to "Pages on which this PHP code returns TRUE (experts only)" and write some PHP [Read this for more help on this topic](http://stackoverflow.com/questions/7195769/drupal-php-block-visibility-rules). Or you can write your custom module and use [hook_block_info_alter](https://api.drupal.org/api/drupal/modules%21block%21block.api.php/function/hook_block_info_alter/7).


Web FrameWork for User and Group Management

Question: We are developing a Web app and looking for a solid existing framework/app that has User Management, Group Management, login screens, Group Admin screens, User SignUp, etc ...
I have a feeling that all SaaS providers require such a thing and there should be something existing and I dont need to write everything again. I have searched google but could not find any such thing but I am sure there is something like this as it is such a basic requirement for any Web App. It can either be in the form of a separate server or can integrate into our app, language is not important for us. Easy integration and customization is most important
Comment: Have you found anything in the meantime? I am looking for the same stuff...
Answer: Our Cloudseal platform handles user and group management, login, reset password, lock account etc. It's currently used primarily for intranet and extranet applications i.e. there is no end user sign up screen but we do have a REST interface so you could collect user details on your site and make a REST call to register them in Cloudseal.


How Independence and Mutually Exclusive connected?

Question: What can we infer from knowing that two (or more) events are independent or mutually exclusive?
Answer: Independence of events means that $$P(A \cap B) = P(A)P(B) $$
and mutually disjoint events are such that $A \cap B =\emptyset$. Therefore
$$P(A \cap B)= 0$$
EDIT: Note that if $P(A)>0$ and $P(B)>0$ then they can't be independent and mutually exclusive
Comment: That's not true in the continuos case.
Answer: [assuming I understand what you mean]: in the first case, $P(A \cap B) = P(A)P(B)$. In the second, $P(A \cap B) = 0$
Comment: If the events are independent, they are not mutually exclusive
Comment: So mutually exclusive $\rightarrow$  dependence?
Comment: You mean $A\cap B=\emptyset$, not $P(A\cap B)=\emptyset$.
Comment: yes, apologies. Intersect of sets is an empty set; probability is 0.
Answer: If two events $A$ and $B$ are mutually exclusive then
$$P(A \cap B)= 0$$ and so $$ P(A\cup B)=P(A)+P(B)$$
If two events $A$ and $B$ are independent then
$$P(A \cap B)= P(A) \times P(B)$$
Answer: You might want to supplement these correct answers with some intuition. When events are independent, knowledge of one tells you nothing about the other. When they are mutually exclusive, knowing that one of them happened means the other did not. So when events are mutually exclusive, knowing about one of them tells you a lot about the other - they are not independent.
Answer: If two events are independent then in presence of one of them does not guarenteed any information about the other one, meanwhile if events are mutually exclusive, then you might conclude something in presence of one of them.
Actually, two events $A$ and $B$ are independent if
$${\rm Pr}(A|B) = {\rm Pr}(A) \quad\text{ and }\quad {\rm Pr}(B|A) = {\rm Pr}(B),$$
which equivalent to
$${\rm Pr}(A\cap B) = {\rm Pr}(A)\cdot{\rm Pr}(B).$$
(In words) it means that it doesn't metter do we know any information about $B$, the probability of $A$ is the same in both cases. However, if the events are mutually disjoint, situation is different. For example, if $A$ and $B$ are mutually disjoint, and let's assume that the complement of one is the other:
$$A\cap B =\emptyset\quad\text{ and }\quad A\cup B=\Omega,$$
then
$${\rm Pr}(A) + {\rm Pr}(B) = {\rm Pr}(\Omega) = 1,$$
and as one can notice that, from knowing the ${\rm Pr}(A)$ we will find out ${\rm Pr}(B)$ and conversely. So, in this case events $A$ and $B$ are depending each other.


How/where does Google Photos store both Original & Edited photos?

Question: Google Photos has for some time allowed you to edit your photos and also undo the edits. This suggests that the edits are saved in a non-destructive manner. Where and how are these different versions saved?
Clarification points:

Original = The original photo as it was saved by the phone when taken. This assumes that you have saving photos in original enabled.
Edited = Any image you have edited within the Google Photos application (eg. cropping, rotation or exposure)
Even if Backup and Sync is not enabled surely the original & edited version need to be stored somewhere on the phone?

So far I have observed some different behaviour when I try and copy/sync the photos.

Browsing Google Photos on the web I see the edited photo by default but in the menu there is an option to Download or "Download Original."
When I browse the images on my phone I only see the latest edited image.
On the other hand, using Google Backup & Sync to sync my Google Photos + Google Drive contents I can only see the original photo in the photos folder.

For context: I am trying to understand how this works so I can figure out an appropriate workflow to incorporate backup & potential desktop editing in software outside of Google Photos (e.g. Lightroom).
Comment: vtc b/c Only Google knows. (Google knows everything.)
Answer: The following is equally applicable to phones, tablets and 'Smart Home' or digital cameras with: WiFi, sync and using the Android operating system; throughout I will use the word "phone" only.
On your phone photos are stored in the /storage/emulated/0/DCIM/ directory, this information is available by opening a photo, clicking on the menu, and choosing "info". Some 3rd party 'camera APPs' use their own choice of directory for storage.
Editing, with Android Oreo and any recent version, is performed by using the menu choice "Edit in" which lets you choose an Application to edit your photo - where each Application stores the results of editing varies greatly, some may overwrite the original while most save edited versions in their own directories.
If you enable sync on your device your phone's contents might be stored on storage provided by the manufacturer of your phone, a 3rd (4th?) party or most often on Android's author's servers at Google.
Go to https://photos.google.com/ to see any photos that Google has stored for you from every device. Click on the upper left Menu and go to Settings.

Choose "Original" and on each device setup "Backup and Sync" correctly.
In the upper right corner you can use that Menu to create a new Album. You can create an album called 'Edited' and copy an original photo there; edit that photo and not the original.
Whatever you do on that website (and any device with Sync on, and an Internet connection) will affect everything everywhere. There is only one copy on all your devices, so make a backup of your synced photos (don't think of synced photos as a "backup", think of them as your only copy).
You can name your originals as 'photo_org' any unedited copies as 'photo_copy_1' and edited versions of the copy as 'photo_edited_1' - you will have only one copy of each photo/video after each device synchronizes.
Comment: If you mean *physical* location and what type of medium that's off topic here and on topic at one of SE's computer oriented sites. Already your question goes past "photography" and into "software" but I feel it's a useful question even if pushing or overstepping the boundary. "How do Google's computers work" is way too far from on topic and may risk closure.
Comment: Not so much physical location on Google's servers but more specifically on your own phone or machine that is synced (perhaps the answer is it is only saved on googles servers and you don't have access to it?) & yes this is perhaps close to crossing boundaries into software but the context for wanting to understand is that to create a workflow to backup &/or edit images i would need to know what is currently available as a user - eg. if i only have access to the latest edited version then i need to create copies to keep the originals, but if i can somehow access the originals then i don't.
Comment: Thanks for the detailed response Rob - just to be clear i'm trying to understand how & where Google Photos saves the edited & original photos after you enable the "original" & "backup and sync" settings you mentioned - i will update the question a little more to make this clear. And yes i agree it is meant to be a sync of he photos instead of a 'backup' and my expectation is that if you edit a photo in place the edited version is synced across devices however the original still exists somewhere since the app lets you undo changes and the website does as well in which case where?
Answer: I've had exact same question about how/where edits are stored (hence ended up here). Don't know if you ever got to the bottom of it - I can't find much info online but made some observations that might be useful.

Unlike iOS that stores edits in "sidecar" files along with the original photo in the same directory, Google photos does not- I looked for special files of any sort in the DCIM structure and found none. Of course, they could store them elsewhere in the filesystem too (I don't have a rooted phone to dig into it)
By accident I also discovered that images with (undo-able/revertable) edits are only saved on internal storage but NOT on SD card- this is supposedly a "feature". When I switched phones and brought over my photos copied to SD card, I ended up with edited (but no longer undo-able, i.e. permanently saved) versions. They then also duplicated in Google photos via backup/sync, since it treats them as being different based on the file sizes, as I've concluded--for each original photo file, I now had two in Gphotos- one with un-doale edits, and one with permanently saved edits (the latter transfered via SD card between the phones)

The above leads me to believe that the edits are saved in some sort of a "database" that keeps links to all original files and possibly even dynamically applies the edits every time the file is viewed/rendered.
Another option could be keeping a separate file of each edited photo, effectively doubling (though not exactly) the storage used. The latter possibility though doesn't account for how and why cropping edits can be un-done (reset) separately from other edits (lighting, color, etc)- 2 versions of a photo (with and without edits) would not be sufficient to undo edits selectively.
So a database of edits/changes in some sort of markup language is more likely. That database wouldn't take that much space and could be easily synced to both Google photos servers and across all synced devices. I'm not sure why the database-based solution would exclude files on SD card though.
Now, these are all merely my conjectures so I may be way off here. Until Google decides to actually publish any sort of reasonable documentation for their products or someone really digs into what's happening "behind the scenes", I'm afraid your best option is not to use or rely on Google photo editing at all...
Comment: Note: this comment was edited by other users to remove an inappropriate racial comment. While that's now gone from the post and the remaining part seems fine, I'm going to leave my downvote until the original author addresses that in some way.


Software automatic content analysis of pdf files

Question: Is there an open sourc/ commercial software which can perform automatic content analysis (to produce wishful summaries) in a large collection of pdf documents which have tagged meta-data for easy classification? What is the technology Google uses to parse web-hosted pdf and rank them?
Answer: I'm unsure what Google uses, but it's possible to read and create PDF documents server-side with a software component such as ABCpdf.NET.  This requires some knowledge of programming in ASP or ASP.NET (Active Server Pages) for Microsoft IIS servers, or PHP for Apache web servers.
Comment: I'm looking for something which does the intelligent text mining in a vast database of pdf files..it can be a desktop app/scripts etc..Google can parse lots of different fileformats and search for textual content


Why does $n \choose k$ get you the $k^{th}$ (starting from 0) coefficient of $(a+b)^n?$

Question: I'm aware of the connection between Pascal's triangle and the binomial theorem, and how each edge, left and right if we consider the triangle to be a graph, represents multiplying by $a$ or $b.$ But how do we relate this to combinatorics?
Comment: When you foil $(a+b)\cdots(a+b)$, you need to choose $k$ out of $n$ of the factors to pick an $a$ from, and the rest will be $b$s. There are $\binom{n}{k}$ ways of choosing $k$ out of $n$ things.
Comment: In some presentations, it's the *definition* of $\dbinom nk$ (whence its name of *binomial coefficient*).
Answer: By definition $$(a+b)^n=\sum_{k=0}^n\binom{n}{k}a^kb^{n-k}.$$
Why this formula ? Let $A$ a set with $a$ elements and $B$ a set with $b$ element s.t. $A\cap B=\emptyset$. $(a+b)^n$ is the number of function from $\{1,...,n\}\longrightarrow A\cup B.$ But you can count them as following : The number of function that send $k$ elements of $\{1,...,n\}$ in $A$ is $$\binom{n}{k}a^kb^{n-k}$$
since you can take $k$ element from $\{1,...,n\}$ with $\binom{n}{k}$ possibilities, and each of those $k$ element has $a$ possibilities in $A$. After, the $n-k$ other are sent on $B$, and each element has $b$ possibilities in $B$. Notice that you can choose $n-k$ other element with $\binom{n-k}{n-k}=1$ possibility (in other way, you don't have the choice). If we denote $f_k$ a function that send $k$ element of $\{1,...,n\}$ in $A$ (and the other in $B$), finally,
$$(a+b)^n=\sum_{k=0}^n|\{f_k:\{1,...,n\}\to A\cup B\}|=\sum_{k=0}^n\binom{n}{k}a^kb^{n-k}.$$
To finish, even if I understood what you tried to mean, to talk about the $k-$th coefficient of $(a+b)^n$ has no sense. It would have sense if you would have ask the $k-$th coefficient of $(a+b)^n$ in $\mathbb R[a]$ (or in $\mathbb R[b]$, but it's not the same coefficient).
Answer: There are $n$ factors of $a+b$ in $(a+b)^n$ and each can contribute an $a$ or a $b$. To get the number of ways those factors can multiply to $a^kb^{n-k}$ we choose $k$ of the factors to contribute an $a$ (and the remaining $n-k$ contribute $b$). That show that there are exactly $\binom{n}{k}$ ways, so that is the coefficient.
Comment: what does mean : "There are $n$ factors of $a+b$ in $(a+b)^n$ and each can contribute an $a$ or a $b$" ? It's difficult to understand why an incomprehensible answer can be accepted (and upvoted) (-1)
Comment: Um, it means that $(a+b)^n = \underbrace{(a+b)(a+b)\dots(a+b)}_{n \text{ times}}$ and that when multiplying, each factor contributes an $a$ or a $b$. Was that really unclear?
Answer: Write the whole product:
$$(a+b)^n=(a+b)(a+b)\cdot\ldots\cdot(a+b)$$
To get the coefficient of $\;a^k\;$ in the above, you have to take all the possible products of $\;a\;$ with itself $\;k\;$ times, which is just the same as choosing all the subsets with $\;k\;$ elements in a set with $\;n\;$ elements, as each such subset represents just one of the above products.
Answer: $$(a+b)^n=\underbrace{(a+b)(a+b)\cdots(a+b)}_{\text{n times}}$$ To get a term of the form $a^kb^{n-k}$ we need to choose an $a$ out of the $n$ factors $k$ times and a $b$ out of the remaining $(n-k)$ factors $(n-k)$ times. Hence the coefficient of  $a^kb^{n-k}$ in the expansion is
$$\binom{n}{k}\binom{n-k}{n-k}=\binom{n}{k}$$
As an example consider
$$
\begin{align}
(a+b)^3
&=(a+b)(a+b)(a+b)\\
&={aaa}+{aab+aba+baa}+{abb+bab+bba}+bbb\\
&=\binom{3}{3}a^3+\binom{3}{2}a^2b+\binom{3}{1}ab^2+\binom{3}{0}a^0b^3
\end{align}$$


Adding UIGravityBehavior and UIPushBehavior after a collision takes place in iOS 7

Question: I'm messing around with the new physics API in iOS 7.
I decided I would make a simple game, I have a character who can move around the screen at a tap of the finger, periodically, shapes fly up from the bottom and if they hit the character it's game over.
I have implemented all of the above and it works great, however, the only thing that doesn't is the character falling when a shape collides with him.
All collisions work, my problem is trying to make the character fall when the collision takes place. Because I don't want the character to be able to fall before this (lets say he's levitating while trying to avoid shapes) I decided to add the character to the gravity when the collision happens, and it does, but first, the character shoots upwards as the collision animation continues.
Is there any way to prevent the collision animation from happening? Is there a better way?
Here is my code in the collisionBehavior:beganContactForItem:withBoundaryIdentifier:atPoint: method:
//  Main Character
//
if ([item isEqual:self.mainCharacter]) {
    [self.collision removeItem:item];

    //          Push
    //
    UIPushBehavior *pushBehaviour = [[UIPushBehavior alloc] initWithItems:@[self.mainCharacter] mode:UIPushBehaviorModeInstantaneous];
    [pushBehaviour setPushDirection:CGVectorMake(0.0f, 1.0f)];
    [self.animator addBehavior:pushBehaviour];
    [pushBehaviour setActive:YES];

    [self.gravity addItem:item];
}

Comment: Just a shot in the dark, try `CGVectorMake(0.0f, -1.0f)` for your gravity values.
Comment: Please mark your answer as accepted so this question doesn't still show open.
Answer: It turns out I should have been using the collisionBehavior:beganContactForItem:withItem:atPoint: and testing BOTH items in this method to see if it is the mainCharacter


How can I set up a second Twitter feed?

Question: I wanted to start a separate Twitter feed on a specific topic (with a different user name) that is separate from the primary one I use. When I tried to create the second account it wouldn't let me because it said my e-mail account was already in use (by my primary account, of course).
Is there a way to have two Twitter feeds that doesn't force me to set up another e-mail account somewhere just to use for Twitter?
Answer: If you happen to use GMail, you can fool the system.  On GMail's end, they ignore "." and anything after a "+" in the username.
All of the following are equivalent in GMail's eyes and would end up in the same inbox:

rchern
r.chern
r.c.h.e.r.n
rchern+twit1
rchern+twit2
Comment: That worked great. My e-mail address at gmail was email@example.com and I confirmed that email@example.com does go to the same inbox. Cool!
Answer: If you use gmail, you can register using username+[anything]@gmail.com (replace [anything] with whatever you want) and it will count as a different address.
I don't think it's possible without using another email address and yes it is stupid.

How can I set up a second Twitter feed?


How can I see where I have used myopenid as login?

Question: Some time ago I was using myopenid.com on SO sites. Traveling around, I have seen it is still registered on one of sites or settings (within a title something alt openid or alt login etc.). Unfortunately I lost it suddenly. I want to remove it because I do not use it anymore. Where can I find it, any ideas are welcome.
Answer: On your profile page on Stack Overflow, go to the "Edit Profile & Settings" tab and click the "My Logins" section:
Comment: There is only Stack Exchange account there, currently I am using.
Comment: Then you must have removed the MyOpenId one at some point. (given they've stopped operations a couple of years ago... not surprising).
Comment: I have seen it in some records this morning, but I did not have a chance to remove it. I even can not find that page (with `alt sth.`).
Comment: From what I can see against your account, a myopenid credential was removed from it about 3 years ago.
Comment: I have found it on https://careers.stackoverflow.com/users/info/350xxx, thanks for spending me some time.


What Command Would I Use To Give Someone A Stone Pickax Thats called Amazing Man and can break leaves?

Question: I Am Building A Map And I Need A Pickax That Is Called Leaf Breaker And Well Can Only Break Leaves, What Do I Do?
Comment: Have you made any attempt to solve this yourself? Arqade works better when askers show effort to solve their own problems; we see that you have a problem you've worked on, and answerers respond to that. You also get a more specific answer that's tailored exactly to the part you're stuck, and Arqade gets a very specific question. Everybody wins!
Comment: You are getting down votes because your question shows no research.  The answer to this question is easily obtainable with a web search.  Also the title to the question is asking for a pickaxe named Amazing Man and the body of the question is asking for it to be named Leaf Breaker.
Answer: For things like this, you can use a give generator.  It makes it easy and does not require command knowledge.  Here is the generator I used for this answer.
I will give two commands.  One without silk touch that will break leaves but not drop them, and one which will break and drop leaves.
Here is the command without silk touch:
<code>/give @p minecraft:stone_pickaxe 1 0 {display:{Name:"Leaf Breaker"},CanDestroy:["minecraft:leaves","minecraft:leaves2"]}
</code>
Here is the command with silk touch:
<code>/give @p minecraft:stone_pickaxe 1 0 {display:{Name:"Leaf Breaker"},CanDestroy:["minecraft:leaves","minecraft:leaves2"],ench:[{id:33,lvl:1}]}
</code>
Answer: Do
<code>/give @p minecraft:stone_pickaxe 1 0 {display:{Name:"Leaf Breaker"},CanDestroy:["minecraft:leaves"]}
</code>


Add customer store view wise

Question: I am working on multi store website.I want to add customer store view wise because at present my customres login from any store view but i want to restrict to store views.How it is possible?
Comment: Theoretically, customers should not be restricted at store-view level, concept of store-views suggests that a customer registered at any store should be able to access other store-views. If you have to, I'd suggest considering second website instead of store-views(or stores).
Comment: But how we can restrict a customer which are using store A view not login into Store B view
Comment: If your business logic really wants that scenario, I'd suggest creating website A and Website B, instead of Store A and Store B.
Comment: But i want with Store A and Store B. How can i do this.
Comment: It wouldn't be possible out of the box in Magento, you'll need to modify the scope of customer entity. If you know how EAV entities work, you can try your luck with that, otherwise I'd suggest searching for something pre-build for this situation.
Answer: Go to

System => configuration

Select

Customer Configuration under Customers tab.

There you can make Share Customer Accounts to Per website rather than Global.
http://prntscr.com/8nw5fq
Comment: Yes i am using per website setting but i want customer for "Store Views".
Comment: If you have to limit per Store, then you will need a module to introduce that.

Add customer store view wise


Android Programming HtmlUnit

Question: I am using httpclient on android, and I have added all the external jars to my classpath. However, when I startup eclipse it gave me java heap space errors, so I went in the .ini file and I "upped" the numbers, and it worked. However, when I try to start the application on my android emulator it wil not start, and when I try to load it on my phone it says it cannot be installed even though I have unliscenced sources turned on, on my phone. Is it possible that i have "too many" .jar files in my android project? Also I get errors in my project when it builds the workspace, please look bellow
Thanks so much!
<code>[2011-09-05 22:30:39 - AndroidTest] Dx warning: Ignoring InnerClasses attribute for an
anonymous inner class
(org.apache.xalan.lib.sql.SecuritySupport12$8) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
</code>
Answer: HttpClient is built-in to Android Framework. You don't need to add another .jar file to use HttpClient.
http://developer.android.com/reference/org/apache/http/package-summary.html
Comment: Im still looking at httpclient, thanks. Turns out I was actually using htmlunit in my program. I feel like an idiot :P sorry. but I am looking into this apache library

Android Programming HtmlUnit


Use SharePoint:MultipleLookupField control in visual web part

Question: In visual studio, I had a drop down list whose data source was connected to a LINQ query. Because there are many records, the client ask for a searchable control. I have replaced the drop down list with MultipleLookupField in the ascx page in visual studio. How can I bind this control to a data source? Is it possible to show checkbox beside each records?
Comment: Instead of using MultipleLookupField, would you prefer to use AutoComplete on a textbox control? You can use CAML query to filter the data. Complete doc is at http://sympmarc.github.io/SPServices/value-added/SPAutocomplete.html
Answer: Did you create visual web part in SharePoint 2010, SharePoint 2013 or SharePoint 2016?
Per my test in my SharePoint 2013 environment, then I cannot find the SharePoint:MultipleLookupField control which can be added when creating visual web part.
You could add the control and bind the data source using C# code in code behind.
There is a similar post:
https://social.msdn.microsoft.com/Forums/vstudio/en-US/a2e26cea-4b36-471d-a035-f51f693e1ac7/sharepoint-multiplelookupfield-control?forum=sharepointdevelopment


Uninstalled Compiz and OpenGL - Ubuntu won't load

Question: About a week ago I installed CCSM and enabled wobbly windows. After using the autoremove command today, it was gone.  I decided that if I re-installed Compiz that maybe it would come back.  I un-installed Compiz and it's OpenGL window and compositing manager.  While those were being removed icons started disappearing, I restarted my computer after that. When the computer restarted, Ubuntu was stuck on it's loading screen with the dots.
I used the tty1 terminal to re-install Compiz, unity, and the ubuntu-desktop.  While doing this I got the E: Failed to fetch errors.  I've been trying for hours hopelessly reading other questions, but no luck.
Also, if I press the up button on the loading screen, this shows up with [OK] on the far end:
http://puu.sh/iedJV/fe737b9eb7.jpg
Comment: Not sure what you've expected. Compiz is the default window manager in Ubuntu, after all.
Comment: I'm still learning. Big mistake on my part I guess.
Answer: Try running the updatedb command as root first the perform the locate on the wpa_passphrase again
:~$ sudo updatedb

:~$ locate wpa_passphrase

if you still have the wpa_passphrase, try running the iwconfig command and see if your connected to a network.
:~$ iwconfig

the output should be something like this:
wlan0     IEEE 802.11bgn  ESSID:"Your-Routers-name"
      Mode:Managed  Frequency:2.462 GHz  Access Point: 84:24:8D:4E:75:00
      Bit Rate=57.8 Mb/s   Tx-Power=16 dBm
      Retry  long limit:7   RTS thr:off   Fragment thr:off
      Power Management:off
      Link Quality=53/70  Signal level=-57 dBm
      Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
      Tx excessive retries:9  Invalid misc:15   Missed beacon:0

if your ESSID declares your routers name and you have a legitimate bit rate then run the following commands:
:~$ sudo apt-get update && sudo apt-get -f install -y && sudo apt-get upgrade -y &&  sudo apt-get -f install -y

and post the last 5 or 10 lines from the execution of the commands before control is returned back to prompt, like run the commands and what does it say at the bottom of the output. If it says
dpkg error sub-process [1]

than you have broken packages and I tell you how to track them, and remove them.
Comment: if you do, ill get you up and going again
Comment: Yeah, I do the `iwconfig` command, but it says I have no connection.
Answer: As of 1700 EST: Yea sound like you had Network connectivity problems. After you run the updatedb command and verify that you have wpa_passphrase, and if indeed you do, check to see if you have your last network connection still located in
/etc/NetworkManager/system-connections/The-name-of-your-router

If indeed you do have that file with your router address and encryption information, you need to get networking up and going. To do this gain root privileges and restart or possibly force-reload your network. For Example:
:~$ sudo bash

assuming your using a laptop with wifi (wlan0), as opposed to a hardwired ethernet cable for internet (eth0) you should relabel your essid
:~# iwconfig wlan0 essid "Your-Network"

Then restart your network
:~# /etc/init.d/networking restart

Once you get back online run the
:~$ sudo apt-get -f install -y && sudo apt-get update

Then reinstall the ubuntu-desktop
:~$ sudo apt-get install ubuntu-desktop

Let me know how it goes.
JUNE 13, 2015
Sorry ig,
I had looked at this post a couple of times during the week and I hadn't noticed your comment.
No you're not root. On linux systems (e.g. Ubuntu) there is only one root user who is the only member of group root. You gain super-user privileges with the sudo command, for example:
:~$ sudo bash

:~# cat /etc/NetworkManager/system-connections/your-routers-name > $HOME/your-routers-name.txt

:~# chown 1000:1000 your-routers-name.txt

Note: the previous command assumes your user and group id numbers are 1000:1000 respectively, your can test this by using the id command
:~$ id your-user-name

:~# exit

On Ubuntu, unlike just about all other Unix/Unix-like Operating Systems, there are certain features that are advantageous to gaining super-user privileges using fakeroot (sudo bash). One, which pertains to using the
:~$ cd

command (by itself when working out of your $HOME) while having temporary root privileges, which on most systems would enter you into /root; on Ubuntu it will simply take you into your $HOME dir. The other is being able to use the $HOME variable with temporary root privileges to work with files. If you are the login user of the initial session, the environment variables for the session apply to your interactions in the terminal while having temporary root privileges. e.g.
:~$ sudo bash

So just gain root privileges and then copy file with cat or the
:~# cp

command.
NOTE: Your only doing that to verify there is a file that has the same title as your routers name (your network access point).
I am so sorry I didnt get back with sooner.
Im gonna be on here on and off today. Post back
Comment: After I do the `/etc/NetworkManager/system-connections/The-name-of-your-router` command it gives me a 'Permission Denied' message.  I am root.


Converting EC2 instance from instance-store root device to EBS root device

Question: I have a running 32-bit Windows EC2 instance whose root device is of type instance-store. I would like to bundle it, create an AMI, and then launch a new EC2 instance from that AMI, but change its root device to type EBS.
I can't find a way to do that in the AWS console, nor can I find documentation telling me I can't.
Is this possible, and if so, what tool can I use to do it?
Answer: You can create an EBS root instance from your windows instance, for that you need to do the following steps.

Create an EBS volume with the desired size, mount it to running instance
Use some kind of cloning tool for cloning your windows disk contents to the EBS volume
Unmount EBS volume
Create a snapshot of the EBS volume
Use the EC2 command line tools to create a new AMI based on the snapshot, you can see an example of that in this post (just follow the last step to register the snapshot)


Scaling models for 3D print

Question: So I need to print out this model, however with default sizes, one of the pieces is too large for my printer (M3D). I will need to scale it down.. the question is, do I need to scale the rest of the individual objects (pieces) in the same proportions, so I will be able to assemble all the parts afterwards ? This might be a bit of a stupid question, but I don't have any experience with 3D printing yet.. thank you.
Comment: (A belated) Welcome to Computer Graphics SE! I'm afraid questions about 3D printing are not on topic here, as this site is about computer graphics programming and research. Unfortunately, I can't think of any better Stack Exchange to redirect you to either. There *is* [a proposal for a 3D Printing SE](http://area51.stackexchange.com/proposals/82438/3d-printing-and-rapid-prototyping) in the commitment phase though, so you might want to keep an eye on that.
Answer: Just like for any reduction or drawing, if you scale one part and not the other, their relative proportion is changed, so yes, aesthetic, matching, functionality are affected: scale everything in the same proportion. Nothing specific to 3D printing here.

Scaling models for 3D print


How to transfer record ownership from one user to another in salesforce1

Question: Salesforce1 app doesn't have an option to transfer record  from one user to another. Is there a way to customize the app providing an option to select new owner of the record using mobile SDK or lightning.
Answer: Since you appear to be looking for guidance on how to go about doing this, I'll offer a few ideas that might kick-start your efforts.
First of all, the answer to "is there a way?" is, "Yes!"
In all likelihood there are probably several ways. Some considerations.
Is this a request for one particular object? Like Account? If the pain-point is specific, like that, it will be an easier solution, as you can write your code in an object-specific manner, which would favor a straightforward one-off Visualforce page + controller.
But if this is a global request: we want to be able to change ownership for every object we use in S1 Mobile, then you're looking at more work, especially given the way Visualforce works.
Let's take a publisher action.
A Visualforce publisher action that sits on an object page needs to use the Standard Controller for that object. Meaning you need to create a new page for every single object that you use in S1 Mobile. Furthermore you will need some custom Apex. Here, you might come up with a way make your controller abstract enough that you might get away with only writing one Apex class.
And finally there is the question of objects that can also be assigned to a queue. This is not so hard to test for, but you would need to create logic that would enable your user to assign the record.
Given what is available today, this would be my approach: Visualforce publisher action. The creation of individual pages for each object would be a PITA, but it would offer a lot of advantages from the UX perspective.
Lightning Components will probably have some additional features to support making this kind of customization easier in the future, but the only implementation option Lightning Components is a tab in S1 Mobile. That might be a fit for an Admin UI for mass ownership changes, but not to reproduce something akin to the standard change object ownership feature that exists today.
Mobile SDK is about building customer-facing mobile apps, really. I think building a mobile app using the Mobile SDK just to do ownership changes would be overkill.
Comment: Very good clarification. Would be great to have this on the roadmap as standard feature.
Answer: I don't think that mobile SDK will be of great help inside the salesforce 1 mobile app. But transferring the owner should work easily with Lightning or Visualforce+Apex.
Look into an example to edit a single record. Take an userpicker and bind it to the owner field.


Can I ask same question in multiple sites?

Question: Can I ask same question in both stackoverflow.com and programmers.stackexchange.com or maybe other Stack Exchange site? or it will be duplicate question?
Comment: related: [What difficulties could be there in establishing automatic checks for SO cross-posts on a site like our (50-100 questions a day)?](http://meta.programmers.stackexchange.com/q/6660/31260)
Answer: This is the official guidance for cross-posting questions between Stack Exchange sites. In short, each site is a different community. Even if the question would be on-topic on multiple sites, you should read each site's Help Center to find out what is and isn't on-topic and similar questions to find out the types of answers each site provides, and then ask the question where you feel you'll get the best answers. If you aren't getting the answers you need, moderators can migrate it if it's necessary. Alternatively, you can always ask a new question on a new site that is worded differently to get better answers. However, simply copy and pasting questions between sites isn't recommended.
Answer: Nope.
Well, technically you can, but it's preferred if you don't.
Posting duplicate questions on multiple sites makes it harder for future users to find the answer to the question.


How exactly does a remote program like Team Viewer work?

Question: If you make use of Windows RDP or Remmina, you normally use the IP (public) or attached hostname of the server to log on. I was wondering how a remote program like Team Viewer works? And also, how does the program know how to route that traffic over the internet?
Answer: TeamViewer, LogMeIn and any other program that allows a zero config remote desktop session uses a third-party server.
For example, LogMeIn is a program similar to TeamViewer where you are able to remotely login to a computer outside of the network that you're currently on. You will notice that there are no external configurations required for this type of remote session. This is due to the fact that the software that you installed on the remote machine (the LogMeIn client) initiates an outgoing request to the LogMeIn servers. Since this client initiated the request, no port forwarding on the Firewall is required.
On your computer, outside of the network of the LogMeIn computer, can access this computer remotely through LogMeIn's website. This website accepts the initiated request from the remote computer and keeps the connection alive to listen for a remote session request.
When you run TeamViewer, you are assigned an ID on their broker server. You make a connection to a Teamviewer ID, and TeamViewer passes the connection down through the TeamViewer client's established tunnel to the destination and you then you are prompted for password and then the connection establishes afterwards.
Comment: Extended question: Is there any possibility to run such a third-party server yourself and make VNC (or any other client) work the same way?
Comment: Good question. In this way you'll on the path for create a new TeamViewer company...
Comment: @TheStoryCoder any luck? I think we need to create the communication protocol first between server and client, then build the tcp server. RDP is the default protocol by windows, but i guess it is not designed to support this. I know that TeamViewer use their own protocol. I really hope that someone out there already create an opensource project for it :)
Comment: @TheStoryCoder A simple way but with less security: you can have a server installed OpenVpn(server A) and your PC(PC A) is connected to internet through that server. And you have another PC(PC B) only accepts incoming connections or remote desktop (if windows) from your VPN server. That way you can connect to that PC B from your PC A which establishes connection through server A.
Comment: Does this mean that all traffic between client and server is routed over the internet even if both devices are on the same LAN?
Answer: Teamviewer uses port 80 to make a connection to a central server. If the connection is made, you get a unique ID, and the server knows you're online. All communication can happen over port 80 if other ports are blocked.
Teamviewer does allow you to connect directly to an IP-address. You have to set this in the options, to allow incoming LAN connections. This works for local networks, and probably for WAN networks as well, but then you have to get portforwarding working, to get port 80 to connect to the right computer behind the router/firewall. That makes things difficult for most people, and unmanageble for most of the rest, so then we use the Teamviewer ID method.
I don't know if this means that all traffic goes via the teamviewer servers, but it might. (And as it registers all clicks and keypresses, that probably means that they could - in theory - and since we know about PRISM etc probably in reality as well - know about all your logins and secret keys.)
Answer: This is what the company says in their Security Statement:
When establishing a session, TeamViewer determines the optimal type of connection. After the handshake through our master servers, a direct connection via UDP or TCP is established in 70% of all cases (even behind standard gateways, NATs and firewalls). The rest of the connections are routed through our highly redundant router network via TCP or https-tunnelling. You do not have to open any ports in order to work with TeamViewer!
As later described in the paragraph "Encryption and Authentication," not even we, as the operators of the routing servers, can read the encrypted data traffic
So:

1) as others have suggested, the initial connection from both clients is client-initiated and
goes through port 80 so it has no problems with NAT or firewalls,
can go through a web proxy, etc. After this, everything is set up and both clients need to be connected to each other, then:
2.1) probably uses UPnP or NAT hole punching to be able to do an actual connection between the two clients, or
2.2) if not possible it will route the traffic through their servers, which will be slower and could be spied on (however they state that the data is encrypted end to end, in that case that would not be a problem)
Comment: any opensource solution that you might aware?
Comment: @AltianoGerung a bit late, but have a look at nomachine. You have to be in the same network (vpn or so), but it allows you to use ssh and log in with your linux user credentials. Highly recommended.
Comment: @AltianoGerung I don't know any opensource ones that work without opening ports like Teamviewer
Answer: Most applications like TeamViewer route things through their servers if there's no direct path available, therefore bypassing the need to use public IPs and open ports.


Convert existing SVN repo to git-svn

Question: I have an existing SVN repo. The remote is SVN too. I would like to use git-svn to manage it locally.
How can I do that without having to check out all the files again?
Answer: The recommended link to begin with
https://help.github.com/articles/importing-from-subversion
Some previous stackoverflow discussions
Convert an SVN checkout to use git (git-svn)
How to migrate SVN repository with history to a new Git repository?
Other links for reference
http://john.albin.net/git/convert-subversion-to-git
http://www.mabishu.com/blog/2011/01/13/migrate-subversion-repository-to-git-without-loosing-data/

Convert existing SVN repo to git-svn


Why does it use temporary? (MySQL)

Question: MySQL 5.
I have the following table (filled with many rows):
CREATE TABLE `SectorGraphs2` (
  `Kind` tinyint(3) UNSIGNED NOT NULL COMMENT '1 - продюсер, 2 - жанр, 3 - регион',
  `Criterion` tinyint(3) UNSIGNED NOT NULL,
  `Period` tinyint(3) UNSIGNED NOT NULL,
  `PeriodStart` date NOT NULL,
  `SectorID` int(10) UNSIGNED NOT NULL,
  `Value` float NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

ALTER TABLE `SectorGraphs2`
  ADD UNIQUE KEY `Producer2` (`Kind`,`Criterion`,`Period`,`PeriodStart`,`SectorID`) USING BTREE,
  ADD KEY `SectorID` (`SectorID`);

then I run:
EXPLAIN
    SELECT SectorID, SUM(Value)
    FROM SectorGraphs2
    WHERE Kind = 1 AND Criterion = 7
      AND Period = 1
      AND PeriodStart >= ? AND PeriodStart < ? + INTERVAL 1 WEEK
    GROUP BY SectorID

and it produces:
+---+---+---+---+---+---+---+---+---+---+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+---+---+---+---+---+---+---+---+---+---+
| 1 | SIMPLE | SectorGraphs2 | range | Producer2,SectorID | Producer2 | 6 | NULL | 1 | Using index condition; Using temporary; Using filesort |
+---+---+---+---+---+---+---+---+---+---+

I wonder why it uses a temporary while all keys Kind, Criterion, Period and PeriodStart are in the key Producer2 and it can be calculate by just enumerating the last field PeriodStart of the key. (Accordingly to what I learned, MySQL can enumerate the last field of a key without consulting data, if all previous fields have a fixed value.) Please help if possible to rewrite this without using a temporary.
Note that the above code is intended to store and calculate some statistics.
I need to ensure we do not run heavy queries which may overload our MySQL server. Please help to make proper use of indexes and avoid big temporary tables.
Comment: There are five different minor versions in major version 5: 5.0, 5.1, 5.5, 5.6, 5.7. Which one do you use?
Comment: It probably uses temp/filesort because `value` is not in the index. It also needs to do the sorting for the `GROUP BY`. Is the query slow?
Comment: we use MySQL 5.5.49-log
Answer: Step 1: Filter (WHERE) to get just the desired rows.  Producer2 is excellent for that.
Step 2: Now do the GROUP BY.  Well, the rows from Step 1 are not ordered by SectorID (because of the "range" on PeriodStart left things shuffled.  This could be done in one of two ways:  Via some hash in memory, or by sorting (probably in RAM) and doing a simple pass through the data.  It is hard to say which is faster.
You should move away from MyISAM.  This particular query will probably run faster with InnoDB because of the way indexes are handled between the two engines.
Your query is an example of one thing I talk about in my index cookbook -- "an index cannot handle both a range (PeriodStart...) and a GROUP BY.
I am suspicious of "Using index condition".  That is a synonym for "ICP" or "Index Condition Pushdown", wherein the high level handler lets the Engine do some of the index work (more efficiently).  However, I thought that MyISAM was not updated to do any ICP work.  If I am correct, then this is another reason for moving to InnoDB; it does benefit from ICP.
If this is a big table, we can talk about another way to speed up the query (perhaps 10x) -- Summary Tables .

Why does it use temporary? (MySQL)


Investing small portion of assets with financial advisor

Question: I have seen most financial advisors charge a fee on managed assets amount. Instead of having all assets with FA, can I just have 10 percent managed and then scale up the rest myself on another account? What I mean is that this 10 percent is meant to be invested for retirement long term and I would see all the rebalancing and holdings, so I can copy them myself on another account and thereby not pay a fee on the rest of 90 percent. Or am I breaking some laws here? Based in the US
Comment: Breaking a law? unlikely. But you're being unethical.
Answer: If the advisor was acting in your best interests, they would want to see your entire financial picture. That way they would know the purpose of the funds they are helping you with.
If you don't tell them about your bank accounts, retirement funds, taxable funds, or funds for your child's education; how can they give you advice that is tailored to your situation.
You would be better off finding an advisor that can for a set fee give you advice that takes into account your entire financial picture along with your income and plans.
Hiding all of this except 10% will give you a plan that doesn't match what you need.
Comment: @Medan So you don't need to "put your assets with a financial advisor", then, you need one to tell you where *you* put your assets. Financial advisors don't move your money between different stocks... they give advice... that's why the name says advisor. You might be thinking of actively-managed funds and the general advice is to not use them.
Comment: the only reason is that I need help managing cash. I do have bunch of other small things but I have lots more cash. And it is accumulating so I need long term plan for that so it generates income. 401k are fairly small compare to my investment amount and I simply need a portfolio that I will hold until retirement. I don't have the time or expertise to decide what and when to buy on the stock market. Investment should not change whether it is say 1mil or 10mil.
Comment: @user253751 you are right, fair point. I think I misunderstood the role of it. Thanks
Answer: Please provide a location, however I am assuming the US.
Many advisers will offer, free of charge, advice on what funds to use in your 401K provided you are a client for your other accounts.
What you are suggesting is allowable by law, but in some cases not permissible and it may not even be in your best interest.
First you would have to keep the "90%" secret as the adviser will push to get that other 90% (assuming it is outside your 401K).
Second you will have to seek an adviser that uses publicly traded funds only.  There was a time that there were many funds that were closed to the general public, one had to have an adviser in order to invest.  I am not sure of the current status of this kind of thing, but I am sure there are some.  Much of the information is close hold so it would be difficult to replicate this with publicly traded funds.
Third is why?  Many advisers use heavily loaded funds.  The tell tale sign of this is having to choose between "A shares, B shares, or C shares".  While index funds from the larger brokerage houses (Vanguard, Schwab, and Fidelity) run in the tenth of a percent these funds can be over 5% per year.  If they do out perform the market they rarely make up for the increased costs.  Even actively managed accounts from those larger houses have fees that are a fraction of those used by many advisers.
Most advisers use a cookie cutter model for clients, especially smaller ones.  Given that you are suggesting 10% of your portfolio, it is likely you will always be a smaller one.  That pattern is 40 to 80% in stock funds, 10% in real estate funds, and the rest in bond funds.  If you find a particularly bad adviser they might suggest some gold or crypto.  The percentage of your stock to bonds will depend on your age and risk tolerance.
This is pretty easy to replicate using index funds from one of the previously mentioned brokerages.  Building money in your 401K is a bit different as you are typically limited on choices.  If you're talking about retirement money, just go for 100% stocks until you are close.  And don't worry about interim swings.
In my own case, my retirement funds follow one model, my taxable accounts another, and my HSA account another.  It is unlikely that someone else can come up with as detailed a plan as I have done for myself.
IMHO a person will have at least two jobs during their working life.  The first is whatever profession they choose.  The second is to manage their finances.  No one can do that for you effectively as you can.
Comment: Note that if you go with a strategy based solely on maintaining a specific ratio of index funds, rebalancing occasionally/as necessary, and reconsidering the percentages once a decade or so or when major life shifts occur, that second "job" can be an hour or two a month. Maybe less. You *can* spend as much time as you like playing with your money, but you don't necessarily have to.
Comment: I don't think those FA have access to something more profitable than public does. That means that comes with additional risk. Basically if he or she skillful enough they can generate good investment strategy even based of public traded funds, there are enough options out there!
Comment: @keshlam because I need a human to keep an eye on things. Say I chose 5 sectors, invested, and then 6 months from now the FA would tell me that one of the assets is not a good long term asset and I should invest in something else. Say swap energy for REITs. I could have bought both at the beginning and held of course but this is where I need the expertise of someone to tell me what are the assets to invest in!
Comment: @keshlan the hardest part is to choose sectors to invest it. There are simply too many, basically endless, do I choose 2, 5, 15, 20? The more it is the better diversified but then it is more work to rebalance and I am trying to use FA expertise to choose the best investments at the time and then rebalance when they seem it is the time and not just end of each quarter!
Comment: See other answers. Get a strategy that suits your risk horizon and timeline, mixing one low-fee index fund each of large cap, small cap, bond, international, and "income" indexes. (A REIT index is what I use for the last). Periodically check how the percentages have drifted and rebalance to that strategy. Ignore everything else. Collect market rate of return. _Done_. It is extremely unclear that a more active advisor can make you enough additional profit to cover their fees.
Comment: @keshlam: what I am mostly afraid to miss is the time to rebalance. I think it is better to rebalance where there is the most discrepancy in ratios, that's is the percentages drifted off more than say 5%. I can set the schedule do it say quarterly but would like to be alerted when it is the best time. Don't robo advisors such as betterment to it for me? Are those any better than do it yourself?
Comment: I just update a spreadsheet periodically to see what wants rebalancing and how badly. I rebalance roughly once a year or when something is 1% off from my desired mix, which means that under normal circumstances I rebalance every three to nine months... so if you're waiting for 5% either either you're trying to minimize fees or you have a very different investment mix than I. I should note that I treat all my investments as a single pool, and do the rebalancing in my 401k, where there is no transaction fee *and* no tax implications.
Answer: The advice that you'll get from a financial advisor will often be different depending on the total size of the portfolio.
There are some investments that have minimum investment amounts. If the advisor only knows about 10% of your worth, they won't advise investments that would require committing a large chunk of that to a single asset.
If the advisor thinks you only have a small amount to invest, it's harder for them to diversify your portfolio. They might recommend just 2-3 different investments, when you would actually do better with 5-6 (or even more), to balance your portfolio better.
Fees are often based on the size of the portfolio that the advisor is managing. So you're a more valuable customer if you have a larger portfolio being managed by the advisor, and you'll likely get better service.
All that said, it's entirely possible that what you may lose in net returns will be offset by what you save in advisor fees.
Answer: Financial advisors who are paid by a portion of funds under management (let's say 120bp) have access to financial instruments and services unavailable to the general retail investor.
To the extent that your financial advisor holds common stocks, ETFs, mutual funds, etc., nothing is stopping you from mirroring the advisor's actions on funds not under management.
However, a financial advisor has access to share classes in the institutional level, with large minimum trade quantities.
More important is the role of a "Manager of Managers". In this scenario your advisor works with Separate Account Managers (individual portfolio managers) who specialize in different aspects of the financial world. So, if the advisor thinks that XYZ Advisors has a good track record with a particular market sector and security type, the advisor opens an account with XYZ with pooled funds from the investments under advisement.
From Investopedia:

They determine an appropriate portfolio with allocations to various
sectors and segments of the market. The manager of managers then hires
a number of investment managers to manage assets in the various
categories, investing portions of the pension funds assets with
various investment managers. Funds can be allocated to multiple
categories including money market funds, bond funds, and stock funds.

This is what investment managers do that is unavailable to retail investors. The Separate Account Managers do not accept non-institutional clients.
All of these relationships involve active management, and the management fees pile up. The key question is does what the Manager of Managers offer consistently outperform the indexes by substantially more than their advisory fees?
Comment: that's true, they might outsource the sleeve but the question if their expertise will outperform those 120bps. I might just get a sector ETF and hold it for small ETF expense fee. what I need help with is to choose sectors!
Comment: In my experience most FA just sell the same old funds to everyone making a big deal out of "fine tuning" diversification and volatile/non-volatile ratio.


How to install themes in Android 4.1.2

Question: I have heard many applications from play store that install themes but didn't try them yet as i don't know its working .I want a new theme on My Samsung Galaxy trend Duos phone-GT-S7392 (Android 4.1.2).Do we have any themes that can be installed from Samsung ??
Comment: Themes for what? Android doesn't provide a way for end users to theme the whole device, but some apps are themeable (commonly launchers).
Comment: can you clearly explain what a launcher is and what do you mean by only some apps
Comment: I mean that it's possible for an app to be written so that you can add themes to it, but without rooting the device there's no way to make a theme that changes the appearance of all apps. A launcher is a home screen replacement app.
Answer: Samsung phones that are running TouchWiz (Samsung's fork of Android) do not support native themeing, as is the case with other manufacturers such as Sony and Acer. You can check if you're running TouchWiz by dialing <code>*#0*#</code> on your dialer - if a new screen appears, you are most definitely running TouchWiz.
To achieve support for the theme apps you see on the Play Store, you need to install or flash a custom Android ROM, such as CyanogenMod and ParanoidAndroid.

How to install themes in Android 4.1.2


PowerVR Android sample: makefile not working

Question: I'm having a hard time setting up PowerVR SDK for Android on Windows 8 64, assuming I met all requirements:

Android SDK (fresh Eclipse)
Android NDK
Cygwin (with make)
PowerVR Android SDK 3.0

I can perfectly make and run an Android NDK sample. However, the same process fails for building any PowerVR sample (from the SDK). Here's the output when I try to run the makefile:

$ ndk
  Compile++ thumb  : OGLES2Texturing <= OGLES2Texturing.cpp
  arm-linux-androideabi-g++.exe: error: C:/cygwin///cygdrive/c/Users/stfn/workspaces/android/03_Texturing/jni/OGLES2Texturing.cpp: No such file or directory
  arm-linux-androideabi-g++.exe: fatal error: no input files
  compilation terminated.
  /cygdrive/c/android-ndk-r8d/build/core/build-binary.mk:269: recipe for target `obj/local/armeabi/objs/OGLES2Texturing//cygdrive/c/Users/stfn/workspaces/android/03_Texturing/jni/OGLES2Texturing.o' failed
  make: * [obj/local/armeabi/objs/OGLES2Texturing//cygdrive/c/Users/stfn/workspaces/android/03_Texturing/jni/OGLES2Texturing.o] Error 1

I suppose the error should be related to a wrong path given to the compiler. To me it looks like a mixture of standard Windows and Cygwin/Unix paths: * C:/cygwin///cygdrive/c/Users/stfn/...*
If been through so many makefiles now trying to resolve this issue but I just don't know where else to look. This is the first time I tried messing with the NDK. I'm afraid this could be my last.
Any help would be greatly appreciated
Answer: 1.in the Android.mk file, for the PVRSDKDIR, set the path of your project folder in your workspace.
2.Copy the build, tools, and shell folders from the powervr sdk folder to your project folder


How to sync email with iPhone

Question: A client of mine has an iPhone.  We have verified that he has the correct settings input in his iPhone for his Exchange account.  Other users have iPhones as well and are able to get email on their device.  His username, password, server, email address, server are all correct.  SSL is on which it should be.  When setting up the account the iPhone accepts it but when he goes to check his mail a warning pops up stating that he is not able to connect to the Exchange server. Any ideas on where to look to solve this?
Answer: Found the solution, at least for my case.  In Active Directory went into the users properties, security tab, clicked on SELF, then advanced and checked the box to allow for inheritable permissions from the parent.  After that he was able to sync up.
Comment: Yeah, I'm not sure how that setting was changed.  Checked other users' accounts and that was checked. :-\
Comment: Thanks for coming back with the fix.  I love the solutions which don't seem like they should've changed anything...
Answer: Make sure that you're on Wifi and not the Cell networks.
Ensure that his Exchange server is reachable by the iPhone.  Since you don't have a command-line to ping from, try accessing OWA (Outlook Web Access) by going to http://[mailserver]/exchange/
Answer: Have you tried setting his phone up with another user's account and setting his account up on another user's phone? This should tell you if it's a phone or account issue.
Comment: Well I tried setting his account up on my iPhone and the same thing happened.  That's why I'm starting to think it's an issue with his account but I can't pinpoint it.
Comment: just get your exchange admin to compare accounts - tell him that you've tried what you just did ok, it'll help.
Comment: In that case I'd look at the Exchange Features tab of the user account properties and make sure that Mobile Services are enabled.
Comment: Thanks for the tip.  Although after looking for that I cannot seem to find it.  In fact, there is no Exchange Features tab for that user in AD.  Nor does any other user have that tab.
Comment: just for sanity's sake try this problem user and a working user on another phone - just to be sure of your belief that it's a user issue ok. Also why not add a comment here showing the various config details (minus passwords of course) of the bad and good users - plus any other config details of the phones too - have you compared the data service APN settings etc.?
Answer: It sounds like he opened his Exchange account somewhere before to me. Just check his PC to see if he already logged in first ... Or there is another case which is possible. That he has some diverse account all connecting to one single e-mail address, so when he logged in the system doesn't know where he referred to .

How to sync email with iPhone


Should we still answer a question if someone has voted to close it?

Question: Is it really frowned upon to answer a question that is a bit vague? Do we do more harm than good or does providing an answer do no harm?
Comment: Are you just asking about questions with close votes? Or are you asking about questions that you think meet the criteria for one of the close reasons (e.g. the question is too broad, or needs more details/info, or the question is primarily opinion-based)? – What you "should" do may depend on whether you think (a) the question is high-quality and properly answerable (i.e. a high-quality answer can be provided) as is; or (b) it has issues but you can edit it to fix those issues; or (c) you think it needs to be edited (and you can't fix those issues yourself) and so it should be closed first.
Comment: I guess one could answer as best as one could and vote close to ask for more information…
Comment: That's not really what I'm saying. If a question can't be meaningfully answered/can't receive a good answer as is, then it probably shouldn't be answered yet. What I'm talking about is whether the problem with the question (if there is one) is easily fixable yourself, or whether it's something that only the original author of the post can address.
Comment: (For instance, if there are key details missing from the post that are necessary to answer it without guessing/speculation, then generally only the author can provide that information; if so, the question should be closed until the author provides that info. However, if it's just that the question is too broad because it asks multiple distinct questions in one post, then other users besides the author might be able to edit out the additional questions and narrow it down to just one good question, in which case you can edit the post (to show by example) rather than closing the post.)
Answer: I don't see an issue with providing an answer to a vague question. Your personal experience might give more context than the question provides. The person who has voted to close it may retract their vote if the answer contains valuable information.
That said, if the question is really vague then it would be better to ask the poster to provide more details.
Use your judgement to decide which approach is best.


Should applicants send an email to check the status of their faculty application?

Question: After sending a faculty application online, should the applicant send an email to check if all documents were received and whether the application is complete or not? Some suggest to send an email, while others suggest not to, since sending unnecessary email to the committee could raise a flag.
Comment: It would be good to keep in mind that there are probably hundreds of applicants, and no one wants to deal with hundreds of e-mails.  But if you have a specific reason to think something went wrong when submitting your application, then it might be reasonable to send an e-mail.
Comment: Most applications can be viewed online, however, a missing or corrupted document (e.g., reference letter, teaching statement) can make an application incomplete. And usually that will result in a rejection letter without knowing what was the real reason.
Comment: Usually the application system will only allow you to submit if everything has been filled in. I only ever called to hear what they had decided a week after the interview. But of course, if they don't call you as soon as possible...
Comment: After a week? Don't they usually call once they decide?
Answer: Assuming that you submitted your application to the human resources office of the university, then it would be appropriate to check with them to make sure that the application was received and was considered to be complete.  I would not send a query to faculty members of the search committee (if you could even figure out which faculty were on the search committee.)
Answer: I think it's okay. Just make sure you are emailing someone who knows where to get the information you seek. Otherwise, it may "get buried" and disregarded.
Email is an accepted and efficient method of communication and should not offend somebody's sense of etiquette. If I were the one receiving your email, I wouldn't be offended in any way unless you were bugging me frequently.
Just a couple months ago, I received an email request from a friend to be a reference for him. I thought nothing of it.
Answer: Try to find out the staff person who is responsible for helping the search committee. Usually this is the person who you addressed the initial file to (our senior admin here is used to getting e-mails addressed to Prof. Lastname, it tickles her sense of humor).
The staffer usually has the best sense of where things are in process. All of the files are at his or her fingertips, whereas a member of the search committee may not be able to recall all of the first-round cuts and the search committee chair may be too overworked or stressed to respond. If your file was incomplete, the search comm members may not have even seen it.
Annoying the staffer has little influence on your file, so that person is the safest person to bother with questions like this.(FN1)
FN1: I won't say it is entirely risk free. If you are truly obnoxious to our staff, then the faculty may view this is as a sign of your future collegiality. So act within reason and professional behavior.


Why multiple blender animations are not showing up in unity when imported

Question: I have followed numerous online tutorials and no matter how many times I watch/mimic exactly what they are doing, I still end up with ONE animation that plays everything at once. I cannot figure it out. Basically I just have two buttons and I would like them to be able to be pressed separately. I have created a left and right armature to control the left and right buttons, but no matter how many times I link/relink the animations or double check that only one animation is linked per armature, they still both press at the same time. A little insight on this would be greatly appreciated. Here is a dropbox link to the blend, I just want it fixed and to know what I am doing wrong. So lost right now.
Watched this tutorial. Seemed great, but doesn't seem to help me out any.
This is what the import looks like. As you can see, only the "RightButtonAction" animation.
Answer: I don't have unity to check but I see a difference that may help.
The right armature has keyframes on the bone (done in pose mode)
The left armature has keyframes on the armature itself (done in object mode)
It may be that unity doesn't support object animation on armatures which are expected to be animated in pose mode.


Causation vs. correlation

Question: Neither causation can say they are correlated, nor correlation can say they are causation. Am I right ? Suppose there is no correlation between A and B. Does it mean there is no causal relation between A and B? No. It could be the case that A causes B, but C causes not-B. (This is modelled as defeasibility in causal logic.) And if that is the case, the combined presence of A and C in a given situation would neutralize each other's causal effects, with the result there would be no observed correlation.
Comment: In such situations,
to show that A causes B , we need to eliminate the effects of C,
and
to show that C causes not-C, one should eliminate the effects of A.
It is only when these confounding factors are eliminated that we can see correlations in the data
Comment: Doesn't it depend on your definition of *correlation*? In common statistical parlance, correlation refers to a test of *linear* association as expressed in a Pearson correlation coefficient, *r*. If a relationship is highly nonlinear, e.g., parabolic, Pearson's *r* can be 0 but this is not evidence of a lack of relationship or dependence.
Comment: @quanity Yes you're right. (And I don't see more of a question here.)
Answer: No. Correlation is a prerequisite for causation. So if you know that A is the cause of B you also know that there is a "co"-"relation" between A and B. A is at least partially the cause of B and B is at least partially caused by A.
So it would be somewhat weird to know that A is the cause of B and not know that the two are related to each other.
In other words you wouldn't find yourself in a position where you know there's a causation, but being in search of a correlation. It's usually the other way around once you find a correlation you can take that as a hint of a causal relationship as a correlation is a prerequisite, but not a sufficient condition, for a causation.
What you describe is a completely different scenario of a superposition of different effects, which makes it difficult to test for correlate and causation. So you'd usually set up "lab conditions" where you test for just one parameter, either by suppressing the rest or by keeping them the same except for one.
Comment: While I think you are broadly correct, it is rather hasty to suppose you would never find yourself knowing about a causal relation but unable to find a correlation. E.g. You might know that lack of sunlight causes vitamin D deficiency, but find an entire population that lives at high lattitude without vitamin D deficiency and not know why there is an absence of correlation here. I guess this is the kind of defeasibility the OP has in mind. Isolating variables under lab conditions is nice but not always feasible.
Comment: @Bumble I kinda get this point but that isn't really how this would work. Like the absence of a correlation doesn't really prove the absence of a causation, that is what OP is basically saying and where they aren't entirely wrong. BUT if you are unaware of the causation and not seeing a correlation you wouldn't even end up expecting one or would rather argue that the setting is too messy to do that. On the other hand if you know that a causation exists, but don't see the expected effect, that wouldn't disprove the causation, but rather hint at a superposition with another effect.
Comment: @Bumble So if you know there is a causal relation between lack of sunlight and vitamin D deficiency, then you would research the cause of that. Idk sunlight being the power source and/or trigger for a production of this vitamin for example. And if you know that cause you'd assume it still being active in situations where you don't see it, so what you expect is an adverse effect overshadowing this correlation, rather than it's absence. Similar to how a rocket doesn't switch off gravity, it just provides a force in the opposite direction that is bigger.
Answer: You are right in saying that correlation is distinct from causation. Two or more sets of events can be perfectly correlated without one set being the cause of the others. For example, if I have a garden sprinkler with ten jets, I can vary the pressure of water through the sprinkler by opening and closing a tap. All of the jets will react to an opening tap by becoming more forceful, and to a closing tap by becoming less forceful. The waxing and waning of each jet will be correlated with the waxing and waning of all of the others, but there is no causal relationship.
It is also possible for there to be causation without any readily identifiable correlation, particularly where causes are essentially fuzzy. Take the statement that market sentiments determine stock valuations- it would be hard to deny the truth of the claim, but equally hard to figure out any meaningful correlation because the idea of 'sentiment' is inherently vague.
Answer: Causation is the relationship "X if and only if (Y and 'Y is in the past of X')".
Correlation is the trivial relationship "X and Y".
You can plug any combination of stuff into X and Y here. In your example you've plugged B into X, and "A and not-C" into Y, so the causation is that "A and not-C" causes B. A is not "A and not-C", A is A.
Comment: Your definition of causation is still just a correlation. Like it could still very much be a coincidence that X and Y and Y being in the past of X. If X and Y are causally related that would be the case, but being the case does not mean they are causally related.
Answer: Known Causes
Given:

A is the sole cause of B
C is the sole cause of not-B

Bayes' Theorem:

AC = A & C
P(B|A) = 1
P(~B|C) = 1
P(B|AC) = ? *
P(~B|AC) = ? *

In digital circuit design when signals try to drive a flip flop to both 1 and 0 (representing B and ~B) at the same time this causes an uncertain outcome or possible race condition. Applying that intuition if A is the sole cause of B, and if C is the sole cause of not-B, then the operative joint cause AC = A & C would produce an indefinite probability for the observation of B or ~B. The * is provided because I have not reviewed the math for applying Bayes' rule with two conditions that drive a contradictory outcome. It may be there is a definite probability for each outcome in the math model.
Known Correlations
Bayes' Theorem:

P(B|A) = 1
P(~B|C) = 1

Correlation is not causation so the mere fact of correlation does not imply that A is the sole cause of B or that C is the sole cause of ~B.
Comment: The problem with comparing that to circuit design is that this would apply discrete math, while for all intents and purposes large parts of our everyday reality are better described by continuous math. So it's less of a 1 or -1 swap that happens instantly where the order of operations matter, but more of a continuous application of force that happens simultaneously. So rather than 1 or -1 it might be 0 or tilt in whichever direction has the stronger effect.
Comment: Digital circuits are a mechanism to model B, not-B (B, ~B) using voltages that map to our symbols (1, 0). I see no problem comparing the given logic to signal A trying to drive outcome B and a competing signal C trying to drive the opposite outcome ~B. If we balance an inverted pendulum at the unstable equilibrium point, and constrain its motion to two dimensions, in the absence of active control it can fall toward the left (B) or the right (~B). Even in continuous math models saddle points and multiple equlibrium states are discrete things in our minds. Agreed: the real world is more complex.
Answer: There is indeed an awkward disconnect, as far as I can see, between what is said in the context of statistics (correlation is not causation) and what is said in the context of philosophy of science, where correlation is at the heart of causation. Of course, Humean causation involved more than correlation - cause must be spatially contiguous with effect, cause must precede effect in time, and all similar events must be followed by an similar effects. (Details may vary). Nonetheless, the disagreement between the two is striking.
Mill's four methods of induction are helpful to further distinguish "mere" correlation from causation and high-light the importance of experimentation. See J.S. Mill - Stanford Encyclopedia of Philosophy especially section 3.3 (The italics are mine.)

"We may discover, by mere observation without experiment, a real uniformity in nature" (System, VII: 386). Where possible, however, engaging in experimental activity is the most direct way to uncover the causal relations between events, because it allows us to "meet with some of the antecedents apart from the rest, and observe what follows from them; or some of the consequents, and observe by what they are preceded" (System, VII: 381). Mill claims that, as science has progressed, four methods have emerged as successful in isolating causes of observed phenomena (System, VII: 388–406; see Cobb 2017: 240–1). Firstly, the Method of Agreement: where instances of phenomenon A are always accompanied with phenomenon a, even when other circumstances accompanying A are varied, we have reason to believe that A and a are causally related. Secondly, the Method of Difference: where the only distinguishing feature marking situations in which phenomenon a occurs or does not occur is the presence or absence of phenomenon A, there is reason to think that A is an indispensable part of the cause of a. (If we have noted, via the Method of Agreement, that in all instances of A, a is present, we can, where possible, systematically withdraw A, to determine whether A is a cause of a by the Method of Difference. Mill terms this the Joint Method of Agreement and Difference.) Thirdly, the Method of Residues: against the knowledge that A is the cause of a, and B the cause of b, where ABC causes abc, and AB causes merely ab, we can (by ruling out that c is the joint effect of AB) regard C as the cause of c. Fourthly, the Method of Concomitant Variations: whenever a varies when A varies in some particular manner, a may be thought to be causally connected to A.

However, that article also refers to another possible differentiation:-

A detailed anthropological study of the history of successful scientific practice is likely to reveal the irreducible use of imaginative hypothesis-making—not to mention changing questions and ideals of the sort later highlighted by Thomas Kuhn (1962). Such was the basis for a telling historico-normative debate between Whewell and Mill—the former arguing that scientific reasoning had and should involve the creative a priori development of concepts prior to the discovery of laws, the latter claiming, as can be seen in the quote above, that observation and induction alone could track facts about the world and elicit the concepts used in science.

Causation vs. correlation


How to power led from arduino

Question: I am new to electronics and ohms law is confusing.
When I power the led with analogWrite and give it only 3 volts do I have to still use a resistor?
When I power the led with 5 volts does it matter if I put a resistor before or after the led?
Comment: This LED stuff is being discussed over and over again here. I can't believe you didn't find anything.
Comment: analogWrite is a really confusing name for the function as **it doesn't just output a voltage proportional to the input value.** What analogWrite actually does is to toggle a pin between high (5 V) and low (0 V) hundreds of times (490 IIRC) each second, with the function parameter determining how much time is spent with a high output relative to a low output. For example, analogWrite(10, 153); wouldn't output 3 V to the LED, it would output 5 V for 60% of the time and 0 V for 40% of the time. This technique is known as pulse-width modulation.
Answer: You always need to use a resistor with an LED (unless you're powering it from a current source where different rules apply as stated by jms or unless you have a special LED that has a resistor built into it but I highly doubt you have it and it's bad for learning about LEDs anyways). It does NOT matter if the resistor is before or after the LED, though in practice, you mainly see circuits with the resistor behind the LED.
To check what resistor value you need if you don't know or wasn't given any instructions with the specific LED you are using, use this calculator.
IMPORTANT: You should also note that analogwrite doesn't really output 3V, but rather outputs 5V that switches on and off rapidly to average on 3V. So honestly you should treat it like a 5V source. Treating the analogWrite as a 3V source can be risky.
Comment: Thanks! Does that mean that even with 3 volts too many amps go trough the led and thats why i need a resistor?
Comment: @abanana Well think of an LED as a diode. You would be creating a short circuit if you just connect an LED without a series resistor. It also depends on your LED's forward voltage (Vf) which is a characteristic of the LED. If the LED's Vf over 3V, it won't turn on and nothing will happen. If it's under 3V and there's not a resistor, lots of current will go through, likely burning it. Also if this answers your question make sure to mark the answer as correct with the tick below the score.
Comment: You always need a (current limiting) resistor *if you are powering the LED from a voltage source*. Arduino outputs are voltage sources by nature. If you are powering the LED from a current source set to the appropriate current, you won't need a resistor. Many dedicated LED driver chips act as current sources, and don't need resistors.

How to power led from arduino


Page redirect function

Question: Looking to infleunce a direct page route after one submits Donation or Event form within Linvio. We wish to redirect to a page not housed within Salesforce. Any thoughts?
Comment: Please add more detail and relevant code.
Comment: Welcome to SFSE Jessica. Typically questions need to be quite tight and focused, have you tried to do this? If so, where have you gotten stuck?
Answer: You can use PageReference class to redirect the user to different, even to a url which is outside of Salesforce. Here is an example.
<code>PageReference pageRef = new PageReference('http://www.google.com');
pageRef.setRedirect(true);
return pageRef;
</code>

Page redirect function


Origins of 'Madchester'

Question: I'm interested in the origins of the term 'Madchester' that was used to describe the Manchester music scene of the late 1980s /early 1990s.  The 'Madchester Rave On' EP released by the Happy Mondays in November 1989 is a likely source, but did they coin the term or was it already in use before this record came out?
Answer: Manchester venue the Victoria Warehouse claims that the term 'Madchester' was coined in 1989 by Factory Records video director Philip Shotton, and the end of the 80s saw the scene burgeoning in popularity. Shotgun is one half of the Factory Records video directors 'Bailey Brothers' (the other half being Keith Jobling).
In "The Stone Roses", by Simon Spence, (excerpts presented on The Manchester Confidential), Jobling is quoted as saying that the phrase originated while developing a script about car thieves and, to avoid potential legal issues, needing to change the setting of the film from Manchester to a fictional setting: "Madchester".
Approximately a month later, Tony Wilson, head of Factory Records, instructed the Happy Mondays to rename their respective cord from "Rave On" to "Madchester Rave On".So, the name "Madchester" predates the record by approximately one month.
Shaun Ryder, the lead vocalist of the Happy Mondays remembers:

It was our video directors, the Bailey Brothers, who came up with the term "Madchester", but we said, "Great, yeah, go with it", because Manchester was mad at the time.

The likelihood is that the term "Madchester" came out of the script must meeting between Shotton and Jobling and neither can quite remember who originated it.
Answer: Keith once told me that it came from a little phrase he used to say - "like a mad thing on a mad one on a mad night out in Madchester".

Origins of 'Madchester'


Understanding S-Corp election timeline

Question: I started a business on February 2nd of 2023, and my Tax Year will be 1st January, 2023 to 31st December, 2023, and the business tax filing deadline will be 15th April, 2024. Will I be in compliance if I file my S-Corp Election (Form 2553) by March 15th, 2024? If not, what can I do to have my business be treated as a S-Corp for 2023?
Answer: According to the IRS, the form is due within 2.5 months of the beginning of the first tax year during which you want the election to become active.
Also, according to the IRS, the deadline for S-Corp tax returns is March 15th, not April.
See the IRS deadlines here and the instructions for the form 2553 here.
You may be able to qualify for late election relief.

Understanding S-Corp election timeline