In a random forest, are all decision trees given same priority?

Question: In random forest algorithm, m (say) number of decision trees are generated using p ( $log_2 n$ +1, where n= number of features) randomly selected features. The label of any sample from test data is chosen by the number of votes by the result of these decision trees. But these decision trees result in different accuracy ( quite obvious). My question is, why should we give same priority to all the decision trees? If a decision tree has higher accuracy in predicting the labels of the test samples, shouldn't we give it more priority than those with lower prediction accuracy ?
Answer: As you mentioned, each decision tree is trained on p (sometimes sqrt(p) random features). This ensures that each tree is "grown" (trained) differently so that the model 1. Does not overfit the training data (reduces variance) and 2. Generalizes better to new data (reduces bias). Therefore we don't weigh the trees differently, as this would be similar to having all tress trained on the same features.
You can change the voting threshold however from the standard 50% to anything you want (e.g 40%, 70%, 90%) which will change the precision and recall accuracies of the model.
EDIT: changing the voting threshold means changing the number of trees needed to make a classification. For example, in binary classification most standard random forests require 50% or more of the trees to vote for a class for that class to "win" (be predicted to be that class). But if you change this threshold, to say 70%, then 70% or more of the trees need to vote for the same class for that class to win.
Comment: Can you please elaborate the voting threshold part a bit more?
Comment: I saw your edit. Since, features are chosen randomly, it is impossible to say decision trees with higher accuracy will appear more than the decision trees with lower accuracy. If decision trees with lower prediction accuracy appears more, then your idea of voting threshold is not of much use.
Comment: A random forest is different to that of a single decision tree model; it is an ensemble of decision trees with a few extra architecture features designed to be more robust. For example, the selection of random features for each tree to be trained on. Another is that random forests use bootstrapping, whereby each observation is sampled and replaced, so that on average 1/3 of the total samples are not included in training a tree. As a result, the voting threshold is still a valid parameter to tune. [This link](https://www.stat.berkeley.edu/~breiman/RandomForests/cc_home.htm) may explain more.
Answer: The point is that we can not use test data to choose the best model or give weights to our set of models because test data must be used for the finsl evaluation of our machine learning algorithm. Thus, we have two starategies:
1- Keeping a separate validation data and choose the best model or or give weights to our set of models according to their performance on validation data. This is not the best action because our training data set usually does not include the whole data space, so when we see the new test data which is far from the training set, our model fails. So, our model lacks generalization and is overfitted to validation data and has high variance in terms of expected loss.
2- Training multiple models (trees) and average the results of them which is called bagging. This effectively reduces the variance of the model. In case of random forest which includes random selection of features, the variance is further reduced. This techniques lead to better model generalization (performance on test data).
To cut the long story short, if we choose the best model according to its performance on validation data, we run the risk of over-fitting on validation data. To prevent this problem, we should train multiple models and because we do not know anything about the distribution of test data, we should give equal weigth (priority) to these models while averaging them.


Lie algebra embeddings and the center of their enveloping algrabras

Question: Let $\mathfrak{g}_1\subset \mathfrak{g}_2$ be a Lie algebra embedding. Assume both are semisimple. For instance take the standard diagonal embedding  $\mathfrak{sl}(2, \mathbb{C})\subset \mathfrak{sl}(3, \mathbb{C})$. This lifts to an embedding $U(\mathfrak{sl}(2, \mathbb{C}))\subset U(\mathfrak{sl}(3, \mathbb{C}))$ of the corresponding enveloping algebras. Consider their centers $Z(\mathfrak{sl}(2, \mathbb{C})),Z(\mathfrak{sl}(3, \mathbb{C}))$. It is relatively easy to see that under the previous embedding we have that $Z(\mathfrak{sl}(2, \mathbb{C}))\cap Z(\mathfrak{sl}(3, \mathbb{C})) = \mathbb{C}$. Is there any reasonable way to "connect" these centers? Let me be a bit more clear. For instance, we can pass the same question to the symmetric algebras of $\mathfrak{g}_1,\mathfrak{g}_2$. Here we have $S(\mathfrak{sl}(2, \mathbb{C})^*)^{SL(2,\mathbb{C})}$ the algebra of $SL(2,\mathbb{C})$-invariant functions on $\mathfrak{sl}(2, \mathbb{C})$ and $S(\mathfrak{sl}(3, \mathbb{C})^{\*} )^{SL(3,\mathbb{C})}$. There is a natural embedding of $S(\mathfrak{sl}(3, \mathbb{C})^{\*} )^{SL(3,\mathbb{C})}$ into $S(\mathfrak{sl}(3, \mathbb{C})^{\*} )^{SL(2,\mathbb{C})}$ and a projection of $S(\mathfrak{sl}(3, \mathbb{C})^{\*} )^{SL(2,\mathbb{C})}$ onto $S(\mathfrak{sl}(2, \mathbb{C})^{\*} )^{SL(2,\mathbb{C})}$ given by restriction. Are there any results that could describe how these centers behave under restrictions?
Answer: Take a look at "Shifted Schur Functions"
Andrei Okounkov, Grigori Olshanski
http://arxiv.org/abs/q-alg/9605042
Section 10: "Coherence property of quantum
immanants and shifted Schur polynomials"
In particular formulas 10.4, 10.5 - they discuss "averaging operators"
Z(U(gl(n)) -> ZU(gl(N)) , n < N
and later prove certain "good" (coherence) property of special generators of the centers
Z(U(gl(k)) which has been studied by the authors and M. Nazarov.
Hope this helps...
What is very interesting for me personally - is try to generalize such things
to the case of loop algebras Z(U(\hat gl)).
Here certain "good" elements of the centers has been constructed by Talalaev's formula,
it is natural to expect that Okounkov-Olshanski-... story can be generalized to loop algebra case
Answer: I'm doubtful about getting nice relationships between centers of universal enveloping algebras, if you look at embeddings for arbitrary pairs of semisimple Lie algebras; maybe there are subtle connections in special cases, however.   For one thing, centers and algebras of invariant polynomial functions for a given semisimple Lie algebra are related only   indirectly in the work of Chevalley and Harish-Chandra.   Moreover, embeddings into special linear algebras of unbunded rank occur when you start with a fixed semisimple Lie algebra and consider all of its faithful irreducible representations.   But the respective centers of the smaller and larger enveloping algebras are isomorphic to polynomial algebras in the number of indeterminates given by the respective ranks.
If there is a useful way to relate centers, it should be visible in diagonal embeddings for Lie algebras both of small rank such as you describe.   But it's not immediately visible to me.
P.S. A tag lie-algebras would be useful.
Comment: Thank you for the reply. I was asking this question because I'm interested in direct limit Lie algebras. Their enveloping algebras have trivial centers and this of course is a big set back in trying to understand their representation theory. It seems to me there should be some nice generalization of the center in this case, but of course I might be totally wrong about this.

P.S. I tried to add a tag with lie-algebras but it didn't let me for some reason. If you can edit the post then you're more than welcome to do so and add the tag.
Comment: @Alex: I've added a tag, but you should be able to edit your question including the tags.  Also, it would have been helpful to focus your question more on direct limits, since arbitrary embeddings look pretty hopeless for comparison of centers.   But even in the case of direct limits, you have to choose the embeddings explicitly.


Car stereo turns off when the cooling fan comes on

Question: I drive a Honda Civic 2008 model. I noticed that when driving, my car stereo momentarily switches off and back on after about 3-5 seconds when the radiator/condenser cooling fans come on. The lights on the instrument console & the headlights (when on at night) also flicker momentarily when the cooling fans come on.
What could be the cause of this problem & its solution?
Thanks.
Comment: Welcome to Motor Vehicle Maintenance & Repair! Is the car stereo the stock one or an aftermarket one?
Comment: A bad or loose ground connection somewhere.
Answer: Car fans consume a lot of electricity, especially when first turning on.
Does your dashboard have a voltage gauge? If it did, you would probably see the voltage drop from 14v to less than 10v when the fans first turn on. After that the voltage would stabilize at 14v, or possibly a little bit lower.
This is why your cabin lights flicker when the fans first turn on. Lights will get dimmer as the voltage decreases, but your radio may be programmed to turn off when voltage drops below 12v.
If my diagnosis is correct, then you have nothing to worry about. It might be annoying, but it will not damage your car.
You can test this by purchasing a cheap multi-meter at a hardware or auto parts store. They typically cost under $15. With the dial set to voltage, hook the leads up the battery. It should read close to 14v when the car is running. When the fan turns on, like I said before, the voltage will briefly fall below 10v.
Comment: This is not normal for a 2008 Civic
Answer: You could also check the connections to the radio because any corrosion/loseness in them would cause a voltage drop that is added to when the fan comes on.
Answer: Like someone mentioned, fans take a lot of current draw when they start. Normally your battery would be able to absorb the momentary high load, if it isn't happening you may want to test your battery.


If bitcoin have a 21 milion limit...what happens with the lost bitcoins?

Question: After reach the 21 million limit, and every year there is some coins that are lost... won't this make the value of the bitcoin go up?
Comment: Yes, maybe? Is that a bad thing?
Answer: It is never possible to determine which bitcoins have been lost, and which are merely being held unused.  In either case, it means they are effectively removed from the economy.
This means that they aren't being offered for sale on an exchange, nor being offered in exchange for goods and services.  This creates scarcity, and as economists tell us, scarcity (in general) makes the value go up.  It means that those who are offering to sell bitcoins on an exchange have less competition, and can charge a higher price.
Answer: Total bitcoins amount will never reach 21 milion, it will continue to approach the limit closer and closer. You can check wiki page for the details:
https://en.bitcoin.it/wiki/Controlled_supply
About your question. Yes, these lost bitcoins will make other bitcoins cost more. But from market perspective, very big part of all mined bitcoins are not participating in transactions. We can treat them like lost bitcoins, and they also increase the value of bitcoin. But someday owners will spend them.


Why do monastics in certain Buddhist traditions take new names?

Question: In the Theravada tradition, and perhaps others, monastics take a new name when becoming bhikkhus/bhikkhunis. Where does this tradition come from, and what is its significance? Others don't - what's the difference?
Answer: In India, during the time of the Buddha, the vast majority of monks and nuns didn't change their names. Notable exceptions are Sariputta and Moggallana, whose original names were "Upatissa" and "Kolita" respectively.
It is not clear why the Buddha chose to call Upatissa by the fact that he was the son (putta) of Sari, or Kolita by the name of his village. The Mahavagga calls them by these names before they met the Buddha, so it may have been that they took these names earlier.
Other examples that may also have been acquired earlier are Kundala-Kesi, Bakkula, etc.
Cases of adding a descriptive to the name are common, e.g. Kumara Kassapa, Lakuṇṭaka-bhaddiya, etc.
One case stands out, that of Angulimala, who actually had his name changed by the king:

Then the king's fear, his terror, his hair-standing-on-end subsided. He went over to Ven. Angulimala and said, "Are you really Angulimala, lord?"
"Yes, great king."
"What is your father's clan? What is your mother's clan?"
"My father is a Gagga, great king, and my mother a Mantani."
"Then may Master Gagga Mantaniputta delight [in staying here]. I will be responsible for your robes, almsfood, lodgings, & medicinal requisites for curing illness."
http://www.accesstoinsight.org/tipitaka/mn/mn.086.than.html

Apart from all this, the biggest reason for later name changes is simply because names in other languages don't work for the Pali recitation required for ordination, e.g.:

ayaṃ Noaho āyasmato Tongassa upasampadāpekkho

doesn't really work, so giving monks Pali names is considered appropriate:

ayaṃ yuttadhammo āyasmato sirimaṅgalassa upasampadāpekkho

It seems that early on there was a tradition of naming monks after arahant disciples of the Buddha, so we get various Moggallanas and Sariputtas throughout the ages. In modern times, there seems to be some greater variation in the practice, and choosing a name for a monk has taken on significance that pretty clearly wasn't there in the time of the Buddha.
My name, for example, is chosen because I was born on a Wednesday - in fact, I was given the wrong name, because one monk thought that me being born in the morning in Canada meant that he should give me a Wednesday night name (it having been night in Thailand when I was born).
In the end,

What's in a name? That which we call a rose
  By any other name would smell as sweet;
  So Romeo would, were he not Romeo call'd,
  Retain that dear perfection which he owes
  Without that title.
-- William Shakespeare, Romeo and Juliet
Answer: I think this relates to the fact you are starting a new life when you get ordained. This does not seem to be the case in the Buddha's time but more of a later development.
The name changing practice refer here is more perticulaly in referece the practice in Sri Lanka where a monk takes the name of the village or area he is from followed by a new name he would be addressed by.
Comment: I think the first statement is accurate but, as for the second one, some early discourses do relate name changing. [*SN 56.11*](http://www.accesstoinsight.org/tipitaka/sn/sn56/sn56.011.than.html) is one example of this: *"Then the Blessed One exclaimed: "So you really know, Kondañña? So you really know?" And that is how Ven. Kondañña acquired the name Añña-Kondañña — Kondañña who knows."* And if I recall correctly, *Sariputta* was called *Upatissa* before becoming a monk.
Comment: This is more like getting a nick name. E.g. like Kumara Kassapa than a formal name change in my thinking.
Comment: Indeed. I agree, but they are addressed by their nicknames from then onwards and that is what matters I think.
Comment: Also during Buddha's time there were monks who didn't change name. E.g. Anurudha, Deva Devadatta, etc. This became a norm sometime later in my opinion. Perhaps a historian can give more light on this.
Comment: I certainly have nothing to say about your opinion but in the early texts there are explicit references to name changing: *"...when members of the four castes — noble warriors, brahmans, merchants, & workers — go forth from home to the homeless life in this Dhamma & Vinaya declared by the Tathāgata, **they give up their former names and clans and are classed simply as 'contemplatives, sons of the Sakyan'**..."* [Ud 5.5, Uposatha Sutta: Uposatha](http://www.accesstoinsight.org/tipitaka/kn/ud/ud.5.05.than.html)
Comment: There are instances the names didn't change. At least for the first names. This might be referring to the Sir name or "Ge" name which is tired to the class or community you come from. E.g. Ananda, Ysodara, Maha Prajapathi Gothami, etc.where their original names before ordination.
Comment: I'm not opposing that some didn't change or that it was only the last name that changed. That seems to be true. I'm just saying that name changing seems to go back to the *Buddha*'s time and is not a later development. If you wish to stick to your opinion, feel free, I have no problem with that. May you be well.
Comment: Added more clarification to the answer.
Answer: The practice of monks getting a Dharma name upon ordination is very old and widespread. (It would be interesting to know the flip side question- is there any Buddhist order than doesn't involve Dharma names? I can't think of one)
Ref: https://en.wikipedia.org/wiki/Dharma_name
This article discusses the modern practice in Zen of giving Dharma Names where in he mentioned that this is an Indic tradition that probably pre-dates the historical Buddha.
Ref: http://hardcorezen.info/dharma-names/2733
Since the renunciates were renunciating family and householding, it is not surprising that they took on a new name, which makes it perfectly clear to the surrounding community that you don't plan to carry on the Jones family name by having kids, you aren't going to take advantage of the hereditary titles that go with the Jones family nor keep the Jones family estate.
If we're lucky someone familiar with the history of the early vinaya might know more about this, since the practice of Dharma names would have been promoted in the vinaya.
Answer: It's worth remembering here that general naming practices in different Asian cultures often differ from our own.  In traditional Thailand (before 1935 or so), government officials received a new name when they took up a new rank in the hierarchy, besides the actual rank title.  For example, there is a scholar of Thai culture who is now known as Phraya Anuman Rajadhon (1888-1969).  Phraya was his official title, the rest is the name he took when he received the title.  (His descendants use A-R as their family name.)  Earlier in his life, he had other names:  since his family was Chinese, he was born Li Kuang-jung, and in Thai he was known as Yong Sathienkoset.  When people have multiple names like this, each used in a different context or life phase, another name taken when ordaining would seem perfectly natural.
Note also: in Thailand today, parents seeking a name for a new child will often go to a monk for suggestions.  And a person who wants change his or her given name for luck or some other personal reason will also usually consult a monk.  It may be that this is "not Buddhist," but anyway it's common practice.
Answer: I practice with the Triratna Buddhists. For us the renaming of a person symbolises spiritual death e.g the passing away from an old life/way of existence. Fortunately this is followed by spiritual rebirth or it would be all a bit bleak.
The full process (system of meditation) is

Integration
Positive Emotion
Spiritual Death (new name)
Spiritual Rebirth

Just responding to @MatthewMartin. Though it isn't a Buddhist order as such - the Insight Meditation Society doesn't rename as far as I'm aware. Jack Kornfield is still Jack Kornfield irrespective of his commitment and progress on the path (both formidable I'm sure)


How can I bathe my baby in the shower?

Question: Our house has no bathtubs, only showers. We have very active 17-month-old twins that love the tubs at the grandparents' and we'd love to be able to have one at home. Unfortunately all the inflatable tubs are pretty small at this point and we'd rather avoid the cost of installing an actual tub. Is there such product that's large and we can just place in the shower as is?
Comment: Is there a shower bowl as such, or is it a wet room where the shower is?
Answer: When my son was 2-4 years old, we had this issue and used a large plastic storage box (without the lid!) for this, and it worked very well. They're cheap (and since we had just moved had many anyway, and when he didn't need it any more, it went back into service as a box), have no sharp edges, and completely watertight. Ensure that it's the high quality strong plastic (the ones you could pack dozens of books into) and not the stuff that breaks when you barely touch it.
If I recall correctly, the one we used had a 120L capacity, and it was only when he got to 4 that it started being a bit cramped (we moved to a house with a bath at this point, so never looked into alternatives).
The worst part was that when full it's heavy, so lifting it to empty the water was something I or my wife had to do (i.e. not grandparents when visiting), although this does mean that it doesn't get knocked over and spill everywhere. There's also some care needed to empty without overflowing the shower.
If you're strong enough to carry it, there's an added advantage of any tub in that you can reuse the water (e.g. in the garden) much more simply than with a real bathtub.
Comment: Thanks! We decided that this would be the least expensive, most effective solution for us.
Comment: To get the water out, you could try a siphon.
Answer: We picked up a tub at BabySam here in DK for our son - he's 3 and he still fits in it perfectly:

Volume: 90 liter.
Dimensions H33, B69 og L82 cm.
They also have a new sort of bathtub, one that's foldable:

Its dimensions:
Unfolded:  L:67 cm, B:39 cm, H:24 cm
Folded : L:67 cm, B:8 cm, H:24 cm
Weight: 1,3 kg.
We just have the tub on its side against the wall of the bathroom when it's not in use; the folding ones would take up even less space.
Comment: That folding one looks pretty cool!
Answer: I have all girls so I just brought them in with me when we were in this situation. I put some toys on the floor of the shower and let her sit down there and play for a couple minutes while I take care of myself, and when it's her turn I just hold her to wash her body and hair. But, once they get a little bigger their weight + slipperiness tends to cause difficulties with holding them, lol.

How can I bathe my baby in the shower?


Why does whip cream dispenser sometimes produce "ragged" cream?

Question: Sometimes I make whipped cream in my ISI cream whipper and it comes out beautifully fluffy and smooth, and other times when I dispense it, the cream looks "ragged" for lack of a better description. Any ideas what factor accounts for the difference?
Comment: Are you being consistent in the amount of shaking? I got an iSi for Christmas and haven't used it yet, but was surprised that the instructions explicitly stated how many times it should be shaken based on the fat content of your cream.
Answer: When I first got my iSi I had wildly inconsistent results, including exactly what you're describing.  I'm not sure if you're just whipping cream or if you're whipping other cream-based preparations, but the most common reason for this happening is that the liquid going in isn't quite, er, liquid.  Any solid particles of any kind will almost assuredly cause sputtering, which is why they recommend that you strain everything through a fine sieve.
Other things I've learned about the iSi whippers to help prevent these inconsistent results:

Ignore everything the instructions tell you about how to charge it.  They're somewhere between very misleading and complete nonsense.  What I actually do is this:

Screw on a charger as described.
Shake it vigorously, as if it were a cocktail shaker.
Let it rest for a moment, then shake again.  Repeat the shaking 4-5 times.
Finally, remove the charger and screw the cap back on.

The instructions are full of ominous warnings about not being able to discharge it properly if you shake it too much because the nozzle will get blocked or something.  Never happened.  What's far more likely is that the cream doesn't actually whip fully or there are large air pockets.  Do not err on the side of caution here; many "external" iSi recipes such as those you find in the HRC actually tell you to shake frequently as the dispenser chills.  I'm not sure if I'd do this with cream (as opposed to a water-based foam) but I can't stress this enough, don't skimp on the shaking.
If you need to chill it some more after charging, make sure to chill it on its side.  The instructions are quite explicit about this and in this case they're actually correct.
Shake it again after you chill it and before you dispense any.  This is very important and conspicuously absent from the instructions.  You shouldn't need to shake as much as the first pass, but some of the gas does seem to separate over time.
Start by dispensing the cream very, very slowly, until you actually see some come out, then you can apply more pressure as needed.  If you squeeze the trigger as hard as you can right off the bat, you'll just end up depressurizing the thing before any cream has a chance to come out.  Every single time I've pulled too hard, I've ended up with spatters.
Finally, make sure that you actually thoroughly clean it all between uses, including the tiny horizontal hole in the metal tube that you screw the tips onto (I forget what it's called) as well as the socket that piece goes into.  Any blockages whatsoever, no matter how small, can cause at least minor sputtering.

Hope some of that helps.  If you do all of that, you shouldn't have any sputtering issues.  Last 7 or 8 times I've used mine, I haven't had any.
Comment: @daniel: You may be thinking of the 1 L food-service whippers they sell; I myself have a 500 mL whipper and it's possible that Michael even has one of the 250 mL models (in which case there might be an entirely different problem - that of over-filling).  1.5 cups is a somewhat odd amount either way, but whether or not it's too little would depend on the size of the dispenser.
Comment: This is hands-down the best answer, and my guess is a combination of not enough shaking, and not enough liquid (1.5c in an ISI is really not very much) leading to a far too high nitrous:cream ratio.
Comment: If you're whipping cream, make sure you don't shake it so much that you make butter. Other than that, Aaronut is correct: if it sputters, shake some more.
Comment: Oh! Haha. I've only ever used the 1L size, had no idea they came smaller! Even Nikolau's only sells the 1L size.
Comment: @daniel: I had no idea that any local stores here even sold iSi products; I ordered mine online...
Comment: Nikolau's sells everything (Queen, east of Bathurst, south side). I believe Nella and Dinette also sell iSi stuff.
Comment: @daniel: Going way off topic here, but do they also sell higher-end appliances (Vitamix, Waring, etc.)?
Comment: I've never looked for them there; they focus more on restaurant supply in terms of knives, other non-mechanical stuff. But I'm willing to bet if they don't sell 'em, they know who does or will order for you.
Comment: Great answer, very helpful. My whipper is the 500ml. I used 1.5 cups because I had a pint but needed to reserve 1/2 cup for a sauce :).
Answer: Four things:
(1) You are definitely over whipping the cream. Please read the instructions -  these are tested in the iSi lab to ensure your best results.And they do give you the correct amount of shakes per the fat content of the cream. You describe what we call "choppy" cream.
(2) Hold the whipper upside down in your hands. This means that your little finger is on the lever - not your index finger. This can position is very important because you need to have the gas behind the cream when it's dispensed. this will ensure that the gas is working with gravity and going through the cream and will result in less sputtering, and a full dispensing of your cream.
(3) Make sure you are using iSi branded chargers. Not all chargers are the same, and while the less expensive chargers will fit onto the charging mechanism, it can damage the pin of your iSi whipper and will VOID your warranty. The off brand chargers will provide an inconsistent amount of gas in use, and contain a high amount of oils from manufacturing that will be injected into your foods, this can change the recipe outcome.
(4) Carefully measure your contents, and don't over fill; The head room is very important for the best use of the mixing between the cream and the n20 gas. There is a pour line indicated; make sure your liquid + solid ingredients do not exceed that level (10-x sugar and cream)
Comment: Please use capital letters, paragraph breaks, and periods where appropriate. I've copy-edited this post to make it more readable for you
Answer: I was taught how to whip cream with a handheld mixer and there are a few things to consider
Is the whipped cream being over whipped? When you beat it too hard with a handheld it starts to form ragged peaks
Is the cannister almost empty? Gas charged cannisters often 'sputter' a little bit when over-charged or almost empty.
Comment: I don't think it was over-charged; just 1 charge and 1.5 cups of cream, and it definitely wasn't almost empty. One theory I had was temperature. I had left it in the coldest part of my fridge. I moved it to a less frigid spot, so I'll see if that made a diff in the morning.
Answer: I don't suppose that it could be a little clogged and just need a cleaning in addition to the possibility of the temperature needing to change?  If you happen to have another dispenser, you could always fill and use both the same way to make sure one isn't faulty.
Answer: Whilst resolve whipped cream dispenser is important, it is more important to give the liquid time to dissolve the nitrous oxide into the fatty components. If it doesn't have time to dissolve, it will force them liquid out, bit it won't expand evenly as it leaves the nozzle.


Ebook app for Windows 8

Question: I am looking for recommendations for an ebook application that runs on Windows 8/8.1 .
Answer: You can try the good old ebook reader bundled with Calibre. It's a multiplatform software, so it's available for other systems too, not just for Windows. Besides being a great application (Calibre itself is the swiss army knife for all things related to ebooks), it's also free and open-source.
There is also EPUBReader, it's not a standalone program but a Firefox extension. Anyway I've never used it so I can't tell you much more than this.
Other available ereaders are those tied to online ebook stores, like Kindle, Kobo, Nook, and so on.
Comment: Thank you. I've been playing with Calibre as of late, and it seems very useful. I just have some slight issues with the resulting text format, but nothing that can't be resolved by messing around with it a bit more.
Answer: I like Readium, which is an extension for Google Chrome. Works best for me.
TxtR is also a good option.
Answer: I would recommend Adobe Digital Editions. It's free and will run on 8.1. It also supports EPUB 3. As long as there is no DRM, you can print from there too. It can open PDFs too.

Ebook app for Windows 8


Membase nightmare too many connections

Question: We have a group of four web apps (C#, ASP.NET, NHibernate) and a few services that used to share a Northscale instance. We've since upgraded to Membase, at which point we were actually able to start making effective use of the NHibernate second level cache. However, once we got the apps into production, the memcache service stopped listening to telnet on port 11211 and the management interface showed that it was using 9.99k connections. Judging by the traffic slamming into our database, we believe that one or more of the following steps should occur. In both cases, the server was located on a Windows 2008 server.
1) We should allow more connections to the server. This is allegedly done by calling the executable with the -c parameter. In practice, on our machine, we get an error indicating that it can't load default_engine.so when we attempt this.
2) We should decrease the pool size that our apps are using. Currently, the main web app (which has many instances that run for different clients), has a pool sized between 10 and 100 connections.
3) We need to consider whether it was an issue of network saturation. According to the management console, we had more than enough RAM. Is it possible that all the traffic overwhelmed some of the hardware at Rackspace?
Is there any other obvious source of problems that we could have overlooked?
Answer: Looks like it was an issue with the membase provider. Apparently it was creating separate clients for each entity in our app (there are a crap ton of them). Multiply that out by the number of sites we have and the trouble is easily understood. The other dev made a tweak to the code that changed the allocation strategy. Now it's running smoothly.

Membase nightmare too many connections


Is our smart contract required gas,every time it executes.

Question: form my understandings, after the first execution of a smart contract, the network will return the remaining gas to the contract sender. if so, how will the contract  obtain  gas for future execution??
Answer: A contract can only be executed because of either 1 of 2 reasons:

It receives a transaction
It is called by another contract, which, in turn, is executing also due to these 2 reasons.

Thus, for a contract (or a chain of called contracts) to execute, there must be a transaction in the network to start them. This transaction necessarily provides all gas for the whole execution, including the contract it calls directly and contracts called by it, so on and so forth. The provided gas will be forwarded around along with contract calling, so subsequently called contracts have gas for their execution.
The contract deploy transaction is essentially the same, providing gas for execution of contract initialization (in addition to writing contract's code to blockchain).
Side note: By contract call I mean the CALL, DELEGATECALL and similar EVM instructions carried out during contract execution, not the (confusingly named) call that just executes a constant/view contract function in your local friendly node.
Answer: Gas is not a currency. It is a unit of work.
Gas is calculated based on the exact operations performed during the execution of a transaction. For smart contracts, this means it is based on what code is executed.
The gas used is then multiplied against the gas price to arrive at the final fee for the transaction, which is deducted from the ether balance of the account that initiated the transaction.
After you deploy a smart contract, anyone who makes a transaction to it will be responsible for paying the transaction fees.
Answer: Yes every time whenever you pass value to blockchain. You will required a gas so that the transaction gets excuted in the blockchain.  But if you are calling the constant function (only to return the stored value) then you do not require any gas for that.
Answer: The gas needed to execute the functions in your contract is provided by the external user that initiates the transaction, not by your contract. So your contract does not need to have Ether to pay for the gas, the users of your contract are who will pay for it on each transaction.
Hope this helps


12.04 Suspend not working proper

Question: Okay I may have a strange issue. I can suspend my session and the computer will suspend as normal i.e I can press my power button and the computer will come back to my session. However, when I leave the computer for an extended amount of time it will not come out of being suspended. The computer will cold boot. I've tried looking through similar questions and can not find this exact same issue.
Answer: I suppose it depends on what you mean by "an extended amount of time".
Suspending your computer puts it in a low-power mode, but not a no-power mode. The low-power is used to keep the contents of your RAM memory intact.
On my computer I can suspend for about a day and a half. The lights on my computer are different from when the computer is on or off.
If I need to put the computer to sleep for a day or more I can use hibernate instead. It writes the contents of RAM to your swap partition (assuming you have one) and then turns the computer off completely. It takes a long time to write everything to disk and to boot and recover from disk so it might not be worth the time and effort over saving everything and shutting down. I don't do it often.
sudo pm-hibernate
will attempt to hibernate your computer.
Hibernation is harder for Linux to do on some computers so it no longer appears in the menus for 12.04, but if it works for you consistently it can be reenabled. See How to enable hibernation? for instructions.
Comment: Ahhh, okay got ya! This is my first Ubuntu/Linux install so I'm still trying to get the hang of things. I can not find a hibernate setting in Gnome3, so Ill have to do some research on how to add that to the UI. Thanks!
Comment: I suppose I should have added something about that to the answer. I've editied it to do so. I'm glad your question is answered--I think the terms are confusing.

12.04 Suspend not working proper


MFCC - Significance of number of features

Question: I have been doing some readings on the computation of Mel-Frequency Cepstral Coefficients (MFCC) and further use of Vector Quantizers (VQ) for recognition purposes. I am however stumped by the method of computation for those MFCCs regarding the number of suggested frequency bands. For example, why is the recommended number of mel filterbank filters 20 -40? Why do we eventually end up with 13 coefficients and not 40 as will have been found from the 40 log energies we shall calculate?
Comment: a simple look at wiki page reveals that MFCC (the Mel-Frequency Cepstral Coefficients) are computed based on (logarithmically distributed) human auditory bands, instead of a linear so as an inital expectation there are about 10 full octaves from 30 hz to 16 khz (or 11 if you begin from 20Hz to go up 20Khz) and even further if you prefer processing 1/3 octaves, you would then have around 30-40 logaritmically distributed bands. https://en.wikipedia.org/wiki/Mel-frequency_cepstrum
Comment: Also a finer look at Mel Scale reveals that it may treat the frequency bands as linear below 1kHz and logarithmic above that, which would further change the number of bands. The specific number should, therefore, be derived based on the choosen method unless otherwise stated.
Comment: @Fat32 Thank you for the simple explanation on that. What about eventually ending up with 13 Mel-Frequency Cepstral Coefficients? What warrants dropping the other 27 coefficients if 40 coefficients were calculated?
Comment: Sorry but I may not provide any further explanation based on the conditions.
Answer: Number of filter banks
One of the last steps in the MFCC's calculation is measuring the energy in the filter banks. We do that because want to reduce the dimensionality of our input vector (amplitude spectrum), as well as capture its envelope. Those triangular filters are spaced over the Mel scale:

This means that we have very good resolution in low frequencies. Exactly opposite is true for higher frequencies. We do that because MFCC's are suited for speech-related tasks and most of the information is located in lower frequencies (i.e. formants).
So how many filter banks do we actually want? For example HTK by default is using 20 filter banks. You might increase that number, especially if you are dealing with signals that contain a lot of closely spaced frequencies and you want to resolve them between each other. It's totally up to you - in the end what really matters is the classification performance.
Number of coefficients
After taking the logarithm of energies in each filter bank, the last step (or second last if you are doing some liftering) is to calculate the Mel Frequency Cepstral Coefficients. We do that by fitting the cosines to calculated log energies using the DCT. This captures the periodicity in the reduced spectrum. Figure below should help you in understanding that process. You can imagine that for number of coefficients equal to number of filter banks this would correspond to capturing the alternating energy between each of the filter banks.

So how many MFCC's do we want to calculate? HTK by default uses 12 and in most applications it is more than enough. In general we don't want too many coefficients because:

It's all about reducing the dimensionality of our feature space.
One DCT properties is that it de-correlates and keeps most of the information in first few coefficients.

Again it all depends on your application and you should adjust this number based on the recognition performance. From my experience the gain from increasing the number of MFCC's was negligible compared to introducing the $\Delta$ and $\Delta\Delta$ coefficients.
Comment: Thankyou for this detailed answer. What I am getting is that at around the twelfth coefficient, is when the periodicity in the spectrum is sufficient enough to be used?
Comment: Yes, sometimes it is necessary to use higher MFCC's, especially when we know the nature of our signal. In some of my applications the upper MFCC's were the most important ones as opposed to the lower ones.
Answer: A great answer is given above, but to specifically respond to why 12 MFCC per frame. Usually, when you are doing automatic speech recognition, you do not care about the pitch information of the signal, that is, the information of the vocal cords. Rather, you are more interested in the phoneme-related information or the information due to the shape of the vocal tract that creates the sounds.
Pitch value usually has a low period and when you move to the cepstrum domain (using DCT or IDFT) that is captured in the mid to end values. This is why most applications only chose the first 12 or 13 MFCCs so as to not include the pitch information. If you are building a system where the pitch information is important, you should increase the number of MFCCs (maybe you want to perform speaker identification)


How often does the moon "set" for us compared to the sun?

Question: I am working on a game, and I have a day/night cycle. Currently I have the sun. Currently every "sun day" is 24 hours, with that being said, how long is every "moon day"? In other words, how much does the moon lag behind the sun. I just need to figure out what the moons speed should be in relativity to the sun. I've done some searches, but wasn't quite sure how to properly word this question.
Comment: the sun and the moon are essentially static... it's the Earth that rotates in 24 hours.  The moon falls behind by about 50 minutes every day.
Comment: @farrenthorpe My point is that a solar day does not correspond to a single rotation of the Earth, but that it is a single rotation of the Earth /plus/ a fraction of the Earth rotation around the Sun.  This is quite relevant for astronomical questions such as this one, as it causes the length of a solar day to vary during the year, which makes the answer to Jaydens question more involved.  I'm not sure if a rotation on an axis is a relative or an absolute quantity.
Comment: @farrenthorpe The Earth rotates in 23 h 56 m 4.1 s.
Comment: @gerrit yes with respect to the stars, not with respect to the sun.  Not sure  what your point is here other than to prove you know decimal places?
Comment: Technically this is probably a question for astronomy.se, but we should be able to provide an answer here... The Google terms for the comment conversation above are "solar day" vs "sidereal day". The "moon day", as you put it is a little less straightforward. I'll try to put an answer together when near a PC later.
Comment: gerrit perhaps re-read the question... he is not asking about the spin rotation of the Earth... he is asking about the relative time between our day (which is 24 hours, not 23h 56 m) and the moon position.
Answer: As noted in comments, the earth rotates on its axis in about 23hrs 56 minutes. This is known as the sidereal day, that is, the day with respect to background stars. (that's not quite true, but it's good enough unless you're dealing with periods of thousands of years with high accuracy - see the linked wiki article if you care about the detail).
At the same time, the Earth is also orbiting around the Sun in the same direction, and the combination of the Earth's spin and its orbit around the Sun gives us the 24-hour solar day that we are familiar with, and that you have already modelled in your game.
Now consider how the Moon rises and sets, when seen from a position on Earth. The primary cause of this is, again, the Earth's rotation with it's just-less-than-24-hours period. In addition, this time, one must consider the motion of the Moon around the Earth, which is again in the same direction as the Earth's spin. This results in a period of about 24 hr 50 mins for the apparent motion of the Moon across the sky (Source). For your game that may be sufficient info, although if you want to be accurate it is complicated.
Remember to also take account of the phases of the moon - because the whole earth-moon system is also in orbit around the sun, and because the moon is only visible via reflected light, the mere fact that the moon is above the horizon when seen from a given point on earth does not mean that it is visible.
Comment: Nice VSauce episode about the moon terminator: https://www.youtube.com/watch?v=Y2gTSjoEExc
Comment: Thank-you, that is what I was looking for was the 50 minute delay, I've got my system all working with moon & sun now. And moon phases are working as well, although I can't have lunar eclipses because my game world is not a globe.


In a turbofan what holds the spinning axis?

Question: When the turbofan is spinning inside the housing, what holds the axis? All I know is that the axis holds the fan blades.
Answer: Stationary frames
The supporting structures of a turbofan are two stationary frames with their characteristic struts, located at the ends of the engine core: One is behind the OGV stator of the fan module, the other at the aft end of the turbine module:

CFM56 with the two frames visible (source)
Stationary frames to spinning shafts
In the case of an engine with two spools, the frames support the longest shaft (N1, low pressure), which in turn supports the coaxial N2 shaft (high pressure).

Shafts are centered within frames by bearings (drawn in magenta in the next picture).
Shaft to rotors
Disks of rotors on a spool are bolted together to form a continuous structure fixed to the related shaft. The structure is used as the inner wall for the related air duct:

Frames, shafts, bearings. Adapted from CFM56-7B Familiarization Manual
A view of the N1 shaft and the two frames, before adding the bearings and their oil sumps. The fan shaft (darker / trumpet-shaped) is fixed to the N1 shaft using grooves and can be considered part of the N1 shaft:

LP shaft, fan frame and turbine frame of a CFM56-7B
The bearings and the oil sumps are added to center the N1 shaft (blue tubes are used to pressurize air-oil seals of the fan sump). The clevises used to hang the engine under the pylon strut are (barely) visible on the top of the rear frame (see this question for details):

LP shaft, fan frame, turbine frame, bearings and sumps of a CFM56-7B
Another CG view which additional elements:

The fan disk bolted on the N1 shaft (actually fan shaft).

The fan cone and spinner bolted on the fan disk.

The two extremities of the N2 shaft coaxial to the N1 shaft.

Shafts of the CFM56-7B
The HP/N2 shaft (shown in red above) is centered on the LP/N1 shaft by bearings. All rotors of the HP spool form a single structure bolted to the HP shaft (shown in light blue below):

HP rotors of CFM56-7B. Adapted from CFM56-7B Familiarization Manual
Frames to core stators
Similarly, outer shrouds of stators and intermediate rings of a spool are bolted together to form continuous structures.
Four stationary structures are built:

The LP compressor (booster) stators assembly is fixed to the mid-box of the fan frame (on the fan side).
The HP compressor stators assembly is fixed to the mid-box of the fan frame (on the other side).
The combustion chamber is fixed to the HP compressor assembly.
The turbine stators assembly is fixed to the combustion chamber on one end and to the rear frame on the other end.

Overall CG view with some components highlighted:

CFM56-7B cutaway. Original CG model by vhfine3d, at DeviantArt
From frames to wing strut
The engine is supported by a pylon, which is supported by the wing. There are only two mount points connected to the pylon, located on the fan and rear frames. Thrust is usually transferred to the wing using the forward mount point.
If it is not practical to transmit the thrust from the forward mount, e.g. because space is lacking to build a strong mount, then thrust links are used to transfer thrust to the aft mount which transmits it to the pylon:

Sources: left, right
Other components
There are a few other components to support.

The air inlet is fixed on the fan case.

The fan case (which role is to create a duct for the fan and contain any broken fan blade piece) is fixed on the fan frame.

The nacelle, that is the fan cowls and the thrust reversers ducts, including the reversers, is fixed directly to the pylon. The nacelle is not really part of the engine.

The exhaust nozzle and cone are fixed to the turbine frame.

To sum up
Engine component are kept together using two frames.

Rotors are fixed to shafts, which are maintained within the frames by bearings.
Stationary components (fan case, stators, combustion chamber, etc) are bolted together and fixed the directly to the frames.
Comment: Nicely done! With some continued maintenance, we can probably start pointing most new jet engine questions at this answer and be done with it!  _It's not **that** complete, but it's close!_
Answer: Struts. Lots of them, and with an aerodynamic shape so they don't cause too much drag. Some of those struts double as stator vanes and reduce the swirl of the internal flow. By doing this they add a little thrust. Others house the driveshafts by which rotational energy is taken from the shaft to spin pumps and generators.
Maybe it helps to watch this YouTube video. I pasted a screen shot from it below:

Jet engine cutaway. The bright orange shows where the structure has been cut. In the grey gaps you see plenty of vanes and struts: They hold the shaft bearings in place.
On multi-spool engines the outer spool is held in place by the struts and has internal bearings to keep the inner spool in place. Since the outer, high-pressure spool is shorter, the inner, low-pressure spool emerges from the outer spool at both ends.
This drawing from a patent shows moveable stator vanes. They are arranged like spokes on a wheel. Each disk of stators is placed between two rotor disks.

Stator vanes (26 and 28) held moveably in place by bolts (32 and 44) and interspersed with rotor vanes (24). A lever (38) on each vane is moved by an actuator ring (36) and adjusts the incidence of the stator vanes.
Comment: I did read the answer, but did you read the question? I was just trying to be helpful by explaining the reason for my downvote. Of course i see that the stators don't hold the shaft. That's exactly why i'm complaining that this isn't a good answer. I don't see why you even mention them at all, let alone making them half the space of your answer. Just adds confusion for nothing imho.
Comment: The movable stators don't seem to be connected (via bearings) to the shafts at all, so they don't hold anything. This doesn't answer the question.
Comment: @Scrontch Why didn't you read the answer? Of course don't the movable stators hold the shaft - how would you think they do?
Answer: I'm assuming you're asking about the shaft support. In that case, the engine shaft is supported on the engine casing using bearings (the type of which may vary).
Comment: Yup, the spool is held in place by a number of bearings.
Answer: I Believe the 1st picture don't show the turbine frame, but the fan frame (By the way, i'm not sure if Turbine Frame can have use of the VBV System), after some research I believe that CF6 and CFM56 have the exact same model of Fan Frame, probably they shares some other parts too... And maybe some others GE motors get shared others same parts
Comment: Antoine, corrected! Thanks.


When looking for students to work on a research project: contact good students directly or contact all class then select the good ones?

Question: When teaching an undergraduate or graduate course and knowing about some good students, what would be the best approach in inviting them to join a research project? Contacting them directly, or send an email to all students and then select the "good students" that are also interested?
Answer: At my institution the selection was two-fold. The professor usually has an open invitation for all students to apply for their lab, but chosen students were known to be approached to raise their interest. This was always done carefully as to don't imply any precedence between students, but not secretly, and almost always orally (not by email or similar). For example, at the project oral defense, the instructor would suggest to the best students to consider applying for their lab.
At least all of my instructors were careful not to "flatter" the students, but only to raise their interest. There is little sense to have a, no matter how brilliant, student working on a project, if they are not interested in the subject.
Comment: @Mindwin I read that sentence as using singular _their_ as a gender-neutral reference to the professor (i.e., _his or her_).
Comment: I agree with you, but some good students may not understand the project well or may not realize their capabilities, so maybe it is the faculty job to invite them directly? Not sure though.
Comment: Of course, all I wanted to imply is that the faculty I know avoided praising the student to get them to work on the project, but rather by emphasizing the subject of the project to gauge whether the student's interests match. Then leave it to the student to think about it and possibly inquire further and/or apply, if interested. That's what I meant by "raising the interest".
Comment: @JeffreyBosboom I stand corrected.
Answer: As an undergrad, I was both approached directly by a prof and responded directly to a job advertisement that a prof posted on a bulletin board near the entrance to our building. Both led to great research experiences for me and no apparent sour grapes or other complaints when my peers found out about my research opportunity. I have also seen a professor simply advertise during class that they had some opportunities available and that those who were interested could see them after class during office hours.
Answer: It would be better if you could contact whole class and then select the students who might not only be good, but also very much interested in doing the research. If you think that, someone is good and haven't approached you, you may just ask him/her about it.
Also, there's a possibility that you might not know all the students very well, so if you plan to select only the students whom you think who are already good, there's a chance that you might miss out someone who might be better and also more interested.
So, I would say to ask the whole group and then decide, depending on the response.


Is it wise to log failed login attempts of non-existing accounts?

Question: In terms of application layer authentication, it is common to track failed login attempts to existing user accounts. However, I have not seen anyone tracking failed login attempts of non-existing user accounts (meaning those that cannot be identified using public identifier, e.g. email).
Comment: To better clarify and understand the problem, I would ask you at first: _If so, which attributes would you track on non-existent account login attempt?_
Comment: Just to be clear, I am aiming to identify a malicious host activity, rather than user trying to desperately remember his forgotten username/password. If I see same user (based on IP) to attempt 100 different username, I will ban it (for a duration of time, such as 5 minutes). If I see same IP attempting 100 different passwords against same username, I will ban it, and vice-versa, if I see same password attempted against 100 different usernames, I will ban those IPs.
Comment: Well, I was thinking to include this as part of the question, though didn't want to make it too broad. My research shows that storing password in plain text wouldn't be wise for this case. However, I would still include username. I was also thinking about storing simple password hash, that would allow me to tell whether user is retrying the same silly password over and over again OR there are thousands of different login attempts.
Comment: Therefore, what would you do if you notice in your logs statistically significant pairs of unsuccessful attempts with _1) same username, various passwords_ and _2) same username, same password_. This breakdown can go on, as you apply another metrics of identifying the source.
Answer: One drawback to logging failed user attempts is that some users type their password into the username field and press submit.   Sounds silly but it has happened enough times to be a concern.
This can happen with typing too quick, a password manager, or some other automated means.
Comment: I agree. There are some other questions that relate to this as well. I am in favor of a two page logon to reduce this.
Comment: @EricG by two page do you mean one page for username, a second for password?  Is the username validated (I assume not)..?
Comment: You only have one input box on the first page, no search, nothing else, just an  for the username. You may wish to use cookies, etc. to remember this for the user. The user is trained to only enter either the username or password per page. Since they know they have to clear the username page first, they are less likely to type the password in the username box; therefore, this may help to reduce the risk of logging a password in a place where the username is expected.
Comment: Here is the original answer where I discussed this in more detail: http://security.stackexchange.com/questions/32003/passwords-being-sent-in-clear-text-due-to-users-mistake-in-typing-it-in-the-use/32026#32026
Answer: You are looking at different types of attacks. Logging failed attempts for known users is an attack against a specific user. By definition, a failed login attempt against a non-existent user will always fail since there is no password to match. This could show attempts to enumerate users or it may show attempts to profile an application.
From some of your follows ups above, it seems you want to log each entry but are concerned that the logs could lead to security concerns. For example, if a real users mistypes their id, and puts in the real password, this could lead to targeted attempts using variations of the username (attempting to use the incorrect username to reach the real username) with the typed password or variations.
I would recommend logging the IP and usernames to perform heuristics and to create blocking rules (stop brute forcing from an IP by blocking the IP for some period of time or requiring a CAPTCHA, etc.). Usernames combined with passwords may be helpful in identifying the methodology of the attacker (e.g., they think you are using application backend A which has default username X and default password Y). However, generally, you want to take action to block the attack and identify the source. There is greater risk in recording the passwords, even if hashed, than the value you might get from analyzing these passwords or hashes, since knowing the passwords isn't a good key to block future attacks, since any given password may be valid for another user.


What are the reasons for president Walker's decision?

Question: Im not well-versed in political affairs (I like House of Cards because of other aspects). So I didn't understand very well why president Walker had to resign. Can anyone explain this to me in "dummy language" :)?
Answer: It has been some time since I finished the second season now, but I will try to go on what I remember:
There were several reason why Walker was in a difficult position and why his opinion ratings were dropping quickly.

Walker (supposedly) led the country into a growing conflict with China, which possibly could have been avoided. This also led to an energy crisis in the US with raising energy prices. All this was not exactly helping his reputation. Of course, Frank orchestrated all of this behind the curtains.
On top of all that, there was a major investigation going on about illegal donations for his party over the past years. This was bad press and Walker had to cut ties with his biggest ally, Tusk, because of this.
Walker and his wife had marital problems. Frank and Claire convinced them that they should seek counseling, which they did. When it finally got uncovered, it was also unveiled that the therapist gave Walker drugs with psychological effects. This was a huge scandal, because it now was suggested that Walker's judgement was impaired. Especially with the current crisis going on, this meant a huge lost of trust for him.
In consequence, his polls were dropping rapidly and it seemed clear that he had lost a lot of public faith. This was a serious threat for the next elections and could have cost his party the win over the Republicans.

In the end, Walker was isolated, without political allies or public support. Because of the allegations against him, he would probably have faced an impeachment trial and might have lost the office anyway. Resigning was the logical consequence for him.
Comment: @JeanPaulOlvera - Jackie did two things: 1) She *whipped* enough votes in the House to impeach Walker. 2) She cornered Remy into helping them bait Tusk into confessing, which put President Walker in a very tough position.
Comment: Tbh I don't remember that part too well, but as I recall Frank made her Whip (which is basically the person that ensures that all party members play along with the party line) so that he was able to enforce radical decision in the Congress. This radical decision probably would have been to push Walker out of his office through an impeachment trial if he hadn't resigned on his own.
Comment: And what was the role of Jackie Sharp in this plan?
Answer: Because Frank Underwood, after being completely exposed as a ruthless sociopath by Walker himself in the damn oval-office, wrote a letter to the President on an old type-writer. That's seriously it. There's is no cohesive connection in FU's ridiculous plan that actually "closes the deal" and puts him in the White House. So, during a montage where Frank writes the letter, all of the characters (including the previously-perceptive Walker) spontaneously decide to become ass-hats and hand over the Presidency to a murderer with no plausible explanation. Stupid show, watch the British version if you can ignore the 90s-fuzziness, it requires the audience to suspend their disbelief much less often than this long-winded, bizarre US off-shoot.
Comment: You might think that, I couldn't possibly comment.


What happens if I develop a software and provide it as an online service and someone else patents it?

Question: Suppose that I am providing a SaaS on the web. What happens if someone (after working with my service and getting familiar with it), develops the software (and ideas used in it) and patents it?
Answer: If the PTO examiner does not find your website while doing their prior art search, your competitor might still be able to get the patent and even sue other companies with it. I'm assuming that if they are dishonest enough to steal your idea and apply for a patent for it, they will be very happy to sue companies left and right. It takes a few years for a patent to issue.
At that time if you get sued you will have the option of trying to invalidate his patent by claiming your website was prior art. However, it may be a tedious and costly process and since it will be in like 5 years you will have to prove your website was here before he applied for the patent. Also, if for some reason you are out of business in 5 years, a lot of companies will be unfairly sued. It's good to have dated public records detailing your invention.
My thoughts on this are that if you think your invention is patentable, you should try to patent it. If you want no one else to patent it, you can also file for the patent and then abandon the application once it's been published since that is the strongest and easiest to find prior art. The latter case acts like a defensive publication to prevent people from patenting the idea. Or you could try and get the patent yourself, then only use it as to counter-sue.
Anyway I'm not a lawyer so you'll probably get better advice from the actual practitioners on here.
Comment: Thanks. Could you please elaborate more on how to have a " dated public records detailing my invention"? Is an interview with a populate tech blog enough?
Comment: It helps of course - if you're in tech (as I am), having articles in techcrunch, engadget, or even a simple prweb release can be somewhat helpful in proving you were there first. However, those articles must describe your invention really well. Also, a USPTO examiner will rarely (IMO) look at any of that during the patent prosecution, and you will only be able to use it to protect yourself if you are sued with your own invention. However, I have seen USPTO look at the "wayback machine" for prior art. My advice is that if you don't want to apply for a patent (which I still think may be the best
Comment: thing to do, get your name out there everywhere and make sure that in 5 years people will be able to look up whatever your SaaS does, they'll find dates publications about your website as well as good "enabling" explanations of what it does. Here is a similar question that helped me a while ago: http://patents.stackexchange.com/questions/83/how-to-make-an-invention-un-patentable-easily


Is there a historical connection between Buddhism and martial arts?

Question: Are kung fu monks and all related Hollywood stereotypes based on any actual historical connection between Buddhism and martial arts? Or is it just a fun movie concept? :)
Answer: There is a legend that Bodhidharma instructed the monks at the Shaolin Monastery in ways to increase their physical fitness. These exercises later became the Shaolon kung fu.  As one of the documents involved seems to be a forgery, scholars now doubt this connection.
Also see here and here.
Additionally the concept of Do has influenced many japanese martial arts, changing the craft (-jutsu) of fighting to a way (-do) of fighting (e.g. karate-do, ken-do)
Answer: This is just one more good example on how Buddhism mixed with local culture, Buddhism began in India and spread through Asia, in many countries it incorporated local practices and believes just like all main religions have done, things like Martial arts, Astrology, Tantra, etc were local additions, I'm not saying this is right or wrong, good or bad, but it didn't come from the original teachings and practices.
Answer: I heard many of my relatives tell me this(I am a Indian BTW, so I assume what my relatives tell me has some degree of truth to it cause some of their ancestors might have known the correct answer to this and they passed down their wisdom to these folks) that Buddhist roam around all over the world to preach Buddhism and as required by their travel used to go to all the dangerous places where there is a high probability of them getting mugged !
So things like karate, kung fu came into being as a self-defense techniques !!
If you think about it, these Buddhists used to frequent the silk route to spread Buddhism which was also frequented by traders carrying insanely precious goods and hence attracted most muggers ! Given the fact that Buddhism just came into being during that time, these muggers couldn't tell a monk from a trader so its not tough to imagine these monks getting attacked frequently by them hoping to find silk, spices, gold or something precious ! So these monks must have invented Kung fu and Karate as a self defence technique which gradually became more than that ...
Comment: In the contrary spirit, there is a sutra in the palicanon, where the buddha talks to some monk who wants to go to spread the dharma, and the buddha asks: are you also prepared to bear all physical pain they will possibly do to you? And are you prepared *not* to go into conflict with them but to stay compassionate and calmly?
Comment: that's some very interesting hearsay. i hope it can be sourced.
Answer: A short answer is NO. In the history of Buddhist foundations, there is nothing to do with martial arts.
By the way, these kind of monks in China are real. They have adapted and created their own way to train their minds (and bodies) by applying some "part" of Buddhist philosophy.
Comment: Maybe not going all the way back to the Buddha himself, but there certainly are historical associations between Buddhism and martial arts that predate Hollywood.


Was Bishop Berkeley part of the Enlightenment and if so - how did it fit his adherence to religion?

Question: In his The Analyst Berkeley argued, among other things, that mathematicians must not "submit to Authority, take things upon Trust" and so expressed a view of the Enlightenment. This made me think: if Berkeley adhered to the Enlightenment how could he explain his and others' adherence to religion? Do not religious people necessarily submit to Authority (in the shape of God)? Did Berkeley explain how Enlightenment's themes such as not submitting to Authority might align with religion?
Answer: The OP quote is from Query 64 of Berkeley's Analyst (1734):

"Whether Mathematicians, who are so delicate in religious Points, are strictly
  scrupulous  in  their  own  Science?  Whether  they  do  not  submit  to  Authority, take things upon Trust, and believe Points inconceivable?  Whether they have not their Mysteries, and what is more, their Repugnancies and Contradictions?"

In other words, Berkeley has no problem with deference to authority per se but with mathematicians misrepresenting what they are doing as "Reason and Science" while indulging in shady concepts and invalid arguments. He claims that mathematicians fail by their own standard, which he need not accept to make the objections. Indeed, in earlier passages he is explicit about the hypocrisy of accepting the "magic" of early calculus while criticizing religion for obscurity, the pretense of giving demonstrations while using infinitesimals that do and do not vanish depending on the part of the calculation, and the ex post facto justifications offered for the results.

"All  these  Points,  I  say,  are  supposed  and  believed  by  certain  rigorous  Exactors of  Evidence  in  Religion,  Men  who  pretend  to  believe  no  further  than  they  can  see.   That Men, who have been conversant only about clear Points, should with difficulty admit obscure ones  might  not  seem  altogether  unaccountable. But  he  who  can  digest  a  second  or  third
  Fluxion, a second or third Difference, need not, methinks, be squeamish about any Point in Divinity... But with what appearance of Reason shall any Man presume to say, that Mysteries may not be Objects of Faith, at the same time that he himself admits such obscure Mysteries to be the Object of Science?
[...] I  say  that  in  every  other  Science  Men prove their Conclusions by their Principles, and not their Principles by the Conclusions. But if in yours you should allow your selves this unnatural way of proceeding, the Consequence would be that you must take up with Induction, and bid adieu to Demonstration. And if you submit to this, your Authority will no longer lead the way in Points of Reason and Science."

In other words, Berkeley need not accept the Enlightenment's challenge to the Faith, his point is that one of Enlightenment's darlings, the creator of calculus and mathematical mechanics, engages in obscurities that require no less faith than the Holy Trinity. Berekeley's criticism was accepted by mathematicians, even by Newtonians, who (Maclaurin's Treatise on Fluxions of 1742, D'Alembert, later Cauchy) developed more coherent expositions of the calculus methods in response.
But, Berkeley aside, Enlightenment included plenty of religious figures, and the challenge to the authority of the Catholic Church could go hand in hand with devout Christianity, especially of the Protestant sort. Berkeley himself was an Anglican bishop. Reformation emphasized one's personal relationship with God as opposed to the one filtered through the authority of the priests, to a degree this was even accepted by some Catholics, like Jesuits. Berkeley opposed Enlightenment's deism, which rejected miracles and revelation, but even Newton himself sought to reconcile science and faith, and Locke, Berkeley's philosophical inspiration, proceeded to do just that in On the Reasonableness of Christianity (1695), see SEP's Religion and the Enlightenment:

"Though the Enlightenment is sometimes represented as the enemy of religion, it is more accurate to see it as critically directed against various (arguably contingent) features of religion, such as superstition, enthusiasm, fanaticism and supernaturalism. Indeed the effort to discern and advocate for a religion purified of such features – a "rational" or "natural" religion – is more typical of the Enlightenment than opposition to religion as such. Even Voltaire, who is perhaps the most persistent, powerful, vocal Enlightenment critic of religion, directs his polemic mostly against the Catholic Church in France... not to religion as such.
[...] Alongside the rise of the new science, the rise of Protestantism in western Christianity also plays an important role in generating the Enlightenment. The original Protestants assert a sort of individual liberty with respect to questions of faith against the paternalistic authority of the Church. The "liberty of conscience", so important to Enlightenment thinkers in general, and asserted against all manner of paternalistic authorities (including Protestant), descends from this Protestant assertion."
Comment: What a great answer. The final quote seems desperately important. It would be wonderful if people took more trouble to distinguish between religion as a whole and the Roman churches' version as just one example. It seems to me there's more sense on this forum than in many academic journals. .  .
Answer: Bishop Berkeley didn't adhere to the Enlightment; he was a Christian, and:

From his earliest days as a writer, Berkeley had taken up his pen to attack what were then called free-thinkers (secularists, skeptics, agnostics, and atheists—in short, anyone who doubted or questioned the local Christian religion or called for a diminution of religion in public life).

and

One of the archetypes Berkeley addressed was the rational scientist, who discarded local Christian dogmas as obstructing superstitions, and declared his confidence in the power of human reason and science. Seeing this rational attitude as a threat to the Church, Berkeley, a Christian priest, mounted an attack in defense of the Christian dogmas.

This figure of the rational being is a typical enlightment trope. So in this sense he wasn't a typical Enlightment figure. Nevertheless, its not true to say that there is no figure of authority for the secularist, the free-thinker and the agnostic - they set up reason as the object of worship.
I think that there may have been a typo in the quote: He'd instead

questioned whether mathematicians "submit to Authority, take things upon Trust" just as followers of religious tenets did.
Answer: Good question.
SUV is a car but we call it SUV assuming that is a car.
Enlightenment is a religion but we call it Enlightenment assuming that religion is detached from Enlightenment.
It seems it is not possible for our little brains to split religion AND something such as science, capitalism, communism, clubism, statism, enlightenment and so for... things emerge from other things...
As Max Planck put it "For religion, God is at the beginning; for science, God is at the end." See more, for example, in God Is a Person Reflections of Two Nobel Laureates. Religion is embedded everywhere. ☺
It seems to me The Analyst, by George Berkeley, 1734 was a superior exercise to make sense of things which worried him then. It was so good that even today we revisit it.
Read, please, the text of the image the way it is presented and then read it replacing "I" by "Religion" ☺


Adding external library into Qt Creator project

Question: How can I add external library into a project built by Qt Creator RC1 (version 0.9.2)? For example, the win32 function EnumProcesses() requires Psapi.lib to be added in the project to build.
Answer: The proper way to do this is like this:
LIBS += -L/path/to -lpsapi

This way it will work on all platforms supported by Qt. The idea is that you have to separate the directory from the library name (without the extension and without any 'lib' prefix). Of course, if you are including a Windows specific lib, this really doesn't matter.
In case you want to store your lib files in the project directory, you can reference them with the $$_PRO_FILE_PWD_ variable, e.g.:
LIBS += -L"$$_PRO_FILE_PWD_/3rdparty/libs/" -lpsapi

Comment: Is it possible to specify an environment variable as a library path? I'm asking because writing hardcoded path names into the .pro file would break things if a project is developed by multiple people who may not have all the libraries installed in the same locations.
Comment: I don't think you need to specify a path for a built-in Windows library.  Our .pro files have lines like this in the win32 section: `LIBS += -lGdi32`.
Comment: As @DanKorn noted, for built-in Windows libraries you don't need to (and shouldn't) specify a path.
Comment: This did work for me, but when I generate a vs project with `qmake -tp vc`, I find no libs names in `Additional Dependencies` of the project, but the vs project do run well. Does that mean there is some other methods to add `Additional Dependencies` in vs?
Comment: Why can't they just make a GUI to add a library smh.
Comment: Is -L required ?? LIBS += $$PWD/simulation/... works for me in QT @ MSYS2
Answer: Are you using qmake projects? If so, you can add an external library using the LIBS variable. E.g:
win32:LIBS += path/to/Psapi.lib

Comment: Sorry for lame question, but should psapi library be already prebuilt or QtCreator will take care of building it ?
Answer:
LIBS += C:\Program Files\OpenCV\lib

won't work because you're using white-spaces in Program Files. In this case you have to add quotes, so the result will look like this: LIBS += "C:\Program Files\OpenCV\lib".
I recommend placing libraries in non white-space locations ;-)
Comment: The newest versions of Qt (Creator) always want (single) forward slashes as directory separator. The only exception is when you use the "system" command under Windows. Then you need to feed the system an escaped backward slash, that is to say two backward slashes. To replace all forward slashes with two backward slashes can be done as follows: `WINDIR = $$DIR` , `WINDIR ~=s,/,\\,g`
Answer: The error you mean is due to missing additional include path.
Try adding it with:
INCLUDEPATH += C:\path\to\include\files\
Hope it works.
Regards.
Answer: And to add multiple library files you can write as below:

INCLUDEPATH *= E:/DebugLibrary/VTK E:/DebugLibrary/VTK/Common
  E:/DebugLibrary/VTK/Filtering E:/DebugLibrary/VTK/GenericFiltering
  E:/DebugLibrary/VTK/Graphics E:/DebugLibrary/VTK/GUISupport/Qt
  E:/DebugLibrary/VTK/Hybrid E:/DebugLibrary/VTK/Imaging
  E:/DebugLibrary/VTK/IO E:/DebugLibrary/VTK/Parallel
  E:/DebugLibrary/VTK/Rendering E:/DebugLibrary/VTK/Utilities
  E:/DebugLibrary/VTK/VolumeRendering E:/DebugLibrary/VTK/Widgets
  E:/DebugLibrary/VTK/Wrapping
LIBS    *= -LE:/DebugLibrary/VTKBin/bin/release -lvtkCommon -lvtksys
  -lQVTK -lvtkWidgets -lvtkRendering -lvtkGraphics -lvtkImaging -lvtkIO -lvtkFiltering -lvtkDICOMParser -lvtkpng -lvtktiff -lvtkzlib -lvtkjpeg -lvtkexpat -lvtkNetCDF  -lvtkexoIIc -lvtkftgl -lvtkfreetype -lvtkHybrid -lvtkVolumeRendering -lQVTKWidgetPlugin -lvtkGenericFiltering
Answer: If you want to deploy your application on machines of customers, rather than using your application only yourself, we find that the LIBS+= -Lxxx -lyyy method can lead to confusion if not problems.
We develop applications for Linux, Mac and Windows using Qt. We ship complete, stand-alone applications. So all non-system libraries should be included in the deployment package. We want our customers to be able to run the application from the same USB stick for all OSs. For reasons of platform compatibility the USB stick must then be formatted as FAT32, which does not support (Linux) symlinks.
We found the LIBS+= -Lxxx -lyyy idiom too much of a black box:

We do not exactly know what the filepath is of the (static or dynamic) library that has been found by the linker. This is inconvenient. Our Mac linker regularly found libs different from the ones we thought that should be used. This happened several times with OpenSSL libraries where the Mac linker found and used its own - older, incompatible - OpenSSL version rather than our requested version.
We cannot afford that the linker uses symlinks to libraries as this would break the deployment package.
We want to see from the name of the library whether we link a static or a dynamic library.

So for our particular case we use only absolute filepaths and check whether they exist. We remove all symlinks.
First we find out what operating system we are using and put this in the CONFIG variable. And, for instance for Linux 64bit, then:
linux64 {
    LIBSSL= $$OPENSSLPATH/linux64/lib/libssl.a
    !exists($$LIBSSL): error ("Not existing $$LIBSSL")
    LIBS+= $$LIBSSL
    LIBCRYPTO= $$OPENSSLPATH/linux64/lib/libcrypto.a
    !exists($$LIBCRYPTO): error ("Not existing $$LIBCRYPTO")
    LIBS+= $$LIBCRYPTO
}

All the dependencies can be copied into deployment package as we know their filepaths.
Answer: I would like to add for the sake of completeness that you can also add just the LIBRARY PATH where it will look for a dependent library (which may not be directly referenced in your code but a library you use may need it).
For comparison, this would correspond to what LIBPATH environment does but its kind of obscure in Qt Creator and not well documented.
The way i came around this is following:
LIBS += -L"$$_PRO_FILE_PWD_/Path_to_Psapi_lib/"

Essentially if you don't provide the actual library name, it adds the path to where it will search dependent libraries. The difference in syntax is small but this is very useful to supply just the PATH where to look for dependent libraries. It sometime is just a pain to supply each path individual library where you know they are all in certain folder and Qt Creator will pick them up.
Answer: in .pro : LIBS += Ole32.lib OleAut32.lib Psapi.lib advapi32.lib
in .h/.cpp: #pragma comment(lib,"user32.lib")
#pragma comment(lib,"psapi.lib")


Deploying OSX-Bootcamp-Windows 7

Question: I have to deploy 5 OSX Macs with dual booting via Bootcamp into Windows 7.
What's the most efficient way to do this?
Many thanks
Answer: I recently did exactly this on 20 OSX systems. I just created a custom image, ran sysprep, captured the image with ImageX and then booted each Mac into the PE to apply the image with ImageX. It worked great! We tried to use Deploy Studio but it made a mess of the partition and left me with an unusable Win7 install. I'm curious to see if anyone has a better solution though, as I'm always up for improving efficiency!
Answer: To be honest, the most efficient way to do it for only 5 machines is to just do it manually.  Any automated deployment solution is going to take longer to setup and maintain than just managing the machines on an individual basis.
In my environment we manage about 1200 machines of which about 300 are a mix of MacBooks and iMacs.  All the Apple hardware dual boot MacOS 10.6 and Windows 7 x64.  The MacOS deployment is done via Casper and the Windows deployment is done via MDT 2010.  It definitely took some effort to get the two products to work together well enough to deploy both OSes properly.  Ultimately, the Macs pull down their image from Casper via netboot which also takes care of partitioning the drive in preparation for Windows.  Then the operators are instructed to insert a bootable CD that MDT creates which takes over doing the Windows installation.  There's some custom scripting at the end of the MDT task sequence that uses the Windows BootCamp software to set the boot drive back to the MacOS partition.  Users choose which OS to run using BootPicker.
Answer: I would simply use dd in the Terminal on Mac OS X to create an image of the whole hard drive. You can then use the Mac OS X DVD that also contains a Terminal and dd to write the image you made (which you can store on a USB HDD) to the hard drives of the other Macs (which I assume are identical).

Deploying OSX-Bootcamp-Windows 7


How much does imperfect grammar put off an agent?

Question: I've written a novel and looking back the story line was good but the grammar wasn't great. I submitted the book to a few agents and received some constructive comments which I took on board. I have rewritten the story and corrected many of the errors. For instance I removed gerunds. Now that it's complete I'm getting hung up on other issues for instance starting sentences with quickly. I don't want to put agents off accepting my work but does this honestly matter? Should I just bite the bullet and start submitting the novel again?
Comment: I'm not sure what the problem with gerunds is. *Swimming is fun*. "Swimming," being the present participle of the infinitive *to swim*, operates as a noun because it is the subject of the sentence--a gerund. If this makes no sense, then consider a good style guide.
Comment: @StuW Yes, bit of a non sequitur there. "I ... corrected many of the errors. For instance I removed gerunds." A gerund is not an error; it's a perfectly valid part of the language. I'm not sure if the OP is confused about what a gerund is or if he means that he fixed places where he was using gerunds incorrectly or what.
Comment: Is "gammar" intentional? :)
Answer: When you submit to an agent or publisher, your writing is all they have to go on when forming an opinion of your work. You want to make the best impression that you can.
Think of it this way: If they're considering two equally engaging stories, where one will need significant line-editing to fix the grammar, and the other doesn't, they'll want to buy the story that requires less work to publish. I think it will be worth your time to give it one more pass to tighten things up.
Answer: Your grammar doesn't need to be perfect in fiction and breaking certain rules is perfectly acceptable so long as you convey the correct meaning. An agent isn't going to turn down a brilliant story because it needs to be proofread.
However, if you know full well that there are lots of grammatical errors and it will require significant re-writing at some point, then clearly you do need to fix it before you send off your manuscript. Especially for the beginning of the manuscript.
If you've noticed the mistakes that implies you are capable of fixing them. If you can't be bothered to present the best work you can -- why should anyone else bother with it or take it seriously?
Comment: Of course there is room for error in a 80,000 word manuscript. Suggesting an agent would immediately bin an otherwise brilliant manuscript because they came across one or two run-on sentences is ridiculous.

Most agents I've met and talked to are lovers of books and literature. They are not usually grammar Nazis looking to hate everything they come across. There is no correlation between perfect grammar and a good story that will sell.
Comment: There is somewhere between zero and no room for error when an unheralded author looks for an agent. Punctuation is a style issue with some reasonable variation accepted. Run-on sentences will get you a form letter.
Comment: Ok. I see your point about a manuscript. I am talking about the query letter and short piece of the overall work. If you get past the query stage, there is definitely more room for error. Plus, there is a huge difference between punctuation mistakes and grammar mistakes. Punctuation is certainly more forgiving. This has been my experience. If you feel I'm being dramatic, it's all good.
Answer: While I wouldn't consider "gerunds" (or even adverbs) to be mistakes, if you're worried about your grammar, hire an editor to do a line-edit. Explain (if this is the case) that you're happy with the story and don't want a content edit, but you do want to polish your grammar, structure, word choice, spelling, and so on.
Publishers do have editors, but if your work is not already the best it can be, why would they waste their time and money on you?
So yes, IMHO, it does honestly matter, and you should make the effort to clean up your manuscript as much as humanly possible.
Answer: When you send your work to a publisher or agent or anyone, it should be the best that you can do. Which would you rather read: A story that is the writer's absolute best effort, or a story that he figured was "good enough" and he was too bored with to bother working on any further?
Many writers crank out a first draft hurriedly as thoughts come to them, and that draft includes many grammar errors, clumsy wordings, incomplete thoughts, etc. That's fine ... as long as you go back and clean it up later.
Why would you NOT fix the grammar errors? Is it because it's too much work? If that's your answer, then I can only say, knuckle down and do it. Producing a quality product -- whether a novel or furniture or a gourmet meal or whatever -- requires having the discipline to do what it takes to get it done right.
Is it because you're anxious to see your work in print? But if grammar errors result in your book being rejected by agents and publishers, then in the end you may well have to fix the errors and start all over, and it will only take longer. And if you made a bad impression on your first submission, they may not be willing to seriously consider your second try. When my books got close to being ready to go to print, I rushed some things because, hey, I've done all this work and now I want to see it in print. But that's a bad attitude. Don't throw away months of work because you got impatient at the end.
Is it because you don't know grammar rules well enough? Then you need to take some time and learn them. Get a good book on grammar. If I buy a car and it doesn't run, and I take it back to the dealer and he tells me, "Well, yes, but the engineer at the car company doesn't really know a lot about auto mechanics so this was the best he could do", my response will be that I want my money back. Publishers and readers want a good, quality book, not excuses about why you couldn't produce one.
Is it because you don't think anyone cares? They do. Grammar errors make a book hard to read and understand. They make the author look unskilled. This is a novel, but imagine you were writing a non-fiction book and found it was filled with spelling errors. At some point you would say, If the author doesn't even know how to spell (say) the word "astronomy", why would I think he knows anything about the subject? Yes, we all make mistakes. If you have two grammar errors in a 300 page book, likely no one will think much of it. But if every other sentence has errors, readers are going to give up on you.
Answer: Agents and publishers get so many manuscripts that they have to screen them quickly. Anything, especially in those first few pages, that makes you seem no better than average will get you rejected.
Most published books are commercial failures. I read that 90% of books for which royalties were advanced do not earn out the advance. Since publishers know they are shooting craps when they select a book, they are as fussy as they know to be.
Big publishers don't do the degree of editing that they used to, in order to keep labor costs down. So a first-time author needs to have their work professionally (or at least competently) edited before submission.
Get yourself a copy of the "Chicago Manual of Style" and read relevant parts.
I suspect, too, that if your grammar is shaky, there are other things wrong with your writing. Although it is targetted for mystery writers, I strongly recommend fiction authors of any genre read "Don't Murder Your Mystery" by Chris Reorden. It's not really about writing mysteries, it's about writing fiction well, heads above your competitors--who are also sending their manuscripts to the same people you are.


How far into the future is a stock future?  How do stock futures work?

Question: I have been looking at the markets recently and most of the time, I see similar articles on how the market is going to do depending on how futures did.  I am not that familiar with futures, but how far into the future do futures go.  What I mean is that, would Mondays futures (10/3) be an indicator of what the markets are going to do on (10/3)?
Answer: Context is key here. Futures don't really have to do with a time in the future in this context.
Futures are a capital market (futures market), just like Stocks are a market (stock market). Both capital markets have the ability to affect each other. Up until 30 years ago there was a separate use for the futures market, but in the days since they are MOSTLY used for stock derivatives (financial futures are the most widely traded contracts since 1980, hugely eclipsing the commodity futures that the market was designed for.)  So there is overlap and one affect the other, I'm not going to go into too much detail here but basically the futures market trades 24 hours a day, 6.5 days of the week and the  stock market trades 8-12 hours a day, 5 days a week.
So when the stock market closes, the futures market is still running will react and effect the broad stock market.
Hope that gets you started in your research
Answer: Futures are an agreement to buy or sell something in the future.  The futures "price" is the price at which you agree to make the trade.  This price does not indicate what will happen in the future so much as it indicates the cost of buying the item today and holding it until the future date.  Hence, for very liquid products such as stock index futures, the futures price is a very simple function of today's stock index value and current short-term interest rates.  If the stock exchange is closed but the futures exchange is open, then using the futures price and interest rates one can back out an implied "fair value" for the index, which is in essence the market's estimate of what the stock index value would be right now if the stock market were open.  Of course, as soon as the stock exchange opens, the futures price trades to within a narrow band of the actual index value, where the size of the band depends on transaction costs (bid-ask spread, commissions, etc.).


Configuring FTP Server in IIS for remote access in Amazon EC2 instance

Question: I have configured an FTP server in IIS 6. I can access it by using ftp://localhost/. When I try I accessing it using static IP instead of localhost in a remote location, the page doesn't open. I am using Amazon EC2 instance. I have opened all ports for ICMP so I can ping to the static IP and port 21, 20, 1025-7000 are opened. I can open the page even if I disable the windows firewall. What changes must I make for it to work remotely ?
Answer: Make sure that the site binding listens on the public IP for FTP, and not just 127.0.0.1.  Try testing locally using ftp://{your_public_ip} to confirm that it's setup to listen on that IP.  If it works locally but not remotely, then a firewall or proxy server in-between is blocking it.
Also, try briefly to disable the Windows firewall to confirm that it's not fighting with you.  Or, better yet, enable logging and check the logs after a failed attempt.  That way you don't have to disable the whole firewall.
Answer: I faced the same problem today, so maybe my answer will still be helpful for someone.
All I needed to do was to add a security rule in my EC2 dashboard. The steps are:

Go to EC2 dashboard
Select Security Groups in the right panel
Select HTTP rule in Inbound Rules tab
Click Add Rule and then Apply Rule Changes