How do I make sure my electronics design is good from manufacturing perspective?

Question: I am a beginner in electronics design. I have some experience with fairly complex PCB design. I want to design a product that will hopefully sell a lot. How do I ensure that the design is inexpensive from manufacturing perspective? I mean not for a single PCB fabrication but for mass production. I use commonly found microcontrollers like atmel, Texas instrument. Is this the way to go for mass manufacturing?
Comment: Minimize part cost. Minimize BOM count. Minimize assembly time. Minimize, minimize, minimize.
Comment: Test time costs money also. If you can plan ahead and incorporate a test strategy at design phase that minimizes test time, that will help.
Comment: Voting to re-open because although it's not possible to answer the question completely we did get several good answers and 30 upvotes on the question indicate this is a type of question the community does want to see.
Comment: I think this might make a good Community Wiki if there's not already one on this subject.
Comment: get more out of less, as Igancio says. Half of designing a product is parts procurement - you can spend a LONG time putting together a list of supppliers and useful parts that are cheap and available for production quantities that you want.
Comment: Several EEVblog entries: https://www.youtube.com/watch?v=VXE_dh38HjU http://www.youtube.com/watch?v=Uemr8xaxcw0 and https://www.youtube.com/watch?v=2zGisPMNstI
Answer: There's a thousand things to consider to reduce manufacturing costs, but some of the important ones are

Build in high volume. This spreads the set-up costs for a batch across more units. You'll find, for example, that the cost of board blanks drops extremely fast as you increase the batch size.
Negotiate your component costs. List price is just a starting point for negotiation. And once you've started buying in volume and your vendors know you're serious (and not going to need more support), go back and negotiate again. (To have a stronger position, design in multi-sourced components wherever possible)
Reduce process steps. For example, via-in-pad plated-over adds steps to board manufacturing, and mixing SMT with through-hole components adds steps to assembly.
Reduce the number of lines in the BOM. This reduces effort for purchasing and increases the volume you're purchasing for each part number. For example, if you have both 49.9 and 51.1 ohm resistors, check if you can just make them all the same value. Or, if you have 3 linear regulators with different output voltages, use the same adjustable type for all of them instead of 3 different fixed-output parts.
Design in as much tolerance as you can. For example, don't use 4 mil tracks if you can use 6 mil tracks. Don't specify +/- 10 mils on the board size if you can live with +/- 25 mils. Etc. The looser your tolerances, the better your yield. Even better, if you can make a tolerance loose enough, you might even eliminate the need to test it in final test.
Make your boards smaller. The more boards that fit on a standard panel, the lower the material cost.
Design in testability. This might mean adding test points for a bed-of-nails tester or it might mean making the design able to test all necessary features by itself (BIST).
Use standard processes rather than exotic ones: hot-air solder level instead of gold plating, through vias rather than blind vias, green solder mask rather than red, etc., etc.
Comment: Minimize BOM, if you use many 10k resistors on board and need one 5k, just use two 10k in parallel. If you use many 1k and need 2k, use two of them in series. If you use some 1k and need 470 ohm for LED, use 1k for LEDs as well.
Answer: Already some great answers here so I'll just add a few more things.

Work closely with your assembler and your pcb fab house, they often provide dfm (design for manufacturing feedback) that will help you understand how to change your product to be easier for them to manufacture.  The higher you go in volume the more concerened you will be about every little thing related to yeild.
Minimize assembly operations.   Can you get away with all surface mount components on a single side of your board?  Adding the second side is another operation for assembly, they have to go back through the line, maybe in carriers cost will go up.
Component selection, that tiny QFN part sure is cheap, oh but turns out it costs me slightly more in assembly because it's harder for the cheap guys I'm using.   This through hole connector is cheaper than the surface mount version, but using it means your board has to go through another step at assembly, wave soldering, so your cost goes up.
HASL is a cheap surface finish but it doesn't have the shelf life of a silver immersion or gold ENIG. At really high volumes you may be buying boards in bulk and using them over serveral months.  If half your boards become scrap because of oxidation you're not saving any money.
Comments about minimizing test time are on point, time is cost, and testing takes time.  At moderate volume you maybe doing in circuit or clam shell testing.  At very high volume there's no time or money for that.  You'll likely be only doing FVT, a functional test of your circuit at the end of the line.  Bad boards just go in a pile, that may or may not be looked at later.   So long as yield is acceptable you just want to keep the line screaming.
PCBs in addition to what was already said keep in mind that pcbs have several cost factors.  Obviously size is related to cost but so is waste.  Boards are made in panels so you to maximize your usage of the panel, wasted material is just that waste.  Also your fab house has a list of things that are standard, and things that are doable but cost more.  That tiny via sure is attractive but maybe it costs less to use one 2 mils bigger.  You should check with them.  Tiny trace widths are great but when moving to a high volume shop it may cost less again to me just 1 or 2 mils bigger.
Layer count is also a big discussion point 2 layers is cheaper than 4, but is it?  If you're doing digital logic and I/O above say 1Mhz you may find that the added cost and time required to pass EMI negates your savings.   I haven't done a 2 layer board in years on million unit plus designs.   However I have done them, and in my case using a spread spectrum clock was a life saver for emmissions.  There are definitely some board where 2 layer is more appropriate, but I'm a 4 layer advocate all the time.
More on component selection.  I liked the answers that talk about second sourcing, and thinking about the decision to use a cheapo part vs something more reliable.  The interesting thing to know is that the good price is often hidden in various ways.  By pushing researching and working you can find much better pricing.  Not sure where you're located but compaines here in the US seem to like to give us higher pricing then when I get it quoted in China.  Often there are parts only marketed to the China market that you have to find out about to even get pricing.  I once had a company come in and present their line of products, then I started asking them about what turned out to be China only products.  They stopped, asked me how I knew about them, then closed their presentation and opened a whole new one about their much cheaper parts not sold in the US!
Negotiate, if you have volume that first price is not the price :)  Probably the third or fourth price is the right price.  We just went from $10 to $2 on a part just by saying, no I'm going to go with your competitor on this one (which would have been true).  At some point though keep in mind if the parts are equal in value to you?  If you're getting more reliability and support perhaps a few cents is worth the cost?
Advice.  I'll assume you're not a giant corporation with deep pockets and a marketing team already hyping your product?  That you're more of a one man startup at this point.  I'll give you the best piece of advice I ever got about building to scale when  starting a company or new product.  Don't.  Focus on what it will take for to get one customer, or ten.  Build for that.   Then get your next ten, your next hundred, and scale with your customer base.   For us engineers making the product isn't the hard part it's getting a customer.  If you find that you can only sell your product if you had the price you get at volume... perhaps that's the wrong product to start with :)  here's a great article on that
Comment: Your point 1 is very valid. The best person who knows how cheaply they can make the device is the person making the device. Use that.
Comment: Great answer +1. Thanks a lot for the link at the end, it was quite inspirational and informative.
Answer: One point that is often underestimated by engineers is finding a second source for all components. Not only for price negotiations, as @The Photon (in his great answer) mentioned, but also to make sure you don't have to throw away PCBs if one of your components isn't sold anymore, or get into problems if there are unforeseen delivery/supply problems. For diodes etc. that's rather easy, but also try to find pin-compatible voltage regulators, if possible even pin-compatible microcontrollers from another manufacturer.
If you have different versions of your circuit, e.g. NPN/PNP output, different interfaces, voltage versions, etc. it is usually cheaper to create one PCB for all versions then to create a PCB for every version. You can then assemble only the parts needed for a specific version.
If you have some space left on the PCB (e.g. if you have given mechanical dimensions for the PCB) then you can add footprints for EMC protection like TVS diodes or decoupling capacitors.
Comment: Relatedly: I've seen a lot of boards use 'flexible' part footprints to allow for substitutions. [For instance, this Arduino is laid out to use either a QFN or SOIC package.](http://i.ebayimg.com/00/s/MTYwMFgxNjAw/z/BlwAAOSwVFlUDaca/$_57.JPG) (from http://www.ebay.com/itm/111472445403)
Answer: One hint I got from our assembly company (actually from the boss of a 5 people company, always having a talk with customers):
We had a board with 24 "euro DIN connectors". They are like standard pin headers with 2x16 or 3x16 pins.
The board was wave-soldered and the connectors were pulled over the wave in parallel, i.e. all pins of a connector were soldered at the same time. Due to this, the liquid tin cooled down locally, and the risk of bridges between the pins increased. If the connectors are pulled over the wave perpendicularly, the risk is much much smaller.
In our case, we had about 26 boards and they reworked them by hand. But on larger scale, you would not do that, and it would lower your yield.
Typically, a board is pulled over a board with the short side ahead, so it would be nice if parts like long pin headers are in parallel to the long sides.
Answer: Decide the quantities your board is going to be built, the geographical region and use appropriate parts and materials for those conditions.
You can have a board made in China in large quantities with a "US" or "European" design, but it will not be optimal. It's better if you use parts that are widely available and cheap in that market (which may mean using older generation parts, using parts that are common in consumer products or quit modern parts you're not familiar with and have no English datasheet because the manufacturer has no interest in selling less than 50,000 pieces at a time). You may choose to use a punched paper-phenolic board for part of the design and a fancy multilayer board for other parts.
In large enough volume, forget about second sourcing, the only important thing is how far you can screw the costs down. The product can always be redesigned. Engineering time is free, relatively speaking. You may have to use weird microcontrollers with unwieldy development systems to save a few pennies, on the other hand you may find it makes sense to negotiate a very low price on a higher end micro so you can take advantage of open-source software and speed up the development. Costs become a lot softer when volumes get really large- I recall it was possible to get a very impressive DSP for about 1/20 the 100's price at Digikey because the manufacturer was motivated to break into that market and the total amount of money was still attractive to them. They may even provide the software.
If the volumes are not huge, you have to be concerned about the longer term availability of products (look at track record as well as price), spreading risk by using multiple suppliers etc. Be careful about locking into technologies that are associated with highly volatile or fad products. Six months might be a long time in the life of some products.
Don't succumb to temptation and use low quality components- rebuilding a reputation is very expensive. This applies especially to electromechanical parts. Make sure any required safety agency approvals are genuine and current. Be sure to use appropriate suppliers for assembly- if you have a one-time order of 20K pieces, you're not going to get a top-tier supplier the slightest bit interested unless there is some really convincing story there (involving future business and minimal risk of embarrassment), and saving money on a cut-rate assembly house may really hurt when you see the results. If the components might involve patents be sure to verify that the required licenses are in place and royalty payments are up-to-date.
Comment: @ScottSeidman Especially if the product life is measured in months. I recall seeing a graph for a commercial (telecom) product (not a consumer product) where you could see that almost any expense for engineering was justified if it could be brought to market earlier by a year or two, and if it run later by a similar amount there's no way it would ever make money.
Comment: The only part I can't agree with is engineering time being free-- even "relatively speaking".  Once a product is out of the R&D portion of its life cycle, reforming an engineering team, especially once the original team has scattered to the winds, can get very expensive.  There are a variety of studies that show how a comprehensive design strategy can save money over an "over the wall" design approach -- and even an over the wall approach is less dramatic than leaving R&D and starting it up again later.
Comment: @ScottSeidman I agree it's arguable. On something like a power supply the cost of an extra diode per unit can easily add up to the salary of an Engineer (especially in Asia) and everybody seems to use ASICs that are not second sourced, so it's certainly true in context. The opposite attitude (that Western engineering salaries are free even with limited production) is probably more prevalent so your constructive criticism is valid.
Comment: It would also have to do with the cost of money associated with any time delay.  If you're a mature company with a big product line, a few weeks here and there can be eaten.  If you're a new company with nothing to sell waiting for a production run, those fore weeks can be the difference between life and death.
Comment: I suppose that's way the cost of money is well represented in the Fundamentals of Engineering exam for US credentialing.
Comment: @ScottSeidman, for most consumer companies if you miss Christmas, you are screwed. If you delay a few weeks in March, you might be able to make it up later. But as time goes by, delays become much more significant. There will certainly be cell phones ringing in the middle of the night if the line goes down during mass production.
Answer: Defensive design applies to all phases of the product lifecycle.
These are just some of the phases your product might encounter:
prototyping
Leaving extra pads for different-value components is good, during the early phases of a prototype. However, as your design nears completion, the board should start to look exactly like the "mass produced" one. This can be especially important for high-frequency or high-power circuits where the shape and size of the copper on a PCB is just as important as the things soldered to it. Don't forget to do a small run of boards using exactly the same layout and component as your large-scale production run.
manufacture
As mentioned you should take manufacturing processes into account. This also applies to multi-layer PCBs, especially the interior layers:
The copper is etched away with a solution, which must then drain away before the next layer covers it up, otherwise you'll have etchant trapped inside your board. This is terribly hard to debug later, because it's completely invisible and might not fail right away.
So, when you are laying out the interior layers of a board, avoid pockets or dams that might trap liquid etchant and prevent it from draining properly.
shipping
How many times does the design change hands during the build process? If one company makes circuit boards, another stuffs components, and a third puts the finished board assembly into an enclosure, minimize the chance of failures due to repeated packing and unpacking. This can mean things like

Use lower-profile connectors (short lever arms are harder to snag on bubble wrap)
Give the assembly technicians something to grab on to, so they don't pick up the board by something that might break off.
Make it easy to wrap. Rectangles are easier to wrap than other shapes, which means they'll be more likely to arrive safely to the next destination.
Answer: All good answers here already. Just to add my 2c on designing for debug/repair.
It's a fact of life that there may be some units that are RMA'd from downstream (internally or externally). Just as it is good to make a unit easy to assemble it is also good to make it easy to disassemble a unit so as to reduce the turn around time for such RMA'd units.
Examples of design decisions here may include taking a balance on using smaller SMA components, as the tiny ones are of course harder to manually handle and place when all the other components are already in place. Similarly placing things packages too close together may lead to heat damage with them when removing and replacing nearby components resulting in the need to actually replace two or more components even if only one of them failed.
Another one is reducing the size of heat dissipating pours to only as large as necessary. Again when removing and replacing parts, if the part pad is connected to an unnecessarily large pour or other heat dissipating PCB feature the heat gun will need to be applied for longer, allowing the possibility of damaged nearby components or damaged board surface/layers which means replacing the unit altogether.
Overly constrained or concentrated collections of components will also complicate repair, E.g. if one component blocks access to one that is to be replaced or just preventing access for manual probing.
Second-sourcing also has a large bearing in regard to RMA work for mass produced products that are to be produced for some time.
Such considerations are of course somewhat secondary to constraints imposed by DFM and the functionality and overall physical product design but should still be considered for any potentially mass market product.


Why is the altitude information of the geotag from a drone/uav/uas/rpas (Phantom 3) so innaccurate?

Question: I have a Phantom 3 4k and on examination of the geotag information the altitude reading is often inaccurate by 10-15 metres. Why is this? Is it because the drone only has a GPS rather than a DGPS unit?
Answer: 10-15 m is indeed the uncertainty that you get with a normal GPS in Z (it is roughly 3 times less accurate than XY). Furthermore, the XY errors are compensated by the large number of photograph on nearly the same plane, but it is more difficult to calibrate in Z.
Another source of difference is the fact that GPS measures the height above ellipsoid and not above sea level, but this would results in a systematic error that is often corrected (I don't know in the case of your device).
Answer: The drone gps might have less accurate elevation than ground gps receivers. If this is the case for you, you might want to optimize your geotagged photos with some markers you have photographed and then collected gps waypoints from the ground, to get more accurate elevation. For example in the PhotoScan software, this is covered in Ch. 4 of the manual (Referencing) http://www.agisoft.com/downloads/user-manuals/


Let $Q$ is the matrix with the column vectors from orthogonal basis $\beta$

Question: Let $Q$ be a matrix such that the column vectors form an orthogonal basis $\beta$={$v_1,\dots,v_n$} of $V$.
Let $\alpha$ be the standard ordered basis of $V$.
Then $[I]_\alpha^\beta=Q$.
I think it is trivial (or not..?) but I would like to see a complete proof.
Does anyone know how to prove that?
Answer: Let $Q$ be a matrix such that the column vectors form an orthogonal basis $\beta=\{v_1,\dots,v_n\}$ of $V$.
Let $\alpha=\{e_1,e_2,...,e_j\}$ be the standard ordered basis of $V$.
Claim: $[I]_\alpha^\beta=Q$.
The proof is trivial in the sense that it uses things you already know.  However, I would argue that it is important to know what facts go behind what statements.  For this statement, we would use the following facts (loosely stated):
Lemma: a linear transformation is completely determined by what it does to a basis of the domain.
Lemma: matrix multiplication on the left defines a linear transformation from column vectors to column vectors
By definition, $[I]_\alpha^\beta \,e_j=v_j$ for all $j$ from 1 to $n$
Claim: $Q\,e_j=v_j$
This follows from the nature of matrix multiplication.
By our lemmas, because $Q$ maps the standard basis to the vectors in $\beta$ and because $[I]_\alpha^\beta$ maps this basis in the same way, we may conclude that the two represent the same linear transformation.


How can I progress in academia with no connections?

Question: I am an RA with an unorthodox path. During my PhD I had to move from a group to working alone with a different set of supervisors that didn't have much of a connection to my topic and after my PhD they couldn't help. I am now an RA but I mostly do teaching and no research. My teaching experience is good but I don't have that many publications. I tried to publish some things from my PhD but they are now a bit dated and I don't have any connections to get involved in other projects. I tried to network but it is very difficult. So far this year I wrote a couple of papers, I was in 2 conference programme committees, I got 2 small grants but it is still not enough.
Comment: I don't understand what position you hold. You say RA, but that implies to me that you haven't yet finished or have only done so after completing this year.
Comment: I am an RA on paper for the past 3 year with ongoing short extensions (3-6 months each). In reality I created a course and I teach part of it along with coordination.
Comment: @Diane What is an "RA"? Are you effectively a post doc? "RA" can abbreviate many different things in academia...
Comment: What country? Might help because usually "RA" doesn't imply teaching responsibilities.
Comment: @Buffy Research Associate, similar to postdoc but not attached to a particular project.
Answer: Yes, it is very difficult to advance without a circle of connections, especially collaborators. And you are in a particularly difficult position, I think, and may be being exploited to some extent. If they would offer you a permanent position, even as teaching faculty then it would give you a base.
But the solution to the problem is to develop that circle, I think. I had a very difficult time getting started even with people willing to support me and the market for faculty in academia seems to be very difficult at present (as it was for me).
First, try to find a mentor where you are. Look around at faculty who might serve - people you respect. Talk to them about your need to find a better position that is more open to advancement. You need a base from which to work and you need people willing to help you find that base.
The department head/chair has an ethical obligation to help you get started, even if they don't recognize that. If you can talk to them, expressing your career needs, perhaps they can help with money for travel and conference fees.
You are doing the right thing being on conference committees. Use those people to start with building your circle. Talk to them about your needs. Get the more prominent ones to introduce you to people with similar interests.
One can expand their own circle by getting introduced to members of the circle of others.
If you are introverted, find ways to overcome that. It can be difficult and it takes practice but it can be done. I doubt many here would tag me as very introverted, but at one time I was held back by an extreme reluctance to make my needs known to those who had the power to help. I know people who are "on the spectrum" who are also known as brilliant public speakers. They have learned to play a role and not let their "natural" inclinations to hide in the background dominate their lives. If this is an issue with you, add a comment and I'll say a bit more.
Answer:
... but I mostly do teaching and no research. My teaching experience is good but I don't have that many publications. ... I tried to network but it is very difficult. So far this year I wrote a couple of papers, I was in 2 conference programme committees, I got 2 small grants but it is still not enough.

As an add-on, give thought to reflexivity. You can leverage on your subject knowledge and teaching experience to write and publish papers on your teaching delivery, innovations in your teaching style/approach and assessment.
Innovation can be processes, pedagogical approaches, technological innovation, sustainable assessments: Boyd (2000), Boyd (2016), Adesemowo (2017).
Through collaboration and showcasing your scholarship of teaching, learning and assessment, you might build (lasting) network. Your network will also gravitates towards your 'topic'.
Answer: Nobody knows, really, "how to" progress in academia. Trying to progress in academia means taking part in a lottery. Someone might read a paper of yours and notice you, or it might go unnoticed. Being at conferences is good. Being a research assistant who is exploited to do only teaching sounds bad.


Big O Notation, when can we drop constants legally?

Question: I know in Big O Notation we only consider the highest order, leading polynomial term because we are basically placing this theoretic worst case bound on compute-time complexity but sometimes I get confused on when we can legally drop/consider terms as constants. For example if our equation ran in
O((n^3)/3) --> we pull out the "1/3" fraction, treat it as a constant, drop it, then say our algo runs in O(n^3) time.
What about in the case of O((n^3)/((log(n))^2))? In this case could we pull out the 1/((log(n)^2)) term, treat it as a constant, drop it, and then ultimately conclude our algorithm is O(n^3). It does not look like we can, but what differentiates this case from the above case? both can be treated as constants because their values are relatively small in comparison to the leading polynomial term in the numerator but in the second case, the denominator term really brings down the worst case bound (convergence) as n values get larger and larger.
Answer: At this point, it starts to be a good idea to go back and look at the formal definition for big O notation. Essentially, when we say that f(x) is O(g(x)) we mean that there exists a constant factor a and a starting input n0 such that for all x >= n0 then f(x) <= a*g(x).
For a concrete example, to prove that 3*x^2 + 17 is O(n^2) we can use a = 20 and n0 = 1.
From this definition it becomes easy to see why the constant factors get dropped off - its just a matter of adjusting the a to compensate. As for your 1/log(n) question, if we have f(x)  is O(g(x)) and g(x) is O(h(x)) then we also have f(x) is O(h(x)). So yes, 10*n^3/log(n) + x is O(n^3) but that is not a tighter upper bound and it is a weaker statement than saying that 10*n^3/log(n) +  x is O(n^3/log(n)). For a tight bounds you would want to use big-Theta notation instead.
Answer: Any value which is fixed and does not depend on a variable (like n) can be treated as constant. You can separate the constants, remove the  lower order terms and classify the result as the complexity. Also big O notation states if
f(x) <= c*g(x)

Then f(x) ~ O(g(x)). For example-
n^3 * 5 -> here 5 is a constant. Complexity is O(n^3)
4*(n^3)/((log(n))^2 + 7 -> here 7 and 4 are constants. Complexity is O(n^3/(logn)^2)


Discrete-time realization for continuous time domain controller/filter?

Question: Let us say I simply design a low pass filter like (1/s+1) with the cutoff frequency as 1 rad/sec, when I implement it in real software, do I have to do the discrete-time realization? If not, what issues will I have? How to design a discrete low pass filter that have the same cutoff frequency?
Answer:
Do I have to do the discrete-time realization? If not, what issues will I have?

AFAIK, you cannot implement continuous time filters with digital processors which are inherently discrete time devices (since they execute instructions at discrete clock edges).

How to design a discrete low pass filter that have the same cutoff frequency?

Some methods to transform continuous time filters to discrete time are (from Wikipedia)

Bilinear transform This is probably what you need.
Impulse invariance
Matched Z transform
Discretisation of the continuous time derivative operation. (Euler ?)

The reference given in the Wikipedia article including this one will give you the properties of each of the above techniques.

How to design a discrete low pass filter that have the same cutoff frequency?

The cut off frequency is the usually not the property of the filter we are interested in. We are usually interested in properties like

gain in the pass band,

attenuation in the stop band,

bandwidth,

phase distortion (linear phase response),

ripple in the pass and stop band,
and as implmentation constraints,

order of the filter,

sensitivity to components or coefficients,

memory requirements,

computation time etc.

So rather than trying to get the cut off frequency to match exactly with the continuous time "parent" filter, check if the discrete time filter obtained by conversion meets the "real" requirements.
Comment: Even if you could apply a continuous filter to a digital system (like circuits) theoretically it will kill the signal. since each step is an impulse (has very high frequency) that will be attenuated. e.g instantaneus change zero to one will be deleted by the continues filter decay. 1Hz cut frequency means, no change fastest than 1s is allowed.
Answer: For a great many engineering uses, you can approximate your idealized s-plane filter, into a z-plane equivalent, by one of the transformations mentioned in AJN's answer, using closed-form "cookbook" methods.
If the upper frequency is comfortably below Nyquist freq. (including saving room for the transition band where the roll-off happens), there will be few problems. Just as in analog, neither ideal differentiators nor integrators are really possible, since both have infinite response (at low and high f, respectively).
Start with Bilinear transform. Look up how to do the adjustment for "frequency warping". For most day-to-day uses, that should get you there.
Other notes

In some implementations, there may also be issues with arithmetic precision (for instance with very-low frequency dynamics) so be mindful of that
Don't implement higher orders (e.g. 4-pole or 6-pole) directly, instead decompose into a series of "biquadratic" building blocks.
If implementing "integrators", and data originates from an integer form (e.g. ADC), try to prevent accumulated rounding errors.

If you must get closer to Nyquist frequency, designing directly in the z-plane might be something to look at. Also check out the DSP StackExchange, there may be more questions of this type there.


Fourteen numbers around a circle

Question: Place the numbers 1 to 14 around this circle so that both the sum and (absolute) difference of any two neighboring numbers is a prime.
Comment: @DrXorile: It is an original idea inspired on a question of Carlos Zuluaga (Colombia Aprendiendo). It first appeared in Number Play, Gary Antonnick's New York Times puzzle column.
Comment: Was this an original question? Or do you have a source?
Answer: This appears to work, and I think it's unique but haven't checked super-carefully:

 10 -- 13 -- 6 -- 11 -- 8 -- 3 -- 14 -- 9 -- 2 -- 5 -- 12 -- 1 -- 4 -- 7 -- (10)
Comment: To expand a bit: 2,11,13,14 can each only be adjacent to two numbers, so that part of the sequence is forced, namely 3-14-9-2-5 and 10-13-6-11-8. 1 could neighbour 4,6,12 but 6 is now "taken" by 13 and 11, so 12-1-4 is forced. 4 could neighbour 9 but 9 is also taken, 1-4-7. 12 could neighbour 7 but that would close off a cycle of length 4. So 12 and 7 are forced: 7-10 and 5-12. 3 could neighbour 10 but that's taken. so 8-3. Done.
Comment: Was about to post this too, and I'm pretty sure it's unique because: there are 2 or 3 possibilities for the neighbours of each number, if 2 then it's forced, and then we can draw a graph for the remaining and there is only one cycle covering all numbers.
Comment: Sorry if I ninjaed you! Your reasons for saying it's unique are very much like mine (unsurprisingly) but since I hadn't bothered to write them out carefully I didn't want to claim too much :-).
Answer: Uniqueness proof
The accepted answer by Gareth found the solution but didn't properly prove uniqueness. Just to complete the puzzle, let's derive that answer from first principles, showing that it's the only possibility.
Each number from $1,2,3,4,5,6,7,8,9,10,11,12,13,14$ only has a few possibilities for neighbours:

 1 can only be adjacent to $4,6,12$;
 2 can only be adjacent to $5,9$;
 3 can only be adjacent to $8,10,14$;
 4 can only be adjacent to $1,7,9$;
 5 can only be adjacent to $2,8,12$;
 6 can only be adjacent to $1,11,13$;
 7 can only be adjacent to $4,10,12$;
 8 can only be adjacent to $3,5,11$;
 9 can only be adjacent to $2,4,14$;
 10 can only be adjacent to $3,7,13$;
 11 can only be adjacent to $6,8$;
 12 can only be adjacent to $1,5,7$;
 13 can only be adjacent to $6,10$;
 14 can only be adjacent to $3,9$.

Four of these, namely $2,11,13,14$, can immediately be put next to both of their neighbours. So we get two chains of five on the circle:

 $5,2,9,14,3$ and $8,11,6,13,10$ (not necessarily in the same order around the circle).

Now, after the above deduction, we get more restrictions on $1$ and $4$:

 $1$ can't be next to $6$, and $4$ can't be next to $9$, so there's now only two possible neighbours for each of those, giving a chain of four: $12,1,4,7$.

Now the chains we've found cover all numbers, so we just need to figure out how to link them together.

 The $7$ end of the last chain must connect to $10$ from the second chain. Now we have a chain of nine $8,11,6,13,10,7,4,1,12$ as well as the first chain of five. The $3$ end of the first chain must connect to $8$, so $5$ connects to $12$.

This proves that there is only one possible solution (up to rotation and reflection), namely the one found by Gareth.

Fourteen numbers around a circle


How do languages like C# and Java avoid C/C++-like independent compilation?

Question: For my programming languages class, I'm writing a research paper on some papers by some important people in the history of language design.  One by CAR Hoare struck me as odd because it speaks against independent compilation techniques used in C and later C++ before C even became popular.
Since this is primarily an optimization to speed up compilation times, what is it about Java and C# that make them able to avoid reliance on independent compilation?  Is it a compiler technique or are there elements of the language that facilitate this?  And are there any other compiled languages that used these techniques before them?
Answer: Short answer: Java and C# don't avoid separate compilation; they make full use of it.
Where they differ is that they don't require the programmer to write a pair of separate header/implementation files when writing a reusable library. The user writes the definition of a class once, and the compiler extracts the information equivalent to the "header" from that single definition and includes it in the output file as "type metadata". So the output file (a .jar full of .class files in Java, or an .dll assembly in .NET-based languages) is a combination of binaries AND headers in a single package.
Then when another class is compiled and it depends on the first class, it can look at the metadata instead of having to find a separate include file.
It happens that they target a virtual machine rather than a specific chip architecture, but that's a separate issue; they could put x86 machine code in as the binary and still have the header-like metadata in the same file as well (this is in fact an option in .NET, albeit rarely used).
In C++ compilers it is common to try to speed up compilation by using "pre-compiled headers". The metadata in .NET .dll and .class files is much like a pre-compiled header - already parsed and indexed, ready for rapid look-ups.
The upshot is that in these modern languages, there is one way of doing modularization, and it has the characteristics of a perfectly organised and hand-optimised C++ modular build system - pretty nifty, speaking ASFAC++B.
Answer: IMO, one of the biggest factors here is that both java and .NET use intermediate languages; that means that the compiled unit (jar/assembly) contains, as a pre-requisite, a lot of expressive metadata about the types, methods, etc; meaning that it is already laid out conveniently for reference checking. The runtime still checks anyway, in case you are pulling a fast one ;-p
This isn't very far removed from the MIDL that underpins COM, although there the TLB is often a separate entity.
If I've misunderstood your meaning, please let me know...
Comment: I *believe* you understood me properly.  I'm basically meaning the idea in C/C++ that each source file is its own individual compilation unit.  This doesn't as much seem to be the case in C# or Java.
Answer: You could consider a java .class file to be similar to a precompiled header file in C/C++.  Essentially the .class file is the intermediate form that a C/C++ linker would need as well as all of the information contained in the header (Java just doesn't have a separate header).
Form your comment in another post:

"I'm basically meaning the idea in
  C/C++ that each source file is its own
  individual compilation unit. This
  doesn't as much seem to be the case in
  C# or Java."

In Java (I cannot speak for C#, but I assume it is the same) each source file is its own individual compilation unit.  I am not sure why you would think it is not... perhaps we have different definitions of compilation unit?
Answer: It requires some language support (otherwise, C/C++ compilers would do it too)
In particular, it requires that the compiler generates self-contained modules, which expose metadata that other modules can reference to call into them.
.NET assemblies are a straightforward example. All the files in a project are compiled together, generating one dll. This dll can be queried by .NET to determine which types it contains, so that other assemblies can call functions defined in it.
And to make use of this, it must be legal in the language to reference other modules.
In C++, what defines the boundary of a module? The language specifies that the compiler only considers data in its current compilation unit (.cpp file + included headers). There is no mechanism for specifying "I'd like to call function Foo in module Bar, even though I don't have the prototype or anything for it at compile-time". The only mechanism you have for sharing type information between files is with #includes.
There is a proposal to add a module system to C++, but it won't be in C++0x. Last I saw, the plan was to consider it for a TR1 after 0x is out.
(It's worth mentioning that the #include system in C/C++ was originally used because it'd speed up compilation. Back in the 70's, it allowed the compiler to process the code in a simple linear scan. It didn't have to build syntax trees or other such "advanced" features. Today, the tables have turned and it's become a huge bottleneck, both in terms of usability and compilation speed.)
Comment: The design of the C languages was based more upon trying to ensure compilation would be feasible on memory-limited machines, than on trying to make it fast.  Today, there are relatively few systems whose entire source code wouldn't fit easily in the RAM of a typical desktop machine, but C was designed in an era when a large machine would have less than 1/16,000th as much RAM as today's everyday workstation.  Development environments had to make severe tradeoffs between build speed and the largest-practical build size.
Answer: The object files generated by a C/C++ are ment to be read only by the linker, not by the compiler.
Answer: As to other languages: IIRC Turbo Pascal had "units" which you could use without having any source code. I think the point is to create metadata along with compiled code which can then be used by the compiler to figure out the interface to the module (i.e. signatures of functions, class layout etc.)
One problem with C/C++ which prevents just replacing #include with some kind of #import is also the preprocessor, which can completely change the meaning/syntax etc of included/imported modules. This would be very difficult (if not impossible) with a Java-like module system.


Why does Mac OS X requires repairing of permissions for maintenance while other OS (windows /Ubuntu) doesn't require it?

Question: Please explain briefly why repairing of permission is  one of the maintenance tool for mac os x exclusively .
Why it isn't done on windows?
Comment: You had two questions in here. This site works better when there is only one question per question. That way, it's easier for other people to find solutions if they have the same problem. I've edited out your second question, but feel free to ask it separately.
Answer: Only because OS X offers a convenient way to repair permissions shouldn't be taken as an indicator that other operating systems don't need similar functionality as well. At least in the Linux world it depends on the distribution whether something similar is available and how it is run (e.g. periodically via cron).
As for the "why is this required in the first place": Software is usually not bug-free, neither are Installer applications. So permissions may get changed in unexpected ways over time. Having a function to repair them may save a lot of time wasted for hunting such issues down.
Answer: Windows does actually require equivalent permissions fixes, it's just that there is no built-in tool to do it all automatically.
Analogous processes such as sfc /scannow etc or any of the suite of tools from tweaking.com provide easier user access to those underlying system tools.


How does registered memory allow more RAM?

Question: I understand that there is a register between the memory controller and the DRAM and that commands are written into this register and "buffered" but I don't understand the advantage of this. All I can find is that it reduces load and allows more RAM to be added per DIMM. But I can't find it explained why?
Comment: [Registerd memory wiki article](https://en.wikipedia.org/wiki/Registered_memory)  has a rough explanation. What's unclear about it?
Comment: it says "They place less electrical load on the memory controller and allow single systems to remain stable with more memory modules than they would have otherwise.", but does not explain why
Comment: You would probably have to check the specs for a board/controller and the modules. Without having that setup the controller would likely have to bear the electrical load of more concurrent modules. [This presentation](http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.210.6296&rep=rep1&type=pdf) by (presumably) Intel on FB-DIMM might be very relevant.
Answer: Buffers allow signal regeneration at fixed points and allow a local split so that only one single device appears on the bus. That device handles splitting signals to local devices and handles powering the signals to each device itself rather than expecting the host, which is potentially far away, to do it.
The electrical load part is a feature of any electrical device. In order to sense any kind of current or voltage you need to leech a part of the current on the wire. This is the "load" of the device. A large number of memory chips on a stick presents a large load to the memory controller because it has to send enough power down the line that every device will still see the same voltage even after they have all leeched their power off of the line to sense it.
By putting a buffer in place on the stick you reduce the load from what could be 8 or 16 (chips on the memory stick) times the current needed to one chip per memory stick. The buffer takes the load of the chips on the stick and powers it from a more local source, leaving the host memory controller under less stress and the attenuation of the signal is a lot less than more devices would have.
With a large number of memory sticks the load without a buffer could be huge, with a buffer it can be somewhat more manageable.
Comment: So does the address and command lines from the controller need to be wired to every chip in unbuffered?


Why are the hormones dopamine, adrenaline, noradrenaline and serotonin so ubiquitous across the animal kingdom?

Question: As far as I know there is no reason for the makeup of a given hormone to be universal as it merely serves as a carrier from one part of the brain to another. So why are the above hormones seen across the entirety of the animal kingdom, and used in more or less the same way?
Answer: Evolution.
This is not special to hormones: receptors and ligands of all types are highly conserved across not only the animal kingdom, but also to single-celled organisms. The degree of conservation is typically dependent on the closeness of evolutionary relationship: more related organisms share more homology.
Because species evolve from common ancestors, they tend to share a lot of the same 'tools.' Changing the purpose of a hormone would likely require some sort of selective pressure, some new reason to use that molecule in a different way, and if the old and new roles conflict then there needs to be a replacement. This can happen, but it's complex and requires just the right conditions. More often, minor changes occur: among the steroid hormones, for example, you will find many small biochemical tweaks that make new molecules that have different functions.
Certainly the functions of some hormones are not entirely conserved, and if you look at the nervous systems of, for example, insects versus mammals, you will find some major differences, but the closer in evolutionary time you look the more similarity you will find.
Comment: @ShmuelNewmark If an answer is helpful you should upvote it with the up arrow next to the answer; if a question has been solved by an answer you should accept it with the check mark. Sponges are the simplest extant animals, though they may or may not be in precisely the same lineage as the other animals, but even they have some rudimentary use of molecules like serotonin and dopamine - the purposes are almost certain different, but these things are very very old. C elegans is a roundworm and common model organism - you could start there. The actual common ancestor is long gone.
Comment: Thank you for the answer, I assumed it was something like that, I just had trouble with the idea of a shared ancestor between all these animals that still retained the complexity of hormones and neurotransmitters, do we have any idea what animal that is?

P.S. I'm new here, is there anything I need to do to close the question or am I fine?


Apartment requires that I consent to them using images of myself on social media

Question: I am signing a contract for an apartment.  In it, there is a section stating that I agree to the apartment using images, video, and/or audio clips of me wherever they'd like (Facebook, their website, etc.)  I'm not comfortable with this, but I want to live here.  Can they really make me do this?
Comment: It's a request for the question to be clarified.
Comment: Generally, people are free to contract to whatever they can agree on; so if you don't agree, then try to negotiate with them to drop it, or don't live there.  Some jurisdictions do have laws saying that various terms in a residential lease are not valid or enforceable - but you'll have to tell us what jurisdiction you are in (maybe down to the city since much of this is locally regulated).
Comment: I'd look at that wording pretty closely. Does it allow bugs about the property?
Comment: @NateEldredge this is an answer, don't post it as a comment
Comment: What jurisdiction?
Answer: You could sue them for commercially exploiting your image without permission, so the waiver is necessary. It is entirely legal to require of tenants (even if weird) that they be part of an advertising campaign, in a specified way: it's also your right to refuse to sign. There is a minuscule chance that there is a local ordinance prohibiting such a clause.
Answer: They can ask for you to appear on social media for them, and you can refuse.
Contracts are negotiable, you can simply cross that section out before signing if you want to. It's then up to them if they accept it or not.
Comment: Keep in mind that once you have modified the contract in any way, you are most likely sacrificing any future argument of "no meeting of the minds" from prevailing, as can sometimes occur with an unaltered form contract.


Google Datastore model User and Messages efficently

Question: I have two kinds: USER and MESSAGES. A user can send/receive many messages to/from another user. Thinking in a relational way the relationship would suggest a user can have many messages, and a message can only be created by one user. So if user A sends a message to User B, both user A should be able to see the message they sent, and user B should be able to see the message they received. I was thinking first of storing all sent/received messages inside of each user object, but since there is a 1mb limit for entities this is not an option as some users can retrieve many more messages than this. Second I was thinking of creating two kinds, USER and MESSAGES.The messages kind would have a to and from property both which would be indexed so that I can get all the messages a user has sent and received. As a result each message would be its own entity and this is where it is problematic. Lets say a User is deleted, I know have to delete all the message sent and received by this user. If a user has sent though sands of messages, the cost of removing each message will be very expensive. I was wondering what would be an efficient way to model this. I am be to Google Datatore and would be open to any ideas as I have nothing implemented yet.
Answer: Your second approach seem to be the best. Having a Message entity with key relations to sender/reciever.
As for you deleting a user dilema, you should consider not removing the entity when a user is deleted as this would break your db consistency. You should probably just have a logic deletion (eg a boolean value changed when a user is deleted), that way, messages sent to/from that user will stll make sense for other users.


difference between new android application project and new android sample project on eclipse

Question: I am newbie to the world of Android. Just wanted to know what is the difference between a new android application project and new android sample project on eclipse. When I click on new android sample project, it directly shows me the Android API level display. The display says "This target has no samples" and that is true if I pick any API level.
Answer: New android sample project allows you to access the sample projects provided by the SDK which you need to download from the android manager. So on Eclipse go to->Android SDK manager ->once you open the package details you can find Samples for SDK (each API level have samples, you may get for the latest target which would be backward compatible up to certain API level). Install the ones you need. Then you will find samples for the target under new android sample project.
New android project is for starting new project without using the sample.
Answer: Android Sample Projects give you demo projects that demonstrate an android functionality (e.g., Accelerometer, ApiDemos, ContactManager, etc) which you can run and check the code on how it works.
By the looks of it, you haven't installed your Android Samples. Check the Android SDK Manager and check "Samples for SDK".


Help installing a ceiling pendant light fixture

Question: I recently bought a pendant-type fixture that contains three, silver (or aluminum?) stranded wires encased by a decorative braided cord. Two of the wires are sheathed in clear plastic and the third is not. How do I install this fixture when there is no indication of white, black or ground? The wires all seem to be the same.
Answer: Was this a used fixture, because it doesn't sound like it would meet UL approval for new fixtures if there is no way to identify which wire should be connected to hot or to neutral.  Is there any ribbing or texture on one wire?  If so, that is likely the neutral.
I'm assuming your fixture just uses standard light bulbs.  From an electrical viewpoint of a standard incandescent bulb, it doesn't matter which way the current flows -- but it might matter for led or cfl bulbs (cfl = compact fluorescent).  However, from a SAFETY perspective, the polarity does matter (polarity is which contact on the light bulb socket is hot and which is neutral).  The uninsulated wire is the ground, which is always connected to the ground (bare wire) in the box.
I strongly recommend you identify which of the insulated wires (plastic covered) should be connected to the hot, and which to the neutral.  An easy way to do this is to take your volt/ohmmeter, touch one lead to one of the insulated wires and the other lead to the light bulb socket.  If you get zero resistance (the same as touching the two leads together) on the collar (side) of the socket, then that wire is the neutral (white).  If you get zero resistance when touching the button (bottom of the socket), then that is the hot.  Wrap a bit of black electrical tape around the hot wire.
Now you can install your fixture correctly, connecting the wires using the coding that you identified: white-white, black-black, bare wire-bare wire.  Use wire nuts to connect the wires.  The packaging on the wire nuts tell you what quantities of what size wires they are approved for use with.

Strip and straighten 1/2" to 5/8" of each wire to be joined.
Hold the wires together, straight and parallel.
Put a wire nut over the wires, covering all the stripped wire, and twist clockwise. Turn until the wires outside the connector start to twist.
Test the connection by holding the wire nut with one hand and tug on each of the wires with the other hand.  The wires should be firmly connected and not slip out of the wire nut.

Forgot to add: it's unlikely this is aluminum wiring.  Could it be stranded wire that is soldered on the end?  If it is aluminum wire, then you need to use fasteners approved for use with aluminum.
Answer: Lighting typically does not matter which is hot and which is neutral. The Power going though a lightbulb does not matter which way it goes. Think of the Plugs that don't have the slightly fatter blade, you can plug them in either way.  This is the same.
Not sure what tools you have access to, though Hot is typically wired to the bottom nub of the light bulb and the neutral is the outside threaded part.   If you have a Test Meter you can determine which wire goes to the nub and which goes to the threaded.   If you were only using incandescent it won't matter, though some of the newer LED bulbs might like it the proper way.
So in your case the two with the clear plastic are the Hot and Neutral and the bare wire is the Ground. If you look there might be a difference in the color of the wires in the clear plastic. one might be more gold/copper (Hot) and the other might be more silver (neutral)
Hope that helps.
Answer: If you feel the wire one side will have a bumpy texture, the other side is smooth.
The textured side is neutral.
The bare wire is ground.


How do I prevent general analysis questions from being close voted?

Question: This question , which I've asked, I got two close votes on it already but I can not understand why. I think having a complete discussion of my question/ answer to it would benefit the community as a whole because if my question is solved then there is a large category of problems which could be solved using the techniques I've discussed in the question. Further, I've put in some effort of my own by analysing the problem to the best of my knowledge. So, I can not understand where exactly I'm going wrong/ making people think this is some homework question
Comment: Hey all, the comment section here isn't really the place to discuss how to solve the original question. Could you take it to [chat]? If you like, I can migrate the existing comments to a new chat room.
Comment: BTW I don't think your technique would be very useful for finding equilibrium of a particle _moving_ along a plane curve.  You may want to think back on some of the assumptions you made in those equations to see if they apply.
Comment: Other than gravity being the most direct one and friction being uniform, I don't see anything else
Comment: You're using equations as if it's an inclined plane problem, but there's an extra factor you're missing.
Comment: I can't see it... can you say specifically?
Comment: If the path is curved you need more forces to follow that curve.
Comment: Basically the plane curve is like a race track of sorts, imagine that curve being like  a structure which the particle could move through. Would I still need application of centripetal force?
Comment: https://en.wikipedia.org/wiki/Centripetal_force
Comment: Ok, I think I'm starting to realize my mistake, How do I get equilibrium when I include centripetal force? Do I just equate component of normal as centripetal force?
Comment: I have an extra unknown because I do not know the radius of circle in the centripetal acceleration formula at some point on curve
Answer: Speaking for myself:
I do not understand what you mean by " find the points on the curve where the particle would become at equilibrium."  Presumably that would be "reach equilibrium" and not "become at equilibrium".
Next, the notation is unclear.  Your curve is parametrized by $(x,g(x))$ which is a bad choice because you also use $g$ which I presume is gravity.  In your text you use $`\mu$' when I think you meant "$\mu$" in quotation mark.  Or did you?  Do you mean to use $\mu^\prime$ as your coefficient of friction?  Why use `$\mu$' or quotation mark?  Is this static or kinetic friction?  (I presume static as I can't see how kinetic friction would enter in equilibrium.)
Next, you have an inequality $f_{\mathrm{max}}\ge mg\sin\theta$ but the inequality sign disappears afterwards.  I suspect that
$\mu=g'(x)$ should be something like $\mu\ge g'(x)$ but I'm not sure, all the more so as I suppose $g'(x)$ is the derivative of $g(x)$ or is it related to the gravitational constant $g$ (which doesn't make sense).
Next, you seem to treat the problem as in rotational motion, introducing $mv^2/r$.  As you admit yourself, you cannot find a meaning for $r$ which I suppose would be the local radius of curvature at $x$, i.e. find the osculating circle at $(x,g(x))$ and use the radius for that.
Next, how to you define equilibrium when there's friction?  Do you mean if you place a particle there it would remain there?  Then surely there might be a range for if I imagine the slope of the curve is very small everywhere then a particle might be stuck anywhere along the curve and not overcome static friction.  If you define equilibrium position as the position $x$ where the particle would come to rest, then it's intuitively clear that this must be the bottom of your curve (or at least a local minimum) since the particle would slowly dissipate energy until it reaches that point with no more energy, and would stop there.
I could go on but if you start with these it will immediately improve the question, although i must say it does look like a homework question.
Comment: I tried to fix everything you noted to the best of my ability , if there is anything then pls inform
Answer: The current version (v11) has several problems. It is not focused, as evident by the plethora of questions in the post. And you're really not asking about any physics concepts per se, you're just asking for the results of physics calculations:

Basically I want to find a description of points of equilibrium for which the body was moving already (kinetic friction ).

And you're also somewhat expecting others to check your work:

Would there exist no points of equilibria by this derivation or would I have to account for something else there?

So in summary it looks like the question boils down to "Hey, I have this interesting problem, and I don't really know how to analyze it. What should I add to my analysis? ... What about this point? ... And what if this were the case? ... If this was the case then what would I do differently?" This, to me, is definitely not on topic for PSE.
To answer the title question of "How do I prevent general analysis questions from being close voted?" I will say that the answer has nothing to do with the fact that the question is about "general analysis" and more about just the quality of the post.

For v12 you are still just asking how to do a calculation/solve a problem. Therefore, I still think it shouldn't be reopened yet.


The 'what' problem

Question: 'What seems enjoyable to you seems troublesome to me' I have a problem with 'what'. I know 'what' in the sentence is a pronoun but I can't figure out what type of pronoun it's supposed to be. I do think it's a relative pronoun, but if it is I don't why it is so since relative pronoun doesn't come first in a sentence-- or at least I think so. Thoughts?
Answer: What (unlike which) is not a typical relative pronoun because it can't have a noun or a pronoun as its antecedent. In your case it starts a nominal relative clause, which functions as the subject of the sentence (in other cases such a clause can be the object of a verb). More details about it:
https://www.englishgrammar.org/relative-pronoun/
Answer:
[What seems enjoyable to you] seems troublesome to me.

This is a 'fused' relative construction where the bracketed constituent is a noun phrase as subject of the sentence.
It's fused in that the antecedent and the relative word are fused together instead of being expressed separately. The pronoun "what" thus means "that which".
It has the same meaning as the non-fused:
That which seems enjoyable to you seems troublesome to me.

The 'what' problem


Which weapons have extended magazines available for unlock?

Question: For example most of the LMG's do. Some SMG's do. Has anybody compiled a list?
Answer: By going through all the weapons in battlelog, the following weapons can have extended magazines attached to them.

All Support weapons (except for the QBB-95 and MG-36).
The PP-2000, PDW-R, MP7, AS Val and M5K.
All Shotguns.

So not many at all, and all of the ones that can are either a LMG, SMG, or a Shotgun.
Answer: In all of the weapon classes I have come to see, every gun uses a secondary slot for extended mags except for three weapons in the support class.
Comment: Welcome to site, Briyor. :) Can you please be more specific with your answer and include which three guns? Also, please avoid irrelevant information in your answers.


How to easily remove installed software?

Question: I would like to know if there is an easy way to remove any installed software. I do know that sudo apt-get remove <package-name> command, but what happens when you don't know the package name. Let's say you install form a .deb file and you don't know what the package name is? It would be great if there was an universal un-installer, like the one in the Ubuntu Software Center, but for all packages.
Comment: Can you give an example of how or why this would happen:  _Lets say you install form a .deb file and you don't know what the package name is?_ ?
Answer: 1. If you know the application package name
From terminal, use one of the following commands:
sudo apt-get remove package_name

remove is identical to install except that packages are removed instead of installed. Note that removing a package leaves its configuration files on the system. If a plus sign is appended to the package name (with no intervening space), the identified package will be installed instead of removed.
Source: man apt-get

apt-get purge package_name

purge is identical to remove except that packages are removed and purged (any configuration files are deleted too).
Source: man apt-get

You can also use:

aptitude with the same arguments as of apt-get.
Ubuntu Software Center:

2. If you know how to open the respective application from GUI

Find application package name using this method:

How can we get the command line of a running application?

Go to the step 1.

3. If you forgot the application/package name and you don't know where to find it
Ubuntu Software Center is very useful in this sense. It knows about any application installed on your system: provided by Ubuntu, from Canonical partners, from purchase, from PPAs, from .deb files, etc. To find them:

Click Installed tab and search there your application:

Click History tab, then Installations and search there your application/package:
Answer: There is aptitude, it is console based, but it gives you a complete list of the installed software and once you know the keyboard commands, it's fairly easy to navigate.
Otherwise, the following gives you a list of your package:
dpkg --list

But be careful, make sure to use apt-get to do removes/installs unless you know what you're doing.
Comment: Ok thank you. I think that this will help my very much.
Answer: This may be useful for you.
Uninstall Softwares using Aptitude
Comment: Again thank you for the help, you both will have made this much easier.


object detection model with few shot and active learning

Question: This video https://youtu.be/60Sk-mq3Cr8, from 0 to 2:00 minutes, mentioned an object detection model that can train on 10 samples and improved over time, what kinds of the latest model out there that can achieve this?
Answer: Try this:

https://paperswithcode.com/paper/you-only-learn-one-representation-unified
https://github.com/WongKinYiu/yolor

It's an object detection model that also gives you a representation of the thing it detected that's supposed to be generally useful for new downstream tasks. 10 images isn't a lot to work with, but you could definitely try fine tuning with that data and see what happens. Start with the pre-trained weights available in the git repo.


aperiodic property and the existence of limiting or stationary distribution for Markov chain

Question: Given a Markov chain, what are the relationship between the property of aperiodic and the existence of stationary distribution or limiting distribution? Moreover, if a Markov chain is claimed to be aperiodic, can I ensure that all the states will have self-loop arc?
Answer: There is no implication relation between aperiodicity and stationarity. Take the examples of an aperiodic and transient Markov chain and of a positive recurrent periodic Markov chain. The only sure things are that (i) if a chain is periodic, with period $\rho$, it does not converge to the stationary distribution when the later exists, as the probability of visiting a set $A$ starting from $x$ at time $t$ will depend on $t\text{ mod }\rho$. And (ii) an irreducible aperiodic Markov chain on a finite state space is recurrent (and hence has a stationary distribution).
I do not understand what you mean by self-loop arc. If you mean that there is a probability to remain in the same state, this is not correct. An aperiodic Markov chain may enjoy zeroes on the diagonal of the transition matrix $Q$. For instance, take this matrix
$$Q = \begin{pmatrix}
  0 & a & 0 & b \\
\frac{1}{2} & 0 & \frac{1}{3}+c & d \\
  0 & a & 0 & b  \\
  e & 0 & f & 0
 \end{pmatrix}
$$
Then the associated Markov chain is aperiodic whenever $a,b,c,d,e,f>0$ and the rows sum up to one. (Going back to state 1 is possible in two steps as $(1,2,1)$ and three steps as $(1,2,4,1)$. The largest common denominator of $2$ and $3$ being one, the period is $1$.)
Comment: thank you for the response. My understanding, might be wrong, is that an aperiodic chain may always have period as 1, therefore, it will have self-loop arc.


Is there any script or smart contract which send tokens?

Question: I wondering if is there any script o smart contract example which when i send X ada to a wallet after i receive a native token
Answer: You can do this with multisignatures (no smart contract required). Because of how flexible the (e)UTXO model is, it's possible to construct a transaction that spends from two different addresses, as long as both of the parties involved sign the transaction with their signing key. Imagine party A has 10 ADA, and party B has 1 native asset lets call it XDA, the aim is for party A to buy one XDA from party B in exchange for 10 ADA.
Party A: build Tx with their own utxos as input, and as output they set 10 ADA to party B, and then they add another input using the UTXO of party B, and as output they set 1 XDA to party A address. So you get a transaction like so:
INPUTS
  partyAUtxo [containing ADA]
  partyBUtxo [containing XDA]

OUTPUTS
  10 ADA -> partyBAddress
  1  XDA -> partyAAddress

party A now signs this transaction and sends the serialized signed transaction to party B. Now party B verifies that the trade seems fair (simply checking the price is fair or whatever), signs it with their keys and submits the transaction to the blockchain.
This constructs an atomic swap in a SINGLE TX, which would require two transactions if using a smart contract (lock, and unlock).
I would include the code here, but it'd require quite a bit of code to give you a working demo so I can just guide you to checkout cardano-serialization-lib, and Nami wallet - these two libraries/APIs provide all of the above functionality in terms of getting UTXOs, constructing transactions from UTXOs with custom outputs, building/serializing the transaction, signing it with a wallet, and submitting a transaction to Blockfrost. If I get a simple demonstration of this in action soon I will update here.
Answer: There are no such example that I know of, but you can create one, by monitoring an incoming address for new transaction and trigger a faucet server, something like cardano-faucet.
If you are looking for a smart contract and not a federated solution, you are probably thinking about a token swap.
In the Plutus Pioneer Program, the Lecture #10 explains an uniswap contract, which might be helpful to you.


How do I import modules or install extensions in PostgreSQL 9.1+?

Question: Firstly, if you're not using 9.1+, please refer to this question.
How do I install an extension to PostgreSQL 9.1?
Answer: Postgrseql 9.1 provides for a new command CREATE EXTENSION. You should use it to install modules.
Modules provided in 9.1 can be found here.. The include,
adminpack , auth_delay , auto_explain , btree_gin , btree_gist
, chkpass , citext , cube , dblink , dict_int
, dict_xsyn , dummy_seclabel , earthdistance , file_fdw , fuzzystrmatch
, hstore , intagg , intarray , isn , lo
, ltree , oid2name , pageinspect , passwordcheck , pg_archivecleanup
, pgbench , pg_buffercache , pgcrypto , pg_freespacemap , pgrowlocks
, pg_standby , pg_stat_statements , pgstattuple , pg_test_fsync , pg_trgm
, pg_upgrade , seg , sepgsql , spi , sslinfo , tablefunc
, test_parser , tsearch2 , unaccent , uuid-ossp , vacuumlo
, xml2

If for instance you wanted to install earthdistance, simply use this command:
CREATE EXTENSION earthdistance;

If you wanted to install an extension with a hyphen in its name, like uuid-ossp, you need to enclose the extension name in double quotes:
CREATE EXTENSION "uuid-ossp";

Read more about contrib, and the modules available in 9.1.
Read about the new extension infrastructure, and the SQL commands to manage it here You can now more easily uninstall a module, see DROP EXTENSION. You can also get an extension list, and there is basic support for version numbers.
Comment: For convenience, to remove an extension:

`DROP EXTENSION extension_name [, ...]`
Answer: While Evan Carrol's answer is correct, please note that you need to install the postgresql contrib package in order for the CREATE EXTENSION command to work.
In Ubuntu 12.04 it would go like this:
sudo apt-get install postgresql-contrib

Restart the postgresql server:
sudo /etc/init.d/postgresql restart

All available extension are in:
/usr/share/postgresql/9.1/extension/

Now you can run the CREATE EXTENSION command.
Comment: I was trying to install citext, but google was not finding this page, and this answer did not come up.  Now citext is mentioned three times on this page :-)  Come on google, do that indexing thing.
Comment: Note that the package is also needed to add `vacuumlo` script in pgsql bin. Additionally you might need to use `ln -s` to link vacuumlo to `/usr/bin`.
Answer: In addition to the extensions which are maintained and provided by the core PostgreSQL development team, there are extensions available from third parties.  Notably, there is a site dedicated to that purpose: http://www.pgxn.org/
Answer: For the postgrersql10
I have solved it with
yum install postgresql10-contrib

Don't forget to activate extensions in postgresql.conf
shared_preload_libraries = 'pg_stat_statements'
pg_stat_statements.track = all

then of course restart
systemctl restart postgresql-10.service

all of the needed extensions you can find here
/usr/pgsql-10/share/extension/

Answer: The extensions available for each version of Postgresql vary. An easy way to check which extensions are available is, as has been already mentioned:
SELECT * FROM pg_available_extensions;

If the extension that you are looking for is available, you can install it using:
CREATE EXTENSION 'extensionName';

or if you want  to drop it use:
DROP EXTENSION 'extensionName';

With psql you can additionally check if the extension has been successfully installed using \dx, and find more details about the extension using \dx+ extensioName. It returns additional information about the extension, like which packages are used with it.
If the extension is not available in your Postgres version, then you need to download the necessary binary files and libraries and locate it them at /usr/share/conrib
Comment: Leave off the quotes. This works: `create extension intarray;` This does *not*: `create extension 'intarray';`
Answer: Into psql terminal put:
\i <path to contrib files>

in ubuntu it usually is /usr/share/postgreslq/<your pg version>/contrib/<contrib file>.sql
Comment: That's for pre 9.1. Do not use this method in 9.1+.
Answer: How to download and install if you have SUSE. As an example I am downloading the tablefunc module so I can use crosstab. I have PostgreSQL 9.6.1.
right-click desktop, terminal, type:
sudo zypper in postgreql-contrib

Enter credentials, continue by typing:
y

Run query (I ran mine from pgAdminIII):
CREATE EXTENSION tablefunc;

You should now have the crosstab function.
I did not have to restart.


Conditions for entangling $A$ with $C$ via an interaction on $AB$

Question: I have three qubits in subsystems $A$, $B$, $C$. System $A$ initially contains some state $\rho_A$, and $BC$ contains a bipartite pure state $|\psi\rangle_{BC}$. I apply a unitary operation $U$ acting on $\mathcal{H}_A\otimes \mathcal{H}_B$ and then I trace out system $B$, resulting in the state
\begin{equation}
\rho_{AC}' = \text{Tr}_B \left((U \otimes I_C)(\rho_A \otimes |\psi\rangle \langle \psi|_{BC})(U^\dagger \otimes I_C)\right)
\end{equation}
I would like to know, for what conditions on the choice of unitary $U$ will there necessarily exist $\rho_A$ and $|\psi\rangle$ such that the final state $\rho_{AC}'$ is not separable in the space $\mathcal{H}_A\otimes \mathcal{H}_C$?
Comment: maybe a trivial solution but, what about if $U$ swaps $A$ and $B$. That way you effectively trace out $\rho_B$ at the end and the final state on $AC$ is precisely $|\psi\rangle$, which can be entangled
Comment: yes thats a good example - I am hoping for a set of conditions on $U$ such that $AC$ can be entangled. I'll edit to clarify
Comment: is $\rho_{A}$ an arbitary density matrix, or a representation of a pure state?
Comment: $\rho_A$ can be an arbitrary qubit state, mixed or pure.
Answer: This isn't a full solution. More a way to reduce the problem in a more general one, and possibly pinpoint the difficult question that needs answering.
Let's assume $\rho_A$ is pure, $\rho_A\equiv |\phi\rangle\!\langle \phi|$, and write the Schmidt decomposition of $|\psi\rangle_{BC}$ as
$$|\psi\rangle = \sum_k \sqrt{p_k} |k,k\rangle.$$
We can always write it this way in some suitable basis for the spaces $\mathcal H_B$ and $\mathcal H_C$.
Before the partial trace on $B$ the state is therefore
$$|\Psi_f\rangle\equiv (U_{AB}\otimes I_C)(|\phi\rangle\otimes |\psi\rangle) = \sum_k \sqrt{p_j} \big[ (U_{AB}(|\phi\rangle_A\otimes|j\rangle_B))\otimes |j\rangle_C\big].$$
Define $V:\mathcal H_B\to \mathcal H_A\otimes \mathcal H_B$ as the isometry with action $V|j\rangle_B\equiv U_{AB}(|\phi\rangle_A\otimes|j\rangle_B)$. This is purely for notational conciseness, it's not strictly required, but allows to write the state concisely as
$$|\Psi_f\rangle = \sum_k \sqrt{p_k} (V|j\rangle\otimes |j\rangle).\tag X$$
The rationale is that asking "is there a unitary $U_{AB}$ such that there are $|\phi\rangle_A$ and $|\psi\rangle_{BC}$ such that XYZ?" is the same as asking "is there an isometry $V$ such that there is $|\psi\rangle_{BC}$ such that XYZ?", and we can reduce the "elementary objects" involved in the question.
We thus translate the question in the following on: given a generic isometry $V$, are there bases for $\mathcal H_B,\mathcal H_C$ and weights $p_k\ge0, \sum_k p_k=1$ such that the $|\Psi_f\rangle$ in (X) is entangled after partial tracing $\mathcal H_B$?
In this terms, this seems tightly related to the following more general question: given a tripartite state $|\Psi_{ABC}\rangle$ that is entangled in the bipartition $AB:C$, when is the reduced state $\operatorname{tr}_B[|\Psi_{ABC}\rangle\!\langle\Psi_{ABC}|]$ still entangled?
I don't have a good answer for this. I would have guessed that you get a separable state whenever you have maximal entanglement in the bipartition $B:AC$, but this simple condition appears to not be quite right: in such situations you get a balanced mixture of projection onto orthogonal states in $AC$, but this can still be entangled.
See eg examples below:

Consider as a toy example
$|\Psi_f\rangle = |000\rangle+|111\rangle$. Then partial tracing $B$ we get
$\mathbb{P}_{00}+\mathbb{P}_{11}$ where $\mathbb{P}_\psi\equiv|\psi\rangle\!\langle\psi|$, which is separable.
If instead
$$|\Psi_f\rangle\equiv (|00\rangle+|11\rangle)|0\rangle+(|00\rangle-|11\rangle)|1\rangle$$
then partial tracing we get $\mathbb{P}_0\otimes\mathbb{P}_- + \mathbb{P}_1\otimes\mathbb{P}_-$ which is again separable.
Yet another example is
$$|\Psi_f\rangle\equiv (|00\rangle+|11\rangle)|0\rangle+(|01\rangle+|10\rangle)|1\rangle$$
then partial tracing we get $\mathbb{P}(|00\rangle+|11\rangle)+\mathbb{P}(|01\rangle+|10\rangle)$. This is an $X$ state, which is also separable (see e.g. https://quantumcomputing.stackexchange.com/a/5565/55).
Note how in all of these examples, $B$ is maximally entangled with $AC$.
As an example of this not being the case, say
$$|\Psi_f\rangle \equiv |00\rangle|0\rangle+\left(\frac{|01\rangle+|10\rangle)}{\sqrt2}\right) |1\rangle
= |0\rangle_B\left(|00\rangle+\frac{1}{\sqrt2}|11\rangle\right)_{AC}
+ \frac{1}{\sqrt2}|1\rangle_B |01\rangle_{AC},$$
where the second identity is a rewriting to highlight the entanglement features in the bipartition $B:AC$. Properly renormalising the above you see that the Schmidt coefficients in this bipartition are $(\sqrt3/2,1/2)$, and thus the entanglement is not maximal. And indeed, you can easily observe eg via partial transpose that the reduced state is entangled.
For a state that violates the pattern above, consider instead
$$|\Psi_f\rangle = (V\otimes I_C) (\sqrt3/2 |00\rangle+1/2|11\rangle),
\\
V|0\rangle\equiv (3/2)^{-1/2} (|00\rangle+\frac{1}{\sqrt2}|11\rangle),
\qquad
V|1\rangle \equiv |01\rangle.
$$
Isolating $B$ you get the maximally entangled state
$$|0\rangle_B\otimes|00\rangle_{AC} + |1\rangle_B\otimes\left(\frac{|01\rangle+|10\rangle}{\sqrt2}\right)_{AC}.$$
However, tracing out $B$ you still get an entangled state, as again verifiable eg via partial transpose.

The question seems related to the topic of robustness of entanglement,
so a look at the topical literature there might help. Eg https://arxiv.org/abs/1809.00622 is a start.
Answer: This is not a fully characterised solution, but perhaps you will find it helpful...
We start by writing the initial $|\psi\rangle$ in its Schmidt basis,
$$
|\psi\rangle=\alpha|00\rangle+\beta|11\rangle.
$$
I'm going to assume that the input of the other qubit is pure for simplicity, though I don't think it makes much difference.
Now act the unitary on it. It must produce
$$
|\Psi\rangle=\alpha|0\rangle_C|\psi_0\rangle_{AB}+\beta|1\rangle|\psi_1\rangle.
$$
We take the partial trace over $B$, leaving
$$
\rho=|\alpha|^2|0\rangle\langle 0|\otimes A+|\beta|^2|1\rangle\langle 1|\otimes D+\alpha \beta^\star|0\rangle\langle 1|\otimes B+\alpha^\star \beta|1\rangle\langle 0|\otimes C
$$
where $A,B,C,D$ are $2\times 2$ matrices relating to partial trace of $|\psi_i\rangle\langle\psi_j|$ for different $i,j$. This is just a block matrix
$$
\rho=\left(\begin{array}{cc}
|\alpha|^2 A & \alpha\beta^\star B \\
\alpha^\star\beta C & |\beta|^2D
\end{array}\right).
$$
We know that this is a density matrix, so its positive. If $A$ is invertible and $\alpha\neq 0$, then
$$
\text{det}(\rho)=|\alpha|^2|\beta|^2\text{det}(A)\text{det}(D-CA^{-1}B)\geq 0.
$$
Now, you can take the partial transpose,
$$
\rho^{T_C}=\left(\begin{array}{cc}
|\alpha|^2 A & \alpha^\star\beta C\\
\alpha\beta^\star B & |\beta|^2D
\end{array}\right).
$$
The state is entangled if and only if this has a negative eigenvalue. Moreover, it can have at most one negative eigenvalue (according to https://arxiv.org/abs/1304.6775), so its determinant would have to be negative.
$$
\text{det}(\rho^{T_C})=|\alpha|^2|\beta|^2\text{det}(A)\text{det}(D-BA^{-1}C).
$$
So, aside from the special cases identified (i.e. non-invertible $A$), the conditions on $U$ are that it creates $A,B,C,D$ such that $\text{det}(D-CA^{-1}B)<0$ even though $\text{det}(D-BA^{-1}C)\geq 0$. Quite what that means in terms of $U$, I'm not sure (yet), but it is interesting that it does not depend on the Schmidt coefficients of the initially entangled state!


How to measure a currencies valuation or devaluation in relevance to itself

Question: Usually when currencies are devalued, the percentage change is given in relevance to USD or EUR.
Is there a way to measure the currencies change in value to itself or to all the world's currencies combined?
Answer: The measure of change of value of a currency in relation to itself is inflation (or deflation).
Comment: Thanks! What about all the world's currencies combined?
Comment: If you and I each have a $1 bill.  We could trade our $1 bills and be in exactly the same position.  Over time our $1 buy less stuff in the US Dollar economy, so did the USD lose value or did the stuff gain value?  More than stars in the galaxy there are ways to calculate what something is (or should be) worth.  BUT, one unit of one currency is not fungible with one unit of another currency.  I'm not sure why you would want a way to measure the value of a basket of currencies because you can't trade the currencies for each other and stuff varies in price from region to region.
Answer: It's very hard to measure the worth of an abstract concept like money, particularly over long periods of time. In the modern era we have things like the Consumer Price Index (CPI) in the United States, where the Bureau of Labor Statistics literally sends "shoppers" out to find prices of things and surveys people to find out what they buy. This results in a variety of "indexes" which variously get reported by media outlets as "inflation" (or "deflation" if the change in value goes the other way). There are also other measurements available like the MIT Billion Prices Project which attempt to make their own reading of the "worth" of currencies. Those kinds of things are about the only ways to measure a currency's change in "value to itself" because a currency is basically only worth what one can buy with it.
While it isn't "all the world's currencies combined", there is a concept of the International Monetary Fund's "Special Drawing Rights (SDR)", which is a basket of five currencies used by world central banks to help "back" each other's currencies, and is (very) occasionally used as a unit of currency for international contracts. One might be able to compare the price of one currency to that of the SDR, or even to any other weighted average of world currencies that one wanted, but I don't think it's done nearly as often as comparing currencies to the basket of goods one can buy to find "inflation".
Even though one might think what would be important to measure would be overall Money Supply Inflation, much more often people care more about measuring Price Inflation. (Occasionally people worry about Wage Inflation, but generally that's considered a result of high Price Inflation.)
In order to try to keep this on topic as a "personal finance" thing rather than an "economics" thing, I guess the question is: Why do you want to know? If you have some assets in a particular currency, you probably care most about what you'll be able to buy with them in the future when you want or need to spend them. In that sense, it's inflation that you're likely caring about the most. If you're trying to figure out which currency to keep your assets in, it largely depends on what currency your future expenses are likely to be in, though I can imagine that one might want to move out of a particular currency if there's a lot of political instability that you're expecting to lead to high inflation in a currency for a time.
Comment: Thank you! That was really helpful. I guess this shouldve been posted on stack exchange economics instead of here. However, the purpose of my question was that I wanted to know if there's any absolute way to measure a currency's worth instead of realting it to only one (or even 5 (SDR)). Do you think it is viable if i compare a currency's value to the average of all the world's currencies? Is there such a thing?
Comment: @user627154: Well sure, you *could*, but I'm not sure what actionable information one would get from doing so. I care much more about "What can I get for my money in the future?" than "How much money of other countries could I get?". I think you may be looking for more of an economics point of view and so, yeah, feel free to post over on [economics.se].
Answer: As the value of a currency declines, commodities, priced in that currency, will rise. The two best commodities to see a change in would be oil and gold.
Comment: Commodities change in cost per currency unit based on far more than that currency's devaluation. See the other answer provided - inflation attempts to be a measure of relative cost of *all* of a 'basket of goods' (ie: food, housing, fuel, consumer electronics, etc).
Comment: Inflation can be skewed by political policies. Gold is used by banking system for settlements. Oil is a needed commodity. I trust these two far more than published governmental inflation numbers. See shadow stats. Also Libor scandal.


Does doing nothing produce negative net present value? How can we show that?

Question: When evaluating investment projects, a popular approach is to calculate the net present value (NPV). A positive NPV suggests carrying out the project is better than not doing that, in light of the project's risk. But is "not doing that" the same as doing nothing? It seems the NPV of doing nothing is zero: all cash flows are zero at all time points, and thus their discounted sum is also zero. But doing nothing is clearly worse than, say, investing risk free as long as the risk-free rate is positive. However, I think the NPV of a risk-free investment should also be zero, as the appropriate discount rate is the risk-free rate. So zero is worse than zero... How do I reconcile these things and show that doing nothing is a negative NPV endeavor (actually, a non-endeavor) - if it is?
Answer: NPV just looks at actual cashflows so NPV of doing nothing is 0.
What you are thinking about is the concept of opportunity cost from economics. Every action/inaction has a cost that you need to forgo your next best alternative.
From economic perspective thus you are correct doing nothing when you have option to have risk free investment is creating economic cost for you. However, textbook NPV only looks at accounting revenues and costs. Any implicit costs, though economically important are disregarded in NPV calculation.   You could modify NPV to include this implicit costs and in fact in economic model when we have dynamic optimization problem of firm, a firm would discount economic profits that include opportunity cost, but I think unless you specify what you are doing most people would think you are making mistake in your NPV calculation so if you want to modify it, you should let your readers know.
Comment: @RichardHardy you can argue for modification of NPV you just need to be clear about it because if you just say I am doing now economic NPV people wont understand so you need to explain your modifications. Also, I always worked just in government or academia, but via discussions with a friend working in finance institution as I understood NPV would be used as a tool to figure out discounted value of cashflows, and that would be then used as *one* of the inputs into decision making process and skilled financier would realize that if there is risk free alternative it should be pursued
Comment: Thanks! Does that mean that essentially NPV is not a helpful concept when tackling this issue? That is, if I wanted to argue for what I am trying to argue for, I should not base my argument on NPV as it would lead me nowhere? (By the way, I tried asking this to ChatGPT, but it messed things up. This was my second encounter where ChatGPT is just not up to par.)
Comment: yea I do not think AI bot could process this kind of complex thought


When do I get the notification for the final acceptance?

Question: Does the paper that was accepted by the editor and transferred to the reviewers not mean that the paper got the final acceptance? Or can the reviewers still reject the paper?
Comment: Happy to answer below, but I would worry about your relation with your advisor or senior colleagues if you were unable to ask them about it before going to a collaborative website such as Stack Exchange. You will have many other surprises if you do not learn from an advisor or from your peers!
Comment: I think you have something backwards. It is editors who accept or reject. Reviewers only recommend.
Comment: @Buffy Thanks a lot ..excuse me if there is an issue and the deadline is at the end of this month but I didn't get any response or change to be with a reviewer .. will I get the notification after the deadline because I mail the lead editor without any response
Comment: @Jérémy i'm asking here for more experience from who is editor or reviewer .. thanks for your advice
Comment: Sorry, I interpreted your use of "accepted" as "accepted for publication" which is usual. Apparently you meant "accepted for review" which is a less common interpretation. But editors initially (usually) only make a superficial determination and pass a "reasonable" paper to a set of reviewers (2-3). They can take weeks to months to complete the review before the editor needs to make a decision about publication.
Answer: SHORT ANSWER:
The decision of accepting or not a submission for publication does belong to the editor, but accepting the submission for evaluation is not the same as accepting it for publication!
LONGER EXPLANATION:
I guess that the process might be different for each publisher, or even for each journal, but my experience of the process is as follows:

Upon receiving a submission, the editor

verifies that its format follows the guidelines of the journal,
checks that its content is within the scope of the journal,
set-up a list of potential referees for the submission.
The submission can be rejected if any of those three criteria is not fulfilled. If all three are fulfilled, the submission is "accepted by the editor", but only in the sense that the evaluation process will be allowed to go on, at the cost of more people's time.

The referees are sent requests to evaluate the submission or to propose alternate reviewers if they are unable to review it. The process can be iterated various times, until a set of willing reviewers is found, or the editor gives up and "rejects" the submission for lack of willing referees.

Once willing referees have been found (ideally, two or three of them)  they are sent the submission (ideally, double blind so that to avoid biases), instructions (ideally, an evaluation form) and a deadline to send their evaluation in.

At the deadline, the editor teases the referees who did not send their review (it happens more often than you would think!) until receiving all the reviews, check them for inadequate comments, and forward them to the authors if judged adequate, along with a decision, typically a) refusal, b) conditional acceptance or c) acceptance.

The process can iterate various times with referees asking questions and requesting corrections and the authors answering or complying, until the editor accepts the submission or fails it (most often following the recommendations from the referees, but   not always: it is their decision to make!)

I hope it helps! (And anyone willing to correct or extend my description of the process should feel welcome to do so!)
Comment: Yes, you will get an answer from the editor AFTER the deadline for the referees to send their answers (and sometime quite a long time after: as I described above, sometimes the referees send their reports late). I would recommend NOT bothering the editor before one month after the deadline. I had once to recontact the editor every 6 months for several years in a row about the status of a given article (to have the editor answer that he was rejecting the submission since I was asking about it).
Comment: thanks a lot for your answer but excuse me if there is an issue and the deadline is at the end of this month but I didn't get any response or change to be with a reviewer .. will I get the notification after the deadline because I mail the lead editor without any response
Comment: the last question please .. if the state changed to be under review that doesn't mean the editor found the reviewers, right?
Comment: When the publisher's website indicates "Under Review", it DOES mean that the editor found some willing referees and sent them the article for review.


How much would writing a thesis help for a person's career in industry(not in academia)?

Question: There are many people who pursue a thesis-based master's degree but do not want to pursue academia after graduation. If people just want to have a good job, is thesis writing helpful to them? My major is electrical engineering.
Comment: Could you be more specific about your question? The value of completing a written thesis likely varies by field and position, even in industry.
Answer: I can think of two reasons you might want to write a thesis.

If you would inherently enjoy the challenge.
If digging in and writing up specialized knowledge in a particular topic might be related to your future work on the job.

Either of these would be a good reason -- you don't need both.
Answer: Actually having a Ph.D. can be seen as a disadvantage in industry. I have met this attitude from a couple of employers / potential employers. They see you as an academic, and not wanting to do real work.
I think it would be less of an issue with big employers, but certainly smaller ones, at can be an issue. It may be worst in my case, as I spent a number of years as a post-doc at university.
If you don't want to do academic work after university, and just want a good job, I'd personally suggest the case for doing one is rather weak.
Others experience may be different, but I personally think the main thing you get out of a Ph.D. is the ability to do research properly. That is a transferable skill. My Ph.D is Medical Physics, but I work in a completely unrelated field (I'm director of Kirkby Microwave Ltd, developing vector network analyzer calibration kits) The skill of doing research I learned during the Ph.D. are very relevant to the products I develop, and hope to develop, despite they have nothing to do with what I actually did during my Ph.D.
If you go into industry after 3 years spent studying for a Ph.D, you will probably find your manager does not have one, and is earning more than you!
I can't recall where I read it, but there was an analysis somewhere of what it costs to do a Ph.D. If you consider a "good job" one where you gets lots of money, you will probably find the loss of income for those 3 years is significant and you may never make it up in your lifetime.
Comment: The question is about writing a thesis as part of one's master's degree, not about doing a PhD.
Comment: Oops - my error.