Following normal physics, can a world be unable to make electronics due to a lack of resources/materials?

Question: I want to have a post apocalyptic world where 21st century tech is unable to be made anymore due to humans using up all the resources on the planet. Since space programs also use computers, there should be no way to get to space either. The problem is that I do not know if it is feasible for the human race to run out of enough raw elements to make consumer electronics. It is acceptable to have some of that tech to still exist, I just want to know if it is feasible or realistic for humans to run out of stuff like copper, gold, etc. I would preferably like the world to be set in 2080, if so possible. I am willing to go up to 2110 if not. There are no sci-fi elements, like aliens and such, except for the wasteland that is earth.
Comment: Let us [continue this discussion in chat](https://chat.stackexchange.com/rooms/140804/discussion-between-dburn2023-and-pelinore).
Comment: I'm just picturing this dirty, old guy wearing goggles going to town on a block of silicon with an itty bitty rasp and a tiny soldering set while giggling to himself.
Comment: "Since space programs use also use computers..." -- you have a false premise here.  It wasn't until the Apollo program that NASA made heavy use of computers; it took the Soviet Union even longer.  The Mercury rockets were designed and launched mostly through the use of slide rules.
Answer: What does it mean to have depleted resources?
With the exceptions of atmosphere that has sublimated into space and mass converted to energy by nuclear power and bomb testing (and maybe a few other things, but you get my point), every atom of material that started on the planet is still here. Through chemistry, we've manipulated those atoms, but they're all still here. The idea that a point in time could come where a critical material needed for manufacturing electronics was gone is hard to believe. One would only need to start digging up old trash dumps to get access to those materials and fire up chemistry to recycle them.
So, what's missing in a post-apocalyptic world that would prohibit high-tech manufacturing?

The supply chain. Most people don't realize just how large and complex the high-tech supply chain is. It's massive. And one of the reasons it's massive is that an honest analysis of the supply chain can't ignore dependent chains. All those raw materials that go into an integrated chip. That go into the machines that make integrated chips. That go into the tools that maintain the machines. That go into the machines that make the clothes of the people who perform the maintenance. That go into gathering, processing, and shipping food that feeds all those maintenance workers. And that was just an infintesimal sliver of the supply chain. That supply chain simply won't exist post-apocalypse.

Some chemicals are very hard to handle. During a safety class at my first post-university job, one of the fabrication scientists was reviewing how to manually detect dangerous chemical situations (never trust the automation!). One of those chemicals was hydrogen cyanide, which at that time was used during the integrated circuit manufacturing process. He explained that it smells like almonds — o'course, you're probably dead at that point, so the idea was primarily academic. My point? Post-apocalypse you might not have the ability to handle the dangerous chemicals needed for or produced by high-tech manufacture.

As @L.Dutch mentioned (I upvoted his answer, you should too) post-apocalypse you might not even have the ability to build and/or maintain the machines needed for high-tech manufacturing. Remember that supply chain I mentioned? There is a similar "knowledge chain" that's required for those machines to work for any length of time. Scientists, engineers, and technicians from the machine manufacturer down to the machine user and you need all of them. Take too many of them out of the "knowledge chain" and you get the same kind of collapse you see when you disrupt the supply chain.

And speaking of chains... there's also the need for electricity (a LOT of it), water (a LOT of it), waste processing (a LOT of it)... But if we ignore everything and only focus on electricity, high-tech manufacturing facilities use their own substations. Their power requirements are enormous. You're post-apocalypse, so let's simply consider running train after train of coal to the local power plant to keep the power going. I live next to train tracks that run eight coal trains, each 2 miles (3.2 km) long, seven days a week. I'm told they supply one power plant in Washington. (And the supply chain... miners, train workers, dock workers... repair/replace trucks, diggers, train cars & engines, track...).

And then there's Mad Max...
You just can't have a post-apocalyptic world without the kind of drama we saw in the Mad Max movies. Oh, it's not the Hollywood flash-bang I'm talking about. It's the sense of lawlessness and chaos. High Tech depends on stable civilizations and stable governments.  Why?
As an example, it's a whomping big deal when a fabrication facility shuts down. A small facility can lose a million dollars a day. A big one can loose a million dollars an hour. Planned shutdowns for maintenance are one thing, but the power suddenly shutting off is very much another! The one time I remember it happening, the company literally just sent everyone home. All of us, right down to the janitors. Every possible penny of expense was salvaged while the building support staff worked around the clock to get the power back online. Yup, these facilities have backups after backups after backups — but nothing is ever perfect. If it's that sensitive in the Real World, imagine the problem of keeping one running with twenty cars circiling the facility shooting bullets into it.
Conclusion
While I don't believe you can rationalize the inability to manufacture high-tech due to a lack of resources, I think your real problem would be rationalizing the ability to manufacture high-tech at all. There's so much civilization that high-tech depends on — and post-apocalypse, some or more of that civilization is usually gone.
@AlexP makes a good point: as the size and stability of post-apocalyptic government increases, so does the ability to manufacture high-tech components. Given the inevitable amount of equipment left over after even a classic apocalyptic event, the odds are very good that 1960-1970 grade electronics could be manufactured almost immediately, 1980-1990 grade electronics within a few decades, and 2000-2010 electronics a decade after that. Humans are nothing if not tenacious — and we've decidedly proven that we love our cool gadgets.
Comment: @AlexP so then the corollary of that, would be if there is no law, or government, then there would be no reliable manufacturing? I think that is what JBH was saying with the Mad Max part
Comment: @Dburn2023: If there is no law then there is no functional economy. 90% of the people are dead. (You do realize that without modern technology we cannot feed and clothe and shelter 8 billion people, right?)
Comment: This is the correct answer. You may want to emphasize however that *if* there is a reasonably large state structure still surviving, and *if* they absolutely want to, there is no way to prevent them being able to make '486s in about 20 years time. More advanced stuff, it's hard; but '386 and '486 level electronics, any functional state of a decent size can aspire to make it. (And hydrogen cyanide smells like almonds because *it is what gives almonds their smell*. Yes, almond pits release HCN in tiny or even not so tiny amounts; yes, you can smell it at concentrations well below danger.)
Comment: Dburn2023 Here in the U.S. Northwest the supply chain is still recovering from the effects of the COVID pandemic and I need only look at how long it took New Orleans to recover from Hurricane Katrina back in 2005 to know that "natural" events can easily disrupt supply chains. However, your comment is very revealing. It appears you're not looking for how to stop high tech per se, but are looking for a way for human society to degrade by natural causes. An Ice Age might do that, as might a sufficient qty of solar flares. @AlexP, any ideas about a "natural apocalypse?"
Comment: @Dburn2023: *"Is it possible or probable for the supply chain to be disrupted without human intervention":* every other year or so you hear about some dreaful shortage of hard disks or memory chips or such stuff because there was a flood in Vietnam or a fire in Taiwan. Many essential parts (not only in electronics) are made in only a small number of factories somewhere in the world and when one of those factories gets put of order by some accident the supply chain gets disrupted. (Try to find out from where do all the zippers in the world come.)
Comment: This is a well thought out and comprehensive answer. I looked up supply chain disrupting mechanisms though, and it seems like a lot of them are man made (political upheaval, economics, terrorism, and cyberattacks)cyber attacks. Is it possible or probable for the supply chain to be disrupted without human intervention (i.e. if you just wait long enough, will the supply chain be disrupted?) The goal of using the lack of natural resources was to have a passive mechanism for the apocalpse/state of the world. A disaster that just happened, over time.
Comment: @AlexP That's a good point and I"m happy to include it. Fundamentally, as the quality of civilization increases so does the capacity to re-embrace high technology. Also, I had no idea HCN was what gave actual almonds their smell! That wasn't part of the presentation.
Comment: @AlexP I didn't know that, I don't read the news. I looked it up and I saw some examples. Could that make manufacturing electronics hard or unpractical?
Comment: @Dburn2023: That is why I said that you need to have functional state of sufficient size and with sufficient will power, to be able to build and control a complete supply chain.
Comment: Since people can disobey the government if they are willing, then social unrest where all the citizens disobey the government would lead to no tech and a degraded society?
Comment: @AlexP yes. Without the factories for food, water treatment plants, trucks, oil wells, housing, etc. Lots of people won't have their needs met.
Comment: This is a frame challenge, not an answer to OP's question. The question was "Can resource depletion stop us from making electronics?" This answer is "In post-apocalyptic setting, supply chain issues would prevail." However, this answer does not try to isolate supply chain issues from resource depletion issues. On the other hand, it makes an impression that those two issues can not be isolated - without an attempt to prove such point.
Comment: @Alexander I do answer the question. "While I don't believe you can rationalize the inability to manufacture high-tech due to a lack of resources...." The belief is based on the assertions made in the first paragraph, which deals with the difficulty of resource depletion.
Comment: @JBH I see - though you didn't consider the possibility that some technological solutions may become cost prohibited.
Comment: @Alexander Yeah. No such thing as a perfect answer.
Answer: Making state of the art electronic is not only a problem of materials, but also of technology. While any amateur can expose board with a resolution of several microns, going to the nanometer scale requires complex machines.

Although several years delayed than its initial plan, extreme UV lithography (EUVL) with 13.5nm wavelength has been finally implemented into high volume manufacture (HVM) of mainstream semiconductor industry since 2018. With the delivery and installation of ASML EUV scanners in those giant Fab players like Samsung, TSMC and Intel, EUV lithography is becoming a sort of industry standard exposure metrology for those critical layers of advanced technology nodes beyond 7nm. Although ASML NXE EUVL scanner is the only commercialized EUV exposure system available on the market, its development is the concentration of all essence from worldwide industrial and academic collaboration. It is becoming more and more important not only for fab runners but also for main stream fabless design houses to understand and participate the progress of EUVL.

And to make those machine one needs also the electronics made with those same machines, or those from the generation before. To put it simply, you can have all the silicon wafers, gold, copper, indium etc. of the world, but if you don't have a litho fab you won't get any decent (for today standards) electronic.
And that is way more easy to achieve in a post apocalyptic scenario. Vacuum tubes might be done, but will never achieve the performances of today electronic.
Comment: This might work. From what @pelinore said about the materials not being an issue, the difficulty of making electronics should suffice. The only thing is that the apocalypse I was looking for wasn't a nuclear war or an asteroid hitting the Earth (nothing destructive). Do you know of a way that the high tech labs and such could be absent due to a passive cause?
Comment: @Dburn2023: No it doesn't work. This answer refers to bleeding-edge state-of-the art integrated circuits. A lithography machine capable of making the masks for an 80386 or 80486 is not quite so very hard at all; and I can assure you that those were sufficiently powerful for anything practical.
Comment: You don't need modern electronics to get to space
Comment: Also, vacuum tube technology never was developed to its limits because it never become necessary...
Answer: This is not feasible.
Most of the chip is silicon coming from just about anything, Earth is full of that and it is not too difficult to purify to something reasonably good. Dopants are common. The remaining materials such as rare earths are available mostly everywhere too. Yes, there are some countries dominating the supply. But this is because they have most suitable deposits, laws, tools and know-how to make extraction and purification profitable on a large scale. I daresay 90%+ of countries could get all required materials for chip manufacture on their soil, it just wouldn't be environmentally friendly or cost effective, so they don't. But blow up / infect / ... the rest of the world and Madagascar as the obvious safe spot becomes the world powerhouse in chip manufacture.
So, you need to break down everything. JBH's answer talks about supply chains and this is a good starting point. The main problem with it is that an ancient process doesn't require all that much fancy stuff, especially as we have worked out most of kinks. You can prevent 2020 tech. Perhaps make 2000 tech need many years to get back to. But 1970s tech can be set up fairly fast after complete collapse.
Next step would be that people forgot how to make chips. You can't really do that, unless the apocalypse wipes out adults and leaves just children alive. They would remember what glorious toys they had, but have no idea how to make them.
Yet another way of stopping chip manufacture is if your chips were responsible for the apocalypse so nobody wants to make them - but this is a fairly common trope these days.
Comment: @Hobbamok Knowledge to make state of the art stuff would be indeed lost easily, kill the top scientists/engineers/... and you set the field back years if not a decade even without apocalypse. The problem is wiping out knowledge how to make 70s chips. Even a small Slovenia has people making old tech chips - you can't realistically assassinate everyone.
Comment: Not just wipe out the adults. Wipe out all the books. Bazillions of tons of books located everywhere from people's houses (like mine, microelectronic design, physics of fabrication, etc.) to high school, college, university, *and corporate* libraries. Wiping out the lab notes and folders full of data and observations of hundreds of millions of people.... Wiping out knowledge has been asked about on the Stack. It's really, really, really hard to do.
Comment: >You can't really do that, unless the apocalypse wipes out adults and leaves just children alive.
 Nah, a dedicated Hitman organization with like 20 people and 4 helicopters on each continent yould wipe that knowledge out easily in global chaos. I study computer science (incl a how cpus are made class) and I would be absolutely lost
Comment: True, I was too focused on semi-modern stuff, but the basic processors you can make in your basement with maybe a couple of scavenged chemicals. That won't bring you to the moon, but should be enough to replace control elements in essential machinery or so (with enough skill)
Answer: Have difficulty yes, unable no
For the working scenario I take a process of recovery from post-apocalyptic state when commercial stability has been restored, and there are resources to resume production of the more and more technologically complex products, but lack (or expensiveness) of raw resources creates obstacles on this path.
Some of the resources that our civilization is using are considered non-renewable, such as oil and gas. Ores, on the other hand, while non-renewable, can be recycled. There are not so much easily accessible gold deposits anymore, but most of what people have mined so far is recoverable. The only question is the price of it.
So, under this working scenario it is possible that recovering civilization can be starved off certain materials that are presently necessary in electronics. Gold is one such example, rare earth elements is another.
However, semiconductors in general should not be affected. Silicon, as well as most doping elements are broadly available and in not in any realistic risk of depletion.
With realistic depletion, the cost of new gadgets may make them too expensive for the consumer segment, but as mentioned above, the elements themselves are still available here on Earth, research and development would still be possible, albeit at a higher cost.
One notable exception to this is Helium. While almost all other elements stay put on Earth, Helium, once extracted from the Earth cavity, eventually escapes to space. So this new civilization may have to cope with shortage of helium, which would put restraints on its superconductor research and fields related to it.
Comment: Helium is semi-renewable, in that it is leaking from far underground.  Much of the helium we use is trapped in natural gas deposits, where it leaks up from below then gets trapped by the same barriers that keep the methane from escaping; those deposits aren't renewable.  But over long periods of time (geologic?) new deposits will form; of course, the same may be true of methane deposits
Comment: Funnily enough, for a lot of materials (like copper), it's now profitable to mine old waste heaps from mines - they often have more easily recoverable material than actual ore (as high concentration ores are depleted). In a post-apocalyptic scenario, you'd have even nicer "deposits" of human waste all over. Raw resources are not going to be a problem, except for oil and coal.
Comment: *Gold?* Electronics consumes a small fraction of the gold extracted. The bulk of it is either stored or used for jewelry. And gold is fantastically expensive *right now*, but that doesn't prevent the use of tiny amounts in electronics.
Comment: @AlexP - sure, my argument here was about the rising cost rather than depletion.
Answer: Materials required to fabricate many types of electronics compose roughly 50% of the Earth's crust.  It would be virtually impossible to get rid of them all.
The earth's crust is made of...

27.7% silicon
8.1% aluminum
5.0% Iron
3.6$ Calcium
2.8% Sodium
2.6% potassium

Silicon's primary use in electronics is to make semiconductors (transistors, diodes, microchips, etc.).
Aluminum itself is actually a really good conductor.  It can be drawn into wires and used to make coils for transformers, electric motors/generators, power transmission lines, etc.
Iron, while a much worse conductor than aluminum, is still a viable choice in many cases.  And can be used to make stuff like electromagnets and inductors.
Calcium Sodium, and Potassium all have their uses making batteries.
It's probably more likely that knowledge, practical expertise, and infrastructure required to make advanced electronics would disappear rather than the actual materials necessary to do it.
If engineering and production facilities of tech-corporations are destroyed, universities are destroyed, libraries are destroyed, and the internet goes off-line that knowledge would exist mostly in the minds of knowledgeable professionals and whatever private reference books they own.
If those professionals don't pass on their knowledge to the next generation, it's possible that knowledge could become virtually lost within a generation or two.  This could happen either because schools are not operational, professionals are specifically targeted for elimination, or they simply stop practicing their skills and don't take on apprentices (perhaps because they are busy trying to survive, can't get work in that field, or can't get the materials to perform their jobs).


Couldnt enable SSH headless

Question: I still get access denied massage when I try to login with putty even with file named "SSH" in boot partition.
Comment: I agree, seems you're connecting to your router's SSH server.  Try connecting to the router (web UI if it has one) and find a list of known machines (or DHCP log) and see what IP's are actively used right now.  You can probably pinpoint the Pi pretty quick (default hostname is raspberrypi I think).  If you don't have access to the router, install nmap and run nmap 192.168.2.0/24 to scan the entire class-c. It should run multiple checks (ping, basic port scan, and I think attempt OS identification).  It should tell you pretty quick which IP your Pi is sitting on.
Comment: If it's really the Pi then the SSH daemon is working, so the `ssh` file-configuration worked. You need to provide the correct password or ...connect to the correct machine. It would be pretty unusual (although not impossible) for a router with default configuration to give `.1` address to the client machine.
Comment: That you're getting as far as that response screen means that you're connecting to *something* at that IP address. I notice that 192.168.2.1 seems to be the default address assigned to Belkin routers - is it possible you're trying to connect to your router rather than the Pi?
Answer: It's already working since you can connect to it. Putty would give a connection refused error otherwise.
In this case, make sure you typed the password correctly. If you did not change it, the password should be raspberry. Another possibility would be you're connected to the wrong machine.
Answer:
make sure you used the up-to-date image to install from, the ssh file option is new.
if you are in an environment where other raspberry pi can be connected (company network), make sure you are connecting to you own raspberry pi. A few weeks ago I thought setting up my raspi and realized too late that I completely screwed another departmens Dashboard ;-) they just used the standards without bothering to change the password or hostname... See next step.
Did you already log into your pi lets say with a monitor and keyboard or alternatively with console cable / COM port? If you can do that, than it would make sense to change your hostname from raspberrypi.local to something else. If your network / device uses bonjour/zeroconf you could ping your device with the new hostname you just created. This way you can be sure your are addressing the correct device.
if you are logged in use raspi-config and check again that SSH is enabled.

In short: I believe you either trying to log into the wrong device, or have the wrong password, or both.

Couldnt enable SSH headless


Two bulbs of different wattage in one AC circuit

Question: If I connect two bulbs of different wattage in one circuit, can that lead to problems? Is that a bad idea?
Does it make a difference if the circuit is serial or parallel?
Comment: In parallel - and they are the same voltage - no problem.
Comment: For proper operation in parallel, they should be the same voltage, for proper operation in series they should have the same current rating, that's it, as long as that criteria is met, the wattage is not important (but you can find the current from the wattage I=P/V)
Answer: Parallel
All the mains bulbs in your house are probably in parallel so that should satisfy you that that works. Each lamp will draw the current it requires.

simulate this circuit – Schematic created using CircuitLab
Figure 1. Your house wiring. This system works well because the lamps are fed from a constant voltage supply.
Let's do some easy maths using a 100 V supply. \$P = VI\$, where P is power, V is voltage and I is current. Using Ohm's law, \$ V = IR \$ we can modify the power formula to get \$ P = I^2R = \frac {V^2}{R} \$. Rearranging the last one gives us \$ R = \frac {V^2}{P} \$. This is hot\$^1\$ filament resistances were calculated.
Series connected similar lamps
If you put equal lamps in series they will divide up the available voltage between them and the current will be \$ \frac {1}{n} \$, where n is the number of lamps.\$^2\$

simulate this circuit
Figure 2. In this circuit both lamps have the same resistance so will drop half the supply voltage across each. Since the total resistance is doubled the current will also be halved. Since P = VI then the each lamp will be running at 1/4 power.
Series connected dissimilar lamps

simulate this circuit
Figure 3. More voltage is dropped across the higher resistance / lower wattage lamp. It will glow the brightest.
If you put unequal lamps in series the one with the highest filament resistance will limit the current to the others. It may also glow the brightest (if they're all the same voltage rating).
Power calculation for each lamp:

100 W: \$P = \frac {V^2}{R} = \frac {33^2}{100} = 11~W\$.
50 W: \$P = \frac {V^2}{R} = \frac {67^2}{50} = 22~W\$.

Note the possibly surprising result that the lower powered lamp will be brighter and consume more power.

\$^1\$ Lamp filament resistance increases dramatically with temperature. I have not factored this into the calculations.
\$^2\$ Again, the current calculation will be higher than calculated here because the filament resistances will be lower when cold.
Answer: Assuming that you are connecting two light bulbs of the same voltage rating, but different power, to the same AC source, you have two cases:

Series: the bulbs are both dimmed and cannot operate at rated power because they are sharing the voltage of the supply (voltage divider); this is usually not done for household lighting
Parallel: both bulbs will operate at their rated power like normal; this is effectively what happens in a chandelier or when multiple lamps are powered by the same light switch
Answer: If you are using constant-voltage bulbs, then you should parallel any mixed bulbs of the same voltage.  Constant-voltage bulbs include pretty much any incandescent bulb or packaged bulb-like product or integrated fixture in common use on mains voltage, including whole Christmas tree light strings as a product, and constant-current bulbs packaged to be constant-voltage, such as LED strips.
Mixing is fine.  You can parallel any light intended for mains voltage.  You can parallel any 12V lighting including LED strips of any length.
If you are using constant-current bulbs, then you drive them in series, so you only need one constant-current power supply.   This typically comes up when building an array of raw LED emitters.  Most people keep the entire array matched, but you could mix them if current is the same.
Many lamps must be driven constant-current, or they will burn up.  Including fluorescent, neon, mercury vapor, metal halide, LPS, and HPS. It may make sense to "series" them to save money on power supplies, but if one bulb blows, they all go out.  Some fluorescent ballasts do just that.  That's not a big problem for LED emitters, which will likely outlast the driver circuit.
Incandescent lights are a relatively linear load, they work well in parallel but can also go in series if they are matched.  For instance Christmas tree lights, electric railway lighting (5x120V=600V) and street lights in a few older cities, notably Detroit.


What's the relationship between the risk-neutral probability in HJM and the risk-neural probability under domestic money market?

Question: In shreve's book, we model the stock price dynamics as:
$$S_i(t) = \alpha(t)S_i(t)dt +S_i(t)\sum ^d_{j=1}\sigma _{ij}(t)dW_j(t)$$
and the forward rate can be written as :
$$df(t,T) = \gamma(t,T)dt + \sum ^d_{j=1}\beta _{ij}(t,T)dW_j(t)$$
I'm wondering are we assuming the risk factors $W_j$ to be the same for stock price and forward rate, and they could be viewed as the risk factors for the financial market. or they are different? And what's the relationship between the two risk neutral probability measures in two models?
Answer: A priori, if those two $W_j$ notations are in the same paragraph, they identify the same Wiener processes, under the same probability measure. So yes, they are seen as the different risk factors in your financial market.
If you assume that your $W_j$'s are independent of one another, you can introduce correlation between your two variables (stock price and forward rate) by changing the volatility vectors, as long as you keep the Euclidean norm of those vectors (which is the total volatility of your variables) unchanged.


One person patenting a biology researcher's published idea

Question: If a biology researcher publishes a paper indicating that a certain molecule can be used to treat a certain condition, can another person then patent that molecule or would the right to patent that molecule be exclusively the original researcher's? If that researcher does not patent that molecule, would it then become freely usable by anyone? (It seems to me like the idea to treat this condition in this way would then be public knowledge.)
Comment: AFAIK, the patenting of medicines is often a special case (but no jurisdiction ins mentioned). This is relevant, because often you simply **cannot** patent a molecule. What you can and do patent is a production process. Many jurisdictions will admit medicines onto their markets only when produced by an approved production process. Together, these two measures serve as a limited protection, but novel production processes of the same molecule would not be protected.
Comment: It can become more complicated in other fields. If a computer science researcher comes up with an algorithm, then publishes a paper describing the algorithm (but lacking some important details, such as how to tune some parameters) then they can still patent the algorithm, but I think the patent really only protects the details that were not disclosed in the paper.
Comment: @MSalters I don't believe that's true, novel chemical matter usually falls squarely into the "composition of matter" category of patents. There are many patented molecules including pharmaceuticals, preservatives, pigments, pesticides, and plastics. Generic pharmaceutical companies must wait for the original patent to expire before they can legally produce the same drug molecule, regardless of the manufacturing method. If that wasn't the case, generics would rush to find alternative manufacturing methods and cut out 99% of the drug development process.
Comment: When two people state contradictory "facts," a citation to a reliable might be helpful.  Even Wikipedia would be better than nothing, since it usually cites good sources.
Comment: @NuclearHoagie: "Composition of Matter" speaks to eligibility, and is part of the evaluation. I looked at the EPO Guidelines for Examination, and as I read it the problem with patenting a molecule would be the "Inventive step". What is the inventive step in a molecule? Now, there obviously can be an inventive step in the production of a molecule, or its application, but not in the molecule itself.
Comment: For the "special case of medicines", see the section ["First or further medical use of known products "](https://www.epo.org/law-practice/legal-texts/html/guidelines/e/g_vi_7_1.htm). "A claim in the form "Use of substance or composition X for the treatment of disease Y..." will be regarded as relating to a method for treatment explicitly excluded from patentability under Art. 53(c) and therefore will **not be accepted.**" That seems to cover exactly this question.
Comment: @MSalters I don't see why you wouldn't consider the design of brand new, non-naturally occurring molecule that has never existed before to be an act of invention. You often patent the the production method as well, since patents require a practical implementation - you can't patent a theoretical molecule you've never synthesized. But that doesn't mean the molecule itself doesn't have patent protection. See this pharma patent which clearly claims the chemical structure as IP (see Claims): https://www.lens.org/lens/patent/001-892-512-397-359/fulltext?l=EN#claim
Answer: Once thwe molecule and its use have been published, that becomes prior art, and no other person can patent this. Whether the original researcher can seek a patent, or is precluded by his or her own prior disclosure, I think depends on the exact facts. I know that in some cases, disclosing an invention  to the public waives any claim to a patent.
Comment: Correct, such research publication would inexorably result in the finding of it being prior art. Limited disclosure may be saved in the U.S., but not elsewhere if the fact is established before the court. (As a matter of practical reality, one may get away with some disclosure elsewhere, but there is no legal basis for its protection. The U.S. has provisional patents and, to my knowledge, no other similar legal fiction exists elsewhere)
Comment: It also depends on the jurisdiction. I believe some jurisdictions have a "self-prior-art exception", at least for certain kinds of patents.
Comment: I'm not up on current patent law, but I was told years ago that in the US the inventor had one year from either trigger to file for a patent.  The triggers are (1) public announcement, or (2) offer for sale.  In this case, the article would establish (1).


Best practice for currency input fields

Question: I'm working on a web application, which I just received a request to make all input fields collecting currency data to be right aligned.
Is there a standard for collecting currency data in a web form that mention right aligning.
Comment: It is worth noting that the number input type (``) is right aligned by default.
Answer: The reason that currency is normally right-aligned has to do with scanability.
It's normal to right-align any numerical data that is going to be scanned in a column. This is so that when you scan visually down the page, you're always comparing the same digits in each number.
If they're left-alighed you get this problem:
<code>1111
12222
166666
</code>
If you scan visually down the left edge of this figure, in the first row, you're looking at a glyph which represents thousands, in the second row a glyph which represents 10 thousands, and in the third row a glyph which represents 100 thousands.
These glyphs aren't directly comparable.
If the numbers are instead presented like this:
<code>  1111
 12222
166666
</code>
Then as you look down from a glyph to the glyph below you'll find it's directly comparable.
Since this property isn't really important on a web form, arbitrarily right-aligning a currency field there would just be cargo-cult UX.
Answer: If I'm correct Microsoft Excel aligns currency to the right of the table cell. The person requesting the aligned might be familiar with that program (as will a lot of people be).
If your target audience isn't that wide you could easily do some research to find out if your audience is familiar with Excel. If so, right aligning currency can trigger familiarity with your user and could even make them like your app more.
Other than that, it shouldn't really matter.
Comment: This is correct. It's a small user base that's familiar with working in Excel.
Answer: I believe balance sheets and accounting sheets have currency right aligned.  I would say it may be what people with experience in accounting are used to.  I would just recommend from a usability perspective to make sure it doesn't mess the flow of the user's input.  So if the user is entering information just fine and then has to adjust dramatically to a right alignment it may be something to look into.  Just my two cents.

Best practice for currency input fields


Why do polarizable nucleophiles favor SN2 over E2?

Question: Weakly basic ions and polarizable bases favor $\mathrm{S_{N}2}$ over $\mathrm{E2}$. Why? The argument used that polarizable nucleophiles form bonds earlier, stabilizing the transition state, can be applied to either $\mathrm{S_{N}2}$ or $\mathrm{E2}$.
Answer: Polarisable Nucleophiles increase the rate of an Sn2-type reaction but not an E2 reaction because the more polarisable a base is, lower the electronegativity and charge density (conversely, higher ionic radius) it has.
Now, we know that the basic strength depends on these factors( in a period, we check the electronegativity and in a group, the ionic radius).
As, the Rate Determining Step of an E2 reaction involves the attack of a base, lower basic strength would mean that the reaction would be slower. Hence, more polatisable bases means that E2 would be slower.
Comment: But why doesn't the stronger bonding in the TS for E2 that would result from using a more polarizable nucleophile matter
Comment: the base is only used for removing H+ ion from the carbon in the rds.


How to train a commoner to a level 1 character

Question: A player in my game wants to train some commoners to be a level 1 character. How long would this take and how much would it cost?
Answer: By the Books
There is no answer to this question, either RAW or RAI. NPCs are statted exactly the same as monsters- unlike in Pathfinder and older editions of Dungeons and Dragons, they have no system for progression in the rules.
Hence, they do not have levels in character classes.
If you decide to house-rule, consider the following rules for adventurers that will come into effect here:

The PC must pay the living cost of the NPC while they're training, unless the NPC can pay it on their own. The details for this are given in the PHB.
It is presumed that your character has some sort of history that lead them to become a Fighter, Wizard, or other PC class. This implicit assumption would likely also apply to any NPC who is about to become a member of a "heroic" class. The exact details are strictly up to the DM here.

My Opinion as a DM
Aside from the logistics, I would be extremely wary of a player wanting to do this. I can see three cases:

The player wants to have additional characters to roleplay.
The player wants to abuse Leadership shenanigans that often arose in 3.x games.
The player wants to have a bunch of heroes running around the world.

Case 1 can be fun with the right campaign and the right group. Think of it as an ensemble cast game, where not everyone goes on every adventure (see Firefly, for fiction in this style).
Case 2 will lead to major problems in your campaign. Monitor this very carefully. Building up a follower base can be used to extend the functionality of one's character.
Either way, be very careful with this. Gaining followers undermines several class benefits, such as the entire Beast Master archetype, and the Warlock's Pact of the Chain. NPC followers have been traditionally abused in previous editions. Remember that an NPC adventurer will want to adventure, and adventurers are not generally followers.
Case 3 is the situation I would outright disallow. There's no benefit to the added headache.
Comment: Just for a difference in perspective, this is exactly the sort of shenanigans I would expect to see out of my regular TTG group, all the way back to our first Dark Heresy mission where our Cleric used his speech skills to rouse a lynch mob in the middle of the hive to tie up the local law enforcement, who were completely corrupt. That's partly how we ended up resolving the introductory mission given in the rules. This kind of gameplay is definitely manageable if you don't just "give up" to the players' unconventional methodology. That said, the jump from "commoner" to "level 1" is a large one.
Comment: "NPC followers have been traditionally abused in previous editions." This is technically true, but the nature of the abuse varied. Prior to 2e, followers were assumed to be a significant resource of most high-level groups; They were "absued" only in the sense that applies to all poorly-treated employees. Editions after 3e assumed that PCs do everything themselves. In 2e the assumptions varied from adventure to adventure and campaign setting to campaign setting, but 3e was the real turning point: It had rules for NPC followers, but never assumed that PCs would take them on adventures.
Comment: I have removed my suggested house rules- they were untested and made assumptions about the player's intent.
Comment: Can you clarify Case #3? If you mean the hypothetical player wants NPCs performing quests on their behalf off-screen, that may be appropriate for some campaigns. Since the players won't actually witness Bob-the-Level-1-Peasant's combat encounter, you can just roll once for the outcome and move on. Not really a headache, IMO.
Comment: It's also worth noting that because of 5e's scaling (or lack thereof), a follower who's 5 levels behind the party is a lot more useful in a fight of the party's level than would be the case in most previous editions. For that reason DMs should be *much* more cautious about allowing the party to train up followers than they might have been in the past.
Comment: I would add to @gmjoe s remark in that followers were required to run a stronghold.  Case 2s post in of extending the character is exactly why you need followers, when you've saved the kingdom a few times you tend to attract unwanted attention from the adventurers/NPCs that disagree with your choices.  I believe 5e gets rid of the whole world effects aspect, but I could be wrong as its been a while since I dug into the 5e rules.
Comment: There's a difference between extending their _estate_ and their _character_. Consider a level 7 character who has trained a ranger companion to level 3. If that character acts as an extension of the character, the player controls his/her PC, an NPC, plus the NPC's animal companion. That's a huge advantage. Contrast with a ranger that patrols the woodlands around the PC stronghold- good narrative, no functional advantage. That is my meaning.
Comment: @ObliviousSage Several earlier editions didn't have much power scaling either, but like I said, that players would use followers to solve adventuring problems was a baked-in assumption of those editions. Of course, it was also an assumption in those editions that certain adventuring problems could kill you without a saving throw. Much has changed in the editions since then.
Comment: @GMJoe That's exactly my point. In previous editions followers were generally either almost-necessary cannon fodder or status fluff; in 5e they can actually get pretty close to the PCs in effectiveness (if you let them have class levels).
Answer: The D&D GM basic rules indicate that there are NPC classes, and gives the experience values of monsters by CR. An NPC commoner should already have a level (to give it stats) of a commoner class.  Levelling this commoner should be as simple as taking them out with some gear to beat some monsters.
That said, from a lore standpoint this is far from satisfactory. Characters spend years of their lives getting the basic skills of their class, lore-wise (anywhere from a few years to nearly a century, depending on your race and the assumption that they spent a good portion of their starting age developing their skills), and would probably find a flavorful workaround to be beneficial.
I recommend an 80's montage with basic skill training taking a few weeks, and some minor hands-on learning.  The NPC classes are generally less powerful than PC classes in versions of D&D, and this can be handwaved as them being less skilled -- perhaps even book-skilled -- and inexperienced compared to the people who meet up at a bar and then go out to save the world.

I put my pants on one leg at a time, just like you. The only difference is that once I have my pants on, I SAVE THE WORLD.
Comment: You appear to have accidentally created two accounts. Please follow [these instructions](http://rpg.stackexchange.com/help/merging-accounts) to have them merged.


Prevent word from being added to the dictionary

Question: I have a Samsung Galaxy S. My understanding is that pressing space after manually entering a word will add that word to the dictionary. How do I prevent this from happening?
Answer: That is not supported, but there are some workarounds:

You could change language to something unused, before pressing space, and switching back afterwards.
Or you may enter two spaces and place the cursor in between, and then type the word.

I really like Swype, but that's one of its drawbacks...


How do I show the MLE is biased?

Question: The MLE being $X_{1:n}$ where $1:n$ indicates the minimum value. The pdf of the distribution is given as:
$$
f(x;\theta)=\begin{cases}2\theta^2x^{-3}\hspace{10pt}\theta\leq{x}\\0\hspace{33pt}x<\theta;0<\theta\end{cases}
$$
Calculating the log-likelihood gives
$$
\ell(\theta)=n\ln(2)+2n\ln(\theta)-3\sum^n_{i=1}\ln(x_i),
$$
Leading to concluding that the Log likelihood will minimize if $\theta$ rises so we have a max L if $\hat{\theta}=x_n$. What I don't understand is how I can show that this MLE is biased.
Comment: Where are you stuck? Find expectation of $X_{1:n}$. For that you have the distribution of $X_{1:n}$.
Answer: First, note that the CDF of the minimum of $n$ iid observations from a continuous variable is
\begin{align*}
  F_{X_{1:n}}(x) &= Pr(\min(X_1, \dots,X_n) \leq x)\\
  &= (1  - Pr(\min(X_1, \dots,X_n) > x))\\
  &= (1 - \prod_{i=1}^n Pr(X_i > x))\\
  &= 1 - (1 - F_{X}(x))^n.
\end{align*}
By differentiating this with respect to $x$, we find that the pdf of the minimum is
\begin{align*}
  f_{X_{1:n}}(x) &= n(1 - F_{X}(x))^{n-1}f_X(x).
\end{align*}
By integrating the pdf of each $X_i$ we can find that
\begin{align*}
F_X(x) &= \int_{\theta}^x f_X(t)dt\\
&= \int_{\theta}^x 2\theta^2t^{-3}dt\\
&= 1 - \frac{\theta^2}{x^2}, \; x \geq \theta,
\end{align*}
so therefore we can find that the pdf of the minimum is
\begin{align*}
 f_{X_{1:n}}(x) &= n\left(\frac{\theta^2}{x^2}\right)^{n-1}2\theta^2x^{-3}\\
&= 2n\frac{\theta^{2n}}{x^{2n + 1}}.
\end{align*}
Now we can compute that the mean of the minimum is
\begin{align*}
  \int_{\theta}^\infty x 2n\frac{\theta^{2n}}{x^{2n + 1}}dx
&= \int_{\theta}^\infty 2n\frac{\theta^{2n}}{x^{2n}}dx\\
&= \frac{2n}{2n - 1}\frac{\theta^{2n}}{\theta^{2n - 1}}\\
&= \frac{1}{1 - \frac{1}{2n}}\theta.
\end{align*}
So, the maximum likelihood estimator $\min(X_1, \dots, X_n)$ is biased by the factor $\frac{1}{1 - \frac{1}{2n}}.$
Comment: I've been trying to find the unbiasing factor and just figured out its $\frac{2n}{2n-1}.$ Checking my math once more before posting. But it's the same as your answer. (+1)
Comment: Please note the [help/on-topic] in relation to homework style questions.
Answer: You have a Pareto distribution.
Outline of solution: (a) Identify parameters and write the CDF.  (b) Use the CDF method to find the CDF of $X_{1:n} = \min_i(X_1, \dots, X_n).$ (c) Find PDF of the minimum from its CDF. (c) Find expectation.
Graph of density of $X_i,$ for $\theta=2.$

As you say, the MLE is $V = X_{1:n} = \min_i(X_1, \dots, X_n).$ But in practice, the true $\theta$ must be (at least a tiny bit) smaller than the minimum from data, hence the bias.
Using Wikipedia's notation, your particular Pareto distribution
has $x_m = \theta$ for the scale parameter and $\alpha = 2$ for the (known) shape parameter.
The distribution of the minimum of $n$ observations is again Pareto with the same scale parameter $\theta$ as the data and shape
parameter $n\alpha.$ Then because the Pareto mean is $\mu = \alpha\theta/(\alpha - 1),$ the unbiasing constant for your distribution is $c = 2n/(2n-1).$ This agrees with @SimonBogeBrant's Answer (+1).
Because your Pareto random variable can be simulated as $X = \theta/\sqrt{U},$ where $U \sim \mathsf{Unif}(0,1),$ it is easy to simulate the minimum
of $n$ of your Pareto random variables and illustrate this result. [The Wikipedia link has a section on simulating Pareto distributions. I am using the base of R which doesn't have tailor-make functions for Pareto distributions.]
<code>set.seed(1210)
n = 10;  th=2
v = replicate(10^6, min(th/sqrt(runif(n))))
mean(v)
[1] 2.105398       # aprx E(V) > 2
c = (2*n-1)/(2*n)
mean(c*v)
[1] 2.000128       # aprx E(cV) = 2

hist(v, prob=T, br=20, col="skyblue2")
</code>

Notes: (1) Runs of the program with several different sample sizes $n$ gave similarly
good results.
(2) Even though another answer has a completely worked
version of this problem, I hope you will follow through my outline
and some relevant parts of the Wikipedia article to get familiar with Pareto distributions and to make sure you
understand and remember how to do this general type of problem.
Comment: A simpler approach is to stop after finding the CDF of $X_{1:n}$, note that $X_{1:n} \geq \theta$ and that (from the CDF) the probability that it is $> \theta$ is $> 0$; these two facts combined are sufficient to show that $\mathbb{E}X_{1:n} \geq \theta$ and that therefore it is biased.
Comment: @jbowman. Thanks for comment. Clearly biased as you say. But I've been trying tind unbiasing constant (amongst interruptions). Think I've got it. If so, will illustrate in a simulation. Just noticed. Looks as if another answer already has it.

How do I show the MLE is biased?


Elements of $\mathbb{Z}_6 / \mathbb{Z}_2$

Question: Studying some concepts of group theory and after having read and trying to assimilate the concept of quotient group, I was wondering what structure would have the group $\mathbb{Z}_6 / \mathbb{Z}_2$. My reasoning was the following:

Using Lagrange's Theorem, we know that $|\mathbb{Z}_6 / \mathbb{Z}_2| = |\mathbb{Z}_6 : \mathbb{Z}_2| = \frac{|\mathbb{Z}_6|}{|\mathbb{Z}_2|} = \frac{6}{2} = 3$. Therefore, there are three equivalence classes, but taking into account that we are working with $\mathbb{Z}_2$, I think that all elements would be reduced modulo 2, and therefore I cannot see where the three equivalence classes appear. Am I using Lagrange's Theorem in an improper way? I would be grateful if someone could explain me.
Comment: Since three is prime, there is only one group of order three up to isomorphism.
Comment: After you ask a question here, if you get an acceptable answer, you should "accept" the answer by clicking the check mark $\checkmark$ next to it. This scores points for you and for the person who answered your question. You can find out more about accepting answers here: [How do I accept an answer?](http://meta.math.stackexchange.com/questions/3286/), [Why should we accept answers?](http://meta.math.stackexchange.com/questions/3399/), [What should I do if someone answers my question?](https://math.stackexchange.com/help/someone-answers).
Answer: You have to ask yourself: how do we view $\Bbb Z_2$ as a subgroup of $\Bbb Z_6$? The only possible way to do this is to identify $[0]$ with $[0]$ and to identify $[1]\in\Bbb Z_2$ with $[3]\in\Bbb Z_6$. Then for some $[n]\in\Bbb Z_6$, its image in $\Bbb Z_6/\Bbb Z_2$ corresponds to reducing $[n]$ modulo $[3]$. Explicitly, the cosets are $\{[0],[3]\},\{[1],[4]\},\{[2],[5]\}$; these are the three equivalence classes.
To be even more explicit, we are not really calculating $\Bbb Z_6/\Bbb Z_2$ in the sense that you're used to. Rather, if $\phi:\Bbb Z_2\to\Bbb Z_6$ is the homomorphism I described (taking $[1]$ to $[3]$) then we're calculating $\Bbb Z_6/\phi(\Bbb Z_2)$. But, because $\phi$ is an embedding, i.e. it corestricts to a group isomorphism $\Bbb Z_2\cong\phi(\Bbb Z_2)$, it would be extremely common to write $\Bbb Z_6/\Bbb Z_2$ since many things in mathematics are only considered "up to isomorphism" and we commit frequent abuses of notation in this vein.
Comment: Thanks for your answer, the visualization of $\mathbb{Z}_2$ as subgroup of $\mathbb{Z}_6$ was the point missing. Now I can see it much clearer
Answer: I have rethought this question and I have noticed that I could use First Isomorphism Theorem, finding a homomorphism $\phi : \mathbb{Z}_6 \rightarrow \mathbb{Z}_3$ with kernel $ker(\phi) = \mathbb{Z}_2$, induced by equivalence class


Automating database creation for testing

Question: For speedier testing it's nicer to use a memory-based sqlite, but it's still necessary once in a while to use MySQL for testing that more closely matches production.
To avoid a dry discussion/abstract question, the code below inserts a couple of words and confirms they're in the database, for both types of SQL databases just mentioned.
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
import unittest

db = SQLAlchemy()
TEST_DATABASE_URL_MEMORY = 'sqlite:///:memory:'
TEST_DATABASE_URL_MYSQL = 'mysql+pymysql://root:@127.0.0.1:3306/somewords'

def create_app(db_url):
    app = Flask(__name__)
    app.config['SQLALCHEMY_DATABASE_URI'] = db_url
    app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
    db.init_app(app)
    return app

class Word(db.Model):
    __tablename__ = 'words'
    id = db.Column(db.Integer, primary_key=True, autoincrement=True)
    word = db.Column(db.String(32), index=True)

class TestInsertion(unittest.TestCase):
    def manual_set_up(self, db_url):
        self.app = create_app(db_url)
        self.app_context = self.app.app_context()
        self.app_context.push()
        db.drop_all()
        db.create_all()

    def insert(self):
        words = ['hello', 'world']
        for word in words:
            w = Word(word=word)
            db.session.add(w)
        db.session.commit()
        for word in words:
            assert Word.query.filter_by(word=word).first() is not None

    def test_dbs(self):
        for db_url in [TEST_DATABASE_URL_MEMORY,
                       TEST_DATABASE_URL_MYSQL]:
            self.manual_set_up(db_url)
            self.insert()

The first (sqlite) passes. The second fails:
E       sqlalchemy.exc.InternalError: (pymysql.err.InternalError) (1049, "Unknown database 'somewords'")

We can, everytime we run the tests, create the database
> mysql -u root -p
Welcome to the MySQL monitor.  Commands end with ; or \g.
mysql> create database somewords;
Query OK, 1 row affected (0.02 sec)
mysql> quit;

but this precludes automated testing, and so I'm guessing I'm missing something basic.
How can a test such as the one above be run unattended, by automating the creation of the database?
Update
The test examples for 1.0, 1.1, and the tutorial (flask/examples/tutorial/tests/conftest.py) use tempfile.mkstemp(), which seems like a nice way to go. One needs neither to worry about setting the name and creating the database, nor even to care about the (random and discardable) db name. How/where is the database creation part done?
import tempfile
db_fd, db_path = tempfile.mkstemp()

Answer: With some modification to manual_set_up and test_dbs I was able to run code.
For mysql database, I remove database name from the db_url. And db.drop_all() also fails because the database does not exist so I put in try/except and pass the exception here. Then before db.create_all() I create a sqlachemy engine bypassing db_url which does not have database name  db.create_engine(db_url).
# your imports ...

import sqlalchemy.exc

#...
TEST_DATABASE_URL_MYSQL = 'mysql+pymysql://root:@127.0.0.1:3306/'

def manual_set_up(self, db_url, db_kind, db_name=None):
    if db_kind == "mysql":
        self.app = create_app(db_url + db_name)
    else:
        self.app = create_app(db_url)
    self.app_context = self.app.app_context()
    self.app_context.push()
    try:
        db.drop_all()
    except sqlalchemy.exc.InternalError as e:
        if "unknown database" in str(e.args[0]).lower():
            pass
    try:
        db.create_all()
    except sqlalchemy.exc.InternalError as e:
        if "unknown database" in str(e.args[0]).lower():
            db.create_engine(db_url, {}).execute(f"CREATE DATABASE IF NOT EXISTS {db_name};")
            db.create_all()

def test_dbs(self):
    for args in [(TEST_DATABASE_URL_MEMORY, "sqlite"),
                 (TEST_DATABASE_URL_MYSQL, "mysql", "somewords")]:
        self.manual_set_up(*args)
        self.insert()

Comment: This solution is nearly perfect, but if you want to quibble, you'll find room to do so. 1- Using a bare SQL statement breaks the spirit of SQLAlchemy. Aaron's solution may help here. 2- Hardcoding the database name precludes that it be used for another purpose. One solution for the latter is to pick a random string for the name (and perhaps skip that name if it exists, or else use an outlandishly long random string).
Answer: Creating and dropping databases doesn't seem to be directly supported by sqlalchemy, but it is supported by sqlalchemy-utils: https://sqlalchemy-utils.readthedocs.io/en/latest/_modules/sqlalchemy_utils/functions/database.html#create_database.
This will require you to already have a mysql server running, so it won't allow you to control the file placement with tempfile.mkstemp().
Another approach would be to run the mysql command as part of the automated testing.


Diablo 2 procuring affixes on mercenaries (hirelings)

Question: If I give my mercenary an item that has "Chance to cast" attribute, will it work?
Answer: Yes, it will work as normal.
See the ultimate guide to mercs for more tips on mercenaries:

(2) Most other mods (Crushing Blow, Open Wounds, Chance to Cast on Striking, Faster Cast Rate, Faster Hit Recovery, Increased Attack Speed, etc.) do work for mercs.
Answer: They all should work, except the Peace runeword's chance to cast Valkyrie, because it is bugged. It even works buggy on the player, making spawned Valkyrie despawn, because the server doesn't find a skill point invested (or granted by another item) into Valkyrie skill on player, and Mercenaries can't have their own minions.
I hear the same stuff happens with Spirit of Barbs, Druid's summoned creature, charged skill from Bramble runeword, but everything else should work.


Can I travel within the USA with 3 months left to my passport but valid student visa?

Question: I have booked a flight in 20-28th March to go to Hawaii from Seattle. My Philippine passports current expiry date is 23th June 2016. My USA student visa and Form I-20 has until Sept 2019. I am still waiting for my new passport from the Philippine consulate in San Francisco but I am not sure if I will get it before I leave.
Will this be an issue for me? I am traveling within the USA with a valid Visa and just a really tight life line on my passport. Thanks
Comment: Are you staying in Hawaii until your passport expires?
Answer: The only thing you need to travel within the US is a TSA-accepted form of ID, of which an unexpired passport is one. Your passport can serve as an ID for TSA purposes until the day it expires. So you should be fine.


Number of shifts in DES key schedule

Question: In DES key schedule some rounds use one left shift while others use two left shifts. What is the reason behind this?
Comment: The 2nd part of your question should be separate, and you will want to reword it so it makes sense to people, I have no idea what you are actually asking.
Comment: so can we change the shift of rounds..means 1 shift to other and 2 shifts to other is it possible ?
Answer: For the first part of the question regarding DES subkey generation, the reason there is a difference in the rotation amount is so that each subkey is different, and that all bits of the original key are used, and that there is a fairly equal probability that a bit will be in a subkey.
The rotations occur on the equal sized 28-bit halves of the 56-bit permuted key (after PC1), and are then sent to PC2 and reduced to 48-bits.
Because of the rotation constant, all 16 subkeys are different. If the rotation constant was 2, the subkeys would start to repeat after 14 rounds.
The combination of PC2 and the rotation constant means that each bit of the 56-bit key is used in approximately 14 of the subkeys. Bit 1 of 56 for example is used 15 times, whereas bit 2 is used 13 times. A complete list of bits (prior to PC2) used in the subkey generation are shown in this answer.
Comment: The 16 values of the key schedule add up to 28, matching the length of C or D allowing cyclic operation.  The program keytab referenced  in the linked answer has a -c option that shows the number of key bits in common between rounds. Any two adjacent rounds have 40 key bits in common.  Non-adjacent rounds have either 41, 42 or 43 key bits in common. You can modify the key schedule in keytab.c as long as the number of shifts add up to 28 and use the -c option to see what happens. (It alters the distribution slightly).

Number of shifts in DES key schedule


Does it allow to create many transactions at a time in Android SQLite

Question: Reading this document, it says that SQLite supports transaction and nested transaction. I wonder that it is possible to create many different transactions.
For example: I have 2 threads access to a database connection, is it posible to create  a transaction on each thread and they are not nested?
Answer: Sqlite does not support nested transactions:

Transactions created using BEGIN...COMMIT do not nest. For nested
  transactions, use the SAVEPOINT and RELEASE commands.

I myself have experienced deadlocks when using nested transactions with the SQLiteDatabase class, so I strongly encourage you to stay away from nested transactions. Use your own locks to prevent your transactions from nesting.
Answer: Creating two separate transactions on two separate threads is not considered "nesting transactions".
Each thread maintains its own db session, which maps to 0 or 1 DB connections (a DB connections can be picked from a connection pool and returned to it if the connection is no longer needed by the session, so at any time, the session has a connection or not, depending on if its needed).
Therefore, each thread maintains its own trasaction state indepdnent of other threads. The sources confirm this:
../Android/sdk/sources/android-23/android/database/sqlite/SQLiteDatabase.java:
// Thread-local for database sessions that belong to this database.
// Each thread has its own database session.
// INVARIANT: Immutable.
private final ThreadLocal<SQLiteSession> mThreadSession = new ThreadLocal<SQLiteSession>() {
    @Override
    protected SQLiteSession initialValue() {
        return createSession();
    }
};

../Android/sdk/sources/android-23/android/database/sqlite/SQLiteSession.java:
 *
About database sessions

 *

 * Database access is always performed using a session.  The session
 * manages the lifecycle of transactions and database connections.
 *

...
* Consequently, each thread
 * has its own session object and therefore its own transaction state independent
 * of other threads.

So if you have two transactions going on in seperate threads, they are not "nested" but completely independent and will run in parallel or be serialized depending on the modes and types of the transactions involved (ie. whether they are deferred, immediate, exclusive and whether they are read or write).
However, the Android SQLite libraries must be used properly to achieve this.

I have 2 threads access to a database connection

If this means both threads are using the same SQLiteSession, (although I'm not sure how you can accomplish this if its even possible), then that could very well lead to a deadlock.
My setup:

Single content provider
Content Provider initializes member variable mDbHelper for SQLiteOpenHelper in its onCreate()
Call mHelper.getReadableDatabase / getWriteableDatabase as needed in the Content Provider's query/insert/ ... methods
Android will handle ensuring separate transaction state on each thread that uses the Content Provider

If a long running transaction is going to be execute on a thread (eg. data import from sync on background thread), consider using db.yieldIfContended() or db.yieldIfContendedSafely() to allow transactions from other threads (say or record update on UI thread) to squeeze in so that they do not have wait for the long-running transactions to finish and thus block those threads.


Ubuntu all of Apache's vhosts in one file

Question: In all instructions I found to setup vhosts on Ubuntu LAMP you need to create a new vhost conf file for each vhost. Can I declare all my vhosts in one single file and what I need to do for it?
Comment: Yeah, you can do more than one in a file.  It doesn't require anything special, just open and close the sections as though they were in different files
Answer: You can do one big file, and if you only have a host name or two to worry about it will work fine.  Even with LOTS of hosts one file will technically work.
BUT ... when you have lots of hosts (more than 2 or 3 for me), having each one in its own file, named after the FQDN w/ a SSL indicator (ie ssl-webapp3.example.com.conf or webapps.example.com.conf or www.example.com.conf) will make your life MUCH easier and be "more maintainable" in the long term, and it makes enabling/disabling individual hosts/sites easier as well.


What is Indra's Net, according to Mahayana Buddhism?

Question: I have heard a lot about "Indra's Net". A wiki says that it describes how emptiness and dependent origination are creating the universe. Can anyone provide me a link and book which I should read, to understand this more?
Answer: There are two sets of Mahayana sutras:

The seventeen Perfection of Wisdom sutras (Prajnaparamita Sutras), and
The other sutras, of the Wheel of Perfect Differentiation.

The first set does not present Indra's net while the second does. Tibetan traditions posit the first set as being "of definite meaning" and therefore study it and overlook the second. They do not study the sutras of the Wheel of Differentiation except through commentaries refuting their presentations.
On the other hand, most Chinese, Korean, Japanese and Vietnamese traditions such as the Huayan school, Chan, Tientai, etc. posit the second set of sutras as being "of definite meaning" and therefore study it and overlook the Perfection of Wisdom sutras.
Therefore, if you want to know more about Indra's net, you have to look on the side of Zen, etc. because they are more likely to comment sutras that speak of Indra's net. Among the various sutras of the Wheel of Perfect Differentiation, the most well known are:

The Lankavatara Sutra (remember that Chan masters were first called "Lankavatara masters" before the "Chan" designation came into being),
The Avatamsaka Sutra (Garland of Flowers), that became popular after the Lankavatara was found too complicated for lay people
The Lotus sutra,
The Tathagatagarbha Sutra, and
The Vimalakirti Sutra.

Most of them mention Indra (just as the Prajnaparamita Sutras do) but do not mention Indra's net. For instance, the Vimalakirti Sutra merely mentions Indra. Even the translator's footnotes do not say more than:

Kausika, Sakra, and Indra all refer to the same god, who, in Buddhist cosmogony is regarded as the king of gods in the desire-realm.

This helps you understand that it is not that common a notion.

Of these scriptures, only the Avatamsaka Sutra (a 1'500 pages sutra) does. It says:

Far away, in the heavenly abode of the great god Indra, there is a wonderful net which has been hung by some cunning artificer in such a manner that it stretches out indefinitely in all directions. In accordance with the extravagant tastes of deities, the artificer has hung a single glittering jewel at the net's every node, and since the net itself is infinite in dimension, the jewels are infinite in number. There hang the jewels, glittering like stars of the first magnitude. A wonderful sight to behold. If we now arbitrarily select one the these jewels for inspection and look closely at it, we will discover that in its polished surface there are reflected all the other jewels in the net, infinite in number. Not only that, but each of the jewels reflected in this one jewels is also reflecting all the other jewels, so that the process of reflection is infinite.

Thích Nhất Hạnh is a Vietnamese Zen master in the lineage of Huineng. The Caodong Chan school in China and the Soto Zen school in Japan also proceed from Huineng. In Understanding Our Mind (Chapter 13, Indra's Net), Thích Nhất Hạnh refers to the Avatamsaka Sutra:

Indra's net is a vast, cosmic lattice that contains precious jewels wherever the threads cross. There are millions of ewels strung together to make the net, and each jewel has many facets. When you look at any facet of any jewels, you can see all the other jewels reflected in it. In the world of the Avatamsaka, in Indra's net, the one is present in the all, and the all in the one. This wonderful image was used in Buddhism to illustrate the principle of interdepedence and interpenetration.

And he explains the meaning:

In our ordinary world, we see a teapot as a single, independent object. But if we look deeply enough into the teapot, we will see that it contains many phenomena – earth, water, fire, air, space, and time – and we will realize that in fact the entire universe come together to make this teapot.

From this Vietnamese Zen perspective, this is analyzing dependent-origination.
Answer: The earlier answer is excellent and exceeds my knowledge of the question in the sutras.
However, this issue is also addressed (perhaps with a twist) in the tantras, albeit, less accessibly (depending on what it is being compared to). Generally, to fully understand the meaning of Buddhist tantras, it requires oral transmission because the information in any one tantra is incomplete, sometimes encoded, sometimes arranged out of order, and needs cross-reference with other tantras.
For example, in the book published in English as "Luminous Essence," which is Mipham Rinpoche's commentary on (Longchenpa's great commentary on) the Guhyagarbha Tantra, arguably the "root" tantra for the Nyingma system, Mipham says the following:

The Great Tantra of the Glorious Magical Net, the Secret Essence, Reality Ascertained reveals mind and wisdom to be self-display. ... This universal tantra of the great Magical Net is a secret among secrets.

and

Reality is nothing whatsoever, yet from it, anything can arise. Due to this key point, its self-display manifests impartially and without limitation as the display of the magical net.

While none of this references "Indra's" net specifically by name, I'm pretty sure it's the same idea explicated with a different kind of terminological domain.
Lastly, with regard to the wording of your original query, to say emptiness and dependent origination are "creating" the universe, this maybe has some conceptual issues (which may also just be semantic). Depending on the system of tantra or the view you're looking from, "the universe" can be said to be somewhat of a mistake, as least as unenlightened beings are experiencing it, and emptiness and dependent origination are concepts we're using to try to bring some degree of understanding into the matter, but to think there is something operating with intent would be, to my limited understanding, a mistaken idea.
Hope this helps (get you started :-)
Comment: Just so you know, the question is 4 years old and it looks like the OP no longer has an account. Nice answer nevertheless. ;-)
Comment: Yeah, I didn't check the timeframe. It sorted to the top of a list and I assumed that meant it was new. I, on the other hand, AM new here. I'll pay more attention to details :-)
Comment: Welcome and enjoy the site!


what are inproc variable and how do they make the session faster?

Question: I understand what InProc variables are but how do they make the session faster?
Is it because they have less access time ?
Answer: Check this topic and the answer given by adt.
Which one is better, InProc or SQL Server, for Session State mode in asp.net?
InProc keeps data in-memory and SQL persists data to disk. Definitely faster!
Answer: InProc session is basically kept in memory of the process.
You alternative to use database session will give you the overhead of querying the database, instead of just directly accessing the variables in memory. Yet, it should be unnoticable in smaller apps.
You should consider that having the session in database will give you the advantage to run multiple worker processes and have the same session shared across them.


Is a PhD needed after an MD or DO if one wants to pursue a research career?

Question: I have completed my MD. I am more interested in research than in clinical practice. I know there are post-doc positions available which accept post-MD candidates. Still I am thinking of doing a PhD in my specialty of interest. However I would like to know what are the benefits of pursuing a PhD after receiving an MD? Is it really necessary to obtain a Ph.D. degree for a research career?
Comment: I'd suggest looking through some journals in your specialty of interest. Do the authors usually have Ph.D.s in addition to MDs? (I have published together with a few MDs, and I can't recall any who also had a Ph.D., but that's just anecdotal.)
Comment: It is all a matter of qualification. If you think you need more training on a particular subject then you need to do a PhD. What is your specialty of interest?
Comment: @andreas My specialty of interest is genetics, particularly genetic epidemiology.
Answer: Look at it this way; an MD says you are qualified to practice medicine, and a PhD says you are qualified to do research. In theory you could practice medicine without an MD (it'd be illegal in many countries but not having an MD does not mean you don't have medical knowledge), and likewise you could do research, especially part-time, without a PhD.
Leaving semantics aside, having that degree significantly increases your chances of pursuing a career in a particular field. If you intend on leaving the clinic and devoting your time and energy to research I'd say that a PhD would be expected, when you look for jobs. Whether or not you can bypass that expectation with other qualifications would be speculation.
As it turns out an MD & PhD combination is... uhmmm how to put it delicately..  "so money". :)
I say you put your hat in front of you, figure what you want to do, and go for it. Many doctors here (in Sweden) go for a double degree and it is definitely not something that's frowned upon. On the contrary, in many cases it is an additional merit for future promotions.
Answer: I'm an epidemiologist, working with a large number of research-oriented MDs, as well as a number of MD/MPH, MD/PhD and PhD researchers.
In terms of an MD vs. an MD/PhD...
I haven't met anyone whose been held back by doing research with just an MD, but my field admittedly somewhat exalts clinical expertise. The biggest advantage of a PhD is that you will have spent a great deal of time doing research instead of clinical practice. If you want to be an expert in methods for research and analysis, that's where a PhD comes in. The MDs I work with often end up deferring to a PhD (like me) when the research goes from the high level to genuinely in the weeds.
Answer: It is very much depend on your country and research field. Technically speaking many medical doctors affiliated to hospitals do research and publishes the results, so it is definitely not impossible. However, you should ask yourself if you have enough technical knowledge in your field you want to go and if you have enough experience in setting up research programs, writing proposals and papers etc.


Capillary action in the presence of pin holes

Question: Assume that capillary forces are sufficient to draw a fluid up a tube.  Now repeat the experiment with very tiny pin-holes in the tube.  The question:  do the pin-holes limit the capillary action?  Or do the capillary forces allow the fluid to span the pin-holes and continue to be drawn up the tube?
Answer: I think it depends on the size of the holes, if they are smaller pin holes then it will not stop it, as the water will simply span the hole due to surface tension and cohesion. If the holes are bigger, the water will not as closely adhere to the main tube, this would effectively end the tube, as water would not travel further up the tube due to a lack of enough to adhere to.
Comment: +1 When pin holes are big enough that water can flow out of them then we could create perpetual motion machine by using a turbine to get work out of the water flowing out and falling down.


Fix grub on UEFI system

Question: I have windows 10 installed and am seeking to dual boot with Ubuntu Studio.
Alright so I was installing Ubuntu Studio on an Asus F555L type laptop. At the end of the installation it said "grub failed to install". I tried again and it did it again. So, I then grabbed a boot recovery iso that a friend recommended to me (can post link to that upon request) and attempted to boot of that to reinstall grub. The only problem is that I cannot figure out how to enable Legacy Bios support in the UEFI menu, in fact I don't think it's possible.
So, my question is, does anyone know of how to boot of a live USB that doesn't support UEFI from UEFI firmware, or of any other method of installing grub without reinstalling an OS?
Answer: I'm assuming that you can actually boot from the Live CD. Ubuntu has more information here, but in short, after voting from the live CD:

If you don't have a /boot/efi partition, create it
Start Boot-Repair, click on "Advanced options", go to the "GRUB location" tab, and select the UEFI partition. Click Apply.
Comment: Okay thank you. I left out that I have windows 10 dual booted and wish to keep that, but that shouldn't change anything. I'll try that.
Comment: Edit your question and add it. That way someone else might give you a better solution.

Fix grub on UEFI system


SVN not working after updating to xcode 4.1 for snow leopard

Question: I have recently updated my xcode to version 4.1 for snow leopard, but after that my life became miserable and all the repositories in Organizer are unable to connect and show red icons.
Anybody has any idea how to fix that???
Answer: have you tried this:
1.open a terminal
2.type 'svn list svn://~~~paths'
ie. "NJW-Mac:~ bluepin$ svn list svn://192.168.0.184/BMA"
3.You will need to enter PCUserPassword,svnUserID,svnUserPassword
4.U should see output from the svn list command which means you were able to connect to the SVN server
5.return to xcode4
6.try again your job(connect Repositories)
from Xcode 4 + SVN = working?
Answer: Is it the IP addr in the settings of svn? I had the same problem on lion at the begin. so pls try to input your svn server name to replace the ip addr, it's will be work.
If you did not get the name of your server, you could set a new name in the /etc/hosts file by yourself. Such as "192.168.1.10 iOS_SVN_Server".


Should I train my network for classification on samples whose ground truth label is ambiguous?

Question: Imagine that I am training a model to classify handwritten digits. Suppose there are some bad quality images that could be classified by a human as either 0 or 8, 1 or 7 or other commonly misclassified pair of digits.
My question is, should I simply remove such ambiguous samples? Should I annotate it as the most similar digit, even though there are other similar answers? Should I present it repeat the sample, presenting it once per each 'acceptable' answer?
Answer: This depends on the behaviour you want. If the ambiguous sample's ground truth is classified by a range of people, your network will get an average* based on that group. If it's only by one person, your network will be biased to how that one person classifies these samples.
Alternatively, depending on your loss function, you could train the network to classify ambiguous samples with an ambiguous label. For example, if 40 people label the digit as 1, and 60 as 7, you could have the desired output for the network be 0.4 for 1 and 0.6 for 7 (assuming it's a probability).
This doesn't have an exact answer, it's whatever behaviour you deem best for your scenario. If you want to keep it simple, you can remove the samples and then see how the network performs on these ambiguous samples at testing time. Assuming your dataset is good, you'll probably find the network performs about the same on these samples anyway.


Files can not be opened directly by an application in which they were created

Question: I have installed a Java Application[which creates slides presentations like powerpoint] on my computer. It runs successfully from start menu. But when I Open the file created in that application, it does not opens, application does not launches. Somehow those files can't find the path to that application. does anyone have any idea what possibly could be the issue? I am using windows 7.
Answer: Windows uses file associations to know which application can handle which file type.
These associations aren't created by magic; either an installer creates them or you need to create them manually. When you right-click the file and select "Open", Windows should ask you which application to use. Select your Java app and it might work.
"Might" since some applications don't accept command line arguments. That means Windows can't tell the app which file to open. If that's the case, then you need to launch your app manually and then open the file from within the app.
Related:

Add a new file association in Windows 7
Comment: Thank you for you response :) This I am already doing, right click the file, open with -> then I guide it to the exe of my Application. select/apply and click ok, but application is still not able to open it. what i have noticed is that application process starts in task manager and exits after 1 or 2 seconds. Second option that you told is already working, I can open file from file menu when application is running. Link that you mention is helpful, I have made another file association using regedit, that is functional for these kind of files, but still application does not loads file.
Comment: In that case, try to run the application from the command line and pass the file to open as argument. If you see an error, let us know the exact error message.
Comment: It was running only in case that we provide complete path of application and complete path of file as arguments. Now that issue is resolved. Actually something went wrong during the build of application. And btw setting file association in registry editor manually is a good solution and application works fine with files later on. Thank you very much for your help.


Transfer docs/books between Kindle and other devices

Question: I have a Kindle Paperwhite, 2012 version, and I have downloaded books and documents to it from the built-in experimental browser, not from Amazon, but they does not show up on other devices connected to my Amazon user. Does anyone know how to transfer them to those other devices? Preferably without installing a lot of other programs and stuff.
Answer: If you didn't purchase the books from Amazon, they won't be synched to other devices, because (among other reasons) Amazon doesn't know they're there.  There's no upstream sync mechanism.
I don't have a paperwhite, but I have a K2, DX, Fire HD, and Android reader.
The sync mechanism for non-Amazon content without installing anything anywhere involves a computer and 2 USB cables.
Plug both devices in, open them each in a file browser window, find the right folders, and drag across.


Making multiple textures appear randomly

Question: Im currently in work of making a texture pack, that changes the Ender Dragon, but i wanted to make it more interesting, and make the dragon appear different each time you fight it, without making any mods since im not really experienced with making mods. I have just 2 textures of the Dragon done, but each of them has different layouts because it was easier for me to do it. I also have a .propeties file for it, but i still don't know how to make it random so that each 1-2 times when the dragon respawns, the texture from the folder would be randomly chosen, and the chosen texture would replace the default texture of the dragon. Is it even possible to do without mods?
Comment: This *might* (i dont think so) be possible with optifine, but im pretty sure it cant be done in vanilla
Comment: I've seen some Servers have this Option, and even Texture Packs that change the texture when you change the Name of an Item. But welp, if it can't be done in Vanilla/Optifine, can it be done with Plugins/Server-side Mods?
Comment: Yes! If you give the dragon a random nametag every time they respawn.
Comment: some optifine resource packs implement random entity textures (e.g. faithful), shouldn't be too hard to replicate this but with the dragon texture
Answer: Well you can change a mobs texture, and item textures on specific properties they have, for items this can be durability, for mobs this can be health, and other attributes. Although you could make it so the ender dragon has stages based on its health, I don't know how you would make the second ender dragon fight different but I know you can do it, as I have seen texture packs have random textures, I just don't know how you would do it, maybe you could try randomly tagging the dragon, and for each different tag the dragon skin changes?


Ceiling fan light dims

Question: I have a Harbor Breeze ceiling fan and light kit.  When I turn on the light, it starts out bright, but then in a second it dims.  It doesn't turn off, it just dims.  What could be causing this to happen?
Comment: Is the light controlled by a dimmer, a remote of some sort, or simply by a wall switch?
Comment: Is the lamp a compact flourescent? Some of them actually are bright when the come on and then get dimmer. I had one like that I replaced with an LED.
Comment: Holding down the light bulb on the remote helped my dim issue. Thanks all!!
Answer: One of the current limiting methods required by the U.S. is similar to a dimmer the current is limited by controlling an SCR and this has the effect of dimming. This may be the cause.
Comment: Yes, this would be the case if you have a large wattage of incandescent bulbs in there.  The product labeling should state how much wattage the fan can support, it will dim if you try to add more.
Comment: The government limit is 190 W but I have seen the active current limiters start reducing the power at under 100 W total.
Comment: Just curious why the down vote since the op did not state the wattage being used I have seen the limiters to cause this problem including no light at all when they fail.
Answer: I had this problem, with my harbour breeze LED being very dim.  it turns out the light button on the remote is a dimmer.  with the light turned off, press the button to turn the light on.  but keep the button pressed, don't let it go.  in a couple seconds, the led light brightness will go up.  if you continue to hold the button down, the brightness will go down.  the brightness will go up and down repeatedly if you keep the button pressed.  when you get to a light brightness you like, let the button go.  now, when you turn the led light on again, it will remember the last setting.
Comment: That sounds as annoying as the remote control on my grandparent's TV back in the mid-70's. It had a wired "clicker" remote (the buttons on it actually clicked when pressed), and there was only one volume button - each time you clicked it, the volume increased until it was at max, then it went down to mute and started climbing again.
Answer: I had the same problem with my Harbor Breeze fan.  I found an remote for a fan in another room and programmed it for the fan that had the dimming issue.  It seems to have fixed the problem, so I'm guessing the remote is bad.
You may want to double check that the remote is set to the correct bulb type (if it has this switch in the back).  Also try pressing and holding the light button to raise or lower the brightness level.
Answer: I had issues...turns out the "light" button on the remote, which is long left to right, is the dimmer. Meaning, pushing on the left side of button increases luminosity
Comment: Welcome to DIY! Can you add a picture of the remote? And how do you know this relates to the question asker's fan?
Answer: I had this exact problem. I bought two Home Decorator fans from Home Depot and installed them in separate rooms in my house. They have LED lights. I know for a fact that I wired them right because the model fan in Home Depot fan was wired the same and my remote worked perfectly with that fan. Both fans at my house had the same issue of the light not turning all the way off but dimming worked and fan speeds worked. LONG story short, I had another fan in the Master Bedroom that was turned on. When I turned the power to that fan off (wall switch toggled to off), both of the new fans worked!!! Now I need to figure out how to wire the Master bedroom fan correctly (9 wires in one box) but at least I know what the issue was!
Comment: Can you describe how to verify the problem you had is the same as the OP and what steps need to be taken to correct it?

Ceiling fan light dims