What is the boundary of two manifolds with boundary?

Question: I know that if $M$ is a manifold without boundary and $N$ a manifold with boudary, then $\partial(M\times N)=M\times \partial N$, but, if I have the product of two manifolds with boudary, it's known what would be the boundary of that? I suppose it could be $\partial{M}\times \partial{N}$, but when I think in $I\times I$ $\left(I=[0,1]\right)$, the corners doesn't look as something differentiable.
Answer: You're right that "corners" won't be differentiable.  In fact, a product of two manifolds $M$ and $N$ with nonempty boundary does not have any natural structure of a differentiable manifold, because of the "corners" in $\partial M\times\partial M$.  If you remove these corners, you do get a differentiable manifold $(M\times N)\setminus(\partial M\times\partial N)$ with boundary $(M\setminus \partial M)\times\partial N\cup\partial M\times(N\setminus\partial N)$.
(There is a notion of a "differentiable manifold with corners" that does allow such products.  These have not just boundary points that look locally like $[0,\infty)\times\mathbb{R}^{n-1}$ but also higher codimension "corners" that look locally like $[0,\infty)^k\times\mathbb{R}^{n-k}$ for $k>1$.)
Comment: I'm not quite sure what you mean by that.  But if you remove the points that are in $\partial M\times\partial N$ from $M\times N$, then yes, you do get a differentiable manifold with boundary.
Comment: So quitting the intersection of the boundaries I get a differentiable manifold?
Comment: Yes, I wrote it wrong, but you put what I needed to understand. Thanks!
Answer: $$ \partial (M \times N) = (\partial M \times N) \cup (M \times \partial N).$$


Update OWD using metadata for custom objects

Question: Requirement-
I have many custom object whose OWD I need to change.Almost 50 managed package Objects are there which i need to consider .Is this possible to do it by metadata (package) or what is the best way to do it
Answer: The sample xml package will be :-
<code><?xml version="1.0" encoding="UTF-8"?>
<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata">
     <sharingModel>ReadWrite</sharingModel>
    <visibility>Public</visibility>
</CustomObject>
</code>

SharingModel Indicates the org-wide defaults for the object.
visibility- This field returns the visibility of the custom object, custom setting, or custom metadata type.

I believe the folder structure VS Code gives us does not allow you to do the change at once.

You can use something called MavensMate and Sublime text to achieve this.
The folder structure they give you the ability to make change for all the object in a single file.


maximun number of inputs on a opamp adder circuit

Question: With 4 timers of a mcu I am generating 4 square signals , each of them have an amplitud of 3.3v and are generated at diferent frequencies (8KHz 9KHz 10KHz and 11KHz), to generate a multitone signal I am adding them with an op amp adder circuit, everything is OK, but I would like to try with more of 4 signals if it is possible, What would be the maximum number of input signals for an adder circuit?, the op amp is working with 3.3 volts (ad822).
Answer: The more inputs you add, the more noise the op-amp produces - this is because the noise (regard it as in series with the grounded non-inverting input), gets amplified each time a new input is added. Consider the non-inverting op-amp amplifier: -

Now, regard Vin as the op-amp input noise with respect to 0 volts but it gets amplified as shown in the formula. Regard R2 is one limb of your mixer. Every time you add a limb, R2 gets smaller and the noise on the output gets higher. For instance, if you have one input, the output noise might be X but, with 10 inputs the output noise will be 10X.
It's not normally a show-stopper but it's something to take into account and anyway you did ask!
Clearly, the sum total of all the input voltages x gain has to produce an output voltage that avoids clipping or slew limiting as well.
Comment: Hmm that's a subtle point.  In general with a summing amp I'd expect that the input R's (R2 in your example) would be made bigger as more inputs were added.. such that the sum of all the inputs won't overload the output.
Comment: @george yes it sounds that simple but you in effect make a bigger capacitor to ground with more inputs and that also increases noise gain. For audio you can probably get away with many inputs but I'm not sure this question or answer should be limited in that respect.
Comment: ah a random downvote.
Answer: There is no maximum number of inputs you can use, so long as the output does not exceed the op amp capabilities.
Answer: You could compress the signal, using diodes. Keep the resistances low, so the node-capacitance (the summing node) does not cause excessive phaseshift and turn your summer into an oscillator.

simulate this circuit – Schematic created using CircuitLab


Can you derive the Tsiolkovsky rocket equation without calculus?

Question: Can you derive the Tsiolkovsky rocket equation without calculus?
Comment: This sort of questions without showing any progress or without any detail are considered to be trivial and are prone to be withheld and to be downvoted. Show your progress under the question asked with detailed pictures of what you have come through. These type of trivial questions are not encouraged here. Also, first of all, calculus is the study of variations and in a rocket everything varies during its take off for example, the fuel hence the mass, position, velocity everything varies. So, you can't actually solve it without calculus.
Comment: https://en.wikipedia.org/wiki/Tsiolkovsky_rocket_equation#Derivation
Answer: No. You want to get to the total change in velocity. To do this, you have to add up (integrate) all the tiny contributions from each little lump of fuel as it is ejected. Each contribution is different because as each "lump" is ejected, the rocket gets lighter.
You could get an estimate if you work out the $\Delta{v}$ from the first ton of fuel, reduce the rocket mass by 1 ton, get the next $\Delta{v}$ from the next ton, reduce by another ton, and so on until you use up all the fuel, then add all the $\Delta{v}$s - but this would give only a crude estimate of the total. You could repeat the calculation and do it for each kg of fuel (1000 $\times$ as many steps). This would get you a better result, but still not precise.
Finally, you'd do it for an infinite number of infinitesimal quantities of fuel at each step - which is exactly how integral calculus works.


How to simulate correlated stock prices (not returns)

Question: Suppose we have two stocks following GBMs. Drift and volatility are calculated based on historical data. Furthermore the stocks are assumed to be correlated (i.e. they move together, if stock 1 goes up, stock does also). How can I actually simulate their future stock prices so that they stay together? For return I would use Cholesky Decomposition, but since I'm looking directly at price levels and not returns I doubt that would be correct.
Answer: For two GMBs
$$
S_i(t)=S_i(0)e^{(r-\delta_i)t+\sigma_i W_i(t)-\sigma_i^2 t/2}\,,\quad i=1,2
$$
with ${\rm Corr}[W_1(t),W_2(t)]=\rho\,t$
we have
\begin{align}
\mathbb E\left[S_i(t)\right]&=S_i(0)e^{(r-\delta_i)t}\,,\\[2mm]
\mathbb E\left[S_i^2(t)\right]&=S_i^2(0)e^{2(r-\delta_i)t+\sigma_i^2t}\,,\\[2mm]
{\rm Var}\left[S_i(t)\right]&=S_i^2(0)e^{2(r-\delta_i)t}\left(e^{\sigma_i^2t}-1\right)\,,\\[2mm]
\mathbb E\left[S_1(t)S_2(t)\right]&=S_1(0)S_2(0)e^{(2r-\delta_1-\delta_2)t+\sigma_1\sigma_2\rho\,t}\,,\\[2mm]
{\rm Cov}\left[S_1(t),S_2(t)\right]&=S_1(0)S_2(0)e^{(2r-\delta_1-\delta_2)t}\left(e^{\sigma_1\sigma_2\rho\,t}-1\right)\,.
\end{align}
Therefore,
$$
\boxed{{\rm Corr}\left[S_1(t),S_2(t)\right]=\frac{e^{\sigma_1\,\sigma_2\,\rho\,t}-1}{\sqrt{e^{\sigma_1^2t}-1}\sqrt{e^{\sigma_2^2t}-1}}\,.}
$$
Obviously, the correlation of $S_1$ and $S_2$ is increasing/decreasing/positive/negative when $\rho$ is increasing/decreasing/positive/negative. In other words: for all practical purposes the correlation of the returns, $\rho$ is as good as the correlation of the stocks. I am of the opinion that there is no time series of historical data that will tell you what the true correlation is.


Why did "он" suddenly become so much more common?

Question:
In the case of English, "she" was used much less than "he", and it still hasn't caught up. In Russian, it looks as if the translation of "he" almost didn't exist, until around 1915. What happened?
Comment: Russian orthography reform happened.
Answer: Actually, the year is not "around 1915", but the beginning of 1918 when the orthography reform began. Before 1918 "он" was written as "онъ", and naturally before 1918 "он" was not used. Have a look:

After 1918, Ъ at the end of words after "hard" consonants was used mainly by emigrants in their printed publications. All the instances of "он" used before 1918 that Ngram Viewer shows in its graphs are actually mistakes of the Google Books OCR.
Comment: I think graph with all three pronouns is more informative. https://goo.gl/4GJYkA
Comment: Also note that Google Ngram Viewer uses a 3-year smoothing window by default, which partly explains why the OP's graph seems to start climbing up around year 1915 = 1918 - 3. Switching to 1-year smoothing, or no smoothing at all, shows the sharpness of the change much more clearly.
Comment: @Alissa - I updated the answer as you suggested, thank you.
Comment: @IlmariKaronen - A good point! I absolutely agree with you.
Comment: Actually, ъ was after all consonants: плащъ, врачъ.
Comment: @user31264 - OK, it was really used after Щ and Ч, but definitely not after all consonants, it was never used after Й.
Comment: Only because Й (*и с краткой*) was not considered a consonant.  Today it is considered as полугласная согласная (https://ru.wikipedia.org/wiki/%D0%9F%D0%BE%D0%BB%D1%83%D0%B3%D0%BB%D0%B0%D1%81%D0%BD%D1%8B%D0%B5_%D1%81%D0%BE%D0%B3%D0%BB%D0%B0%D1%81%D0%BD%D1%8B%D0%B5)


job offer contingent on background check

Question: My current job is going out of business in a few months.  I received and signed a job offer contingent on a satisfactory background check.  I have no criminal background, but did not want to give notice to my current employer until the background check comes back.  I reached out to the HR person about what paperwork is needed to get the ball rolling on the background check.  I received an email reply back from HR stating for my position a background check is not required.  Is it alright for me to give notice now?
Comment: @keshlam - this does seem familiar,  especially the HR saying not required bit.
Comment: Isn't this a duplicate if a recently asked question? The answer comes down to how sure you are about the new job and when the start date for that  job is.
Answer: These are the two key items:

I received and signed a job offer contingent on a satisfactory background check.

The written offer you have in hand is contingent on a background check.  This is what you have in writing and you should treat its terms as valid and enforceable.

I received an email reply back from HR stating for my position a background check is not required.

Don't take HR's word for it; get it in writing:

A memo, to be signed by you and an authorized representative of the company, indicating that both of you abandon the previous offer.
A new offer with all of the same terms except the background check contingency.

This protects you against the risk of the company deciding at some future date that the background check should have been done and that because you didn't meet that contingency, you should no longer work there.
Unless it includes an actual contract, offers of employment aren't legally-binding documents.  This gives you something to throw back at them if they try to let you go because of it and you still want to work there.
Comment: Depending on local laws, an official email sent by HR could be legally binding though.
Answer: If you are not at the point where you know what your start date is, what location you are to report to, who is receiving you, what documents you are to bring with you on the first day including those documents that they want as proof of ID and proof that you are legally authorized to work at your locale, then you are not yet at the point where you are ready to give notice.
Remember, your employment contract with your new employer does not kick in until your first day of work, so you have to know what your first day of work is before it is safe for you to you give notice.
Comment: In the offer they informed me of my start day, who I report to, where to report, and what documents to bring
Comment: Then you are in good shape to give your two-weeks' notice. DON'T give any notice that's longer than two weeks. Because rescission of offers are much more likely to happen to you when you say give three months' notice than when you give two weeks' notice.


Is it possible to update group permissions based on user profile?

Question: In SharePoint 2013, is it possible to update group permissions based on user profiles? For example, we will have 50 team sites each with group permissions that each hold 10-50 users. Rather than manually managing all the team site groups (ie: people leaving, promoted, change team, etc.) I'd like to have the group permissions updated when their user profile changes (ie: deleted, changed team, on multiple teams).
Answer: SharePoint doesn't provide a out of the box way to do this by using SharePoint Groups.
I don't know your Active Directory structure but it is likely that you have matching groups already defined there. Those groups can be added to the team sites then. If something is changed in active directory this will reflect directly to the permissions in SharePoint.
The only downside of using Active Directory Groups is that you won't see the members directly in SharePoint.
For more information you please take a look at Kirk Evans blog:
Clarifying Guidance on SharePoint Security Groups versus Active Directory Domain Services Groups
Comment: +1 we've implemented this with scheduled scripts that impact AD groups. SharePoint is none the wiser. You could do it with SharePoint groups (so that you can monitor membership) but it really comes down to your requirements. Scripting the User Profile queries is easy.
Comment: Thanks. I realize I can apply always-updated AD groups to SharePoint groups, but in SharePoint you can't see the people in each group. I want to be able to show the "members" of each child-site (for contact purposes). So... I think I will resort to manually updating the sub-sites.


Can community users log in from the normal login page?

Question: Can community users log in from a community other than the custom login page?
Answer: Answering the question title, no, community users cannot login via login.salesforce.com or test.salesforce.com. They must login using a community URL. This can point (or be re-directed) to a "standard" community login page (from the template) or a customized one.
With Salesforce, platform users have to have a username that is unique across all Salesforce orgs. However, community users sharing the same username can exist across many communities. It is for this reason that community users can only login using a community login page.
Answer: You can create a login page for communities and use it as an entry point.
If you are referring to getting to communities after login into salesforce, then you can enable the banner so from the top banner users can select the community to login
Answer: Simple answer is No. Community users are logged in via special url's created for the community which can be any organzsation domain specific or default salesforce generated force.com subdomain.


If I accidentally used a trademarked name or word in my title, can I just change it?

Question: I'm closing in on a point in the development of my first game that it's ready for Steam Greenlight. I don't even have a name for it though. My project name is Asteroids, but obviously I can't use that. I have a bunch of other ideas, but I'm scared to death of getting sued. Let's use the Edge Vs EA example. Edge Games tried to sue Electronic Arts because they released Mirror's Edge. They were unsuccessful, but the case aside, couldn't EA have just said, "Oops, sorry mates, we'll come up with something else."? I'm developing because I want to secure a real future for my family, but I make $10 an hour busing tables, getting sued would mean financial ruin, right? I barely manage to pay my bills and feed myself, so a Lawyer isn't an option, and there's no other way I know of to be absolutely sure I'm not infringing on someone else's rights.
Comment: I don't think they _sue_ you right away. They usually start by a cease and desist. And give us 15k. And sign this paper acknowledging that you recognize that we truly own the name. (They can use that later as a precedent for later cases.)
Answer: Changing the name of a larger game development project is often easier said than done because of all the marketing expenses and PR effort which was already invested to promote the old name. Companies like EA run a well-oiled marketing machinery for every title which starts working long before a title is even announced. The money and time they lose through a name-change might far outnumber the cost of the lawsuit. Also, when the game was already sold or the trademark owner feels like the existing marketing has already damaged their brand, the trademark owner could try to demand recourse even when the name is changed immediately.
You can check the US patent office database of registered trademarks to check if your game's name is a trademark registered in the United States. You should also check if there is a database like that specific to your own country.
There is generally no sure way to be completely save from lawsuits because everyone can sue anyone for anything, and finding out if the lawsuit is even remotely justified already takes money from both sides.
I am not a lawyer, but if I would want to protect my private finances from being ruined by a lawsuit against my game, I would consider forming a limited company and distribute my game through that company. A limited company is a separate legal entity from yourself, and when it goes bankrupt you will only lose the money you invested into the company and will not inherit any of its debt. This also means that anyone who sues your company won't see any more money than the company owns, which makes it unattractive for any trademark trolls who don't care about your game and only want money.
But in the long run you should really get proper legal advise and not just rely on what random laypeople on the internet like me tell you. When you want to run a company, legal advise is just part of the cost of doing business.
Comment: Both of those tips and links are gold for me, thanks a lot.
Answer: IANAL. Disclaimer: my advice is based on my experience in the gamedev field alone.
You can not use trademarked names for your actual game. Try and come up with a different name. A lawsuit is an ugly thing.
You can go with something unique-ish like... Kuiper Belt something. Do your best to not even derive your name from other games.
Comment: Actually "Kuiper Belt" is already a registered trademark by LG Electronics for all kinds of technology-related goods and services, including "games". Check [the USPTO database](http://tess2.uspto.gov/). (unfortunately it doesn't allow direct links to results because their URLs  become invalid after a short time).
Comment: For sure, Zimspy, but I'm worried about using a trademarked name on accident, not on purpose.


Resistors with lead-free coating

Question: I know it is bad to solder lead-free devices, such as resistors, with lead. However, is it possible (with less effort) to remove this lead-free coating on the resistors to make it possible to solder with lead? PCB has also a chemical coating.
Comment: You seem to think having lead-free parts are made to be incompatible with lead solder. Why is that? Using lead free components does not mean they are incompatible with lead solder. The resistors are just marked as lead free because they are lead free, it does not mean that they ever contained any lead or have been changed in any way.
Comment: Why is it bad??
Comment: I have boards soldered with Pb all the time and most of the components available today are all Pb Free.  There is no issue (unless it's a BGA type).
Comment: I should have add that I intent to use it at low temperature - where it is better to solder with lead. Well, I can't imagine that it is good to have different materials. The question is if that tiny amount of coating can make problems
Comment: Is -55C cold enough?  That's what we test to.
Answer: The coating on the leads is typically tin.
For Pb-free components, the manufacturer will have used Pb-free Sn, for example the datasheet for some resistors I picked at random says:

Pure tin plating provides compatibility with lead (Pb)-free and lead containing soldering processes.

Presumably by "solder with lead" you mean solder with tin/lead solder (e.g. 60/40 or 63/37). There will be no need to remove the coating.
Comment: @Jeres Pb-free means they are *sure* there is no Pb in them. Not saying Pb-free does not mean that there is Pb in them. A pure Pb coating would not be used anyway, even in the old days, AFAIK.
Comment: I agree, I know places that produce thousands of circuit cards every year using leaded solder and a mix of leaded and lead-free parts.  I have not heard of them having any problems.
Comment: But Bb-free = lead free ?! I have seen some resistors where Pb-free is not specified, which for me means they have a lead coating
Answer: There are many resistors out there which have lead free terminals, you just have to search in mouser ticking the ROHS compliant.
The problem of using leaded + unleaded solder is that the melting point can go down dramatically, in some cases below water boiling point creating reliability issues, however these days most components have pure tin contacts, and pure tin + leaded shouldn't pose a problem the same way pure tin + unleaded shouldnt.
YET... there is more to the story, because it's not only the terminals that may contain lead, also the ceramic substrate of the resistor. You can tell which have leaded ceramic as in the ROHS certificate it says compliant by exception.
This won't affect the performance of the circuit however for environmental consciousness you may want to avoid them if the specs allow you to.
There are options without leaded ceramic such as RC0603FR series, i guess more will pop up in the future

Resistors with lead-free coating


Can a VPN connection be detected (and get blocked) even after the key exchange happens

Question: If the key exchange happens when using lets say Wireguard or any other protocols that use IKA, and the connection never drops, could the ISP still detect the VPN traffic using Deep Packet Inspection?
Comment: Most VPNs use well defined ports and most commercial VPNs use well known IP addresses.
Comment: Some VPN base on TLS connections, for such connections the only chance to identify them as VPN would be TLS fingerprinting in the handshake phase.
Answer: Yes, the ISP could detect encrypted traffic (likely) corresponding to VPN. They could block it as well (such as blocking the server you are connecting to).
They could not block specific traffic inside the VPN or know what is being transferred (unless that's obvious from traffic volumetry)
Answer: What happens with VPN, for example when you are at home: Normally, all your traffic would go to your isp, who sends it to the destination. With vpn, your computer encrypts your traffic, and sends it to your isp, addressed to the vpn provider. Your isp sends it to the vpn provider, who decrypts it and passes it to the real recipient, with the return address forged so it isn't yours, but the von provider.
Your isp can detect that you are sending to a vpn server. First, by analysing your traffic. Then there is the obvious fact that you send all your data to one single address, instead of different ones. So they can interfere with your traffic.
The vpn provider decrypts your traffic. They are in a very strong position to interfere. So you need to trust your vpn provider.
At last the vpn server sends your traffic to the recipient. It looks like it comes from a different address than yours. The recipient may have a list of addresses that Vpn addresses are detected and block anything coming from a vpn.


Do any speculative executation attacks affect ARMv7 CPUs?

Question: Do we know if there are speculative execution attacks that affect ARMv7 CPUs at this time? Are there any theoretical risks that need further investigation?
Answer: ARMv7 is a version of the ARM CPU specification, not a specific CPU design.
Some ARMv7 implementations, like Cortex-A15, make use of speculative execution and are affected by the Spectre vulnerability. Others, like Cortex-A5, do not implement speculative execution and are unaffected.
For details on which ARM cores are affected and what mitigations exist, refer to: https://developer.arm.com/support/arm-security-updates/speculative-processor-vulnerability


Selecting voltage rating for capacitors

Question: In my project I want to use some ceramic and electrolytic capacitors, I will need the capacitors be at least 10V rated, but what will happen if I use much higher rated capacitors (just to make sure in case of something went bad they don't explode!)?
Comment: Even if you have enough information to make progress on your system, you should wait 24-48 hours to accept an answer.  This gives more time for other users to post high quality answers.
Comment: Geesh, if I had known you were going to accept a answer in the first few minutes, I wouldn't have bothered to go into such detail
Comment: possible duplicate of [High Voltage Capacitor, in a low voltage system?](http://electronics.stackexchange.com/questions/13091/high-voltage-capacitor-in-a-low-voltage-system)
Comment: @Olin - consolation: I always appreciate your extensive answers, very knowledgeable. Others do as well; in a short time you gained a lot of reputation.
Comment: @Olin Sorry I did not ment to be not thankfull, the answer I marked was enough at that time I wanted to order some caps, but now I really enjoyed your answer. Thanks.
Answer: In general, the voltage rating of a capacitor is the maximum it can take and still stay within specs.  Unpolarized caps, like ceramics, can take any voltage +- the voltage spec value.  Polarized caps, like electrolytics and tantalum, can take any voltage from 0 to the voltage spec value.
That said, different things happen to different cap types as their voltage gets near the maximum.  With electrolytics, the lifetime goes down.  In theory with a reputable manufacturer, the rated lifetime is at max voltage and temperature unless stated otherwise.  You could therefore say the lifetime goes up if you operate the cap below its rated max voltage.  The two major stressers of electrolytic caps are voltage and temperature.  Large currents can also hurt them, but this is due to heating so is really a temperature issue.
Ceramics have different properties.  Voltage doesn't effect lifetime of SMD multilayer caps much, assuming of course you don't exceed specs.  Some ceramics however do not linearly store charge as a function of applied E field.  They hold less additional charge for the same voltage increment at high voltage than at low voltage.  This means the apparent capacitance goes down with voltage.  The cheap ceramics, particularly those with "Y" in their names and a few others exhibit this effect more strongly than others.  If you are just bypassing a digital chip, this doesn't matter much.  If however the cap is used in a analog filter, then this probably matters and you generally want to stick to ceramics with "X" in their name and look over the datasheet carefully.
There are issues with too low a voltage too, especially with electrolytics.  They work on a thin oxide layer on the alumimum.  This can get degraded when there is no charge accross it.
So to finally give you a concrete answer, if you are going to use electrolytic caps try to aim at running them around 3/4 or 2/3 of their rated voltage.  It's OK to have occasional spikes up to the maximum, but don't ever exceed it.  It's OK for them to be off too, but it's better that they're not completely discharged for years on end.
Comment: Olin,  Your effort in answering this quesiton so well is not wasted.  I am an electrical engineer and have spent some years as an electronics designer.  I enjoy reading your answers and bouncing it off of what I think I know.  :-)
Answer: You can always safely use caps rated at higher voltages. The only reasons not to are that they may be larger and more expensive.
See also answer to this question.
Answer: The value might be different from the marked value, if the operating voltage is much lower than the marked voltage, especially for electrolytic capacitors.
Answer: For ceramics, if 10V is your goal you will probably end up with 50V parts because that's a common voltage.  I don't bother to have anything else on hand.
For electrolytics, 25V is a common voltage.  Should be fine.

Selecting voltage rating for capacitors


Is there a free, online stock screener for UK stocks?

Question: Does anyone know if there is a free online Stock Screener for UK stocks, especially for the companies in the FTSE100?  I'm looking for something similar to the Stock Screener created by Google Finance, which seems to work just for USA based stocks.
Answer: Yes, http://shares.telegraph.co.uk/stockscreener/ has what you're looking for.
Answer: Although this is an old question, it's worth pointing out that the Google Stock Screener now supports stocks traded on the London Stock Exchange. From the country dropdown on the left, select "United Kingdom" and use the screener as before.
Answer: Most free stock screeners for UK stocks, even those mentioned above, are very poor and not worth the effort really, and searching for stock screeners on a search engine will only bring up stock screeners for USA stocks.
The best free UK stock screener (registration is required although this is FREE) is without any doubt on www.digitallook.com who also provide many other features like five year fundamentals, charts, prospects, etc, which can easily be downloaded onto a spreadsheet.
I really wouldn't look elsewhere to be honest unless you are prepared to pay.
Answer: I use and recommend barchart.com. Again you have to register but it's free. Although it's a US system it has a full listing of UK stocks and ETFs under International > London. The big advantage of barchart.com is that you can do advanced technical screening with Stochastics and RS, new highs and lows, moving averages etc. You're not stuck with just fundamentals, which in my opinion belong to a previous era. Even if you don't share that opinion you'd still find barchart.com useful for UK stocks.
Answer: I know nice and free stock screener for UK (and 20+ exchanges) - https://unicornbay.com/screener?f=exchange_str|%3D|LSE;&s=MarketCapitalization|desc&p=1|20 from Unicorn Bay.
It supports both fundamental and technical analysis.
Answer: I'm actually building a UK stock screener right now. It's more of an exercise in finding out how to work out technical things like MACD and EMA calculations, but if those are the things you're interested in, it's at  http://www.pifflevalve.co.uk/screen-builder/
As I say, it's more of a personal project than anything commercial, but it's fun to play with.


C++ Threadsafe Singleton (NOT FOR INIT)

Question: So I want to access a singleton class from multiple threads. Conceptually I'd think that calling non-const methods on this singleton instance would be not thread-safe. I've been looking online and no one seems to address this possible issue. Is there an actual problem with this, is the only issue with Singleton's thread-safety, the initialization of the instance variable?
Answer: A singleton instance has the same thread safety issues as any other instance, so calls to its methods or access to its members should be synchronized.
The initialization of the singleton itself is another issue...in gcc static initialization is threadsafe, but probably not so much on other platforms.
Also take a look at this paper addressing some threading singleton issues by Andrei Alexandrescu. His Modern C++ Design book also addresses singleton issues.
Answer: You are correct, calling a non-const methods or methods that depend on instance data that could be modified by other threads must be syncronized.
Answer: Apart from the thread-safety issue with the initialization of instance variable, the singleton objects should be treated as any other normal objects with respect to thread-safety for the method calls.
ie, Any methods ( you need synchronization for const method as well, if we are trying to read the value of a variable, which will get updated in another method by another thread)  of the singleton object accessed by multiple threads and involves in shared data read\write must be synchronized.

C++ Threadsafe Singleton (NOT FOR INIT)


How to export all the products that are not assigned to any category?

Question: I am looking for a way to export all the products that are not assigned to any category. I know it can be done using XML, but I don't have enough knowledge in XML to create an Action so is there any easy export products that are not assigned to any category in CSV format?
Answer: <code> // First You need to get the collection of all product based on the category array having products.
       $collection = Mage::getModel('catalog/product')
                                 ->getCollection()
                                 ->joinField('category_id', 'catalog/category_product', 'category_id', 'product_id = entity_id', null, 'left')
                                 ->addAttributeToSelect('*')
                                 ->addAttributeToFilter('category_id', array('eq' =>array(1,2,3,4)))
            ->getData();
       $cat_pro_id = array();
       foreach($collection as $prod_data){

       $cat_pro_id[] = $prod_data['id'];

   }
   //print_r($cat_pro_id); // here you got the all product id belongs to category

   $products = Mage::getModel('catalog/product')->getCollection()->getData();
       $pro_id = array();
       foreach($products as $product){
           $pro_id[] = $product['id'];
       }
 //print_r($pro_id);  // all product in store having product id
 $product_id_remain = $pro_id + $cat_pro_id ; // merging the two array get the id array of product which not belongs to category.
 $products = Mage::getModel('catalog/product')->getCollection()->addAttributeToFilter('entity_id', array('in' =>  $product_id_remain));
 // get the product collection based on prodcut id array filteration
</code>
//To save in csv file
<code>$uri = 'main.csv';

 $csv = array(
            'header' => array('products'),
            'rows' => $products,
        );

        $this->_h->CSV__write($uri, $csv);
</code>
Answer: Given you have a spreadsheet editor like Excel:
1) Export your entire product base
2) Open your CSV in excel
3) Sort the CSV by the Categories field, this will bring all the empty cells in this column to the top/bottom depending on how you sort.
4) Either copy all these products to a new excel for editing or remove the products that have categories and you will have a CSV of your category-less products.


Does the fiber product of two normal varieties remain normal?

Question: Suppose $k$ is an algebraically closed field, and $X$, $Y$ are two normal varieties over $k$. Is the product $X \times Y$ necessarily still normal?
Answer: Are you asking about products or fiber products? If you're asking about fiber products, the answer is no. For example, you can have two smooth surfaces in A³ whose intersection is a nodal cubic (see the picture on this page of Hartshorne). This intersection is the fiber product of the two surfaces over A³.
Comment: There's another easy and explicit example: take the squaring map $\mathbb{A^1} \rightarrow \mathbb{A}^1$ ($k[x^2] \rightarrow k[x]$ on rings -- which is flat!) and take its fiber product with itself to get $k[x, y]/x^2 - y^2$ which is not normal.  In reference to Greg's answer, the squaring map is not geometrically normal at 0.
Answer: The answer is yes.
In general one can define a normal morphism of schemes $f:X \rightarrow Y$ to be a flat morphism such that for every $y \in Y$ the fibre over $y$ is geometrically normal.
Then we have the following theorem on normality and base change (see EGA Ch 2 IV 6.14.1)
Let $g: Y' \rightarrow Y$ be a normal morphism of locally noetherian schemes. Then for every normal $Y$-scheme $X$ the fibre product $X \times_Y Y'$ is normal.
Over an algebraically closed field flatness and geometric normality reduce to just being normal so the result follows.
Comment: Thank you! You argument is definitely true. By the way, the definition of normal morphism seems should be flat and every fiber geometrically normal. But it may also be true that if a variety is geometrically normal, the under any base change it remains to be normal, not necessarily by a field extension's base change.
Comment: You are right... I fixed the answer up - in particular no need to mention affines here and the answer is yes.


Trying to make an Applescript to open webpages added to Reading List

Question: I would like to automatically open download links in Safari that I remotely add to the Reading List.  It is easy to add to the Reading List in iOS, and the changes are instantaneous on my computer.
My idea is to use a Folder Action Applescript to watch for new files added to  /Library/Safari/ReadingListArchives/
New alphanumeric folders are added there containing "Page.webarchive" files and if possible "ReaderPage.webarchive"
My script is based of an existing Folder Action, "add - new item alert".
Please know that this is my first attempt to code; here it is:
on adding folder items to this_folder after receiving added_items
try
    tell application "Finder"
        --get the name of the folder
        set the folder_name to the name of this_folder
    end tell

    tell application "Finder"
        --go to the desktop
        activate
        --open the folder
        open this_folder
        --select the items
        reveal the added_items
        --select the items
        tell application "System Events"
            set item_list to POSIX path of file "Page.webarchive" of added_items
        end tell
    end tell

    tell application "Safari" to open POSIX file item_list
end try
end adding folder items to

This code successfully opens the new alphanumeric folder containing the webarchive.  Continuing, I have been trying to code a prompt for Safari to open the page.  My understanding is to open the file, the POSIX path is needed.  I tried to name that path and direct Safari to it.  This probably makes quite evident I have no experience, so thanks to anyone who has advice.
I have also unfortunately noticed that direct download links don't show up here despite showing up in the Safari side panel, and I wonder where those exist.  This code will probably also be useful to watch and open those links.
Is there a location to watch for Reading List additions which cannot be saved as a webarchive, like direct file links?  And following my code, how can I command Safari to open the new file brought to focus by the Applescript?
Thanks so much,
Kenny
Answer: Try this:
on adding folder items to this_folder after receiving added_items
    repeat with aFolder in added_items
        set archivePath to (aFolder as text) & "Page.webarchive"
        try
            tell application "Safari" to open archivePath
        end try
    end repeat
end adding folder items to


CiviCRM module "Group-Based Pricing" doesn't work in Joomla

Question: the module Group-Based Pricing (com.zengenuity.civicrm_groupprice) can't be enabled in Joomla. I copy the files from https://github.com/zengenuity/civicrm_groupprice into the media/civicrm/files and the module is still red in the page "Administer->System settings->Manage Extensions". The civicrm was moved from the Drupal site into the Joomla.
Answer: Can you confirm that's the correct directory for extensions by going to Administer menu » System Settings » Directories and looking at the Extensions directory listed there?  It may also need to be updated from the Drupal location if you copied the database.  If there's a token like <code>[civicrm.files]</code> you can click the question mark in the blue circle in the text at the top of the page to see what that token resolves to.
If the directory is correct, it's likely a file permission issue.
Answer: I just noticed that this module appeared with another name in list of CiviCRM Extensions: "Limit Prices by Group (civicrm_groupprice)". Author Wayne Eaker (firstname.lastname@example.com). This is a bit confusing.


What is the difference between an indefinite integral and an antiderivative?

Question: I thought these were different words for the same thing, but it seems I am wrong. Help.
Comment: [Wolfram Mathworld](http://mathworld.wolfram.com/IndefiniteIntegral.html) says that an indefinite integral is "also called an antiderivative". This [MIT page](http://www-math.mit.edu/~djk/calculus_beginners/chapter16/section01.html) says, "The more common name for the antiderivative is the indefinite integral." One is free to define terms as you like, but it looks like at least some (and possibly most) credible sources define them to be exactly the same thing.
Comment: Not really a direct answer to your question, but note that there are examples of functions which are integrable but which don't have an antiderivative, and examples of functions which have an antiderivative but are not integrable. Using "indefinite integral" to mean "antiderivative" (which is unfortunately common) obscures the fact that integration and anti-differentiation really are different things in general.
Answer: "Indefinite integral" and "anti-derivative(s)" are the same thing, and are the same as "primitive(s)".
(Integrals with one or more limits "infinity" are "improper".)
Added: and, of course, usage varies. That is, it is possible to find examples of incompatible uses. And, quite seriously, $F(b)=\int_a^b f(t)\,dt$ is different from $F(x)=\int_a^x f(t)\,dt$ in what fundamental way? And from $\int_0^x f(t)\,dt$? And from the same expression when $f$ may not be as nice as we'd want?
I have no objection if people want to name these things differently, and/or insist that they are somewhat different, but I do not see them as fundamentally different.
So, the real point is just to be aware of the usage in whatever source...
(No, I'd not like to be in a classroom situation where grades hinged delicately on such supposed distinctions.)
Comment: Well, this is not a question of "truth" but of mathematical usage. It surprises me to see that an integral with "variable" upper bound is called "indefinite". (Not to mention the serious but potentially-nonsensical question of "what is a variable, as opposed to constant?) Or, for all I know, usage may have drifted over the years... One must always pay attention to _context_, which may entail usages different from what's expected. As long as it's up-front and not deceitful, it's mostly harmless, even if jarring.
Comment: The difference is that the antiderivative has to be differentiable; the indefinite integral does not.
Comment: @paulgarrett : many people call "the primitive" of a function the antiderivative that has the value $0$ at $0$.  I thought this was universal, but I Googled it and found several people who used it for any antiderivative.
Comment: Pugh's "Real Mathematical Analysis" also uses "indefinite integral" to mean the function $F(x) = \int_a^x f(t)\,dt$.
Comment: www.ma.utexas.edu/users/sadun/F11/408N/FTC.pdf This defines them differently though. Is it incorrect?
Answer: An anti-derivative of a function $f$ is a function $F$ such that $F'=f$.
The indefinte integral $\int f(x)\,\mathrm dx$ of $f$ (that is, a function $F$ such that $\int_a^bf(x)\,\mathrm dx=F(b)-F(a)$ for all $a<b$) is an antiderivative if $f$ is continuous, but need not be an antiderivative in the general case.
Comment: In which books is the definition of the indefinite integral stated?
Answer: An antiderivative of a function $f$ is one function $F$ whose derivative is $f$.  The indefinite integral of $f$ is the set of all antiderivatives of $f$.  If $f$ and $F$ are as described just now, the indefinite integral of $f$ has the form $\{F+c \mid c\in \mathbb{R}\}$.  Usually people don't both with the set-builder notation, and write things such as "$\int \cos(x)\,dx = \sin(x)+C$".
This is what I was taught.  One of the other answers here is completely different.  I did some Googling, and, to my surprise, Wikipedia defines an improper integral as a single function.  I found a link at http://people.hofstra.edu/stefan_waner/realworld/tutorials4/frames6_1.html that agrees with my answer.  I don't know if there is any consensus in the math community about which answer is correct.
Answer: (http://math.mit.edu/suppnotes/suppnotes01-01a/01ft.pdf) p 1 sur 7
Antiderivative is an indefinite integral.
Answer: The answer that I have always seen: An integral usually has a defined limit where as an antiderivative is usually a general case and will most always have a $\mathcal{+C}$, the constant of integration, at the end of it. This is the only difference between the two other than that they are completely the same.
You will be safe in class though if you assume them to be identical if neither of them has a defined limit.
Answer: (J. Stewart. Calculus pp 391) I believe Stewart defines an antiderivative as an indefinite integral.
Comment: Nope. This is only true if $f$ is continuous. Stewart is assuming $f$ is continuous, as you can see in the paragraph above the paragraph that you quoted.
Answer: i think that indefinite integral and anti derivative are very much closely related things but definitely equal to each other.
indefinite integral denoted by the symbol"∫" is the family of all the anti derivatives of the integrand f(x) and anti derivative is the many possible answers which may be evaluated from the indefinite integral.
e.g:
consider the indefinite integral:
        ∫2xdx
in this indefinite integral, 2x is the differentiated function with respect to x and the integration results in the function x^2+c where "c" is the constant but what is the antiderivative of 2xdx?
the answer is not one it can be many i.e x^2+10, x^2+4, x^2+0 etc and these all are the members of  ∫2xdx.
so the family i.e ∫2xdx is the integral and all its member are the antiderivatives.
Answer: I can't believe I haven't found a single answer that says this, but:
This is exactly what the fundamental theorem of calculus is about.

An integral is an area function. An integral of function $f:\mathbb R  \to \mathbb R$ (usually assumed continuous I guess) is any $F:\mathbb R  \to \mathbb R$ s.t. $F(x) - F(a) = \int_a^x f(t)dt$. $F$ tells you the area under $f$ from $a$ to $x$.

An antiderivative $G:\mathbb R  \to \mathbb R$ is any differentiable function whose derivative is $f$.

The whole point of the fundamental theorem of calculus is to tell you

anti-derivatives and integrals are identical.

Integrals are anti-derivatives: Such an area function $F$ of $f$ is actually not only a continuous function but a differentiable function whose derivative is $f$ itself, i.e. $F'(x)=f(x)$.

Anti-derivatives are integrals: Such an antiderivative $G$ of $f$ can actually be used to compute the area under $f$ like $\int_a^x f(x) dx = G(x)-G(a)$.

Notes:

$F(x)-F(a)=G(x)-G(a)$ for any area functions / integrals / anti-derivatives $F,G$ and for any $x,a \in \mathbb R$.

This is because the rule is any anti-derivatives $F$ & $G$ will differ by a constant. Like for all $F,G$ there exists a $C$ s.t. for all $z \in \mathbb R$, $F(z)-G(z)=C$. In particular, $F(x)-G(x)=F(a)-G(a)=C$.

It's just occurring to me that the fundamental theorem of calculus' saying that integrals and anti-derivatives are identical is kinda like in complex analysis where they say that holomorphic and analytic are identical. (This isn't the fundamental theorem of complex analysis though, which is apparently Cauchy's Integral Theorem. Kinda anti-climactic, but ok I guess.)
Comment: Dude, what happened to your reputation.
Answer: The indefinite integral is a definite integral in which we ignore the limits of integration:
$$\int f(x) \,dx$$
The utility of the indefinite integral is in finding the antiderivative $F(x)$ of a complicated function. That is, the antiderivative is the result of solving the indefinite integral:
$$ \int f(x) \,dx = F(x) \longrightarrow F'(x)=f(x) $$


Scripted auto-closing SSH tunnel capturing assigned port number

Question: A script was automatically creating an SSH tunnel in the background with a simple command like this, which works:
ssh -R 19000:localhost:22 firstname.lastname@example.com -i ~/.ssh/keyfile &

This answer describes how to set up dynamically assigned ports and redirect the output of SSH such that the port can be captured by my script. It works too:
ssh -R 0:localhost:2222 firstname.lastname@example.com -i ~/.ssh/keyfile 3>&1 1>&2 2>&3 | sed -n "s/^Allocated port \([0-9]*\) for/port \0/p" > portfile.txt &

Separately, this article suggests a method to have tunnels auto-closing after a specific time, which also works on its own:
ssh -R 19000:localhost:22 firstname.lastname@example.com -i ~/.ssh/keyfile sleep 10;

Now I wish to combine them into one line but the tunnel collapses before my sleep command can execute:
(ssh -R 0:localhost:22 email@example.com -i ~/.ssh/keyfile 3>&1 1>&2 2>&3 "sleep 1" | sed -n "s/^Allocated port \([0-9]*\) for remote forward to localhost:2222/\1/p" > portfile.txt); sleep 10 &

Output is redirected and the port number is written to the file as expected, but immediately the tunnel closes and the sleep command runs.
Please can someone explain what I'm doing / doing wrong in this command, and why it doesn't work?
Answer: Try to send your initial SSH tunnel to background. Add thees options '-fN'


How to get Ajax to load first?

Question: After updating module webform_paymethod_select I noticed that Ajax on webforms stopped working. I was unable to edit any existing webforms or create new ones. This happens when JS Aggregation is enabled. Clearing caches did not help.
Console shows two error messages:
TypeError: D.ajax is undefined
  var beforeSerialize = D.ajax.prototype.beforeSerialize;

TypeError: Drupal.ajax is undefined
  Drupal.ajax.prototype.commands['getBlock'] = function(ajax, response, status) {

The first error is coming from jQuery update and the second one is coming from the boxes module. Disabling boxes module worked for me but it left an important part of my site broken.
I believe the reason is that Ajax is unable to load before boxes requires it. After this Ajax just does not load at all.
If anybody can help me out, I would appreciate it.
EDIT:
I couldn't quite figure out how to get Ajax to load before everything. I tried changing its weight in drupal_add_js() and modifying hook_boot() to get it to load first. This seemed dangerous as i couldn't guarantee that it would only apply to the pages i needed Ajax to be first in. I then turned to figuring out how to encapsulate the boxes modules' JavaScript code that was throwing this error. I noticed that the code was being encapsulated with the following:
(function ($) {
  ..
})(jQuery);

Drupal suggests using :
(function ($) {
  // All your code here
}(jQuery));

That didn't work either, so i used the following instead and this made the error go away (except for the error jQuery Update is throwing):
jQuery(function($){
  ..
});

I am now able to edit existing webforms. I don't really understand why this worked, so if anybody can provide some insight i would appreciate it.
Answer: It could help.
add php function:
use Drupal\Core\Ajax\AjaxResponse;
Class AnyClass extends FormBase {
public function buildForm(array $form, FormStateInterface $form_state) {
/**
 * Running the library drupal core ajax
 */
$form['#attached']['library'][] = 'core/drupal.dialog.ajax';

}
}

How to get Ajax to load first?


Three.js object3D.toJSON submitted parameters

Question: Why are there only material and geometry in the file created by toJSON() ?
Why do I have to add other object's parameters(position, rotation,etc.) manually?
Answer: In the source, it does seem to keep that info. It keeps the Matrix, but I'm not sure if that'll work out of the box without some operation, like updating the matrix? I dont know enough in that area.
But another alternative I saw in the source is to stash that info into "userData", and then retrieve it on the other end, because that does get passed along in the source.
If no one comes along to give better advice than I am capable of, you should add this as a request/issue ticket on github. It's possible that it's an outstanding/ new issue.


How large can an animal's eye realistically get?

Question: The largest eye in the world belongs to the giant squid, which has eyes up to 27 cm in diameter (some reports from the 1800s say 40 cm). Extinct ichthyosaurs also had very large eyes, 20-30 cm in diameter. How large can eyes realistically get? What evolutionary pressures could result in obscenely large eyes?
Comment: Note icthyosaurs had eyes rivaling that of the largest squid, both use them for the same functions to see with high acuity in near darkness of the deep ocean.
Answer: Oh, those sexy eyes:
You need to have some advantage to having eyes, or else they degenerate like blind fish. So why do animals get distorted into seemingly impractical forms?

The most obvious thought is that if eyes become a sexual display somehow, the might grow to the point of being dysfunctional. If the opposite sex likes it, it will select for it.
Big eyes imply dark places - either nocturnal animals or ones living in dark places like the deep ocean (those giant squid). This is a decent link to the whys and hows. https://animals.mom.me/nocturnal-animals-large-pupils-7471.html
Some special selective pressure and nurturing could result in a specialized species with really big eyes. If an animal (say, an owl) were domesticated and selected for large eyes because they can see ships at sea (for example) and alert their owners, those with the freaky birds can flee threats (or pursue victims, for pirates) even at night. People are people, and for something like this, big eyes could be selected for even if they don't actually result in better vision (appearance creates reality).
Comment: @jamesqf, I agree, but the ostrich and horse are relatively large compared to their eyes, and I was thinking more in proportion. Most nocturnal animals are smaller. I'm trying to come up with scenarios where the animals could potentially have almost cartoonish eyes.
Comment: That first one is an interesting concept. How large would the eyes have to grow to become dysfunctional?
Comment: WRT your second point, note that the land animals with the largest eyes are the horse and the ostrich, neither of which are especially nocturnal.
Comment: All that is needed for an eye to be dysfunctional is to be selecting for size rather than function. I'd guess the eye would stay at least somewhat functional if it's needed for survival, but if a male can get away with using other sensory systems to compensate, Who knows? I've never actually heard of animals where the eyes were specifically described as sexual displays, but I think of the peacock. Those are, of course, not REAL eyes, but still. PS I definitely know humans who consider eyes sexual displays.
Comment: @DWKraus: Ah, relative size rather than absolute.  Then (depending on how you actually define "eye") the record probably goes to the purple sea urchin, since the entire surface of their body is one big eye: https://www.livescience.com/5970-body-sea-urchin-big-eye.html


In Pokemon, what is a V card?

Question: So for my birthday, my father got me a new Pokemon card set that you can get at Walmart. The card set he got me was a Venisaur V, but I don't necessarily know what the V means. Is it a better version of GX and EX?
Answer: Yes, Pokémon V are the current (Sword and Shield block) two prizer mechanic, which are cards that are very powerful and as a result give the opponent two prizes instead of one when they are knocked out.  Pokémon VMAX are even bigger, giving 3 prizes and having more hit points, and evolve from Pokémon V.  Pokémon VStar also evolve from Pokémon V, give two prizes, and have a special power (ability or attack) that you can use one total per game (similar to GX attacks).  Pokémon V-Union are special Pokémon that require four cards to make, and can be created once per game, and have multiple abilities and attacks typically.
Note, the term "Pokémon V" in most cases refers to Pokémon V, Pokémon VMAX, Pokémon V-Union, and Pokémon VStar, unless it is talking about a specific Pokémon (so "Rayquaza V" is only the V, not the VMax).
When the first full set next year comes out, Pokémon Scarlet and Violet, that will begin a new block with a new mechanic - which is actually an old mechanic;  Pokémon ex (not the same as Pokémon EX) - but along the same basic lines.  It is a repeat of an older mechanic, and may or may not share the same characteristics.
Comment: Is the letter V an acronym for the pokemon cards?
Comment: The "V" doesn't really mean anything... it's just a letter that sounds important and big.  There's no specific meaning for it.
Comment: Oh, well, okay. V of all letters? Their choice. Thanks.

In Pokemon, what is a V card?


How to programmatically do a switch user on macosx

Question: I am working on a security agent plugin on Mac OS X and would like to allow the user to do a switch user (in the same way of the button "switch user" that is displayed when you lock your account).
After some research, I found  this thread with the following solution from the command line:
<code>/System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -suspend
</code>
Launching this command line works well when the user is logged in. However, in the context of a Security Agent plugin: "The Security Agent runs with restricted permissions so that the user must be physically present, using the graphical user interface, in order to be authenticated. The graphical user interface elements can't be used through a command-line interface such as the Terminal application or a secure shell (ssh) remote session"
So the command line call fails to execute. Is there any other solution to simulate a switch user, like sending an apple event? I didn't find any other solution.
Thanks in advance for any idea.
Best regards
Answer: Try making a LaunchAgent that runs for each user. In your Security Agent plugin, connect to the agent for the current console user (eg using BSD sockets), and tell it to run the CGSession command.


Reset a PCI Device in Linux

Question: Is there a generic way to reset a PCI device in Linux from the command line? That is, cause the PCI bus to issue a reset command.
Answer: according to http://www.kernel.org/doc/Documentation/ABI/testing/sysfs-bus-pci you can reset individual functions of the device if that's supported:
What:       /sys/bus/pci/devices/.../reset
Description:
            Some devices allow an individual function to be reset
            without affecting other functions in the same device.
            For devices that have this support, a file named reset
            will be present in sysfs.  Writing 1 to this file
            will perform reset.

Comment: This issues a function-level reset, which does not have to be implemented and specifically does not reset the entire device, only the function in question.
Answer: The problem with the solutions above is that they require the cooperativity of the device; however in most scenarios the reason to reset it is exactly its non-cooperativity.
However, as it is described here, there is another, "harder" way to reset it on the PCI level: we remove it from the PCI bus and then re-insert it by a rescan.
The steps:

echo 1 >/sys/bus/pci/<pci-id-of-device>/remove. We can find its PCI ID with an lspci command.
echo 1 >/sys/bus/pci/rescan

I have here a buggy pci device, sometimes PCI-level reset, sometimes this removal-readd trick fixes it. I am about to write a script to do it automagically. :-)
Comment: This worked beautifully for me to periodically reset an old RAID card with a bunch of failing drives attached to it that would keep infinitely retrying bad sectors without ever returning I/O errors to the kernel.  Attempts at data recovery using ddrescue would simply lock up once it hit these bad sectors, so the only way to make progress was to keep resetting the card using the method described in this answer.
Comment: Ugh. My USB controller is still buggy, even after this reset.
Comment: @Chris Are you sure that it is the controller, and not a device on it?
Comment: Yes, I'm sure it's the controller `00:14.0 USB controller: Intel Corporation 200 Series/Z370 Chipset Family USB 3.0 xHCI Controller`. I pass it to VM through VFIO and after VM reboot I also have to reboot the host to make it work again, otherwise any USB plugged in is detected, but communication fails.
Comment: @ven42 Wow, thanks! But note, it is not the hdd, but the hdd controller. It is possible that the hdd controller is bad, and the disk is good. Try it with a different controller (not in a different sata slot, as it will be likely the same controller). The simplest way is to use an usb adapter for that.
Comment: @peterh-ReinstateMonica Under normal circumstances, I would definitely have started pulling hardware components as you suggest rather than doing this, but thanks to pandemic restrictions, I'm miles away from this ancient, neglected machine with zero prospect of getting hands on it anytime soon.  Resorting to fancy kernel tricks over a (half-broken) iKVM is the best I can do right now, so the butt-saving factor for your method is abnormally high. :-)
Answer: The closest thing the PCI bus has to a device level reset is changing the power state to D3 and back to D0.  After unloading the driver ( it would be bad to reset the hardware out from under the driver ), you can use setpci to write to the control registers to change the power state, but I believe this happens automatically when you unload the driver.
Answer: Since a generic PCI device is not hotpluggable there won't be a way to reset it and have the kernel re-enumerate it.
Whatever kind of problems you are trying to solve, there surely is a better way than to just reset it.
Comment: I'm simulating a PCI device in QEMU and need to reset it's state as I develop. I wanted to do it from within the guest.
Comment: I have a buggy pci cctv card, it is working but sometimes dies with a segfault. After that, the whole system needs to be restarted, wiht a PCI reset this could be avoidable ... The system is stable, no harm, only the video input gets blank, so sometimes it is a better solution to reset the PCI than restarting the whole machine every day. (especially if you are 8000km away from that machine for 6 months)

Reset a PCI Device in Linux


Is it possible to detect in which way the player is facing at exactly and store it?

Question: I have been trying to find out if you can store the direction a player is facing and maybe use it to summon an arrow that shoots in that direction.
I want to make a gun but it would take years and very many command blocks to make a system that will detect every single direction and then shoot the arrow in that direction. That's why I'm asking if there is any way to do it.
Answer: Assuming 1.13.
To store player's rotation, use execute store:
execute store result score rot0 store run data get entity @p Rotation[0] 1000000
execute store result score rot1 store run data get entity @p Rotation[1] 1000000

which stores his rotation in multidegree


Does Crafter's Fortune affect the spellcraft check for crafting magic items?

Question: When crafting magic items you make a spellcraft check to see if you are successful. Does the Crafter's Fortune spell effect this check, or does it only apply to skills like Craft(Alchemy)?
Answer: The spell only applies to Craft skill checks.
According to the description of the Crafter's Fortune spell, the bonus only applies to Craft.

The target is struck by inspiration and gains a +5 luck bonus on its next Craft skill check.

Normally, magic item creation requires a Spellcraft skill check, even though you are "crafting" something. If you don't use a Craft skill (such as alchemy, weapons, armor, etc.) for making magic items, then the bonus doesn't apply.
However...
It applies if you use the Craft skill to make magic items.
And there are very limited ways to do this. One is with the Master Craftsman feat. Here is an abridged version of the feat text:

Choose one Craft or Profession skill in which you possess at least 5 ranks. ... You can create magic items using these feats, substituting your ranks in the chosen skill for your total caster level. You must use the chosen skill for the check to create the item.

In other words, you can use Craft (alchemy) in place of the Spellcraft check when creating a wondrous item. And you would get the bonus from Crafter's Fortune on the check.
Answer: The crafter's fortune spell's description says, "The target is struck by inspiration and gains a +5 luck bonus on its next Craft skill check." The skills Craft and Spellcraft are distinct skills, and the spell's luck bonus only applies to Craft skill checks, not Spellcraft skill checks, even when that Spellcraft skill check is made to create a magic item.
However, sometimes a Craft skill can be employed instead of the skill Spellcraft—the feat Master Craftsman is one way—, and, in such cases, a caster could benefit from the bonus provided by the spell crafter's fortune when making a magic item.
Comment: @MikeQ Other voices saying the same thing are *fine*, especially if the difference is moments. Somebody's phrasing may be more appealing than somebody else's.
Comment: Darn, I've been ninja'd again!
Answer: Not usually
Spellcraft and Craft are two separate skills. You will only get the luck bonus from Crafter's Fortune for the Craft skill.

The target is struck by inspiration and gains a +5 luck bonus on its next Craftskill check.

This will only be relevant for magic item creating if the specific magic item requires a Craft check of some kind to create (this is often the case with crafting magic armors for example).


How to calculate ATT using Propensity Score Matching method

Question: I am working on thesis work for Mphil. I am interested to estimate the average treatment on treated effect (ATT) by using propensity score matcing method. The primary data on 320 respondents, out of which 160 are beneficiaries of a social cash transfer and 160 are non-beneficiaries have been targeted. The propensity scores will be calculated through binary logistic regression. Is this suitalbe to estimate ATT in this situation?
Answer: Yes, but there are some issues that may make this procedure slightly challenging. First, matching for the ATT generally involves discarding control units until a sample of control units comparable to your treated units remain. When you don't have more control units than treated units, you will need to match with replacement, meaning that you will discard some control units, but others will be given a larger weight in the effect estimation. Matching with replacement has been shown to often have poor empirical properties.
Second, the theory for estimating marginal treatment effects depends on random sampling from a population of interest. If your 360 units were selected for a specific reason, and that reason could be related to the treatment effect, then your treatment effect estimate will not generalize to a meaningful population. Ideally, you want your treatment effect to generalize to others who would take the treatment in the population, not just others who would take the treatment in your chosen sub-population.  The reason I mention this is that it is unusual to have equal numbers in each group if treatment is assigned non-randomly.


Is the gutter on the side of my roof dormer necessary?

Question: On each side of this dormer there is a small gutter which drips onto the roof and into the longer gutter and down the side of the house. If this short gutter wasn't there, wouldn't the water go to the same place anyway? Follow up, if the short gutter is a good idea, should I connect it to the longer gutter or leave it as is?
Answer: Since the dormer extends out past the main roof, some (looks like about half) of the water would fall to the ground below. This could cause problems with drainage, puddling, erosion, and possibly lead to water infiltration.
The gutter should be there, but there should be a downspout running from the outlet to the lower gutter (as described in this answer).  As it is now, you will likely see deterioration of the shingles, where the water flows out of the outlet and across the roof. The rate of deterioration will depend on the volume of rainfall in the area, among other factors.
Comment: Additionally, without the short gutter, heavy rainfall might launch the water off the edge of the dormer at a more oblique angle.


Understanding limits for the polylogarithmic function

Question: Wikipedia lists 7 different limits for the polylogarithmic function which can be found here. For example, the fourth and sixth listed limits state that
$$\lim_{\mathrm{Re}(z) \rightarrow \infty} \mathrm{Li}_{-n} (\mathrm{e}^z) = (-1)^{n + 1} \mathrm{e}^{-z},
\qquad n = 1,2,3,\ldots$$
and
$$\lim_{\mathrm{Re}(s) \rightarrow -\infty} \mathrm{Li}_s (\mathrm{e}^z) = \Gamma (1 - s) (-z)^{s - 1}, \qquad -\pi < \mathrm{Im}(z) < \pi,$$
respectively.
If $s$ and $z$ are both real, how is one to interpret/understand either of these limits? What I mean is, after having taken the limit, the quantity the limit was taken for, re-appears. So in the first limit $z$ re-appears after having taken a limit with respect to $z$ while in the second $s$ re-appears after having taken a limit with respect to $s$.
Answer: It means
$$\text{lim}_{\text{Re}(z)\rightarrow \infty} \frac{\text{Li}_{-n}(\exp(z))}{(-1)^{n+1}\exp(-z)}=1$$


Making sure the Drupal community grows

Question: The Drupal community traditionally clustered around Drupal.org. While surely there will be a community around drupal.stackexchange.com I am really curious on how can we channel these people back to drupal.org where they can contribute in the many ways drupal.org lets us: code reviews, handbook page, answering questions in the issue queues, bug reports, etc.
Answer: Ideally Drupal Answers would be a part of drupal.org. The only problem is that with a community as big as Drupal it will take a long time to form the consensus needed to get something like it there.
I'm sure you know there have been some talks about this in groups.drupal.org, but to go from there to actually have an implemented solution for asking and answering questions that's useful and organized might take as long as 2-3 years.
So how can we bring people back to drupal.org?
I'm not sure how many people there actually is channel back to Drupal.org. This site currently have around 130 of what SE calls avid users. That is a user with more than 200 rep. This is actually not much rep, but it is high enough that you have to make an effort, either being a regular user or creating some good answers or questions. Of those avid users, I believe most of them like yourself are already contributing to drupal.org. I think it would be quite rare to find some one experienced enough to answer questions here regularly, that isn't already active on drupal.org in one way or the other.
We do
What we do already it to point people to the issue queue of a module if they encounter a bug instead of answering it here. But it's actually rare that this happens.
Random people
We do get some traffic from google, about 2k or so visits per day. The only reason we get this traffic is because right now this site fills a need that drupal.org doesn't. You can get a quick and easy answer to your question. I'm not sure that we can or should try to channel these people back. But I guess they won't be part of the community around this site anyways. If they don't come here, they might go to SO, a random blog or some other place.
Comment: I agree; more than pointing out that _Drupal Answers_ cannot (and doesn't want to) replace drupal.org (which what is done when somebody asks how to resolve a module bug), I don't think it can be done more. People already know about drupal.org, and if they want to contribute on drupal.org, they know where to go.
Comment: Good answer. And I'm always linking people back to issues on d.o and handbook pages if the opportunity arises. However, a lot of questions are simple 'how do I do X' questions, and it's quite frankly easier, more fun, and more effective to ask and answer those questions here than in drupal forums (or, god forbid, issue queues, which are NOT designed for support!).
Answer: IRC is something which we don't promote very much. While it isn't a direct link to D.org it is a hotline to the Drupal community. Perhaps we should mention it more.
Comment: It could be something to put on the FAQ page
Comment: Rather than adding a reference to IRC, I would add a reference to drupal.org for questions that are about a bug in a module, if the FAQ doesn't report that already.
Answer: Actually there is something that can be done to channel people back to Drupal.org, but this is not actually possible in a beta site.
In other SE sites (e.g., Super User with Community Promotion Ads - 1H 2011), I saw a question on their meta site asking to provide an image and a link that would be then shown as ad in the main site; the most up-voted ones will then be used in the main site. As far as I recall, on MSO the ads where about projects under a GPL or similar license.
If that would be done for Drupal Answers too, we could create an ad for a particular initiative that is important to Drupal.org, or we could put an ad for a project (module or theme) that needs some care, and that is maybe interesting for Drupal.org because it is going to be used on Drupal.org, and there are bugs or improvements to be done for the project.
The ad could even link to a page where a list of initiatives are reported, and that link could even take to the group that is used for such initiatives.
Edit: Now we have it too; see Community Promotion Ads - 2012.
Answer: I think that 'answering questions in the issue queues' is a real weakness in D.O. the redesign didn't address. There is still no email notification of answers happening. So I am guessing there is no notification of questions either, which makes it really difficult to use to get the answers; therefore, there is a migration to an easier platform, such as drupal.stackexchange.com.
D.O. is great for filing bugs, and let the maintainers know what is going on, but I really don't think it functions as a community. IRC does a good job if you happen to be in the right time zone (I'm not, so it's really quiet when I get on it). These are just my 2c.

Making sure the Drupal community grows


Does a hard drive need to have an external power source to be compatible with the Wii U?

Question: The FAQ for the Wii U regarding external storage recommends that you use an external hard drive with a dedicated power source, but is the dedicated power source absolutely necessary? I want to know, because I have an extra external hard drive lying around that doesn't connect to an external power source, and I am wondering if it will work.
Answer: According to Nintendo support, a dedicated power source is not necessary, but recommended.

Can bus-powered hard disc drives be used with Wii U?
Some bus-powered hard disc drives draw more current than the USB 2.0 specification and might not run stably, so we cannot guarantee that such devices will run properly on Wii U without the use of a supplemental power cable called a y-cable that draws power from two USB ports. For best results, we recommend using a external storage device with its own power supply that connects to the Wii U system via the USB port on the console.

Emphasis mine.

From the above quote, it appears that although the use of a y-cable is already good enough, you might still encounter a drive requiring more power than even two USB 2.0 ports together can officially provide.
Answer: To clarify definitions for my answer (as this is atleast relative to how they are packaged here, in Australia), external hard drives are the bigger units that have a dedicated power source, while portable hard drives are smaller, and power from the USB connection.
Note that Nintendo only recommend an external hard drive, and do not list it as a hard requirement.
The Wii-U can support portable hard drives, however, an external is simply more efficient.
I can think of two reasons off the top of my head.

Not requiring the Wii-U to power the hard drive is simply one less thing it is doing. This will have an arguabley insignificant impact on performance and/or reliability.
Generally speaking, it is easier to obtain larger hard drives in external format. Larger hard drives hold more games.
Comment: Theres also an easy way to test this, in the future, off sight, alone. Will update with pictures to demonstrate when I can.
Answer: So, when I tried plugging in a hard drive with no external power to the Wii U it blew out the power source for the Wii U and we had to replace it. So, a hard drive with no dedicated power source will pull too much power from the Wii U and blow the power source.


stirring or degassing wine

Question: If I stir my wine after the first racking, won't that stir up all that sediment?  Will that give the wine a bad taste and will it reduce the ABV?  I  don't want to do either one. Obviously this is my first time making wine.  I racked it from the primary to the carboy 4 days ago.
Comment: Why do you want to stir?
Answer: How much sediment you'll disturb depends on how you stir. Usually you try to get the wine to clear (i.e., get rid of the sediment), as wines (especially white and rosé) are supposed to be clear. Sediment will probably also have a negative effect on the taste (e.g., yeasty).
Stirring won't have an impact on ABV.
Any CO2 the yeast has produced during fermentation probably has already escaped through the airlock.
Answer: Usually, degassing wine is done prior to bottling, often after 2 rackings or more.
The fact that you racked your wine means that you left most of the sediments in the primary, so stirring the secondary won't disturb any sediments, they have not settled yet.  The bad taste and loss of ABV will only occur if your wine gets infected, so make sure that you sanitize your spoon or any other instrument that will touch your wine.
I have seen wine kits that instruct to stir before the first racking (which means that sediments are transferred to the secondary).  However stirring (mixing the sediments) is not the same as degassing (removing CO2).  Later, the sediments are left behind after the second racking.
If your wine kit recommends stirring, follow the procedure but sanitize your equipment carefully.  Personally, I would degas my wine only before bottling, which I normally do after 4 weeks, not before.
Comment: Thanks for answering.  My primary was not from a kit, but from my own muscadines. So my first racking does have some sediment in the bottom.  I will wait until I rack it a couple more times before I degas.  Thanks again.
Comment: Also, the more time you leave it to age in a carboy, the less CO2 will be present at bottling.  When you will be ready to bottle, taste it and if it is too fizzy, then degass, if not, then there is no need to degass.

stirring or degassing wine


Power Brake Booster Removal

Question: Can someone please explain the easiest way to remove a Power Brake Booster from a 1994 Honda Accord Wagon lx.  everything has been dismantled.  the hard part here is the removal only part.  there isn't enough space to pull the booster out and away from the car.  It looks like my air intake manifold is in the way and I may have to remove my AIM to get the job done but I don't want to do that and so in the meantime I'll cut-off the latch bolt from the old booster to see if I can gain some space to move the Booster around and slide it out.  If someone knows an easier way Please let us know.
Answer: It is possible to do this without removing the intake manifold. Move all the hoses, wires and cables out of the way. Move the clutch reservoir and bracket if it has a manual transmission. Pull the booster out and then rotate it clockwise about 90 degrees so that the operating rod is facing the fender. It is a tight squeeze but it can be done.
Comment: Thank you Fred.  I'm going to try again to see if I can jiggle it out and I made up my mind.  If I cannot get it out  then I'll be removing the AIM manifold to save on time.  Been without for a month  I need it now!     There are only about 8 bolts to remove and a gasket to replace.

Power Brake Booster Removal


crontab mutt email fails to be sent

Question: I have a crontab which is supposed to send an email, but it doesn't.
echo " ok backup  " > /home/nuvoshift01/zDB-backup-start.txt
mysqldump --opt --user=q --password=xyz --host=localhost giladparking > /home/nuvoshift01/GPmonthly-DBdump.sql
mutt firstname.lastname@example.com -s "MySQL BackUp" -a /home/nuvoshift01/GPmonthly-DBdump.sql  < /home/nuvoshift01/zDB-backup-start.txt > /home/nuvoshift01/whatHappened.txt
touch /home/nuvoshift01/zDB-bacup-end.txt

(1) the first line does touch the file as coded
(2) the back up file is created
(3) the mutt mail does not send
(4) the 4th line does touch the file as coded
if I issue the mutt command from the command the email IS sent with the attachment
my puzzle/question is: why doesn't the email get sent by the crontab?
Answer: OK, today I provide the solution to my own problem. I determined to send the email with mutt I needed to create a properly configured .muttrc file AND explicitly describe the path in the cron task.
my .muttrc file looks like this :
set from = "firstname.lastname@example.com"
set hostname = hostname.com
set envelope_from = yes

the mutt command needs to look like this:
mutt -F /home/user/.muttrc  -s "SUBJECT"  email@example.com -a /home/user/attachedfile.txt < /home/user/bodyofmessage.txt

It turns out the message will likely end up in the spam folder of the recipient.
A special thank you for Major Hayden at Rack Space for his assistance behind the scenes.

crontab mutt email fails to be sent


WP replace shortcode in custom meta box

Question: I am trying to figure out how to replace FormBuilder's shortcode [formbuilder:#] in a custom Meta Box.  Here is how I am getting the meta data:
<code>$meta = get_post_meta( get_the_ID() );
foreach($meta as $key => $value){
    $post_meta = get_post_meta($post->ID, $key, true);
}
</code>
I tried doing the_content() with no luck.  Any assistance would be greatly appreciated.  Or if anyone knows of any tutorials out there.
Here is the website for the formbuilder plugin:
formbuilder
Answer: Use this tip ;
<code>$t = get_post_meta($post->ID, "CUSTUM_META_KEY", true);
$trep = str_replace('[formbuilder:#]', '' , $t);
echo $trep;
</code>

WP replace shortcode in custom meta box


Why work done Is 0 and why not a negative value?

Question: If a gas expand in vacuum, $P_{ex.} =0$. Then why is the work done 0? Since the gas is expanding, it is doing some work on the piston so the work done must have some negative value.
Comment: How about a balloon bursting with the gas expanding into vacuum? Or opening a valve (you would do some work opening the valve, but the gas would not be involved)? There are many situations where the process described is an "ideal" one that can only be approximated in reality.
Answer: There is no work done on moving a piston against zero external pressure (not if it is ideal, ie lacks mass and there is no friction in its movement). You might consider the definition of $pV$ work
$$w = -\int_{V_\mathrm{ini}}^{V_\mathrm{fin}}p_\mathrm{ext}
\mathrm{d}V$$
Obviously if the external pressure $p_\mathrm{ext}=0$ then $w=0$.
Conceptually, the point is that a collision by a single gas molecule would suffice to drive the piston to its extended position. In addition, that gas molecule would expend no energy, it would not slow down or change course in pushing the piston, it wouldn't feel it at all (this can get complicated, as explained further below). As absurd as that sounds, this is accurate within the constraints imposed by this conceptual question.
The following schematic contrasts the effect of a gas molecule impinging upon an ideal versus a slightly more realistic piston.

In the real case forces during the collision transfer momentum to the piston and reduce or reverse the forward momentum of the gas molecule. In the case of the ideal piston the collision is best modeled as a perfectly inelastic collision between the massless piston and the gas molecule, the resulting united body having the same momentum (in the direction of the piston axis†) as the original momentum of the gas molecule. There are no forces however and therefore no work is done.
† Components of the molecule's momentum along the orthogonal direction are conserved as well, and the molecule must be reflected once it reaches the chamber wall.


What language does the Meta-Crisis Doctor speak?

Question: What language does the Meta-Crisis Doctor speak in the parallel universe, considering he does not have the Tardis around him? How did he learn English?
Comment: The Doctor is a very clever fellow. Just because he has the translation circuit, doesn't mean he doesn't speak English (or a million other languages). After all, he speaks *Baby.*
Comment: It is stated in one episode that the Doctor can speak millions of languages. In fact he is fluent in more than six million forms of communication.
Answer: The Doctor speaks English.
He's spent more than enough time in Britain without a TARDIS that he must be fluent in English. It's not surprising really: he's a 1000-year-old Time Lord who spends an awful lot of time on Earth and in Britain, and a good deal of his competence and awesomeness is based not just on fancy technology such as a universal translator but also on his own knowledge.
See also bitmask's excellent answer to Does The Doctor hear everyone speaking in Gallifreyan?
Plus, the Meta-Crisis Doctor is half-Donna.
The Meta-Crisis Doctor, created along with the Doctor-Donna from a single meta-crisis event, is part human, just as Donna becomes part Time Lord. Donna gains Time Lord knowledge from him, so it stands to reason that he should gain human knowledge from her. Even if we assume that the Doctor wasn't fluent in English (or perhaps that his English had grown rusty after so long relying on the TARDIS and its translator), the Meta-Crisis Doctor almost certainly would be, simply from being half-Donna. We even see him speaking in a more Donna-ish way than the usual Tenth Doctor:

DONNA: Oi, watch it, spaceman.
  NEW DOCTOR: Oi, watch it, Earth girl. Ooo. I sound like you. I sound all, all sort of rough.
  DONNA: Oi!
  NEW DOCTOR: Oi!
  DONNA: Oi!
  NEW DOCTOR: Spanners. Shush. I must have picked up a bit of your voice, that's all. Is it? Did I? No. Oh, you are kidding me. No way. One heart. I've only got one heart. This body has got only one heart.
  DONNA: What, like you're human?
  NEW DOCTOR: Oh, that's disgusting.
  DONNA: Oi!
  NEW DOCTOR: Oi!
-- Series 4 Episode 13, Journey's End
Comment: Strictly speaking, the Third Doctor wasn't without a Tardis - just that it was grounded, i.e. the time rotor wouldn't work, but the translation circuit may still have been working.
Comment: It's worth noting that The Doctor-Donna's accent is noticeably different: it's closer to Donna's. This furthers the idea that his linguistic skills come from Donna.
Comment: @Wallnut Just the nitpick I was about to add.  Of course there are *other* occasions when the Doctor was without his Tardis (e.g. during the events of *Blink*).
Answer: Even if you assume that the Doctor couldn't speak English without the Tardis already, the metacrisis is part human. If the Doctor Donna gained enough of his intellect and knowledge to defeat the Daleks, it stands to reason that he could absorb enough of hers to learn her language. He does adopt a few of Donna's mannerisms.


Title of book with plot about double pregnancies in women

Question: I am trying desperately to remember the title of this book.  I read it sometime between 1995 and 2004.  The protagonist is a female doctor.  She starts researching women who get pregnant, miscarry, and then get pregnant again almost immediately.  The government gets wind of it all and is trying to track down these women.  Oh, and the protagonist is pregnant by the end of the book and is on the run.  It was also available as an audiobook.
Answer: I want to say it's Darwin's Radio by Greg Bear, where humanity is making a leap up the evolutionary ladder. I'd go further but don't want to spoil it for others just in case.
Comment: @ Niall thank's for the link. It's really hard to do a hyperlink on a not-so-smartphone!