Miracles of the Bible versus the Qur'an

Question: A skeptic said it is intellectually dishonest for me to believe in miracles in the Bible but not in the Qur'an. Is it?
What are some Biblical basis for not believing in every miracle, or that every miracle is from God?
Comment: Your mistake is in giving any weight to what a skeptic is telling you about your beliefs.   This person is not interested in your best interests.
Comment: @KorvinStarmast you are definitely right. But ignoring their objections indefinitely doesn't seem like an option either.
Answer: The magicians of Pharaoh performed miracles, copying Moses' works when Moses was sent to Egypt to deliver Israel.

And the magicians of Egypt did so with their enchantments: and Pharaoh's heart was hardened, neither did he hearken unto them; as the LORD had said. Exodus 7:22 [KJV]

Jesus warns that :

Many will say to me in that day, Lord, Lord, have we not prophesied in thy name? and in thy name have cast out devils? and in thy name done many miracles (δυναμεις) ? Matthew 7:22 [KJV]

But he shall say to them :

I never knew you: depart from me, ye that work iniquity. Matthew 7:23 [KJV]

Paul also says :

though I have all faith, so that I could remove mountains, and have not charity, I am nothing. I Corinthians 13:2. [KJV]

It is prophesied in the Apocalypse that in the last days that which is termed the second beast and the false prophet works miracles on earth in order to encourage worship towards an entity other than God :

And he exerciseth all the power of the first beast before him, and causeth the earth and them which dwell therein to worship the first beast, whose deadly wound was healed.And he doeth great wonders, so that he maketh fire come down from heaven on the earth in the sight of men. Revelation 13:12,13 [KJV]

So, not every miracle is of God.
Answer: The simplest answer is that our acceptance of a recorded miracle is contingent on whether we think that record is accurate or not.
As a Christian I personally believe that the Bible is the inspired word of God, and so I accept that the miracles it describes did actually happen. I do not believe the Quran was inspired by God. There is therefore no inconsistency or dishonesty in accepting the miracles of the Bible and not of the Quran, just as I do not have to accept the claimed miracles of other religions, or even the claimed miracles of Christians that are outside the Bible.
Answer: The skeptic's position contains some assumptions:

He assumes that the miracles related in both religious texts are utter fiction.
He quietly slips in the unwarranted premise that nobody believes either book from honest motives.
From these false assumptions he infers that you prefer one set of miracles over the other for reasons having nothing to do with their factual basis (or lack thereof).

Looks to me like this skeptic is the one being intellectually dishonest. The second assumption is particularly egregious.
Answer: Your skeptic friend's opinion is certainly understandable at first glance. It may well be intellectually dishonest to use different criteria to evaluate different miracles. So the question then becomes: is that the case? Are the criteria different? That depends.
First, you have talked about "believing in miracles". This may not be the same as believing in a miracle. In the one case we are asking whether miracles are possible in principle. In the other case we are deciding a particular miracle did or did not happen.
Given that distinction there are a range of logically consistent positions, even when considering only the Biblical miracles. For example, two people might both believe that miracles are possible and yet have a different opinion on the reading of a particular miracle story. Did Joshua command the sun to stand still for a whole day? (see Joshua 10) Some people will read this text as a historical and miraculous event; others will read it as a poetical description, requiring no miraculous element on this occasion. The key here is that the evaluation of a particular miracle story requires us to interpret the story as well as decide on its truthfulness.
Another example is Matthew's account of the saints coming out of the tombs on the day of Jesus' death. In Matthew 27 we read:

When Jesus had cried out again in a loud voice, he gave up his spirit. At that moment the curtain of the temple was torn in two from top to bottom. The earth shook, the rocks split and the tombs broke open. The bodies of many holy people who had died were raised to life. They came out of the tombs after Jesus' resurrection and went into the holy city and appeared to many people. (verses 50-53)

I have read of at least these understandings of the passage:

The account is historical and is true.
The account is intended to be historical but can't seriously be treated as historical. (This, even though the person who said this was happy to accept other gospel miracles as true.)
The account is written in apocalyptic language to interpret Jesus' death as the day of the Lord. It was never intended to be read as a historical event.
The account is a legendary addition to the original text of Matthew's gospel.

I am not arguing for or against any of those views. My point here is rather that all of them are logically consistent with "believing in miracles". It's perfectly possible for any of us to believe in God's ability to perform miracles and yet have reasons why we question particular miracles.
When it comes to considering miraculous stories outside the Bible, the same idea applies. In his book "Miracles" C S Lewis talks about assessing individual miracles based on their sense of fitness, on how consistent they are with the big picture of God at work. And he says that we all recognise some miracles as being more or less plausible:

Whatever men may say no one really thinks that the Christian doctrine of the resurrection is exactly on the same level with some pious tittle-tattle about how Mother Egaree Louise miraculously found her second best thimble by the aid of St. Anthony...Even those who think all stories of miracles absurd think some very much more absurd than others; even those who believe them all (if anyone does) think that some require a specially robust faith.

So to take the example of the OP: suppose I study the Christian story and the Muslim story and conclude that Christianity is most in harmony with God's work of salvation. In that case, to hold a stronger view of the reliability of the miracles in that story would be consistent with my confidence in the overall Christian story. In the same way, to reject particular stories in the Quran because I have rejected the big story of the Quran, that too would be consistent.
But it's equally rational to go the other way. The essence of a miracle is that it is a free action of a God who is at liberty to do in a particular setting whatever he chooses. Suppose a Muslim woman prays to Allah for the healing of her sick son, and God in his mercy chooses to answer that prayer. Which of us can say that the sovereign God is out of order in this case? I don't have the detailed knowledge to accurately assess miracle stories in the Quran. But if any of them turned out to be factual miracle stories, that would not put a dent in my Christian world view. It would simply illustrate that God is good, God is merciful, and God is free to act in any way he chooses for the well being of his creation.
Answer: Before giving an answer directly two things of note:

It is intellectually dishonest of a die-hard skeptic to pretend that his/her reasons for rejecting Christ and the Bible are intellectual reasons.  The real reason is the love of sin, an unwillingness to give it up, and a proud hatred of being reproved.

This is the condemnation, that light is come into the world, and men loved darkness rather than light because their deeds were evil.  For everyone that does evil hates the light, neither comes to the light lest his deeds should be reproved.  John 3:19,20.

As regards the Qu'ran, which miracles is the skeptic talking about?  Has he read the Qu'ran?  I have read it and I don't remember any miracles attributed to Muhammed or his followers.  I think he doesn't know what he is talking about.  The only miracles referred to in the Qu'ran that I remember are those accounts which draw passages out of either the Bible or the Gnostic writings.  All the miracles in the Qu'ran relate to the actual life (Bible), or supposed life (Gnostic writings) of Jesus.  The skeptics criticism really boils down to "Why do Christians accept the Gospels in the Bible and reject the Gnostic writings about Jesus, such as the Gospel of Thomas?"  Anyone who compares the Gospels in the Bible with the Gnostic "gospels" should be able to see why the Gnostic writings were rejected.
Attack is the best form of defence; so the first response to the such an accusation is to go on the attack and ask the skeptic:  "Do you mind being honest with me and yourself?  Give me a true answer: if I could prove to you that the Bible is the fully inspired and true word of the living God would you be willing to give up your current lifestyle and follow the Lord Jesus Christ?"  If they duck the question with evasive answers then tell them plainly that therein lies their problem, they are not willing to give up sin. Their intellectual smokescreen is just a ploy.

Direct Answers to the question

The Bible claims to be the only word of God.  If we believe the Bible then it would be intellectually inconsistent to also believe the Qur'an.  It would also be intellectually dishonest to pretend to believe both. You cannot believe the Bible to be God's only book and then also believe another book to be inspired.  The Bible will not let anyone do that.  (Revelation 22:18,19).
The Bible and the Qur'an completely disagree on fundamentals. They cannot both be from God.  Miracles are given to authenticate a book i.e. to show it is from God.  Why would God allow true authentcating miracles in a book which is not from Him?

The Bible and the Qu'ran differ: on the death of Christ - Bible- he died on the cross for our sins; Qur'an- someone who looked like Jesus died on the cross, Jesus went straight to heaven without dying (surah 4:157).
The way of salvation B- by grace through faith in Christ as a free gift of God's grace, we cannot earn or deserve mercy, else it isn't mercy; Q- salvation is through our own works. We get what we deserve.
B- Christ took the punishment for our sins, Q- no one else can take your punishment, we must all receive justice from God.
B- love is the greatest commandment, Q- jihad, holy war against those who do not believe in Mohammed, is the greatest commandment (according to the most traditional interpretation of the Qur'an, whereby Surah 9 is the last, and so the most authoritative of the surahs, and according to the Hadith) and "Let those who would exchange their life in this world for the hereafter fight for the cause of Allah; whether they die or conquer we shall richly reward them." (surah 4:74);
B- Jesus is the Son of God, God made flesh; Q- God has no son, Jesus was just a prophet.
B- We can be saved even if we have done the most terrible sins, if afterwards we truly repent and believe;  Q- Only smaller sins can be forgiven (Surah 53:32).
B- Divorce is a very serious matter,  Q- Even Mohammed himself persuaded a divorce so he could marry the divorced woman;
B-love your wives as Christ loved the church and gave himself for her, Q- Disobedient wives are to be beaten "Send them to their beds apart and beat them" (Surah 4:34).
These are just some examples to show the two books are very different, and it cannot be the same God inspiring both books.  Seeing as there is only one God, then God cannot be inspiring both of them, and God would not put true miracles in a book which is not from Him.

Even if there were lots of miracles in the Qur'an we still would not be dishonest to doubt them.  What is needed first and foremost of a book from God is that its moral standards be very high, and its leader (Christ, Mohammed, etc) have an exemplary life.  Christ's life was without sin, Mohammed's life was not exemplary.  The moral standards of the Bible are exemplary, the moral standards of the Qur'an are not.  It is this combination of very high moral standards and authenticating miracles which together combine to make the Bible believable.  The good standards of the people show they are not liars, but honest, true, good, loving, with the best interests of the reader at heart; the miracles show the book and its authors are of God.

An important question of any religion and any religious book is what is the motivation of those who promote it/ preach it?  Who does it benefit? and in particular Does it benefit only its own leaders?  All false religions promise great freedom to all who follow but mostly only benefit the leaders, it gives them control, power over other people's lives, and money from the followers.
But what did Christ gain for his efforts? Crucifixion.  What do his followers often gain for their efforts?  Rejection, persecution, and sometimes death at the hands of opposers.   The benefits of following Christ are not of this world. The benefits are not so obvious to onlookers, because the benefits are unseen things like a relationship with God, a clear conscience, freedom from guilt, answers to prayer, and an eternity in heaven.  The leaders of the Christian community are called to be the servants of all, figuratively to wash the feet of all (John 13:13).
True religion pursues heavenly things, and false religions pursue earthly things - power, influence and wealth.
For further reading on the Gnostic writings and why they were rejected by the early church see "Why 27?" by Brian Edwards (Its about Why are there (only) 27 books in the New Testament).
Answer: It is possible (though maybe unlikely) he was primarily refer to the "duplicated" miracles, the ones that occur in both the Quran and the Bible, as the Quran many stories from the Bible (and also many from apocraphyl texts, such as the Arabic Infancy Gospel). Examples would be the virgin birth and the red sea and others. So you could say that you believe the ones that the Quran also affirms, as the Quran agrees that Jesus could work miracles (and that Muhammad can't/wouldn't).
That does not mean, however, that we should believe the miracle of the Quran itself, or Jesus breathing into clay birds or speaking as a baby. These last 2 come from the rejected Infancy Gospel of Thomas that Muhammad would have known by the Arabic infancy Gospel.
So asking him what he means by that and which miracles he is referring to would be good. If there is good evidence for the truth of the Quran or of its recorded miracles, then perhaps they can be conceded. The resurrection, on the other hand, is by far the best explanation of the data.
As the others have said, if you believe miracles that have multiple, early, independent attestation of eyewitness testimony, that is different than believing a miracle just because its a miracle.

Miracles of the Bible versus the Qur'an


Good idea to reveal server error logs to strangers for help diagnosing?

Question: I have a WordPress website that's being served, but with a 500 status code. I want help diagnosing the problem behind the error, but don't know what information in the logs I should keep under wraps when I ask for help on Stack Overflow, etc.
Comment: Mask out any IP addresses as well. But if you are diagnosing a 500 error then it should be obvious from the timestamp, which (if any) rows in the log are relevant.
Comment: The web server access logs will not help. But check the error log. There may be a clue in there for you. As well, It does not hurt to paste an example of the error in your question, however, you may want to replace the domain name with example.com.
Comment: Check the .htaccess file.  There is something in a wordpress plugin that edits .htaccess and makes a mess of it.  Have seen it on multiple sites.
Answer:
I have a WordPress website that's being served, but with a 500 status code.

First, start on a clean slate. If this site is live to the public, replace the main index page with a page that shows users the website is under construction. Make a backup of the old index page first. This may be index.php since you're using wordpress. If it isn't then look for index.html or index.htm or any file beginning with index.
Next, deactivate all .htaccess files on the entire server by renaming or removing them. Ask your serice provider for assistance if you don't have access to the entire server. Also, have the provider check the apache configuration file (httpd.conf) to make sure all entries in it are valid and accurate and that all modules required are installed and functioning correctly.
Then test the index page with the .htaccess files removed, and if the out of order page shows up, then replace the .htaccess files, and test the index page again and literally reload the page to see if the out of order page shows up again. If it does, then reinstall wordpress because the problem lies within wordpress core files directly or the entries in .htaccess that are related to wordpress.
I will guess right now that your .htaccess file(s) have been hacked.


Displayed | ActivityTaskManager not showing specific Activity in logcat

Question: I have 3 activities. ActivityA, ActivityB & ActivityC.
From ActivityA button click I am opening ActivityB. On ActivityB onCreate ActivityC is opening.
When I type Displayed in Logcat ideally ActivityA, ActivityB & ActivityC all should show on clicking button on ActivityA. However ActivityA & ActivityC is only getting displayed. Any reasons for this?
2022-05-18 18:02:01.347 2044-2153/? I/ActivityTaskManager: Displayed com.libs.a6maytestapp/.activities.ActivityA: +454ms
2022-05-18 18:02:03.296 2044-2153/? I/ActivityTaskManager: Displayed com.libs.a6maytestapp/.activities.ActivityC: +150ms

Comment: Same question, need some help.
Answer: From the documentation since Activity B called Activity C in onCreate the output should be in the form
2022-05-18 18:02:03.296 2044-2153/? I/ActivityTaskManager: Displayed com.libs.a6maytestapp/.activities.ActivityC: +150ms (total +643ms)

where the extra total would be the sum of Activity B + Activity C. But in your case I would guess that's summed up in the reading of Activity C itself.


Recreating assets after onResume()

Question: After onPause is called for the GLSurfaceView the rendering surface is destroyed, along with all the textures, shaders and the like.  On onResume() should the surface not be recreated and GLRenderer onSurfaceCreated called? However that is never called. I am using render when dirty.
Comment: Are you calling `GLSurfaceView.onResume()` from the application's `onResume()`?
Comment: Yes, I am calling onResume() and onPause()
Answer: If you use this modified version of GLSurfaceView your rendering surface will not be destroyed:
http://replicaisland.googlecode.com/svn/trunk/src/com/replica/replicaisland/GLSurfaceView.java
As far as graphical context (OpengGL ES context) is concerned there is a myth surrounding this issue, that it's destroyed when onPause is called. No that is quite not true. Your context stays alive as long as there is still memory left for other contexts to be called upon.
For example if you have 3 games each requiring around 100 MB of RAM, they can all run at once on a Samsung Galaxy S2, which has around 800+ MB, depending on the manufacturing model. However on low memory devices you should implement a texture + shader load/unload method.
Answer: I believe this is something the android framework does, as some devices / GPU's can't support multiple GL states and clearing any onPause() allows other apps to use openGL.
I just accept that and reload textures etc onResume(). If you keep your textures as bitmaps in memory as well as all your vertices etc, you should be able to minimise the amount of time it takes to reload after resumption.
Then again, I don't extend GLSurfaceView and do all my rendering in GLSurfaceView.Renderer
EDIT: Actually, check the answers for this question

Recreating assets after onResume()


Was Surya's son Karna with his Kavachakundala as strong as Krishna and Arjuna taken together?

Question: Was Surya so powerful in the Mahabharata even Nara (Arjuna) and Narayana (Krishna) together could not defeat his son when he had all his power?
Comment: Why do u doubt even if Lord Krishna himself says so... :)
Comment: so the answer is one word - "yes"? :-) @yds
Comment: Actually this looks self answered to me..u should move quote to answer.. that's it...
Answer: No. Karna was never any match to Krishna and Arjuna. Arjuna had forced karna to retreat in battle after the Draupadi Swayamvara. Karna was defeated by Gandharvas in gosha yatra parva. Arjun then killed a million Gandharvas and defeated their leader Chitrasena.
Comment: This is the correct answer here! Karna lost to Drupada as well when Duryodana tried give guru dakshina. Karna was great warrior but not a match to Arjuna and never a match to Krishna, the creator!
Answer: Yes, the answer coming from Krishna himself.:
Krishna says to Arjuna in the Critical Edition.:

It is through good fortune that his armour has gone. It is through good fortune that his earrings have been robbed. It is through good fortune that the invincible spear has been used up on Ghatotkacha. Had he possessed the armour and had he possessed the earrings, the powerful Karna would have been able to defeat everyone in the three worlds, even the immortals. Vasava, Kubera, Varuna, lord of the waters, and Yama would not have ventured against Karna in an encounter. Had that bull among men possessed those, you with your Gandiva and I with my sudarshana chakra would not have had the capacity to defeat him in a battle.
Answer: Best explore Drona Parva and Karna Parva of Mahabharatam to solve all confusion. This is from Karna Parva.:

"Thus did that illustrious Deity (Mahadeva), that Creator of the
worlds, that Lord of both the Gods and the Asuras, (viz Maheswara),
did that which was for the good of all the worlds. As the illustrious
Brahmā, the Creator of the worlds, the Grandsire, the Supreme Deity
of unfading glory, acted as the driver of Rudra (during the destruction of the Tri-Purasuras), so do thou restrain
the steeds of the high-souled son of Radha like Grandsire restraining
those of Rudra. There is not the slightest doubt, O tiger among kings,
that thou art superior to Krishna, to Karna, and to Phalguna. In
battle, Karna is like Rudra, and thou art like Brahmā in the policy.
United, ye two, therefore, are competent to vanquish my foes that are
even like the Asuras. Let, O Salya, that be done speedily today by
which this Karna, grinding the Pandava troops, may be able to slay
Kunti's son owning white steeds and having Krishna for the driver of
his car. Upon thee depend Karna, ourselves, our kingdom, and (our)
victory in battle. Hold the reins, therefore, of the excellent steeds
(of Karna)" ~ Mahabharatam Karna Parva 34.

Karna was a student of Parashurama. Drona was also a student of Parashurama. Karna directly learned from Parashurama. Whereas, Arjuna learned from Drona. Even Ahsvathama is also like Rudra. But Since Sri Krishna the Divine was next to Arjuna, he was saved.
Comment: U r welcome. N yes, I know that Kmg has translated Lord Brahmā as Brahman but it might confuse some new readers n they might get confuse so i have edited it and also added the Tripura Dahan episode in braçket for further clarity. Hope you don't mind. If u want you can change it back. I won't mind as it's your answer only.
Comment: I have already voted this answer up yesterday only. N don't worry other up votes will also çome. ..
Comment: Thank you Savdy ji. The content was from the book directly as is.
Comment: Thank you Savdy Ji. Makes valid sense. May be a vote to this answer might help.


Can I use an ANOVA to compare groups in which each data group was calculated from a linear regression?

Question: As a result of some previous experiments at 5 different temperatures, I have 5 simple linear regression slopes describing the effect of body mass (independent variable) on water loss rates (dependent variable) of frogs. For a new set of experiments at that the same 5 temperatures, I used the predicted values from slopes to predict the expected values (water loss rates) that new individuals (frogs)exposed at that 5 temperatures would experience based on their body masses. Can I performed an ANOVA to asses the difference between those new 5 frog groups even when their different individual values within each group were calculated from regression slopes?
Answer: I would suggest including temperature as either a continuous or categorical variable in 1 regression model rather than splitting different temperatures into 5 regression models and then running an ANOVA.
My intuition tells me you should treat temperature as a continuous variable that you exercised experimental control over. However, if you have a very good reason for treating it as a categorical variable, I have linked the Wikipedia page for using "dummy variables" in regression.
https://en.wikipedia.org/wiki/Dummy_variable_(statistics)
If you read up on dummy variables, you may notice that an ANOVA is a regression model in and of itself. Your specific ANOVA is modeled like this:
If we treat each category of temperature as a dummy variable, so that we refer to temperature group

1 as X1
2 as X2
3 as X3
4 as X4
5 as our base value

then y (our independent variable) is predicted by:
$$
y = \beta_0 + \beta_1X_1 + \beta_2X_2 + \beta_3X_3 + \beta_4X_4
$$
Where all x values are either equal to 1 or 0. So if we had tempurature group 1, we would equate it as
$$
y = \beta_0 + \beta_1X_1 + \beta_20 + \beta_30 + \beta_40
$$
which simplifies to
$$
y = \beta_0 +  \beta_1
$$
if we had temperature group 4 then:
$$
y = \beta_0 + \beta_10 + \beta_20 + \beta_30 + \beta_41
$$
which simplifies to
$$
y = \beta_0 + \beta_4
$$
Because temperature group 5 is our base value, all Xs = 0 and our model simplifies to this when we want to examine group 5:
$$
y = \beta_0
$$
If you compute this model and you are interested in whether or not your groups are statistically different from each other, you can build a confidence interval around your regression coefficients and look for overlap. If you are interested more so in prediction, you can use your standard methods for calculating prediction intervals and see if differing groups are useful in your predictions.


Add podcast-like chapters to audiobooks

Question: I have a number of audiobooks that are very long (10 or more CDs).  I don't like having them all in separate files because when you leave and come back, you're scrolling through hundreds of files to find the one you were on.  Instead, I used an audio editor to combine them in to 3-5 hour files.  However, if you are scrubbing through the file and accidentally slip (lift your finger, etc), you've now lost your place in such a large file.  I have seen in some podcasts that have chapters, allowing you to use |<< and >>| to skip around, and keeping the scrubbing to within the chapter.  Can these be applied to audiobooks?  If not, can I tell iTunes that my book is a podcast and set them there?  I tried that once but couldn't see how to set chapter markers anywhere.
Answer: You can do it with Garageband on a Mac, or using a separate utility on Windows.
Mac with Garageband
There's a detailed guide here, but the concise version is:

Create a new Podcast in Garageband.
Delete the placeholder tracks (the Podcast track can't be deleted), then drag in the audio file you want to add chapters to.
Select the Podcast track, make sure the editor is open (⌘E).
Move the playhead to the position you want a chapter at, and click Add Marker. Repeat for each chapter position you want. You can add titles if desired.
Export to disk or iTunes via the Share menu.

If you want the files to appear as audiobooks in iTunes, you may need to select them (in iTunes), and change the Media Kind (Get Info/⌘I, Options tab) to Audiobook.
Windows using Chapter and Verse

Download the free Chapter and Verse program. There are probably others out there, but this one seems to do the trick fairly simply and is free.
Click Add Files to import your audio track. If it's not in AAC format, it will prompt you to convert it.
Go to the Chapters tab and add your chapters as necessary.
Click the Build button to save the file, then import it to iTunes as desired.
Comment: Guess I should have specified "within iTunes" in my question, especially since I don't have a Mac.  Related to your answer, though, does it **have** to be a podcast in order to get chapters?
Comment: Ah, didn't realize that it was iTunes for Windows. You can do this with a free utility on Windows, but iTunes itself doesn't have that capability. There's nothing special about a podcast per se, chapter support is a feature of the mp4/m4a container used - any AAC audio in an m4a file should work. I'll update my answer to include details about the Windows utility.
Answer: You can do that with Audiobook Binder. It's an open source app, and also available for free on the Mac App Store.

Add podcast-like chapters to audiobooks


MongoDB - sharding an collection with data already in it

Question: I'm using Mongo (shell version 2.6.12) in a clustered configuration.  Right now I have a few collections sharded, and was looking to shard another collection.  This collection already has data in it.  Once I run the command to shard the collection and give it it's key, will the cluster take the existing data and spread it across the multiple systems in my cluster, or will the existing data stay put on one server and any new data will then be spread across the other systems?
Answer: When you shard an existing collection, MongoDB will split the values of the shard key into chunk ranges based on data size and start rebalancing across shards based on the chunk distribution. Rebalancing a large collection can be very resource intensive so you should consider the timing and impact on your production deployment.
In MongoDB 2.6 (which reached end of life in October, 2016) the balancer will only perform one chunk migration at a time. In MongoDB 3.4 or newer the balancer can perform parallel chunk migrations with the restriction that each shard can participate in at most one migration at a time. As at MongoDB 3.6, that means that a sharded cluster with n shards can perform at most n/2 (rounded down) simultaneous chunk migrations.
A faster approach to sharding a large existing collection would be to pre-split chunks in an empty collection based on the current data distribution for your shard key, and to then dump & restore your existing data into this new sharded collection. The pre-split approach minimizes rebalancing activities by creating appropriate chunk ranges so data is distributed on insert.
There have been significant performance improvements since MongoDB 2.6, so I would strongly recommend upgrading to a supported version of MongoDB (ideally MongoDB 3.4 or newer).
Comment: Thanks Stennie for the response!  I'll look into the dump & restore as you noted.  Right now we're "married" to 2.6 due to the application that is written on top of Mongo.  I'm hoping the vendor will be updating their code so we can upgrade to a newer version of Mongo.


How to reload a crashed process on Windows

Question: How to reload a crashed process on Windows? Of course, I can run a custom monitoring Win service process. But, for example, Firefox: it doesn't seem to install such a thing, but still it can restart itself when it crashes.
Comment: How is it not programming related exactly?
Comment: @Mitch: Yes, I also would like to get some clarification on this.
Answer: On Vista and above, you can use the RegisterApplicationRestart API to automatically restart when it crashes or hangs.
Before Vista, you need to have a top level exception filter which will do the restart, but be aware that running code inside of a compromised process isn't entirely secure or reliable.
Answer: Firefox constantly saves its state to the hard disk, every time you open a tab or click a link, or perform some other action. It also saves a flag saying it shut down safely.
On startup, it reads this all back, and is able to "restore" based on that info.
Answer:
Structured exception handling (SEH) allows you to catch program crashes and to do something when it happens.
See: __try and __except
SEH can be very dangerous though and could lead to your program hanging instead.  Please see this article for more information.
If you write your program as an NT service then you can set the first, second and subsequent failure actions to "Restart the service".
For Windows 2008 server and Windows Vista and Windows 7 you can use the Win32 API RegisterApplicationRestart

Please see my answer here for more information about dealing with different types of program crashes.
Answer: If I recall correctly Windows implements at least some subset of POSIX and so "must" have the signal interface (things like SIGKILL, SIGSEGV, SIGQUIT etc.).
I've never done this but on linux, but you could try setting the unexpected termination trap with signal() (signal.h).
From quick scan of docs it seems that very few things can be done while handling signal, it may be possible that even starting a new process is on forbidden list.
Now that I've thought about it, I'd probably go with master/worker pattern, very simple parent thread that does nothing but spawns the worker (that does all the UI / other things). If it does not set a specific "I'm gonna die now" bit but still dies (parent process always gets message / notification that spawned process died) then master respawns the worker. The main theme is keep master very simple and hard to die due to own bugs.


Minecraft launcher not logging in on windows PC and not updating on a mac

Question: I own a macbook, a mac and a windows PC. I generally use my MacBook for gaming (weird, I know) but I recently met some restrictions forcing me to use a different device for gaming. I had used the windows PC before for minecraft, but I got logged out some time ago and I can't get back in (via the minecraft launcher). It used to say it could not connect but now it just says it is an incorrect username/email and/or password. I have checked my minecraft password on the website (minecraft.net) and it works just fine on there but I just can't get in on the launcher. I also cannot access minecraft on my mac because "the launcher is unable to update". The circumstances basically are that I can't play minecraft at all at the moment so I would appreciate help.
Comment: Welcome to arqade. I'm afraid the community here won't be able to help with this specific issue; you're best off contacting Mojang support on this one.
Answer: This is what you should try:

Make sure you are using a legitimate copy of Minecraft.  People can run into problems like these if they are trying to use an unauthorized or cracked copy of Minecraft.
Restart your Minecraft.  Sometimes if Minecraft is left open for long periods of time it can self-log itself off and require you to re-type your username and password to get back on.  However, it doesn't always let you  (This may be a bug, I have had this happen to me).  Just restart your Minecraft and it may let you log in.
Wait.  Sometime Minecraft servers can be having trouble and you just need to wait them out.
Try restarting your computer.  I'm unsure of the reason for this, but one time I was about to contact Mojang because my info was no longer working, I restarted my PC and all was well.
Lastly, try to uninstall and re-install Minecraft.  This is the last resort and solves many related problems involved with Minecraft.

If all of these fail then you should try contacting Mojang.  You can also visit https://help.mojang.com/ were you might find specific troubleshooting help.
Answer: If you know the password to log in but it says it's incorrect, it's because the account could be hacked.
Answer: Like Jason_ said, try to uninstall and reinstall Minecraft, but make a copy and move it to a USB before you uninstall it. Remove the USB and uninstall. Then add the USB into the port. Finally, remove the one from the USB and try again.


What method/classifier should I use for a training set with lots of attributes but few examples

Question: Each training example has 100 numeric attributes plus one output class and about 80% of the attributes are 'zero' (means no data collected). The value of attributes varies in a small range, like $(-20,20)$. I have 100 examples like this. What method/classifier should I use? I tried KNN, Naive Bayes, SVM, random forest/tree, none of these methods give me accuracy above 50% (I used 10-fold cross validation). What should I do?
Comment: Did you tune the parameters on the SVM? How many trees are you using in your forest? Please add more details regarding the implementation of the algorithms.
Comment: I tried 100 trees,got 44% accuracy,10 trees, got 33% and 200 trees got 40%. For SVM what specific parameter are you looking for?
Answer: This is the well known large $p$ small $n$ problem, often named as $p \gg n$, common in biological, biomedical and imaging problems, basically any field where either data is scarce/expensive to come by or simply carries too much information.
There are several techniques often used in this scenario, such as regularization and attribute bagging. Implicitly, you already tested both, respectively on SVMs and Random Forests. You can try to improve upon that, though. Try other regularization penalties, such as elastic net, try using it fused with attribute bagging.
Another possibility is that your data simply doesn't explain your outcomes.


Security considerations in storage of audit logs

Question: How can I securely store audit logs of activity from a system such as together with source data or separately off site?
Comment: It looks like you are trying to gather a large list of various reasons. That is not a great fit for a Q&A site. The general idea here is that it is possible to have a single acceptable answer to a question. Can you narrow your question down a bit?
Comment: What do you mean by "source data"? Do you mean, for instance, keeping logs of a system not on the system? When you say "not co-located", do you mean the audit logs should not exist with the "source data" but only remotely? Or is keeping a copy locally an option?
Answer: As an IT auditor, let me give you an answer from experience.
Segregation of duties - SOD
It is a good practice and core principle to segregate employees who operate or administer the system from which audit logs are produced from employees such as myself, with responsibilities to review these logs for fraud / malicious activity / security vulnerabilities. If these duties are not segregated, then a single individual can undermine the system by making a malicious change, and cover his wrongdoing by modifying the audit logs to hide his actions. To illustrate, the following individuals in general should not have access to log data.

Security administrators
Computer operations personnel
Data base administrators

To expand on the above examples, if a security administrator has access to logs data, he can escalate his own privileges to allow for improper access greater than is appropriate for his job duties, a violation of the security principle of Least Privilege. To prevent or deter detection, he can delete and / or falsify values for log entries of date, user ID...etc. The same reasoning applies to items 2 and 3.
To prevent the aforementioned, logs can be centrally stored in a server in which access is strictly controlled to individuals with specific roles - RBAC. Periodic review of individuals having access to logs should be conducted and improper access rights should be removed immediately upon discovery.
Secure storage of logs
Log data should be backed up on a regular basis and the backup should be stored offsite away from main company operations. This is to ensure that if a disaster (ex: Fire or flood) were to occur at the main company site, data loss will be mitigated.If logs contain sensitive information, log backups should be encrypted using strong cryptography such as AES 256. A written method, such as receipts should be used to track shipping and receipt of these logs. Periodically, a reconciliation of backup media should be taken against the tracking documentation, with any failed reconciliations promptly investigated.
Monitoring procedures regarding security and confidentiality of backup storage should be documented. If these responsibilities are delegated to a third party to perform, SLAs and a contract should ideally be in place, explicitly specifying the duties of each party (Company and vendor), and ideally include a right to audit clause in the contract. Log retention length of time should be documented in a retention policy known to all individuals with a job role of handling backups.
Finally, to learn more, this is an authoritative source from ISACA.


Garbage Truck Fleet Route Optimization Using PGRouting?

Question: I am trying to create an optimized route plan for a townships garbage truck fleet for garbage pickup. I have tried using ESRI's Network Analyst within ArcMap but have found the analysis to be to complex and the results returned are not as desired. There are approximately 2000 stops within each zone within the township with 3 trucks per zone.
Recently I have come across the PGRouting SQL extension and would like to know if this type of project would be to complex for PGRouting to run? Can PGRouting handle the large volume of pickups?
Comment: why was ESRI network analyst not desired? Have you tried changing your config settings for the extension?
Comment: The routes achieved through network analyst were pretty wonky and that was with a test neighborhood with approximately 300 pickup points. From the documents I have read of similar projects and comments I have received about the project, it seems as thought network analyst cannot handle that many pickups. I'd love to be wrong though. Which config settings are you referring to?
Answer:
found the analysis to be to complex

You are talking about an optimization problem that is an NP-hard problem. They are complex problems including TSP

and the results returned are not as desired.

Normally what you get as "solutions" on NP-hard problems algorithms are approximations. Some can be "close to reality" and some might look "far from reality", in your case maybe by visual inspection it came out to be far from reality.
Visual inspection, does not necessarily give you a correct result, because, there are constraints that might not be included on the problem definition and those can add more complexity to the problem, and even if the "routes" looks fine if those are not taken into consideration then those additional constraints will make the solution invalid.
Maybe the constraints are well defined, but not taken into consideration on the algorithm, because it would make it a specialized algorithm.

City A - trucks pick container on the left side
City B - employees pick & take the garbage bags to the truck.

So, if an algorithm exists for problem for City B, it would not look as a solution for city A
Suppose the route looks ok for city B...  So the algorithm is used for city A, but when the solution says "pick container", it happens that some of them are being picked at the right side of the truck which makes the solution invalid on City A.
Does it matter if the trucks can pick from the right side, from the left side?, or does not matter, because people pick up the bags and put them in the truck? The trucks fleet contains a mixture, some pick up from the left, some from the right some don't care?
Can the truck do U turns?, Speed limits are an issue?, are the trucks of equal capacity? can they make multiple trips to the dump? are the schedules of the drivers taken into consideration? are times used to fuel gas also taken into consideration?
You might like to see this presentation:
http://talks.vicky.georepublic.info/2016/garbageCollection.html
Answer: PG_Routing's TSP needs distance matrix as one of inputs... Since counting this matrix (only) will take about 23 days (assuming 2000 starting points, 2000 destinations and performance of 2 distances per second) I don't think anyone tested it with more than 100 points...
IMO of course - correct me if I'm wrong


If I link my PayPal account to bank account does my bank know the balance of PayPal account or transactions?

Question: I know how to transfer and setup of bank account to PayPal. My concern is if my bank is connected to PayPal, and how will bank know the transactions and PayPal balance?
Answer: Both financial institutions have you as a customer. They care about protecting your assets, and being able to provide financial services in a timely, efficient, and secure manner.
To transfer funds from one institution to another, they need to know that the transaction is authorized, the amount of the transaction, and some method of knowing the transaction was completed. They also keep records regarding that transaction. These records contain time/date, routing numbers, account numbers, amount and the confirmation code.
The two institutions have no reason to expose more of their valuable data to another financial institution beyond the minimum amount to complete the transaction.

My concern is if my bank is connected to PayPal, and how will bank
know the transactions and PayPal balance?

PayPal doesn't want to give a list of transactions to your bank. That exposes more data than necessary to complete the transaction. They don't make a habit of telling another financial institution your account balance. That would expose data that isn't necessary.
If you have recently linked two accounts together they typically ask you to verify a pair of micro transfers. One place sends two small amount of money, then reverses those same transactions a short time later. You are given time to see the transactions and report the amount of each transaction. If you get the numbers right they know you have the ability to see the transactions in the other account.  Notice they didn't just download the balance and ask you to confirm the balance.
Answer: The bank will know that PayPal withdrew or deposited money in your account at the bank.
But the bank will not have any visibility into your PayPal account itself.
Comment: While this answer matches my own understanding of how it works, I think it would be better with references / cites to demonstrate this. I didn't answer myself because I don't know how to prove it.
Comment: I cannot cite anything to prove this either.  It's just how these things work.


Macbook Pro Retina 13,3" tingling/buzzing sensation

Question: Okay, so YESTERDAY i bought my (super very wow expensive) Macbook Pro Retina 13,3". Huge investment for me.
Yesterday night i tried charging i for the first time, and it started tingling against the palms of my hands whenever i like moved it across the under-keyboard area. I've read a lot about it, and i've read that it's normal, and that i have to use a three plug charger - the problem is that in Denmark we dont use three plug chargers, so i really dont know what to do! I just can't believe that i've saved so many money for so long, and that I experience problems after less than 12 hours.. ugh.
Hope you can help me.
Comment: Haha i just asked my mom and it's not that common, we normally just use two plugs, but i guess i could be like a transformer.
Answer: In Denmark you have 2 types of wall plug.
Both have ground connection.
The left one is standard European type and it has two ground connection showing as springs. Your Apple plug should just fit in that one.
I am assuming the socket it is actually connected to the ground in your place.
Comment: Yes, and it's when i use the left one it happens. But my plug isn't round its flat like normal chargers in Europe. But i got an extension cord with the normal charger, which ends as a three plug thing - so i'll try that out! The weirdest part is that i'm using my old white MacBook right now, which doesn't give me that same tingling sensation - only when i touch the round part going into the computer. Maybe it could have something to do with the aluminum ''shell''?
Comment: are you standing or sitting on a tile floor or wooden floor? If you try not to touch any ground surfaces around you then there should be no tingling.


JSF 2.0 sample or open source application

Question: Does anyone know a complete JSF 2.0 sample or open source application using JSF 2.0 features (Facelets, Composite Component, Templates, Ajax, Navigation, etc.). Would be a good reference to learn some best practices. I'm talking about an application that you would also use in production. The only ones I know are ScrumToys and PetCatalog which are delivered with NetBeans 6.9 and are "tutorial-like" applications.
Answer: Yes there are few open source projects beeing hosted in Kenai. You can find here some JSF applications.


What is $\gcd(0,0)$?

Question: What is the greatest common divisor of $0$ and $0$?
On the one hand, Wolfram Alpha says that it is $0$;
on the other hand, it also claims that $100$ divides $0$,
so $100$ should be a greater common divisor of $0$ and $0$ than $0$.
Comment: It is typically not defined.
Comment: A fancy expression: $\gcd(a, b) = \operatorname{char} \mathbb{Z}/(a, b)$.
Comment: $\gcd(0,0) = 0\ $ by $\, d\mid 0,0\iff d\mid 0,\,$ see the [GCD Universal Property](https://math.stackexchange.com/a/3356212/242) $\ \ $
Comment: Relevant: http://en.wikipedia.org/wiki/Partially_ordered_set
Answer: The word "greatest" in "Greatest Common Divisor" does not refer to being largest in the usual ordering of the natural numbers, but to being largest in the partial order of divisibility on the natural numbers, where we consider $a$ to be larger than $b$ only when $b$ divides evenly into $a$. Most of the time, these two orderings agree whenever the second is defined. However, while, under the usual order, $0$ is the smallest natural number, under the divisibility order, $0$ is the greatest natural number, because every number divides $0$.
Therefore, since every natural number is a common divisor of $0$ and $0$, and $0$ is the greatest (in divisibility) of the natural numbers, $\gcd(0,0)=0$.
Comment: Thanks, great answer! How did you figure this out? Where do mathematicians store such commonly agreed on, but not completely obvious definitions? When did people start defining gcd this way, I assume they didn't when Euclidean algorithm was invented 300BC?
Comment: Similarly $\gcd(0,n)=n$ for all $n\in\Bbb N$ (including $n=0$).
Comment: For the most part, the partial order of divisibility coincides with the usual ordering wherever it is defined.  So if $\le$ represents the usual ordering and $\vert$ represents the partial order of divisibility, then $x\vert y\Rightarrow x\le y$, except if $y=0$.  Moreover, if $x$ is a common divisor of two non-zero natural numbers $a$ and $b$, then $x\le\gcd(a,b)\Rightarrow x\vert\gcd(a,b)$.  So in most cases, you can define $\gcd(a,b)$ to be the greatest common divisor of $a$ and $b$, where 'greatest' refers to the usual ordering.  That's what Euler did (and left $\gcd(0,0)$ undefined).
Comment: Euclid, I mean....
Comment: @KonstantinWeitz I wish such an Official Book of All Mathematical Definitions existed. It would end every dispute, because one could simply refer to that book and consult the definition and case closed. But guess what: I asked many mathematicians and none could point out any such book :P I'm starting to believe that they're all making things up :P They seem to be able to pull any definition they please up their butt and claim that "because Mathematics says so, so shut up and calculate" ;q  Once I was looking for a definition of an angle, and I found over 9 of them, all of them different :P
Comment: Suppose it is true that every natural number is a divisor of zero. If we include 0 as natural number, this must mean that 0 is a divisor of 0. But if something is a divisor of something else, doesn't it mean that one can divide one by another? In conclusion, 0/0 should be possible. Right? :q
Comment: Does this work for the case where negative number allowed?
Comment: @IsaacSaffold It is!  $a|b$ means there exists a $k$ such that $b=ak$.  So $0|0$ because, for instance $0=7 \cdot 0$.
Comment: Including $0$ in the partial order of divisibility implies that $0$ divides $0$. This raises no issues as far as the divisibility lattice is concerned, but it isn't consistent with the definition of divisibility itself.
Answer: I answered this already in a comment at MO: "The best way to think about this is that the "gcd" of two natural numbers is the meet of them in the lattice of natural numbers ordered by divisibility. Note that $0$ is the top element in the divisibility order. The meet of the top element with itself is itself. So $0 = \gcd(0, 0)$ is the answer. 'Greatest' is an unfortunate misnomer in this case."
The book Mathematics Made Difficult has a nice little section on this. It should perhaps better be called "highest common factor" (hcf).
Comment: Win or lose, "the meet of [two numbers] in the lattice of natural numbers ordered by divisibility" is a definition of delightful pithiness.
Comment: @dfeuer Well, I had answered the question already at MO. I wasn't racing.
Comment: You lost the race to William.
Comment: we all lost to him :)
Answer: Simply said - this depends on your definition.
Clearly, if $d=\gcd(a,b)$, you require $d\mid a$, $d\mid b$, i.e., it is a common divisor.
But there are two possibilities how to express that it is greatest common divisor.
One of them is to require
$$c\mid a \land c \mid b \Rightarrow c\le d$$
and the other one is
$$c\mid a \land c \mid b \Rightarrow c\mid d.$$
Clearly, if you use the first definition, $\gcd(0,0)$ would be the largest integer, so it does not exists. If you use the second one, you get $\gcd(0,0)=0$. (Notice that $0$ is the largest element of the partially ordered set $(\mathbb N,\mid)$.)
As far as I can say, the first definition appears in some text which are "for beginners"; for example here. (It was one of the first results from Google Books when searching for "gcd(0,0)".)
I would say that for students not knowing that $\mid$ is in fact a partial order, the first definition might feel more natural. But once you want to use this in connection with more advanced stuff (for example, g.c.d. as generator of an ideal generated by $a$ and $b$), then the second definition is better.
Comment: This helped. I still feel a little icky about  (ℕ,∣) as a partial order, because 0∣0 feels weird to me, and this whole argument requires that reflexivity.
Comment: What's an ideal, in simple terms?
Comment: @BarbaraKwarc You can have a look at [Wikipedia article](https://en.wikipedia.org/wiki/Ideal_(ring_theory)). Or perhaps this question: [Intuition behind "ideal"](http://math.stackexchange.com/q/63909).
Answer: Another way to think about this is ideals. The gcd of two natural numbers $a, b$ is the unique non-negative natural number that generates the ideal $\langle a, b \rangle$. So in this case, $\langle 0 ,0 \rangle$ is just the $0$ ideal so the gcd is $0$.
Answer: If we take Euclid's algorithm:
$\text{gcd}(a, b) = \left\{
  \begin{array}{l l}
    a & \quad \text{if $b = 0$}\\
    \text{gcd($b$, $a$ mod $b$)} & \quad \text{otherwise}
  \end{array} \right.$
as the definition of GCD, then $\text{gcd}(a, 0) = 0$ for any $a$, because the stopping case of $b = 0$ is reached immediately.  If $a = 0$, then we get $\text{gcd}(0, 0) = 0$.
So, it's possible that Wolfram Alpha obtains its result as a side effect of using Euclid's algorithm rather than deliberate thought as to what gcd(0, 0) should return.  But it does fortunately coincide with William's "partial order of divisibility" explanation.
Answer: Defining $\gcd(a,b)$ for $\def\Z{\mathbf Z}a,b\in\Z$, to be the non-negative generator of the ideal $a\Z+b\Z$ gives $\gcd(a,0)=|a|$ for all $a$, including for $a=0$. Similarly one can define $\def\lcm{\operatorname{lcm}}\lcm(a,b)$ to be the non-negative generator of the ideal $a\Z\cap b\Z$, which gives $\lcm(a,0)=0$ for all$~a$ (note that since this is the only common multiple in this case, it is unlikely to provoke much discussion).
Adding these cases to the usual definitions of the $\gcd$ and $\lcm$ for nonzero integers causes no problems; all usual formulas remain valid. In fact, if one wants the rule $\gcd(xy,xz)=|x|\gcd(y,z)$ to hold for all integers $x,y,z$, one is forced to put $\gcd(0,0)=0$.
On the other hand, I don't think it is absolutely vital for mathematics to have $\gcd(0,0)$ defined, in the same way as $0+0$, $0\times0$ and $0^0$ need to be defined (and $0/0$ needs to be undefined) in order for the usual rules of algebra that one uses all the time to be valid. I think it would suffice to qualify the rule I cited by "$x\neq0$" if one wants to leave $\gcd(0,0)$ undefined; other rules like $\gcd(a,b)=\gcd(a,a-b)$ do not seem to equate $\gcd(0,0)$ with something else. The reason that leaving it undefined is not so dramatic is that when considering divisibility, $0$ is often excluded anyway; for instance it has to be put aside in the theorem of Unique Factorisation.
Answer: In the general framework of integral domains (commutative rings with unity, without nontrivial zero-divisors), we define a greatest common divisor of two elements $a,b$ of an integral domain $R$ as any element $c\in R$ satisfying:

$c$ divides both $a$ and $b$, that is, there are $x,y\in R$ such that $a=cx$ and $b=cy$.
If $d\in R$ divides both $a$ and $b$, then $d$ divides $c$.

We write $c=\gcd(a,b)$ in this case. The definition implies that if $c,c^\prime=\gcd(a,b)$, then $c$ and $c^\prime$ are associates, that is $c=uc^\prime$ for some invertible element $u$ in $R$. This is equivalent to say that the principal ideals generated by $c$ and $c^\prime$ are the same. Therefore a non-ambiguous definition is as follows:
"$\gcd(a,b)$ is $\ $ any minimal$\ $ the minimum element in the family $\mathcal F=\{Rd: Rd\supseteq Ra+Rb\}$ of principal ideals containing $a$ and $b$, ordered by inclusion, wherever such minimum ideal exists."
Since $R0+R0=R0$, we see that $R0=0$, the trivial ideal of $R$, is the $\gcd$ of $0$ and $0$.
In general you cannot guarantee that $\gcd$s exist. A sufficient condition is your integral domain $R$ to be a UFD (Unique Factorization Domain).
Comment: anon- Not on my keyboard. On my keyboard, backtick is the key to the left of 1, and tilde is obtained by holding shift and pressing the hash key (which is next to Enter). In general, the location of punctuation characters varies in keyboards used in different countries.
Comment: Use `\gcd` instead of `$GCD$`. Also, `^\prime` can be abbreviated all the way down to `'`.
Comment: I've tried editing it myself, but you've interrupted me twice, so I'll let you do it.
Comment: @dfeuer Thanks for the suggestion. By the way, that ' shortcut works in ordinary $\LaTeX$?
Comment: Yep! It even works in Plain $\TeX$! $x'''$ just takes four keystrokes (six if you count dollar signs).
Comment: @dfeuer Great!!! One question: how did you manage to write text with that gray background?
Comment: By putting two `s around text (it's the same key as ~).
Answer: From Wikipedia:

The greatest common divisor of $a$ and $b$ is well-defined, except for the
  case $a=b=0$, when every natural number divides them.
Comment: Well, this isn't really the right answer, is it? William got it right.
Comment: All I'm saying is that Wikipedia got it wrong in this case (or at least it's misleading to suggest that $\gcd(0, 0)$ is not well-defined, because as has been clearly explained, it's perfectly well-defined and indeed it's $0$).
Comment: The guy got his answer, that's the most important :)

What is $\gcd(0,0)$?


Claiming tax exemption to use the funds for Capital Investment

Question: I currently work as a server/bartender, and saving up to get a food truck off the ground. Suppose I claim tax exempt on my W-2 (with the restaurants I work for) and use 70% of gross funds for Capital Investment in my business, while using 30% for living necessities. Will I only pay income tax for the 30%? Would there be tax impositions on the other 70%?
Answer: Ask a CPA before doing anything
No, it's not that simple. You have a certain income, you have deductions and you pay taxes on the rest. If you can claim business expenses on everything you spend on the new business you will pay significantly lower taxes than if you didn't. But you definitely don't just pay taxes on the other 30%.


Asking about transit visa traveling from Nigeria to Canada with a Canadian passport

Question: Does a Canadian passport holder need a transit visa for a London transit when traveling from Nigeria to Toronto, Canada?
Comment: The other question has almost nothing in common with this one and is therefore not a duplicate.
Answer: If you can enter a country, you can generally transit there without worrying about the destination and all other complex rules for transit (which only apply to people who cannot enter the country without visa).
Since Canadian citizens can enter the UK for tourism and other purposes, they can also transit there without visa.


Apple Pay Peripheral

Question: I use an iPhone 5S, as I was unable to wait until the 6 came out (my screen was destroyed on my old phone). Is there any peripheral which allows me to use Apple Pay on my phone?
Comment: I don't think I've heard of any. Something like a Apple Pay case with NFC should come out soon by third-party company.
Comment: I picked up an iPhone 6 last week and was suprised I could not yet use ApplePay.  The Visa/MC/Amex logo on the card is not enough to make it work, the list of participating banks is actually still fairly short. See http://support.apple.com/en-us/HT6288
Answer: No. You can't put an NFC chip into a 5s, even with external hardware.
Comment: Explain, why not ? provide source !

Apple Pay Peripheral


How should a cut chandelier wire be repaired?

Question: The wire in our chandelier is cut and spliced between the fixture and the ceiling. The chandelier is currently being supported by the wires and not the chain. Does the wire need to be completely replaced?
Comment: I stripped the rant and unrelated commentary from your post. That's not what we're concerned with here. You'll get your answer and can then deal with the electrician as you see fit. For help with legal or contractual issues, consult other websites.
Answer: Replace the cord. Legal situation will vary by country, but in NZ I would cite ASNZS 3000:2007:

188.8.131.52 Mechanical stress
All cables and conductors shall be installed so that there is no undue mechanical stress on any connection.

188.8.131.52: Flexible Cords
Joints shall not be made in flexible cords.
Answer: The real issue is that the lamp appears to be suspended on the electrical cable. That's not OK.
There's a chain, and there's a metal wire; the weight should be suspended on one of these. There's clearly a lot of slack on the chain, and there's a bit of slack on the steel wire. I'm not sure which is supposed to support the weight. Make an educated guess there.
After that, either use a longer electric cable, or shorten the mechanical wire/chain, so that there's slack on electrical cable.
Ideally you'd replace the electric cable, both for reliability (and therefore safety) and aesthetics.
Since this is home improvement, you can use something as simple as "sugar cube" connecting blocks or shrink connectors or spring wire connectors, or an inline junction box, or even twist the wires and cover with electric tape (least safe).
In summary: supporting the weight is the problem, use common sense.
Comment: That bare wire is the ground wire.  (See e.g. https://diy.stackexchange.com/questions/95247/what-is-this-copper-looking-wire-on-my-light-fixture).  The chain is meant to support the weight.


Automatic numbering field in Microsoft Word?

Question: I'm creating a template with a section with figures/tables, and I would like to have them automatically numbered, e.g. Figure #1, Figure #2, etc. A user would copy/paste the template's format, and it will paste with the incremented number. Is there anyway to accomplish this?
Answer: If you use Insert Caption it will enter Figure [#] where # is the next number in the series. If you copy and paste this info into a new file it will keep the correct order. If you add a new Insert Caption between current ones, it will update all #s.
Answer: I think the only way is to create a macro to insert selected file image and insert Caption and crossRef and option to Ctrl+A and F9 and save


Dimension of the Hilbert scheme of curves

Question: Consider the Hilbert scheme parametrizing the curves of degree $d$ and arithmetic genus $g$
in $\mathbf{P}^n$. Is there a formula for its dimension in terms of $g,n,d$? Is there a bound
on its number of irreducible components?
Comment: (Please forgive the self-advertising!)
In an old paper [B. Fantechi, R. Pardini, On the Hilbert scheme of curves in higher-dimensional projective space, Manuscripta Math. 90 (1996), 1-15.] B. Fantechi and I showed that for every $n≥3$ there exist smooth projective curves $C_r\subset P^r$ lying on exactly $n$ components of the Hibert scheme, for infinitely many values of $r$. I don't know whether this partially answers your question.
Comment: Are you asking about the Hilbert scheme parameterizing closed subschemes on $\mathbb{P}^n$ with Hilbert polynomial $f(t) = dt+1-g$?
Answer: It is well known that if $C \subset \mathbf{P}^n$ has degree $d$, arithmetic genus $g$ and is a locally complete intersection, then the dimension at $C$ of the Hilbert scheme $\mathscr{H}=\mathscr{H}^n_{f(t)}$, with $f(t)=dt-g+1$, satisfies $$\dim _C \mathscr{H} \geq h^0(C, \mathscr{N}_C)-h^1(C, \mathscr{N}_C), \quad (*)$$
where $\mathscr{N}_C$ is the normal sheaf of $C$ in $\mathbf{P}^n$.
When $C$ is a smooth and irreducible, by using Riemann-Roch one checks that the right hand side of $(*)$ equals $p(n,d,g):=(n+1)d+ (n-3)(1-g).$
A component of $\mathscr{H}$ of dimension exactly $p(n,d,g)$ is called regular, whereas a component of dimension strictly bigger that $p(n,d,g)$ is called superabundant.
For instance, it is known that every complete intersection curve $C$ belongs to a regular component of $\mathscr{H}$.
Comment: The dimension inequality you write is true if $C$ is a local complete intersection scheme.  In general, you do need some extra conditions to reduce the "natural" obstruction group to $H^1(C,\mathcal{N})$, cf. pp. 33-35 of Koll\'ar's "Rational Curves on Algebraic Varieties".
Comment: You are right. I corrected the answer, thank you.
Comment: I am aware of this inequality. I wonder if something more precise is known (or at least conjectured). I am mainly interested in smooth $C$.
Comment: @Alex: "I am mainly interested in smooth $C$".  Are you interested in "general" or "generic" $C$?  If so, then Brill-Noether theory essentially gives a complete answer.
Comment: I am interested in general $g,n,r$, for generic $C$ their values are restricted by the Brill-Noether number being nonnegative.


can anybody elaborate single threded model in webapp?

Question: When do we need single threded model in webapp while designing web application in java.
Comment: You need to be more specific.
Answer: The single-threaded model should almost always be avoided. (I'm assuming you're talking about the SingleThreadModel interface.) Basically it was introduced in an attempt to save people from having to think about concurrency, but it was a bad idea. Concurrency is inherent in web applications - introducing a bottleneck like the single threaded model is the wrong solution. The right solution is to educate developers about concurrency better, and introduce better building blocks for handling it.
The interface is deprecated as of the Java Servlet API 2.4, with this note:

Note that SingleThreadModel does not
  solve all thread safety issues. For
  example, session attributes and static
  variables can still be accessed by
  multiple requests on multiple threads
  at the same time, even when
  SingleThreadModel servlets are used.
  It is recommended that a developer
  take other means to resolve those
  issues instead of implementing this
  interface, such as avoiding the usage
  of an instance variable or
  synchronizing the block of the code
  accessing those resources. This
  interface is deprecated in Servlet API
  version 2.4.
Answer: When your Servlet has state (which is a bad idea) and you want to prevent multiple requests in stepping on their own toes (or data).
I would recommend you avoid it because at some point you will mess something up. Also, performance drops like a brick.
Answer: The single thread model for servlets is used to signal that the servlet cannot handle multiple concurrent threads from client connections. Setting a servlet to the single threading model results in the servlet container (application server) to create a servlet instance per client.
It is best practice not to use the single thread model for servlets. Data kept per client connection is typically stored in the client Session object.


What does "The insolence of wealth will creep out" mean?

Question: Can anyone paraphrase the following statement by Samuel Johnson?

The insolence of wealth will creep out.
Answer: Let's look at the quote in a more illustrative context...

"The insolence of wealth will out" - and on whom more readily than on a poor relation? The very term suggests every idea of contumely and neglect.
(contumely - rudeness or contempt arising from arrogance)

This particular citation doesn't include the word creep - but that doesn't significantly affect the sense, so we can ignore it.
What matters is the idea that a poor relation in particular should feel more insulted than anyone else. That's because the poor relation is more likely than most other poor people to actually know rich people. Specifically, he's probably reasonably well acquainted with his wealthy kinsfolk.
Given the truism that people are the same the world over, it's very likely our typical "poor relation" will feel that his rich cousins are no different to him (except they've got the money, and he hasn't). He doesn't feel insulted because they treat him badly - it's just the pure injustice of the situation.
This interchange between F. Scott Fitzgerald and Ernest Hemingway never actually occurred, but...

Fitzgerald: "The rich are different than you and me."
  Hemingway: "Yes, they have more money."

...pretty well sums things up from the modern "egalitarian" perspective. If you say the insolence of wealth will [creep] out today, people will probably realise you're quoting some archaic maxim even if they've never heard it before. If you say the rich are different, they'll probably understand exactly the same sentiment, but they won't think your phrasing is "dated/literary".
Answer: Wealth frequently brings out the worst in people, and not just in civil suits and in the dividing of the estate among the surviving relatives.  The love of money, it is said, is the root of all kinds of evil.  (Notice I did not say "money is the root of all evil," but the love of money.)
If insolence is "contemptuously rude or impertinent behavior or speech" (http://dictionary.reference.com/browse/insolence?db=dictionary), then a wealthy person who has a hang-up about his or her wealth is very likely to communicate that contemptuous attitude in various ways, verbally and/or nonverbally.
An insolent wealthy person (and in fairness, there are many humble, down-to-earth wealthy folks in the world, though I am not one of them) in passing a homeless person on the street might say, "Get a job!"  (Check out Bruce Hornsby's song "That's Just the Way It Is").  Or in a conversation with another wealthy person might she might opine,

"The government really must do something about all these entitlement programs.  It's creating a generation of do-nothings and beggars living off the public dole!  And you just know these people wouldn't do a lick of work if their lives depended on it!"

Or another wealthy dude might say from an apparently egalitarian perspective,

"You know, it doesn't matter what your job is, whether you're a street cleaner or a garbage collector.  As long as you do an honest day's work for an honest day's pay is all that really matters.  Oh, please pass the champaigne and the caviar, please."

If you were to ask the wealthy dude,

"Hey, by the way, have you ever swept up cigarette butts from a gutter or collected garbage on the poor side of town?"

you can bet he'd say,

"Well, no, but I've worked hard for my money.  Just because I inherited a few million from my dad doesn't mean I don't know what a hard day's work is all about!"

Insolence creeps out of the wealthy, yes; but it also creeps out of even modestly "comfortable" middle-class people who are just a little bit ahead of their neighbors, if only because they've maxed out their credit cards to have the accouterments of "success" but are now up to their eyeballs in debt.
Go figure.

What does “The insolence of wealth will creep out” mean?


Does exercising help to treat varicosis?

Question: Does exercising help to treat varicosis? Which exercises do you suggest me to do? They are at the beginning phase. It is difficult for an outsider to recognize them unless he inspects my legs carefully.
Comment: @ahmetozgul - consider adding your comment above to your question instead, as it's relevant to receiving an appropriate answer to your specific question. People answering often don't read the comments and jump into an answer without all the information they need.
Comment: How bad are they, what are your own experiences, any relevant information you might have to add?
Comment: They are at the beginning phase. It is difficult for an outsider to recognize them unless he inspects my legs carefully :)
Answer: Anything you do to increase your circulation will help with varicosis. According to varicose-help.com, exercises such as walking, bicycling, and swimming will not only help to prevent varicosis, but also deep-vein thrombosis and spider veins.
Getridofthings.com also suggests exercise as the number one way to get rid of varicose and spider veins, followed immediately by maintaining a healthy body weight. Excess fat is known to reduce circulation, which in turn adds to the problem of varicosis. For worse cases that a healthy lifestyle alone won't recover, they also suggest sclerotherapy, laser surgery, or traditional surgery.
Additionally, you shouldn't wear any restrictive clothing (unless recommended by a doctor) such as tight pants or socks with a tight band, as these will also reduce your circulation. In the articles I've cited, they also suggest sitting with your legs uncrossed, or elevating your legs above your heart when resting.
Comment: Also, many yoga inversions, such as [shoulder stand](http://www.yogajournal.com/practice/598), are reputed to prevent varicose veins.


mDNS (Avahi) working TO RPis but not between them

Question: Avahi/mDNS is running by default on recent versions of Raspian. Great. Very convenient to just ssh firstname.lastname@example.com.
I am doing development on a Mac and operating a local network of headless Raspberry Pis. Up until now, I was able to use mDNS to access the Pis, and the Pis used mDNS to connect to each other.
Today, I shifted the RPis to a private local network by setting them up on a wireless router unconnected to the internet. Once I join the private network, I am still able to access them via mDNS:
% ssh email@example.com
Linux scheduler 5.10.63-v7l+ #1459 SMP Wed Oct 6 16:41:57 BST 2021 armv7l

Last login: Mon Aug  1 09:07:43 2022
pi@scheduler:~ $

and
wes@macbook % ssh firstname.lastname@example.com
Linux crossing 5.10.17-v7l+ #1414 SMP Fri Apr 30 13:20:47 BST 2021 armv7l

Last login: Mon Aug  1 09:07:46 2022
pi@crossing:~ $

But when they try to access each other, I get some results I don't understand:
pi@scheduler:~ $ ping crossing.local
PING crossing.local (10.0.0.1) 56(84) bytes of data.
From 192.168.0.1 (192.168.0.1) icmp_seq=1 Destination Net Unreachable
From 192.168.0.1 (192.168.0.1) icmp_seq=2 Destination Net Unreachable
From 192.168.0.1 (192.168.0.1) icmp_seq=3 Destination Net Unreachable
From 192.168.0.1 (192.168.0.1) icmp_seq=4 Destination Net Unreachable

Here's what Avahi reports:
pi@scheduler:~ $ service avahi-daemon status
● avahi-daemon.service - Avahi mDNS/DNS-SD Stack
   Loaded: loaded (/lib/systemd/system/avahi-daemon.service; enabled; vendor preset: enabled)
   Active: active (running) since Mon 2022-08-01 09:07:37 PDT; 41min ago
 Main PID: 388 (avahi-daemon)
   Status: "avahi-daemon 0.7 starting up."
    Tasks: 2 (limit: 1438)
   CGroup: /system.slice/avahi-daemon.service
           ├─388 avahi-daemon: running [scheduler.local]
           └─414 avahi-daemon: chroot helper

Aug 01 09:08:08 scheduler avahi-daemon[388]: Leaving mDNS multicast group on interface wlan0.IPv4 with address 169.
Aug 01 09:08:08 scheduler avahi-daemon[388]: Joining mDNS multicast group on interface wlan0.IPv4 with address 192.
Aug 01 09:48:29 scheduler avahi-daemon[388]: Files changed, reloading.
Aug 01 09:48:29 scheduler avahi-daemon[388]: No service file found in /etc/avahi/services.

Here's my hosts and hostname files:
pi@scheduler:~ $ cat /etc/hosts
127.0.0.1   localhost
::1     localhost ip6-localhost ip6-loopback
ff02::1     ip6-allnodes
ff02::2     ip6-allrouters

127.0.1.1   scheduler
pi@scheduler:~ $ cat /etc/hostname
scheduler

What does avahi say about it? Let's see:
pi@brs-scheduler:~ $ avahi-resolve --name brs-crossing.local -4
brs-crossing.local  192.168.0.214
pi@brs-scheduler:~ $ ifconfig | grep "inet 192"
        inet 192.168.0.109  netmask 255.255.255.0  broadcast 192.168.0.255
pi@brs-scheduler:~ $ ping brs-crossing.local
PING brs-crossing.local (10.0.0.1) 56(84) bytes of data.
From 192.168.0.1 (192.168.0.1) icmp_seq=1 Destination Net Unreachable

So for some reason, on this private network, mDNS is resolving correctly, but ping and ssh don't resolve properly?
What am I missing?
Answer: Unsurprisingly, since the pis worked fine on the local net and stopped working on a private net with a new router, it had to do with the configuration of the new router not mDNS.
mDNS was working fine:
pi@scheduler:~ $ avahi-resolve --name crossing.local -4
crossing.local  192.168.0.214

The new router on the private net had two operating modes "router" and "access point." In "router" mode, the router was pushing a DNS nameserver IP to clients which was somehow hosing ping and ssh and other services, despite mDNS working okay.
pi@scheduler:~ $ cat /etc/resolv.conf
# Generated by resolvconf
nameserver 192.168.0.1

Once the router was placed in "access point" mode, and DHCP was turned on manually, everything worked.
Obscure problem. Obscure solution.


Derailleur hanger bent

Question: How can I bent it back
Because its one of those the hanger is a part of the derailleur
If I want to get a new one its the whole derailleur replaced with it
Comment: Large adjustable spanner. the quality of your derailleur, approx is ok. do not bend the derailleur, only the hanger.
Comment: A photo from the side might help - this appears to be a claw adapter which are readily available, and not a dedicated part of the rear derailleur.
Answer: The Savvy Cyclist is right, a hanger alignment tool is the best way to straighten the hanger. For some bikes, like yours, a hanger alignment tool won't work.
For bikes that have derailleurs that can't be removed from the hanger, or for inexpensive derailleurs you can bend it by hand and eyeball if it's straight.
The key to eyeball straightening is knowing what you are comparing to for straightness.

In your picture - you want the red line - the derailleur hangar - to be parallel to the green line - the drop out.
Grip the derailleur cage so that you can apply force such that the derailleur hanger will bend in the right place.
The red arrow indicates where force will need to be applied

In some cases I've used a large adjustable wrench to grab the hanger bolt (or hanger rivet in this case) and apply force on the hanger.
It takes some experimentation, but it can be done. Start by bending a little, checking, and repeat.
Comment: @Mahmoudll it's fixable!
Comment: *In some cases I've used a large adjustable wrench to grab the hanger bolt (or hanger rivet in this case) and apply force on the hanger.*  I'd recommend that over grabbing the derailleur and pulling - if possible.  Simply grabbing and pulling could just bend the hanger the opposite way in a different location, most likely up by the frame, leaving a sharp bend outward near the frame and the existing bend inward.  That would make aligning the derailleur impossible.  Much better to remove the derailleur and use that large adjustable wrench on the unbent part and use that to straighten the hanger.
Comment: In this case (assuming the derailleur can't be removed from the hanger), I'd work that wrench onto the flat portion of the hanger between the derailleur and the frame and carefully straighten it that way.  And be prepared to buy a new one if I bodge it.
Comment: Ok thanks I will try to do it.               Is it too bent to be straight?
Comment: Ok Thank you
Answer: If the derailleur hanger is bent and it is not possible to separate it from the derailleur, it may be difficult to straighten it without causing further damage. If you are not confident in your ability to repair the hanger, it is recommended to take it to a bike shop for repair. The shop should be able to straighten the hanger or replace the entire derailleur if necessary.
If you are comfortable with attempting the repair yourself, you will need to use a hanger alignment tool or a flat surface such as a workbench to straighten the hanger. First, remove the wheel and derailleur from the bike. Then, place the hanger on the alignment tool or flat surface and gently apply pressure to the bent area until it is straight. Be sure to use caution and apply pressure slowly and evenly to avoid causing further damage to the hanger or derailleur. Once the hanger is straight, reattach the derailleur and wheel to the bike and test the shifting to ensure it is functioning properly.
Comment: Thank you I will try to do it by my self

Derailleur hanger bent


What is the minimum number of atoms required to run a Monte Carlo simulation meaningfully?

Question: What is the minimum number of atoms required to run a Monte Carlo simulation meaningfully?
Comment: Indeed, path integral Monte Carlo has been used to study quark gluon plasmas, which are not atoms, and so the technical answer to the question is _zero_. https://journals.aps.org/prc/abstract/10.1103/PhysRevC.87.035207
Comment: I'm afraid you didn't phrase the question in the way you wanted, because even a system composed of two atoms can be simulated by Monte Carlo. You just apply the Metropolis algorithm to the one-dimensional (or three-dimensional, if you want to sample the rotational degrees of freedom as well) potential of the molecule and then you are fine. The simulation may be pointless, but is certainly doable.
Comment: I edited your post. Please ask 1 question in each post: https://mattermodeling.meta.stackexchange.com/q/421/5
Answer: The literal answer to the question you asked is zero. That might not be the answer you were looking for, but then again, you're asking too general a question to get a meaningfully specific answer. About a year ago I tried to tell you that Monte Carlo simulation is a name for a broad set of general mathematical techniques for stochastic simulations that use random sampling. I'll try again. Monte Carlo simulation is very general, and does not have anything intrinsically to do with atoms at all, unless you're applying it to some system of atoms. In particular, Monte Carlo methods are commonly applied in particle physics to cases where all simulated particles are subatomic (as pointed out by Shern Ren Tee in a comment), in entirely abstract math problems such as random walks and numerical optimization problems where atoms are irrelevant, and in a variety of applications like simulations of traffic flow and galaxy distribution where the (numbers of) atoms in the simulated entities are abstracted away entirely.
Now, the lowest meaningful number of simulated particles (be they atoms, galaxies or quarks) depends on what you're trying to simulate. For example, one-particle Monte Carlo methods are often used in modeling of electron transport, diffusion through obstructed media, and low-count responses of particle detectors. If you want to model systems with $n$-body interactions between particles, you'll want at least $n$ particles in your simulation in order to minimally capture the effect of the interaction. In matter modeling, we are often interested in interactions with $n=2$, but there are many exceptions with $n>2$. In addition, the description of qualitative features such as magnetic configurations and charge patterns requires the number of particles to be at least equal to the size of the repeated pattern.
However, in many cases of relevance to matter modeling that answer isn't very helpful except for testing one's code. Unless you're actually interested in a system with that few particles, you really should do a finite-size scaling analysis since many properties do depend on the number of particles. In case you're dealing with a confined nanoscale system, for example, there is a finite upper limit to how far you can scale the simulation. Often, however, you might be trying to describe a thermodynamically large system with an infinite number of particles, using finite-size simulations. In that case, look at how intensive quantities like the energy density depend on the system size. Are they converged to within your desired tolerance? If not, you can choose to simulate increasingly larger systems, or do extrapolations. Either way, the system size you'll need for saying something meaningful (and with reasonable error bars) about the system in the thermodynamic limit is non-universal.
Answer: I used a Monte Carlo method called FCIQMC to calculate the ionization energy of the carbon atom with unprecedented precision. Therefore, MC methods can be used for a single isolated atom.
The answer to the question depends on the type of Monte Carlo method in which you are interested. Monte Carlo methods are also used by particle physicists to study sub-atomic physics (zero atoms).
At least 15 different "quantum" Monte Carlo methods were listed here:
What are the types of Quantum Monte Carlo?
Based on your 14 questions with the monte-carlo tag, it looks like you're interested in Monte Carlo methods for classical mechanical modeling rather than quantum mechanical modeling, so I'll mention that there's even more Monte Carlo methods used in Matter Modeling than what is listed in the above-mentioned QMC thread.
Before asking further questions about Monte Carlo calculations, I recommend that you consider the following two questions:

What precisely am I simulating? (e.g. "I'm calculating thermodynamic properties of a protein with 100 amino acids via an ensemble average, as described in this question: https://mattermodeling.stackexchange.com/q/3610/5" ).
What specific Monte Carlo method am I using? (e.g. FCIQMC).


What model did the MONIAC use?

Question: Phillips designed a hydraulic computer to model the UK economy in 1949; 12-14 copies were built. What model did it compute with? How have modern models of the UK built on that work?
Comment: I heard the basic principle of the Moniac was actions and feedbacks between different variables. One of these relationships being the Phillips curve (the original one, relating nominal wage acceleration with unemployment). So the formal equivalent would be a 'general disequilibrium' aggregate model described by a differential system. So something very different from general equilibrium and closer to the work of Semmler (https://ideas.repec.org/e/pse120.html) or Flaschel (https://ideas.repec.org/e/pfl107.html).
I would be very interested in a more informed answer.
Answer: According to Bissell (2007),  MONIAC was based on a simple, first-order model of the dynamics of an economy (but authors also mention it could be recalibrated to higher-order models):

Let $u$ be the production flow, $v$ the consumption flow, $w$ the stocks and $p$ the price, all measured, for simplicity, from a base at which the system is in equilibrium. We have then, by definition, the identity
$$U-V={dw\over dt}$$
and three hypotheses,
$$\eqalignno{&\ \ u=lp\cr &v=mp}$$
and
$$w=np$$
where $l$ $m$, and $n$ are parameters.
If at time $t=0$, from equilibrium, there is a spontaneous change, $\Delta v$ in
consumption, then
$${dW\over dt}=u-(v+\Delta v)=(l-m)p-\Delta v$$
Also,
$${dp\over dq}={1\over n}$$
Therefore [after some manipulation] […]
$$n{dp\over dt}-(1-m)p+\Delta v=0$$
The solution of this equation,
$$p={\Delta v\over l-m}(1-{e}^{{l-m \over n}t})$$
gives the path of the induced price change. […]
This simple model could be further developed, in particular by making a distinction between working and liquid stocks, introducing lags into the production and consumption functions, and linking the demand curve for liquid stocks to the rate of change of price […].

The above is in its essence based on the idea of circular flow combined with some canonical Keynesian macroeconomics.
For example, just compare the diagram representation of MONIAC (picture on left from Media Archealogy wiki) to the circular flow diagram from contemporary Krugman's macro textbook (picture on the right). You will notice that there is some resemblance although they are not exactly the same.
This being said both MONIAC and circular flow diagram are didactic tools (MONIAC was used by central banks for some time, but the machine was originally intended just for classroom use). Hence the actual models do not directly build on this ideas even though they are connected.
Modern models that try to model economy such as dynamic stochastic general equilibrium (DSGE) models, relate to the MONIAC model only very superficially and don't build upon MONIAC model directly.

What model did the MONIAC use?


Score of importance from feature selection techniques

Question: Can I get the score of importance for each feature in feature selection methos such as Chi2, Information Gain (IG), or Recursive Feature Elimination (RFE)? Or they just provide a list of important features?
Answer: As far as I know, in scikit-learn you can only get individual (relative) features importance if you're using an ensemble method of decision trees. After fitting a model you can check model.feature_importances_. As in the example below:
# Feature Importance
from sklearn import datasets
from sklearn import metrics
from sklearn.ensemble import ExtraTreesClassifier
# load the iris datasets
dataset = datasets.load_iris()
# fit an Extra Trees model to the data
model = ExtraTreesClassifier()
model.fit(dataset.data, dataset.target)
# display the relative importance of each attribute
print(model.feature_importances_)

Source: https://machinelearningmastery.com/feature-selection-in-python-with-scikit-learn/
This question has also some more in-depth answers on the subject.
Comment: I don't think you are answering his question here, he is asking about specific feature importance algorithms not just if any exist.
Comment: @astel a matter of adverb. Fixed, thanks for speaking out.
Answer: I don't use scikit-learn so I can't speak to the specifics on that, but the R package CORElearn will give you importance values (usually on [0,1] I think) for features using information gain, minimum description length, and a whole host of others.  Might be of interest to check that package out if scikit-learn can't provide what you are seeking.


Bjt for trigger MOSFET

Question: I my project MOSFET need 13 v 65% PWM to trigger but controller output is 5 volt then how can I amplify this in voltage
Comment: Is your positive rail also 5V? Can you use a 12 V rail? And will 12 V work for the MOSFET or must it really be 13 V? (Please add these details to the question.)
Answer: Look for a MOSFET gate driver IC for a simple solution.
Answer: The easiest way to do this is with a  low-side MOSFET gate driver. Microchip, for example, has a wide range. You can do a parametric search. Here is a typical one - the MIC4120/4129 (originally Micrel):

Vs for this part can be as high as 20V so your 13V is okay. The input MOSFET and the 0.1mA current source produce a full swing voltage at the buffer input-- the 0.4mA current source is part of a speed-up circuit that draws relatively little current in the DC state (the 0.4mA current source switches off once the inverter output has risen close to the Vs supply voltage).
The output transistors can supply peak current in the 6A range which is desirable for charging and discharging your power MOSFET gate charge as quickly as possible. The net result is a simple-to-use circuit that can handle the gate charge in tens of ns. Because the relatively high and relatively fast-switching gate current flows in and out of the power supply pins on the gate driver, be sure to pay attention to the layout and provided adequate supply bypassing in accordance with the datasheet recommendations.
If you want a slower switching action (for example, to reduce EMI) at the expense of switching losses in your MOSFET you can add a gate resistor.

Bjt for trigger MOSFET


Best practice to transform ipad app to iphone app?

Question: I have made an iPad application and know I want to make an unique application for iPad / iPhone. I have started to create a new xib and modify my code with idiom to detect the system the app is running on. But I have some questions: How can I reuse my ipad implementation? Given the files: iphone.xib, iphone.h, iphone.m, ipad.xib, ipad.m, ipad.h, what is the best way to prevent adding the same code in iphone.m and ipad.m ?
Answer: Please check the following link that explains how to create an universal apps : http://blog.corywiles.com/creating-a-universal-ios-app-tutorial


Is label offset only possible in PCS?

Question: I'm working with ArcGis 10 and I need to show the name of the streets along the street line. I want to increase the distance of the label from the line and I saw in the Label Tab I can control this by changing the offset in Placement Properties, but I fear this option does not work when the feature is in a GCS. Is that right?
Answer: No, In fact arc map uses map units or page units for label offsets so this distance is not related to projection anyway. As ESRI says "These units are measured in map units or in page units (millimeters, inches, or points)."
So there is no matter if the layer is in GCS or PCS.
Details are at here and here.

Is label offset only possible in PCS?


Wanna learn python and MEL for 3d scripting

Question: I want to explore python and MEL for 3d scripting. I have knowledge of blender and Maya (modeling, animation, rigging and a little bit of simulation ), and basic OOP coding knowledge. But I don't know where to start. Will it differ from one software to another? Please refer some courses. Also it would be better if the courses are free :)
Comment: Aking for tutorials and resources is kind of off-topic as well, but learning Python's API comes up quite a lot here so I think it's valuable for BSE community to have some answers about that. I think we should not close this question.
Comment: MEL is obviously off topic on Blender Stack Exchange.
Comment: Hello and welcome. Asking for links to resources about X is considered off topic here, asking directly about X is encouraged though. If you can rephrase your question to focus on the specific difficulties you are encountering, rather than point you to some site, please [edit] your post so it can be reopened. As it stands it is not a good fit for this site.
Answer: To learn Blender's Python API, you obviously have to learn Python scripting first. Python.org website provides a lot of resources like the documentation for Python which might look boring and complex, but it is very valuable in learning it. With Python and scripting all resources you need to learn are online so simple Google search will get you started just fine. You will find places like https://www.w3schools.com/python/ which is just one of many brilliant resources for learning. There are also many video tutorials like the ones on Youtube.
Once you have basic knowledge of Python, you need to look into Blender's Python API. You always have the documentation for it as well.
In both cases - Python and Blender's Python API -
the docs are actually quite good and video tutorials you will easily find online will get you started. There are so many of them it's hard to recommend any specific ones. It's best for you to choose something you like yourself. Besides that, practice can really speed up learning, so you should open Blender and explore what you can do with it. You will find really great Python examples in the text editor's Templates menu:

Another invaluable tool in exploring bpy in Blender is the Autocomplete feature of the Python Console. That's the Tab button. Just start writing something and see what's available:

Once you have basic understanding, you can also explore thousands of Blender's add-ons that are written in Python(pretty much all of them are and if you can use an add-on, you can also read it's source code). All add-ons that come with Blender are in Blender's install directory(on Windows that's C:\Program Files\Blender Foundation\Blender 3.4\3.4\scripts\addons). You can also see the ones you install(on Windows that's %appdata%\Blender Foundation\Blender\3.4\scripts\addons - you can copy/paste that into the address bar of Windows file explorer)
If you get stuck with something, just ask here on Blender Stack Exchange. These days it's getting kind of hard to find unanswered questions if they are formed in a specific and clear manner.
Comment: Thanks a ton! :D