Why is my TPMS light solid after replacing all 4 sensors, reprogramming and verifying proper psi in live data?

Question: 2009 Toyota Camry SE V6. I replaced all 4 sensors after 1 died. I reprogrammed using my Autel MK808BT for the new sensors ID's AND verified each tire is reporting ~34 psi in the live data. However, the TPMS light on the dash remains solid never flashing. I'm looking for ideas as to what I'm missing. There are no trouble codes within the TPMS section of the Autel diagnostics. I do have C0210 and C0215, which are left and right rear speed sensor codes, and a sunroof code, but that's a whole different section of diagnostic. What am I missing here?
Comment: Are you sure the new sensors are compatible with your vehicle? Did you check the spare tire's sensor?
Comment: Yes, they are. No sensor in the spare.
Answer: There must be a drive interval that prevents the light from going back off until the minimum drives or drive time. I'm not sure which. But the light just eventually went off after a couple days and around 5 or 6 drive cycles.


Where is my wallpaper stored- Galaxy S20, Android 13

Question: I'm in the process of switching from a Galaxy S20 to a Pixel 7 Pro. Both are running Android 13. I completed the data transfer, but my old wallpaper (a picture I took a long time ago which I really like) didn't transfer. I cannot find it in the wallpaper and style control on either phone, and I've tried looking everywhere in the data folder I can think of when the S20 is connected to my PC.  This is a picture that I believe I had on a Galaxy S8 and it transferred to my Galaxy S20. I'm trading the S20 in and need to get it in the mail soon. I appreciate any help/advice you can give me.
Answer: On my Samsung Note it is at
Android\data\com.samsung.android.wallpaper.res\files
Comment: Thank you!  I just looked there and there's nothing in the files folder.  I know it must be in the phone somewhere, I'm just stumped.


Extending a class hierarchy

Question: Recently, I've found a puzzling (to me) problem: Let's say I have a hierarchy of classes C1...C_n. Assume that at least some classes have more than one (direct) child class, but none have more than one parent (i.e. no multiple inheritance). I would like to change the hierarchy's behaviour. My first impulse would be to create subclasses D1...Dn and override methods as necessary, but there is one problem: when calling a newly overridden method, an actual Di may need to be passed as a formal D1 (or some level in between); this can be solved by subclassing C1 -> D1 -> D2 .... But when calling an unchanged method, any actual Di will need to be passed as a formal Ci, so we would have to derive each Di directly from Ci. Is there any elegant or generally accepted way to solve this riddle? If so, is there any way without resorting to multiple inheritance?
If there is no general way to achieve this, can the author of the original C hierarchy follow certain rules to provide this possibility?
For those who prefer a more practical approach, the original hierarchy implements SOAP in Ada. I am working on XML-RPC. From an abstract point of view, SOAP is a superset to XML-RPC, but the actual XML "on the wire" is quite different. In principle, one can perform most of the work by throwing away some of the data types (e.g. XML-RPC has one integer and one floating point type whereas SOAP has several of each), and replacing the routines that convert the remaining types to and from XML.
However, due to the aforementioned inheritance problems, I ended up copying almost the entire SOAP hierarchy. The only code I've been able to re-use properly turned out to be the HTTP part (as it is not concerned only with text payloads, not with SOAP objects).
[Edit: Removed a simplifying assumption that would allow for a simple solution not applicable to the more general problem]
Answer: The solution, because you assume single inheritance, and direct subclass relationships, is to just create D(1) as a subclass of C(n), in which case all Ds will also be in every C class.
In practice, the solution is not to create deep class hierarchies for no reason. If you're really into small classes, then use a system which accommodates multiple inheritance in some form.
Comment: +1 for the fast response, and the simple solution. Unfortunately, it is only simple because I oversimplified, not thinking this would introduce new solutions.
Comment: @AnsgarEsztermann Not really. I don't think this problem actually exists, and I challenge you to show a hierarchy where it arises.

Extending a class hierarchy


Why Neutrino is a ghost particle?

Question: why neutrinos  are called ghost particle.why it is not affected by strong magnetic field. why it does not interact with matter. why it does not interact with gravitational field? I am unable to understand it
Answer: It is called a "ghost particle" because it can pass effortlessly through solid objects "as if it were a ghost". This is another way of saying that it interacts very little with ordinary matter.
The reason it does not interact much with ordinary matter is that it has no electric charge (and so will not be acted upon by electric or magnetic fields) and it contains no quarks (and so it will not be acted upon by the strong nuclear force). This allows it to travel almost completely unimpeded through (for example) light-years of solid lead without scattering off any of it.
For a neutrino to interact with another particle, it must strike it more or less head-on, which is very unlikely even if the beam of neutrinos is very intense and the target material is extremely dense.
Presently, it is believed that neutrinos have very small masses, which means that they actually will experience gravitational forces.
Answer: This is a  misleading way of talking in popularized versions about neutrinos, not recommended for physics vocabulary, since in the theories for particle physics "ghost" has a different mathematical meaning.
The everyday version of "ghost" is a moving impression that can pass walls and appear randomly, and popularizers attribute this adjective to neutrinos because they are hard to detect as they mainly interact with the weak interaction. Thus they can cross large distances in space passing through matter like "ghosts".
Nevertheless in our experiments we do detect neutrinos and antineutrinos, form beams of them and experiment with them and thus given them the niche in the elementary particle table of the standard model. Nothing ghostly, just weak interacting.
I have worked in experiments with neutrino beams, and we detected them by their interactions, which helped build up the standard model.

In the above experiment the neutrino beam enters from the bottom, there is a magnetic field perpendicular to the picture so the charged tracks turn. The neutrino as neutral leaves no track but interacts with the hydrogen in the bubble chamber.

why it does not interact with gravitational field

As it has a four vector of energy momentum, it will interact with the gravitationla field, very weakly, look at the forces again and their strength.
Ignore the adjective in popularized articles. They are just hard to detect.
Comment: It's still cool to call the Higgs boson the "_God particle_", though, right?
Comment: Lederman claims he wanted to call it The Goddamn Particle but his publisher wouldn't let him.
Answer: A neutrino is not affected by an electromagnetic field because it has no charge. It is a electrically neutral.
It barely interacts with matter for the same reason. It just tends to go right through atoms because it doesn't interact electromagnetically with electrons or protons. It does experience something called the "weak nuclear force" but this is much weaker than electromagnetism.
It does experience gravity. Neutrinos have a very small mass, but even if they were massless they would still experience (and also create!) gravity, just like photons do.
Comment: why they do not interact with matter??
Comment: Because almost all "interaction with matter" is "electromagnetic interaction with electrons and nuclei". Neutrinos can't do this because they are electrically neutral.
Comment: @user221619  It is because they have to do a direct hit on a particle in order to interact, the weak interaction is *very* short range, in contrast to the electromagnetic. look at the ranges here  http://hyperphysics.phy-astr.gsu.edu/hbase/Forces/funfor.html

Why Neutrino is a ghost particle?


Testing an IMAP client

Question: I am writing an IMAP client library for a Uni project. I need comprehensive, in-depth testing for it. This is the focus even more than the e-mail functionality itself. What should I do? I am looking for a list of tools and actions for the setup and a process/procedures recommendation to prevent introduction of regression when the library will be rev-up'ed, please.
Comment: Have you tried looking at the test suites for any open source IMAP client libraries?
Answer: can you please be precise if you are developing or looking for test suites in Java.
Also let us know if you are looking at the unit tests?
Apache Commons mail is one very good open source library to send and receive emails. I am sure they must have come up with loads of unit tests for that library. You can download the source code and try out the unit-tests they have for their IMAP, POP3 etc code and imitate them.
I do not have a readily available links for functional test suites / libraries of any open source tools. but if you are looking for unit tests in java, Apache commons mail should be what you are looking for.

Testing an IMAP client


Problem UIview size after re-orientation

Question: First,I am sorry for my poor english...
So, i have a problem with a view which is added on a other one.
I am setting size of UIview in IB as 200px/200px
I set the center of this view with the center of parent view.
Everything is working great at this point.
I can see my View in the center of the parent view like i want.
Then I set the <code>- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation</code>
And that's working to.
But when i rotate the iphone, the size of the view change to full size, the view don't want to stay in center and go on the top left of the screen and resize as fullscreen...
Can somebody help me with this problem ?
Do I have to set the frame and the center after rotate ? That can't be automatic ?
Thank you!
Answer: In IB, under the "Autosizing" section, remove the "arrow" that indicates auto width/height of your component.


What is the drupal way for wysiwyg reply edit box?

Question: I'm making a forum and I'm using drupal6 advance-forum module.
I browsed all the admin sections and I still cannot figure it out
how to put a wysiwyg edit toolbar on the reply form.
It shows in the admin section when I create a topic but not outside the
admin section.
Should I do that manually? - I can do it with java script, but if I
do that, than I don't think that it will be the drupal easy maintain way...
Answer: In Drupal 6, I'd use the WYSIWYG Module along with the Better Formats Module.
http://drupal.org/project/wysiwyg
http://drupal.org/project/better_formats
After installing and enabling both of these modules you'll want to:

Add and/or configure a specific input format for wysiwyg use on comments at Administer > Site Configuration > Input Formats (might want to disable any filters at first to avoid possible conflicts with the WYSIWYG script)
From the Input Formats admin section, click on the Defaults tab and select this input format as the default for comments.
Finally, visit Administer > Site Configuration > WYSIWYG where you can get instructions on installing your WYSIWYG of your choice.  After the WYSIWYG scripts are in place you can select that WYSIWYG for your chosen input format and configure any available options.

Better Formats also allows you to turn on default input formats per node type, so you could use the same WYSIWYG enabled input format as the default for initial forums posts as well as the comments.
Answer: Wysiwyg editors in Drupal us usually related to input formats. Check what input format is used for the reply form.
The wysiwyg module and better formats module is pretty good combo you can use to setup editors for different roles in different senarios.


Levels and curves

Question: Can anyone explain difference between levels and curves regarding luminance in Photoshop??
As the both of them affects the whites blacks and their intensities ,then what is the difference between them?
Comment: Possible duplicate of [How levels and curves tools are related?](https://photo.stackexchange.com/questions/43824/how-levels-and-curves-tools-are-related)
Comment: Possible duplicate of [What is the difference between levels, curves and contrast settings in post processing?](https://photo.stackexchange.com/questions/61211/what-is-the-difference-between-levels-curves-and-contrast-settings-in-post-proc)
Comment: Also possible dupe: [What is the difference between levels, curves and contrast settings in post processing?](//photo.stackexchange.com/q/61211)
Answer: In both tools you are mapping the existing levels to new levels.
Levels is simply a straight line from lowest level to highest level.  You can adjust the start point, end point and slope of the line.
Curves are more sophisticated.
You can adjust the start and end points, but you can also shape the curve to whatever you want.
Curves allows much more flexibility and control.  Experiment is the best way to get a feel for this.
Comment: Actually if you move the mid point of the levels, it does produce a (gamma) curve, albeit one with only a single point in the middle.
Answer: Here is a demonstration of the difference between Levels and Curves, showing action of both. http://www.scantips.com/curve/
Both do the same thing, but Levels is just a small subset of what Curves can do.

Levels and curves


Meaning of running out into the road

Question: My dog is very silly ; he is always running out into the road. What does running out into mean?
Answer: "Running out into the road" essentially means the same as simply "running into the road".
Although a road is a surface and you may be more familiar with the concept of someone or something being on a road, the road is also an area with defined boundaries, and so when something is within those boundaries it is spoken of as being in that area. For example, you might say "stand inside the circle" because a circle is a line or perimeter, but if it were a solid shape marked on the floor you would say "stand on the spot". "Running into the road" therefore means that the dog has run into the road area and is on the road surface.
The inclusion of the word "into" is partly idiomatic, but also implies direction. "Out" or "outwards" can be used to show that something extends away from a starting point. In your example, it adds some drama to the situation by describing how the dog is running away from something, possibly its owner.
Answer: "Running out" has multiple meanings in English - but here it simply means, running from some small area (the sidewalk/pavement, or perhaps from a house or garden) into a more open area (in this case, the road). "Into", of course, is just where the dog runs to. "Into", rather than "to" again implies some defined area, rather than a specific point or place. You might say "John ran out of the house", or "John ran out to the shops" or "John ran out into the fields". "Running out into the road" is a very common fear for the safety of children and pets in busy towns and is an everyday expression.

Meaning of running out into the road


Why does Rory not use his handgun after he discovers he has it?

Question: It seems rory could have used it many times for getting out of particularly tight spots, so why didn't he use it then?(unless I missed a huge timey wimey spacy wacy thing)
Comment: What episode are you taking about?
Comment: The universe is rebooted after the events of the pandorica. The real human Rory is back and was no longer the centurion. The gun has gone
Comment: thank you my good sir. You can answer it normally and I will check the box next to it!
Comment: after the pandorica opens, also it never say's that he is human again.
Answer: He did use it:

 to kill Amy back in 102 A.D.

in his National Musuem guard disguise: he shot at the Dalek and forced it to retreat!!

 (and possibly many times more over the years - or rather centuries - while protecting the Pandorica and Amy within it)

After The Doctor flew the Pandorica into the ever-exploding TARDIS and repaired the cracks / rebooted the universe, Rory was no longer an Auton, just regular flesh and blood again, so he had no Hand-Gun to use anymore.
In addition to @Ixrec's perfect quote: Rory must have been human again, since

 immediately afterward Amy and Rory went on their honeymoon which led to  River, which would have required them both to be human.
Comment: @Shane *A Good Man Goes To War* tells us she is  human (her Time Lady aspects come from being concieved within the time vortex)
Comment: Yeah it was never explicitly stated, but we can infer it from the wealth of evidence. Most of that evidence comes in the form of River, but when Rory says (in the background) that "I _was_ plastic" as his wedding gets underway (and the fact that, in this moment, remembering being plastic is shocking to him; hardly the response you'd expect if he still were plastic), it seems clear that we're supposed to believe he no longer is.
Comment: But River is a Time Lady. What does Rory being human have anything to do with it?
Answer: If you're talking about when Rory was an Auton in The Pandorica Opens and therefore had a gun in his plastic hand, the answer is that he went back to being human after the universe was rebooted in the subsequent episode, The Big Bang.
I was a little confused about this myself until the Doctor said this around the middle of the next season, in A Good Man Goes to War:

DOCTOR: No! No! Impossible! It's all running about, sexy fish vampires and blowing up stuff. And Rory wasn't even there at the beginning. Then he was dead, then he didn't exist, then he was plastic. Then I had to reboot the whole universe. Long story.

Which I'm fairly sure is a confirmation that Rory is human after the "reboot".
Also, in The Curse of the Black Spot, Rory cuts his hand on a sword. An Auton probably wouldn't be damaged so easily.
Comment: Unless you can get pregnant by pl.... yeah... let's not go there...
Comment: By the time of *The Curse of the Black Spot* something else had already happened which would have needed him to be human again....
Comment: @BMWurm I re-skimmed the scripts for the few episodes between The Pandorica Opens and The Curse of the Black Spot, but I haven't found anything else that seems conclusive. Their wedding might've been awkward if he was still plastic but I assume Amy would still marry him in spite of that, and in Day of the Moon he only pretends to get shot. What event are you referring to?
Comment: True, but Eye-Patch Lady is already in *Curse* which means certain things for Amy (see the third spoiler in my answer below)
Comment: Good point. I think I missed all of that because I thought of Amy being pregnant in Amy's Choice but then remembered that episode was before The Pandorica Opens.


Just after updating a page, is there any action that I should do for google indexing?

Question: I have found out that one of my pages has weak SEO and shows in the later pages of google. So I modified my page a little and added some description etc. Now is there a way to tell google that I have updated this single page? I could not find it in webmaster tools? Did I miss it ?
Comment: In GWT you can manually submit a page to be indexed... http://webmasters.stackexchange.com/a/39612/1243
Answer: Few of things you can do:
1 - On Webmaster Tools, Go to "Health" / "Fetch as Google" where you can enter the address of the page that has changed, click on "Fetch" then click on "Submit to index". At which point a message will pop up and say: "Select if your page is new or has been recently updated. Google doesn't guarantee to index all submitted URLs." Choose your option, and hit OK.
2 - Resubmit sitemap.
3 - Adjust crawl frequency.
<code>I always go to step 1 when I change something on a page.
</code>
Cheers!
Answer: Googlebot will recrawl soon, so there is generally nothing you need to do.  How soon depends on the pagerank of the page.  Here are some rough guidelines about how long it might take googlebot to return.

pagerank 0: 3 weeks
pagerank 2: 10 days
pagerank 4: 4 days
pagerank 6: 1 day
pagerank 8: 1 hour

You might be able to get googlebot to come back faster by bringing the page to its attention.  I know that for new pages, you can tweet about the page on Twitter.  Then googlebot will crawl it right away.  I haven't tried getting Googlebot to return to an updated page with a tweet, but that might work as well.
Comment: I don't think PR necessarily has a direct correlation to how often Google crawls the site / new pages. Webmasters homepage appears to have a PR of 6, and new pages are crawled within minutes. PR is attributed to pages, not sites and new pages don't have PR.
Comment: I'm talking specifically about return crawl rate.  New pages are generally crawled as soon as they are found.  Googlebot revisits pages that are already crawled based on their pagerank.  If you friend has a PR 6 homepage, and links to new pages in several places, the new page will likely be found very quickly.
Comment: Stephen where are you getting those figures? I'd be interested in reading more
Comment: Personal experience.  I worked with a pr 8 site where the homepage was crawled hourly.   Googlebot crawl rate seems directly proportional to pagerank on a page level.
Answer: In Webmaster tool, add the updated link in your existing sitemap.xml and re-submit it.
Otherwise, If your site is a blog, you can use pingomatic.com. So it will ping your site to the major blog search engines.
I hope this will help you.
Comment: Re-Submitting a sitemap is a way submitting google to re-index the pages. If your pages is getting dropped means, that may be the wrong in your SEO process.
Comment: But re-submit'in the sitemap.xml is like a reset, and whenever I did it before, my indexed pages droped to zero and restarted to increasing ? am I wrong?


How to cancel :X encryption in vi

Question: This has annoyed me for years but I've never found a solution.
Instead of pressing Esc then :x to save an exit from vi, I accidentally type a capital X and press Enter. The only way to continue is to allow encryption. Surely there's a cancel command at this point?
Answer: You just have to enter an empty password twice. There will be no encryption.
Answer: Simpler: cancel the operation by pressing escape
By canceling, you are ensured that the program will not do something unexpected with the prompted (empty) passwords.

How to cancel :X encryption in vi


Is there a combinatorial proof that $e$ is finite?

Question: I'm looking for an integer $N$ and a combinatorial proof either that $(n+1)^n<Nn^n$ or that $\sum_{k=0}^n \frac{n!}{k!}<N\cdot n!$. By "combinatorial proof of $a<b$" I mean exhibiting explicit finite sets $A$ and $B$ with cardinalities $a$ and $b$, respectively, and either an injection $A\to B$ or a surjection $B\to A$.
Comment: $\frac{1}{e}$ is the asymptotic density of derangements in $S_n$.
Comment: I have a vague memory that $e$ can be expressed as the expectation of some "nice" random variable; perhaps this would be a good direction to go in.
Comment: @JackD'Aurizio interesting idea, but I think that to use this, one would need to establish that
$$
\frac 1e = \left( \sum_{k=0}^n \frac{n!}{k!}\right)^{-1} \overset != \sum_{k=0}^n (-1)^k \frac{n!}{k!}
$$
Comment: It follows by expanding $\left(1-\frac{1}{n}\right)^n$ through the binomial theorem, then applying the dominated convergence theorem.
Comment: Perhaps there is something you can do with [Cayley's formula](https://en.wikipedia.org/wiki/Cayley%27s_formula).
Answer: Let us consider the functions from $[1,n]$ to $[1,n+1]$: they clearly are $(n+1)^n$. Any function of this kind might attain or not the value $n+1$, and the number of function not attaining the value $n+1$ is precisely $n^n$.  Assume that $f:[1,n]\to [1,n+1]$ does attain the value $n+1$ and consider the chances for $f^{-1}(\{n+1\})$: this set may have $1,2,\ldots,n-1$ or $n$ elements, and there obviously are $\binom{n}{k}$ ways for picking $f^{-1}(\{n+1\})$ among the subsets of $[1,n]$, once established that $\left|f^{-1}(\{n+1\})\right|=k$. It follows that
$$\left|\{f:[1,n]\to[1,n+1]:\exists a\in[1,n]:f(a)=n+1\}\right| $$
equals
$$\binom{n}{1} n^{n-1} + \binom{n}{2} n^{n-2} + \binom{n}{3} n^{n-3} +\ldots + \binom{n}{n} $$
which is less than
$$ \frac{n^1}{1!}n^{n-1}+\frac{n^2}{2!}n^{n-2}+\frac{n^3}{3!}n^{n-3}+\ldots < n!\sum_{k\geq 1}\frac{1}{k!}. $$
On the other hand
$$ \sum_{k\geq 1}\frac{1}{k!}< 1+\frac{1}{2}+\sum_{k\geq 3}\frac{1}{2\cdot 3^{k-2}}=\frac{7}{4}$$
and this proves that $(n+1)^n < \frac{11}{4} n^n$.
Comment: The first part is a nice combinatorial description of the binomial theorem applied to $(n+1)^n$. However, I don't see how to prove the $7/4$ bound combinatorially.
Comment: @MTyson - would you accept FINITE summations as combinatorial?  If I understand correctly, the bounds in this Answer still work if all summations are only up to $k \le n$.  I.e. the no. of terms is still dependent on $n$, but at least it's not infinite any more...
Comment: @antkam I don't have a problem with finite summations, but I do want to avoid fractions. A bound like $\sum_{k=0}^n 2^k\le 2^{n+1}$ can be made combinatorial by explicitly packing $k$-cubes of side length $2$ into an $n+1$-cube of side length $2$. Jack's bound could be truncated to the first $n$ terms and be multiplied through by $n!$ to match the second inequality in my question, but this leaves the fractions $n!/3^k$ that can't be interpreted combinatorially.
Comment: @MTyson it should be pretty trivial to combinatorially prove the geometric sum formula with base 3 (instead of 2) and with a finite number of terms.  If you accept that, then the only missing ingredient is you need to accept "integers $a > b \implies$ rational numbers $1/b > 1/a$"...  However, if you wont accept non-integers, then your original puzzle remains unsolved.
Answer: You can always do some artificial nonsense like saying that $\sum_{k=0}^n\frac{n!}{k!}$ is the number of ways to choose some amount $p$ of numbers out of $1,\dots,n$ and order them. Clearly, the number of ways to do it for $p=n,n-1$ are $n!$. As to all other $p\le n-2$, you can consider full orderings and remove the numbers up to and including the first one that violates an increasing order (so if the full ordering is 3546127, then you remove 354 and keep just 6127). This gives you a surjection from the set of all orderings to the set of choices and orderings of at most $n-2$ numbers, effectively showing that $e\le 3$. However, I really wonder what the point of this exercise is...
Comment: @MTyson the 1st inequality is similarly easy using fedja's trick.  Consider any $n$-vector in $[1,n]^n$ and look for an initial segment up to & including the first violation of increasing order.  If the numbers $S$ in the segment are distinct, then interpret them as indices $j\in S$ where $f(j) = n+1$, and interpret the rest of the vector as the other $f(k)$ values (i.e. for $k \in [1,n] - S$) listed in order.  This map covers all $f:[1,n]\rightarrow [1,n+1]$ where $f$ achieves $n+1$ at least twice.  (There are another $n^n f$ achieving $n+1$ once and another $n^n f$ not achieving $n+1$.)
Comment: Thanks, this is helpful. I expected the first inequality to be more difficult, because to pack an $n$-cube into $N$ slightly smaller $n$-cubes requires moving around a lot of low-dimensional surface mass.


If a flag is wrong, but the post is still flaggable, an extended message to just "declined" should be given

Question: There is sometimes confusion over what to flag certain posts as, and when there is no reason to flag them and they are flagged then they should be "declined". But if the post was flagged with the incorrect flag, but there is a correct flag it could be flagged with. Then the message should not just be "declined", but instead something like "this flag was helpful, but please flag as <correctFlagName> next time". And the flag shouldn't be just 'declined' in the system either either, but instead it should be changed to the correct flag so that the post isn't just cleared and then requires reflagging to get back in the queue.
Comment: If a post is flagable, but for another reason, I believe in most cases, it *is* mentioned "helpful".
Comment: Seems to be going over well here. Might be time to post on meta.se soon, but with more than one sentence.
Answer: There can not be a valid case when a post is deleted and a flag is declined at the same time.
The whole point of flagging is to draw mod's attention to a post that should be deleted.
It is much less important which flag is used. It is helpful if it was used on a bad post.
It is very unlikely that all users will understand that slight difference between VLQ and NAA. Even mods can't quite agree on that and write a clear rule. There are some opinions, but not a rule.
If the mods are too hard on declining flags, people will stop using them. Mods are trying to get their life easier with the declining, but will get the opposite case.
The best option IMO is to add a post to the LQ review queue if it has been flagged as VLQ or NAA. If finally the post is deleted, then the flag should me marked as helpful. That is a clear and a fair approach.
Blatantly wrong flags can be declined directly.
Comment: Trivia: 36% of VLQ and NAA flags raised on this site over the past 90 days have been handled by /review. the median handling time for flags by /review was 331.5 minutes. The median time for moderator-handled NAA/VLQ flags during the same time period was 163 minutes. Generally, I would increase the wait time for flags to enter the mod queue only on sites where /review is handling them relatively quickly (or at least, more quickly than moderators) and there are enough flags to warrant giving the mods extra time to do other things. Right now, too few people actively review here, @Pilot6.
Comment: "*The best option IMO is to add a post to the LQ review queue if it has been flagged as VLQ or NAA. If finally the post is deleted, then the flag should me marked as helpful. That is a clear and a fair approach.*" That is already what happens. Those flags are not even shown to moderators for 15 minutes to give the low quality queue some time to handle them.
Comment: 15 min is not sufficient. Reviewing is not that fast.
Comment: Only because people in the queue tend to be too delete-happy. Sure, moderators don't always get it right, but almost every time I take a look in the queue everyone is just voting to delete everything. That does much more harm than good. If you use less VLQ and more NAA you would have much fewer declines ;)
Comment: They don't leave the queue after 15 minutes, they just get shown to moderators too.
Comment: And they decline it. If it stayed for an hour, there will be less work for mods and less declines. ;-)
Comment: @redredwine If I delete the post I mark all the flags helpful. The only time I mark NAA helpful and decline VLQ is when I do not delete the post. I can't mark the VLQ helpful for "good intentions" because of the downvote it casts.


How and where to store user uploaded files in high traffic web farm scenario website?

Question: i am working on a website which deploy on web farms to serve high traffic.
where should i store user uploaded files? is it wise to store uploaded files in the file system of the same website and synchronize these files in all web servers(web farm)? or should i use another server to store all uploaded files in this server to store files in a central location?
if separate file server will be a better choice, than how can i pass files from web server to that file server efficiently?
or should i upload files directly to that file server?
Answer: For security reasons you want to serve the files from a different sub-domain anyways.  This is easier by dedicating one server for these files, if the traffic for these files warrants it, but that also creates a single point of failure and bottleneck which you probably want to avoid.
You can have all web servers serve the files from a central file server or local cached copies.  This depends a lot on if the files ever change.
Comment: how facebook stores user uploaded images? my case is a bit same with facebook photos.
i think facebook also uses separate file server because all the images in user albums are serve from different domain rather than from facebook.com
what u recommend if one have to provide facebook photos like functionality?
Comment: A subdomain can be served from the same phyiscal box or set of boxes.  Also facebook has a huge user base, so if you're talking about a scale like that then you want to store on Amazon S3 and serve via CloudFront.  If you can't go that far, then make sure you serve the files from multiple web servers and either use a caching mechanism which will cache-upon-request or push the files to all web servers so there is no single bottleneck or point of failure (cache-on-demand has a single point of failure for non-cached files, but less of a bottleneck).
Comment: got it sam
one last question
is there any tool available which automatically synchronizes uploaded files to all the servers in web farm.
my web servers will be windows 2008 servers and my website is ASP.NET MVC site.
i cant go for amazon s3 and for a while cant use any mechanism for caching files.
thanks for your feedback.
Comment: @Inam Jameel, I'm sure there are lots of options to auto-sync files.  You'll be best off asking a new, specific, question about this.
Answer: Have you considered using Amazon S3 to store and serve user-uploaded files?
Otherwise, a central file server in your data center makes sense. You could mount the storage locally on each of your web servers using NFS or similar.
However you choose to store these files, you should always serve user-provided files from a different domain to avoid cross-domain exploits.
Comment: nope currently there is no plan to use Amazon s3 or something similar. we have already 3 dedicated servers connected via gigabit LAN somewhere.
how facebook stores user uploaded images? my case is a bit same with facebook photos.
i think facebook also uses separate file server because all the images in user albums are serve from different domain rather than from facebook.com
what u recommend if one have to provide facebook photos like functionality?
Answer: You asked about how Facebook stores photos. You might want to read the following article:
Needle in a haystack: efficient storage of billions of photos


Summary of "Large p, Small n" results

Question: Can anybody point me to a survey paper on "Large $p$, Small $n$" results?  I am interested in how this problem manifests itself in different research contexts, e.g. regression, classification, Hotelling's test, etc.
Answer: I don't know of a single paper, but I think the current book with the best survey of methods applicable to $p\gg n$ is still Friedman-Hastie-Tibshirani. It is very partial to shrinkage and lasso (I know from a common acquaintance that Vapnik was upset at the first edition of the book), but covers almost all common shrinkage methods and shows their connection to Boosting. Talking of Boosting, the survey of Buhlmann & Hothorn also shows the connection to shrinkage.
My impression is that, while classification and regression can be analyzed using the same theoretical framework, testing for high-dimensional data is different, since it's not used in conjunction with model selection procedures, but rather focuses on family-wise error rates. Not so sure about the best surveys there. Brad Efron has a ton of papers/surveys/book on his page. Read them all and let me know the one I should really read...
Answer: What do you mean by "result" theoretical result ? or numerical results ?
I like the reviews of Jianqing Fan see for example this one and this one on classification (lot of self citations).
Also there are non review paper that make rich review in introduction, see for example  this one and this one.
Answer: If you want a resume maybe this is the best you can get
http://www.springer.com/statistics/statistical+theory+and+methods/book/978-3-642-20191-2
Answer: Chapter 18 of Hastie, Tibshirani, and Friedman (12th printing/second edition, this chapter wasn't in the first edition) is a nice overview with some interesting data sets. It's not quite as thorough as their treatment of older material, and a lot of the time they have to give somewhat heuristic explanations of why certain algorithms work better than others. I found it very useful coupled with reading papers for things you want to know more in-depth.

Summary of "Large p, Small n" results


Getting 'default' translation for a translation that doesn't exist

Question: I'm trying to develop a database driven translation site in cakePHP.
When I'm setting the Model locale or Config.language to a language such as de-de like below:
Configure::write("Config.language", "de-de");

it loads the correct translations of de_DE from the i18n table.
My problem is, if the translation does not exist for another row, it doesn't return anything.  Is there anything you have to setup so if it doesn't find anything, it returns the 'default' language translation or the data directly from the Model??
I think it's too much work to stay checking all the time if data is returned and if not changing the locale/language settings all time to the default language you want..
Or maybe I'm doing this wrong?

Code:
data in i18n table:
id  locale  model   foreign_key field       content
2   de_DE   Suite   4           description description in en_US for vilhena
3   en_US   Suite   3           description description in en_Us for del Monte
4   en_US   Suite   2           description description in en_Us for Pinto
5   en_US   Suite   1           description description in en_Us for Hompesch

Configure::write("Config.language", "de-de");
$this->Suite->find("all");

returns
Array
(
    [0] => Array
        (
            [Suite] => Array
                (
                    [id] => 4
                    [name] => Vilhena
                    [enabled] => 1
                    [description] => description in en_US for vilhena
                    [locale] => de_de
                )

        )

)

Comment: Yeah, the default behavior is that it shows the untranslated string if no translation is found. Maybe if you showed an example where it's not working correctly?
Comment: @Juhana - thx for the interest! i've updated my question with the data in the i18n table, the code i'm using & the result i'm getting
Answer: must be Configure::write("Config.language", "de-DE");


A question about path-independent integral

Question: Prove that for a domain $\Omega $ in ${R^2}$ and a differential form $\omega  = P\;dx + Q\;dy$, if $\oint_\gamma  \omega   = 0$ for every smooth closed curve in $\Omega $, then the path-integral of $\omega $ is path-independent, in the sense that if $\gamma _1$ and $\gamma_2$ are two piecewise-smooth curves from $p$ to $q$, then $\oint_{\gamma _1} \omega= \oint_{\gamma _2} \omega $.
Comment: For usual definition of exactness of integral it often requires for every piecewise smooth closed curve the integral to be 0. But the weaker hypothesis can be proved to be equivalent as said in some book but without proof.
Answer: Consider the curve $\gamma:= \gamma_1 - \gamma_2$. This is a closed curve by definition. The result follows easily from your hypotesis $\int_\gamma\omega = 0$.
In other words, you're saying that $\omega$ is exact.
Comment: The hypothesis only holds for smooth closed curves, while $\gamma_1-\gamma_2$ need only be piecewise smooth. One needs to extend the hypothesis to a larger class of curves.
Answer: I think the following answer can be applied to smooth manifold, but for the time we restrict ourselves to $\mathbb{R}^2$.
First, we prove that $\frac{{\partial P}}{{\partial y}} = \frac{{\partial Q}}{{\partial x}}$ in $\Omega$. For any $p=(x,y)$ in the $\Omega$, we form a circle $\gamma$ around $p$, then by the Green formula and condition, we have $\int\limits_C  {\frac{{\partial P}}{{\partial y}} - \frac{{\partial Q}}{{\partial x}}} dxdy = 0$ where $C$ is the ball formed by the circle $\gamma$. Then when we shrink $\gamma$, we have $\frac{{\partial P}}{{\partial y}} = \frac{{\partial Q}}{{\partial x}}$ at $p$.
To prove the conclusion, we have only to prove for arbitray piecewise smooth closed curve $\gamma$, $\int\limits_\gamma  \omega   = 0$. For a sigular point $a$ in $\gamma$, first we find a small ball $B$ in $\Omega$ of $a$ and break the curve into $\gamma_1$ and $\gamma_2$, and we can find a smooth curve $\gamma_3$ linking $\gamma_1$ and $\gamma_2$ and differing from them just in $B$(like here). If there are $n$ singular points in $\gamma$, then we have $n$ small balls around them named $B_1, B_2,...B_n$, and $n$ piecewise smooth closed curves $c_i$ each in one $B_i$. So we have to prove that in $B_i$, $c_i$, $\int\limits_{c_i}  \omega   = 0$. Since  $\frac{{\partial P}}{{\partial y}} = \frac{{\partial Q}}{{\partial x}}$, we can consruct a function $u(x,y)$ such that ${u_x} = P$ and ${u_y} = Q$. That is, $\omega$ has a primitive in $B_i$, then $\int\limits_{c_i}  \omega   = 0$. Then we conclude the proof.


Remove managed package dependency

Question: Good day Everyone. My question is a follow up question for my first problem which is already answered here. This is the link of my first question Use Object from another manage Package without making my own package dependent to it. As what our mates here suggested my first problem can be solve using dynamic SObject and dynamic SOQL. My question is that, If I did some code that will make my managed package dependent to "Package B", can I remove the dependency by removing the part of the code that makes it dependent ? or once it is dependent it will always be dependent even if I remove some part of the code ? Thank you.
Answer: if you release a package which is dependent on package B then you cannot remove that dependency easily. You have to connect to salesforce to remove that dependency.
Comment: @Hope In the package screen that lists all the components the rightmost column will tell you if the item is from another package
Comment: Thanks Mate. Is there any way to check if there are dependency created in my code before doing a manage package ?
Answer: It may be possible if you roll back the version that caused the dependency to a beta package. This is only allowed if no subscribers have that version or later installed. You'll also need to create a case with support. Simply removing the component that caused the dependency to be created will not remove the dependency. This is why it is incredibly important that you take care not to create these dependencies in the first place.
Comment: @Hope The "View Dependencies" button on your package should identify all dependencies detected. You should review this list before each upload.
Comment: Thank you for this. I have further question. Is there any way, that I can check if there are dependency created in my code before doing the package ?

Remove managed package dependency


Determining whether raster pixels in or out of zone

Question: I am running ArcGIS 10.2.2 and often use the Zonal Statistics and Tabulate Area Tools. I wanted to confirm that the area of a pixel will only be included in the tabulated area if the pixel centroid is in the zone and that the whole pixel area will be included, even if part of the pixel is outside of the zone. Vice versa, if the pixel centroid is outside of the zone, the area will not be included even if part of the pixel is inside the zone.
Comment: I don't know the answer for sure, but I do know that both the Zonal Statistics and Tabulate Area tools work with rasters only. If your Zone layer is a vector layer, the tool will convert it to a temporary raster before doing the analysis. So the exact boundaries of your vector layer are not actually being used. The Help advises converting your Zones to raster beforehand, so you have total control over the Zone raster, and so you can see it before the analysis runs, rather than having Arc do it behind the scenes.
Comment: I like the advice from @DanC in his first comment. If you convert your zone layer to raster (using Polygon To Raster), you have options for CELL_CENTER, MAXIMUM_AREA, or MAXIMUM_COMBINED_AREA (the latter is potentially useful if you have overlapping polygons) so you would get added control. And of course you can choose your own Snap raster etc.
Comment: Good advice. I guess calculating area in a raster will always be an estimate anyway, unless the raster resolution is super fine.
Comment: @WhiteboxDev because I don't know if it's right. Seems like someone would have to take a look at the temporary raster that ArcGIS generates when given a vector Zone layer to know for sure. I'd imagine that it would generate a Zone raster with the same extent and cell size as the raster you're generating statistics for, but I don't know.
Comment: Okay, how's this as an answer then? Seeing as how we cannot know how ESRI performs the internal rasterization when you provide a vector Zone layer, the best approach would be to rasterize it yourself first. In that way you can control (and be certain of) the method (Cell_Centre, Max_area, Max_Combined_Area) that is used to define the boundaries between zones. The answer combines parts of DanC, mine and jbchurchill's replies. Why don't you take it @DanC? You were the first to the scene.
Answer: Unfortunately, because ArcGIS's source code is not publicaly available, we cannot know for certain how ESRI treats boundary locations when you provide a vector zone layer input. However, as DanC points out above, it is very likely that there is some kind of internal vector-to-raster conversion that is taking place such that the vector zone layer is mapped onto the same raster structure as the data layer. I've had some experience with programming a similar tool (see here) and this is the only logical way to handle this particular problem.
As jbchurchill points out in the comments section, there are actually multiple criteria that grid cells can be classified using when performing vector-to-raster conversion in ArcGIS, including CELL_CENTER, MAXIMUM_AREA, and MAXIMUM_COMBINED_AREA. It is very likely that the CELL_CENTER approach is being used internally because it is the most efficient method, and if this is the case, the answer to your question would be yes, the cell centre must be within the zone to be counted.
The best approach to handling this issue would be to perform the vector-to-raster conversion yourself prior to running the Zonal Stats operation, such that you have more control over how boundary cells are handled. (Note: I've deleted my comments above to remove some of the discussion element of how this answer was derived and I also would like to fully credit DanC and jbchurchill for their contributions. DanC, I still say, if you're willing to post something...I'll delete my answer so you can get the credit!)
Comment: Both the Zonal Statistics tool and Tabulate Area tool definitely convert vectors to rasters internally before running the analysis, it says so in the ESRI help for both tools. I wonder if it's possible to grab that temporary raster from a TEMP folder while it's running.
Comment: @DanC If I had to guess, I'd say that the temporary raster only exists in memory since performance is clearly an issue when you write a tool that has the automagical means of allowing users to input vectors where rasters should be. Of course, I could be wrong and I don't have Arc on my computer to confirm. If you do confirm, why don't you write an answer for it to compile everything we've figured out?
Comment: This answer is very useful to understand how the Zonal Statistics behaves in ArcGIS. http://gis.stackexchange.com/questions/30386/does-a-zonal-statistics-value-change-when-applied-on-a-subset-of-data


How do duels work in Red Dead Redemption 2?

Question: I accepted a duel from a random NPC and the game told me to slowly press R2, and while I was doing that the other guy shot me in the face and I died and lost 7 dollars. I didn't have time to learn anything before I was dead, and it's not in the Help menu so I'm hoping somebody else can explain the dueling mechanics to me before I get shot in the face again. Thanks!
Comment: Simply holding R2 (not slowly) and then pressing it quickly multiple times to shoot worked for me, but I still didn't manage to understand the actual mechanics of duels despite winning one.
Answer: Duels works by holding down R2 slightly to fill the 'dead eye' meter, while this is happening you need to watch your opponent to see what they are doing as they may not draw straight away, dive out the way, pull out a knife or do any number of unexpected things.
The longer you slightly hold R2 down, the more your 'dead eye' bar will fill and the longer your will have to aim. To draw your weapon and begin aiming you need to push R2 all the way down then release the button. When exactly is the best time to do this will vary wildly in every duel. You just need to watch your opponent and draw when you have enough 'dead eye' time to hit the target you want.
Apart from the actions of your opponent, you also need to consider what you want to aim at once you have drawn. If you don't want to shoot to kill you may require a longer time to aim.
Once you have lined up your shot press R2 again to fire.
If you have waited too long to draw and you don't have time to aim before the opponent shots you, then you can press R2 rapidly again after you have drawn. This usually results in a body shot to your opponent, provided they haven't moved out the way, and will usually kill them.
Answer: I have an elite (xbox) controller and was experiencing the same thing for one of the story missions. It dodnt matter how fast I pressed the button, there was no opportunity to also press it completely.
To get around this, I had to map an extra button also to RT. So i used RT to slow press, then pressed my newly mapped "RT" to draw.
Answer: When competing in a dual (or at any point in the game) you can slowly press RT/R2 and you will see a circle slowly wrap around the icon at the bottom right. When you press RT/R2 all the way down you will draw your gun and enter dead eye.
The longer you pull the trigger the longer you will have in dead eye once you draw.
Answer: I finally see the problem and you're not gonna like it. Old controllers for some reason can not detect the second the command after you hold the right trigger. I switched out the button assignments to see if I had to tap the right trigger in order to for my draw my handgun and I was right. My controller that I bought 1 year ago works fine with duels but my black controller that came in with my PS4 in 2015 is not working too well with duels. I'm sorry bro, but if you only got one controller and that one doesn't work. You are gonna have to buy another one if you want to duel properly.


What would you recommend to help with the current state of my mint plant?

Question:
My mint plant stem is turning brown and i had to take out all the dead leaves and I don't know what to do. I think it was dry and put some water now, an it gets adequate sunlight near a window.
Answer: I hate to say it, but I would recommend a new plant. It's possible this one might grow more shoots from the rhizomes, but I wouldn't count on it. As to why your current plant is in this situation, I'm not sure. It could be a disease, overwatering, pests, or something. There might be something wrong with the soil.
If you're intent on saving this one, high amounts of light on the stem (which appears to be leafless) might help it to sprout new leaves.


Back-end options for Angular6 front end

Question: I want to create a small android application, i've planned to use ANGULAR 6 as front end .What should I use for the back-end of this application ?
Comment: Anything you want, really. Personally, I go with PHP & MySQl, like most of the rest of the world, but you do'nt have to
Answer: I guess it depends a lot of your knowledges, it's not possible to give a clear answer without more informations ...
I'm working on a project using Dropwizard to run a REST server as backend (so in java), I find it rather straightforward to use and performant. (you can check our project here for inspiration)
If you'd like to stay in javascript or typescript, NodeJS is very popular and well documented.

Back-end options for Angular6 front end


Aside from Quick Learner are there other qualities that take effects only AFTER character creation?

Question: As can be seen here:
When/how does the Quick Learner merit work?
The quick learner positive quality comes into effect only AFTER character creation.
Are there any other qualities for which this is the case? OR is this the only one?
(With effect I mean they have effects on costs,.... but not on character creation costs but only for costs afterwards).
Comment: Ah nope. what I meant is most of the merits have effects or at least fluff that is in action already at char creation (you are hard to kill and were so even before becoming a PC as example). But quick learner explicitely is only active AFTER char creation as its rules say that it affects only skills after char creation.
Comment: I answered to the best that I understand your question.  Does this answer fit what you're intending to ask, or is the question different than I'm understanding?
Answer: All merits that I have found (with the exception of Cloistered and Bilingual (Both from "One of the Living", p 16) ) take effect after character creation, modifying your rolls, how the DM presents information or what options are available to you.
Answer: The closest result I can find is Old Soul because it only affects untrained skills, which come only after character creation.  Even if you started unskilled and learn it, you lose the Quality's bonus so things after the creation change the way it functions instead of being static throughout (IE -3 on Roll-Type-X, even if you have a +10)
Comment: hmmm the same is then also true for additional essence qualities or am I mistaken?
Comment: From what I've seen, it's the only one where the effect can change dynamically instead of being implicit.


的 at the end of the sentence (ex: 蠻有趣的)

Question: 這篇文章蠻有趣的。
Why is there a 的 at the end?
Could anyone explain the grammar to me?
Thanks!
Answer: 的, when present at the end of a statement, emphasizes and affirms the truthfulness of the stated matters, and it also adds a positive tone to the statement.

這篇文章蠻有趣的。(Implication: It is indeed quite interesting)

她的車子是紅色的. (Implication: Her car is red for sure)

Note that 的 is often used after 是 to form 是...的 construction in Chinese grammar. See here for more details.
Answer: Good question! You probably will not find a simple answer to the question: Why?
这篇文章蛮有趣的!(8 characters)
You can leave 的 off: 这篇文章蛮有趣!(7 characters)
You could replace 的 with 哦:这篇文章蛮有趣哦!(8 characters)
Possibly 8 characters have a better speech rhythm for Chinese ears.
有趣的 here is a descriptive phrase for 文章。
We could rearrange like this: 这篇有趣的文章 ....
这篇有趣的文章,讲述了一只小青蛙的故事。
This interesting essay tells the story of a little frog.
Two small examples of the use of 有趣的:
她在文章中提出了几个蛮有趣的观点。
In the article she mentioned some very interesting points of view.
Then you can take a descriptive phrase like 有趣的 and talk about it:
有趣的是,几周后本杰明再婚了。
Interestingly, Benjamin remarried a few weeks later.
You can't really take 有趣的, interesting, and use it that way in English:
Interesting is ...
Better to write:
The interesting thing is ...
Answer: 的 in 蠻有趣的 is an adjective marker
蠻 = quite
有趣的 = interesting
Some adjectives don't need an adjective marker 的, but some do

有趣的文章 (interesting article) may be reduced to 有趣文章 (interesting article)

為大學寫的文章 (essays written for university) cannot be reduced to 為大學寫文章(write articles for universities) without changing the meaning

這篇文章蠻有趣的

這篇(this)
文章(article)
(is)
蠻(quite)
有趣的(interesting)

的 at the end of the sentence (ex: 蠻有趣的)


The smallest size spoke wrench I can find is 15(.127" / 3.23mm) and it's too big. Where can I find one that fits?

Question: I purchased a spoke wrench with sizes from 10 (biggest) to 15(smallest).  15 is just small enough to round out the nipples on my wheel, but not small enough to actually turn them, so I surmise that I need one size smaller, however I can't seem to find any sizes below 15.  How can I obtain a wrench that I can actually use on my spokes?
Comment: What type of nipples do you have?  The Park Tools SW-0 is the smallest they make and is commonly used with DT Swiss nipples.  But, a 15G is going to the smallest in common usage.
Comment: You could try the four-sided park, mine seems to be a hair below its alleged size.
Answer: Unfortunately this is almost certainly resulting from a ring-type spoke wrench that's loose-fitting and not very well made, of which there are sadly a lot of in the world, despite there being nothing wrong with the core design in this way. (I believe the way it works is that cheaper ones have the wrench slots forged in and nicer ones have them machined in and then are hardened). So your options are either get a tighter fitting multi-size wrench or a one-size, which don't tend to have problems like this.
It wouldn't surprise me if there were all sorts of nipple sizes smaller than 15g in the long history of bikes, but they're pretty rarely encountered now if so, and never on remotely recent conventional nipples.
Comment: I purchased the Park Tools SW-0 and it fits correctly


Definition of Sin

Question: Prior to reading Langston Hughes Salvation, I defined sin as something that you have done wrong. But, in reading Langston Hughes essay, it used sin to mean something like not believing in god. So, my question is whether sin means the first, second or both of the definitions.
Comment: Obviously quite a lot of people who *do* believe in (their) God will think it's a sin not to. Besides which, *sin* is a highly loaded term that usually refers to offenses *in a theological context*. You wouldn't normally hear the word in a modern British courtroom where the intended meaning was simply "wrongdoing".
Comment: @FumbleFingers But I believe it to be a relevant discussion since the bible and the Christian ethos have played a monumental part in the evolution of the system of jurisprudence, across the English-speaking world. Many British people may not believe in God any longer but, as sure as night follows day, they will tell you when someone is acting like a hypocrite!
Comment: @WS2 Unfortunately, the Christian ethos that you can commit an offense simply by thinking about something is somewhat taking its time in completely working its way out of jurisprudence. So is the ethos that someone other than you owns you and your body. If not God, then the state. So that taking narcotics and suicide are de facto sins.
Comment: @Kaz As Thomas Hobbes rightly observed in the reign of Elizabeth I, life in a 'state of nature' is 'solitary, poor, nasty, brutish and short'. The only alternative to the state of nature is to adhere to a 'monarch' (which he accepted to include a republican government). The monarch to all intents and purposes 'owns' us, and our allegiance. Now if you would prefer to walk out into the woods and live and die as the squirrels do, you have no need of being 'owned'...
Comment: This question appears to be off-topic because it is better asked on a related Q&A site.
Comment: @WS2 I've always made fun of that by reading it is "... British and short". :)
Comment: @Kaz Brutish or British you are better off being owned by the Queen of Gt Britain than being reared by wolves like Romulus and Remus.
Answer: The short answer to your question is both.
from Merriam-Webster:

1

a. an offense against religious or moral law
b. an action that is or is felt to be highly reprehensible
c. an often serious shortcoming : fault

If not believing in a god is a violation of a religion's law, then in the eyes of that religion the act of not believing is sin. In this sense, your second example would actually fall under your first umbrella. However, the exact list of what constitutes sin will vary between belief systems/religions, so what one group/individual may view as sin may not be seen as sin by another group/individual.
Apart from religious connotations, definition 1b that I quoted above is probably the most likely/reasonable definition.
Comment: Thanks, I've never thought about it from this angle. I've always thought both definitions as two definitions.
Comment: Webster's 1828 def is general:" The voluntary departure of a moral agent from a known rule of rectitude or duty, prescribed by God; any voluntary transgression of the divine law, or violation of a divine command; a wicked act; iniquity. Sin is either a positive act in which a known divine law is violated, or it is the voluntary neglect to obey a positive divine command, or a rule of duty clearly implied in such command. Sin comprehends not action only, but neglect of known duty, all evil thoughts purposes, words and desires, whatever is contrary to God''s commands or law. "http://goo.gl/bBOfkE
Answer: Sin, like beauty and obscenity, is in the eye of the beholder.
Comment: While cos() works for everyone
Comment: @mgb Is cosplay a sin, by the way?
Comment: @kaz - I think we are just going off on a tangent()
Answer: In religion, sin is a concept not only of doing something wrong (and doing something wrong includes not believing in the right ideas) but also condemned state. Someone who has committed a sin is in a state of carrying sin, like a dirty stain, which can be "washed away" when God forgives. In Christianity there is also the concept of "original sin": carrying sin from birth, having done nothing wrong (or nothing at all, really).
So sin is a word which denotes both the offense and the "criminal record", so to speak.
There is no difference between your two definitions: not believing in God is doing something wrong, among those who believe in that type of religion and use use sin in its context.
You're only disagreeing that simply not believing in something is doing something wrong; but that is irrelevant to the definition of sin. Two people don't have to agree on what is sinful in order to agree on the definition of the word "sin".
A secular use of the word sin is to denote something which is irrationally wrong due to offending someone's preferences or tastes, or whatever:

Did you hear? Jack committed the grave sin of making fun of golf within earshot of the vice president. He can pretty much kiss that promotion goodbye!

Example from a technical context in the field of computing:

Assignment to variables is considered a sin by adherents of pure functional programming, and so they invent and use languages in which it isn't possible.
Answer: Langston Hughes is not a theologian.  He may qualify as a philosopher, or even as a pretty smart guy, but I seriously doubt that he's the final arbiter on the definition of sin.
I think SnoringFrog has a good case: that there's a religious definition of sin, and a secular one.  If it were only religious, it would be a meaningless concept for atheists.
One religious definition of sin is that it is a moral evil.  So now we have to figure out what "moral" and "evil" mean.  "Evil" is a complicated subject, but we can simplify to the basics as "that which harms".   Murder is evil; theft is evil; lying is evil.  I believe that there are degrees of evil; the Holocaust is one of the greatest evils; lying in order to have your little sister get the blame for something you did is a lesser evil.  Lying to protect someone from harm (as in, during the German Reich, saying, "No, there are no Jews here") is usually good.
"Moral" is also a wide concept.  Almost every society has (or had) some concept of morality - there are things that are OK, and things that are taboo.  Those concepts vary widely, and unfortunately, we have fallen victim to the error of "moral relativity": the idea that whatever society A holds a moral, is OK.
You can learn  a lot more by reading C. S. Lewis, for example, "The Abolition of Man".  (Read the non-fiction books first.)  One thing that comes out of Lewis' book is that there are concepts of good that are common to almost every religion and philosophy.  Confucianism, for example, says "Do not do to others what you would not have them do to you".
Comment: -1, sorry. The OP asked what the English word *sin* means, and your answer is mostly an explanation of your personal philosophy of evil. That is unhelpful, irrelevant, and inappropriate to this site; I'm amazed that anyone upvoted it.
Comment: What is or is not moral is a wide concept, but the word moral is not a very wide concept: it just denotes having rules for what is right or wrong. You're confusing the definition of the word "moral" with the set of things that someone particular considers moral. The meaning of the word does not change between people who live by different rules. They disagree on what is moral, but they usually don't disagree about the **word** "moral". Most of this is not an answer to an English language question about "sin".
Comment: @ruakh Oh you'll continue to be amazed at what gets upvoted and downvoted.

Definition of Sin


Electric current definition

Question: I'm trying to understand electric current. Some resources say that it is the flow of charge, and other resources say that it is the quantity of charge that passes through a cross-sectional area over a period of time. This confuses me because I'm not sure if it is a quantity (quantity of charge) or an action (the flow of charge). Can you please provide me with a definitive definition?
Comment: "Flow of charge" and "quantity of charge ... _over a period of time_" both mean the same thing.
Comment: Can you explain more why you think these terms are different? _Flow_ means _amount per unit time_ - the two terms say exactly the same thing...
Comment: Better question to ask would be that how are both of these definitions equivalent
Answer: Simply stated, current is just a flow of charge.  If, however you want to measure and quantify the amount of current, the quantity of current is the amount of charge passing a point over a period of time.
The first statement defines current, while the second defines its measurement.
Comment: "passing a point" is definitionally hazardous.  "passing through a surface" is less so.
Comment: That's not so clear for current...  See, for example, [current clamp](https://en.wikipedia.org/wiki/Current_clamp), where the current through a surface isotopic to a disk is what is measured.
Comment: @EricTowers You are of course correct, but actual measurements in general occur at points.
Comment: @EricTowers There are several ways to measure current.  The NIST defines the ampere as "One ampere is the current in which one coulomb of charge travels across a given point in 1 second." At https://www.nist.gov/si-redefinition/ampere-introduction.  Previously the ampere was defined by the force between infinite parallel wires.  At one time the ampere was defined by the amount of silver deposited from a silver nitrate solution.
Comment: That is not the current definition of the Ampere; it is a simplified description appearing in prose describing the 2019 redefinition.  The current definition makes no attempt to detail what electric current is, merely stating that an Ampere is the electric current which satisfies 1 C = (1 A)(1 s) (where the Coulomp is defined using the 2019 version of the elementary charge and the second is still defined using the hyperfine transition of Cesium).  See [the BIPM](https://www.bipm.org/en/si-base-units/ampere) for instance.
Answer: You can probably find various definitions so I am not sure if there is any single "definitive" definition of electric current.
But as an engineer, I use the definition from the reference handbook for the Fundamentals Exam for becoming a professional engineering in the U.S. as follows:
"Electric current $i(t)$ through a surface is defined as the rate of charge transport through that surface or
$$ i(t)=\frac{dq(t)}{dt}$$
which is a function of time $t$, since $q(t)$ denotes instantaneous charge.
A constant current $i(t)$ is written as $I$, and the vector current density in amperes/m$^2$ is defined as $\vec J$."
Hope this helps.
Comment: Writing a formula adds nothing to the understanding.
Comment: @Peter-ReinstateMonica I respectfully disagree. The OP asked for a definition which addressed his question of whether current is simply a "quantity of charge", or  simply the "flow of charge". This definition, with the formula, shows that it is the rate of charge transport across a surface.
Answer: Your confussion regarding the terms is specific to the use of the terms in English.
There is the phenomenon of charge flowing through a wire and the physical quantity that is used to measure this flow. The two are different objects and they could be named with two different words. Which is done in french, Italian, Romanian and maybe other languages that I don't know.
So the phenomenon is the "electrical current" and the quantity representing the rate of flow of charge is the "intensity of the electrical current". A hint about this is the usual leter used to desigante it "I" and not "C" (from current).
The "intensity of the current" can be shorted to just "current" and so it may produce confusion with the term used for the phenomenon.
In English this is so common that even in physics textbooks they call the quantity "current" even though they mean the intensity of the current. In Romanian, for example, I learned about the "intensity of the current" in school and this is what we called it in the classroom, but people in electrical industries and trades call it "current" as well or even the equivalent of amperage, like in English we use voltage for potential difference. In French and Italian physics texts I can see that they also use the equivalent of "intensity of the current" so there is less confusion than in English, I suppose.
Comment: Interesting observation. In German, in many cases we use the word for the property (current, distance, mass etc.) also for the *amount* of that property. English and German are similar enough that  I can stick with English here, the examples work 1:1 in German: "What's the current, distance, mass, force?". As is often the case for native speakers I find that entirely normal -- but for other things it is utterly impossible: "What's the light, money, sound, butter" does not make sense, or means something different. We have to ask "what's **the amount (or sometimes, level) of** x".
Comment: I was wondering about German.  When I said that it is something specific to English I meant from the lanuages I understand more or less. German it's on my list of languages I want to learn but did not get there yet.  Thank you for your comment.
Answer: Bob D and SomeUser, respectively, explained that current is the movement of charge per unit time,
$$ I = \frac{\partial Q_\Omega}{\partial t},$$
and the integral of current density over cross sectional area,
$$ I = \int_{\partial\Omega} \text{d}\mathbf{S} \cdot \mathbf{J}.$$
I will add that these two quantities are the same because of charge conservation. Indeed, by standard arguments (see Griffiths, Electrodynamics), we can write down the following equation
$$\frac{\partial \rho}{\partial t} + \nabla\cdot \mathbf{J} = 0.\qquad\qquad(*)$$
The first term describes the change of charge density over time in some region $\Omega$, and the second describes the outward flow of the current density in that same region. Indeed, we see the quantities above once we integrate over the region $\Omega$,
$$\int \text{d}V ~\frac{\partial \rho}{\partial t} = \frac{\partial Q}{\partial t}, \quad\text{and} \quad \int_\Omega \text{d}V~ \nabla \cdot \mathbf{J} = \int_{\partial\Omega}\text{d}\mathbf{S}\cdot \mathbf{J},$$
where we've used the divergence theorem for the second equality.
Since charge density and current density are not in general separately conserved, we can define a new quantity, called the four-current, which is conserved by the equation $(*)$:
$$J^\mu = (\rho, \mathbf{J}),\qquad \partial_\mu J^\mu = \frac{\partial \rho}{\partial t} + \nabla \cdot \mathbf{J} = 0.$$
The statement $\partial_\mu J^\mu= 0$ is equivalent to the conservation of charge. See here for more.
Answer: Electric current $I$ through a cross section of a conductor is: $$\lim_{\Delta t \to 0} \frac{\Delta q}{\Delta t}$$ where $\Delta q$ is the amount of charge that passed through that cross section during the period of time of length $\Delta t$.
Therefore, it is a scalar quantity.
Alternatively, if the area of the cross section is $S$, the quantity of charge per unit volume of the conductor is $n=\frac{N}{V}$ ($N$ is the number of charged particles in volume $V$) and $v_d$ the average drift velocity in the direction of the electric field, then the amount of charge that passes through that cross section in time $\Delta t$ is $\Delta q=q_0 \times n \times S \times v_d \times \Delta t$ ($q_0$ is the elementary charge of a single particle).
This is because all the charge that passes through during this period is located within a cylinder of height $v_d \Delta t$ and volume $V=Sv_d \Delta t$ which contains exactly $\Delta N=nV=nSv_d \Delta t$ charged particles.
From this, the current $I_S$ through this cross section would be $$\lim_{\Delta t \to 0} \frac{\Delta q}{\Delta t}=\lim_{\Delta t \to 0} \frac{q_0nSv_d \Delta t}{\Delta t}=\lim_{\Delta t \to 0} q_0nSv_d=q_0nSv_d$$.
All in all, it is a scalar quantity that describes the amount of charge that flows through a surface during a certain period. Its units are $\frac{Coulombs}{second} \equiv Amperes$.
Answer: I prefer to define it as
\begin{equation}
I = \iint_{S} \mathbf{J} \cdot \, d\mathbf{S}
\end{equation}
which can be rewritten as
\begin{align}
I &= \frac{\iint_{S} \rho \mathbf{v} dt \cdot \, d\mathbf{S}}{dt}    \\
\end{align}
The charge density is integrated over the surface and some thickness given by the velocity (actually, just the speed on the direction perpendicular to $S$) of the charges: if the charges are moving faster, further charges will reach the surface in   the same time $dt$. You can see units match up.
\begin{align}
  &= \frac{\iint_{S} \rho d\mathbf{r} \cdot \, d\mathbf{S}}{dt}      \\
  &= \frac{\iint_{S} \rho \,dr_{\perp} \,dS}{dt}                     \\
\end{align}
Bassically, the numerator is the total amount of charge that will pass trough $S$ in $dt$. Thus, we can write it $dq$.
\begin{equation}
I = \frac{dq}{dt}
\end{equation}
This do not intend to be a "proof" nor similar. I just wanted to point out that both concecpts are equivalent. Myself, I was introduced this concept the other way arround.

Electric current definition


Problems with my new lens on my Nikkon D3000

Question: I just added a new 70-300 Nikkor lens to my Nikkon D3000 camera. It will not auto focus or take a picture with the new lens. It seems to be installed properly and is communicating with my camera. It just does not allow me to take a picture. I can put the old 55mm lens on and it works fine. Help!
Comment: Nikon have made quite a few 70-300mm lenses over the years - some will & some won't work on a D3000 - so you'll have to tell us exactly which one you got.
Comment: _Which_ Nikon 70-300mm lens? There are several.
Comment: Although the lenses and camera models are different, the core issue is the same: Nikon's AF-P lens series has limited or no compatibility with any but the latest models of DX bodies.
Comment: See also: [Why won't my 18-55mm f/3.5-5.6G auto-focus on my Nikon D3200?](https://photo.stackexchange.com/q/88395/15871)
Comment: And: [Extendable Nikon 18-55 mm lenses compatible with D7100?](https://photo.stackexchange.com/q/84700/15871)
Answer: If your lens is the Nikkor AF-P 70-300mm f/4.5-5.6E ED VR lens, it is not compatible with the D3000. From Nikon's product page:

The number of cameras compatible with this lens is limited. Even for compatible cameras, a firmware update may be required. Fully compatible models: D7500, D5600, D3400, D500.
Fully compatible models (without limitations) after available firmware update: D5, D750, D610, D600, D5500, D5300, D3300. Download firmware updates at: http://downloadcenter.nikonimglib.com/en/index.html
Regardless of firmware update, these models will still have some limitations*: D4, D4S, D3, D3X, D3S, D810, D810A, D800, D800E, Df, D700, D300, D300S, D7200, D7100, D7000, D5200.
*Because these models reset focus when reverting from standby status (timer off), pre-focus shooting is not available.
Incompatible models: D2 series, D1 series, D200, D100, D90, D80, D70 series, D60, D50, D40 series, D5100, D5000, D3200, D3100, D3000, film SLR cameras.

This is true of all AF-P lenses in Nikon's lineup, the first of which was introduced in 2016. The AF-P motor system requires lens focus feedback (and possibly power delivery) that older camera body designs and/or firmware were not capable of providing.


Realm studio can't open new realm file generated from nodejs realm v6.1.1

Question: I'm trying to convert my json data to a .realm file, i think i'm succeeding since i see the default.realm file increasing size but when i try to open it using realm studio i get this error:

I'm not sure what to do at this point. The realm/realm mongodb realm sync names are very confusing and links to docs go from one product to another which makes it a lot more confusing.
Answer: Realm is in the process of a change from Realm to MongoDB Realm
The first, I call 'classic' Realm. That's going be be Realm 5.x SDK and Realm Studio 3.11.
The Beta version of MongoDB Realm is what you're using (I think) and it's SDK is 10.x and that goes with Realm Studio 10.x. They work together and the SDK's are not compatible with the other Realm Studio versions.
So, if you are using the Beta, you'll need to download Realm Studio 10.x.
Be sure to back up important data files as opening them with a newer version will update them and you can't go backward.


Orthographic Cam with HDRI in background

Question: Basically I'm trying to make an animation birthday card 4 my friend. There is this airbus a400m plane scene, which I'm trying to film it like mission impossible fallout. The view of the plane is in orthographic, and the problem is that with using orthographic cam on blender, I can't see MY HDRI. Increasing the distance didn't quite work so pls give me some tips thx.
Answer: The longer the camera lens, the smaller part of HDRI is visible.
Orthographic camera is infinitely long, so it only shows one pixel of your HDRI.

Solution: Use a perspective camera.


Given a 12x12 binary image (only black and white pixels) what is its dimensionality? And how can I define dimensionality of a data space?

Question: Suppose I have a grid 12x12 of pixels that can be only black or white. I can't understand if the dimensionality is 2 or 3. I mean... Is dimension given by 12x12 or 12x12x2 ?
Answer: There is some ambiguity in dimensionality you ask for. The vector space that your input lies in is $12\times12 = 144$ dimensional. So, if you're going to apply some kind of dimensionality reduction algorithm, e.g. PCA, this is the dimension. But, we sometimes tend to refer to dimension as the shape of the tensor, which is $2$ in this case. Some libraries might read the image into $12\times12\times3$ tensors, in which the third entry indicates RGB decomposition, even if the image is black and white. In this case, the tensor dimension is $3$.
Comment: Yes, I want to apply a dimensionality reduction but also in this case I don't understand why the dimensionality is **12x12** and not **12x12x2** (no rgb, just black or white).
Comment: Where does that 2 come from? Is it the number of possible choices for a given pixel?
Comment: Yes, supposing that we are talking about rgb pixels the dimensionality could be **12x12x3**... or not?
Comment: Definitely not. {0,1} is your domain, it has nothing to do with dimensionality. In RGB, your domain would be binary numbers with 24-bits, i.e. $2^{24}$ possible values. For dimensionality, you'll consider how many *variables* you have, not their values. In this case, you have $144$, i.e. $x_{1,1},x_{1,2},...x_{12,11},x_{12,12}$


Need recommendation of name of human lotion or cream that is safe for cats to lick!

Question: I have a cat who loves to kiss me by licking my hands, arms, face when I am near or petting her. I am wondering if anyone has heard of a human hand or body lotion that is safe for cats to lick? My hands and arms are dry, so I like to wear lotion! I just want to make sure that kitty is safe. Thanks for the help!
Comment: Have you considered simply not using skin lotion anymore, and letting your body reset to an equilibrium where it doesn't need skin lotion to maintain its skin? If you habitually use skin lotion, then your body will adjust itself by making the skin dryer to compensate, forcing you to continue to use skin lotion.
Comment: I am sorry but this question has to be closed because of reasons mentioned in [this Q&A](https://meta.stackexchange.com/questions/158809/why-are-shopping-list-questions-bad).
Comment: I agree with making your own! Shea butter would be a good natural option as well. Super moisturizing and safe for animals.
Comment: Thank you for the ideas on making my own hand cream! I do have coconut oil -here maybe I'll try a little of that alone-Hopefully not too greasy.
I also appreciated the suggestion about not using lotion so that your body could moisturize itself and not get dependent, but my experience has been that as we age, we lose oils and elasticity and the skin needs a little help. I'm convinced that my face looks as good as it does (few wrinkles) because I've been using creams through the years (And good genetics! Thanks, Mom & Dad)!I appreciate all the thoughts and suggestions. Thank you!!
Answer: You are a good cat parent! There are so many lotions out there that are concerning. You could try making your own hand moisturizer out of coconut oil, or jojoba oil mixed with a bit of glycerine. Have them at room temp and use a wire whisk to emulsify. You could try other combos to see if they work for you. In a pinch, plain Vaseline might work, although it is greasy.


Java compile error with generics

Question: public class IRock
{
    public List<IMineral> getMinerals();
}

public class IMineral { ... }

public class SedimentaryMineral implements IMineral { ... }

public class SedimentaryRock implements IRock
{
    private List<SedimentaryMineral> minerals;

    @Override
    public List<SedimentaryMineral> getMinerals()
    {
        return minerals;
    }
}

Getting a compiler error:
Type mismatch: cannot convert from List<SedimentaryMineral> to List<IMineral>.

I understand that I can't convert an impl back to its API interface (because an API is just than - an API). But I'm confused as to why I'm getting a compiler error! Shouldn't Java honor the fact that SedimentaryMineral is an impl of IMineral and allow this?!?
Along with an explanation as to why I'm getting this compiler error, perhaps someone could point out why my approach here is "bad design" and what I should do to correct it. Thanks in advance!
Comment: There's a really good explanation in the answer of this question: http://stackoverflow.com/questions/5082044/most-efficient-way-to-cast-listsubclass-to-listbaseclass
Answer: Imagine if this compiled:
List<SedementaryMineral> list = new ArrayList<>();
list.put(new SedimentaryMineral());

List<IMineral> mineralList = list;
mineralList.add(new NonSedimentaryMineral());

for(SedementaryMineral m : list) {
    System.out.println(m); // what happens when it gets to the NonSedimentaryMineral?
}

You have a serious issue there.
What you can do is this: List<? extends IMineral> mienralList = list
Answer: The problem is that Java generics are not covariant; List<SedimentaryMineral> does not extend/implement List<IMineral>.
The solution depends on precisely what you wish to do here.  One solution would involve wildcards, but they impose certain limitations.
Comment: See my answer for a simple example why a collection of apples is not a collection of fruit. Even if collections were covariant, you'd just risk getting runtime exceptions. I prefer compile time error checking to unexpected errors at runtime.
Answer: Here is what will work for you:
interface IRock
{
    public List<? extends IMineral> getMinerals();
}

interface IMineral { }

class SedimentaryMineral implements IMineral {  }

class SedimentaryRock implements IRock
{
    private List<SedimentaryMineral> minerals;

    public List<? extends IMineral> getMinerals()
    {
        return minerals;
    }
}

Here I am using wildcard to denote that I allow list of everything that extends the basic interface to be returned from getMinerals. Note that I also changed some of your classes to interfaces so that everything will compile (I also removed the accessors of the classes so that I can put them in a single file, but you can add them back).
Answer: First, your code would work if you done something like
...
public interface IRock
{
    public List<? extends IMineral> getMinerals();
}
...

Second, you can't do this directly because you wouldn't be able to guarantee type safety from what you insert inside your list. So, if you want anything that could extend Mineral inside your rock, do what I showed above. If you want that only a specific type of be inserted inside a rock, do something like
public interface IRock<M extends IMineral> {
    public List<M> getMinerals();
}
public class SedimentaryRock implements IRock<SedimentaryMineral> {
   public List<SedimentaryMineral> getMinerals()
   {
    return minerals;
   }
}

Answer: You need to understand why this cannot work in general, and why it is a good thing to have the compiler complain here.
Assuming we have a class ParkingLot implements Collection<Cars> and since Car extends Vehicle, this would automatically make the ParkingLot also implement Collection<Vehicle>. Then I could put my Submarine into the ParkingLot.
Less funny, but simpler speaking: a collection of apples is not a collection of fruit. A collection of fruit may contain bananas, while a collection of apples may not.
There is a way out of this: using wildcards. A collection of apples is a collection of "a particular subtype of fruit". By forgetting which kind of fruit it was, you get what you intended: you know it's some kind of fruit you get out. At the same time, you can't be sure that you are allowed to put in arbitrary fruit.
In java, this is
Collection<? extends Fruit> collectionOfFruit = bagOfApples;
// Valid, as the return is of type "? extends Fruit"
Fruit something = collectionOfFruit.iterator().next();
// Not valid, as it could be the wrong kind of fruit:
collectionOfFruit.put(new Banana());
// To properly insert, insert into the bag of apples,
// Or use a collection of *arbitrary* fruit

Let me emphasize the difference again:
Collection<Fruit> collection_of_arbitrary_fruit = ...;
collection_of_arbitrary_fruit.put(new Apple());
collection_of_arbitrary_fruit.put(new Banana());

Must be able to store any fruit, apples and bananas.
Collection<? extends Fruit> collection_of_one_unknown_kind_of_fruit = ...;
// NO SAFE WAY OF ADDING OBJECTS, as we don't know the type
// But if you want to just *get* Fruit, this is the way to go.

Could be a collection of apples, a collection of banananas, a collection of green apples only, or a collection of arbitary fruit. You don't know which type of fruit, could be a mix. But they're all Fruit.
In read-only situations, I clearly recommend using the second approach, as it allows both specialized ("bag of apples only") and broad collections ("bag of mixed fruit")
Key to understanding this is to read Collection as Collection of different kind of A, while Collection<? extends A> is a Collection of some subtype of A (the exact type however may vary).

Java compile error with generics


Combining primes for getting primes?

Question: I was thinking about what would happen when we combine two  prime numbers $p$ and $q$ into one number $:pq:$ . Like if $p=5$ and $q=3$ , then $:pq:=53$ . Then if $p=7$ and $q= 11$ then $:pq:=711$ and so on for other $p$ and $q$. It seems so that there is a fairly good chance that the newly obtained number is also a prime. Further examples which we can see are (in no specific order)
$$331 ,353 , 223 , 233 ,719 \cdots$$
This motivates me to put forward the following question- Does there exist infinitely many prime numbers $p$ and $q$ such that $:pq:$ is a prime?
Comment: By Dirichlet's theorem, there are infinitely many primes of the forms $10n+3$ or $10n+7$, or $100n+11$... Anyway, remains to be proven that infinitely many of these $n$ are prime. And by the Green-Tao theorem, there are arbitrarily long sequences of $n$ generating only primes. Anyway, remains to be proven that they contain at least a prime $n$. You can think of Bertrand's postulate, but this is not enough as the arbitrarily long sequence (say of length $m$) may start later than $m$.
Comment: $711$ is not a very good example since it equals $79\cdot 9$
Comment: With regards to prime numbers, there is nothing particularly special about the number $10$, which you are using as the representation base of $pq$ (e.g., why not use base $4,6,8,12$, etc?).
Comment: @5xum it was nt for prime it was just to introduce the notation
Comment: There is a small typo, it should be $q=11$.
Comment: @IndrayudhRoy yeh , let me correct it
Comment: 131 is also not a good example as 1 is not prime.
Comment: @YvesDaoust changes made
Answer: Yes, there are infinitely many such primes. I don't have a theorem with proof but I think pigs would fly before someone could prove me wrong on this.
Go to the OEIS and search for "23, 37, 53, 73, 113, 137, 173, 193, 197". They have a list of ten thousand such primes, though of course that doesn't prove there are infinitely many of them. Much more telling is that the entry's keyword field doesn't have the keyword "fini", which they use to mark sequences they know to be finite.
Denote by $\mathcal{L}$ how many base 10 digits an odd prime $q \neq 5$ has. Then we need to find a prime $p$ such that $10^\mathcal{L}p + q$ is also prime. Given that there are infinitely many primes, it seems highly improbable to me that none of them would satisfy this requirement.
A slightly more interesting question would be: for every odd prime $q \neq 5$ does there exist at least one prime $p$ such that $10^\mathcal{L}p + q$ is also prime?
Comment: I don't know if this counts as a heuristic to you, but I will try: I believe that for each prime other than 2 or 5, there is at least one other prime which can be prefixed to it so that the concatenation is another prime. If I'm correct in that belief, even if for some primes there is only one other prime that works as such a prefix, since there are infinitely many primes that would still prove there are infinitely many such prime concatenations.
Comment: I have a belief that may be less interesting but easier to prove: I believe there are infinitely many primes to which you can suffix 3 or 7 to make another prime. See for example Sloane's A023238.
Comment: Sourpe can you give a mathematical heuristic for your statement .

Combining primes for getting primes?


Finding a highest megapixel camera for PC

Question: How can i have a PC camera/webcam that have high quality as a portable camera, like the Nikon D800 have 35 MP. I can't find a PC camera that have the same Megapixel ? Even the Microsoft Lifecam have only 2MP and it's not my choice :(
Comment: This question appears to be off-topic because it is about scientific imaging, not audio-video production.
Comment: @AJHenderson ok, it's a bit relevant when i show my purpose. But the main problem is a camera/webcam for PC, so i have edited the question
Comment: It's unfortunately still not a good question as it asks to find the highest MP camera which is a shopping question and still off topic as it will change every time a new, higher MP camera comes out that supports tethering with a computer.
Comment: Please note that many people take the megapixels specification as proportional to the image quality, but that is incorrect.

Higher megapixel cameras require smaller pixel sensors (as there are more of them on the sensor). Smaller pixel sensors mean less photons are hitting each sensor, thus producing more noise.

High megapixel specs are important mainly if the image is to be printed in large scale (billboards, etc.). But for highest quality small images a lower mega pixel camera may well produce a better image.
Answer: Your best bet is a DSLR with a lens mount for the microscope.  It goes in places of the eyepiece and generally does not have the diopter from an eyepiece (so magnification is a bit lower, but you can also zoom in).  Among standard size DSLRs, the highest megapixel one I'm aware of at this time is the Nikon D800 at 35 megapixels, but there may be bigger out there now.
Comment: @ĐứcUltraSoft -- As AJ says, the best way to do that is to _use the Nikon D800_.
Comment: @ĐứcUltraSoft You can connect a DSLR to a computer. This is called "tethering".
Comment: How can i have a PC camera that have high quality as the Nikon D800?
Comment: @mattdm but i need a camera/webcam directly for computer. It must be show directly in computer instead of a portable camera.
Comment: @ĐứcUltraSoft - As mattdm already pointed out, a DSLR can be tethered to a computer using drivers for the camera and photos can be taken directly on the computer.  You also want a camera that supports an interchangeable lens system so that you can properly rig it to a microscope, otherwise the effective resolution of the image the camera is seeing will be less than that of the resolution of the camera.  (And honestly, there is a decent chance that it will be anyway, depending on the quality of microscope you are using and the level of magnification.)


How would you solve for the complex roots of a polynomial with a greater degree than two?

Question: Lets say we have a polynomial with only complex roots.
an example would be
$$9x^6-4x^5+x^4-7x^3+8x^2-8x+7$$
How would one go about finding the roots to this polynomial and factoring it. I know this may seem like just asking for an answer, but I would really like to know the process behind it because I couldn't find anything online that would seem to work.
Comment: Use a black box polynomial root finding algorithm like the Jenkins-Traub algorithm.  Fortran code is available from netlib, toms 493 http://netlib.org/toms/
Answer: For the case where the degree is 3 or 4, there are formulae giving the roots. However, these formulae cause some nasty numerical problems, so they have to be implemented very carefully, as discussed here. Actually, even the quadratic formula has numerical problems if you don't code it correctly.
For degrees higher than 4, there are no general closed-form formulae, so you have to use numerical methods. There is a survey of available methods here. You shouldn't have to write any code yourself -- the work has already been done by experts, and software libraries are widely available.


"seen before" vs "already seen"

Question: Please clarify the exact difference between:
I've seen your hands before
and
I've already seen your hands
Which sounds more natural in everyday English and which sound more common in formal talking or writing?
Comment: They mean different things, so the second question is irrelevant. The first means that you recognise the person's hands from some time in the past. The second might be said if you are, say, a classroom assistant inspecting the children's hands, and one of them comes to you twice.
Answer: It's not possible to say which is natural in everyday English as both sentences have different meanings in different contexts.
In case of human hands;
I've seen your hands before means the person has seen her or his hands before. This could mean the person remembers the hands or at least remember to have seen them at least once.
On other hand, I've already seen your hands means the person has already seen her or his hands.
My personal opinion is that you could use the latter one when you have seen the hands recently. Otherwise, use the former sentence.

"seen before" vs "already seen"


Growth Rate of Power of 2 Partition Function

Question: I was wondering how to find the growth rate of the function defined by the number of ways to partition $2^n$ as powers of 2. After a search through OEIS I came across OEIS A002577 which is what I'm looking for. I can't seem to find any link to asymptotics for this function. Could someone help?
Answer: Go a bit deeper. OEIS A000123 gives the number of ways of partitioning $2n$ (multiplication, not exponentiation) into powers of two. In the formulas section there is this from Philippe Flajolet (typesetting and expansion of abbreviations is mine):

The asymptotic rate of growth is known precisely – see de Bruijn's paper. With $p(n)$ the number of partitions of $n$ into powers of two, the asymptotic formula of de Bruijn is:
  $$\log p(2n) =\frac1{2\log2}\left(\log\frac n{\log n}\right)^2+\left(\frac12+\frac1{\log2}+\frac{\log\log2}{\log2}\right)\log n\\
-\left(1+\frac{\log\log2}{\log2}\right)\log\log n+\Phi\left(\frac{\log\frac n{\log n}}{\log2}\right)$$
  where […] $\Phi(x)$ is a certain periodic function with period 1 and a tiny amplitude.

I will abbreviate the above RHS to $A\left(\log\frac n{\log n}\right)^2+B\log n
+C\log\log n+O(1)$. To get the growth rate of the number of partitions of $2^n$, substitute $n\to2^{n-1}$:
$$\log p(2^n)=A\left(\log\frac{2^{n-1}}{\log2^{n-1}}\right)^2+B\log2^{n-1}+C\log\log2^{n-1}+O(1)$$
$$=A((n-1)\log2-\log((n-1)\log2))^2+B(n-1)\log2+C\log((n-1)\log2)+O(1)$$
Define $m=(n-1)\log2=O(n)$:
$$=A(m-\log m)^2+Bm+C\log m+O(1)$$
Therefore
$$p(2^n)=e^{A(m-\log m)^2+Bm+C\log m+O(1)}=O(e^{n^2})$$
Answer: Maybe this is what you're looking for: let $b(n)$ be the number of partitions of $2^n$ into powers of $2$, and assume that $2^{n+1}$ is an integer. Then de Bruijn (1948) showed that there exists a function $\psi$ of period $1$ such that
$$\begin{split}\ln b(n+1)&=\tfrac{1}{2\ln 2}(n\ln 2-\ln n-\ln\ln 2)^2\\
&\quad+\left(\tfrac{1}{2}+\tfrac{1}{\ln 2}+\tfrac{\ln \ln 2}{\ln 2}\right)n\ln 2\\
&\quad-\left(1+\tfrac{\ln\ln 2}{\ln 2}\right)(\ln n+\ln\ln 2)\\
&\quad+ \psi\left(\tfrac{n\ln 2-\ln\ln n -\ln\ln2 }{\ln 2}\right)+ o(1)\text{.}\end{split}$$