How to determine the highest quality fish oil?

Question: I've read many, many articles recently about how great fish oil is for you.  Awesome.  I'm in.
The hard part - which fish oil should I take?  There are so many of them.
What attributes make a fish oil "high quality"?
Comment: I'd rather just eat the fish
Comment: Unless there is some connection to exercise, this question is closed as off-topic according to the [faq]. If it is edited to be on-topic and fits the scope of the site, reopening the question will not be an issue.
Answer: This article from the New York Times cites a consumerlabs.com report (can't link directly to report because you have to sign up) which says that large chains like Walmart/Costco store brands are typically high quality:

In any case, ConsumerLab.com says it has found a few patterns that consumers may find helpful. Products sold by vitamin chains tend to be more reliable than drugstore brands, and Wal-Mart and Costco's vitamin lines are usually worth considering. In a recent test of multivitamins, ConsumerLab.com found that Equate-Mature Multivitamin 50+ sold by Wal-Mart was just as good as the name brand Centrum Silver, but at less than a nickel a day is half the price.

Note that even though the study was for multi-vitamins, I'm assuming that the same standards for manufacturing the pills are carried over into different vitamins/supplements.  The only way to not have to make this assumption would be to point to an equivalent study for fish oil and I don't know of one (feel free to upvote/accept someone else if they happen to find one).  This does make sense though because whoever produces the highest volume will likely discover the most problems and be more apt to roll out fixes to the manufacturing process.  Pills aren't like food/beer/whiskey/wine where quality tends to go up when made in smaller batches.
So I'm sure if you just picked up the walmart store brand you'll be fine.  Keep in mind that "quality vitamin" just means that the contents of the bottle match what the nutrition facts say they do.  In terms of amounts and how much you should be taking you should look into research on amounts used in fish oil studies and I know from experience that fish oil pills do vary in amount of oil per pill, so you should definetly pay attention to this.
Comment: There are different brands at Wal-Mart, sometimes. I'm guessing it's talking about the SPECIFIC Walmart "in house" brand, so don't assume everything sold there is good.
Comment: Good point.  Bolded the walmart store brand for emphasis.
Answer: My source for information on this topic is Whole9:

Your fish oil should be free of soy (including lecithin), dairy, wheat, rice, sweeteners or other artificial ingredients.
What fish oil brands does Whole9 recommend?
A: The brand we take personally is Stronger Faster Healthier's OmegaMaine.  We've tried lots of other brands, and like quite a few (including Carlson's and Nordic Naturals), but we choose OmegaMaine for three reasons.

First, the ingredients are squeaky clean – no soy, dairy, wheat, sweeteners or other artificial ingredients.
Second, it has more EPA and DHA per teaspoon (1.8 grams!) than other high quality brands, and taking in a bunch of fragile PUFAs besides EPA and DHA isn't a great idea. Prioritize the EPA and DHA, and minimize your PUFA intake in general.
Third, it comes in five palatable flavors (lemon, tangerine, mint, chocolate and vanilla), and all taste pretty darn good… for fish oil.

They have a lot more, including brand recommendations and frequently asked questions. Their general supplement checklist is good stuff too. Some excerpts:

Is the product designed to replace real, high quality, fresh food in your diet?
Are the product's claims too good to be true?
...is it cost-prohibitive to eating better quality food?


Optimal mySQL design for 500k+ products with up to 50 specs

Question: I facing a problem where I have to design a MySQL database capable of containing +500k products in approx. 1.500 categories, that can hold up to 50 specs. (like size, weight, speed, color, etc).
My goal is to find/use a design that is optimal (fast) for selecting products base on the input of up to 50 specs. Later on, I may implement precached on often use search patterns (specs), when I have collected statistics on that.
As my raw data is in Python (dicts/lists) I was initially thinking of using JSON-objects, but as I see it, this would result in huge overhead and maybe bad search performance. (Actually, I have no experience in using JSON in MySQL)
BTW The easiest would have been using MongoDB, but this is a no-go. I'm also trying to find a way to design it as generic as possible without having product-specific tables and like.
Based on the information above... What design/schema would be the optimal/best, regarding fast search in specs. ?
Is EAV (Entity-Attribute-Value) the way to go or is the a better way ?
If anybody knows if this question is answered somewhere, please link to it :-)
Thanks
Answer: A common request.  You are actually a step ahead of most questions tagged with [eav] -- you have thought about "common use patterns" and how to optimize once you gather that info.
You should be able to make an initial guess at what is most common, put them in columns for efficient searching, put flag-like attributes in a FULLTEXT-indexed column, then throw the rest into a JSON column for testing in the app.
More:  http://mysql.rjweb.org/doc.php/eav


Quotient space of $S^n$ and the projective plane

Question: The quotient space on $S^n \times I$ obtained from equating $(x, 0) \sim (-x, 1)$ seems like it might have the same fundamental group as the projective plane, but I'm not entirely sure how to prove it.  Is there a way to use van Kampen here?
Answer: The homeomorphism $x\mapsto -x$ of $S^n$ is homotopic to the identity of $S^n$ if and only if $n$ is odd. Thus, using my answer to you previous question, you know that whenever $n$ is odd, the mapping torus of the antipodal map of $S^n$ is homeomorphic to the mapping torus of the identity map of $S^n$, which is $S^n\times S^1$. Projective space $\Bbb{RP}^n$, for $n\geq 2$ has fundamental group $\Bbb Z/2\Bbb Z$, while for $n\geq 2$, $S^n\times S^1$ has fundamental group $\Bbb Z$. When $n=1$, then the fundamental group is isomorphic to $\Bbb Z\times\Bbb Z$. So at least when $n$ is odd, your claim cannot be correct.
EDIT. Suppose $n+1=2p$ is even, and identify the $\Bbb R^{2p}$ with $\Bbb C^p$. Then there is a homotopy through homeomorphisms linking the identity to the antipode given by
$$H((z_1,\dots,z_p),t)=(e^{i\pi t}z_1,\dots,e^{i\pi t}z_p)$$
EDIT. The mapping cylinder $M_\phi$ associated to a homeomorphism of an orientable manifold $X$ is (a) a manifold, (b) orientable iff $\phi$ preserves the orientation of $X$. Since the antipode reverses the orientation whenever $n$ is odd (which we assume below), this shows that the mapping cylinders of the identity and of the antipode aren't homeomorphic, as the first one isn't orientable, while the second one is.
In any case, you can check this explicitely by moving a frame $\mathcal{B}_{u}\equiv$ basis of the tangent space to $M_{\text{antipode}}$ at $c(u)$ along the continuous loop $$c(u)=\begin{cases}0\leq t\leq \frac12:&[(N,2u)]\\
\frac12\leq t\leq 1:&c(u)\text{ links }[(-N,0)]\text{ to }[(N,0)]\end{cases}$$
(where $N=(0,\dots,0,1)$, and the second part of the loop could follow a great circle drawn on $S^n$). Since the antipode reverses orientation, the two frames $B_0,B_1$ define two different orientations of the tangent space at $[(N,0)]$, and $M_{\text{antipode}}$ is non-orientable.
Comment: But as you mentioned before, is that homotopy a homotopy through homeomorphisms?  I don't think the same homotopy will work because the great circles might intersect
Comment: Ok that makes sense.  I actually think the answer is the same for $n$ even but not sure how to show it
Comment: Can this be done using van Kampen? Take $U$ to be half the ball and $V$ the other half.  Since $U \cap V$ has one less dimension we know it's fundamental group
Comment: I doubt it: I don't thinkthe mapping cylinder is orientable when $n$ is even.
Comment: Is there anyway to get this for $n$ even?  I know that the quotient map on antipodes is homeomorphic to the projective plane but I'm not sure that helps


Galaxy Note II slow due to lack of memory?

Question: I have a Galaxy Note II and it's too slow due to low memory, I bought a 16 GB memory card and it still is slow, what to do?
Comment: Stack Exchange sites operate in English only. As such, we ask that all posts are in English as well. If you need to use a machine translation that is generally fine - other users can edit your posts to fix any errors in the translation. (Google Translate: Sites Stack Taxas de operar apenas em Inglês. Como tal, pedimos que todas as mensagens são em Inglês também. Se você precisa usar uma tradução automática que é geralmente bem - os outros usuários podem editar as suas mensagens para corrigir os erros na tradução.)
Comment: @eldarerathis I translated it to English (but still it isn't a very good question), can you reopen the question?
Comment: Adding an SD card is unlikely to affect the speed of a slow device; low memory messages are related to RAM, not storage.  More likely you have one or more apps running that is eating up CPU/RAM, as the Note 2 has excellent hardware specs and is unlikely to be "slow" except under exceptional circumstances.
Answer: The speed of your device relates to the RAM not ROM. RAM of NOTE2 is 2GB and RAM is not expandable.
RAM is the memory where all your foreground and background process resides. If RAM usage in your device is very high, uninstall or disable unnecessary applications. And install a Task Killer and schedule it in crazy mode at every half hour. It may increase the speed of your system.
You can manually clear your ram from task manager. Long press home button then tap on left most option which is task manager there select ram tab and tap on clear Memory.
Comment: I wouldn't recommend a task killer since most of them just screw up Android's memory management even further.
Comment: Additionally, clearing RAM and doing round-house-kicks with a task killer often slows down the device even further – as killed apps do auto-restart, and have to load all their data back to RAM. Result: More I/O, faster battery-drain – and no relief. Task-killers are for getting rid of *hanging/havocing* processes, not for "cleaning" RAM.


How do I have Java auto-update for both 32-bit and 64-bit?

Question: I have both Java 32-bit and Java 64-bit installed on my computer, and when automatic updates rolls around it asks me to save in Program Files (x86), but no equivalent for 64-bit Java comes up. How can I get 64-bit Java to update as well as 32-bit Java?
Comment: Its very likely the service that handles this only supports 32-bit support.  One way to check is to remove the 32-bit version and see if the automatic updates still happen.
Answer: From the What is Java Auto Update? How do I change notify settings? article:

Why is the Update tab missing from the Java Control Panel?
Java Auto Update is currently not available for 64-bit versions of Java. 64-bit versions of Java do not include the Update tab in the Java Control Panel.

Guess you'll have to do it manually. Given the sheer number of security issues with Java of late, not having auto-update support x64 is a real head-scratcher.
Comment: See [ticket #6492837](http://bugs.sun.com/view_bug.do?bug_id=6492837) from year 2006. I suppose everyone in Oracle Corporation is using Windows XP and Internet Explorer 6. (*Gosh*)
Comment: @ÁlvaroG.Vicario: 2006? Wow, and who knows whether that's even the first bug to deal with this. Sun/Oracle might as well just officially state that they're not interested in supporting 64-bit properly. I advise people nowadays to stay away from the Java plugin if possible, and even if it's installed most browsers restrict it by default anyway.


UE4 Blueprint Multiplayer Spawning Issue

Question: I'm attempting to copy/modify the MultiplayerShootout project's multiplayer functionality for my own project. I'm running into issues when Player 2 joins a running session though. Finding it very hard to debug multiplayer stuff because you have to run it in standalone and toggling breakpoints doesn't seem to be illustrating any issues.
Here's the issue:
https://youtu.be/270p4YS36Pw
The first player to search for a game hosts a game, then the OnPostLogin in the GameMode fires and calls the ClientPostLogin event in the PlayerController, then the PlayerController calls the RespawnPlayer event inside the GameMode which spawns and possesses the character. The second player finds a session and joins it, but the server is not spawning a character for them on the other PlayerStart.
The logic is very much similar to the MultiplayerShootout, but I have modified it in the following ways:
The 1v1 button searches for sessions, and if it can't find any it will automatically host a session.
The ClientPostLogin event on the PlayerController and the RespawnPlayer event on the GameMode accepts a Selected Character (Actor class) variable. This is so I can get the player to select their character before they matchmake and pass it through to the PlayerController and then GameMode for spawning purposes. Would really appreciate some help on this, been stuck on it for a while.
Here's some of the blueprint scripting to make sense of it:

OnPostLogin event in the GameMode

ClientPostLogin in the PlayerController

RespawnPlayer event in the GameMode

1v1 button released event in the PlayScreen Widget

HostGame event in the GameInstance

JoinGame event in the GameInstance
Edit: I'm using UEngine version 4.24.3
Comment: You don't need to write "FIXED" into the title of your question. When you solved your problem yourself, then just accept your answer and the question will appear as answered.
Answer: Moving the RespawnPlayerEvent into the PlayerController fixed this. I think it had to do with the inability for the second client who joins (who is not the server host) to call a function in the GameMode (which only exists on the server).

To sum it up:

The player selects a character and stores the actor class in a
variable inside the GameInstance (this is because the GameInstance
does not lose information upon traveling to different maps).
When a player joins/hosts a server the OnPostLogin event fires, passing the PlayerController and firing the ClientPostLogin event inside the PlayerController.
The PlayerController then gets the Selected Character variable from the GameInstance and passes it on to the RespawnPlayerEvent which is also inside the PlayerController.


1 blockchain for 1 only cryptocurrency?

Question: I do not know if this question was asked before ... I wanted to know if for each cryptocurrency you should have your own blockchain database if the answer is "yes" ... then how can you do trading between each currency?  As a transaction travels from one DB to another?
Answer: That's right, every currency has its own separate blockchain.
Trading one currency for another doesn't move currency between blockchains.  Rather, there is (in principle) one transaction on each blockchain.
As an example, suppose Alice has some BTC that she wants to trade for LTC.  She will have to look for a counterparty who has LTC and wants BTC.  Say she finds Bob.  She makes a transaction on the BTC blockchain sending her BTC to Bob, and Bob makes a transaction on the LTC blockchain sending his LTC to Alice.  The total amount of BTC and LTC in circulation stays the same.
In practice, this process might be mediated by an exchange, who can ensure that neither party cheats.  In this case, Alice sends her BTC to an exchange, who holds it temporarily, and Bob likewise sends his LTC to that exchange.  After everyone has agreed, the exchange sends LTC to Alice and BTC to Bob.  But again, BTC stays on the BTC blockchain, and LTC stays on the LTC blockchain.
It's just the same as a currency exchange desk at an airport.  If you have dollars that you want to exchange for euros, they don't magically convert one currency into the other.  Rather, you give them some of your dollars, and they give you some of the euros that they had in their drawer.  The total number of dollars hasn't changed, nor has the total number of euros; they've just changed hands.
Comment: Thank you very much, I think I understand why they delay both trading transactions on some platforms more than others.

1 blockchain for 1 only cryptocurrency?


Example of a finitely generated flat module which is not free

Question: I couldn't come up with an example of a finitely generated flat module which is not free. I know that over local rings, freeness and flatness are equivalent. So the ring cannot be a local ring.
Answer: Let $R$ be a semisimple ring which isn't a division ring, and take an idempotent $e\notin \{0,1\}$. Then we have that $R=eR\oplus(1-e)R$ is a nontrivial decomposition of $R$, and both pieces are cyclic and projective (since they are summands of $R$) hence flat.
Actually neither piece is a free module, but we'll argue here that at least one of them isn't free to simplify things. If they were both free, that would imply that $R\cong R^n$ for some $n>1$ as modules. (Each factor contributes at least one $R$, you see.) But since $R$ has the IBN property, this is impossible.
Thus at least one of the pieces is flat but not free.

If you really want to be concrete, you can use a finite semisimple ring to make things obvious: let's try $R=\Bbb F_2\times\Bbb F_2$. $\Bbb F_2$ is denoting the field of two elements.
The module $I=\Bbb F_2\times \{0\}$ is a direct summand of $R$, but it can't be free: a free module would have to have at least four elements, and this module only has two elements!
Answer: Here is an example that one can come up with from algebraic number theory. Consider $K = \Bbb{Q}(\sqrt{-6})$ and the ideal $I = (2,\sqrt{-6}) \subseteq \mathcal{O}_K$. This ideal is clearly finitely generated as an $\mathcal{O}_K$ module and furthermore not only is it flat but it is a projective module: we have
$$I \oplus ( 3,\sqrt{-6}) \cong (\sqrt{-6}) \oplus \mathcal{O}_K \cong \mathcal{O}_K \oplus \mathcal{O}_K.$$
If you're interested in knowing how we have such isomorphisms you can look at my answer here. But now $I$ cannot possibly be free because the generators are linearly dependent over $\mathcal{O}_K$:
$$3 \cdot (2) + \sqrt{-6} \cdot (\sqrt{-6}) = 0.$$
Comment: In fact, every fractional ideal of a Dedekind ring $R$ is a projective $R$-module, so in particular every ideal of a ring of integers in a number field is projective.
Comment: @NilsMatthes Yes that is certainly the case, IIRC due to invertibility of an ideal in the ring of integers of an algebraic number field.
Answer: Rings over which every module is flat are called absolutely flat, or Von Neumann regular. If $I$ is any nontrivial ideal of an absolutely flat ring, then $R/I$ is finitely generated flat over $R$, but not free (since $R/I \neq 0$ and $\mathrm{Ann}(R/I)=I \neq 0$). Products of fields are absolutely flat.


Digraph intermediate connectivity

Question: What's the name for a digraph such that for each pair of vertices $u,v$, there is either a path from $u$ to $v$ or a path from $v$ to $u$? I'd call it just connected, since this is an intermediate property between weak and strong connectivity, and is in fact equivalent to the existence of a path containing all vertices. However, I'm not an expert of the subject, and I was unable to find any reference about this, so far.
Answer: Just `connected' is fine. For example, Wikipedia and Tutte agree. However, since "the number of systems of terminology presently used in graph theory is equal, to a close approximation, to the number of graph theorists," (R.P. Stanley, 1986) you might want to include the definition anyway.
Comment: Thank you! I had not seen the definition on Wikipedia. It was added by an anonymous user on last Oct 13, apparently. I had asked the same question in the talk page, but nobody answered me there.
The reference from Tutte is completely satisfactory for me.
Answer: Another term that has been used is "unilateral" or "unilaterally connected".  I don't have a particularly strong opinion in favor of this terminology, but I am slightly opposed to just calling it "connected".  (I usually assume "connected" means "weakly connected" for digraphs.)  However, I must admit a reference by Tutte is good.
Some references for "unilateral":

Graph theory applications by L. R. Foulds
On minimal feedback vertex sets of a digraph by Frank Harary (I think Harary's graph theory book uses it also)
Answer: Such digraph is called traceable. For example, it is defined as such in the paper
http://www.ams.org/bull/1976-82-01/S0002-9904-1976-13955-9/S0002-9904-1976-13955-9.pdf
Comment: Thank you very much for your answer. It seems, however, that the definition of traceable graph in such paper requires the existence of a Hamiltonian path. This is not equivalent to what I am asking; I am not interested whether the path visits each vertex *exactly once*, as long as it does visit all of them. For example, the digraph $\{(a,b),(b,a),(a,c),(c,a),(a,d)\}$ is "connected" as I'm meaning, but it is not traceable as the shortest path visiting all vertices is $bacad$ (or $cabad$), thus visiting $a$ twice. The same graph is also not strongly connected, as no edge starts from $d$.
Answer: Such a graph is called a semiconnected graph. You can find references to it in Cormen and Diestel's book on graph theory http://diestel-graph-theory.com/
Comment: Thanks… but again, it doesn't quite seem to be the same thing. In Diestel's book I could only find a definition for semiconnectedness of submultigraphs of infinite graphs. It is not obvious to me how would this apply to digraphs in general.

Digraph intermediate connectivity


$2\times 2 $ matrices over $\mathbb{C}$ that satisfy $\mathrm A^3=\mathrm A$

Question:
Let $\mathrm A \in \mathbb C^{2 \times 2}$. How many $2 \times 2$ matrices $\mathrm A$ satisfy $\mathrm A^{3} = \mathrm A$. Infinitely many?

If it is $3 \times 3$ matrix then by applying Cayley-Hamilton theorem I could have said that given matrix is diagonalizable. Also zero is eigenvalue of $\mathrm A$. So it would be collection of all singular diagonalizable matrices. But how to count them?
Here I have $2 \times 2$ matrices i feel I can't apply the Cayley-Hamilton Theorem here?
I am stuck with these thoughts?
Comment: What about $$\begin{pmatrix}1-\frac{a^2}{a^2+b^2}&-\frac{a b}{a^2+b^2}\\-\frac{a b}{a^2+b^2}&1-\frac{b^2}{a^2+b^2}\end{pmatrix}$$ for $a,b$ real?
Comment: Or $$\begin{pmatrix}0 & 1/x\\ x & 0\end{pmatrix}$$
Comment: what should be condition on $x$? perhaps for any non zero real $x$?
Comment: @ j.m. and , ALEXAre they any special kind of matrices?
Comment: *Do* you know about the minimal polynomial?
Comment: yes sir i have studied about them
Answer: If $A^3=A$, then $A$ satisfies the polynomial $t^3-t = t(t^2-1)=t(t-1)(t+1)$.
Since you say you know about the minimal polynomial
The minimal polynomial divides every polynomial that the matrix satisfies, so the minimal polynomial divides $t(t-1)(t+1)$. In particular, since it is squarefree, $A$ must be diagonalizable.
If the matrix has a single eigenvalue, then it is a scalar multiple of the identity; the three possibilities are $0$, $I$, and $-I$.
If the matrix has distinct eigenvalues, then the eigenvalues are either $0$ and $1$, $0$ and $-1$, or $1$ and $-1$. In any of these cases, there are infinitely many distinct matrices that satisfy these conditions. For example, for eigenvalues $0$ and $1$, any projection onto a 1-dimensional subspace will do; there are infinitely many different projections onto, say, the subspace $\{(x,0)\mid x\in\mathbb{C}\}$, one for every possible complement. That already solves the problem.
If you don't remember about the minimal polynomial, you can note that any eigenvalue $\lambda$ must be a root of the polynomial $t^3-t$ (more generally, if $A$ satisfies $f(t)$, then every eigenvalue of $A$ must be a root of $f(t)$). That leads you to the fact that $A$ has eigenvalues $0$, $1$, and $-1$, and from there you can obtain infinitely many different matrices as noted above.
Comment: Sincere thanks to you sir
Answer: Any projection matrix satisfies $A^2=A$ and so $A^3=A$. You can get one projection matrix for each line through the origin and so there are infinitely many solutions. As Arturo has noticed, this already answers the question.
If you want to find all matrices $A$ such that $A^3=A$, you can proceed like this:
The Cayley-Hamilton theorem implies that $A^2 = \alpha A + \beta I$ for some scalars $ \alpha $ and $\beta$. Then, $A=A^3= \alpha A^2 + \beta A=\alpha (\alpha A + \beta I)+ \beta A=(\alpha^2+\beta)A+\alpha\beta I$ implies $(1-\alpha^2-\beta)A=\alpha\beta I$.
If $1-\alpha^2-\beta\ne0$, we get $A=\gamma I$. In this case, we must have $\gamma^3=\gamma$ and so there are only three solutions: $A=0$, $A=I$, $A=-I$.
If $1-\alpha^2-\beta=0$, then $\alpha\beta=0$, and the only solutions come from $A^2=I$ and $A^2=\pm A$. Now there are plenty of solutions for these. Even  $A^2=I$ has infinitely many solutions. See for instance Involutory matrix. Alex's comment contains an infinite subfamily.
All this is essentially Arturo's answer without using minimal polynomials or eigenvalues.
Comment: Heartily thanks i got my answer


Is it possible to store zip file in Google app engine blob store and download it In android application

Question: Hi I am new to use Google App Engine.My requirement is store Large Zip file in a Blob Store and retrieve to my android application when user click a download option It is possible?Can some one Give Tutorial link to how can effectively use android app engine blob store in android application.
Thank's in advance.
Answer: The short answer is: yes you can.
First of all you will have to complete the example on how to upload stuff using Google App Engine and then experimenting with the Google Cloud Storage because it will be much cheaper in the long run.
After completing that you will realise that in order to upload, all you'll have to do is to POST multipart data either from Android or using any other method you would like. In that tutorial is also very obvious on how you could download any file back to your Android application.
You could also experiment with one of my examples for uploading files either on Blobstore or on Cloud Storage. In that particular example you are allowed to upload only images and PDF documents, but it's very easy to modify and accepting only ZIP files or whatever else you might want.
Answer: Perhaps Google Cloud Storage would be more appropriate.
https://developers.google.com/appengine/docs/python/googlestorage/


How to customize ShareKit actionsheet?

Question: I am using ShareKit (www.getsharekit.com) to share my URL's to Twitter and Facebook. I want to be able to remove all of the additional social network it points to, but am not sure where to edit?
Answer: in SHK.m find this method
+ (NSArray *)favoriteSharersForType:(SHKShareType)type

and change
switch (type)
    {
        case SHKShareTypeURL:
            favoriteSharers = [NSArray arrayWithObjects:@"SHKTwitter",@"SHKFacebook",@"SHKReadItLater",nil];
            break;

        case SHKShareTypeImage:
            favoriteSharers = [NSArray arrayWithObjects:@"SHKTwitter",@"SHKFacebook",@"SHKReadItLater",nil];
            break;

        case SHKShareTypeText:
            favoriteSharers = [NSArray arrayWithObjects:@"SHKTwitter",@"SHKFacebook",@"SHKReadItLater",nil];
            break;

        case SHKShareTypeFile:
            favoriteSharers = [NSArray arrayWithObjects:@"SHKTwitter",@"SHKFacebook",@"SHKReadItLater",nil];
            break;

to the following for each instance of the switch statement:
favoriteSharers = [NSArray arrayWithObjects:@"SHKFacebook", nil];

or what ever other options you want to support (ie if you only want twitter and facebook add @"SHKTwitter", to the array)
that will eliminate the other options but the action sheet that displays the options wont reflect the change and it will still give the more option, which we also need to disable.
So to do that go to SHKActionSheet.m
in this method you can change the title from "Share" to something more specific (this part is optional) ie "Share with Facebook and Twitter"
+ (SHKActionSheet *)actionSheetForType:(SHKShareType)type

change
SHKActionSheet *as = [[SHKActionSheet alloc] initWithTitle:SHKLocalizedString(@"PUT YOUR NEW TITLE HERE")
                                                  delegate:self
                                         cancelButtonTitle:nil
                                    destructiveButtonTitle:nil
                                         otherButtonTitles:nil];
as.item = [[[SHKItem alloc] init] autorelease];
as.item.shareType = type;

than in that same method, delete this line
    // Add More button
[as addButtonWithTitle:SHKLocalizedString(@"More...")];

that will remove the more button but now the code will now confuse the more button with the cancel button, so to fix that, go to this method:
- (void)dismissWithClickedButtonIndex:(NSInteger)buttonIndex animated:(BOOL)animated

and delete the following else if statement
// More
else if (buttonIndex == sharers.count)
{
    SHKShareMenu *shareMenu = [[SHKCustomShareMenu alloc] initWithStyle:UITableViewStyleGrouped];
    shareMenu.item = item;
    [[SHK currentHelper] showViewController:shareMenu];
    [shareMenu release];
}

what this method is susposted to do is take the button that is normally the more button and open the more options.  So by deleting it the code has no associated action with the cancel button so it just closes and release the action sheet, effectively creating a cancel button
Comment: Wish I could give you 10 upvotes for such a thorough explanation. This is exactly what I needed - thanks!
Comment: What a great answer. Best thing I've seen on SO in a while... and by someone with low rep like me!
Answer: From ShareKit/Core/SHK.m:
[SHK setFavorites: (NSArray *)favs forType:(SHKShareType)type]

+ (void)setFavorites:(NSArray *)favs forType:(SHKShareType)type
{
    [[NSUserDefaults standardUserDefaults] setObject:favs forKey:[NSString stringWithFormat:@"%@%i", SHK_FAVS_PREFIX_KEY, type]];
}

favs is like :
[NSArray arrayWithObjects:@"SHKTwitter",@"SHKFacebook",@"SHKReadItLater",nil]

type is SHKShareType:
typedef enum
{
    SHKShareTypeUndefined,
    SHKShareTypeURL,
    SHKShareTypeText,
    SHKShareTypeImage,
    SHKShareTypeFile
} SHKShareType;

Answer: The new way to do this with latest version of ShareKit 2.0 is to overwrite the following methods in your SHKConfigurator (extending DefaultSHKConfigurator.m)
// SHKActionSheet settings
- (NSNumber*)showActionSheetMoreButton {
    return [NSNumber numberWithBool:true];// Setting this to true will show More... button in SHKActionSheet, setting to false will leave the button out.
}

/*
 Favorite Sharers
 ----------------
 These values are used to define the default favorite sharers appearing on ShareKit's action sheet.
 */
- (NSArray*)defaultFavoriteURLSharers {
    return [NSArray arrayWithObjects:@"SHKTwitter",@"SHKFacebook", @"SHKReadItLater", nil];
}
- (NSArray*)defaultFavoriteImageSharers {
    return [NSArray arrayWithObjects:@"SHKMail",@"SHKFacebook", @"SHKCopy", nil];
}
- (NSArray*)defaultFavoriteTextSharers {
    return [NSArray arrayWithObjects:@"SHKMail",@"SHKTwitter",@"SHKFacebook", nil];
}

Answer: See: http://github.com/ideashower/ShareKit/issues/closed#issue/30
Answer: See my answer on the other thread with more thorough explanation.
It is now easily configurable without changing ShareKit's code, if you use ShareKit 2.0
Basically, if you use only Facebook and Twitter, it is easier not to mess with ShareKit's code. You can easily
create your own UIActionSheet with two buttons, and call ShareKit's convenience share methods.
Comment: wonder why down vote? With "mess with ShareKit's code" I mean to customize ShareKit's code in your app (hiding More button), when it is not necessary. This will earn you additional work, if you want to upgrade to newer version of ShareKit. You can achieve the same using ShareKit's sharers convenience methods directly with classic standard UIActionSheet.
Answer: For the unwanted services not to appear on the action sheet you can simply remove the respective sharer services classes from the project.
Go to project--> Sharers --> Services --> select the .h and .m files of the respective service and delete it.
For example Facebook option can be removed by deleting SHKFacebook.h and SHKFacebook.m.
Note: You will have to check the class import to avoid errors.
Answer: Easiest way is to edit "SHKSharers.plist" and keep the services you need.

How to customize ShareKit actionsheet?


Why is Ravan considered a Rakshasa?

Question: Ravana's father was a Brahmin while his mother a Rakshasi. Then why is he considered a Rakshasa, Rather than a Brahmin.  Is it because of his actions?
Comment: Ravana is considered both a Brahmana and a Rakshasa.  That's why Rama performed an Ashwamedha Yagna, to get rid of the sin of killing a Brahmana.
Answer: In the famous dialogue between Yama (in form of Yaksha) and King Yudhishthira  there is mention about the eligibility to be a a brahmin.
The verse goes as follows(Question no-31):
The Yaksha asked,—"By what, O king, birth, behaviour, study, or learning both
a person become a Brahmana? Tell us with certitude!"
Yudhishthira answered,-"Listen, O Yaksha! It is neither birth, nor study, nor learning, that is the cause of
Brahmanahood, without doubt, it is behaviour that constitutes it. One's behaviour
should always be well-guarded, especially by a Brahmana. He who maintains his
conduct unimpaired, is never impaired himself. Professors and pupils, in fact, all who study the scriptures, if addicted to wicked habits, are to be regarded as illiterate wretches. He only is learned who performes his religious duties. Even if he has studied the four Vedas is to be regarded as a wicked wretch scarcely distinguishable from a Sudra if his conduct be not correct. He only who performes the Agnihotra and has his senses under control, is called a Brahmana!"
Thus it is quiet evident that caste is just a function of a character.  Incase of Ravana he failed to keep his sense under control and never behaved like a Brahmana.Thus Ravana doesn't inhert the caste of his father.
Comment: Nice perspective
Answer:
Because Vishrava (Ravana's father) cursed Kaikashi (Ravana's mother):

O thou having the gait of a mad elephant, there reigns a powerful desire in thee for having ofspring. Inasmuch as thou hast come to me at this fierce hour, hearken, thou amiable one, as to the kind of ofspring that thou shalt bring forth. Thou shalt, O thou of graceful hips, bring forth terrible and grim visaged Rakshasas delighting in frightful friends, and of cruel deeds.
Hearing his speech, she, bowing down, said, O reverend (ascetic), such
sons of terrific ways seek I not from thee that followest the Veda.
Therefore it behoveth thee to favor me. On being thus besought by the
girl, Visrava, best of ascetics, again addressed Kaikasi, like the
full Moon addressing Rohini, O fair faced one, the son that thou
bringest forth last, shall be like unto my line, he shall, without
doubt be righteous souled.
Having been thus accosted, the girl, O Rama, after a length of time
brought forth a very terrible and hideous ofspring having the form of
a Raksha (Rakshasa).

His mother was from Rakshasas (his mother Kaikashi was daughter of Rakshasa Sumali)

He joined his maternal grandfathers/uncles who were from Rakshasas and became king of Rakshasas (this is discussed here).

A Brahmana is not Brahmana by birth alone. He, it is said by the wise, in whom are seen those virtues is a Brahmana. And people term him otherwise in whom those qualities do not exist, even though he be a Brahmana by birth. (Source: Vana Parva: Tirtha-yatra Parva of Mahabharata)
Answer: A Pishacha (wicked ghostly cannibal) named Aj had a daughter named Jantudhanaa. She married Rakshasa (cannibalistic younger son of Kashyapa and Khashaa) and had a daughter named Yatudhana. In turn, Yatudhana gave birth to Heti, Praheti and 8 others [Ref: Brahmanda Purana Upodghaata paada 7.43-90]. All her descendants are called Yatudhana-Rakshasas.
Heti's descendants were Malyavan, Sumali and Mali. Kaikasi (daughter of Yatudhana-Rakshasa Sumali) married Vishrava (son of the pious Rishi Pulastya). Their children were Ravana, Kumbhakarana, Surphanka and Vibhishana [Ref: Ramayana 7.4-5, 7.9]. They and their descendants were the Kaikasi-Rakshasas or simply Rakshasas.
Thus, Ravana was a son of a Brahmin father and a Yatudhana-Rakshasa (hybrid descendant of a Pishacha and a Rakshasa) mother.
Source: 'Essence of the Fifth Veda' by Gaurang Damani page 14.
His lineage partially explains his adharmic acts as listed in my other answer on his Rakshasi actions.

Why is Ravan considered a Rakshasa?


What does a "constructive/non constructive question" mean?

Question: I have read it a lot under many questions in EL&U and even ELL. It is one of most ambiguous terms which I have read here. Please discuss about it to make it clear for all users as well for mods to not misuse it under any questions. Is there anything about in FAQ to explain it definitely?
Comment: @Stoney Thank a lot for your nice edit. what a strange mistake I had made because of my carelessness! :')
Answer: Throughout the SE system a constructive question is one which demands clear, unambiguous, evidentially supportable answers as opposed to varying and mostly personal opinions. Here is what the FAQ says:

not constructive
  As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or specific expertise, but this question will likely solicit debate, arguments, polling, or extended discussion.

For instance, "Which is better, American spelling or British spelling?" is Not Constructive—if people could agree the question would never even arise. But "Will this sentence in American spelling be misunderstood by British readers?" is Constructive—if any misunderstanding is in fact possible, posters will tell you exactly where the misunderstanding arises, and will probably also suggest workarounds to avoid misunderstanding.
Comment: @user37324  Those closevote terms are out of our hands; they obtain across the entire StackExchange network. You must address them at [meta.SO](http://meta.stackoverflow.com/). Keep in mind, too, that Closing is reversible; the point of Closing is not to kill the question but to provide the OP an opportunity to fix it.
Comment: @user37324 Only a moderator can suspend. The point of suspension is to let folks cool off and consider *Have I maybe taken the wrong approach here? Have I misunderstood the 'rules of the road'?* It's what we call a 'time out'. Sure there's potential for abuse; there is in any system. But moderators are elected by the community and accountable to the community. The mods over at ELU are very highly respected precisely because they are seen to be fair and temperate.
Comment: It seems reasonable. So what about suggesting it about any question of non English speakers through editing process not in an aggressive or sarcastic form as a comment?
Comment: If I understand what you are asking, I'd say that it is  difficult for a writer of one language to predict how what he or she writes might be misunderstood by a reader who does not perfectly command that language; and it is equally difficult for the reader who does not command the language to judge what tone the writer intends to convey. My advice to both is that of Proverbs: "A soft answer turns away anger."
Comment: Anger is a case but more important thing is being reasonable and honest. I think through suggesting an edit an editor/user/mod can kindly/nicely suggest people to correct themselves and learn not like an idiot buzzer tries vulgar language or worse offensive reactions without any acceptable reason. Personally I cannot understand how it can make arrogance for a person who have almost good understanding of a language because of knowing by birth or living or working in English unless he/she is a problematic person without "appropriate etiquette" which has been mentioned in the FAQ.
Comment: So how a suspended person who has been target of such an offensive language/behavior can protest against it? do not you think there is a need to rework on some rules of FAQ and make them more clear and change some of them in order to make the space more democratic and far from of hands of "personal idea" owners and aggressive reactions which makes offense and seems ugly as a look from outside?
Comment: What is the point of suspending? Why having 3 closed topics can cause suspending a user? so do not you think it can make a good space for misuse or a grouping attack against a user?
Comment: And how many votes can close a topic and by who?
Comment: What about making cool down a mod? Who can decide creating 3 posts which there is not an agreement between many people to close it or not can considered as misunderstanding some rules which are very ambiguous and vague and every one can find his/her own mean through it which can be very different with the others ideas about it ?
Comment: But "democracy" doesn't mean only an election to give all right of wrong decisions to 3 or 4 people who like the other people can be under many personal emotions against some of users. I disagree with you and found them against this claim. Please make another election to change rules and FAQ and surely moderators but all users with any reputation can join it to find the result!
Comment: And If you find it reasonable to suspend people because of their closed questions according to ideas of 1 or 4 people why do you avoid of adding this rule to the FAQ by clear sentences like this: After having 3 closed questions you will be suspended!
Comment: If this kind of reaction and decision making according to some ambiguous rules which guarantee power of 3 or 4 people to decide about 23000 questions, mean fair and is respectful I have nothing to add! :)
Comment: @user37324: RE: _"But "democracy" doesn't mean only an election to..."_ Where did you read that StackExchange was a "democracy"?
Answer: 1) If a question doesn't seem like a good fit for this site, people can vote to close. When they do, they are shown a screen that looks like this:

We can pick apart the meanings of "not constructive" and "too localized" all we want, but, in the end, they both simply mean: "out of all the reasons I could have voted to close this question, this is the reason that seems to fit best."
2) When a question is closed, that simply means no more answers will be accepted. You don't lose rep points for having a question closed. The answers don't go away. People can still read the question, and leave comments. The question can still be upvoted and downvoted. It's not a punishment, it's a mechanism to help visitors and regular members direct their valuable time and energies toward better questions.  Remember, answers take time to compose, and most regulars on the Stack Exchange have a very finite amount of free time.
3) When a question is closed, it can be improved, and it can be reopened. In fact, some closed questions do get reopened. Sometimes a question gets judged too quickly, when those who voted to closed failed to see some deeper nuances. However, more often than not questions get reopened after they have been improved.
4) Most closed questions fail to provide enough context. If my question was closed, I would invest my energy into improving it, rather than arguing with people about it. (I certainly wouldn't make wholesale insults to the community at large; that's not likely to garner much support.)
5) I've seen very few closed questions that couldn't stand a little improvement: tell us where you found the phrase, show us what research you already did, explain a little more about why you are confused. Make it less vague and more pertinent. Ask for help, and listen to the advice you're given.
6) I don't necessarily agree with all close votes, and I've even actively campaigned to get some questions reopened. But I also understand this is a community, that we all have our own opinions – and I respect that. That's why it takes five votes to close a question, and that's why five more votes can override those votes, and reopen the question.
7) Yes, moderators can close questions unilaterally, but don't complain about that. Moderators are respected, trusted members of the community, and they have a right to exercise their best judgment. It's also worth noting that even a moderator's closure can be overridden by five members of the community, so, please, no railing about perceived injustices.


Why do people down vote?

Question: I don't understand why people give down vote to a question even though it may not be stupid. Some don't even specify the reason for down vote. Are they doing this intentionally to reduces other's reputation? Stack Overflow should provide a facility that we can see who gave us a down vote.
Comment: -1 for not using question mark.
Comment: -1 for not using capital letters properly
Comment: @MohiniMhetre: You have no idea how many times this same discussion has been brought up.
Comment: @MohiniMhetre *why you people waste your time by checking all these things?* that is the way the community is here on SO. Accept it, live it and get great help. If you don't like it, you are free to look for another community that better fits your style.
Comment: I don't think that is important...I think that should not make difference...If I write my query in small letter or capital meaning of word would be same...
Comment: Concrete example is better than saying "not stupid question", since even good question that is not stupid, but seems off-topic (or other reasons that are already stated on tour/help) is **not** good for the site.
Comment: @Jamal why you people waste your time by checking all these things?
Comment: If you have a specific question in mind, please share the link so we can verify if the question is appropriate for the site.
Comment: @Azik: But he did use the question mark: "are they do this intentionally to reduces others no. of reputation?"
Comment: "Stack Overflow should provide a facility that we can see who gave us a down vote" - that would be a one way ticket to retaliation war. It's good to keep things as cold and focused as possible.
Comment: @MohiniMhetre, more down votes to your SO posts after this question posted. Don't worry about reputations which can be earned easily. But take serious about down votes by improving your questions to get needed answers. StackOverflow is the best site for me to get and give programming help.
Comment: A useful resource for you may be [John Skeets: Writing the perfect question](http://tinyurl.com/so-hints).
Answer: The use of this site is free. But you need to follow the rules. And it is your task to make the question as clear as possible.
I checked your question, and I agree it is not perfectly clear. But if you reply a downvote with a rude comment, don't be surprised if you won't get any answer at all.
Answer: A guideline is given in the tooltip of the downvote button:

I higlighted the reason I would downvote your question for. And I don't need to give a reason, everyone is free to vote as he likes to.
except unfair serial downvoting
Comment: +1 for line-breaking freehand circle
Comment: i have gone through all previous post but i didn't get answer..i don't know how solve this problem...I am here to ask for your help but if you give me only down vote then how would I get what is my mistake?
Comment: @MohiniMhetre, [Voting is different here on meta.](http://meta.stackoverflow.com/help/whats-meta)
Comment: @MohiniMhetre Right now the site is helping you to work on your shaky technical writing and communication skills. These are valuable life skills, so you should take advantage of the help.
Answer: The privilege to vote is a valuable privilege we have on Stack, and in most societies.  It allows us all to decide the value of a comment or a question.
There are several reasons why you may have gotten a down-vote.  Generally if it is egregiously sloppy, no-effort-expended post, or an answer that is clearly and perhaps dangerously incorrect.
You can post a comment to your question asking the down-voter to give you feedback as to why they down-voted you.  Personally i try to always leave a comment stating why i down-voted someone in-order to help them improve there posting in the future.
By the way this question will probably be closed soon as a duplicate. You didn't bother to check that there are probably 5 other questions already on meta stack that answer it.  That's why i down-voted your question here.

Why do people down vote?


Tax price issue

Question: How do I show 20% tax at checkout page with product original price? Means we not adding extra 20% to the product price but we should show 20% including tax
Comment: what have you tried? this should be a config setting
Answer: If I understand you correctly, this should solve your problem:
Navigate to Admin > Settings > Configuration > Sales > Tax and in the tab "Calculation Settings" set "Catalog Prices" prices to "Include Tax".

This sets whether catalog prices entered from Magento Admin include tax.

Also, in the same configuration section (Admin > Settings > Configuration > Sales > Tax), you will find the display setting, so you can adjust that to fit your needs.

Tax price issue


Can anyone help me identify this Coat of Arms?

Question: Can anyone help me identify this coat of arms?
As far as I can identify, there are 2 Lion Rampant regardant.
A Pelican in her nest, a crown, a shield with stars.
It is on a small galleried tray that I purchased in France.
There are no markings on the back.
Comment: Looks like a Star of David in the center with 2 joined Stars of David encompassing it. Maybe a Jewish family?
Comment: Horizontal hatching is usually azure/blue
Answer: My answer uses heraldic terminology in the English language.
Technically only the shield and the design on it is a coat of arms.
The other things with the shield are various heraldic accessories.   The shield andy any herladic accessories with it make up an achievement of arms or a heraldic achievement.
The ribbon like shape below the shield is a scroll, and a motto would usually be put on a scroll.
The two lions on teh sides of the sield are called supportrs because they hold onto the shield and support it.
The pelican in its nest is usally called "a pelican in her piety", wounding herself so that her hatchlings can feed on the blood. Being on top of the coronet or helmet makes the pelican a crest.
Identifying the type of coronet used could identify the rank claimed for the user of the coat of arms.
https://en.wikipedia.org/wiki/Crown_(heraldry)[1]
If the coat of arms can be described in heraldic language, or blazoned, someone could search for a coat of arms matching that blazon.
As Henry said, the horizontal lines in the shield are an example of hatching, using lines to indicate the colors in a coat of arms when it is depicted in black and white. Horizontal lines indicate the heraldic color azure (blue) in the main system of heraldic hatching, but have been used to represent gules (red) in some other less used systems.
https://en.wikipedia.org/wiki/Hatching_(heraldry)[2]
In the English language the color of the field of the coat of arms is mentioned first, and the charge onthe coat of arms is mentioned second.
So the blazon would be "Azure, a ________".
According to the rule of tincture inh eraldry, a charge should be one of the "metals" - Or (gold/yellow) or Argent (silver/white) - if it is placed on a field of one of the heraldic colors - red, green, blue, purple, or black.
Since the field is very probably blue, the charge should be either white or yellow.
So the coat of arms would be blazoned in Eanglish as "Azure, a ______ Argent" or "Azure, a ______ Or."
And if you can add a better picture of the charge on the coat of arms, maybe someone can didentify it and make a full blazon of the coat of arms in English or some other language and search online for it.
Comment: I'm going to toss in a couple of my observations. First, a source for translation [Illustrated atlas of French and English heraldic terms](https://commons.wikimedia.org/wiki/Illustrated_atlas_of_French_and_English_heraldic_terms). Second, the shield seems to have a border in [Or](https://en.wikipedia.org/wiki/Tincture_(heraldry)). Comments mention Star of David, but virtually all French stars(mullets) are displayed as six sided. On the same line of thought, the pelican in her piety is often given strong *Christian* [connections](https://en.wikipedia.org/wiki/Pelican#Christianity).
Comment: Another item of interest is that the  coronet is displayed with three mullets, pierced. This might be fairly unique, and a point to research.


Do I need to close MongoDB client?

Question: I'm working on a discord bot, but I'm not sure if I need to close the MongoClient with:
client.close()

The issue I have is that I'm returning some data from a collection, and obviously, I can't close the client after I return something.
If I need to close the client, what's the best way of doing it? At the moment, I have a discord command that returns something.
def get_queue_info(queue):
if queue.isdigit():
    queue = int(queue)
    return db['Groups'].find_one({"order":queue})
else:
    return db['Groups'].find_one({"name":str(queue).upper()})

#obviously, this won't work
#mongo.close()

My bot is executing commands pretty slowly, but I'm not sure if it's because of not closing
Answer: If you really want to manually close, here are a couple options:

Call mongo.close() after you call get_queue_info(queue).
Instead of just returning the data, save it to a var then close the connection and return the var.

EDIT:
upon looking it up, you don't need to manually close it.
You should take advantage of connection pooling, just create one MongoClient that lasts for the entire life of your process.
I think the reason your bot is executing commands pretty slowly is because MongoDB is taking so much CPU (review your schema or index design)
Answer: You don't need to close the connection. Pymongo manages the connection so there is no need to tidy it up.
Answer: Thanks everyone. I guess I don't need to close the connection!
Comment: please kindly accept an answer so this question can be closed.

Do I need to close MongoDB client?


Python matplotlib repository ubuntu 10.10

Question: Dear matplotlib-user and developer,
I just wanted to use the latest version from the subversion-repository which I obtained from
svn co https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/trunk/matplotlib/lib/matplotlib/
Then I tried to load it from python and I obtained the error:
<code>>>> import matplotlib
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "matplotlib/__init__.py", line 104
SyntaxError: Non-ASCII character '\xd0' in file matplotlib/__init__.py on line 104, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details
</code>
The reason is pretty clear since my subversion installation runs on a machine which has russian as its default language. The subversion command does the following replacement:
<code>__version__  = '1.1.0svn'
__revision__ = '$Revision: 8900 $'
__date__     = '$Date: 2011-01-06 20:55:16 +0100 (Чт., 06 янв. 2011) $'
</code>
Does anybody know how I can configure (i)python to work out of the box?
Thank you in advance, all the best!
Answer: matplotlib no longer uses these svn keywords (it doesn't even use svn anymore) so should no longer be an issue.


Remove broken EXT4 inode without debugfs

Question: I have broken filesystem inside qnap. When I'm trying to fsck, it going into endless loop on one inode. Unfortunately qnap haven't debugfs command. Is this possible to remove (clear) inode via dd?
Comment: First I'd like to say sorry cause this may not be thought as an answer. But I don't know how to contact the author, so I can just post here. Zulus, can you try to contact qnap support? Or you can just contact me through firstname.lastname@example.com. According to the NAS model you used, we will provide the correct debugfs to you. Thanks.
Comment: I sent You email and created ticket: JWZ-569-66890. Thank You.
Answer: It's possible but it's highly dangerous.  If you screw it up, you could end up doing more damage.   The trick is calculating the offset to the particular inode, given the output of dumpe2fs.  Once you calculate the offset it's just:
dd if=/dev/zero of=/dev/BLOCKDEVICE seek=OFFSET bs=1 count=INODESIZE

See the source code of debugfs for the function do_imap:
The starting location of the inode table (which is what ext2fs_inode_table_loc() returns) can be found by the output of dumpe2fs, as is the inode size.   Once you find the block number and offset, you can use calculate the OFFSET used in the dd command above via:
OFFSET = (block * BLOCKSIZE) + offset

where block and offset is the values as calculated by do_imap.
You may want to practice seeing if you can properly replicate the calculation of do_imap by hand by practicing using dumpe2fs and then cross-checking with debugfs's imap command on your Linux system (assuming you can run Linux).
All of this being said, it might be useful to try compiling e2fsprogs from scratch for qnap, and then using debugfs built for qnap.
Comment: I just reached out to a qnap developer who had recently corresponded to me on the linux-ext4 mailing list.   I pointed him at this question, and asked him if he could send a pointer to a copy of debugfs compiled for qnap.   So you might want to hang on and wait for a bit and see if Kevin chimes in with something that might be safer and easier.


Stop people from viewing contents of a directory

Question: I want to stop people from viewing the contents of my images directory. I've built an app using Codeigniter and notice that they just have index.html pages with a 403 Forbidden message in all directories - is this a secure method to use?  Is an index.html page in the directory sufficient or do I need to update config or .htaccess?
Answer: The .htaccess solution should work if you're comfortable using it.
Options -Indexes
If you are on a shared host with cPanel, you can change your settings in Index Manager
Cpanel - Index Manager
Answer: The index.html should be enough and secure, but it is not really a clean solution, because it is not actually returning a error message, it is probably still returning HTTP 200 and then showing the html page with error 403.
The clean solution would be adding
Options -Indexes

to the .htaccess file.
Answer: In general you need more than just an index.html, depending on you server configuration you can still get a directory listing.  None of the files in the directory will be protected either.
Your best bet is to do al of the above, update the server config to limit access and also set policy via .htaccess if that is appropriate.  Finally, if you don't want it to be served it really should not be part of the directory structure being published by the server.


probability of rolling at least $n$ on $k$ 6-sided dice

Question: Is there a simple form for the probability of rolling at least $n$ on $k$ 6-sided dice?  Of course you can do it by recursion (see here).  But is there a way to do it with just a few binomial coefficients, without the recursion?
Comment: If you're willing to sacrifice accuracy, you can use the normal approximation, if $k$ is large. There isn't much alternative apart form doing the calculation.
Answer: What you want to know is here.
The formula for a homogeneous and fair dice from 1 to D values is this
$$P(S,n,D)=\frac{1}{D^n}\sum_{k=0}^{\lfloor(S-n)/D\rfloor}(-1)^k\binom{n}{k}\binom{S-Dk-1}{n-1}$$
where S is the sum that you want, n is the number of dice you roll and D is the number of sides of the dice (D6, D8, etc.)
To know the sum of at least S just need to sum what you want over S.

A better way: in the book of generatingfunctionology there is an exercise in the chapter one asking just this but the answer is nicer.
We set $P(x):=\sum_{k=1}^{m}\frac1m x^k=x(1-x^m)/m(1-x)$, then $P$ is the generating function of the probabilities of a fair dice of $m$ sides and $[x^\ell]P(x)^n/(1-x)$ is the probability to get at lest a sum of $\ell$ throwing $n$ times the dice. The closed form is
$$
\begin{align}[x^\ell]P(x)^n/(1-x)&=m^{-n}[x^\ell]x^n(1-x^m)^n(1-x)^{-n-1}\\
&=m^{-n}[x^\ell]\sum_{j,k\ge 0}\binom{n}{k}\binom{-n-1}{j}(-1)^{k+j}x^{km+j+n}\\
&=m^{-n}[x^\ell]\sum_{j,k\ge 0}\binom{n}{k}\binom{n+j}{j}(-1)^kx^{km+j+n},\quad km+j+n=\ell\\
&=m^{-n}\sum_{k\ge 0}\binom{n}{k}\binom{\ell-km}{n}(-1)^k\end{align}
$$


"Volume" vs. "issue" for a new journal

Question: Our school is publishing an academic journal soon. It will be printed annually.  How do we label it – should we use the term volume or issue?  What is the difference?
Comment: As a side note: Before you go through the trouble of actually printing a journal, you should ask yourself whether anybody cares about printed journals in your field anymore.
Comment: @CapeCode Wrzlprmft What's with the rush to judgement? The pros and cons of starting a new journal are not part of the question.
Comment: Aren't there enough journals in your field already?
Comment: @Wrzlprmft I'm guessing it's a school-internal journal, rather than one intended for broad dissemination. For example, I know of several universities which have "undergraduate research" journals, where undergrads can get experience publishing articles for their undergraduate research projects, without having to compete for space and against the expectations for "standard" journals. -- M.N.M Manzano, you may wish to clarify this point in your question.
Comment: @user2390246: I am not arguing against starting a new journal, but only against starting a new printed journal.
Comment: Thanks for the comments. Yes, it is a school based journal, and one based in the Philippines.
Answer: Normally journals come in volumes, which may then be divided into issues, so volume 12 might cover all papers for a calendar year but actually be published quarterly as four separate issues: 12(1), 12(2), 12(3), 12(4). Some journals just publish volumes without subdividing, and if you're only printing annually I think it makes sense to do that.

“Volume” vs. “issue” for a new journal


Uncertainty of conditional probability evaluated from sample

Question: I'm doing some some analysis of an arbitrary string of text, modelling it as a Markov chain where the state is simply the value of the previous character. Call the current character $c$ and the previous character $p$; then it is trivial to calculate $P(c\ |\ p)$ for the given sample text. However, if there are not many cases of a certain $(p, c)$ pair, or in general not many samples used. I know qualitatively that the fewer the samples, the higher the uncertainty/error in this conditional probability is. However, how can I quantify this?
Answer: You can  use the Hoeffding inequality:
$$ P(|\hat{p}_n-p|\geq t)\leq 2e^{-2nt^2}$$
($\hat{p}_n$ is your estimated probability).
For small $n$, Markov ineqality may be more efficient:
$$P(|\hat{p}_n-p|\geq t)\leq \frac{p(1-p)}{nt^2} $$.
For example, with the second inequality, if $n=50$ the probability that the difference between your estimated probability and the truth is greater than $0.25$ is lower than $\frac{1}{4*50*0.25^2}=0.08$ ($p(1-p)<1/4$ but it can be much smaller...). Is 8% chance to have difference larger than $0.25$ small enough for you ?
Comment: @Noldorin answer updated
Comment: Thanks for the response. Could you elaborate any more on what these equations actually say? They may well be useful, but I've sort of got to convince myself. :)
Comment: Thanks for that. Probabilities of probabilities - that may take a little while for me to get my head around! Final question: is the second equation effectively a simplified version of the first (which is always better)?
Comment: @Noldorin the first is not always better (take $p=0$).
Answer: To me, it sounds more like you want a conditional frequency, as a conditional probability has no "error" so to speak.  The only error from a probability is from either from a mathematical approximation, or a mathematical error in the calculation.  Once you make this conceptual distinction, I think finding the exact measure of error is easy.  @robin's answer is a very conservative number - and represents the worst case error.
Anyways, I assume that your data is a $K\times K$ frequency table.  The first way (row) is the letter previous $p_j\;(j=1,..,K)$, and the second way is the current letter $c_i\;(i=1,..,K)$ (column).  Let the counts in each cell be denoted by $n_{ij}$.  So $n_{11}$ is the number of times the character $p_1$ preceded the character $c_1$.  Expressing your problem this way also allows a straight-forward generalisation to a more general model - just add extra ways into the frequency table to give your process more "memory" (although the notation becomes a bit cumbersome, for you have quantities such as $f_{i|(j_1,j_2,...,j_L)}$ for a Lth order auto-regressive process).
Now we need to write down the model.  Because you have a markov model, this means that the frequencies are given by $0\leq f_{i|j}\leq 1$.  This means that the frequency is a function of $p_j$ (i.e. we are modeling each row of the frequency table separately).  They are constrained to sum to 1 over the rows $\sum_{i=1}^{K}f_{i|j}=1\;(j=1,\dots,K)$
The simplest model is to assume that each frequency is unconnected with any other.  In this case you have a N-dimensional multinomial distribution for each row
$$p(n_{1j},n_{2j},\dots,n_{Kj}|f_{1|j},f_{2|j},\dots,f_{K|j},I)\propto
f_{1|j}^{n_{1j}},f_{2|j}^{n_{2j}},\dots,f_{K|j}^{n_{Kj}}
$$
Now you need a prior distribution for the $f_{i|j}$ values, which expresses what you know about them, prior to seeing the data.  If you know that each letter is possible prior to seeing the data, then the uniform prior is the appropriate one.  This is the one I will use.  This gives a dirichlet posterior distribution for the $f_{i|j}$ (same form as above, because of the uniform prior).  This has a mode (most likely value) where $f_{i|j}=n_{ij}$ as you would expect.  Now, this means that each of the marginal posterior distributions have a Beta distribution
$$(f_{i|j}|D,I)\sim Beta(n_{ij}+1,\sum_{m\neq i}n_{mj}+K-1)$$
With a simple form for its mean and variance:
$$E(f_{i|j}|D,I)=\frac{n_{ij}+1}{\sum_{m}n_{mj}+K}$$
$$Var(f_{i|j}|D,I)=\frac{E(f_{i|j}|D)\left[1-E(f_{i|j}|D)\right]}{\sum_{m}n_{mj}+K+1}$$
Also, you can use the dirichlet distribution to get the correlation between two of the frequencies:
$$Corr(f_{i|j},f_{l|j}|D)=-\sqrt{\frac{E(f_{i|j}|D)}
{1-E(f_{i|j}|D)}
\frac{E(f_{l|j}|D)}
{1-E(f_{l|j}|D)}
}$$
I think this approach gives you a far better idea of the accuracy in your data, which shows the value in making a distinction between probability and frequency.  probability can never be observed, only calculated or assigned.  and frequencies can never be calculated or assigned, it can only be observed and predicted.
Comment: A good reference for this answer is MacKay & Peto's article, https://doi.org/10.1017/S1351324900000218
(available also here https://pdfs.semanticscholar.org/01fa/57bd91f731522c861404d29e4604ba6ac6d3.pdf ).


How can an OBJ sequence be converted to an FBX animation?

Question: for a school project, I am trying to import a series of obj models scanned from a Kinnect and import them into blender as sequence of stills, and then after making changes, export them as an FBX to be used in Unity. I have tried using this stop motion addon to import the OBJs as a sequence, but when selecting .fbx when exporting, only a single frame (the first) is ever exported. Is there anything I am able to do to export as an animation?
Comment: Obj doesn't support animations, so every frame has a different object. If you can make a shape key from every object then transform them on one object then you can export it to fbx.
Comment: Sounds like you're looking for temporal consistency for 3D scanned objects. Blender won't be able to generate a single mesh that deforms according to the per frame meshes
Answer: If you can guarantee the same number of vertices will appear in the same order in each .obj file (such as a single character model exported to individual frames), you could accomplish this by interpreting the vertex movements mesh transformations on import. Otherwise, you're stuck with entirely separate objects on each frame.
I don't know of any off-the-shelf versions of this, though the stop-motion script you mention in your question could be modified to work this way (in particular, the bakeSequence() function which creates a separate mesh object per-frame).
Comment: Unity is apparently unable to properly import .FBX files with Constant interpolation and/or visibility keyframes. They always come in with Linear interpolation. Because of this, you get weird artifacts in Unity, even if you bake the sequence. As soon as they support Constant interpolation, I have an idea for modifying the `bakeSequence()` function to work nicely with .FBX
Answer: You could use Dem Bones, an open source tool by EA. It creates bones-based animations from multiple frames.
I don't know the process of using it, but it was recently covered in a GameFromScratch video: https://youtu.be/rY7s_2HNw8I


Ubuntu login loop reappears after every reboot, how to fix it?

Question: I tried everything here but nothing helped. What I found helped is to reinstall manually the proprietary nvidia driver(NVIDIA-Linux-x86_63-390.87.run). But only until the next restart. After that I am stuck again in a login loop and have to reinstall the drivers again. This is cumbersome and I would like a fix where I do not have to reinstall them every time.
The problem seems to be that both the nvidia driver and the nouveau driver want control over something(xorg server, gpu, display)?
I found this out because of this post. Specifically after running lspci -vk | grep -iA15 NVIDIA I get the line:
01:00.0 3D controller: NVIDIA Corporation GM107M [GeForce GTX 960] (rev a2)
        ....
        Kernel driver in use: nvidia
        Kernel modules: nvidiafb, nouveau, nvidia_drm, nvidia

This seems odd to me becaue of two things. I know I saw once somewhere a file that was created by the nvidia driver that read something along this:
# Nvidia driver autogenerated do not touch
blacklist nouveau
options nouveau modeset=0

Plus I followed this post and added a file /etc/modprobe.d/blacklist-nouveau.conf with this content:
blacklist nouveau
options nouveau modeset=0

and then I did:
sudo update-initramfs -u
sudo reboot

but the lspci line still shows the same drivers, notably nouveau being still there and the /var/log/xorg.0.log shows:
(II) LoadModule: "nvidia"
....
(II) LoadModule: "nouveau"
....
(EE) [drm] Failed to open DRM device for (null): -2
(WW) Falling back to old probe method for fbdev

Summary

How to fix the login loop without needing to reinstall the nvidia driver manually every time?
How to blacklist the nouveau driver?

What are not options

Reinstalling ubuntu is not an option.

Just using the nouvea drivers. I need the nvidia drivers.

Let me know if you need more info, e.g. the .xsession-error log.
Comment: You're using `blacklist nouvea` but the driver is called `nouveau`
Comment: That was a typo in the post not in the file
Answer: I fixed the issue with the first answer here. This simply installed the nvidia 410.73 driver. Don't know why this works and the 390 didn't so I will leave this open in case somebody has a hint how I could get it working with the 390 driver.


How common is it to use more than two Rebar rows in a beam (bottom or top rebar)?

Question: I'm programming a drawing plugin for autocad to draw cross-section in beams and ribs. I need to know if it is worth it to add (to my plugin) the feature to add more than two rebar rows, or if I'll be covering the most use cases with two.
Answer: Very common. It's also very common to have two or more rows at each of the top and bottom.
Answer: Depends on the context.
Standard residential and office buildings usually don't require much rebar, so two layers should be sufficient.
Structures under greater loads (i.e. bridges), however, can often have more than two rows. This can obviously include residential/office buildings with more unusual architecture requiring wide spans between columns, etc.
Given that, I'll leave it for you to determine whether designing for only two rows will satisfy the needs for your project.
Answer: I have seen 4 layers at top and 6 layers in the bottom of some deep beams in a high-rise hospital building.


Error while sending field through Outbound messaging

Question: We had a requirement to send a field from Salesforce object to external System. Hence created a Outbout messaging saying whenever a record is created send the field. But Iam getting the error message in the OB messaging delivery status. Please advise.
Answer: Based on the screenshot, it looks like you are definitely sending Outbound Messages (in case you had any doubts...)
I've seen this before, and it's because the external server to which you are sending the Outbound Message is not consuming them. Instead, it's rejecting the message and returning that error.
It could be that you are sending the message to the wrong endpoint, or it could be something wrong with the external server. Either way you will have to work with whoever manages that external server to get to the bottom of it.
Comment: yes you are right I was able to find this issue it was a issue with the external server.


98 accord v6 rough idle car stall

Question: I blew my heater hose on my 98 Honda Accord v6 vtech sprayed coolant all over my cap and wires so I replaced the wires and my idle was fluctuating so I then cleaned my iacv as I was coming to a stop the car stalled out and wouldn't start so I wiggles the spark plug wires and it fired up what else could it be
Answer: If you wiggled the wires and it restarted, I'd suggest you ensure all of the wires are firmly in place on the cap and on the spark plugs. Since it wouldn't actually start, you should pay close attention to the coil wire. If it were the spark plug wires it would probably start, but would run rough. Seeing as how it would not start at all, this might point to the coil wire, which would preclude spark from getting to any of the spark plugs and not allowing it to start.

98 accord v6 rough idle car stall


Android Contacts no longer syncs multiple accounts?

Question: I recently purchased a new Motorola Droid Turbo 2.  My previous phone was a Motorola Droid Turbo.  I had multiple google accounts setup. Personal and work. I could add a new contact and select which account I wanted the new contact to be associated with personal or work or other.  My new MDT2 I can not do this. I have to select an account to sync and then it can not be changed. Is there any work around or recommendations? It seems rather short sighted for Android to get rid of this feature. Running android Version 6.0
Answer: First, make sure that you have added both accounts to your phone under Settings -> Accounts, and enable contacts sync on each one.
While in the Contacts app, begin adding a new contact by tapping on the "+" which brings up the "Add new contact" screen.  Directly under the contact photo, and above the contact name there is a "Saving to" box, which is a drop-down that can be accessed by tapping the down arrow to the right:

This drop-down should contain all your other accounts that are synced:

Select the account you wish to save this contact to by tapping on it, fill out the contact details and tap the check-mark on the top-right to save it.
Keep in mind that other contact management apps will most likely have a different way to save contacts to different accounts.


ArcGIS: Maintaining the same layer styles over multiple data frames

Question: Let's say you have a map with three or four data frames. In each data frame there is the same road layer. Is there a way to ensure that all the symbology/labeling/annotation is the same for that layer across all data frames. So let's say I modify the symbology of the road layer in data frame 1, is it possible to automate that change across all data frames?
Answer: You have to update each data frame manually, as far as I know.  You can right-click on a layer and save it as a "Layer" file (.lyr), then right click on the other data frames and use the "Add Data" tool to find that saved layer file.  If you make changes, just re-save that layer to the same .lyr file and delete and re-add it to each data frame.
I've been looking for some kind of text-file based rules (such as XML) for describing the symbology and layering and be able to apply that to a map, where the map would reload that file at least at every program load, so I could just change the file but so far I haven't been able to find anything like that.
Answer: I agree with the aproach that dmsnell describes, but you can simply copy the layer from one Dataframe to another by a rightclick on the layer -> select copy -> rightclick the other Dataframe name -> select Paste Layer(s).
I have not found any automation script or add-in to take care of this task.
Comment: That's what I currently due, and it really is a pain in the ... . I was hoping for an automated way
Comment: damn keyboard fingers - s/due/use
Comment: I agree. and in one doc it's not that bad but when you want to maintain them in many docs it can turn your (my) hair grey.
Answer: There are a few automatic options you can use
1) Cartographic Representation
Cartographic Representations add new fields to your geodatabase so that the symbology is stored in the data. This would allow you to make a change to the representation (using editing) so that any change you make will be reflected in all locations the representation is being used
2) Views and Visual Specifications
Views are available with Production Mapping (Previously PLTS) and are stored Dataframe Properties and allow you to specify which components of a dataframe are being used from the stored database version of the Dataframe. Where As Visual Specifications are SQL Select Queries which are used in Production Mapping to assign Cartographic Representations based on attribute fields
These are just some ideas, I will edit this and add more as I think of them, but based on you use case I would say carto Reps are the go, will need to be in either File Geodatabase or SDE.
Have Fun,
CDB
Answer: Update:
The little bit of the code that I mentioned was just snippets.  But I think the functionality that you want was the part that I (sort of) got through.  I dropped it into an ArcGIS 10 Addin to test out: http://dl.dropbox.com/u/1156285/SynchLayers.avi
As you can see, this code doesn't handle group/composite layers (need to recursively search composite layers). And it's an ArcGIS 10 addin button and you are on 9.3.  I'm putting code in this answer--it shouldn't hard to wire up to 9.3 (don't think I used anything new to 10):
<code>namespace SynchronizeLayer
{
    using System;
    using System.IO;
    using ESRI.ArcGIS.Carto;
    using ESRI.ArcGIS.Catalog;

    public class SynchronizeLayerByLayerName : ESRI.ArcGIS.Desktop.AddIns.Button
    {
        private const string LayerFileName = "u{0}.lyr";

        public SynchronizeLayerByLayerName()
        {
        }

        protected override void OnClick()
        {
            ArcMap.Application.CurrentTool = null;

            try
            {
                string temporaryLayerFilePath = Path.Combine(
                    Path.GetTempPath(),
                    String.Format(LayerFileName, System.Guid.NewGuid().ToString("N")));

                ILayer selectedLayer = ArcMap.Document.SelectedLayer;

                if (selectedLayer != null && selectedLayer.Valid)
                {
                    ILayerFile layerFile = new LayerFileClass();
                    layerFile.New(temporaryLayerFilePath);
                    layerFile.ReplaceContents(selectedLayer);
                    layerFile.SaveAs(temporaryLayerFilePath);

                    for (int i = 0; i < ArcMap.Document.Maps.Count; i++)
                    {
                        IMap map = ArcMap.Document.Maps.get_Item(i);

                        if (map != null)
                        {
                            IEnumLayer mapLayers = map.get_Layers(null, false);

                            ILayer maplayer = null;
                            int layerindex = 0;

                            while ((maplayer = mapLayers.Next()) != null)
                            {
                                if (maplayer.Name.Equals(selectedLayer.Name)
                                    && selectedLayer != maplayer)
                                {
                                    IGxLayer gxlayer = new GxLayer();
                                    IGxFile gxfile = gxlayer as GxFile;

                                    gxfile.Path = temporaryLayerFilePath;

                                    map.AddLayer(gxlayer.Layer);
                                    map.MoveLayer(gxlayer.Layer, layerindex);
                                    map.DeleteLayer(maplayer);
                                }

                                layerindex++;
                            }
                        }
                    }
                            if (File.Exists(temporaryLayerFilePath))
                            {
                                File.Delete(temporaryLayerFilePath);
                            }
                    ArcMap.Document.UpdateContents();
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Trace.WriteLine(ex.StackTrace);
                throw;
            }
        }
        protected override void OnUpdate()
        {
            Enabled = ArcMap.Application != null;
        }
    }
}
</code>

Maybe a year ago, I was working on an ArcMap button that would keep layers in sync and along the same idea's as dmsnell's manual copy except that I was working to automate the process by updating layers with layers stored in a subversion repository.
In my case, I had layer files in a subversion repository and I was looking to replace any layer in an MXD that was older than the layer file in my subversion repository.
I think @dassouki question is the same except that instead of a layer in a subversion repository, his layer is the one he just modified.  And he's only wanting to modify the MXD that he is in, rather than any MXD (although that is probably useful too).  I think that it's just remove a layer and add a new layer (that is a copy) at the same location.  This was work that was low priority for me and I stopped before it was completed, but  I think I have some code for the layer operations(swap) buried somewhere. I'll look around and update this answer.
The challenge for my solution was to uniquely identify layers (that would persist with the layer)--which I accomplished by using a guid in the layer extension properties.  Given the number of end-users I support, using the layer name would be risky since the chance of a layer with different renderers having the same layer name is high. The amount of our layer modifications decreased and with the promise of web map services, this all seemed like overkill, so I stopped the work.
The only thing I completed was an ArcMap button to modify the layer extension properties.
Update:
It just occurred to me that rambled on without actually answering the question of whether it is possible to automate layer changes across data frames.
Yes, but not with out some custom code.
Comment: Sounds really great. Actually, for my purposes, the layers in my maps, should NOT be updated, as we produce mostly as built, or temporal historical data.
Comment: @dassouki: wasn't your question how to automate the change of layers in other data frames when another is changed?  If the layers should NOT be updated, then don't use a tool that automates the updating of layers!
Comment: In the same MXD, if roads is in GroupLayers1, it should be updated in GroupLayers2. But in different MXDs, they should still remain separate, which happens anyway, as I differentiate my shps from project to project
Comment: Great script, I've been looking for this for a very long time after running into hundreds of errors with my own and others. The only change I require in your script is that all layers, regardless of name, need to match eachother in symbology. Furthermore, what if the ranges between the layers are different? Is it possible to quickly locate the highest and lowest values across the entire set of layers and create a symbology that can incorporate this where all the layers use it? Many thanks for your expertise! Bo


Why do objects rebound after hitting the ground?

Question: When an object, say a shoe, falls from a height (under the influence of gravity), it rebounds after hitting the ground. For an object to move upwards, it requires a force to overcome its weight. When the shoe hits the ground some of its energy is lost and the ground pushes back with a force less than its weight, so why does it rebound, since the upward force is not large enough to overcome its weight?
Answer: Whatever the object lands on and the object itself acts as a spring and in compression the objects store elastic potential energy which comes from the downward motion (kinetic energy) of the objects.
That elastic potential energy is then converted into kinetic energy due to the upward motion of the object which was originally falling.
In general such collisions are inelastic and so not all the kinetic energy due to the downward motion becomes the kinetic energy of upward motion.
So it is the springiness of the objects which result in the force to slow the falling object down and then to exert a force greater than the weight of the object to propel the object upwards.
Update as a result of @CortAmmon 's comment to show the storage of elastic potential energy.
The granddaddy of them all?
Comment: A video's worth a thousand words.   Here's one of a [tennis ball](https://www.youtube.com/watch?v=w9Q4VyPyqG8) showing exactly what Farcher is talking about.  Elastic potentials build up as the ball stretches.  You may not think of the material in a shoe doing this, but you'd be surprised how much [solid looking objects deform](https://youtu.be/6TA1s1oNpbk?t=27) when you see them in slow motion. [Not so solid objects](https://www.youtube.com/watch?v=On1CsbTwlDs&t=166s) are pretty funny too.
Answer: It appears from the tags of your question that you want an answer using Newton's Laws, rather than using energy or elasticity.
Let us assume there are two forces on the object:

The weight of the object, pulling down.
The ground pushing on the object.

Let's look at the possibilities for force #2:

There is no force between the ground and the object (or the amount of this force is zero).  In that case, the object remains in free-fall even after it hits the ground, and passes through the ground, still accelerating.  We know from experience that this doesn't happen.
The ground pushes downward on the object.  In that case, the object accelerates downward even more than it did in free-fall, and passes through the ground.  We know from experience that this doesn't happen.
The ground pushes upward on the object, but with less force than the weight of the object.  In that case, there is a downward net force on the object.  The object will still accelerate downward -- although less than it had in free-fall -- and will pass through the ground.  We know from experience that this doesn't happen.
The ground pushes upward on the object, with equal force to the weight.  In that case, the object is in dynamic equilibrium, for which the 1st Law applies.  The object in motion remains in motion with the same velocity, and passes through the ground.  We know from experience that this doesn't happen.
The only remaining possibility is that the ground pushes upward on the object with a greater force than the weight.  This makes the net force upward, the acceleration upward, and slows the object down.  This is what we observe from experience.  Objects that hit the ground slow down, whether or not they bounce.

So, we've just demonstrated that the ground can and does produce a greater force on the object than its weight.  If this effect continues after the object's velocity reaches zero, then the object will rebound (i.e. it is an elastic collision).  On the other hand, if the force reduces to the object's weight once it reaches zero velocity, the object will stop at the ground (i.e. an inelastic collision).
There are other, more elaborate, and more robust ways of looking at the problem.  As we say in physics, "there's more than one way to do it."  However, this is the answer using only Newton's Laws, and there is no need to make the answer more elaborate than it needs to be.
Comment: how can the ground produce a greater force on the object if the force the object exerted on the ground is equal to its weight, then according to Newton's third law the ground should push back with an equal force
Comment: Force #2 is the force **by the surface** *on the object*.  Its 3rd Law pair is the force *by the object* **on the surface**, not the the force of gravity on the object.  Forces #1 and #2 are *not* 3rd Law pairs and do not need to be equal.
Answer: There are also many objects that do not rebound when they got the ground but rather they get deformed . So the total potential energy stored in the body at a height is used to deform the body and some energy is lost in the form of heat or sound energy. The objects which are elastic in nature have a tendency to rebound and these objects don't get deformed or get a little bit deformed.
Comment: The deformation can be large, it just has to be elastic.


How to configure WSO2 ESB 4.7 JMS consumer proxy polling interval?

Question: Can anyone tell me if there is a property that allows one to configure how often a JMS consumer proxy polls a queue/topic?
Answer: I don't think such a mechanism available. Generally if a message comes to a queue its get removed by the listener. The time between removing an element and next element is variable and  depends on several other factors.
But you can achieve this by having two queues. You can create a thread to move a message from one queue to another in a scheduled time. So in the second queue, a message is available only in particular time interval.


Flagging a job is fine but is it possible to flag a company page

Question: Feature Request:
Is there a way to flag a company page.  In the case that their might be errors on the company page?  It doesn't necessarily mean there is something very wrong about the company but to help in case we come across something that just doesn't look right.
Answer: As I've said before, company pages are in a bit flux. They may be changed dramatically in the future, they may not, but it's something we're discussing. For now, while not the best solution, feel free to send us an email at firstname.lastname@example.com


When is it right to edit the code written by a co-worker?

Question: For which issues is it right to edit the code written by a co-worker? For which issues is it wrong?
Comment: I'm starting to be of the opinion that nobody should own code, much in the same way that a carpenter doesn't own the nails - he owns the bookshelf. "No, you can't remove that nail, I own it! I don't care if it's getting in the way of adding another shelf!"
Comment: You need to elaborate on how your local rules are.
Answer: When it's right
When the edit improves the functionality of the program or makes the code itself more readable / maintainable.
When it's wrong
When the edit harms the functionality of the program or serves no purpose apart from providing the editor with busywork.
Comment: @John: it's *irrelevant* in most common (whitespace-agnostic) languages. But in something like Python it could change the behavior of the program: in that case, you'd call it based on whether or not the behavior changed *for the better*... Note that if your diff tools can't be instructed to ignore whitespace, it could be considered *rude* even for whitespace-agnostic languages (but then you should probably invest in better tools). And if the change consists of nothing *but* indentation changes, I'd classify that as "busywork"...
Comment: @Chinmay: assuming that fixing the bug actually improves the functionality of the program. A "bug fix" that amounts to a work-around for a bug in the editor's own code, or fixes one bug by introducing new ones indicates, at best, an inability to understand the code being edited: it may be a sign that additional documentation is needed, or merely that the editor needs to spend more time reading before attempting to write...
Comment: @John Right if the team standard is what you change it to.  If your team doesn't have a standard I would suggest you get everyone together and make a standard.  That way they don't see it as someone else just "messing with their code".  Then, you have a documented reason why it needed to be changed.
Comment: Or fixes a bug...
Comment: What about to change the indentation? is that right or wrong?
Comment: @Mr. C: agreed.
Comment: @Ryan Doesn't your team have better things to do than arguing over whether indention should be 4 spaces or a tab?  I would say, follow whatever convention is in the file you are working on.  You should be able to adapt to whatever convention is used.
Comment: @KeithB Tools follow the standard for us, so we don't have to.  Like Mr. C said, if it's JUST about the indention, it's busywork.  Thinks like formatting are best left to tools, but you still have to decide on a standard, even if the standard is to have every file have their own standard.
Comment: "When the edit harms the functionality" is very trivial. Edit the coworker code for maintainance, bug fixing, upgrades or whatever is just a normal thing done every day in almost all the companies.
Answer: Who is the owner of the code? The company or the developer?
If the owner is (as usual) the company, there should be no difference in editing code written by you or by a coworker (unless a specific code maintenance policy).
Answer: Editing one other's code should be happening as the code evolves and should be encouraged as a practice so that you have collective code ownership.
The code should be owned by the whole team; having code that is only edited by (and therefore only really understood by) one developer is a bad idea. If you aren't in the code making changes yourself, you probably don't understand it. Waiting until the other developer leaves the company or gets sick is the wrong time to learn the code.
Having detailed unit tests in place and using source control should mean this practice is low risk.
Encouraging the whole team to follow Uncle Bob's "boy scout rule" and always trying to check in the code a little cleaner than you checked it out is a good way to ensure that the code stays clean over time and doesn't devolve into an unreadable, unmaintainable mess.
The only downside to this is if this practice turns into edit wars, where developers are constantly reverting one another's changes. This is probably a sign that you haven't decided on a coding standard for whatever is causing the edit war, so this would be a good opportunity to create one.
Comment: I can only confirm this opinion. There should be no such thing as *my* code and *your* code. The best method of code review is to have someone else work on your code. Of course, it doesn't mean you should barge in and make changes willy-nilly: before you make sweeping changes, at least check with your co-worker whether you understand his design correctly.
Answer: I would say it is right when what you are working on requires the change. It is right when you have been assigned to fix a bug and the bug is in that code.
If the code has nothing to do with what you are working on, but needs to be fixed, then bring it up to the team lead and let him assign a priority to fixing it and assign a person (it may not be you) to fix it. If he says not to spend your time on it, then it is worng to fix at that point. You are being paid to work on what you have been assigned to work on not what you want to work on. By all means bring it up that it needs to be changed, but priority setting is the manager's job not yours.
It is wrong to change working code just because of a personal preference.
It's wrong when you don't understand what problem the code was designed to fix or even understand the code. Just because it doesn't work for your needs doesn't mean you won't break something if you muck with it. If you need to change it to make what you are doing work, then go talk to the oreginal programmer about why he did what he did and what might be affected if you change it to meet your needs. NEVER change code you don't understand unless it is not working. This doesn't mean you don't ever fix the code, it just means that until you take the time to understand it thoroughly, you don't change it, especially if it is code already in production.
Answer:
When is it right to edit the code written by a co-worker?

This depends on which phase the product is in.  If the product is already stable and already released I would not make any changes that aren't needed unless there was a big change needed to really ugly code.

For which issues is it right to edit the code written by a co-worker?

I wouldn't nitpick about coding formatting.  You should refactor when code is overly complex and needs to be changed anyway or is causing problems and never seems to work right.
Answer: Like stackexchange or wikis, you should be ready to share your code and allow anyone to modify it as long as the changes fits in the global design and goals. But ask yourself a question : why should someone have to modify someone else's code if it's not for debugging ? Have you clearly cut your project into pieces sufficiently to allow parallelization of coding through multiple programmers at the same time ?
If, at the same time, for different functionalities, you are forced to modify the same code as your co-worker, there is a code entanglement and bad "separation of concerns". You should revise your design to allow each programmer to work on different parts of the software code base.