when i call balance function it shows 0 all the time ? I am deploying at remix - solidity

Question: pragma solidity 0.4.19;

contract blackeye {
    uint public max_amount = 1000000;
    uint public total_balance_bought = 0;

    mapping(address => uint) total_balance;

    address owneraddress;

    modifier onlyowner {
        require(owneraddress == msg.sender);
        _;
    }

    modifier can_buy_amount(uint rupee_invested) {
        require(rupee_invested + total_balance_bought <= max_amount);
        _;
    }

    function balance(address investor) external constant returns(uint) {
        return total_balance[investor];
    }

    function deposit(address creator, address investor, uint rupee_invested) external {
        if (msg.sender == address(creator)) {
            uint amount_bought = rupee_invested;
            total_balance[investor] += amount_bought;
            total_balance_bought += amount_bought;
        }
    }

    function withdraw(address creator, address investor, uint amount_sold) external {
        if (msg.sender == address(creator)) {
            total_balance[investor] -= amount_sold;
            total_balance_bought -= amount_sold;
        }
    }

    function send_money(address sender, address receiver, uint amount_send) external {
        total_balance[sender] -= amount_send;
        total_balance[receiver] += amount_send;
    }
}

Answer: There are a few problems.
This doesn't do anything useful.
if (msg.sender == address(creator))  {

A sender can just pass their own address into the function to make the condition true. I think what you want is to check that the sender is authorized to report rupees received.
You don't need this because you can make the mapping public. It gives you a "free" getter function.
function balance(address investor) external constant returns(uint){
    return total_balance[investor];
}

The withdraw function doesn't do anything because there is nothing to withdraw to. This is not dealing with Ethereum and not a standard token. In any case, a token like this "withdrawn" by sending from one account to another, which is covered by your send function.
Don't trust the sender. Verify. The send function should use msg.sender to check the balance of the sender's account.
Here's a cleaned up version you can play around with in Remix.
pragma solidity 0.4.19;

contract BlackEye{

    uint public initial_supply = 1000000;

    mapping(address=> uint) public balances;

    address ownerAddress;

    modifier onlyOwner {
        require(ownerAddress == msg.sender);
        _;
    }
    function BlackEye() public {
        ownerAddress = msg.sender;
        balances[address(this)] = initial_supply;
    }
    function deposit(address investor, uint rupee_invested) external onlyOwner {
        balances[investor] += rupee_invested;
        balances[address(this)] -= rupee_invested;
    }
    function send_money(address receiver , uint amount_send) external{
        require(balances[msg.sender] >= amount_send);
        balances[msg.sender] -= amount_send;
        balances[receiver] += amount_send;
    }
    function transferReserves(address receiver, uint amount) external onlyOwner {
        require(balances[address(this)] >= amount);
        balances[address(this)] -= amount;
        balances[receiver] += amount;
    }
}

Deploy the contract.
Copy the contract address and paste into balances(). See the initial supply.
Use the transferReserves() function to send some to 0xca3... (copy). This function gives the owner access to the contract's reserve supply created in the constructor. (Using the mapping and address(this) simplifies the accounting).
Now 0xca3... can send some to someone else.

Hope it helps.
Comment: What if two different user which are not owner and they want to transfer amount to each other? I am trying to do this functionality in send function.
Comment: They don't have to be `owner` to use `send_money`, but they need to have some tokens. They get some tokens from transactions that happened before. Initially, the only possible source is `owner` sending some `transferReserves`.


Accent reduction

Question: How can I correct my prononcitaion of the words and reduce my accent? I am not able to pronounce the english words properly and therefore runinto people not undersatnding me.
Comment: Welcome to ELL.SE. Your question is rather broad, as we don't know what your accent is like, nor what your audience expects. Ultimately, the answer is the same as it would be for any language— get a good coach, or study recordings of yourself and of people speaking the accent you wish to emulate. We have a collection of [pronunciation resources](http://meta.ell.stackexchange.com/a/1057/21), and you might also review *[How to Improve Intonation?](http://ell.stackexchange.com/q/26113)* or *[How to improve or get rid of an Indian English Accent?](http://ell.stackexchange.com/q/16719)* for ideas.
Comment: I'm not sure we can solve this in a text post.  Maybe check out the film "My Fair Lady"?
Comment: I spend a lot of time listening to non-native Anglophones on streamed lectures, debates, etc. (so they're invariably clever, well-educated people). One particular problem I notice more with Indians than anyone else is their tendency to speak very quickly when they *do* know exactly how best to express some small subsection within an utterance, then slow down again when they get to less familiar parts. If I'm attuned to the primary (slower) rate, I may not catch the rapid (often, *slurred*) part. So I suggest that *Try to maintain a constant delivery speed* would be worth bearing in mind.
Comment: While _prononcitation_ (which is what I think you were trying to write) is a very clever coinage (which may remind Americans of their former President George W. Bush) it is not a real word in English. Have you consultified a dictionary to learn the noun we use to describe what results when we _pronounce_ a word?
Comment: Our _Community Wiki_ has a page with many resources which may assist you: it is called [**Resources for learning English.**](http://meta.ell.stackexchange.com/questions/735/resources-for-learning-english)
Answer: Different strategies will be better suited to different people, but I will tell you what helped me the most in improving my English pronunciation: learning general phonetics. By general, I mean studying phonetics independent from a language. Do not start with anything focusing on English phonetics nor Hindi phonetics (or whichever is your native language).
Start by learning the basic concepts of phonetics; once you've got a good base, move on to learn the specifics of English phonetics and that of your native language. Note that it is important for you to study the phonetics of your own language as well, in order to avoid some imperceptible features that are not present in English. For example, I found out that in my language vowels are murmured after the stressed syllable. I had never noticed it despite having used my language nearly every day ever since I was a child, but by having learned this I am able to avoid doing the same thing when speaking English.
This has, in fact, helped me much more than immersion (living in an English-speaking country). At first, my fluency suffered because I had to pay a lot more attention to the details when pronouncing anything, but in the long run my accent has become much more similar to native dialects.

Accent reduction


What exactly is Planck's constant? how did they calculate it?

Question: What exactly is Planck's constant? I'm a pharmacy student and I've googled this question but couldn't find an answer I'd understand. It would be so great if somebody could tell me how we calculated Planck's constant in simple language so that I'd have a more accurate idea of what it is.
Comment: [This](https://en.wikipedia.org/wiki/Planck_constant) might help you, go through this article on Wikipedia. Also [this article on PSE](https://physics.stackexchange.com/questions/44965/what-is-the-real-interpretation-of-plancks-constant-and-what-are-its-origins#). Maybe [this one from PSE](https://physics.stackexchange.com/questions/287514/physical-interpretation-of-plancks-constant) also.
Comment: I am not sure still this one May be [worth seeing](https://physics.stackexchange.com/questions/161820/can-someone-explain-plancks-constant-simply)
Answer: The equations that govern quantum mechanics predict that the angular momentum (that is, spinning or orbiting) in a system can't take on any value, but instead come in lumps.  The "reduced Planck constant" $\hbar = h/2\pi$ is the size of a lump of angular momentum.  An electron orbiting a nucleus can do so with zero angular momentum, with angular momentum $\hbar$, with angular momentum $2\hbar$, and so on, but for a hypothetical value like $1.37\hbar$ there are no solutions to the electron's equations of motion.
When we look at spin angular momentum, it turns out to be slightly more subtle: $\hbar$ is the size of an allowed change in angular momentum, but some systems can have a total angular momentum which is a half-integer. These systems include the proton, neutron, and electron, each of which has an intrinsic spin $\hbar/2$.  An electron's spin can "flip" along your preferred measurement axis, from $-\hbar/2$ to $+\hbar/2$ or vice-versa, but you can never remove the intrinsic spin from an electron.  Light also carries angular momentum: any process that emits or absorbs a photon must involve an angular momentum change of $\hbar$ (or a larger integer multiple of $\hbar$).
The fact that angular momentum comes in lumps is responsible for, among other consequences, the shape of the periodic table.
As of 2019, the International System of Units (SI) has been modified so that the Planck constant is defined as an exact number with nine significant figures; before that change, measurements of $\hbar$ were traced back to the International Prototype Kilogram.  My absolute favorite historical measurement of $\hbar$ is Richard Beth, Mechanical detection and measurement of the angular momentum of Light, Physical Review 50 115 (1936), where bright circularly-polarized light was used to drive a macroscopic torsion pendulum.
Chronological histories of Planck's constant start with Planck's work on the blackbody problem, which he solved by assuming that energy can be added or removed from the electromagnetic field only in multiples of $hf$. However, the quantization of angular momentum has always seemed more fundamental to me, because all angular momentum quanta are integer multiples of $\hbar$ in every known interaction.  It seems to me like energy exchanges come in lumps because angular momentum exchanges come in lumps, even though the discoveries happened in the opposite order.
Comment: Really nice answer.
Answer: The original concept of atoms relates to the idea of dividing things, until getting to objects so small that no longer can be divided.
But by things our intuition thinks of inert objects.
Now think of a pendulum for example. It is not an inert stuff, and our intuition is that it loses energy continuously until it stops.
The Planck constant is related to the notion that there is "atoms" (or quanta) of energy. The pendulum loses energy by bits of $E = \hbar \omega$, where $\hbar$ is the Planck constant, and $\omega$ is the frequency of the oscillation.
The Planck constant symbolized the difference between the ancient Greek notion of atoms as smallest possible objects, and the modern notion of quanta as the minimum energy for a given frequency.
Answer: May be you have already heard, that light (or every electromagnetic wave)
is made up of tiny energy packets, the so-called photons.
In physical experiments (for example of the photoelectric effect)
it was found that the energy $E$ of a photon
is proportional to the frequency $f$ of the light.
$$E=hf \tag{1}$$
The constant $h$ in this equation is called Planck's constant,
and the equation is called the Planck-Einstein relation.
Examples:

Red light has a frequency of $f=4.6\cdot 10^{14}\text{ Hz}$.
The photons of red light each have an energy of $E=3.0\cdot 10^{-19}\text{ J}$.
Blue light has a frequency of $f=6.7\cdot 10^{14}\text{ Hz}$.
The photons of blue light each have an energy of $E=4.4\cdot 10^{-19}\text{ J}$.

From measuremnts like in the examples above and with the
Planck-Einstein relation (1) the value of Planck's constant was calculated to be
$$h=6.6\cdot 10^{-34}\text{Js}.$$
Answer: Planck solved a long standing problem by deriving the formula for thermal radiation emitted by a black body (1900). His formula contains one free parameter to be fit to experiment, the so called Planck constant $h$. In 1905 Einstein showed that light of frequency $f$ consists of particles of energy $hf$. Later it was found that this energy frequency relations holds for all matter.
Answer: Planck's constant is a "resolution limit" to the Universe.
The following is a very loose explanation of how that works. There's a fair bit of understanding that quantum theory is best understood as an informational theory, and from this perspective we can consider that Planck's constant sets the maximum amount of information that is allocated to each particle. What that means is that all the attributes of that particle - such as its position, the direction and speed of its motion, and how it's rotating - have to be derived from this finite amount of information. And that makes things "fuzzy", in a sense, because of the following.
Classically, i.e. in the sense of Newtonian mechanics, if we want to talk about where a particle is located, we need to specify three real numbers - you may have seen at least in school geometry that you have the Cartesian coordinates $(x, y, z)$. These three numbers locate any point in space, but because they're real numbers, in their most general cases they actually require an infinite amount of information to specify, because, in effect, you can't do any better than writing down every last digit after the decimal point, which goes on forever (c.f. numbers like $\pi$ and $e$, but those admit alternative ways of representing them that are compact - as I said, this is loose; there's lots of subtle points at work here to make all this mathematically rigorous). Likewise, we can give three more numbers, similarly requiring an infinite amount of information, to describe the particle motion, i.e. where it's going (we need three because we also need the direction of motion as well as the rate of motion).
But the Universe has only a limited amount of "digits", so to speak, and it can give either some to the position, or some to the velocity, but it can't give an infinite amount to both, and that leaves one or the other unspecified below a certain scale of distance or speed. If more are needed in one, then a sacrifice must be made to the other, and this is Heisenberg's uncertainty principle - most instructively written in the form
$$H_x + H_p \ge \lg(e\pi \hbar)$$
where $H_x$ and $H_p$ are the informational entropies or, better, the degree of privation of information, in the position and momentum ("velocity" was used above to make things even simpler) of the particle. The higher $H_x$ or $H_p$ are, the less information there is in either parameter. The right hand contains $\hbar$, the (reduced) Planck constant. Note the direction of the inequality, and note that logarithms always go up or down when their input values go up or down. If $\hbar$ were smaller, then the logarithm on the right would also be lower, and the information privations could be less, meaning more information. Conversely, if $\hbar$ were larger, then the logarithm would rise, and there'd be a greater minimum privation of information, that is, even less information.
The effect of this limitation on information is that below a certain point of scale, particles cease to be "located" any more because the information just isn't there to place them at a particular point in space - and the scale at which that happens sets the scale of things like atoms. It's as though the Universe just says "the electron is inside the atom, which has such and such a size", and not "the electron is located at this particular point". Thus, $\hbar$ also sets the size of atoms. A larger $\hbar$ would mean larger atoms - and this can also be seen reflected in the formula for one measure of the size of a hydrogen atom:
$$a_0 = \frac{4\pi \epsilon_0 \hbar^2}{m_e e^2}$$
If $\hbar$ were twice as large, say, the atom would be 4 times as broad, because the amount of information in the combined position and momentum would have shrunk by the order of 4 bits (note that the occurrence of two 4s here is a coincidence: bits are logarithmic, not linear), making the electron less able to locate itself, and it less able to place its speed within a given range, so that larger speeds would be consistent with the limited information available, taking it farther from the atomic nucleus.


How do I get started, what hardware do I use?

Question: So, I would like to get started in mining BTC and live in Britain south of Cambridge. I have a custom machine running an OC 7870, intel i5 etcetera. Would it be pointless mining with this hardware as I only get about 380 m/hash and is this too low in comparison to electricity bills. What's an Asic Miner and is it worth buying one of the £40 1.6 GH/s ones. Will this be too expensive in comparison to my electricity and how much could I make off of this in a month   including the price of the electricity?
Comment: I have a 30 GH/s ASIC miner and these days it barely mines anything because the difficulty is so high. Unless you are at 500 GH/s or higher I think you won't find it that rewarding. As Neriseole says, better to try scrypt mining.
Comment: possible duplicate of [How much Bitcoin will I mine right now with hardware X?](http://bitcoin.stackexchange.com/questions/118/how-much-bitcoin-will-i-mine-right-now-with-hardware-x)
Answer: Yes, GPU is out of the question for Bitcoin.  Although, you could mine Scrypt Alt-coins with it, like Litecoin and Dogecoin.  As far as your ASIC is concerned, you can input your numbers in the Profit calculator at http://mining.thegenesisblock.com and see what you come up with...
Answer: The most profitable form of mining now is actually alt coin "scrypt" mining.  So most efficient investment would be to get some good GPU's for alt coin mining, go to http://www.coinwarz.com/cryptocurrency     then pick one of the top coins that has decent volume.  Then start an account with a site like Cryptsy and trade those alt coins for Bitcoin.
Kind of complicated but much more profitable for investment size then Bitcoin mining.  Doing this and getting lucky with mining a few coins early before difficulty took off has netted me a little over 2 Bitcoin in 2 months with a 1000 dollar investment.  Your results may very however as there are a LOT of variables to take into account and these alt coins can fluctuate even more then Bitcoin.
If your dead set on BITCOIN mining then I would suggest something like an ASICMiner Block Erupter Cube 30GH/s to 38GH/s Miner
http://www.amazon.com/gp/offer-listing/B00H8K3MZU/ref=dp_olp_new?ie=UTF8&condition=new
I will warn you that with Bitcoin mining and difficultly increase that with that miner there which is one of the best deals I can find you will be lucky to make your money back at current prices.


Software to scale and rotate drawings without losing resolution

Question: I am looking for software that will let me draw a very simple design and then convert it into different sizes and rotations without losing resolution. The goal is to lay a number of these out into a pattern. I'm not sure if I need to go for something as sophisticated as Illustrator. Will you kindly make some suggestions please?
Answer: I would suggest you to use Inkscape, since it is easy to use and free (Open Source), therefore easy to try. It's a Vector-Editor, so scaling is no problem.
Answer: What you need is any kind of software that handle vector graphics. Here's a long list, pick one that meets your criterias (price etc.):
http://en.wikipedia.org/wiki/Comparison_of_vector_graphics_editors


Minecraft inventory dragging glitch

Question: How do I fix my Minecraft inventory? I am trying to select items, but ever since the recent update, I have to click on the item and drag it to my inventory. It isn't working to fast move it using shift either. Also when I go to the crafting table it won't let me separate the items only one at a time?
Comment: Go to options and turn touchscreen mode off.
Answer: As @JeffreyLin said, this is as simple as turning touchscreen mode off in options:
Comment: Oh THANK you! I turned touchscreen mode on to see if I could play with my touchscreen, and I forgot to turn it off! This made me lose in Hunger Games!!! I was afraid I'd have to make a new minecraft.jar
Comment: Thank you very much. I suffered from a genuine bug regarding this, I couldn't select a particualr slot at all and touchscreen mode was off. Turning off and on worked.

Minecraft inventory dragging glitch


Difference between tendency of benzene and thiophene to undergo sulfonation

Question: Why does thiophene possess a greater tendency to undergo sulphonation than benzene? I came across this reaction which employs the use of sulphuric acid to separate thiophene from commercially prepared benzene.
Comment: As ron said thiophene is less aromatic than benzene, but perhaps more importantly thiophene is an electron-*rich* ring which leads to greater reactivity with electrophiles (which are electron-*poor*). Pyridine is as aromatic or slightly less aromatic than benzene, but pyridine is *very* unreactive towards electrophiles.
Comment: I came across a Quora answer saying that in thiophene, the 6 electrons are delocalised over 5 atoms but in benzene, the delocalisation is over 6 atoms. Therefore, electron density is higher in the former.
Comment: The activation energy is less for the the thiophene reaction because thiophene is less aromatic than benzene.
Comment: Not because aromatic conjugation in thiophene imparts negative charge to the carbon?  Draw thiponene Kekule type structures and see ... .
Comment: @Orthocresol as an aside -- pyridine can be made to "wake up" for electrophiles by N-oxidizing it.
Answer: In the chapter Aromatic five-membered ring heterocycles with one heteroatom in Organic Chemistry by  J. William Suggs (2002) the following explanation can be found (pp. 403-404) which summarizes the thoughts already pointed out in the comments:

The resonance stabilization energy of benzene is greater than that of these heteroaromatic compounds.
  The order of aromaticity is benzene > thiophene > pyrrole > furan.
[…]
All three of these ring systems undergo electrophilic aromatic substitution and are much more reactive than benzene.
  In part, this reactivity difference arises because the rate-determining step in electrophilic aromatic substitution is the first step, which breaks up the aromatic $\pi$ system.
  Since thiophene, pyrrole, and furan have less stabilization to lose than benzene, the intermediate is lower in energy and the overall reaction proceeds more rapidly.
[…]
All three of these heteroaromatic rings undergo electrophilic aromatic substitution, preferentially at C-2.
  The reactivity order is pyrrole > furan > thiophene because of several factors, including the electronegativity of the heteroatom and the resonance stabilization of the aromatic ring.


Connect to embedded device through serial, possible and how?

Question: I have a device with embedded linux. I need to access the CLI of this device, and found a RS232 port in the motherboard. Can I access CLI with putty, using this RS232 port?
Comment: If it's running getty on that port then you're in with a chance, if not then you'll need to access the device another way and run a process that services the port one way or another.
Answer: Based on experience I'd say it is somewhat likely, but it is certainly not guaranteed.
Also, if you can access a console there, you may quickly end up needing a password for logging in.
Comment: may be i can find password. the only problem accessing root shell
Comment: You also needs the physical pin out, and then attach a cable to the pins / solder pads. But good luck in your quest.
Answer: The fact that a linux device has a RS232 connector does not mean you can connect to it and access a CLI console. It may still be possible if it does provide you a console.
You also don't know why it says RS232 on that connector. Maybe it does provide an actual RS232 interface. Maybe it is just a connector for a separate module that provides the level conversion between logic levels and RS232 levels.
So you need to reverse-engineer what voltages are present on the connector to determine if it is a logic level or RS232 level interface. Then you need an appropriate cable between PC and this device. Maybe resolve with an oscilloscope or logic analyzer which pin is an output, and what bit rate is used.
Then the next problem is to figure out which is the input pin.
But embedded devices may not have a console for security reasons. You might need to do something special to enable the console, or can't do anything because it is locked by the vendor. Such devices include Wlan routers running firmware specific to your ISP, even if it the stock hardware could run stock firmware.


inputs and outputs of a fully connected layer for a note classifier

Question: i'm trying to make an object classifier of different musical note types and I'm having a problem understanding fully connected layers. for example I have a 3d array of binarized images (WxLxNo.OfImages) and i pass that array to the conv layer, relu and pooling. a lot of the videos and other tutorials said that I make a vector using the images but is the input per image, category or the whole training data? My second question is how many neuron should be on the last layer? should it be the number of categories in my training dataset?
Answer: Starting with your last question: The final fully-connected layer shoud output the number of target classes you have. This output can then be passed to a softmax, which normalises the values between the range [0, 1] - allowing them to be interpreted as probabilities.
Remember, you train using the following dimensions:
[batch_size, height, width, channels]        # channels = 1 (in your case) so is removed

You always need to maintain the batch_size through one loop forwards and backwards through your neuiral network. Normally it set to None which allows the model to accept any batch size you decide on.
What people mean by "make a vector" is that the output of your convolutional layers will be a 3D (including channels) and so 2D in your case. You need to flatten these into a single vector. The conv layer output, which then flows into the fully-connected layers will then be:
[batch_size, height * width]         # height and width are those from the final conv layer

Depending on your framework, there will be a layer called Flatten or view etc., which gives you the vector for each image, keeping the batch_size. This is performed as part of the model structure and so is applied to all data as it passes through the model (training, validation and test data).


Call to undefined function _bootstrap_process_element() in /var/www/xxxxx/includes/form.inc on line 1870

Question: We have form having upload elements. While uploading images, we are getting error:
 Call to undefined function _bootstrap_process_element() in /var/www/events/includes/form.inc on line 1870
Can anyone help to fix?
Answer: If you recently updated Drupal or contributed modules you will likely need to perform a registry rebuild.
<code>drush rr
</code>
...if you have drush. Otherwise Acquia has a nice post about it here:
https://docs.acquia.com/articles/how-rebuild-drupal-7-registry


How do I cleanse the focal points?

Question: "Cleanse the focal points for magical energies around the College." I was given this miscellaneous objective ("Out of Balance") by Drevis Neloren in the College of Winterhold. I'm at the central well, but it doesn't seem to do anything when I activate it (and the button symbol seems to be greyed out). What do I do?
Comment: I'm considering changing the title to "Why can't I cleanse the focal points?" or "Why is [the option] greyed out?"
Answer: In order to purify each one, you have to equip the Mystic Tuning Gloves and then go around to each focus point to activate them.
There are 3 focus points in total, they are located in:

Hall of Countenance
Main Courtyard
Hall of Attainment

http://www.uesp.net/wiki/Skyrim:Out_of_Balance
Comment: Massive props to @spartacus for essentially answering the question here but not posting it in his own answer.
Comment: What else is there to do? Where do I get these gloves? I'd be surprised if I could complete a quest by only equipping a pair of gloves.
Comment: After you equip them you have to go around to the each of the focal points.
Comment: I was wondering where did that weird glove came from
Answer: If you approach Drevis Neloren in the Hall of Countenance at the College of Winterhold, you are able to ask him if there is any College business that you can assist with. He will then say, "There may be a matter in which your... skills... could be useful. The various points of focus for magic energies around the College have become polluted, and need cleansing. The magical energies underneath the college still require purification. Your assistance would be most useful." Choosing to agree to help, Drevis will further elaborate on what has to be done: "Very well. These specially enchanted gloves will allow you to delve directly into the focal points for these energies. Go to each focal point and remove whatever impurities you may find there. Return the gloves to me when you have finished. Please exercise caution. This is not a procedure without possible... consequences." If you ask Drevis to repeat what has to be done, he will say, "Use the gloves to clear the focal points. Return to me when you have finished. I thought I made this rather clear."

How do I cleanse the focal points?


Help with Bayes Theorem (possibly?)

Question: So let's suppose that there is a baseball player with a .300 batting average (i.e., the probability that he gets a hit is 30%) and he is facing a pitcher who has a .400 avg against (the probability that he gives up a hit is 40%). What would be the probability that this batter will get a hit off this pitcher? I tried to use Bayes theorem, but I got an answer of .222, which doesn't really make sense. Would the answer just be .350 (the average of the two), or is there some Bayesian way to get an answer?
Answer: As @jlimahaverford said, there is not enough information. You are trying to determine
$$ P(H|B=b,P=p) $$
where $H$ is the event "a hit", $B=b$ indicates the batter is $b$, and $P=p$ indicates the pitcher is $p$. But the information you have is
$$ P(H|B=b) \quad \mbox{and} \quad P(H|P=p) $$
and there is no obvious way to get from these two pieces of information to what you are trying to determine.
One approach you might want to look into is logistic regression where the response is the binary outcome of each at bat (hit or no hit) and the explanatory variables are the IDs of the batter and hitter in that at bat. Then you could learn the quality of each batter and pitcher. From this information, you could predict what would happen for a particular batter-pitcher combination.
Comment: You would probably need a lot of data for the logistic regression?
Comment: This is baseball...there exists lots of data at least for estimating main effects.
Answer: As you stated your question, it's a bit ambiguous.  Based on my understanding of your question, it doesn't provide sufficient information to approach this problem in a Bayesian manner.
Suppose $A$ is the event that the batter succeeds, and $B$ is the event that the bowler fails.  You are given $p(A) = 0.3$ and $p(B) = 0.4$ and you are asked what $p(A|B)$ is.  Without any more information or constraints (i.e., whether $A$ depends on $B$ or not), the best you can say is $A$ is independent of $B$ and conclude that $p(A|B)=p(A)=0.3$.
Comment: Are they really independent of each other though? If a batter has hit above average against a variety of pitchers, wouldn't I expect him to hit even better against a pitcher who has allowed above average offense against him?
Comment: I don't quite think this is right.  What are $A$ and $B$ here?  I agree there's not enough information.  But what two events are you assuming are independent.  I think we have two conditional distributions for the same event (hit) conditioned on two different conditions.  $P(A|B), P(A|C)$.  I agree that Bayes theorem doesn't apply but you said "it's not Bayesian" which means something very different (though also true).
Comment: I was probably a bit terse in my reply.  Here, A is the event that the batter succeeds.  And B is the event that the bowler fails.  The first statement "is a baseball player with a .300 batting average" without any more information is just $p(A)$.  The same goes for the bowler as well.  Right?
Comment: @RyanG: Yes, it does sound intuitively correct, but I think statements in English are pretty easy to get confused about unless they are stated unambiguously.  Here, I think we all agree the statements are a bit ambiguous, so any deduction that makes the fewest assumptions makes sense?
Comment: @RyanG: I see where you are coming from.  In the extreme, if you have a batter with 100% success and a certain bowler with 0% failure, then will the batter hit or not?  Is it even possible to have the above statistics?  It's hard to say unless we are given how $p(A)$ is computed and what it is conditioned on.

Help with Bayes Theorem (possibly?)


Tips for cooking a classic French omelette in a carbon steel pan

Question: Are there any specific tricks or tips for cooking a classic French omelette in a carbon steel pan?
Comment: How is it different from using a nonstick pan?
Comment: What are the problems you are having @whiz? What is the method you have tried? This question is a bit vague.
Answer: The main issue in cooking a french omelet in carbon steel it'll stick too much. As I was taught you should just try to use a different pan but if you must use that kind then be sure to properly lubricate the pan with fat before adding egg. Then again if and when the eggs absorb it. Then to change it on to a lower heat than typically then making a french omlete so that it will not burn or get stuck as easily. Be sure to cook it long enough so that the bottom is firm enough not to break before moving it. With the excess fat it should release from the pan much like meat does. Once it has released from the pan be sure to keep it moving so that it will not stick again.


SharePoint 2013 import data from Access

Question: I am trying to build a DR application to a SharePoint site using Access 2013. This Access DB will be available when the SP site goes down. and once the SP site is up, all items created in Access DB has to be moved to SP list. Any idea on how to get started with this is highly appreciated.
Answer: This is fairly easy to do.
You can link access to the sharepoint list, go to external data, click the more arrow and Sharepoint list will be at the top.   Just navigate to the site collection and list which you have your list.  In Access 2013 it always links to the default view of Your sharepoint list.
Once the list is linked it behaves like a linked table so you can query it, update etc.
Now just write a query that appends your offline data to sharpoint - as long as your filling in all the fields that you have set as mandatory on the sharepoint list access will creat new records in sharpoint.
hope this helps
Comment: Thanks for your response. I tried creating this way and linked SP list and Access table. But looks like the Multiple line of text fields are set to Read only in Access table.
Comment: Yes your right it's a memo field in access - suspect your field in sharepoint isn't rich text format?   Try changing it in sharepoint and try it again

SharePoint 2013 import data from Access


Equation Involving Digit Sum Function

Question: Define the digit sum $S$ of a number as the sum of its digits. For example, $S(456)=4+5+6=15$. Given positive integers $a_1, \cdots, a_n$ and $Q$, I'd like to ask how to obtain the nonnegative solutions to $S(\sum_{i=1}^{n} a_ix_i)=Q$ which minimize $\sum_{i=1}^{n}x_i$.
Answer: Unless the $a_i$ are large and the $x_i$ are small where rounding issues intervene, you want the sum to be the minimum number whose sum of digits is $Q$.  That will be a series of $9$s with a prefix digit for the remainder of dividing $Q$ by $9$.
 Let $k=\lfloor \frac Q9 \rfloor, m=Q \bmod 9$.  Then $N=(m+1)10^k-1$ is the smallest number with sum of digits $Q$.  We therefore want the solution to
 $$\sum_{i=1}^{n} a_ix_i=N$$
that minimizes $\sum_{i=1}^{n} x_i$.  This is a classic linear optimization problem.  Again, absent some strange things with the $a_i$, we will want to find the greatest $a_i$ and make $x_i$ large, then fix any rounding problem.

Equation Involving Digit Sum Function


Moment of inertia around two axes

Question: In the this chapter of an online pdf we are given an equation for the deflection of a beam:
$$\frac{d^2y}{dx^2}=\frac{\overline{M}}{E I}$$
where $E$ is the modulus of elasticity, $\overline{M}$ is the moment as function of $x$ and $I$ is the moment of inertia. It works nicely for a beam with one free end as the beam would be rotating around a single axis. However when they get to the worked example with both ends fixed they leave the moment of inertia uncalulated (left just as $I$). I am wondering how one would calculate the moment of inertia for such a beam. Is it even defined?
Comment: Note that the $I$ in $T=I\,\omega$ is completely different from the $I$ in $M = E\,I y''$. Apparently this Prof. in the department of Mathematics in NJIT does not have an engineering background.
Comment: A flexed beam is not rotating about a fixed axis. The end if the beam is not rotating and the further away you go the more rotation you have, in a non linear fashion. A rotation as defined in dynamics implies deflection simply proportional to distance.
Answer: The area moment of inertia for beams is defined from the geometry of the beam cross section and not from the end conditions. It is defined as $I_{xx} = \int (y^2+z^2)\,{\rm d}A$ and has units of LENGTH4. The $x$ and $y$ values are usually displacements from the neutral axis which lies along the centroid.
The same equation holds regardless of the end conditions. The end conditions define the constants of integration when getting $y(x)$.
Example
Rectangular beam with elasticity $E$ and length $L$ is loaded in the middle by force $P$, and fixed at the ends.

Look up in the lists of area moments $I_{xx} = \frac{b^2+h^2}{12}$ where $b$ is base of rectangle cross section and $h$ the height.
The internal moment a distance $x$ from one of the ends (I call A) is $M(x)=M_A - x\,A_y$ with $A_y$ the vertical reaction force, and $M_A$ the reaction moment at A. Force and moment exist in order to enforce the no displacement and no slope at A constraints.
The deflection shape is $$ y(x)  =C_0 + C_1 x + \int \int \frac{M(x)}{E I}\,{\rm d}x\,{\rm d}x = C_0 + C_1 x +\frac{x^2 \left(3 M_A + x\,A_y \right)}{6 E I} $$
The end conditions at A are $y(0)=0$ and $y'(0)=0$ (with $y'$ denoting slope) yielding $C_0=0$ and $C_1=0$  $$ y(x) = \frac{x^2 \left(3 M_A + x\,A_y \right)}{6 E I}$$
In the middle of the beam the slope must be zero (due to symmetry) and thus $y'(\frac{L}{2})=0$ yielding $$M_A = \frac{A_y L}{4}$$.
The total reaction force must be equal to the applied load and thus $A_y=\frac{P}{2}$
The deflection shape is now
$$ \boxed{ y(x) = \frac{P\,x^2 \left(3 L-4 x\right)}{48\;E\,I} }$$
Answer: I am not an expert in this and since I couldn't comment I'll just leave what I have to say here.
Look up the Parallel Axis Theorem:
$I_A = I_{COM} + Mh^2$
Where $I_A$ is the moment of interia at any point, $A$, of the object, $M$ is the mass of the object and $h$ is the distance from the COM (Centre of Mass) to the point $A$. $I_{COM}$ is the moment of intertia around the centre of mass.

Ignore $d$ from the diagram; I just wanted to show you the typical set up of the problem.
Comment: Yes, but with area, not mass. $I_A = I_C + A\,d^2$ where $A$ is the cross section area and $I_C$ the area moment about the centroid.
Comment: You are confusing mass moment of inertia, with area moment of inertia. The first is used in dynamics, and the second in statics.
Comment: Are you saying that because of the diagram? As in: it should not be a 3D object. I should have found a better example. Or maybe the Parallel Axis Theorem isn't the correct method for this question?

Moment of inertia around two axes


Remove Query String from Google jQuery

Question: Was wondering if anyone knew of a way to remove the query string from external Javascript sources, such as Google's jQuery.
Thanks in advance for any help
Answer: Filter 'script_loader_src', you get the source URL as first argument. Then run remove_query_arg() on this URL and return the shortened version.
Sample code:
add_filter( 'script_loader_src', 'remove_script_version_parameter' );

function remove_script_version_parameter( $src )
{
    return remove_query_arg( 'ver', $src );
}

Comment: I'm not exactly sure what you mean, but sounds like a solution. My thing is, I use CloudFlare, and I'm trying to remove the query code from their JS. Not really something im enqueueing or anything
Comment: See my update. It work with enqueued scripts only. Hard coded scripts should never be used, because there is no API for these.

Remove Query String from Google jQuery


Is Newtonian reaction produced from photon radiation pressure?

Question: Is there any quantum explanation of Newtonian Reaction other than photon pressure? I.e. when I put my foot on the ground is it supported by slightly above ambient temperature infrared radiation?
Comment: Does this answer your question? [Forces other than the fundamental interactions, e.g. friction](https://physics.stackexchange.com/questions/129190/forces-other-than-the-fundamental-interactions-e-g-friction)
Comment: No. It seems to me all forces are produced by photon exchange. We are told they are force carrying bosons. Friction produces forces just like gravity etc- matter is distorted away from equilibrium and photons are produced.
Answer: I think when you put your foot on the ground, it is supported by the repulsion between the electrons in the quantum shells of 1. the compounds on the sole of you shoe and 2. the floor material
Comment: Yes but when a quantum shell is perturbed by a load it emits a photon surely? So it's all photons...
Answer: It seems to me that you may be confusing the classical phenomenon of photon pressure or radiation pressure with the quantum field theory interpretation of virtual photons mediating electromagnetic interactions.
photon pressure
Photon pressure is a classical phenomenon that can be explained in terms of electromagnetic waves or photons.  It is a consequence of conservation of momentum.
A single photon's momentum is determined by its frequency through the energy-momentum relation in special relativity. When a photon collides with an object it imparts momentum.  If the photon is absorbed by the object, the stuck together object-photon system will have the same momentum as the photon did originally.  If the photon reflects back, the object will gain up to twice the photon's original momentum (depending on the angles).  In the maximal case:
$$ p_i = p_f $$
$$ +p_\mathrm{photon} = -p_\mathrm{photon} + p_\mathrm{object}$$
$$ \implies p_\mathrm{obj} = 2p_\mathrm{ph}.$$
From Newton's second law we see the object's change in momentum as a force, $\vec{F} = \frac{d\vec{p}}{dt}$.  In order to average the effect of many photons spread out over a macroscopic object it can be helpful to define a pressure, $P = F/A$, from this force.
The same momentum argument would apply if we thought about an EM wave colliding with an object.  In that case we would calculate the momentum of the wave using classical electrodynamics rather than S.R.  When we are talking about large numbers of photons that make up a classical EM wave, we'd get the same answer.
The photons in this description are real, energy carrying photons that physically collide with the object.  In a classical description the contact force of the ground pushing up on you is not from photons.  In order to be supported by photon pressure you would need an incredible source of light shining up on the small area of your feet.
contact forces
You may have heard that the contact force of the ground pushing up on your feet is actually an electromagnetic force.  It is.  The electrons in the atoms that make up your feet (or shoes) are repelled by the electrons in the atoms that make up the ground.  The atoms don't touch at all.  There is a non-contact electrostatic force.  This force is very different from photon pressure.  The ground doesn't make light that shines upward, the electric fields of the ground and your feet interact, resulting in a force that obeys Coulomb's law.
Answers to the question I linked in a comment discuss how all contact forces, like friction and normal forces, arise from the four fundamental forces like the electromagnetic force.
quantum field theory
In the quantum field theory (QFT) description of the universe, everything is just a bunch of quantum fields.  Interactions between particles or wavefunctions are mediated by gauge bosons: photons for the electromagnetic force, gluons for the strong nuclear force, and W and Z particles for the weak nuclear force.  Like the regular quantum wave-particle duality we can think of things like photons and electrons as particles or wave-packet like excitations of the underlying quantum fields.
In the wave way of thinking about QFT the two interacting electrons aren't particles at all. We might think of them as wave packets on the field that don't have well defined spatial extent.  We can interpret their interaction as resulting from the overlap of their wavefunctions into a common wavefunction, like the interference of classical waves.  Within the same paradigm it might even make more sense to say that their isn't a defined number of electrons, there is only single wavefunction and we could calculate the expectation value for observing two electrons given the field configuration, but there may be some non-zero probability we would observe one or three.
In this framework the electromagnetic interaction is wrapped up in the evolution of the wavefunction and there is no call to photons, real or virtual.
In a particle focused description we could say that the electrons are two separate point particles and the electromagnetic interaction between them is mediated by an exchange of virtual particles.  One electron loses momentum by emitting a virtual photon, and the other gains momentum by absorbing it.  This interaction is notably about virtual photons not real ones.
This framework is helpful when keeping track of the perturbation series to calculate the outcome of the interaction.  The sum over paths formalism says that this interaction isn't just from the exchange of one virtual photon.  There is a superposition of an exchanges: an exchange of one photon, an exchange of two photons, an exchange of four ... In this interaction series there will be terms that involve the exchange of virtual electrons and positrons too.  There are even terms in the interaction series with exchanges of virtual gluons and quarks from the strong nuclear force and virtual W and Z particles and neutrinos from the weak nuclear force.
It is important to note that these are not real particles.  In no "path" for the interaction where an emitted photon misses the target electron, so it could be observed separately.  These virtual particles don't necessarily exist.  They are a tool used to keep track of the series approximation to the full calculation.
but what's really happening?
I think confusion like this stems from the fact that there is no coherent description of "what is really happening" in quantum mechanics.  Adherents of the Copenhagen interpretation would say that it doesn't matter what's really happening.  We calculate observables, who cares what happens under the hood.  Many of us try to make sense of what is really happening by using mental models and analogies to classical mechanics.  But there is no definitive statement about what "really" happens when two electrons interact.
One thing to remember is that terms like photon pressure and force carrier particles have very specific definitions based in particular formulations of theory.  I think everyone can agree that:

The contact force of the ground pushing on your feet is not photon pressure.

There is a formulation of quantum field theory where the force of the ground pushing on your feet is mediated by the exchange of virtual particles, including photons.
Comment: Paul T.Thank you very much for such a detailed response.
Comment: Paul T.Thank you very much for such a detailed response. You go to the Wave Equation then invoke unobservable Virtual Photons (the usual view) to produce a fictional rigidity in a structure agreed to be oscillating. But this doesn't escape the need for a rate of momentum transfer process sufficient to produce equilibrium of the load. Every electron going round an atom produces a current of very roughly 16 amps- we're not short of options when it comes to real observable fields. Have we considered them all? Recall van der Waals forces exerting one atmosphere of pressure at 100 atoms distance.


What is the effective "range" of a Falcon Heavy rocket with a very small payload?

Question: Theoretically, If I decided to blow millions of dollars on a Falcon Heavy launch, simply to launch a 2kg cubesat as far as possible, how far could i send the payload assuming no gravity assists?
Comment: Here's the process: How much can a Falcon Heavy throw to orbit? Now, what's the largest + most efficient upper stage that can fit in that payload mass. (It's probably a nuke powered ion drive or something). How much dV can you get out of that thing? Boom, there you go
Answer: Perhaps the best metric for this proposition is characteristic energy (C3). Luckily NASA provides a launch vehicle performance calculator for high energy (C3 defined) launches that includes the Falcon Heavy.
I made a curve fit of the Falcon Heavy expendable launch mass values:

(Personal work, data from NASA launch vehicle performance calculator)
An extrapolation of this curve fit shows the curve intersecting the 0 kg (~2 kg) launch mass at a C3 of about 110 $km^2/s^2$:

(Personal work via Desmos)
This approximately translates to a heliocentric apoapsis near Saturn (~10 AU, calculation based on the $v_{\infty}$ of 10.5 km/s added to Earth's ~30 km/s at 1 AU).
Extending the premise of the question further with the addition of a STAR-48B kick stage brings things into ludicrous territory. Using an algorithm I previously developed to determine the added performance a STAR-48B kick stage provides, I estimate that a 2 kg mass can be thrown with a C3 of 365 $km^2/s^2$.
For reference New Horizons launched with a C3 of 158 $km^2/s^2$, which was a direct solar system escape trajectory regardless of its Jupiter and Pluto encounters. The ridiculous 365 $km^2/s^2$ enables an Earth-Jupiter direct transfer in just 255 days:

(Personal work)
And an Earth-Mars direct transfer in just 52 days:

(Personal work)
And an Earth-Pluto direct transfer in just 6.5 years:

(Personal work)
Comment: ah, the launch vehicle performance calculator was what I was trying to remember.  I knew the numbers for Falcon Heavy were out there.
Answer: According to a table in the Falcon Heavy Wikipedia article, the rocket could send 3.5 tons to Pluto. This suggests that even a moderately-sized probe could achieve solar system escape velocity, ultimately achieving a distance of perhaps 60,000 light years in a few billion years as it revolves around the galaxy at a slightly different rate.
Getting beyond a few tens of thousands of light years would require velocities closer to the galactic escape velocity of 550 km/sec, not achievable using current technology.
Comments have called into question whether the Wikipedia table can be correct, and indeed it does not seem to have a citation. But the example of the New Horizons and Voyager probes, launched by smaller rockets, are supportive.
New Horizons was launched directly onto a solar escape velocity trajectory using the Atlas V 551 configuration, which seems to have a lower capacity to LEO than the Falcon Heavy.
Voyager I and II, launched on the significantly smaller Titan IIIE, were also suggestive. For instance, see this graph, indicating that Voyager II was near escape velocity when it left Earth.
In all of these example cases there was an upper stage in the Star family. Such an upper stage might be necessary in this case.
Comment: I decided to edit my answer to reflect your input. I didn't incorporate your above 11 km total delta-V estimate because I wasn't sure how to turn that into a real answer and I thought it would be better if that was your answer anyway. I'm not sure my answer even still deserves to be there, but at least it's honest about its uncertainty.
Comment: Mark Foskey - what is the total(final) Delta-V for a minimal payload after first and second stages complete their burn?
Comment: Mark Foskey - I agree. From circumstantial information it appears that without gravity assist, on existing chemical energy engines, we cannot go beyond Jupiter.


docker command line list arguments

Question: When I am starting the docker daemon I am modifying the dns server so that the containers have a modified /etc/resolv.conf. Looking at the usage message I see:
$ docker --help
Usage: docker [OPTIONS] COMMAND [arg...]

A self-sufficient runtime for linux containers.

Options:
  --api-enable-cors=false                    Enable CORS headers in the remote API
  -b, --bridge=""                            Attach containers to a prexisting network bridge
                                             use 'none' to disable container networking
  --bip=""                                   Use this CIDR notation address for the network bridge's IP, not compatible with -b
  -D, --debug=false                          Enable debug mode
  -d, --daemon=false                         Enable daemon mode
  --dns=[]                                   Force Docker to use specific DNS servers
  --dns-search=[]                            Force Docker to use specific DNS search domains
  -e, --exec-driver="native"                 Force the Docker runtime to use a specific exec driver

... etc ...

The --dns is what I want to pass, it shows a 'list' with the [], which after much trial and error I finally got this to work:
--dns 127.0.0.1 --dns 220.127.116.11

which deposits :
nameserver 127.0.0.1
nameserver 184.108.40.206

in to the /etc/resolv.conf file.
Is this the correct way to provide a list to docker (and presumably any go) program?
Comment: It's the way they are using the flag package. Many go programs use flags for list options like this, but there's no reason they can't use a quoted list, or comma delimited list.
Answer: This is a way of passing multiple arguments to a program in Go but certainly not the only way. This is accomplished by defining a type that implements the Value interface. The flag package on flag.Parse() iterates though the argument list matching the name to a registered Value and calling the Set(string) function on the Value. You can use this to append each value of a given name to a slice.
type numList []int

func (l *numList) String() string {
   return "[]"
}

func (l *numList) Set(value string) error {
    number, err := strconv.Atoi(value)

    if err != nil {
        return fmt.Errorf("Unable to parse number from value \"%s\"", value)
    }

    *l = append(*l, number)
    return nil
}

This new type can be registered as a flag variable. In the following example the application takes n num command line arguments that are converted to an integer and added to a list.
var numbers numList

func main() {
    flag.Var(&numbers, "num", "A number to add to the summation"
    flag.Parse()

    sum := 0
    for _, num := range numbers {
       sum += num
    }

    fmt.Printf("The sum of your flag arguments is %d.\n", sum)
}

This could have been easily done with a string flag and have users pass a delimited list. There is no established convention within the Go language and each application can provide whatever implementation of best fit.

docker command line list arguments


Unable to download PDF from Sharepoint

Question: Can someone assist me, why can't I see option to download in sharepoint 2016?
cheers,
Emma.
Comment: Please provide more details/screen shot to understand better.
Answer: You probably don't have the download permission - this link explains this in detail - compare the View Only permissions to the Read permission.  If you are in a View Only security group, you would not be able to download.

It's possible that the Sharepoint Admin has restricted access to the place this file is saved to make it 'read only' but not downloadable.  Check with SP Admin.  Then ask them to check one of your colleagues who is in the same user group (security group) you are in, for the sake of comparison.
If it is nothing to do with the download permissions, this post suggests some alternative reasons, for instance there Document Library that hosts the pdf file might be configured to restrict download - as user DvG says in his answer: You can set "Download to Offline clients" as No at your library level settings. Go to Library Settings --> Advanced settings --> select NO To download
I hope this helps

Unable to download PDF from Sharepoint


Websphere CE (Community Edition) fails to load properties from file to InitialContext

Question: my web app works good on tomcat server, now i am porting it to Websphere CE,
app reads properties file & load it to IntialContext, if I run the app using

tomcat >> InitialContext ic has env variable and properties are loaded in env

but in

Websphere CE >> InitialContext ic has env variable and  env is empty

and app is failing?
just to add
in both cases (running on tomcat or websphere CE), InitialContext has variable myProp which has all properties from the file... which means properties file was read ..
I have properties file in classes dir and call a service from third party jar file, using debugger & decompiler I could found above difference, but now stuck here?
can you please share tips/suggestions in this case?
thanks...
Answer: Fixed this issue by adding jboss jars (used for NJDI) in endorsed directory of WAS-CE.
But now facing SocketTimeout while getting remote object.
How/where can we set sockettimeout property of WAS-CE ?


Does hosting a relay on the same machine as your browser improve anonymization?

Question: For the sake of argument, let us assume that all traffic is monitored and recorded at your ISP. Would hosting a Tor relay on the same machine that you are running Tor Browser Bundle protect you from some forms of traffic analysis?
Answer: Yes it does, however you have to distinguish between two kinds of protection

If you run a relay-only setup with no exits allowed, you make it harder for an attacker to measure your activity and compare it with the activity on certain websites, especially when you let the relay on all the time

If you run an exit node it will give you plausible denyability, because it may not be you visiting a certain website or using a certain service

However please keep in mind that from time to time people abuse exit nodes and it might result in house searches or letters and emails to you or your ISP. Depending on the type of complaint and the attitude of your ISP it may have negative effects for you. You can reduce the chance for this by only allowing certain ports or just stick to running an non-exit-relay.
See also the official FAQ:

Yes, you do get better anonymity against some attacks.
The simplest example is an attacker who owns a small number of Tor relays. He will see a connection from you, but he won't be able to know whether the connection originated at your computer or was relayed from somebody else.
There are some cases where it doesn't seem to help: if an attacker can watch all of your incoming and outgoing traffic, then it's easy for him to learn which connections were relayed and which started at you. (In this case he still doesn't know your destinations unless he is watching them too, but you're no better off than if you were an ordinary client.)
There are also some downsides to running a Tor relay. First, while we only have a few hundred relays, the fact that you're running one might signal to an attacker that you place a high value on your anonymity. Second, there are some more esoteric attacks that are not as well-understood or well-tested that involve making use of the knowledge that you're running a relay -- for example, an attacker may be able to "observe" whether you're sending traffic even if he can't actually watch your network, by relaying traffic through your Tor relay and noticing changes in traffic timing.
It is an open research question whether the benefits outweigh the risks. A lot of that depends on the attacks you are most worried about. For most users, we think it's a smart move.
Comment: Thanks for the link to the FAQ - I hadn't seen that.
But, from what you pasted I think the answer to my question is 'no'. The third paragraph states " if an attacker can watch all of your incoming and outgoing traffic, then it's easy for him to learn which connections were relayed and which started at you" which is what my original question was.
Comment: @Ivar you are right, but it really depends on what the attacker does and analyzes exactly.
Comment: "*It is an open research question ...*" Is this true now, 2 years after this answer was written? The FAQ itself has no timestamp, so maybe this statement is even older than 2 years. What results did researchers find since then?
Comment: *"If you run an exit node it will give you plausible denyability, because it may not be you visiting a certain website or using a certain service"* this is likely to be untrue in many situations, and will also harm your *actual* deniability of other users traffic.


Maintaining jobs history in apscheduler

Question: I am using apscheduler to schedule my scrapy spiders. I need to maintain history of all the jobs executed. I am using mongodb jobstore. By default, apscheduler maintains only the details of the currently running job. How can I make it to store all instances of a particular job?
Answer: If you want such extra functionality, add the appropriate event listeners to the scheduler to detect the adding and any modifications to a job. In the event listener, get the job from the scheduler and store it wherever you want. They are serializable btw.

Maintaining jobs history in apscheduler


remove chamberlain wall unit

Question: How do i remove below wall unit? I need to replace it with a new one
Comment: I haven't seen a chamberlain garage door control exactly like that one, however typically with chamberlain/Liftmaster the lighted part (which is the button) is hinged and flips up. Anyway the screws should be behind that big nightlight type button.
Answer: It looks like this one which has a manual, which says:

Remove the push button cover by gently prying off the top edge with a screwdriver
Comment: Yep. You can probably just press down on the top of the button with your fingers. They're usually fairly loose.

remove chamberlain wall unit


What is Tsunade's chakra element?

Question: In the series, she is celebrated as the world's best medical-nin, and is one of Konohagakure's Legendary Three Ninja. What is her chakra element?
Answer: I don't think it was officially announced. It's just like Sakura's case.
From Naruto Wikia, we find that:

Tsunade's Nature Types consists of Fire,  Lightning, Earth, Water, Yin (anime only) and Yang Release.
Comment: You can of course just use RAW chakra as well (rasengan anyone?) which is what the enhanced punches were, compressed chakra that is precisely released on impact, though Medical ninjutsu is probably Yang type.

http://naruto.wikia.com/wiki/Chakra_Enhanced_Strength

What is Tsunade's chakra element?


Is there any other way to get metadata of report except analytics api?

Question: In my project, there is a requirement for fetching metadata from report. I have found that salesforce provides analytics api for this. but my question is there ant other way? I am a fresher in salesforce. Please Help.
Comment: Do you want the data or the metadata?
Comment: I want both data and metadata
Answer: To get data, you can export reports as excel documents directly from the ui. For metadata, the easiest thing to use would be the force.com ide, ant migration tool, or a similar tool. If you are just starting out, my advice would be look at the existing tools first see what they can do.
If they aren't going to work for what you want to do, the analytics api is certainly good for working with reports. If you just want to export a lot of raw data, the bulk api is nice (The Data Loader is an existing tool you could look at first). If you just want to work with report metadata, there is a metadata api that will allow you to retrieve and deploy metadata.
Comment: We have a requirement to access report metadata and report data through apex class and display result in Visualforce page.

Based on above discussion I think the best approach to access report metadata and report data though apex class would be Analytics API. Please confirm.
Comment: @Kaushal This is probably where you would want to start: [Salesforce1 Reporting API via Apex](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_analytics_intro.htm). I believe the Analytics api refers to the REST webservices usually used for accessing report data and metadata in external apps.


To solve non-linear Integro-differential equation

Question: I am just begin to study integral equations, in which i come with following problem regarding second kind Volterra non-linear integro-differential equation,
$$u'(x)=-1+\int_{0}^{x}u^{2}(t)dt$$ with the initial condition $\displaystyle u_{0}(x)=-x$.
I want to know the exact solution of above problem i don't know how to proceed.... Thanks in advance....
Answer: We derive
$$u''(x)=u(x)^2$$
By trial and error I found that $u$ could be
$$u(x)=\frac6{(x+k)^2}$$
where $k$ is a constant that can be easily computed from your integro-differential equation (I obtained $k=\sqrt 6$). I don't know if there are more solutions.
By the other hand, I don't understand that initial condition: $u_0(x)=x$. Isn't that a function definition? What is exactly $u_0$?.
Answer: $u'(x)=-1+\int_0^xu^2(t)~dt$
$u''(x)=u^2(x)$
According to http://www.wolframalpha.com/input/?i=u%22%3Du%5E2,
$u(x)=\sqrt[3]6~\wp\left(\dfrac{x+C_1}{\sqrt[3]6};0,C_2\right)$
But I don't know how to substitute $u'(0)=-1$ .
Answer: The equation implies $u''(x)=u(x)^2$ when differentiating. Multiply by $6u'(x)$ to obtain $6u'(x)u''(x)=6u(x)^2u'(x)=3(u'^2)'(x)=2(u^3)'(x).$ Therefore, $3u'(x)^2-3u'(0)^2=2u(x)^3-2u(0)^3,$ which is equivalent to $$u'(x)^2=\frac23[u(x)^3+C_0],$$ where $$C_0=\frac{u'(0)^2}2-\frac{u(0)^3}3.$$ This implies the restriction $u(x)^3\geq-C_0,$ which is equivalent to $u(x)\geq-\sqrt[3]{C_0}.$ The case where $u(x)=-\sqrt[3]{C_0}$ is excluded, unless $C_0=0,$ and the reason for this is because, after multiplying by $u'(x),$ the equation $6u'(x)u''(x)=6u(x)^2u'(x)$ is trivially satisfied whenever $u'(x)=0,$ but this is not so for $u''(x)=u(x)^2$ unless $u(x)=0,$ which satisfies it. Therefore, for the non-trivial solutions, we must have $u(x)\gt-\sqrt[3]{C_0}.$ With this having been said, there are now two possible equations, $$\frac1{\sqrt{u(x)^3+C_0}}u'(x)=-\sqrt{\frac23}$$ $$\frac1{\sqrt{u(x)^3+C_0}}u'(x)=\sqrt{\frac23}$$ Consider a function $W_{C_0}:\left(-\sqrt[3]{C_0},\infty\right)\rightarrow\mathbb{R}$ such that $$W_{C_0}'(t)=\frac1{\sqrt{t^3+C_0}}.$$ Therefore, $$W_{C_0}[u(x)]-W_{C_0}[u(0)]=\pm\sqrt{\frac23}x,$$ or simply, $$W_{C_0}[u(x)]=W_{C_0}[u(0)]\pm\sqrt{\frac23}x.$$ This is the implicit solution, and one cannot go any further without analyzing $W_{C_0}.$ In the special case that $C_0=0,$ we have that $$W_0'(t)=t^{-\frac32},$$ implying that $$W_0(t)=K-\frac2{\sqrt{t}}$$ is possible, meaning that $$-\frac2{\sqrt{u(x)}}=-\frac2{\sqrt{u(0)}}\pm\sqrt{\frac23}x,$$ and you can do the rest.
The interesting case is when $C_0\neq0.$ According to Wolfram Alpha, $$W_{C_0}(t)=K+\frac{t\sqrt{\frac{t^3+C_0}{C_0}}\,_2F_1\left(\frac13,\frac12;\frac43;-\frac{t^3}{C_0}\right)}{\sqrt{t^3+C_0}}.$$ Therefore, $$\frac{u(x)\sqrt{\frac{u(x)^3+C_0}{C_0}}\,_2F_1\left(\frac13,\frac12;\frac43;-\frac{u(x)^3}{C_0}\right)}{\sqrt{u(x)^3+C_0}}=\frac{u(0)\sqrt{\frac{u(0)^3+C_0}{C_0}}\,_2F_1\left(\frac13,\frac12;\frac43;-\frac{u(0)^3}{C_0}\right)}{\sqrt{u(0)^3+C_0}}\pm\sqrt{\frac23}x.$$ There is the implicit solution. The function $\,_2F_1$ is the hypergeometric function.


Install older versions of tor browser in linux?

Question: This is a simple question probably asked before, but can you make the linux torbrowser launcher, install an older version of torbrowser? The torbrowser launcher settings give no option to do this, so it just installs the latest. Regardless of older versions having more bugs and vulnerabilities, you can install the older versions manually, but this doesn't seem the same as when it is installed using the launcher.
Answer: That's not possible unless you were to hack the code of torbrowser-launcher yourself. The reason for that is because every new version includes code fixes to help ensure your anonymity online. Using an old version would make yourself more at risk.
However, it's your computer and you can do with it as you like. Here is the original github if you want to tinker with it.
Answer: Basically, you'll never need it: because new versions are containing not just some improvements, but also a security fixes, so "the last is a must". However, if you need to test some on the real old code - the best, but not the easiest way - is to set up your CI/CD like Jenkins and to pinpoint a spot where you want to freeze the code precisely. After that - just build it and here you go. This approach also fixes the issue if there's no pre-built binary for your system/setup or if it has some issues. Old releases of the launcher will and has to pull the tool for the latest version - that's what it's built for, so that's why there's no command line switch for that kind of behavior
Answer: Yes, you can.
Download the tarball, extract it and put it in a different folder.
Let's say I want to use 11.0.9 and 11.0.8 versions.
the 11.0.9 version:
wget -c https://www.torproject.org/dist/torbrowser/11.0.9/tor-browser-linux64-11.0.9_en-US.tar.xz
tar -xvf tor-browser-linux64-11.0.9_en-US.tar.xz
mv tor-browser_en-US tor-browser_en-US_11.0.9

and the 11.0.8 version:
wget -c https://www.torproject.org/dist/torbrowser/11.0.9/tor-browser-linux64-11.0.9_en-US.tar.xz
tar -xvf tor-browser-linux64-11.0.8_en-US.tar.xz
mv tor-browser_en-US tor-browser_en-US_11.0.8

to run any of them basically just run start-tor-browser.desktop that found in each folder.
And about the launcher, well, you can add one from the terminal:
./start-tor-browser.desktop --register app
and for the next version all what you have to do is to duplicate the ~/.local/share/applications/start-tor-browser.desktop:
cp ~/.local/share/applications/start-tor-browser.desktop ~/.local/share/applications/start-tor-browser_2.desktop

and now you edit start-tor-browser_2.desktop:

change the folder in the Exec so it points to the other version

rename the app so you can easily know which version you are using (optional though)

here is how it looks:

That's it, you can do the same to run as many versions of tor as you want to!


How to re-upload an image but not removing it

Question: I have an image field which has 1 value limited. I need to change the uploading photos frequently, and I hope the old images will not be removed. Is it possible to achieve this?
Comment: Drupal version?
Comment: Drupal version: 7
Answer: It's not really clear what you're trying to achieve, but basically there are two ways to go:

Don't use an image field, but use an "entity relation" to a media entity instead. (Media is a core module >= Drupal 8.4, or a contrib module <= Drupal 8.3)
User revisions: Create a new revision of your node every time you update the image field. You then can view older versions of the image in the version history of your page.
Comment: "Contrib" means it is a community contribution, published on Drupal.org - The module's name is [Media](https://www.drupal.org/project/media)
Comment: Thanks Hudri so much for your quick response:) I'll take a try
Comment: Dear Hudri, now I have the "Media" module. And I added a "File" field and select "Media Browser" widget. while editing this "File" field there are 2 buttons -- "remove" and "edit". I tried the "edit" function, I re-uploaded a new image, and the former uploaded image is removed. Is it possible not to remove the former one?
Comment: You should not edit, but remove and create a new media entity. I don't know about this module in D7, but in D8 there is an option to hide the edit button in the form display settings.
Comment: Thanks Hudri, actually I want to keep but not remove the old uploaded images. Is that possible?
Answer: For those who really think that they want to hack core: Open includes/file.inc and look for the function drupal_unlink. Add return FALSE; as the first line and NO files will be deleted. Better yet, add a conditional statement that checks the $uri to ensure that it is a file that you don't want to delete.
I got above solution here,
How to keep underlying file when deleting a Filefield value


Does a norm ball around a real matrix contain all possible pairs of complex spectrum?

Question: We consider the normed vector space $(M_n(\mathbb R), \|\cdot\|_F)$, i.e., real matrices with Frobenius norm. Let $A \in M_n(\mathbb R)$ be a diagonalizable matrix and have all eigenvalues to be real. Let $B_A(\varepsilon)$ denote the open norm ball with radius $\varepsilon > 0$, i.e.,
\begin{align*}
B_A(\varepsilon) =\{ E \in M_n(\mathbb R): \|A-E\|_F < \varepsilon\}.
\end{align*}
We know the complex eigenvalues of a real matrix must be conjugate pairs. My question is: for any combination of real or complex conjugate pairs of eigenvalues, is there always a matrix $E \in B_A(\varepsilon)$ has the spectrum with the same number of real and complex conjugate pairs. To be more clear, let $n = 2k$ be even, I would like to know whether there are always matrices in the norm ball such that have eigenvalues with $1$ complex conjugate pair, $2$ pairs, and so on until $k$ pairs of conjugate eigenvalues.
Comment: If the eigenvalues of $A$ are real and distinct then so are the eigenvalues of any nearby matrix (if you deform a bit the coefficients of a real polynomial with all roots real and distinct then the deformed polynomial has the same property, say by the implicit function theorem). So the answer is no.
Comment: @user8268 Why don't you flesh that out to an answer!! It is so much simpler than my argument. Not needing an orthogonal basis of eigenvectors and all that :-)
Answer: If the eigenvalues are distinct, then nearby matrices must also have $n$ distinct real eigenvalues as observed by user8268 in the comments.
On the other hand, if the eigenvalues of $A$ are not distinct, then there can be a complex conjugate pair of eigenvalues near $A$.  For example,
$$
\lVert I_{2\times 2}-R_\theta\rVert = \left\lVert\begin{pmatrix}
1-\cos\theta & \sin\theta\\
-\sin\theta & 1-\cos\theta
\end{pmatrix}\right\rVert
$$
which is $\approx C\lvert\theta\rvert$ for $\lvert\theta\rvert$ small.
So you can afford to get up to $m$ complex conjugate pairs, where $m=\sum_\lambda\left\lfloor\frac12\operatorname{mult}_\lambda(A)\right\rfloor$ and not any further.
Comment: Thanks for answering the question. Could you provide an argument for the second part? In particular, does the result depend on the diagonalizability of $A$? Does it still hold if $A$ is not diagolizable? Thanks.


Dimensioning line with QAD plugin

Question: I would like to use QAD plugin to emulate AutoCAD, especially to draw some dimensioning. There are two possibilities to do so: click on 2 points or select an object.
I want to use the object selection on a line with more than 2 vertices, I would like something like that, but with the actual length of the line (currently the length is the one between the start and end points of the line, and I did it manually with the first method) :
And when I try to use the object selection, I get a result limited by the only two vertices of the section I clicked, as such (I clicked on the almost horizontal section):

Would someone know how I could proceed to solve that?
Answer: Use the option "click on 2 points" using osnap.

Dimensioning line with QAD plugin


Classic Email Template in Lightning Component - Insufficient Privileges

Question: I used visual force components in classic email templates. Now I need to view those email templates in Lightning. So I have created Lightning component custom action to create a pop up and used iframe to get visual force components dynamically. But the issue is I am able to view email templates in pop up as System Administrator but not using other profiles.If I try to view email templates using other profiles I am getting error as Insufficient Privileges Error. I have given access to Visual force component's controller to the profile as well. Am I missing something else.Kindly suggest.
Answer: Not sure but please check 'Manage Public Classic Email Templates' and 'Manage Public Lightning Email Templates' permissions on other profiles. I think they need to be true to access email templates.


Prove that there exist always c s.t. $x(t)(y(t)+1)\leq c x(t)y(t)$ or give a counter example..

Question: I want to know if the following is true and if so how can i prove it: for some positive real valued functions of variable $t$, $x(t)$ and $y(t)$ do i have: there exist always a constant $c$ such that
$$x(t)(y(t)+1)\leq c x(t)y(t)$$ or alternatively under which assumption the aformentioned is in fact true?
Answer: Since $x(t)$ is positive, the condition is equivalent to
$$y(t)+1\le cy(t), $$
hence to
$$ c\ge 1+\frac 1{y(t)}.$$
We see that such $c$ exists if and only if $\inf y(t)>0$.
Answer: \begin{align}
& x(t)(y(t)+1)\leq c x(t)y(t) \\
\iff & y(t)+1 \leq c y(t) \tag{$x(t) > 0$} \\
\iff & \frac1c \le 1-\frac{1}{y(t)+1} \\
\iff & y(t) + 1 \ge \frac{c}{c-1} \\
\iff & y(t) \ge \frac{1}{c-1}
\end{align}
But $y$ is not necessarily bounded below (say $y(t) = \dfrac{1}{1+t^2}$), so no such $c$ exists.


Different types of giants in Tanach

Question: What's the difference between the ענקים and the רפאים of Tanakh? Both seem to be very large people. Is one a subset of the other?
Some Sources: Bamidbar 13:33 and Rashi there, Devarim 3:11
Comment: Where are these words mentioned? Why do they seem like they refer to large people?
Comment: @DoubleAA Added
Answer: They were both tall people (giants), but they are a different group of people and they lived in different areas. One of the key verses is Deuteronomy 2:10-11 (texts from Sefaria):

הָאֵמִ֥ים לְפָנִ֖ים יָ֣שְׁבוּ בָ֑הּ עַ֣ם גָּד֥וֹל וְרַ֛ב וָרָ֖ם
  כָּעֲנָקִֽים׃ רְפָאִ֛ים יֵחָשְׁב֥וּ אַף־הֵ֖ם כָּעֲנָקִ֑ים
  וְהַמֹּ֣אָבִ֔ים יִקְרְא֥וּ לָהֶ֖ם אֵמִֽים׃
The Emim dwelt therein [in the land of Moab] aforetime, a people
  great, and many, and tall, as the Anakim; these also are accounted
  Rephaim, as the Anakim; but the Moabites call them Emim.

So the Repha'im are described to be tall as the Anakim, but they are neither the Ankim or a subset of them.
In your citation of Deuteronomy 3:11:

כִּ֣י רַק־ע֞וֹג מֶ֣לֶךְ הַבָּשָׁ֗ן נִשְׁאַר֮ מִיֶּ֣תֶר הָרְפָאִים֒
  הִנֵּ֤ה עַרְשׂוֹ֙ עֶ֣רֶשׂ בַּרְזֶ֔ל הֲלֹ֣ה הִ֔וא בְּרַבַּ֖ת בְּנֵ֣י
  עַמּ֑וֹן תֵּ֧שַׁע אַמּ֣וֹת אָרְכָּ֗הּ וְאַרְבַּ֥ע אַמּ֛וֹת רָחְבָּ֖הּ
  בְּאַמַּת־אִֽישׁ׃
For only Og king of Bashan remained of the remnant of the Rephaim;
  behold, his bedstead was a bedstead of iron; is it not in Rabbah of
  the children of Ammon? nine cubits was the length thereof, and four
  cubits the breadth of it, after the cubit of a man.—

you point to the fact that Og was, in fact a Repha'ite, and, in fact Og was one of the most "famous" giants. His height is not described, here, but his bed;s length is described, thus, by inference, he was a giant similar to Anak. But, here, too, you can see that he lived in a different area than the Anakim. Also, refer to Genesis 14:5 that mentions that Chedarl'omer conquered the land of Repha'im, which explains this verse discussing that Og was the only survivor of that group.
As for Anak, see this Wikipedia article which will refer you to appropriate Torah verses.

They dwelt in the south of the land of Canaan, near Hebron (Gen. 23:2;
  Josh. 15:13). According to Genesis 14:5-6 they inhabited the region
  afterwards known as Edom and Moab in the days of Abraham. Their name
  may come from a Hebrew root meaning "strength" or "stature".[2]

It seems that the Anakim get more mention than the Repha'im and they are the ones more known as the "giants" than Repha'im. This makes sense, as they were the first giants that the spies saw, and they also lived in Hebron, even at the time that Abraham travelled and lived there! We know that the Philistines were also giants. According to the Wikipedia article (I have to further verify its linked source), they were descendants of the Anakim. So, the Anakim were around for far more years than the Repha'im.
Comment: Where is the Hebrew and English of the pesukim from?
Comment: @DoubleAA OK. I think I see your confusion. I'll edit.
Comment: Not inaccurate. [Chabad](http://www.chabad.org/library/bible_cdo/aid/9966/jewish/Chapter-2.htm#v=11) for instance has כַּעֲנָקִים
Comment: @DoubleAA Your edit overrode mine. Appreciate the help. I don't understand your last comment, though.
Comment: Your version has כָּעֲנָקִים
Answer: Rashi points out that these were different groups of of "giants". The Art Scroll commentary on Devarim 10-11 refers to Rashi and explained that the nation of Eimim were colloquially considered like Refaim "which was a different family of giants (Anakim)". However, they were not the Refaim whose territory Bnai Yisrael were going to conquer. The Eimim had been conquered by the children of Lot and their land was the inheritance of Moav. This was included as an explanation to ensure that Bnai Yisrael did not make the mistake of confusing the territories involved.

Different types of giants in Tanach


Uppercase to lowercase

Question: I have capitalized all my products title, is there a way to convert all products to lowercase?
Is there a way to do it without an extension?
Comment: Where you want to do this one?
Comment: in the title of the products
Comment: Means are you want to show into the frontend PDP page? In the admin, actually how you added the name of the product?
Answer: Yes, you can update the product titles to lowercase without using an extension by following these steps:
1.Backup your database: Before making any changes to the database, it is important to create a backup.
2.Run the update query: You can update the product titles to lowercase by running the following SQL query:
UPDATE catalog_product_entity_varchar SET value = LOWER(value) WHERE attribute_id = (SELECT attribute_id FROM eav_attribute WHERE attribute_code = 'name' AND entity_type_id = 4);

3.Run the basic CLI commands:
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy -f
php bin/magento indexer:reindex
php bin/magento cache:clean
php bin/magento cache:flush

Then check the output.
Please note that this will update all the product titles to lowercase and there is no way to undo the changes once they are made. Therefore, always try with backup and execute first in your test environment.

Uppercase to lowercase


What exactly is a dango?

Question: I recently finished watching Clannad and the ending song is about dango and Nagisa, the one that wanted to start the drama club up again, always seems to be talking about or drawing dango. But, what exactly is a dango? We know it's a food of some sort because the main male character goes and buys them from a gas station and then Nagisa eats them, but what exactly makes a dango a dango and why is there a "big dango family" anyway?
Comment: http://en.wikipedia.org/wiki/Dango   It's a sweet dumpling.
Answer: A dango is "a Japanese dumpling and sweet made from mochiko" according to Shawn Balestracci's Wikipedia link. Mochiko is mochi flour, which is made from pounded rice. The Wikipedia page lists several varieties; some of these are mentioned in the song, such as the "peaceful an dango" source.
The Clannad anime is kind of unclear about where the song and characters come from, but within the world of Clannad, it seems to be some kind of mascot merchandising franchise similar to Hello Kitty. Nagisa has a dango daikazoku pillow, for instance. IIRC, Tomoya mentions early on that the dango daikazoku is old and unfashionable, but Nagisa herself is somewhat unfashionable, so it fits her.
Dango are somewhat commonly mentioned in anime and are even part of a saying, hana yori dango, which means "dango over flowers" (i.e., put food over aesthetic pleasures like flowers) and was punned on as the title of a shoujo manga. (The manga title uses different kanji to write "dango" that can also be read as "otokonoko" or "boy"). The sense I get from other anime is that dango are a common snack among Japanese young people, so they would be attractive as a mascot character for children and teenagers, leading to the idea of the Dango Daikazoku.
Answer: I think she mentioned it about it being a tv show she sayed it used to be popular, it's mentioned in episode 2, it's kinda after half of the episode, it's when they are making a poster to recruit members, and then he says the poster is missing something and he says she can put anything on the poster and then she asks if she could put her favorite picture and he said yes that's when she starts singing the Dango song after that then she starts talking about it.
Comment: @mirroroftruth It is an answer, it just lacks some detail. Andres, please try to add some details to your answer, when does she mention that? Can you provide with a reference?

What exactly is a dango?


Difference-in-Difference, different group size

Question: Is there a specific rule to the number of units in the treatment and control group. I am trying to carry out a difference-in-difference estimation and in the treatment group I have about 9000 individuals and in the control group I have about 800 individuals.
Answer: There is no direct rule but it will be more difficult to find a treatment effect if the two groups are very different in size. For example, if your outcome $Y$ is a normal random variable then the minimum detectable effect for the average treatment effect is
$$\sqrt{\frac{\text{Var}(\widehat{Y})}{n}}\sqrt{\frac{1}{p(1-p)}}(q_{1-\frac{\alpha}{2}}+q_\lambda)$$
where $p$ is the proportion of individuals in the treatment group, $n$ is the sample size, $q$ are the quantiles from a standard normal, and $\alpha$ and $\lambda$ are the level and power that are chosen by the econometrician. The smallest minimum detectable effect is achieved if the number of treated individuals is equal to the number of control group individuals, i.e. $p=0.5$.
If you have very large differences in the group sizes then the treatment effect must be stronger in absolute value in order to be detected by your significance tests. For more information on minimum detectable effects see here.
Comment: Are you suggesting I reduce the sample size of the treatment group to a lesser amount or equal to the size of the control group.
Comment: The first best would be to increase the number of individuals in the control group but I acknowledge that this isn't often possible. Deleting individuals from the treatment group reduces the sample size, so the minimum detectable effect increases again. Whether this buys you something or not depends on the variation in the outcome. As I said: there is no rule for how many units you should have in either group but you should be aware of the potential limitations it can have.
Comment: @Andy do you have by any chance more reference about different group sizes in DD estimation?
Comment: @DJJ unfortunately not from the top of my head but I guess searching for "power calculation"/"minimum detectable effect" together with difference in differences in your preferred search engine might turn up further useful references (guess google scholar would be your best bet)


Definition of Irreducible Analytic Hyper-surface

Question: I am reading "Complex Geometry" by Huybrechts. He defines an analytic hypersurface of a complex manifold $X$ as an analytic subvariety $Y\subset X$ of codimension one i.e. dim$(Y)=$ dim$(X)-1.$ Then he defines a divisor $D$ on $X$ is a formal linear combination $D=\sum a_i[Y_i]$ with $Y_i\subset X$ irreducible hypersurfaces and $a_i\in\mathbb{Z}$ such that the sum is locally finite. I want to know the definition of irreducible analytic hypersurfaces and why it's important to consider the sum of irreducible hypersurfaces for the definition.
Answer: 1.An analytic subvariety $A$ is called reducible if $A=A_1\cup A_2$ where $A_1,A_2$ are also analytic subvarieties in $X$,distinct from $A$,if A cannot be represented in this form,it is called irreducible.
2.The sum is defined formally.It's important because we probably can define and research more,such as the degree of the divisor...Otherwise,we just discuss one single irreducible hypersurface sounds a little boring...
By the way,maybe we could imagine the sumgeometrically as the union of the irreducible divisors occurring with non-zero coefficients and "multiplicities" given by the coefficients $a_i$.(Although it maybe hard to imagine...).
When we consider effective(all coefficents of $[Y_i]$ are non-negative) Cartier divisors on schemes,we can indeed add them by taking the subscheme defined locally by the product of defining equations for these two divisors. This indeed give precise geometric meaning to the formal sum!
Comment: For $X$ a compact complex manifold then the irreducible hypersurface is represented locally as the vanishing set of an analytic function, but globally it is only one of the zeros of a meromorphic function (it is represented globally by an ideal : (the closure of) the common zero of finitely many meromorphic functions)


Forgery of video

Question: I am 79 years old and a resident of a four storey building in NSW, comprising of 26 units. The multi-millionaire Chairman of our building's Strata Committee, who lives in the fourth floor's penthouse and owns another two units in the building, acts as if he personally owns the whole building and has publicly verbally assaulted me, calling me a stupid old man who is always complaining. He controls the building's illegally installed security cameras and some months ago compiled and tampered with the cameras' downloads, within our building, purporting to falsely show me kicking in our building's rear security door and damaging the locking mechanism. He subsequently lodged a complaint with the police accusing me of Malicious Damage (a criminal offence) which, after investigation, was rejected by the police. However, he instructed our Strata Manager to publicly screen the tampered video, without my permission, at the recent AGM causing me, my daughter (who is the owner of our unit) and son in law great humiliation. Our repeated requests for the past months for a copy of the video which we want to have examined by a by a digital forensic examination company to clear my name have been rejected by the Strata Committee, what can I do?
Comment: Does "NSW" refer to New South Wales, Australia?  I added the [tag:australia] tag as a guess.
Comment: Are you seeking suggestions on what to do so that you could do it yourself instead of hiring a lawyer? Why do you think that your respectful age is relevant here?
Answer: If you are accurately representing the facts, this is a clear case of defamation. Your attorney will point out that you could sue him / them, since he apparently accused you of a crime (the accusation to the police, it's the later public accusation that counts). You can subpoena the video, in connection with a lawsuit. There is no way to force them to turn it over without a court proceeding.

Forgery of video


Which tests can be used for variables that are non-normal, but have homogenous variances?

Question: I am trying to compare the effect of two treatments (planting distance) on the growth of plants (multiple species), using the variable growth rate in diameter for multiple years.
I have 4 sets of values for the growth rate (growth rate for each treatment and data for 2 years), but with different sample sizes (by including every plant). I understand that the sample sizes can be the same if I choose plants randomly.
However, on checking for normality and homogeneity of variances, I found that one set of values are non-normal but have homogenous variances, whereas the others are non-normal and have heterogeneous variances.
Which test would be the most suitable for such data values?
Comment: I think there is no general answer without understanding your data more. Providing a histogram for each set of values would be a good start, some more mathematical theory of plant growth would also be great (if available). Note that it is not surprising that growth rates are non-normal as (I assume) negative growth rates do not occur while normal distribution would assume they are OK.
Answer: If you're just trying to test for statistical significant difference between the two treatments you could use bootstrapping to do random sample-tests.
I also highly suggest reading this article by Allen Downey on the subject of statistical testing: There is still only one test as well as Jake Vanderplas' presentation at PyCon2016 on the same subject: Statistics for Hackers - PyCon 2016
Answer: You could try a mixed model approach since it seems you have repeated measures (actually I do not understand your experiment design), if you don't have repeat measures you can use a linear model with treatments as explanatory variables. In the modelling approach you must concern only with residuals normality and variance homogeneity, even if your response are not normally distributed.


Create KML from MXD that contains map service layers like feature layers

Question: How can I create a KML (tools suggestion), provided that I have a map (.mxd) file which layers are service layers of hosted services and not local data coming from a geodatabase.
I know that the map to kml tool works only for local data and not with data coming from services.
Any ideas ?
Answer: Since ArcGIS Server 10.1, the ability to include a hosted service inside a map service has been disabled.
You should get the following error if you try to publish an mxd containing one:
ArcGIS for Server error description
Perhaps you could scrape the data from the hosted service and recreate the service.


Which are the best free Visual Studio 2008 plugins?

Question: I am new to Visual Studio 2008 (not 2010). What do you think are the best free Visual Studio 2008 add-ins or plugins? Is it there some LINT one?
Thanks
Comment: This should be a community wiki as it is fairly subjective.
Comment: It is also both very broad (different users have different needs) and specific (one specific IDE)
Answer: There is Visual Lint for example, but it's not free. In my very subjective opinion LINT is not very popular anymore.
Many use AnkhSVN for subversion access.
I personally like PhatStudio, because it helps me to browse through my C++ projects quickly.
There's also GhostDoc for creating documentation.
I can also recommend StyleCop for .NET projects. It comes with a set of guidelines/rules for code/documentation quality and provides style guides.
The list is pretty extensive, depends on personal preference and cannot ever be complete.
There's even a list on Wikipedia  which contains un-free plugins, too.
Microsoft itself has a gallery with plugin/extensions, etc for Visual Studio which can be found here.
Comment: +1 for AnkhSVN and GhostDoc (http://submain.com/products/ghostdoc.aspx)
Answer: PowerCommands is pretty nice: http://code.msdn.microsoft.com/Release/ProjectReleases.aspx?ProjectName=PowerCommands&ReleaseId=559
CodeRush Express helps you quite a lot, and Code Style Enforcer is nice too.
CodeRush: http://devexpress.com/Products/Visual_Studio_Add-in/CodeRushX/
Code Style Enforcer + DXCore: http://joel.fjorden.se/static.php?page=CodeStyleEnforcer and devexpress.com/Products/Visual_Studio_Add-in/DXCore/
Answer: Bill Evjen's blog lists a few visual studio 2008 plug ins that range from simple and useful.
A good place to start looking would be the Visual Studio Gallery.
Answer: a good Spell Checker helps me out a lot (here is one for 2008, never used it though).
If you are interested in getting in to Text templeting the free version of tangible T4 Editor is pretty nice (here is the 2008 version).