Relation between budget deficit and inflation?

Question: In Iran we have had a high inflation rate for several decades (usually above 20 percent). Some of the top economists of the country say that it is mainly because the government spending is considerably more than its revenues. If I'm not mistaken, this is called "budget deficit" and leads to debt of the government. On the other hand, Paul Krugman believes that debt is good for the economy and people should love debt. As a layman, I'm confused here. When does debt result in harmful levels of inflation?
Comment: The question in the title and the question in the body of the text are different. Which one interests you?
Comment: @Giskard, I hope that now you find them in more harmony.
Answer:
Relation between budget deficit and inflation?

There is no direct relationship between budget deficits and inflation, however, inflation is one of the ways government can choose to finance government deficit, and consequently highly indebted nations often choose to do so for various reasons, but it is not a necessity.
Government budget constraint is by definition (in its static form) given as:
$$G−T=\theta + \beta$$
where $G$ is government spending, $T$ is the net tax revenue after transfers and interest payments, $\theta$ is government financing by high powered money and $\beta$ is government financing by bonds (see for example Blinder & Solow, 1973; Christ, 1968; Tobin & Buiter 1976).
All these variables $G$, $T$, $\theta$ and  $\beta$ are choice variables of the government singe government can choose its spending, taxes, high powered money supply or bond issuance. However, what choices government makes here will have different effect on inflation.
Now price level (positive change of which is by definition inflation), is given by a money market equilibrium that in common modern models is given by (see Romer Advanced Macroeconomics for more detail):
$$M/P = L(i,Y) \implies P= \frac{M}{L(Y,i)}$$
where, $M$ is money stock, which is function of the high powered money $M(\theta)$, $L$ is money demand which is function increasing in the real output $Y$ and decreasing in interest rates $i$.
Consequently, when government decides to fund budget deficit $G-T>0$ with high powered money $\theta$, this will increase $M$ and ceteris paribus it will increase $P$ as well which will lead to inflation. In addition, highly indebted government typically wants central bank to keep interest rates low (to make maintenance of its debt easier), which will again contribute to the inflation since low $i$ decreases $L$ and fall in $L$ again increases $P$.  Consequently, it can be historically observed that many government that were highly indebted eventually choose to (at least partially) monetize their debt by combination of issuance of high powered money and keeping low interest rate (see discussion of that in Rogoff and Reinhart: This Time is Different*).
However, that is not the only thing that government can do. Governments can try to outgrow their debts by keeping deficits lower than the growth of the economy and finance these deficits purely by bond issuance to the public without putting pressure on interest rates via central bank (or buying the bonds itself using high powered money). In such case there is no reason why government deficit should lead to inflation.
Consequently, there is no necessary link between government deficits and inflation. It is all up the government to decide how to finance its deficits, there are always non-inflationary options.  Although, most economists do not consider mild inflation (2-4%) a problem but a good thing (see this excellent answer of FooBar for more info on that).

When is debt harmful?

This is different question. Debts are generally considered harmful if they are used to finance unproductive activity or do not pass cost-benefit analysis (i.e. activity for which net present value is less than zero).
For example, borrowing \$1.000.000 at 10% interest is completely fine if government discovered some new oil field and the   \$1.000.000  is used to set up an oil rig that will generate \$200.000 cashflows each year for next 30 years, as the net present value of the project is positive (that is the project pays for the debt, interest rate, and still leaves us with positive net value).
In addition, to just monetary cashflows it is also reasonable to factor in welfare benefits that the government project has for people (see discussion of that in Carnot et al Economic Forecasting and Policy), however then things get more complex as in such case there might be some issues with debt sustainability (but this is issue too broad for a single SE answer so I won't go into greater depth on that here).
However, if the government decides to spend that \$1.000.000, borrowed at 10% for a new private palace for president, which will have no positive cashflows for government or no welfare benefit for society, then that debt will be harmful.
This being said, note that the above are only very rough outlines of discussion when debt is and is not harmful, that question in itself is too broad to explore fully in SE format as it all depends on the context.

 * Note this book was criticized for their analysis of effect of debt on growth, where they made some serious mistakes making that portion of their analysis discredited so you should not pay much attention to that part, but their historical analysis of how governments dealt with high debt levels is still valid.
Comment: @apadana I just mean nation being in debt without any distinction of who owns the debt.
Comment: Thanks for your answer. By "indebted nation" you mean a nation being in debt to other nations, or it also includes a government being in debt to a fraction of its own people?
Comment: If a government finances its deficit by increasing the monetary base $\theta$, is it considered to be some sort of debt? or the meaning of the term "debt" doesn't include that? By the way, your answer was very helpful. Thanks again.
Comment: @apadana no, increasing $\theta$ is not debt per se although *one of the ways* how government can increase $\theta$ is to ask its central bank to create new money and purchase its debt. This way government effectively purchases its debt from itself with new money. The reason why governments do this is that it makes easier to destroy that new money later (by repaying the debt to itself) and because it pushes pressure on lowering interest rate on government debt, meaning government can borrow more cheaply from other actors than itself.
Comment: Consolidate balance sheets of the fiat government and central bank into one unit that I call the Sovereign finance sector. Sovereign can cover the budget deficit three ways: (1) print and spend currency to increase M1 money supply; (2) write checks via central bank, cleared by bank sector, to increase reserve balances in base money and bank deposits in M1 money supply; (3) issue Treasury securities and/or interest-bearing central bank accounts to drain base money and M1 money at the same rate as the deficit spending would tend to increase base money and M1 money.
Comment: Inflation does not always ensue when government deficit spends because aggregate demand is also caused by whether or not there is spare capacity in the production sector of the economy and by conditions in the credit markets. Are factories running at full capacity? Is there full employment? Is the working class saturated with debt, underwater in mortgages, or do they have sufficient net worth to pledge against net new loans in the industrial credit/debt generating system? Ceteris paribus assumes credit markets expand credit if given more base money. Saturated credit markets may also contract.
Answer: This article argues that growth in the money supply is caused by the government printing money:
https://en.radiofarda.com/a/iran-s-money-supply-skyrockets-parallel-to-inflation/30671910.html
However the credit system can increase the money supply via expansion of bank credit and/or increase the velocity of money via expansion of non-bank credit offered by non-bank creditors.
This article describes the political and structural problems Central Bank of Iran faces with efforts to target rampant inflation:
https://www.rethinkingiran.com/iranundersanctions/mazarei
In a simplified model of rampant inflation if there is no shock to aggregate production (for example a natural or social disaster destroys factories or other means of economic production) then inflation is caused by too much aggregate demand (purchasing power) which enables prices of inputs to production and outputs to rise rampantly. Then the economic community can debate the sole and/or joint causes of too much aggregate demand. Again in the simplified model the government deficit, expansion of bank credit and other sources of credit in the credit/debt markets, and/or so-called increase in the velocity of money are joint causes of greater aggregate demand. In modern economies if the government is running a high deficit and there is rampant inflation the central bank can "kill" the inflation only by forcing the bank sector to ration future credit deals to the non-bank sector or it can jawbone the government to reduce the deficit. There is no deterministic model for how the government budget deficit drives inflation because the credit system and so-called velocity of money are independent drivers of inflation.
Some argue that unions bargain for higher wages and this causes inflation but then such rising wages are either paid via increasing the velocity of money which is hard to accomplish or via increasing the credit provided via financial deals that producers use to pay wages and sell output at rampantly rising prices. So blaming high inflation on something other than the government budget being too big and the credit system expanding too fast is a spurious model.
Comment: Thanks for your answer.


How painful is it for professional fighters to get hit

Question: I watch combat sports that involve striking and the vast majority of the time they get hit they don't show any sign that it hurts.  What kind of pain are they feeling?  I would think that considering how hard pros can punch and kick that getting hit would be extremely painful and cause serious injuries.
Comment: This is a bit small to be an answer, but look at the face of MacDonald at the end of his UFC 189 fight.  If the reaction he had does not qualify as pain, I don't know what does.
Comment: @MattLerner: I believe the question to be different enough so that it merits different answers. Although, they should be linked.
Comment: have a look at the answer here: https://answers.yahoo.com/question/index?qid=20110926044241AAyEIgw the answer states that your nervous system can adapt to the pain so that it is no longer "as unexpected" and therefor not as painful at first perceived. Try this: go to the pool, and jump in the cold water. you will be cold, and feel that it is uncomfortable. swim for a while, and the cold water suddenly is perceived to be much warmer - this is your brain having recalibrated the sensory input from your skin. The difference is that getting "used" to pain is not as fast a process...
Comment: Fair warning, this may be flagged as a duplicate of http://martialarts.stackexchange.com/questions/5163/how-do-boxers-and-other-martial-arts-practitioners-deal-with-pain. That being said, from personal experience, it hurts. It hurts like hell. But the thing is, it's not the end of the world to get hit and once you realize that it's much more mental than physical and you just kind of deal with it. Source: Former Muay Thai fighter now MMA
Comment: @CortAmmon: I think your comment would make a fine answer. You could even gauge the perceived pain on the pain scale.
Answer: In my experience, there are a few reasons why professional/trained fighters do not feel pain as much as a normal person.
Higher pain tolerance
They are constantly taking hits and their bodies have become accustomed to pain. Fighters know in which situations pain is unavoidable and they may have developed a different response to it. Also, by mentally anticipating pain it becomes easier to deal with.
Conditioning
Over time, fighters develop hardened bodies through striking and blocking. Conditioning exercises help to strengthen your body in certain areas. For example, some fighters take blows to their abdominal muscles to develop a higher resistance to pain in that area. Kung fu fighters have been known to thrust their hands in hot sand to toughen them. While these may seem somewhat extreme, through sparring regularly you are effectively conditioning your body and developing a higher resistance to pain.
Adrenaline
Adrenaline, also known as epinephrine, can enable a fighter to feel less pain when it is pumping through their blood. The initial pain is dulled as the body uses the adrenaline rush to protect itself. But with a severe injury, like a broken bone, the pain will always catch up to you eventually!
Answer: Epinephrine is known to dull pain for a time thus allowing someone not to feel as much pain as they actually have. However, it is temporary. I suspect, but have no evidence, that this is what allows competitors to take blows and not register the pain till later on. A lot of training require "soaking" of blows thus both reducing the energy dumped into the body by parry/deflection and getting adapted to the pain of being hit.
In addition, pain is personal but there is a pain scale [source, page 2, & page 3] which you could use to gauge how much pain someone is in.
Answer: Your body turns off you ability to feel pain when you're in a serious fight. I once fought with a broken collar bone. It was a bit tender, but I didn't feel any pain until the following morning. And for me getting hit hard in the face was just a bright explosion of light and a moment of disorientation. If it was a particularly hard strike, you may feel the same type of pain as bumping your head against a door or something but it's not traumatic. You just don't really feel pain. The shock of getting hit is worse than the actual hit.
Answer: The important thing is that there are two phenomena limiting your performance:

Physical limits -- injury or pain so severe that you CANNOT continue.
Psychological limits -- a combination of fear, surprise, stress, or self-preservation instincts make you REFUSE to continue (including fleeing, surrendering, collapsing, dialing back your own intensity, etc.) long before there are injuries that truly, physically prevent you from performing. I'm not being judgmental here... it is these instincts that help you avoid sustaining severe injuries most of the time.

For somebody who is not used to being hit hard, the pain threshold of #2 is MUCH LOWER than the actual physical limits of #1. Through practice -- simple acclimation to being in circumstances where you take hard hits -- you can raise the threshold of pain that you are willing to endure psychologically.
In other words, with practice in painful/stressful/adrenalized situations, you can quite often endure hits (that are very painful but short of severe physical injury) that somebody unpracticed would not tolerate.


Opening app from different android Browser

Question: Till now I have been using the default browser with my Samsung Galaxy S2. When Browsing if I found and clicked on  a link that was from Wikipedia or IMDB for instance it would ask and give the choice if I wanted to open them in the "Internet" Browser or the installed IMDB/Wikipedia App. I have since tried other Browser Apps. (Firefox, Dolphin, Skyfire, Opera etc) and none of these appear to pop up with the option to open them in an app. They go straight to the website. The only app I have found that does offer the choice is Chrome, but it seems to crash a bit too often. Am just wondering if I am missing something in the the other browsers I have looked at. I like Dolphin and Firefox, but would like to see them offer the option to open sites in installed apps. Is there options to get them to do this? Thanks!
Answer: It is because those browsers (Firefox, Dolphin, Skyfire, Opera) you have tested at the end of 2012 don't support or have problems with calling external intents.
Here is the issue about implementation that feature on Firefox.
Related information -  how to use intent filters to open external Android app from browser.


Error 134 in a MySql table

Question: I have a file (mysql error file) full of this message

[ERROR] Got error 134 when reading table './xxxx/wp_options'

I don't really know how to fix this problem
Answer: MySQL error code 134 = Record was already deleted (or record file crashed)

Solution : You need to run a table(s) repair on the database
Identifying table corruption
Checking tables
There are three ways to check tables. All of these work with MyISAM tables, the default, non-transactional table type, and one with InnoDB, the most mature of the MySQL transactional table types. Fortunately, MySQL now allows you to check tables while the server is still running, so corruption in a minor table need not affect everything on the server.

The CHECK TABLE SQL statement (obviously the server must be running
for this)
Running the mysqlcheck command-line utility (the server can be
running)
Running the myisamchk command-line utility (the server must be down,
or the tables inactive)

Checking tables with CHECK TABLE
The first method for checking tables is to run the CHECK TABLE SQL statement while connected to the server. The syntax is:
CHECK TABLE tablename[,tablename2...] [option][,option2...]

QUICK
The quickest option, and does not scan the rows to check for incorrect links. Often used when you do not suspect an error.
FAST
Only checks tables if they have not been closed properly. Often used when you do not suspect an error, from a cron, or after a power failure that seems to have had no ill-effects.
CHANGED
Same as FAST, but also checks tables that have been changed since the last check.
MEDIUM
The default if no option is supplied. Scans rows to check that deleted links are correct, and verifies a calculated checksum for all keys with a calculated a key checksum for the rows.
EXTENDED
The slowest option, only used if the other checks report no errors but you still suspect corruption. Very slow, as it does a full key lookup for all keys for every row. Increasing the key-buffer-size variable in the MySQL config. file can help this go quicker.
Note that CHECK TABLE only works with MyISAM and InnoDB tables. If CHECK finds corruption, it will mark the table as corrupt, and it will be unusable. See the Repairing tables section below for how to handle this
Checking tables with mysqlcheck
The second method is to run the mysqlcheck command-line utility. The syntax is:
mysqlcheck [options] dbname tablename [tablename2... ].
The following options pertain to checking (mysqlcheck can also repair, as well as analyze and optimize.
--auto-repair

Used together with a check option, it will automatically begin repairing if corruption is found.
--check, -c

Checks tables (only needed if using mysqlcheck under another name, such as mysqlrepair. See the manual for more details)
--check-only-changed, -C

Same as the CHECK TABLE ... CHANGED option above.
--extended, -e

Same as the CHECK TABLE ... EXTENDED option above.
--fast, -F

Same as the CHECK TABLE ... FAST option above.
--medium-check, -m

Same as the CHECK TABLE ... MEDIUM option above.
--quick, -q

Same as the CHECK TABLE ... QUICK option above.
Note that you can specify multiple tables, and that mysqlcheck only works with MyISAM tables.
Checking tables with myisamchk
Finally, there is the myisamchk command-line utility. The server must be down, or the tables inactive (which is ensured if the --skip-external-locking option is not in use). The syntax is: myisamchk [options] tablename.MYI, and you must be in, or specify, the path to the relevant .MYI files (each MyISAM database is stored in its own directory). These are the available check options:
--check, -c

The default option
--check-only-changed, -C

Same as the CHECK TABLE ... CHANGED option above.
--extend-check, -e

Same as the CHECK TABLE ... EXTENDED option above.
--fast, -F

Same as the CHECK TABLE ... FAST option above.
--force, -f

Will run the myisamchk repair option if any errors are found
--information, -i

Display statistics about the checked table
--medium-check, -m

Same as the CHECK TABLE ... MEDIUM option above.
--read-only, -T

Does not mark the table as checked
--update-state, -U

This option stores when the table was checked, and the time of crash, in .MYI file.
You can also use wildcard to check all the .MYI tables at the same time, for example:
% myisamchk *.MYI

Note that myisamchk only works with MyISAM tables. For those of you still using the old ISAM table types, there is also isamchk, though there is really little reason not to upgrade to MyISAM.
Repairing tables
In most cases, only the index will be corrupted (the index is a separate, smaller, file with records that point to the main data file) - actual data corruption is extremely rare. Fixing most forms of corruption is relatively easy. As with checking, there are three ways to repair tables. These all only work with MyISAM tables - to repair corruption of the other table types, you will need to restore from backup:

The REPAIR TABLE SQL statement (obviously the server must be running
for this)
The mysqlcheck command-line utility (the server can be running)
The myisamchk command-line utility (the server must be down, or the
tables inactive)

Repairing a table requires twice as much disk space as the original table (a copy of the data is made), so make sure you are not going to run out of disk space before you start.
Repairing a table with REPAIR TABLE
The syntax is, as would be expected, REPAIR TABLE tablename[,tablename1...] [options]. This method only works with MyISAM tables. The following options are available.
QUICK
The quickest, as the data file is not modified.
EXTENDED
Will attempt to recover every possible data row file, which can result in garbage rows. Use as a last resort.
USE_FRM
To be used if the .MYI file is missing or has a corrupted header. Uses the .frm file definitions to rebuild the indexes.
Repairing tables with mysqlcheck
The mysqlcheck command-line utility can be used while the server is running, and, like all the methods of repair, only works with MyISAM tables. The syntax is:
%mysqlcheck -r sports_results fixtures -uuser -ppass

Repairing tables with myisamchk
The server must be down, or the tables inactive (which is ensured if the --skip-external-locking option is not in use). The syntax is myisamchk [options[ [tablenames]. Remember again that you must be in, or specify, the path to the relevant .MYI files. The following options are available:
--backup, -B

Makes a .BAK backup of the table before repairing it
--correct-checksum

Corrects the checksum
--data-file-length=#, -D #

Specifies the maximum length of the data file, when recreating
--extend-check, -e

Attempts to recover every possible row from the data file. This option should not be used except as a last resort, as it may produce garbage rows.
--force, -f

Overwrites old temporary .TMD files instead of aborting if it encounters a pre-existing one.
keys-used=#, -k #

Can make the process faster by specifying which keys to use. Each binary bit stands for one key starting at 0 for the first key.
--recover, -r

The most commonly used option, which repairs most corruption. If you have enough memory, increase the sort_buffer_size to make the recover go more quickly. Will not recover from the rare form of corruption where a unique key is not unique.
--safe-recover, -o

More thorough, yet slower repair option than -r, usually only used only if -r fails. Reads through all rows and rebuilds the indexes based on the rows. This also uses slightly less disk space than a -r repair since a sort buffer is not created. You should increase the key_buffer_size value to improve repair speed if there is available memory.
--sort-recover, -n

MySQL uses sorting to resolve the indexes, even if the resulting temporary files are very large.
--character-sets-dir=...

The directory containing the character sets
--set-character-set=name

Specifies a new character set for the index
--tmpdir=path, -t

Passes a new path for storing temporary files if you dont want to use the contents of the TMPDIR environment variable
--quick, -q

The fastest repair, since the data file is not modified. A second -q will modify the data file if there are duplicate keys. Also uses much less disk space since the data file is not modified.
--unpack, -u

Unpacks a file that has been packed with the myisampack utility.
An example of its usage:
% myisamchk -r fixtures
- recovering (with keycache) MyISAM-table 'fixtures.MYI'
Data records: 0

All above information was taken from the following reference

Repairing Data Base Corruption
How to Repair MyISAM Tables - MySQL

Pls refer the articles if anything that I have mentioned above is unclear.Hope my answer helps!

Error 134 in a MySql table


Calculating $\phi(x^y)$

Question: I know how to compute $\phi(x)$ like $\phi(21)$ or $\phi(7)$ but how can I compute $\phi(x^y)$. Specifically how can I compute $\phi(5^{20})$?
Answer: You can use the general formula: if |$d =gcd(m,n)$ then
$$\phi(mn)=\phi(m) \phi(n)\frac{d}{\phi( d)}$$
In particular, if $m|n$ then $d=m$ an you get
$$\phi(mn)=m\phi(n) \,.$$
Then, by induction of $y$ you can prove that
$$\phi(x^y)=x^{y-1} \phi(x)$$
Answer: You may use the well known equality
$$\Bbb N\ni n=p_1^{a_1}\cdot\ldots\cdot p_k^{a_k}\;,\;\;p_i\;\;\text{primes}\;,\;\;a_i\in\Bbb N\implies$$
$$\implies \varphi(n)=n\prod_{m=1}^k\left(1-\frac1{p_m}\right)$$
So for your question: only put $\;x^y\;$ in place of $\;n\;$ above, as the prime factors are the same...
Answer: It is easy to calculate $\phi(p^k)$ if $p$ is prime.
Using the definition $\phi(p^k)$ is the number of numbers $1\leq i\leq p^k$ such that hcf$(i,p^k)=1$. Well, in this range, only the numbers $p,2p,3p,...,(p^{k-1})p$ share a prime factor with $p^k$. There are $p^{k-1}$ of these.
So $\phi(p^k) = p^k - p^{k-1} = p^{k-1}(p-1)$.

Calculating $\phi(x^y)$


Why didn't the gladers try to use the lift to escape?

Question: When the Gladers were in the Glade in The Maze Runner and the lift came up carrying supplies and even another Glader, why couldn't the Gladers jump inside of the lift in order to escape? It would take them down to the lab where they came from.
Answer: They actually tried that, but it is stated that the elevator would not go down when someone was in it. Thomas at one time starts inquiring about the possibility of doing just that.

And what about the Box? Next time it comes up...

Here he's cut in mid sentence and Newt replies.

No, we tried that. The Box won't go back down with someone in it.

Apparently Chancellor Ava Paige and the rest of her crew were watching if the gladers attempted to exploit this specific loop hole. You could find this conversation around the 20 minute mark of the movie.
Comment: Yeah, i read the book not long ago and you are right, but it wasn't Newt that said it, it was Chuck.
Answer: Yes, I have learned that they didn't try because they already tried it and it turns out that the kid that volunteered got sliced clean in half when he was abut 3 metres down from the box doors, he was going down by vines made by the Gladers.
Answer: Because in the books and maybe in the movies, if people go in the elevator shaft, it won't go down and if someone jumps or goes down while the shaft is going down, they will be killed by saws or maybe some other way, but it will never work and there are gates when the shaft is not coming up to stop people from jumping down.
Answer: They tried that. The lift wouldn't physically go down with weight in it. Also they tried with a hand made rope but weren't able to make it long enough. On another attempt to get down, a guy was asumed to have gone to his death by falling although the people at the top did not hear him land because of long way down. This happened after him trying to climb down. They all gave up after that
Comment: What does this add to the previous answer?


In the main drop-down menu for a logged in user, is it actually useful to have a link to the user's own profile page?

Question: The core question is: Is it useful for users to have easy access to their own profile page on a website or app? Do users view their own pages often enough to warrant spending navigation menu space on it?
In the web app I'm working on, a user can currently access their own profile page view by going to settings page first, and then clicking on a tab within the settings page (called "user activity" for reference).
This profile page view is essentially what another user would see when they click on the user's avatar or username. There is nothing that can be changed about it on that page, it only displays the user's post history, their bio and their profile photo - all things that can be accessed via the settings -> "user activity" path, or (in the case of profile pic and bio) edited directly from settings.
Meanwhile, I'm advocating for including a link to the "user activity" profile in the main navigation dropdown menu so that the user can go directly to their own profile page, rather than having to go through settings.

I realized that I'm thinking this way because every other web app, mobile app, etc. do this, but I'm no longer sure whether it's necessary. Are there any principles, case studies, insights or research that indicate that users really want, use or visit their own profile page if there's nothing they can edit on it?
We're trying to be scrappy on resources, and I got some dev pushback on including the profile link, so I want to be certain of this decision before pushing it to the team.
Also - we haven't launched the product yet, and don't have any users, so I won't be able to test this with user tests for a while.
Answer: Advice
I don't see a major impact that it is going to bring to the product. Hence either of these should be fine. Always spend more time simplifying the core problem of the product.
Arguments for Option 02

One of the principles says "User spend most of their time in other products, hence we should preserve their mental model to reduce their learning curve".
https://www.nngroup.com/videos/jakobs-law-internet-ux/


In Scrum, should we prepare the Product Backlog at the beginning of each Sprint or only at the beginning of the project?

Question: I know that the Sprint Backlog is a subset of the Product Backlog which contains the tasks to be completed in the current Sprint. Does this mean that the Product Backlog should be fully ready and complete at the beginning of the project? Should it be reviewed at the beginning of each Sprint?
Answer: There's no such thing as a "fully ready and complete" Product Backlog.
The Product Backlog is emergent and frequently changes throughout the Sprint. Your Product Owner will probably be talking to stakeholders throughout the effort, and those conversations will result in changes to the Product Backlog. The Developers, while doing work in the Sprint Backlog, may see opportunities to improve the product that can't or shouldn't be done in the Sprint, so they may add Product Backlog Items. During product backlog refinement activities, the team may be decomposing, reordering, adding, and removing Product Backlog Items from the Product Backlog. The Sprint Review is an explicit opportunity for key stakeholders and the team to come together to inspect and adapt (change) the state of the Product Backlog (including the Product Goal, the Product Backlog Items, and their ordering).
Comment: ok thanks for in this case what is the differences between Product backlog and the spring backlog ?
Comment: @NETCoreSharePoint The difference is exactly what you said in the question. The Sprint Backlog consists of a Sprint Goal, the Product Backlog Items selected for development in the Sprint, and the team's plan for achieving the Sprint Goal.
Comment: so in this case where we define all the requirements for the project/product ? if both the Product backlog and sprint backlog will be scoped to the current sprint only.. based on my reading is that sprint backlog is a subset of the product backlog, and the product backlog contain a prioritized requirements for the whole product/project
Comment: @NETCoreSharePoint The Product Backlog is indeed where you keep all of the known requirements. However, over time, you may find that some of those are not necessary. Others may emerge over time. When you use agile methods, you acknowledge the fact that you cannot know all the requirements up-front. Contrast this to plan-driven methodologies that do attempt to capture all the requirements up-front and have complex change control processes when new requirements are discovered.
Comment: yes i know ,, but at the end we will have requirements for the whole project (these requirements can change by time) and requirements or the current sprint .. so the first should go to the product backlog while the later should be inside the sprint backlog, am i correct?
Comment: @NETCoreSharePoint If I'm understanding correctly, yes. The known requirements that have not yet been delivered are in the Product Backlog. The known requirements that are currently being worked on are in the Sprint Backlog. But I don't like the terms "whole project" or "all requirements" since that's very much like the plan-driven mindset of capturing a complete set of requirements and locking them down, which is the exact opposite approach of Scrum and agile methods.
Comment: @Thoms Owens yes that why when i use All i mentioned that can change by time.. so at the end can i say that Sprint backlog can be equal or be a subset of the product backlog ?
Comment: @NETCoreSharePoint The Product Backlog Items in the Sprint Backlog are a subset of the Product Backlog Items in the Product Backlog, but I wouldn't say that the Sprint Backlog is a subset of the Product Backlog because the Sprint Backlog also includes a Sprint Goal and a plan to achieve that Sprint Goal.
Answer: The product backlog is a list of all the work we expect to do on the product. Some of the items on the product backlog may be ready to be started, but other items may just be outlines, with more detail required.
The product backlog should contain at least two sprints worth of work but more typically it contains 3 months or more of work in a variety of states of readiness. The product backlog is never fully prepared. It is a live, dynamic list that will be refined by the team and by the Product Owner continuously.
In Scrum we work in sprints, which are time-boxed iterations. We could work directly from the product backlog in a sprint, but it makes more sense to use a more concrete subset of the product backlog which we call the sprint backlog. The sprint backlog is the work we anticipate completing in one sprint. It will contain work items that are fully prepared and ready to be started.
Answer: The Product Backlog Defines an Emergent Product Goal

Does this mean that the Product Backlog should be fully ready and complete at the beginning of the project?

No. It should have sufficient information to provide an initial Product Goal, but the cone of uncertainty is usually too large at the start of most projects to have a "fully ready and complete" set of specifications. Scrum is about just-enough and just-in-time planning, rather than big upfront specifications. The 2020 Scrum Guide describes this aspect of the Product Backlog as follows:

The Product Backlog is an emergent, ordered list of what is needed to improve the product...The Product Goal describes a future state of the product which can serve as a target for the Scrum Team to plan against.

Product Backlog Refinement is an Ongoing Activity

Should it [the Product Backlog] be reviewed at the beginning of each Sprint?

Yes and no. You have to review the Product Backlog during Sprint Planning to select items from the Product Backlog that form a single, cohesive Sprint Goal and can be done within a single Sprint. However, refinement of the Product Backlog is no longer a separate event within Scrum. The 2020 Scrum Guide says (emph. mine):

Product Backlog refinement is the act of breaking down and further defining Product Backlog items into smaller more precise items. This is an ongoing activity to add details, such as a description, order, and size. Attributes often vary with the domain of work.

So while selection from the Product Backlog is a Sprint Planning activity, and some refinement for items selected for the Sprint Backlog is expected, Product Backlog Refinement is an ongoing activity. "Ongoing" is not defined for you, though; it's up to the Scrum Team as a whole to collaborate with the Product Owner to ensure that Product Backlog items that are likely to be in scope soon meet some team-defined Definition of Ready that includes (but is not limited to) an expectation of being completable within one Sprint.
The INVEST mnemonic is often a good guide for Backlog Refinement and can help form the basis for your Definition of Ready. However, the Scrum Guide largely leaves how the team does refinement and how much detail is required for a Product Backlog item to be ready up to the self-managing team.
While a Product Backlog item must meet the framework's requirement that:

Product Backlog items that can be Done by the Scrum Team within one Sprint are deemed ready for selection in a Sprint Planning event.

it doesn't say you have to stop there, or even that such is sufficient. It simply sets a minimum baseline around which the Scrum Team can then create additional working agreements as needed. This is a core aspect of Scrum's empirical inspect-and-adapt control process, and provides the team with flexibility so long as the foundational requirements are met.
Answer:
Does this mean that the Product Backlog should be fully ready and complete at the beginning of the project?

Not, the only thing that the PO needs to start a Product Backlog is some ideas, briefly written as a phrase or 1 or 2 lines. That's it. The better they are written, the easier will be the refinement. Later, the ideas are discussed and the whole team elaborate on them to narrow down the scope of those ideas. If the scope is too wide, the team may decompose an idea into smaller ones. This can happen several times until the team find the scope manageable. When a Product Backlog Item is considered "manageable" by the Dev Team, it's considered "Ready". Ready for what? To be pulled to a Sprint Backlog.

Should it be reviewed at the beginning of each Sprint?

The Product Backlog is always in motion. It's alive. But you are right, for developers to work on new product backlog items, these items should be refined. Scrum Guide won't tell you when and how to do it. Probably because you do it often no matter the moment. Especially at the beginning, when the lack of definition is absolute. So, each team do what best work for them.

What are the differences between the Product Backlog and the spring backlog?

Some relevant difference are

Scope: The Sprint Backlog is a subset of items extracted from the Product Backlog. These items are not selected randomly, they are selected to achieve a goal (the Sprint Goal) which is crafted and agreed upon by the team. Although, the PO will influence a lot.

Ownership: Sprint Backlog is owned by the Dev team. Only. No one else manages the Sprint Backlog. The Product Backlog is managed by the PO and Devs, but PO remains accountable all the time. The PO has the last say about the Product Backlog and the order of the items.

Lifespan: While the Product (or Service) exists, the Product Backlog exists. Even if it's empty. The Sprint Backlog lifespan is equal to the Sprint length (days, weeks, 1 month at most)

Goals: Both Backlogs have (as described by the Scrum Guide) a goal. These goals are a sort of "commitment". Product Backlog has the Product Goal and Sprint Backlog has the Sprint Goal. The Product Goal is a long term commitment. The Sprint Goal is a desired outcome for the next X days. A short-term commitment. Think of Sprint Goals as a sequence of milestones toward the Product Goal.


What are transaction fees

Question: I would like to know what transaction fees are for, what they represent and how does one make money on these transactions?
Answer: Transactions fees are another incentive for miners to mine bitcoin. When you make a payment you segguest a fee for the miners to verify and approve it. A miner that verifies your payment recieves the fee.
So the way to make money from transactions fees is simply to be a bitcoin miner.
Today, new bitcoins are created as a reward for bitcoin miners. This reward gradually decreases and in the future the reward for mining will be solely from transaction fees, and the amount of bitcoin in the world will be constant at around 21 million.
Comment: Welcome to Bitcoin.se! For questions like this that have clearly been asked before, rather than writing a new answer, it is better to flag the question as a  duplicate. If you think you have more to contribute, add an answer to the previous question.

What are transaction fees


Changing the move/grab tool's multiplier

Question: While working in Blender 3.3.1, I seem to have accidentally activated some mode where the vertex move tool is multiplying the mouse position by some extreme amount (like 5x or something), like it's in the inverse of precision movement mode. While in this state, holding shift to get precision mode is still moving the vertex faster than the mouse's natural motion.
I've tried searching all of the documentation I could find and I'm apparently not finding the right terminology for this, and certainly not figuring out how to undo it. For example, this isn't "increment snapping" mode, it's just that the motion seems to have some multiplier added to it.
How can I revert this back to 1:1 motion?
Whatever the tool setting is, it's saved along with my <code>.blend</code> file — other Blender documents do not have this happening, and saving/quitting/reopening this document still has the affected mode. It also happens whether I have proportional editing enabled or disabled.
This only occurs in perspective views; orthographic views are still following the mouse cursor 1:1.
Answer: I figured it out - it wasn't actually a tool-specific thing, but that I had my pivot point set to 3D Cursor, which caused it to scale the motions based on the distance from the 3D Cursor to the view, rather than the distance of the vertex I was moving.


Need help with on off switch to power arduino.

Question: I am trying to add an on and off power switch to my arduino project.  My project is running off a 9v battery and I would like to save as much power as I can.  There might be a better why that I don't know.  I added SLEEP_MODE_PWR_DOWN to my project and from what I can tell, the arduino enters sleep mode.  I am having a hard time getting the arduino to wake from sleep mode.  Am I able to do this from a full power down?  I have been reading this link. http://www.gammon.com.au/forum/?id=11497  and others.
Comment: Is there a problem with an actual switch? You could store state in NVRAM...
Comment: Yes, I am using a Uno.
Comment: It would also be helpful to know what else are you powering in your project (sensors, modules etc.), their part numbers and their typical and maximum current consumption.
Answer: Since you are using an Arduino Uno board, putting the MCU (the ATmega328P-PU) to sleep won't save you much battery juice. Putting the MCU to sleep won't make a difference because the voltage regulator on the Uno will waste a lot more power than anything else on the board. The ON LED will also draw significant amount of current on that board.
To really save power you should look into getting an Arduino board that has a more efficient voltage regulator, or use no regulator at all by changing your 9V battery by, say, 4 NiMH AA cells.
Here's some more information about the issue for you to look at: What are (or how do I use) the power saving options of the Arduino to extend battery life?
Comment: And the usb-to-serial chip on the Uno will also consume power.
Comment: I will end up moving off the arduino board and just use what is needed down the line.  I have read about this being an issue.
Answer: There is a very good write-up on how to save power, use sleep mode etc, at: http://www.gammon.com.au/power
This includes step-by-step examples of what was done to save power, and how much power was saved, including examples on how to go to sleep and wake back up.


Schengen spouse visa after ban for deception

Question: I am planning to apply for a spouse visa in Europe. 1 year ago I tried to use false documentation to enter Europe out of pressure and desperation and got detained by immigration in Europe. I was told that I have been given a ban in Europe and in any schengen countries. I was not deported and was let free to leave the country voluntarily. Will this have any effect on my future travel to Europe?
Comment: If I were in charge of granting a visa, residence permit or even citizenship in this case, I would be wondering if the relationship is really genuine. Not saying it isn't, but be prepared for a lot of suspicion and checks.
Comment: If you actually have a *ban* from the Schengen area, then yes, that would kind of affect your ability to travel there ...
Comment: @RoddyoftheFrozenPeas unless the spouse is an EU citizen or a national of an EEA country or Switzerland who lives in a country other than his or her country of nationality.
Comment: Well since the asker seems to have disassociated him/herself from the question, I don't think we'll ever know. But the ban would definitely also affect future travels to other countries, such as when applying for visas, and would definitely reflect negatively on their character in the process making it less likely they would receive such a visa in the future.
Answer: There are two entirely different kind of "family" visa.

One is when a family member of an EU/EEA citizen wants to accompany the citizen while the citizen travels under freedom of movement to a different EU country. Those are under EU rules. We can answer questions on those.
One is when a family member of an EU/EEA citizen wants to live with the family in the country of citizenship. Those are under national rules. Questions can be answered on Expatriates stack exchange.

Living with the family is seen as an important human right of the EU citizen (or other resident, but less so). But it is not absolute, and being caught in a lie will certainly hurt.


Why do inert gas have zero electron affinity?

Question: As we know, we have to apply large amount of energy to cause an inert atom lose electron, so in that case, shouldn't its electron affinity be negative?
Comment: Ionization energy has nothing to do with electron affinity.
Comment: The inert gases do have a negative [electron affinity](https://en.wikipedia.org/wiki/Electron_affinity) meaning that the atom has to be in an excited state as well as having an extra electron.
Answer: Clarification is likely required for ionization energy versus electronic affinity. Although the trends of both across the periodic table have some similarity, they are not directly related to one another.
Ionization energy is the energy required to remove an electron (or more) from the element (gaining overall positive charge), while electron affinity is the energy difference (required or released) if an additional electron we're to bind to the element (resulting in an overall negative charge). Inherently then, ionization energy quantifies the difficulty of removing an electron already present, whereas electron affinity is the desire of the element to pick up more electrons; a noble element, for instance, is both "tight-fisted" (holding vehemently onto its electrons already present) and uninterested in further pairing/adding of electrons (is fully satisfied electronically), resulting in large ionization energies and small (e.g. zero or even positive) electron affinities.
Check out this page for more on ionization energies and this page for electron affinities, as they do note noble gases in their discussions.


Is decision tree regression comparable to locally weighted regression

Question: I am new to decision tree method. For decision tree regression model, does it just fit a piece wise step function over data? When and why would people prefer it over some traditional regression like locally weighted (LOESS) regression?
Comment: Yes, decision tree regression outputs are traditionally locally linear, but you can create a model that behaves differently! LOESS is closer to k-NN regression, and shares its strengths/weaknesses. For example, k-NN requires computation of the nearest neighbors, and therefore the storage of the data set for querying. Decision trees are more memory efficient, but only produce locally linear outputs, etc.
Answer: There are two important differences between decision trees and regression:

Decision tree fit a straight a line (mean of the dependent variable for the feature space). Regression fits a sloped line (rise over run).

Decision trees typically do not predict values outside the observed range. Linear regression can predict values outside the observed range.


laser diffraction from a line

Question: Why is the laser diffraction pattern from a line curved when the laser approaches the line with oblique incidence?
Comment: Please crop and shrink the huge photo.
Answer: You can think of the hair as being cylindrical.  In your imagination, scale the hair-sized cylinder up to, say, a half inch diameter.  Illuminate the cylinder with a beam as wide as the cylinder, at the 20 degree angle of your drawing.  Now consider all the directions the light will be reflected into at different points of incidence on the cylinder.  You will see that the reflected rays will be confined to a conical range of angles corresponding to the curve you've drawn.
Comment: Would it still be a diffraction pattern or just a reflection pattern. According to diffraction theory each point acts like a new source and sends spherical wave equally in all directions, not just the reflective angle. Then the two waves from either side of the cylinder interfere constructively or destructively producing the diffraction pattern.
Comment: In the scaled-up scenario I described, if the cylinder is silvered, the resulting pattern will be almost entirely due to reflection.  The curved pattern you see when bouncing light off a hair is due to reflection, even if some diffraction occurs.

laser diffraction from a line


difference of meaning between progressive and simple

Question: If I say "what are you doing now" it means : "have you something planned now "but if I say " What do we do now" could it mean the same thing or as it is present simple does it mean that we are doing  something we do regularly
Comment: But "What are you doing now?" does ***not*** mean "Have you something planned now?".
Answer: What are you doing now? = What activity are you engaging in now?
What do we do now? = Is a question asking for a course of action.
Possible answers can be given using the same tense.
Imagine this situation:
Perry: Oh boy, having our wallets and luggage stolen is the worst thing that could have happened to us on this trip, John. What do we do now?
John: We go to the police station and report it. Otherwise, our travel insurance won't work and we'll really be in trouble.
The use of the simple present is "asking for a course of action" in a specific situation.
Other common questions in the present simple for this type for situation are:
- What do we tell them?
- Where do we go now?
- How do we deal with this?
- When do we respond to this threat?
Answer: No, they don't mean the same thing at all. With what are you doing now?, you're literally asking the person you're talking to what kind of activity they are in the process of doing as you ask them this question (that is, at the moment of speaking).
What do we do now?, on the other hand, is a question where you're asking yourself and your buddies what should your course of action be or how should you proceed with the current situation. So, as you can see, the meaning is completely different. Notice that although you're using the simple present tense, you're referring to things that will happen in the future.
The upshot of all this is that tense-related grammar does not always coincide with the actual grammatical tense of something. When you're talking about things that will happen in the future, it does not necessarily mean that you have to use grammatical structures that are specifically related to the future tense. This is in general very common in English. For example, future events in English can be expressed using present-tense grammar:

I'm going to Paris next week. (this is what you're actually saying: next week I will be visiting to Paris)
You can try and kill me, but still, I'm not telling anything! (this is what you're actually saying: I won't tell you anything)
Comment: So if the question is "what do we do now ?" I must answer  using "will" because this activity has not been certainly planned , my decision has been taken at the time I have been asked the question, I  can answer "I will go to London" but will it  be impossible to answer "I'm going to London " because it has been planned before


Using "eligible" correctly

Question: Is it standard English to use the adjective "eligible" for non-human entities?
Dictionaries seems to suggest that "eligible" should only be used with human nouns.
Comment: Best to add some more detail? Links to dictionary references and a sentence you want to use it in would be nice.
Comment: The question can be made still better by asking whether *eligible* is used for *living things.* Because *a cock* with 'X' pounds or more is eligible for a 'cock-fight'.
Comment: This Wikipedia **[page](http://en.wikipedia.org/wiki/Person)** might be useful. According to the page (Person), "In most societies today, living adult humans are usually considered persons, but depending on the context, theory or definition, the category of "person" may be taken to include such non-human entities as animals, artificial intelligences, or extraterrestrial life, as well as legal entities such as corporations, sovereign states and other polities, or estates in probate."
Answer: Short Answer
There are two entities involved in the concept of eligibility.  One must be human-based and the other may be anything. (1) The entity that creates the rule for determining eligibility must be human or come from human-based systems. (2) The "eligible entity" doesn't need to be human.

Longer Answer
The usage of eligible has the following characteristics:

The entity that is or is-not eligible.
The purpose for which the entity has eligibility.
The rule or condition for determining eligibility.
The person, organization, or social system which determines the rule/condition.

The entity does not need to be human.  Store items purchased may or may not be eligible for return and refund.
However, a "human" or some "group of humans" (or in fiction, some intelligent agent) must determine (or document how to determine) if the entity is eligible for the purpose. The person, organization or social system that determines the rule or condition for eligibility is always ultimately related to a human based choice/determination - either directly or indirectly through a social convention, a contract, a policy, or a law. The only exception would be anthropomorphic perspective, AI, sci-fi, etc.
So a corollary to this would be that you could not have a sentence that uses "eligible" with absolutely no human basis.  So pure natural-science, physical systems are not eligible to be described in terms of eligibility.  Also, animals interacting with nature would not be described with eligibility.

Exceptions
Some limited/narrow exceptions could be made for metaphors based on a social animal related to the social system of the species:

OK: Eligibility of an animal to mate depending on social status.
Not OK: A squirrel knowing it's not not eligible to step on a tree limb because the limb won't support it's weight.

Also, anthropomorphism can be used, but the result is still a matter of endowing non-human things with human qualities:

The little rock wished that it would be eligible to enter the race.  The mountain said, "all rocks larger than an acorn but smaller than a bear may enter the race."  "Oh joy!" said the little rock, "I'm eligible to enter the race!" And at that moment, the little rock started tumbling down the mountain.  Faster and faster, rolling at such a rate the little rock was getting dizzy!  And then, all of a sudden, the tumbling stopped and was replaced with a great wind.  "I'm flying!" said the little rock with sandy rock-tears of joy...

Also, technical fields will borrow words and use them outside their standard usage. So it might be found in something like (I'm making this up) a quantum physics particle being eligible for attachment to a molecule due to a required spin.  But this is exactly what I'm saying is not how eligible is used in standard English.

Justification for this answer.
This answer was largely based on original research.  The conclusion that humans must be involved in creating the eligibility rule is based on me not being able to find any examples to the contrary after a large variety of searching on google, google ngram, and corpus searches.
Furthermore, if one could use "eligible" for a completely non-human, natural physical world context, then one would expect to find some examples such usage.  Yet the following google searches come up with practically nothing:

"the earth is eligible to"
"the sea is eligible to"
"the water is eligible"
"the atmosphere is eligible"
"the bear is eligible to eat"
""the dog is eligible to eat"
"dogs are eligible to eat"

Please feel free to add a counter example in the comments, if you can find one! (It must be an example of real usage by someone other than yourself!)
Answer: In the definitions here the one that might have non-human application would be:

1) fit to be chosen; legally or morally qualified

which could refer to a non-human entity, as it does not specifically refer to humans.
Comment: Just thought you might be interested in my answer to this question. Feel free to comment!
Comment: @CoolHandLouis Yes its a good answer. This is basically what I was trying to get at in some of my other comments (what's eligible vs. who decided it was eligible). +1
Comment: Do you still think your definition might have a non-human application?  If so, do you have an example sentence?
Answer: Yes. The word eligible can be used for living beings other than humans and also for non-living things. Though it's interesting that the word is mostly used for living beings especially humans. +1 for the question :)
Here I found the authentic sources using eligible for the context in concern:
Eligible for non-living thing

Under the three definitions, a school is eligible to participate in all the FSA programs provided the school offers the appropriate type of eligible program - Institutional eligibility for Federal Student Aid Program.

Eligible for living being other than humans

Check out On Tap's official list of rules to see if your dog is eligible to participate - NBC Washington
Comment: But a school is an organization made up of people, right? As for the dog, does it decide its eligibility, or does the owner?
Comment: @user3169 there you answered! **an organization** is a non-living thing. Also, the question is whether the word is used for the humans not *who decides it!* If the latter is the case, everything connects to humans one or the other way.
Comment: @user3169 better examples for your concern - *This container is **not eligible** to get on board. It's much heavier than the vessel can carry - no human deciding the eligibility.
Comment: For example, in the case of the Korean ferry Sewol, it has been shown that the ferry was frequently overloaded. It capsized because humans apparently made the wrong (eligibility) decisions regarding its cargo.
Comment: @user3169 they are the humans who made words and that way the word *eligibility* will include human one or the other way. A *cat* does not jump on a small log in the river. It **does** know that due to her weight, she's not eligible/fit/okay to get on. *Still...another one for your concern!* -*The earth is not eligible to tackle a sun-sized meteorite falling on it* - no human again. haha. Thanks for getting me opportunity to think more and more! :)
Comment: In your example "The earth is not eligible to tackle a sun-sized meteorite falling on it", which definition of "eligible" are you using?
Comment: let us [continue this discussion in chat](http://chat.stackexchange.com/rooms/14565/discussion-between-maulik-v-and-user3169)
Comment: Sorry I missed your last comment. Anyway I broadened my thinking a bit and concede there can be such usage. I revised my answer accordingly; I wanted to leave the definition in as a reference to what might have non-human application.

Using "eligible" correctly


How can you identify the geoprocessing tool that was used to create a layer in ArcMap?

Question: In my Table of Contents, I have a layer that is named "symmetrical differences" but I am not certain it was created using that tool.
Comment: Did you check the metadata? Geoprocessing history can be stored in the ESRI metadata (i.e. the "Item Description" tab in catalog.
Comment: When was this tool run and the layer created?  If the tool was run recently you may be able to find the tool used in the Results window ( Geoprocessing > Results ) and from there you can see what parameters were used and where the output was saved etc...
Answer: The geoprocessing history is often included in the metadata of the item, and it is also logged in the geoprocessing results window. More info from ESRI here
Answer: I found this on the ESRI website...

Whenever you execute a tool using its dialog box or in the Python window, information about the execution is written as a result in the Results window. You can learn more about the results window from ESRI's help page

Here are a few helpful tips to keep in mind as outline by ESRI.

There are a number of useful things you can do with results in the Results window, such as

<code>Open a previous execution of a tool to change a few parameters without having to reenter all parameters, then rerun.
Create a geoprocessing package or geoprocessing service.
View the status and messages of a tool executing in the background
</code>
Here is a breakdown of the Results window
Comment: If they ran the tool recently then it will definitely be there, for some reason my results will only show results for the past month (so if the tool was run before then it wont be there.)  Someone has shown how to keep results for longer I just can not for the life of me remember.  Fingers crossed they ran the tool recent enough its still in the results window!


Natural log of 2 in Radioactivity half life?

Question: How exactly was the half life equation $\frac{ln2}{\lambda}$ derived? My book states something about integrated rate laws but doesn't really explain anything.
Sorry, this is my first post in Physics stack-exchange.
Thanks!
Comment: Do you know any calculus? [Wikipedia](https://en.wikipedia.org/wiki/Exponential_decay) explains the relation between mean lifetime and half life, but you'll need to be familiar with the derivative of the natural exponentiation function.
Comment: Its mathematical derivation comes from the rate law for the radioactive decay
Comment: It involves integration of the first order rate law, hence called integrated rate laws..
Comment: If we were interested in "third lives" rather than half lives then the equivalent expression would involve $\ln 3$ instead of $\ln 2$.
Comment: My answer shows the integrated rate law, mentioned by Sidharth.
Answer: Welcome to Physics Stackexchange.
The empirical formula of reaction rate for equation: -
$$aA+bB\rightarrow cC+dD$$
can be represented as, $Rate\rightarrow k[A]^{m}[B]^{n}$ where proportionality constant $k$ is called rate constant, and $m+n$ is called reaction order.
Consider a simple first order reaction, $A\rightarrow B$
$$\text{Rate}\Rightarrow k[A]^{1}$$
$$-\frac{d[A]}{dt}=k[A]$$
$$\int_{[A]_{0}}^{[A]_{t}}\frac{d[A]}{[A]}=-\int_{0}^{t}kdt$$
$$\ln\left (\frac{[A]_{t}}{[A]_{0}}  \right )=-kt$$
$$[A]_{t}=[A]_{0}e^{kt}$$
In order to calculate half-life the concentration has to be halfed. Let,
$$[A]_{t}=\frac{[A]_{0}}{2}$$
$$e^{-kt}=\frac{1}{2}$$
Solving the above equation for $t$, you get
$$T_{1/2}=\frac{\ln 2}{k}.$$
Does that look familiar?
Let me know about any queries in the comments below :)
Comment: Thanks! I take reaction rates are dependent on concentration of reactants and products then?
Comment: Yes, Rate of reaction = Change in concentration/Time
Comment: Each reaction has its unique rate of reaction equation which are determines empirically and k is affected by various factors, including environmental conditions.
Comment: @Prograxer The given rate law is basically equivalent to the assumption that a reaction that requires $n_i$ of each species $i$ has some probability of occurring when those components are in reactive-distance, which each particle has an equal likelihood of being in at any given moment.  Since this tends to be a pretty idealistic mechanism, it's common to describe retreats from it using [activity coefficients](https://en.wikipedia.org/wiki/Activity_coefficient).  When activities are an insufficient remedy, we typically have to do more simulation-like calculations.
Comment: Is k affected by environmental factors or is unique to each set of reaction?
Comment: @Prograxer Still, we typically regard nuclear decay as relatively unconcerned with chemistry.  The idea's that whatever's happening in the nucleus doesn't tend to be too concerned with what's happening in the electron orbitals, much like we typically don't expect to observe nuclear reactions when doing normal chemistry.  Wikipedia discusses it [here](https://en.wikipedia.org/wiki/Radioactivity#Changing_decay_rates).
Answer: In terms of half life $\tau$ the number of undecayed nuclei after a time $t$ is given by $N(t)=N(0)\left(\frac 12\right)^{\frac t \tau}$
In terms of decay constant  $\lambda$ the number of undecayed nuclei after a time $t$ is given by $N(t)=N(0)e^{-\lambda t}$.
Equating gives $\left(\frac 12\right)^{\frac t \tau}= 2 ^{-\frac t \tau}=  e^{-\lambda t} \Rightarrow  \ln  (2^{-\frac t \tau} )=  \ln (e^{-\lambda t} ) \Rightarrow -\frac t \tau \ln 2 = -\lambda t \ln e \Rightarrow \tau \lambda = \ln 2$
Update as the result of some comments.
In general the half life or the decay constant relating to radioactive decay are not affected by any chemical or physical changes because the energy scales involved in such processes are so much smaller than those involved in reactions involving the nucleus.
The relationship $N(t)=N(0)\left(\frac 12\right)^{\frac t \tau}$ can be written as $N(t)=N(0)2^{-\frac{t} {\tau_{1/2}}}$ where $\tau_{1/2}$ is the half life, the average time it takes $\frac 12 $ of the unstable nuclei to decay.
The relationship $N(t)=N(0)e^{-\lambda t}$ can be written as $N(t)=N(0)e^{-\frac{t} {\tau_{1/e}}}$ where $\tau_{1/e}= \frac 1 \lambda $ is the average time it takes $\frac 1 e$ of the unstable nuclei to decay. ($\frac 1 \lambda$ also is the average lifetime of the unstable nuclei.)
What I hope that you can see is that bases $2$ and $e$ have been chosen although any base could have been used eg $N(t)=N(0)7^{-\frac{t} {\tau_{1/7}}}$ but those other bases would not have been as "user friendly" as the choice of $2$ and $e$.
Answer: The fundamental assumption is that a radioactive particle is as likely to decay at any moment as any other.  And that's it.  There's no more physics involved – no more assumptions, no more laws, nothing!  It's just math after this.
So, if we have $n$ radioactive particles, then the number decaying, $-\frac{\mathrm{d}n}{\mathrm{d}t} ,$ is going to be proportional to the number of radioactive particles:
$$
\underbrace{-\frac{\mathrm{d}n}{\mathrm{d}t} \phantom{-}}_{\text{loss rate}}
~{\propto}~n
\tag{1}
\,.$$Then the math's:

Rewrite $\operatorname{Eq.\,}\left(1\right)$ as$$
\frac{\mathrm{d}n}{\mathrm{d}t}~=~-\lambda n
\tag{2}
\,,$$where $\lambda$ is just a proportionality constant.
Solve $\operatorname{Eq.\,}\left(2\right)$ using WolframAlpha, finding:$$
n~=~c e^{-\lambda t}
\tag{3}
\,.$$
Define $n_0$ at the number of particles at $t=0 ,$ such that$$
\require{cancel}
n_0
~=~c e^{-\lambda \cancelto{0}{t}}
\qquad
\Rightarrow
\qquad
n_0 = c
\,,$$which basically just means that we can describe $c$ as $n_0$, which is more useful since $`` c "$ was just an arbitrary constant while $`` n_0 "$ has a useful physical interpretation, allowing us to rewrite $\operatorname{Eq.\,}\left(3\right)$ as$$
n~=~n_0 \, e^{-\lambda t}
\tag{4}
\,.$$
Rewrite $\operatorname{Eq.\,}\left(4\right)$ in terms of the ratio of particles remaining at time $t$ as$$
\frac{n}{~n_0} ~=~ e^{-\lambda t}
\tag{5}
\,.$$
Find when half of the particles have decayed,$$
\frac{n}{~n_0}
~=~ \frac{1}{2}
~=~ e^{-\lambda t}
\tag{6}
\,,$$then solve for $t$ to find$$
t
~=~ -\frac{\ln{\left(\frac{1}{2}\right)}}{\lambda}
~=~ \frac{\ln{\left(2\right)}}{\lambda}
\tag{7}
\,.$$
And that's it!

The main point I wanted to make here is that this immediately follows from the assumption that radioactive decay is as likely at any moment as any other.  After that, it's just some math.  No need to use any empirical correlations or anything.
Of course, if you find some physics that suggests that particles become more or less likely to decay over time, then you'd just have to rewrite $\operatorname{Eq.\,}\left(1\right)$ as$$
-\frac{\mathrm{d}n}{\mathrm{d}t}
~{\propto}~
\left[
\begin{array}{c}
\text{whatever the physics} \\[-10px]
\text{you discovered says}
\end{array}
\right]
_{,}$$then redo the math.


Can producer find the additions and removals of brokers in Kafka 0.8?

Question: We knowthat, in kafka 0.7, we can specify zk.connect for producer, so producer can find the additions and removals of broker. But in kafka 0.8, we can't specify zk.connect for producer. Can producer in kafka 0.8 find that? If not, the scalability of the system is not worse than the 0.7 version?
Answer: You can still use a ZooKeeper client to retrieve the broker list:
ZkClient zkClient = new ZkClient("localhost:2108", 4000, 6000, new BytesPushThroughSerializer());
List<String> brokerList = zkClient.getChildren("/brokers/ips");

According to that, you do not have to "hardcode" the broker list on client side and you are flexible as far as the system architecture is concerned. But anyway, this would add the ZooKeeper dependency again which is in fact an disadvantage for producer in several environments.
If you want to get a detailed view to the so called "cluster metadata API" solution, check out this link: https://issues.apache.org/jira/browse/KAFKA-369
Best
pre
P.S.: Sorry for reposting this to your other question - but the answer fits on both ;-)
Answer: Little confused what exactly you are looking for, in 0.8 we must specify the list of brokers in the metadata.broker.list property
    Properties props = new Properties();
    props.put("metadata.broker.list", "broker1:9092,broker2:9092");

from the kafka consumer example they say

The property, "metadata.broker.list" defines where the Producer can find a one or more Brokers to determine the Leader for each topic. This does not need to be the full set of Brokers in your cluster but should include at least two in case the first Broker is not available. No need to worry about figuring out which Broker is the leader for the topic (and partition), the Producer knows how to connect to the Broker and ask for the meta data then connect to the correct Broker.

By saying additions do you mean adding new node to your cluster ?


SDL. Current music position

Question: I load my music track using SDL_mixer function:
<code>Mix_Music * SDLCALL Mix_LoadMUS(const char *file);
</code>
For synchronization with video I need to know current music position.
How can I determine this?
Answer: SDL doesn't seem to expose an easy hook for what you want.  Once you trigger Mix_PlayMusic you have a hook to be notified when the music is done playing with Mix_HookMusicFinished, but that's about it.
You could use a completely independent clock mechanism for the video, and trust that the timing is going to "just line up" (e.g. if it's a 4 minute song, it will be done playing exactly 4 minutes after you call play).  But since I doubt you're developing for a Real-Time OS, the results won't be ideal.
It might be possible for you to install a hook via Mix_SetPostMix.  The "effect" you'd install wouldn't actually be for modifying the audio stream, but just keeping tabs on how many samples have been played and do corrections to the video accordingly.  (Just thinking out loud here.)

SDL. Current music position


Why does my cat never like to be picked up?

Question: I have a 2 year old neutered male house cat. Had him since he was 10 weeks old.
He has never liked being picked up - no matter how gently we do it. He does not like being petted very often either, and if you do, after 2-3 times, he bites you very hard.
I scold him but never hit him when he does that, just leave him alone. He almost never will sit on my lap.
He does follow me around the house a lot. He gets toys, treats, very good soft and dry food, fresh cold water daily.
He never lets me hold him for more than a minute, except when he is at the vets, and I'm sure that is because he is terrified!
I love him, talk to him, and my husband and I play with him with his toys.  We have never let him outdoors. I was thinking if we did occasionally would he be less aggressive and happier? But we live in the country and scared he could get hurt, etc.
Answer: Try to determine whether the cat is in pain.
Sometimes it's the case that petting is aggravating some sort of unseen medical condition, causing them pain, and so their response is to lash out at the person petting them.
 Usually pain is specific to some area, and so very cautiously trying to pet him in various areas can tell you if maybe the cause is pain. If the cat very obviously hates it when you touch him in some particular area, you should take him to a vet to have this checked out. A common cause of this sort of problem is arthritis, which even young cats can have.
Keep in mind, not all cats like being handled.
If medical conditions have been ruled out, then it's simply just a case of some cats are less receptive to being handled than others. Your cat clearly is still trying to socialize with you, since he's following you around the house. He just might not be the type that likes being touched too much, and if such is the case, he's never going to be a cuddly cat. But you may have some success with slowly acclimating him to more handling:

Start small.  If your cat really only accepts one or two pets, then start off with just doing that, maybe once or twice a day.
Reward him.  Every time you have an interaction, give your cat a treat.
Go slow.  Keep this up for maybe a week, and then maybe it's time to very slightly increase the interaction, say one additional pet.
Keep an eye on his response, and let that be your guide. If you notice your cat shows any signs of stress or tenseness, cut your session short.  Signs include ears even slightly laid back, twitching skin, or the tail twitching more intensely than before. If your cat actually attempts to bite or scratch, then in the next session, take it back down a notch or two.
Do not reprimand him for biting or clawing. In this case, your cat is not biting or clawing in order to misbehave, but because he doesn't like what you're doing, and he feels he has no other way to tell you to stop. Therefore trying to reprimand him is both ineffective and counterproductive. You want to make him enjoy or at least accept being handled, rather than seeing it as a bad thing.
Be happy for the progress you make, and accept him for the cat he is.  As I said, your cat is surely never going to be a cuddle bug, but you can still have a rewarding relationship with him, and not force him to do more than he's happy doing.
Answer: To add a few points to Kai's excellent answer.

I was thinking if we did occasionally would he be less aggressive and happier?

I don't think that will make a difference. Possibly the more the cat is indoors the more he will be used to you, which counts in your favour.
To combat what you see as potential boredom:

make sure he has scratching posts, or something that serves as such.
play games with him. I find games where they have to catch something you dangle or flit across the floor are good.
an outdoor run may also help give him the outdoors with safety. They can even be run as a tunnel from a cat door that you can close at night.

Ultimately, the best way to get a cat to cuddle with you, is to sit still or lie down. Cats will come to people when they are quiet and don't move. Mine seem to enjoy it most when I am trying to use a computer. When you are totally ignoring them and are focused on something, how often will they try to intercept the object of your attention! A bit of humour, but some truth.
I'd try Kai's suggestions. I hope he becomes more smoochy.
Answer: I adopted a cat, Ms. Nibbles, that had not been socialized very much as a kitten. She enjoyed play, but seemed unreceptive of 'hands on' interactions.
I had a hairbrush of the sort used with blow-dryers, the kind having relatively few stiff bristles, each capped in a small sphere. Miss Nibbles enjoyed being brush with this, so each day I would geantly brush her, every once in a while allowing the edge of my hand to drag along with the brush. Over time, and as she became more receptive of them, these hand-strokes became more common. She was never a cat to put up with extended petting, but short petting sessions became just fine. The important thing is that these brushing/petting interactions were frequent (at least a couple times each day) and I never -forced- her to be petted. I always desisted the moment she showed any sign of enough. The cat told me how much was OK.
I took a similar approach to, and ultimately achieved even greater success with winning her over to being carried. I starting with very short lifts, where I set her down almost instantly, each lift ending in something she really enjoyed such as being placed next to a dab of wet food (or catnip), lifted to a sunny windowsill, or placed next to a favorite toy for play time. As she came to realize that EVERY TIME she was picked up it would end in something she loved, she grew increasingly tolerant of it. Yes it took time, but eventually one of her favorite activities as an elderly cat was to go 'exploring' with me, where I would carry her from cupboard to cupboard, opening the doors and letting her inspect the things inside. She would lay in my arms just peering and purring, purring and peering. Miss Nibbles died of cancer a few years ago, but as I describe these activities it is surprising me how much I miss her still. She was such a good cat.
Every cat is different and I can't promise that this approach will work for you. All that I can say is that it worked for me and that I hope the same for you. Cheers.
-Science_1


What is the simplest way to find the distance of stars?

Question: Once, I was staring at the sky and wanted to know the distance to stars I could see. I searched the Internet but didn't find any easy to use tools. The distance to stars can be measured using sophisticated instruments. But are there any simple ways to measure the distance of a star approximately, using the least instruments possible? Accurate distance is not necessary, but rather an approximate value to get a feel for the distance.
Comment: https://en.wikipedia.org/wiki/Cosmic_distance_ladder
Answer: If you are patient and the star is close enough you can use parallax. The idea is that close objects shift positions with respect to the background when the observer moves. A very intuitive example is: extend your arm and look at your thumb. Now close one eye at the time and see how the position of the thumb changes! You can actually calculate the distance from your eye to your thumb my measuring how much it shifts and the distance between your eyes, it is very simple (see below)
The caveat here is that the longer your arm, the smaller the shift against the background. So for a star closing an eye of the time is not gonna cut it, instead you have to move a large distance to see it shift around. The longer distance you can move is by waiting six months (hence the 'be patient' part).
If you know the diameter of Earth's orbit (the equivalent to the distance between your eyes in the example above) and how much the star shifts w.r.t to the background (angle, $\theta$) stars then you can figure out its distance
$$
d \approx \frac{{\rm 1} \text{AU}}{\theta}
$$
Where 1 AU (149,600,000 km) is the average distance from the Sun to the Earth.
Comment: This cannot be done (for stars) without sophisticated instruments.
Answer: There are simple methods to compute distances between stars (the simplest being simply the parallax method), but none will work without sophisticated instruments. That is why nobody managed to compute the distance between stars until the 19th century, as we did not yet have instruments precise enough to perform such a calculation.
What you can do relatively simply is compute the distance of the moon. As this was performed in $\approx 300\ \text{BCE}$, you do not need any too complicated instruments. There are two methods for this, the first one being the method of Aristarchus, by using various relations from the shadow of earth projected on the moon and angles between the sun and moon (more details here for instance), and the second is the parallax method used directly, as used by Hipparchus, although this one takes a bit more coordination.
The Hipparchus methos is the following : look at a solar eclipse in two different locations $A$ and $B$. If you note that, at the very same moment, the moon completely covers the sun in $A$ while it only covers a fraction of it at $B$, then you can compute the angle formed by those two locations and the sun, as a function of the sun's angular size and this fraction.
From there, it is simply a matter of trigonometry, since you have the distance between the two locations $A$ and $B$ and the angle $\alpha$ at the top of this triangle (since the distances involved are very long with a very small basis, we can assume that both sides of the triangle are roughly equally the distance to the moon).
Of course, this requires the ability to see the event in both location (either by your ancient greek friends in other locations or a webcam).
If you wish to perform the same measurement for stars, I'm afraid it will be much harder. The parallax trick will also work, by measuring angular coordinates of the star 6 months apart (so that the earth is at its two different locations $A$ and $B$), but it may not work unless you have rather good equipment.
Comment: Astronomers were making reasonably precise calculations of the distance to nearby stars before the 19th century, but they could only express those distances as multiples of the _astronomical unit_---the radius of Earth's orbit around the Sun.  The big breakthrough in the mid-19th century was not a sudden leap in the quality of their instruments: it was the invention of a way to accurately relate the astronomical unit to a distance measured on the face of the Earth.   https://en.wikipedia.org/wiki/Transit_of_Venus