Why does the thickness of a wire affect resistance?

Question: A teacher explained why by using a highway analogy. The more lanes you have, the faster the cars go through, where the number of lanes obviously represent the wire thickness and the cars represent electrons. Easy enough.
But after a certain point shouldn't the wire get so thick, that any thickness after that doesn't affect resistance? For example, if you have a 100 cars going down a highway, a 4 lane highway is going to allow the cars to move a lot faster than a 1 lane one, because there are a fewer cars per lane. But a 1000 lane highway highway is going to be as efficient as a 10000 lane one, because on both highways every car has its own lane. After a 100 lanes, the number of lanes doesn't provide resistance.
So why does increasing wire thickness always decrease resistance?
Comment: Don't think of a 100 lane highway with 100 cars vs. a 10000 lane highway with 100 cars, instead think of it as a 100 lane highway with a trillion cars vs. a 10000 lane highway with a trillion cars (or whatever extremely large number number of cars you want).
Comment: @user27379 But there is always more cars than lanes.
Comment: There is more surface area on a thick wire for electronics to travel, meaning you will have more electrons traveling through a thick wire than a thin wire.
Comment: @helloworld922 But my point still applies. A trillion cars running on 10 trillion lanes is as fast as a trillion cars running on 100 Trillion lanes.
Comment: Not an expert, but if the wire is thick enough,  wouldn't it start to behave more like a capacitor than a resistor?
Comment: @AlistairBuxton, no. A capacitor blocks dc current. There is no way that making a wire thicker will cause it to do that.
Comment: With AC, though, the current tends to flow only near the surface of the conductor ([skin effect](http://en.wikipedia.org/wiki/Skin_effect#Resistance)), and the conductivity does not scale with the cross-sectional area.
Answer: The car analogy isn't such a good one, since electrons don't actually flow from one end of the wire to the other (well they do but extremely slowly) and it implies there is some space between the cars, whereas it would be more like a traffic jam whatever the width of the highway.
It's more like a line of billiard balls, and force is applied to the first one, and the energy is transferred to the last one through all the intermediate balls (a bit like newtons cradle, although the balls don't really bounce into each other). The free electrons bounce around, occasionally being impeded (see below) with the potential difference causing an average inclination to the direction of current.
A water analogy is better - the pipe is always full of water, and for the same pump (battery), the pressure (voltage) is always lower the wider the pipe, which equates to more flow and a lower resistance.
This quote from the Wiki page on resistivity explains reasonably well:

In metals - A metal consists of a lattice of atoms, each with an
  outer shell of electrons which freely dissociate from their parent
  atoms and travel through the lattice. This is also known as a positive
  ionic lattice.4
  This 'sea' of dissociable electrons allows the metal
  to conduct electric current. When an electrical potential difference
  (a voltage) is applied across the metal, the resulting electric field
  causes electrons to move from one end of the conductor to the other.
  Near room temperatures, metals have resistance. The primary cause of
  this resistance is the thermal motion of ions. This acts to scatter
  electrons (due to destructive interference of free electron waves on
  non-correlating potentials of ions)[citation needed]. Also
  contributing to resistance in metals with impurities are the resulting
  imperfections in the lattice. In pure metals this source is
  negligible[citation needed].
  The larger the cross-sectional area of
  the conductor, the more electrons per unit length are available to
  carry the current. As a result, the resistance is lower in larger
  cross-section conductors. The number of scattering events encountered
  by an electron passing through a material is proportional to the
  length of the conductor. The longer the conductor, therefore, the
  higher the resistance. Different materials also affect the
  resistance.

Comment: You don't just "pour electrons" in to one end of the wire - they are already there.
Comment: That's the point - there would be air in the tunnel, whereas the wire is always completely "full". This is sort of the same as the water in the bucket forming an extremely thin film to cover the diameter of the tunnel, if you get my drift.
Comment: But even using the water analogy, my point still remains. A bucket of water poured through a tunnel will encounter the same amount of resistance no matter what the size of the tunnel is!
Comment: Sorry, it's hard to find a really good analogy - they all have their inaccuracies. I added a quote and a link to the Wiki page on resistance, if you read this carefully you should get a good idea of the physics. Speaking of which,  other physics sites and the [physics stack](http://physics.stackexchange.com/) would be good places to research/ask.
Comment: I don't know if it's the case but, with AC the "skin effect" also reduces the effective cross-section of the cable.
Comment: Yes, that's correct, the skin effect causes the center of the wire to have a higher impedance at AC. At very high frequencies hollow tubes or litz wire (many thin strands woven in special pattern) are used for conductors.
Answer: I'm going to approach your question in a slightly different way to try and give you a slightly more intuitive understanding of why the resistance goes down.
Let's first consider the equivalent resistance of a simple circuit:

(source: electronics.dit.ie)
When resistors are in parallel (bottom circuit in picture), the total resistance is: \$\frac{1}{R_{Total}} = \frac{1}{R_1} +  \frac{1}{R_2} + \frac{1}{R_3} ...  \frac{1}{R_n}   \$
You can see this equation in a textbook, but you might be wondering "But you added more resistors! How could that make the resistance go down?".
To understand why, let's look at electrical conductance. Conductance is the inverse of resistance. That is, the less resistive a material is, the more conductive it is. Conductance is defined as \$G = \frac{1}{R}\$ where \$G\$ is the conductance and \$R\$ is the resistance.
Now this part is interesting, look what happens when we use conductance in the parallel circuit resistance equation.
\$Conductance = G_{Total} = G_1 + G_2 + G_3 .. G_n = \frac{1}{R_{Total}}=  \frac{1}{R_1} +  \frac{1}{R_2} + \frac{1}{R_3} ...  \frac{1}{R_n} \$
We see here that conductance increases as you add more resistors in parallel, and resistance decreases! Each resistor is able to conduct a certain amount of current. When you add a resistor in parallel, you are adding an additional path through which current can flow, and each resistor contributes a certain amount of conductance.
When you have a thicker wire, it effectively acts like this parallel circuit. Imagine you have a single strand of wire. It has a certain conductance and a certain resistance. Now imagine you have a wire that is composed of 20 individual strands of wire, and each strand is as thick as your previous single strand.

If each strand has a certain conductance, having a wire with 20 strands means that your conductance is now 20 times larger than the wire with only 1 strand. I'm using strands because it helps you see how a thicker wire is the same as having multiple smaller wires. Since the conductance increases, it means the resistance decreases (since it is the inverse of conductance).
Answer: Electricity is nothing but the flow of electrons through a material. In one way, it's like a garden hose already full of water. When the water turned on (pressure applied) at the faucet, the pressure travels through the hose much faster than any particular water molecule, and water begins flowing out of the far end nearly immediately. A wire is chock full of electrons able to move when you apply a bit of electromotive force. Apply a voltage, and you don't have to wait for the first electrons in to traverse the wire, they start moving at the far end almost immediately.
Now think of a cross section of the wire . . . imagine drawing a line around the wire, perpendicular to the axis of the wire. Now imagine counting the number of electrons passing this line, through the circle that is the cross section of the wire. This is the current, measured in amps. There are a couple of ways you can have the same current. Lots of electrons drifting slowly by, or fewer electrons hauling a&& to get the same number passing through your cross section per second, and hence the same current.
How do you convince them to move faster? Apply a greater electromotive force. So in a wire with half the diameter, you'd have one fourth the cross-sectional area, which means one fourth the number of electrons available in any given length of wire to pass your line per second. What'cha gonna do to get that current up with fewer electrons available to move? You're gonna have to move them faster so that the same number can pass by per second by applying a higher voltage.
There you have it: A thinner wire requires a higher voltage to carry the same current. That's pretty much the definition of resistance, since V/I = R.
Comment: Ok so am I thinking about this vaguely right? To maintain some current x (electrons past a point per second), because the thinner wire has space for less electrons per cross sectional area, it has to move the electrons faster past a point so that is can wrack up enough past that point in the one second to equal the current x. This means that there would be more friction (or resistance) in the thinner wire due to the faster speed required.
Answer: Forget the highway analogy.  The resistance of a wire depends on 3 parameters: the conductivity of the material from which the wire is made, its cross sectional area, and its length.  Highly conductive materials, such as copper and silver, are used to manufacture wire to achieve a low resistance.  The longer a wire is the more resistance it has due to the longer path the electrons have to flow along to get from one end to the other. The larger the cross sectional area, the lower the resistance since the electrons have a larger area to flow through.  This will continue to apply no matter how thick the wire is.  The electron flow will adjust itself to whatever the wire thickness is.
Comment: Still doesn't answer "*why* does the electron flow adjust to wire thickness beyond a certain point" though.
Comment: You didn't answer the question, you just rephrased what I already know! *Why* do the electrons adjust themselves?
Comment: I'm sure Barry knows, but for others, please note that "the conductivity of the material" is itself dependent on many factors (temperature, purity, pressure, etc...)
Answer: Do you know why doesn't the car analogy works fine?
Even if we disregarded the possibility that electrons don't really actually move, you'd thing about them again as cars but not moving in straight lines!
They move in a random zig zag paths. Therefore; the more lines the less possibility the cars will ever collide even with a zig zag path.
So you tacitly assumed electrons move in staright lanes (lines) just like cars, which in that case your assumption that the thickness of the wire won't affect.
On the other hand, considering the cars to move in a non-straight lines, your assumed hypothesis won't fit your conclusion.
Comment: There are still a lot of problems with this explanation: (1) cars moving in zig-zag paths across lanes are no longer an intuitive "cars on a highway" analogy, (2) for the most part, electrons collide with the metal lattice (the "road" in the analogy) not other electrons ("cars") and that doesn't change much with a wider wire/road, (3) You still have to explain why "less possibility of collision" results in more flow (remember collisions are almost completely elastic). The electrons colliding simply means more zig-zagging, not reduced speed.
Comment: I will be answering point by point for my own opinion.

1) Yes, you're right!
We can change it to be "cars moving in streets in general". Not necessarily highways.

2) Well, yes and no!
Electron to electron collision is also one of the reasons of resistances. It's not all about the collision with the edges of the path. So if collisions in general were decreased no matter with what the electrons are colliding with, the theory still holds fine.

3) Yes, but when you have more collisions there are more energy loss in the form of heat. Note that you said "almost" completely elastic.

- Adel Bibi
Comment: You still do not correctly grasp how this works. Your response to (2) fails to grasp the basic physics. The electrons don't physically collide (like charges repel), but they do interact through the static forces. This makes the electrons behave like waves (not particles).  It is the interference of the lattice structure (the metal/road) with the electrons that causes resistance.
Comment: This resistance is caused mainly by two things. One is impurities in the metal, which cause irregularities in the periodicity of the lattice. The other is the disturbance or "vibration" of the lattice caused by heat. Since some heat is always present (except at absolute zero) there is always some resistance from this source which prevents the electrons from sailing through.
Comment: You answer to (3) remains similarly confused. The possibility of collision *for any single* electron remains the same (it is a function of material, environment, and applied voltage). The larger the cross-sectional area of the conductor, the more electrons per unit length are available to carry the current. In the context of your analogy, the highway is always full of cars. Adding more lanes also adds more cars so more cars pass through the road per unit time even though the speed hasn't changed.
Comment: Dear @DrFriedParts
I do recall mentioning the word "in my opinion". The analogy of cars is wrong from the very first. I was trying to give an example on how to give a better analogy not far from "cars on highways". Electrons have a dual wave/particle behavior. We can not guarantee so far will the 2 electrons actually collide or will they simply repel from a distance due to electromagnetic forces. LHC in Switzerland is basically built around the idea of smashing particles together in a huge particle accelerators similar to cyclotron to discover what lies inside these particles.
Comment: And this whole thing is based on a series of complex probabilities based on Schrodinger wave equation and the uncertainty principle. So, we can not say for sure if the 2 electrons will diffidently repel without colliding and losing energy in the form of heat.
Comment: So far we both agree that resistance will always be there due to some heat except for some special cases.
1) Reaching absolute zero.
2) Super conductors at certain temperatures.
But the actual value for the resistance will decrease by decreasing electron to electron collisions.
Comment: Regarding the last point "The possibility of collision for any single electron remains the same (it is a function of material, environment, and applied voltage)."
I guess you're right. I have not considered the issue of elections distribution in the material. In general, the electron distribution is uniform (electron/cm²) is almost constant. (or at least assumed to be)

I guess you're right on that.

Accept my thanks and respect to your lovely point.
Comment: Of course. Sorry if I sounded a bit harsh. That wasn't intentional. I still think your understanding of the sub-atomic physics is incorrect (especially given your recent comments about LHC and Schrodinger), but I agree with you that the highway analogy could be salvaged to explain some specific subset of the physics in play here. So thank you for your efforts. Cheers.
Comment: @DrFriedParts Thanks again! :)
Could you please refer me to a good website to check on what did I miss up regarding the LHC and Schrodinger's wave equation?
Answer:
A teacher explained why by using a highway analogy. The more lanes you
  have, the faster the cars go through, where the number of lanes
  obviously represent the wire thickness and the cars represent
  electrons. Easy enough.

What teacher should have said is :

Assume that cars travel at a constant speed and with constant spacing on a highway lane.
The amount of vehicles going past a point will be proportional to the number of lanes.
Increasing the number of lanes does not increase the speed of the vehicles. (Not quite true because cars are driven by people!)
Answer: This is a great question! - The highway / car is an excellent analogy
In this analogy, you have to consider these factors.
Your design will have a requirement for voltage - in our model, voltage is the SPEED the cars need to travel.
The design will have a requirement for current - the is the NUMBER OF CARS needed to travel down the highway. (or volume)
The wire size / resistance is the NUMBER OF LANES.
Wattage, or power, is the combination of both voltage * current, or the number of cars travelling down the highway in a given time.
The highway has to be designed to meet the specifications for both speed and volume. If you have a very small current requirement, say, 1 car, you'll only ever need a one lane highway, because your can can travel as fast as possible, (high voltage). But if you have a high current requirement, 10,000 cars, you'll need a 100 lane highway. (depending on power requirements)
But take for example, the power grid - a transmission line for a city of 1 million people. That is very roughly 300,000 households, each using 1 kw of power. That means our line needs to deliver 3 Gigawatts of power! You could do this with 1 V @ 3 giga-amps, or 3 GV @ 1 amp, or something in between.
What voltage / current would be required to make the transmission line as small as possible?


Undefined offset error, new with building arrays

Question: I am learning arrays and put this together...it works meaning I get the results I want but I am getting undefined offset errors.

$err_array = array();
$err_array[0] = array('Step 1 and 2 are empty.','chu');
$err_array[1] = array('Step 1 is empty (but optional) a','Step 1 is empty (but optional)');
$err_array[2] = array(' Step 2 is empty (and required)','Step 2 is empty (and required)');
$err_array[3] = array(' Step 3 is empty (and required)','Step 3 is empty (and required');
$err_array[4] = array(' Step 4 is empty (and optional)','Step 4 is empty (and optional)');

    # Set text color of error msg
    $counter = 0;

# line 16   while (is_array($err_array[$counter]) ) {
                $err_[$counter]     = ''.$err_array[$counter][0].'';
# line 18       $err__[$counter]    = ''.$err_array[$counter][1].'';
            $counter++;
            }

Here is the erors:

Notice: Undefined offset: 5 in /nfs/c08/h04/mnt/124078/domains/yourinternetfootprint.com/html/wp-content/plugins/wordpress_meta_box_sample_files/includes/template_yif_ealfm_get_rss_feed_parameters.php on line 16
Notice: Undefined offset: 1 in /nfs/c08/h04/mnt/124078/domains/yourinternetfootprint.com/html/wp-content/plugins/wordpress_meta_box_sample_files/includes/template_yif_ealfm_get_rss_feed_parameters.php on line 18

I know there is a cleaner way to approach taking the errors messages and assigning them to varables and wrapping some css around them...but as I said I am learning.
Comment: Check if the offset you're trying to read actually exists. `while (isset($err_array[$counter]) && is_array($err_array[$counter]) )`.
Answer: To properly iterate over $err_array you should use foreach:
foreach ($err_array as $counter => $errors) {
    if (isset($errors[0])) { // make sure $errors[0] exists
        $err_[$counter] = $errors[0];
    }
    if (isset($errors[1])) { // make sure $errors[1] exists
        $err__[$counter] = $errors[1];
    }
}

Comment: Jack, that makes so much more since...thanks. It worked and now the error is gone.
Comment: @jason that's good to know :) please accept the answer when you're happy with it.


How do I install a regional language font in Sharepoint (WSS 3.0)?

Question: I want to implement Regional Language on WSS 3.0, something on the line of google transliteration, which will give an option to the users to choose the language, without affecting the working of other users.
Answer: You just need to install the language pack that you wish to use and it will become available. The language pack needs to match your service pack level. There are instructions on how to do this for WSS 3.0 here.


Mini Split Leaking

Question: I have 2 ductless Comfort Star mini-split units that were installed by a licensed contractor. One of them drips water from the air outflow. The contractor came out, took it apart, wet vacced out the discharge line, but it still drips. I have all the service manuals, and the only recommendation for this problem is to unclog the condensate discharge tube. Self help videos suggest dirty filters preventing cold air from exiting or clogged condensate discharge. Neither of these is the problem. I disassembled the unit, cleaned the drip pan (which was filthy with accumulated wet dust), and figured I had solved the problem. But no, it still drips. Is there a design issue with these units? The contractor will tell me to replace it.
Comment: is the drip pan overflowing ? or dripping somewhere else
Comment: Thanks for replying.  The drip pan has a drain hose, which is working - I disconnected it from the external drain and am running the drain hose into a pail to remove any possibility of a clogged drain system. If the drip pan is overflowing, I don't know how.
Answer: If you want cold, you get drips.  That is the reality of how thermodynamics works.
Every evaporator (or on heat pumps, reversible condenser/evaporator) must have a drip pan underneath it.  That is just basic design competence.
The installer must provide provision for that drip pan to drain somewhere. There must be a drain hose and it must be in good working order.
The "good working order" part may be at issue. For instance if it's just a tube exiting the building, that may be getting plugged by mud wasps or other pests.  Fitting appropriate guards may be necessary.
If you're in a dry area, try not to create a mosquito paradise. Many desert cities get mosquitos solely because of A/C discharges being handled incorrectly.
Comment: OK, sure, the mini-split has a drip pan with a drain hose, connected to PVC piping that exits the house.  It is not clogged, but in any case, I disconnected the drain hose and am running it into a pail during the trouble-shooting process.
Comment: @AKG check the routing of the drain hose. Water does not go uphill, although some installers don't get the concept.  (the confusing part is syphons *do* work, but require every part of the hose to be below the entry.
Comment: Thank you for replying - as noted above, part of my trouble-shooting was to  disconnect the drain hose and route it into a bucket. There shouldn't be any problem now with a clogged drain or uphill flow. My next move is to disassemble the unit again, make sure the drip pan is clean and try to run it with the cover off to see where the leak is actually coming from. I also have a second unit which doesn't leak - maybe I'm missing some internal flashing that routes condensation into the drip pan.

Mini Split Leaking


Matrix class with lots of tiny methods

Question: I have been following the advice to make tiny methods that does just one thing and does it well. I also have been keen on reducing or eliminating duplication as much as possible.
But when a very experienced developer friend reviewed my code, he mentioned I was taking it too far. And, in short, my code was unreadable as it jumped too much killing the flow. Though I too feel I am pretty bad in naming my methods, I feel such tiny methods are helping me break down the problem and letting me solve it easily.
Challenge: Matrix Rotation (Move each matrix element to the neighboring position along concentric rectangular paths. The dimensions of the matrix are guaranteed to be even.)
Solution: matrix_rotator.rb
class Matrix
  def initialize(two_d_array: nil)
    @data = two_d_array
  end

  def rotate!(anti_clockwise: 0)
    rotated = layers
      .map { |layer| layer.map { |row, column| @data[row][column] } }
      .map { |layer| layer.rotate(anti_clockwise) }

    coordinates.zip(rotated.flatten).each do |(row, column), n|
      @data[row][column] = n
    end

    self
  end

  def to_s
    @data
      .map { |row| row.join(' ') }
      .join("\n")
  end

  def coordinates
    layers.each_with_object([]) { |layer, a| a.push(*layer) }
  end

  def height
    @height ||= @data.length
  end

  def width
    @width ||= @data.first.length
  end

  def layers
    number_of_layers.times.map do |index|
      top(index) + right(index) + bottom(index) + left(index)
    end
  end

  def horizontal_segment(index)
    (width - (2 * index) - 1).times
  end

  def vertical_segment(index)
    (height - (2 * index) - 1).times
  end

  def top(index)
    horizontal_segment(index)
      .map { |w| [index, w + index] }
  end

  def right(index)
    vertical_segment(index)
      .map { |h| [h + index, width - index - 1] }
  end

  def bottom(index)
    horizontal_segment(index)
      .map { |w| [height - index - 1, width - index - w - 1] }
  end

  def left(index)
    vertical_segment(index)
      .map { |h| [height - 1 - index - h, index] }
  end

  def number_of_layers
    [height, width].min / 2
  end
end

class MatrixRotator
  def initialize(source: nil)
    parse(source.readlines)
  end

  def result
    Matrix
      .new(two_d_array: two_d_array)
      .rotate!(anti_clockwise: @shift)
      .to_s
  end

  def parse(lines)
    parameters, *@content = lines.map(&:strip)
    @shift = parameters.split.map(&:to_i).last
  end

  def two_d_array
    @content.map { |line| line.split.map(&:to_i) }
  end
end

puts MatrixRotator.new(source: STDIN).result

Comment: You can simplify `rotate`. Rotating an array 90 degrees anti-clockwise can be done as follows: `[[2, 1], [4, 3], [6, 5], [8, 7]].map(&:reverse).transpose #=> [[2, 4, 6, 8], [1, 3, 5, 7]]`. Doing that multiple times and translating it to a `Matrix` method is straightforward.
Answer: The way you dissected the problem was a good way to get a handle on it but once you had, it reveals some refactoring opportunities.  Once you have the individual methods, you can begin to see how to build them back together
Let's begin by focusing on your two Matrix#<xxx>_segment methods.  Both have the same method signature and differ only by the use of width and height. So those could be combined to just be
def segment(index, length)   # maybe name it segment_enumerator just to be clear?
  (length - (2 * index) - 1).times
end

For top(index) then, you get
def top(index)
  segment(index, width)
    .map { |w| [index, w + index] }
end

which has the advantage of keeping width in the same function, making it slightly more readable and DRY.
Your side functions (top, right, et al.) really only differ by the block they use.  So you could write a single map_side method that just passes a block in the map.  However, because of the refactor we just did in the new #segment, a lambda helps pull it together:
def map_side(index, length, &block)
  lambda{ segment(index, length).map &block }
end

You might want to name that map_side something that means more to you in the problem domain (I know it returns an array of arrays, but didn't come up with a better name than map_side).
With that, we just use the new method to set up a quick hash of lambdas for each side, passing each the specific block you wanted:
def sides(index)
  _sides = {}
  _sides[:top] =    map_side(index, width)  { |w| [index, w + index] }
  _sides[:bottom] = map_side(index, width)  { |w| [height - index - 1, width - index - w - 1] }
  _sides[:left] =   map_side(index, height) { |h| [height - 1 - index - h, index] }
  _sides[:right] =  map_side(index, height) { |h| [h + index, width - index - 1] }
  _sides
end

Note, this is a hash of lambdas now, not the arrays you're looking for yet.  But with it, we can now write this for layers in whatever order you need:
def layers
  number_of_layers.times.map do |index|
    _sides = sides(index)
    [:top, :right, :bottom, :left].inject([]) do |array, side|
      array += _sides[side].call
    end
  end
end

A key thing to look at when you have tiny methods is whether you ended up using those methods more than once.  I like labeling things too to keep them straight (and that's always a Good Thing), but when it's just a single use, a variable name is as good as a method name.  So, we can just get rid of number_of_layers as a method.  I called it count below, but whatever works for you.
def layers
  count = [height, width].min / 2
  count.times.map do |index|
    _sides = sides(index)
    [:top, :right, :bottom, :left].inject([]) do |array, side|
      array += _sides[side].call
    end
  end
end

Now the following methods can be safely removed: horizontal_segment, vertical_segment, top, bottom, left, right, and number_of_layers.
The code is now DRYer, the width and height references are near each other for their specific uses, and you can quickly see how they stack up (in other words, your naming of elements was retained).  The one part that might throw you if you're not used to it is how I used the lambda closures to pull this off, but it's not an uncommon approach in Ruby and as you can see, a handy one.
I tested this refactor with your test suite and it ran fine.  I didn't benchmark, but it certainly didn't seem any slower and might be a little faster.
Comment: Thanks a lot for your time! I am so happy to see your answer! Made me thing well. As you rightly guessed, the use of `lambda` did get me confused; its not about how to use it. But it in the reasoning for picking lambda for the specific task.
Comment: Tried to refactor with the changes you mentioned and has updated in the repo; one thing I chose to keep was the method `number_of_layers` because I feel its better to keep such calculations away with proper naming. Anyways, thanks a lot for your very constructive comments. I appreciate the time you took.
Comment: The reason I went with lambdas was that I wanted the length for the segment to be carried through to where you needed the final map block and still make the code readable.  Since a lambda closure would retain state from the time of its creation, then it could just be set in #sides to make it easy to use in #layers.  An alternative would be to call #segment from within #layers, but since you were avoiding putting too much logic into #layers (and I agree), the lambdas seemed the easiest way to move the varied map block logic to where it was needed.
Comment: Okay, frankly I still don't follow as much. But anyways, I wouldn't have thought of listing lambda's like you did. Anyways, I am quite happy with the final refactor I was able to do with your help! Thanks a lot.
Answer: That's taking things a bit too far.
I attacked the problem you pointed me to in this way:
def read_matrix (fd) :
    m, n, steps = [int(x) for x in fd.readline().split()]
    arr = [[int(x) for x in line.split()] for line in fd]
    return (m, n, steps, arr)

def rotate_matrix (m, n, steps, arr) :
    z = (0,)*n
    out = [list(z) for x in range(m)]
    for layer in range(min(m, n) // 2) :
        rotate_layer (out, layer, m, n, steps, arr)
    return out

def rotate_layer (out, layer, m, n, steps, arr) :
    inds = clockwise_indices(layer, m, n)
    ninds = len(inds)
    brk = steps % ninds
    for (ix,iy),(jx,jy) in zip(inds, inds[brk:]+inds[:brk]) :
        out[ix][iy] = arr[jx][jy]

def clockwise_indices (layer, m, n) :
    cols = range(layer,n-layer)
    rows = range(layer+1,m-layer-1)
    return tuple((layer,col)         for col in cols) + \
           tuple((row,n-layer-1)     for row in rows) + \
           tuple((m-layer-1,n-col-1) for col in cols) + \
           tuple((m-row-1,layer)     for row in rows)

import sys
for row in rotate_matrix(*read_matrix(sys.stdin)) :
    print(' '.join((str(x) for x in row)))

Four functions, and a very simple script below the four functions.

In fact, those four functions could be rolled up into one function that still satisfies the single responsibility guideline (note the name: the function does exactly what the name says, and nothing more), and it isn't all that large:
def solve_matrix_rotation_challenge (fd) :
    m, n, steps = [int(x) for x in fd.readline().split()]
    arr = [[int(x) for x in line.split()] for line in fd]

    z = (0,)*n
    out = [list(z) for x in range(m)]

    for layer in range(min(m, n) // 2) :
        cols = range(layer,n-layer)
        rows = range(layer+1,m-layer-1)
        inds = tuple((layer,col)         for col in cols) + \
               tuple((row,n-layer-1)     for row in rows) + \
               tuple((m-layer-1,n-col-1) for col in cols) + \
               tuple((m-row-1,layer)     for row in rows)
        ninds = len(inds)

        brk = steps % ninds
        for (ix,iy), (jx,jy) in zip(inds, inds[brk:]+inds[:brk]) :
            out[ix][iy] = arr[jx][jy]

    for row in out :
        print(' '.join((str(x) for x in row)))

import sys
solve_matrix_rotation_challenge (sys.stdin)

A key problem with a monolithic construction such as my solve_matrix_rotation_challenge is that it's hard to see what's going on without lots of commentary. A key problem with a slew of overly-short functions such as in your implementation is that it's hard to see how things fit together without lots of commentary. There's a happy medium where you can still understand individual chunks of code and where you can see how things fit together, and without needing an excessive amount of commentary.
Some comments about my code:

I explicitly chose to use a separate output array rather than rotating in place. The challenge said the array sizes would be rather small. If the challenge said that the arrays might be up to 30000*30000, I would have rethought this. It instead said 300*300 was the max size. In-place mucking around oftentimes involves convoluted logic. I chose to keep it simple.
Sites such as the one you referenced care about speed of execution. There's some hackery in my code specifically aimed at speed (e.g, z=(0,)*n; out=[list(x) for x in range(m)]). Aiming at speed is usually undesirable. Without that need for speed, I would have just used out=copy.deepcopy(arr).

Some comments about your code:

Your functions are so very, very small that I can't see how they fit together as a cohesive whole.
Many of your one-liners are trivial. You may not have seen them as such at first, but once you do, think about eliminating them and expanding the calls into the implementations.
Can you handle a shift of 999999937?
Answer: The other answers are already very good, but I want to point out one stylistic detail the other answers missed: Matrix#rotate! should be called Matrix#rotate, there should be no bang in the method name.
The bang is used to point out the more surprising one of a pair of methods, i.e. when you have both rotate and rotate!, then rotate! is the more surprising one. However, you only have one method, so it shouldn't have a bang.
Bang methods always come in pairs!
Comment: Thanks didn't know it should come in pairs. I just used it since I was doing in place computation replacing the initialised variable.
Comment: As an example: [`Process::exit!`](http://ruby-doc.org/core-2.2.2/Process.html#method-c-exit-21) has nothing to do with mutation, *its* "surprising" behavior is that it exits the process without running the exit handlers. OTOH [`Array#clear`](http://ruby-doc.org/core-2.2.2/Array.html#method-i-clear) doesn't have a bang, despite mutating the receiver.
Comment: They are great examples. I was assuming mutation or a non idempotent operation is denoted by the bang operator.

Matrix class with lots of tiny methods


Help with recovering data on encrypted Microsd Card

Question: Hi I was using a 64GB microsd card as internal storage on my Lenovo K4 Note (also known as Lenovo K4 Note A7010a48, A7010, Lenovo Vibe X3 Lite). Due to some issues in the display I had to give my cell phone to service center. While doing so unfortunately I did not take back up of the data. The service center guys factory reset my phone. Now I am unable to retrieve the data on the card and its showing as an empty card. I tried sending it to Stellar Data Recovery however they said it has unknown encryption and hence even though data is on the card it can not be recovered. CAN ANYONE HELP ME WITH A SOLUTION???
Comment: Welcome to Android Enthusiasts! Have you already checked with our [data-recovery](https://android.stackexchange.com/tags/data-recovery/info) and [adoptable-storage](https://android.stackexchange.com/tags/adoptable-storage/info) tag wikis? Hint: If your device is rooted, you can extract the encryption key and use that on a Linux machine to mount the storage. From there on, the usual recovery tools should be able to help you.
Answer: If it was encrypted then you're not likely going to get anything back, as far as I'm aware.  I've had good success with Photorec on Linux to recover data from SD cards, so my first thought would be to spin up a Linux VM and give that a shot.
Comment: This is correct. If it was encrypted, all of that data is gone, no ifs ands or buts.


Two persons working on same layer in QGIS

Question: We are two people who need to edit on the same layer in QGIS. For example one of us will edit locally, the other one via a server connection.
Comment: Hi Vignesh! First of all, are both persons going to edit the layer(which may be difficult) or is at least one of them going just to read the layer? If both persons are going to edit it, what kind of data storage are you using? (Two persons reading the same layer is never a problem)
Comment: Is your layer file based or in a PostGIS database? And what exactly do you mean by 'work'?
Comment: If you want both persons to edit the layer, you probably have to use a server based database as PostGIS. Filebased databases as Geopackage are not suitable for streaming (remote access) and afaik also not ideal for access by several users at once. Filebased data formats without database structure are even less apt to be used by several users at once.
Comment: Welcome to GIS SE! We're a little different from other sites; this isn't a discussion forum but a Q&A site. Your questions should as much as possible describe not just what you want to do, but precisely what you have tried and where you are stuck trying that. Please check out our short [tour] for more about how the site works
Answer: For simple use with not too many features, there is a useful tool called GooGIS which is a plugin to QGIS. The data is held in Google Drive, you login and authenticate by your Google Account. It manages edits on a per row basis apparently. It is a little buggy to get running, esp on Windows, but might meet your needs perfectly. https://plugins.qgis.org/plugins/gdrive_provider/ and https://github.com/enricofer/gdrive_provider


How can I isolate glycolic acid from sugarcane juice?

Question: This beginning of a bachelor thesis uses ethylene glycol as a catalyst in the isolation of glycolic acid. I can't find the rest of the article (it ends in the middle of the description) to find out how they did it.
I'm wondering if someone could please help me I want to learn how to do this as an amateur dermatologist. Currently studying pre-med, small knowledge of chemistry.
Answer: Ethylene Glycol was not used as a catalyst! Kataoka described in 2001 the production of Glycolic acid (GA) from ethylene glycol using glycol-oxidizing microorganisms isolated from soil, which is what the author of this thesis is trying to say (the writing is unclear though). It will be difficult to reproduce this in your home since you would need to cultivate those microorganisms inside your own house, chemical oxidation would also be a problem if you mean to use it for medical purposes (the oxidation of ethylene glycol releases formaldehyde, which is toxic and probably carcinogenic), besides the reaction needs potassium dichromate to happen which is also hazardous.
Fruits produce a small amount of glycolic acid and you can try to extract it from banana or sugarcane pulp by an acid-base workup, though I believe you won't get much pure GA using this method (specially if you don't have a deep knowledge of organic chemistry).
Glycolic acid is very easy to find online and it will be a lot cheaper to buy it from ebay or other source then to synthesize it if your goal is to use it for its skin effects.
Source: Glycolic Acid Production Using Ethylene Glycol-Oxidizing Microorganisms
Michihiko KATAOKA, Mié SASAKI, Aklani-Rose G.D. HIDALGO, Michiko NAKANO & Sakayu SHIMIZU
Bioscience, Biotechnology, and Biochemistry Vol. 65 , Iss. 10,2001


Manage Database on iphone

Question: How could I manage Large online database on Iphone? Should I have use other than SQLite3?
Answer: If the database is online meanig on a server, you can access it via webservices (RESt/JSON for example is a common option ) and not use SQLite at all.
If you want a local cache of the data, you can use either property lists (XML) or SQLite locally on the device ( both methods can be easily managed with CoreData) .

Manage Database on iphone


Minecraft Mob behaviour

Question: I was wondering if it's possible to control what zombies do. Is it possible to make the zombies attack certain players but not attack other players? I haven't tried anything yet because I'm guessing this will require /scoreboard and I know nothing of this command. I'm on 1.7.10 minecraft and I'm wanting to do this in vanilla minecraft.
Comment: You should give a bit more info. Have you tried anything allready? Have you done online research?
Comment: [Click here to learn](http://bfy.tw/4acA)
Answer: This is not possible in 1.7.10 vanilla due to the severe lack of command features, namely the @e selector.
I would highly recommend upgrading to a more recent version. For example, in 1.8, the @e selector was introduced in order to target non-player entities with commands, as well as the ability to add mobs to a scoreboard team. If a mob is in the same team as a player, that mob will no longer be hostile towards that player but will remain hostile towards non-teammates.
/scoreboard teams add Passive
/scoreboard teams join Passive @p @e[type=Zombie]

Comment: i would upgrade but the server i'm working on is running essentials and since essentials isn't available for 1.8 i'm stuck there>

Minecraft Mob behaviour


If a mole digs a hole in the football field

Question: I saw a weird dream that in a football, a mole dug a big hole just under the penalty spot and none could kick the penalty, as the ball would fell under the ground. Do football rules say anything about such a weird situation?
Comment: If conditions of the field were this bad (i.e., players can be severely injured due to issues with pitch), the game would not be started to begin with.
Answer:
Does football rules says anything about such a weird situation?

Perhaps unsurprisingly, no!
Should this actually happen, the ground staff would most likely remedy the situation with earth, sand and turf, following up by repainting the spot.
In a penalty shootout, and where the ground staff could not fix the hole, I would imagine that the referee would have the penalties taken at the opposite end of the pitch.
Comment: If the hole could not be fixed, the game would not be played due to unsafe conditions!
Answer: If the hole could not be fixed, the game would not be played due to unsafe conditions!
It is a nice idea for a quirky film but IRL sense would prevail and the match would be moved.


Can domain name contain trademark letters?

Question: If for example I purchased a domain that contains NHS (national health system in the UK). For example nhsnews.com that contains news about nhs. Would I be in trouble and do I have to stop the site?
Comment: Simple answer: speak to a trademark lawyer in your country. They will know the correct answer.
Comment: I believe it's National Health Service rather than System - just saying :) You're probably safer going for a slightly more generic name that still includes relevant search terms - 'national health news' or 'health service news' or even 'nh news' if you want something shorter. Realistically I doubt you'd get in trouble with your suggested URL (unless you will be making money from 'lost' visitors looking for the NHS site). But probably better to stay safe and avoid trademarks in my experience, as the penalties can be hefty.
Answer: If you choose a domain name that conflicts with any one of the millions of commercial names that already exist, you risk losing it. And if you've put money and sweat into marketing your website and then are forced to give the domain name up, your Web-based business is likely to suffer a damaging, if not fatal, blow.
Here are the basics you need to understand:

mark and may even have to pay the trademark owner damages.
Trademarks that are clever, memorable or suggestive are protected under federal and state law.
Trademarks that are descriptive and have achieved distinction through sales and advertising can be protected under federal and state law.
One trademark legally conflicts with another when the use of both trademarks is likely to confuse customers about the products or services, or their source.
In case of a legal conflict with a later user, the first commercial user of a trademark owns it.
If a legal conflict is found to exist, the later user will probably have to stop using the mark and may even have to pay the trademark owner damages.
Answer: You can dive into the WIPO domain name disputes to get a feeling of cases which were won by the registrant to understand how it's really decided. There are sometimes some very surprising decisions, and it's a good way to understand the rules in practice.


Have account but no cell phone. Will GitHub's new authentication require me to buy a cell phone?

Question: I am a retired person who mainly sits at home. I don't need a cell phone. Will the change in authentication methods coming to GitHub force me to buy a cell phone? Are there alternatives?
Answer: GitHub has been using 2FA with email for a while. I couldn't find anywhere where they said they will be forcing users to signup with mobile phones. Email should do fine for the foreseeable future.


ST_Within for TIN or 3D objct in PostGIS

Question: I would like to query if a point is located in the TIN object. My TIN object is closed (convex hull) object (i.e. surface of a round object). I tried to use ST_Within, but the error message returns as:

ERROR: Unknown geometry type: 15 - Tin

My query is as follows:
SELECT ST_Within(mypoint,mytinobject) As mypointinmytinobject
FROM
(SELECT ST_GeomFromText('POINT(x,y,z)', SRID) As mypoint,
(SELECT geom FROM mytintable WHERE gid=1) As mytinobject
) As myobjects;

What are the equivalent 3D query functions like ST_Within for 3D TIN object in PostGIS?
It is a complex 3D anatomical region. It is not solid, it is a surface. If it is represented as Polyhedralsurface, how could we query if a point is located inside this closed surface (or a region). Do I need to make it solid body. Could it be done in PostGIS?
Answer: Don't use a TIN for this, use a polyhedral surface, and the ST_3DDistance function to test for containment tests.


How does a capacitor block DC?

Question: I am confused with this! How does a capacitor block DC?

I have seen many circuits using capacitors powered by a DC supply. So, if capacitor blocks DC, why should it be used in such circuits?
Also, the voltage rating is mentioned as a DC value on the capacitor. What does it signify?
Comment: If you apply a direct current source to a capacitor, it will pass DC just fine.  (The voltage will increase until the cap explodes, of course...)
Comment: If you apply DC voltage to a capacitor it is not at all blocked at first.  Eventually, the capacitor gets charged and puts out its ow  n DC.  At that point no current flows through it.
Answer: I think it would help to understand how a capacitor blocks DC (direct current) while allowing AC (alternating current).
Let's start with the simplest source of DC, a battery:

When this battery is being used to power something, electrons are drawn into the + side of the battery, and pushed out the - side.
Let's attach some wires to the battery:

There still isn't a complete circuit here (the wires don't go anywhere), so there is no current flow.
But that doesn't mean that there wasn't any current flow. You see, the atoms in the copper wire metal are made up of a nuclei of the copper atoms, surrounded by their electrons. It can be helpful to think of the copper wire as positive copper ions, with electrons floating around:

Note: I use the symbol e- to represent an electron

In a metal it is very easy to push the electrons around. In our case we have a battery attached. It is able to actually suck some electrons out of the wire:

The wire attached to the positive side of the battery has electrons sucked out of it. Those electrons are then pushed out the negative side of the battery into the wire attached to the negative side.
It's important to note that the battery can't remove all the electrons. The electrons are generally attracted to the positive ions they leave behind; so it's hard to remove all the electrons.
In the end our red wire will have a slight positive charge (cause it's missing electrons), and the black wire will have a slight negative charge (cause it has extra electrons).

So when you first connect the battery to these wires, only a little bit of current will flow. The battery isn't able to move very many electrons, so the current flows very briefly, and then stops.

If you disconnected the battery, flipped it around, and reconnected it: electrons in the black wire would be sucked into the battery and pushed into the red wire.
  Once again there would only a tiny amount of current flow, and then it
  would stop.

The problem with just using two wires is that we don't have very many electrons to push around. What we need is a large store of electrons to play with - a large hunk of metal. That's what a capacitor is: a large chunk of metal attached to the ends of each wire.
With this large chunk of metal, there are a lot more electrons we can easily push around. Now the "positive" side can have a lot more electrons sucked out of it, and the "negative" side can have a lot more electrons pushed into it:

So if you apply an alternating current source to a capacitor, some of that current will be allowed to flow, but after a while it will run out of electrons to push around, and the flow will stop. This is fortunate for the AC source, since it then reverses, and current is allowed to flow once more.

But why is a capacitor rated in DC volts
A capacitor isn't just two hunks of metal. Another design feature of the capacitor is that it uses two hunks of metal very close to each other (imagine a layer of wax paper sandwiched between two sheets of tin foil).
The reason they use "tin foil" separated by "waxed paper" is because they want the negative electrons to be very close to the positive "holes" they left behind. This causes the electrons to be attracted to the positive "holes":

Because the electrons are negative, and the "holes" are positive, the electrons are attracted to the holes. This causes the electrons to actually stay there. You can now remove the battery and the capacitor will actually hold that charge.
This is why a capacitor can store a charge; electrons being attracted to the holes they left behind.
But that waxed paper isn't a perfect insulator; it's going to allow some leakage. But the real problem comes if you have too many electrons piled up. The electric field between the two "plates" of the capacitor can actually get so intense that it causes a breakdown of the waxed paper, permanently damaging the capacitor:

In reality a capacitor isn't made of tin foil and waxed paper (anymore); they use better materials. But there is still a point, a "voltage", where the insulator between the two parallel plates breaks down, destroying the device. This is the capacitor's rated maximum DC voltage.
Comment: A good explanation but it doesn't answer the OP's question in a direct fashion: With AC, you have an instantaneous variation in the voltage. At every point of the AC wave, the voltage is varying and when you have a capacitor in the ckt, this change/variation in voltage can be transmitted across the dielectric to the other side/plat via an electric field of varying intensity. Therefore current flows in the circuit even though the dielectric is an insulator to the flow of electrons.
Comment: you need to think of this in terms of waves with electrons/molecular polarization acting as a means/medium for waves.
Comment: @Fennekin Capacitors do not allow DC current to flow whether alone, or connected in series, or connected in parallel. But, again, that's in the steady state. There will still be an initial rush of *some* current; whether they are connected in series, parallel, or alone.
Comment: with DC, you have a fixed/non-varying electric field across the dielectric of some field strength/intensity and the dielectric polarizes to oppose this field so the electrons at the other end of the wire are not under the influence of any electric field and therefore don't move barring the usual/routine movement of electrons in a metal.
Comment: After reading this answer, Can i conclude that capacitors do not allow current to flow in DC **when connected in series**?
Comment: Who was it that said, "If you can't explain it simply, you don't understand it well enough"?
Answer: Let me see if I can add one more perspective to the other 3 answers.
Capacitors act like a short at high frequencies and an open at low frequencies.
So here are two cases:
Capacitor in series with signal

In this situation, AC is able to get through, but DC is blocked. This is commonly called a coupling capacitor.
Capacitor in parallel with signal

In this situation, DC is able to get through, but AC is shorted to ground causing it to be blocked. This is commonly called a decoupling capacitor.
What is AC?
I have used the terms "High Freq" and "Low Freq" rather loosely as they don't really have any numbers associated with them. I did this because what is considered low and high depends on what is going on in the rest of the circuit. If you want to learn more about this you can read about low-pass filters on Wikipedia or some of our RC filter questions.
Voltage Rating
The voltage that you see with capacitors is the maximum voltage you can safely apply to the capacitor before you start to run the risk of the capacitor physically breaking down. Sometimes this happens as an explosion, sometimes fire, or sometimes just gets hot.
Comment: @Stevenvh I felt the the confusion that the OP had was not about the physics of how it blocks DC, but rather why it is used if it does block DC. Plus I figured your answer did a pretty good of explaining it at a more physical level and didn't think I could explain that part any better than you.
Comment: Kellen, I appreciate your use of pictures, but I'm missing an answer to the question *how* the cap blocks DC. You just say that it does.
Answer: The explanation is in the fact that opposite charges attract each other. A capacitor is a compact construction of 2 conducting plates separated by a very thin insulator. If you put DC on it one side will be positively charged and the other side negatively. Both charges attract each other but can't pass the insulating barrier. There's no current flow. So that's end of story for DC.
For AC it's different. One side will successively be positively and negatively charged, and attract negative and positive charges resp. So changes on one side of the barrier provoke changes on the other side, so that it appears that the charges cross the barrier, and that current effectively flows through the capacitor.
A charged capacitor is always DC charged, i.e. one side has the positive charges and the other side the negative. These charges are a storage for electrical energy, which is necessary in many circuits.
The maximum voltage is determined by the insulating barrier. Above a certain voltage it will breakdown and create a short circuit. That can happen under DC but also under AC.
Answer: A simple way of thinking about it is that a series capacitor blocks DC, while a parallel capacitor helps maintain a steady voltage.
This is really two applications of the same behavior - a capacitor reacts to try to keep the voltage across itself constant.  In the series case, it's quite happy to remove a steady voltage difference, but any abrupt change in one side will be passed through to the other to keep the voltage difference constant.  In the parallel case, any abrupt change in voltage will be reacted to.
Comment: nice simple answer, kudos
Answer: This is not a very technical answer, but it's a graphical explanation that I find very funny and simple:
Comment: Yes, nice, but you'll get in trouble if you actually try to explain that AC path! :-)
Comment: @stevenvh yeah, of course I know it's a bit stupid, but I've always found it clever :)
Comment: Its a weird answer :D :D :D :D :D
Comment: Actually it helped me lot to understand clearly what is a capacitor. Thank u!
Comment: Not an answer, just a (bad) joke.
Comment: @user342060 yes, but you don't have to thank me
Answer: The amount of charge that develops across the plates of a capacitor with a given voltage across its terminals is governed by the formula:
\$ Q = C \times V \$ (charge = capacitance * voltage)
Differentiating both sides (current is the time derivative of charge), gives:
\$ I = C \times \dfrac {dV}{dt} \$ (current = capacitance * the rate of change in voltage)
DC voltage is the same as saying \$ \dfrac{dV}{dt} = 0 \$.
So a capacitor allows no current to flow "through" it for DC voltage (i.e. it blocks DC).
The voltage across the plates of a capacitor must also change in a continuous manner, so capacitors have the effect of "holding up" a voltage once they are charged to it, until that voltage can be discharged through a resistance. A very common use for capacitors is therefore stabilize rail voltages and decouple rails from ground.
The voltage rating is how much voltage you can apply across the plates before the electro-static forces break down the material properties of the dielectric material between the plates rendering it broken as a capacitor :).
Answer: My answer to such questions is always "water". Water flowing through pipes is a surprisingly accurate analogy for current flowing through wires. Current is how much water flows through a pipe. Voltage difference becomes the difference in water pressure. The pipes are supposed to lie flat, so that gravity plays no role.
In such an analogy, a battery is a water pump, and a capacitor is a rubber membrane which completely blocks the pipe. DC is water flowing constantly in one direction through a pipe. AC is water flowing back and forth all the time.
With this in mind, it should be obvious that a capacitor blocks DC: since the membrane can only stretch so far, water can't just keep on flowing in the same direction. There will be some flow while the membrane stretches (i.e. the capacitor charges), but at one point it becomes stretched enough to completely balance the water pressure, thus blocking any further flow.
It also becomes obvious that a capacitor won't block AC completely, but it does depend on the membrane properties. If the membrane is sufficiently stretchy (high capacitance), it will pose no challenge to water flowing back and forth quickly. If the membrane is really rather stiff (e.g. a thin sheet of plastic), this corresponds to low capacitance, and if the water flows back and forth slowly, such flow will be blocked, but very high frequency oscillations will still make it through.
This analogy has been so exceptionally useful to me that I really wonder why it isn't used more widely.
Comment: A friend helped me understand why this analogy is not used more widely: apparently he has as little intuition for water flow in pipes as he does for current flow in wires!
Answer: First off, a capacitor blocks DC and is a lower impedance to AC, while an inductor tends to block AC yet pass DC very easily. By "blocking", we mean than it offers a high impedance to the signal we're talking about.
First, though, we need to define a few terms to explain this. You know what resistance is, right? Resistance is the opposition to current flow that results in the burning of power, measured in watts. It does not matter if the current is AC or DC, the power dissipated by a perfect resistor is the same amount for either.
So resistance is one kind of "impedance" to current flow. There are 2 others - "inductive reactance", and "capacitive reactance". Both are also measured in ohms, like resistance, but both are different in that, for one thing, they vary with frequency, and for another, they don't actually consume power like a resistance does. So all together, there are 3 kinds of impedance - resistive, inductive, and capacitive.
The amount of blocking or impedance of inductors in ohms can be determined by:
$$X_L = 2\pi fL$$
Where 2pi is approximately 6.28,
f is the frequency (AC, obviously) of a signal,
L is the inductance measured in henries, and
where "X sub L" is the inductive reactance in ohms.
Inductive reactance is the impedance of a component due to inductance; it is a kind of resistance, but does not actually burn power in watts like a resistor does, and since "f" for frequency needs to be supplied, the value of it varies with frequency for a given inductor.
Notice that as the frequency goes up, so does the impedance ( AC resistance) in ohms. And notice that if the frequency equals zero, then so does the impedance - a frequency of zero means DC, so inductors have virtually no resistance to DC current flow. And as the frequency goes up, so does the impedance.
Capacitors are the opposite- the formula for capacitive reactance is
$$X_C = \frac{1}{2\pi fC}$$
Here, C is the capacitance of the cap in farads, "2pi" and "f" are the same as above, and "X-sub-C" is the capacitive reactance in ohms. Notice that here, the reactance is "one divided by" the frequency and the capacitance - this results in values of impedance that go down with frequency and capacitance. So if the frequency is high, the impedance will be low, and if the frequency is near zero, which is DC, the impedance will be nearly infinite - in other words, capacitors block DC, but pass AC, and the higher the frequency of the AC signal, the less the impedance to it.
Answer: I'll go for the shortest-answer qualitative-take-away approach:
A capacitor across DC rails is there, in effect, to short any AC signals that might otherwise get onto the supply rails, so the amount of AC across your DC circuit is reduced.
The voltage rating on a cap is the maximum voltage (sum of DC and any AC present!) that the cap should see. Exceed this voltage and the cap will fail.

How does a capacitor block DC?


Why can't we consider Amperean loop inside solenoid just like a toroid?

Question: According to my book, the magnetic field in any location inside the toroid (the empty region inside the toroid circumference) is zero because if we consider a circular loop passing through that point, the magnetic field would be zero as there is no current inside that loop. If we use this logic for inside the solenoid and take a small circle inside the solenoid with center at axis, we would get the same zero MF there, which is not true. If we apply this logic we will get a zero magnetic field wherever there is no current. I know this is not right and I am missing some point here.
Answer: The Amperian Loop centered at the axis of the solenoid encloses no current. This is true.
You note two rules.

By Ampere's Law, there is no magnetic field.
The solenoid has a magnetic field.

You think 1. and 2. contradict. However, realize that Ampere's Law only describes the net magnetic field along the Amperian Loop. It does not say anything about other magnetic fields. So let's modify the rules.

By Ampere's Law, there is no net magnetic field along the Amperian Loop.
The solenoid has a magnetic field.

To see why 1. and 2. are true and don't contradict, let's consider an ideal example, then generalize.
Ideal Example
The magnetic field lines within an infinitely long solenoid are perfectly parallel with the central axis of the solenoid. This is consistent with 2.
If you consider a circle centered at the solenoid's central axis, realize that all magnetic field lines are perpendicular to the circle.
So, there are no magnetic field lines that go along the Amperian Loop. This is consistent with 1.
General Example
In the real world, we can't have infinitely long solenoids. Real world solenoids deviate from the ideal solenoid.
A single wire loop has a circularly symmetric magnetic field. Similarly, a stack of single wire loops have a circularly symmetric magnetic field. This is consistent with rule 2.
Since the solenoid is made up of circles, note that any deviation from the ideal must be circularly symmetric.
By circular symmetry, there is no net magnetic field along the circular Amperian Loop. This is consistent with rule 1.
Conclusion
Rules 1 and 2 hold for all solenoids, and don't contradict each other.
(P.S. I'm pretty sure, but cannot prove, that real-world solenoids have magnetic field lines that deviate radially outwards from the central axis, radially perpendicular to the Amperian Loop. So, there is no single magnetic field line that contributes to the Amperian Loop, and we don't even need to consider circular symmetry.)
Answer: You have to be careful and understand what you are doing when evaluating the left hand side of the equation $\displaystyle \int_{\rm loop}\vec B \cdot d\vec l= \mu_0 I_{\rm enclosed}$.

For loops $X$ and $Z$ you can appeal to symmetry and say that the magnetic field $B$ has the same magnitude and is in the same direction as the loop at all points around the loop.
However for loop $Y$ because the integral $\displaystyle \int_{\rm loop}\vec B \cdot d\vec l$ is zero around the loop that does not mean that the magnetic field is zero at each point along the loop.
You will see from the diagram you will get positive and negative contributions to $\vec B \cdot d\vec l$ which will add up to zero.
Comment: Actually my question was regarding loop z which is in the open area ( not inside the toroid). Why is the magnetic field zero at any point p inside, the explanation in the book is because there is that if we draw a loop , for example, z in this case ,since there is no enclosed current , MF is 0. Likewise,  can we take loop anywhere outside the toroid and say there is no enclosed current hence the mf is zero or anywhere inside Solonoi.
Comment: By symmetry the magnitude of the magnetic field must be the same at each point along the loop and the direction of the magnetic field must be at a tangent to the loop.  This makes the integral $Bz$ where $z$ is the circumference of the loop. Since the enclosed current is zero the magnetic field $B$ must be zero.


What if you don't reach the optimal sample size?

Question: I have used a binomial sample calculation to conclude that we need a sample size of 150, which for a response rate of 80% there is 80% power that the confidence limits between 71% and 89% cover our target. But, for a sample size of 100 and a response rate of 80% there is 80% power that the confidence limits between 70% and 90% cover our target, which does not change the results significantly at all. I'm just wondering what effect missing the optimal sample size gives if this doesn't change the CI?
Comment: For my curiosity: (71%, 89%) is xx% CI, 95% or 99% or others?
Answer: If you are comparing confidence intervals with the same confidence level then having less data will make the interval wider (i.e., less accurate).  The only way you could be getting confidence intervals of the same width with less data is if you have simultaneously dropped your confidence level.


Can I force my router to use the same external IP instead of a dynamic one?

Question: My ISP is providing dynamic IP adresses but I want to be able to always use the same IP. I did some research and I ended up with the conclusion that it's not really possible to do from my side alone, is this really it? and if so why are services like PayPal suspending the access to one's account when their algorithms detect multiple IPs for the same account if dynamic IPs are a thing?
Thanks a lot!
Comment: It costs money to have a fixed IP. There's no way to dictate that you will always get the same one unless you 'buy' it from your ISP. On the other hand, some ISPs hand out the same IP to the same account for years at a time [mine's changed once in 12 years] so it's luck of the draw.
Answer: Your ISP is leasing an IP to your CPE(Modem/router etc). Most will charge if you want this to be static. Some its a monthly fee, some its a one time charge. Others do not offer it at all (Cellular providers can be among these).
IP blocking is a blunt tool but only some IPs are dynamic and their rate of change varies. Some are "sticky" and may only change once or twice a year, some change upon reconnection, some change nightly.
Paypal most likely blocked you because of simultaneous access from multiple IP's. This is suspicious for a personal or small business account as even if you were using a few devices they should be through the same connection and use a single address.


How to read a text file line by line and modify every line using a batch file?

Question: Let's say there's a text file that contains:
L1
L2
L3

I want to have a batch file that will read each line from that file, and then make them into variables. For example, these will be the variables:
line1 = L1
line2 = L2
line3 = L3

How can this be done with a batch file?
Comment: Maybe you got the wrong idea... StackOverflow isn't a free coding service! Please take a look at [ask] and offer a [mcve] of what you tried so far.
Answer: The Windows command processor is designed for running commands and applications. It is not designed for editing text files. Really every scripting or programming language would be better for this task than a batch file executed by Windows command processor cmd.exe.
For your simple text file example with using a character encoding with one byte per character or UTF-8 a simple batch file can be used:
@echo off
setlocal EnableExtensions EnableDelayedExpansion
set "LineNumber=0"
del "%TEMP%\TextFile.tmp" 2>nul

for /F "usebackq delims=" %%I in ("TextFile.txt") do (
    set /A LineNumber+=1
    echo line!LineNumber! = %%I
) >>"%TEMP%\TextFile.tmp"

if exist "%TEMP%\TextFile.tmp" move /Y "%TEMP%\TextFile.tmp" "TextFile.txt"
if errorlevel 1 del "%TEMP%\TextFile.tmp"
endlocal

But this batch file fails to process a line correct which

does not contain any character (empty line),
starts with a semicolon ;,
contains one or more exclamation marks !.

A better but slower batch file would be:
@echo off
setlocal EnableExtensions DisableDelayedExpansion
set "LineNumber=0"
del "%TEMP%\TextFile.tmp" 2>nul

for /F delims^=^ eol^= %%A in ('%SystemRoot%\System32\findstr.exe /N "^" "TextFile.txt" 2^>nul') do (
    set "Line=%%A"
    set /A LineNumber+=1
    setlocal EnableDelayedExpansion
    echo line!LineNumber! = !Line:*:=!
    endlocal
) >>"%TEMP%\TextFile.tmp"

if exist "%TEMP%\TextFile.tmp" move /Y "%TEMP%\TextFile.tmp" "TextFile.txt"
if errorlevel 1 del "%TEMP%\TextFile.tmp"
endlocal

See my answer on How to read and print contents of text file line by line? why the FOR loop is much more complex to process text files better.
A text file with UTF-16 or UTF-32 character encoding cannot be processed with those two batch files.
For understanding the used commands and how they work, open a command prompt window, execute there the following commands, and read entirely all help pages displayed for each command very carefully.

del /?
echo /?
endlocal /?
findstr /?
for /?
if /?
move /?
set /?
setlocal /?

See also the Microsoft article about Using command redirection operators.


What material are the thin, colored wires in my headphone cable?

Question: My broken headphones have different colored wires. Are the red, green and blue wires all copper? The colored wire is wrapped around a white thread.
Comment: The color you see comes from the insulation.  Most likely the conductive material inside the wire is copper.
Comment: @Cliff, they do have insulation, or they would short each other out. The Insulation is painted or dipped on enamel, like nail polish. It just isn't thick rubber insulation like cables you are used to.
Comment: these wires dont have insulation. theyare bare wires, extremely thin, wrapped around a white thread
Answer: Yes, all of the conductive stuff inside the cable is copper. However, the copper wires are coated with a very thin insulating layer called enamel.

The enamel can sometimes be removed by rubbing molten solder on it.

If this doesn't work, then you might have some luck rubbing some fine emery paper on it.

As you can see, you don't need to clean your fingernails before you do this.
But one of the problems with headphone cable specifically is that it often contains some thread to reinforce it.

The thread makes soldering the cable pretty difficult. Usually, if I find threads in my cable, I just throw it away.
Comment: +1 just for "As you can see, you don't need to clean your fingernails before you do this."
Comment: When I find these threads I light them up with a lighter, and they go away instantly.
Answer: The inner conductor is usually copper. The outside, the colored stuff (red, green, blue) is usually some kind of plastic. You can carefully remove the insulation from the conductor to reach the copper. Some headphones have very thin wires which easily break when you try to pull off the insulation. Don't tell the other electronics engineers here that I said this, but if you are careful you can remove the insulation by carefully holding it in a flame of a match or cigarette lighter.
If you are planning to try and connect the wires together to make it working again, be careful to not make shorts between different colors as that may kill your amplifier.
Comment: Actually heating those wires sometimes makes them very brittle, so I'd be careful.
Comment: If using fire, do it in a well ventilated area and avoid the fumes! Plastic chemicals are really nasty stuff.
Answer: I broke the connector off a bluetooth microphone for a car stereo.  The wires inside the sheath were red and blue, but happily nestled together...I soaked them in nail polish remover for a few seconds, agitating slightly...then burned the enamel off - carefully.
To my surprise...I was left with slightly carbon-covered copper wire...definitely something I could work with.  I soldered the newly "cleaned" ends after tinning carefully at 700 degrees.  The result is a serviceable salvage job.


Dear all flutter developer I would like to ask about How to draw line as the image below "flutter concept"?

Question: enter image description here
Dear all flutter developer I would like to ask about How to draw line as the image below "flutter concept"? I meaning vertical line sharp.
Answer: I would suggest to you to use the CustomPaint class, with this you are able to paint custom shapes.

Docs: https://api.flutter.dev/flutter/widgets/CustomPaint-class.html

Official video-guide: https://www.youtube.com/watch?v=vvI_NUXK00s


When was `relatime` made the default?

Question: What is the first Linux kernel release to set relatime as the default mount option?
Comment: The spelling of that option is very unfortunate: I will forever parse it as a misprint of "realtime".
Answer: I remember the change, but couldn't remember the date.
It seems that it was back in 2007.
According to the article, relatime was available in 2.6.20, and it became the default option a few versions after that (2.6.24) maybe.
Edit: man mount /relatime says 2.6.30.
From ChangeLog-2.6.30:

commit 0a1c01c9477602ee8b44548a9405b2c1d587b5a2
Author: Matthew Garrett <email@example.com>
Date:   Thu Mar 26 17:53:14 2009 +0000

Make relatime default

Change the default behaviour of the kernel to use relatime for all
filesystems. This can be overridden with the "strictatime" mount
option.

Signed-off-by: Matthew Garrett <email@example.com>
Signed-off-by: Linus Torvalds <firstname.lastname@example.com>

Comment: Hmm, my CentOS 5 servers using 2.6.21 don't appear to have relatime.  Strange.
Answer: relatime mount option is default default since RHEL/CentOS/Scientific Linux version 6 (see here).
If relatime option is used, the atime is updated when:

old atime is <= than mtime/ctime
at least 24 hours (hardcoded in fs/inode.c) have passed since the last atime update
inode is dirty (or the file contents have been changed but it's in the buffer and have not been written to the physical disk yet)

When was `relatime` made the default?


SharePoint Server 2013 Emulating SharePoint Server 2010

Question: My company recently switched from SharePoint Server 2010 to SharePoint Server 2013, but for now it is the 2010 Emulation Mode. One of the older (created on SharePoint Server 2007) Visual Studio SharePoint projects does not work after the migration and I need to rewrite it. Eventually we will shut off 2010 Emulation for a pure 2013 environment so my question is - will a SharePoint 2013 Project work on a SharePoint 2013 Server emulating SharePoint 2010 and once we shut off the 2010 Emulation, will it still work?
Answer: So that emulation is called 'v14.5' mode. You will build your new project (or upgrade it) to use v14,v15 mode in your Visual Studio package properties. This will deploy it to the 14 and 15 hive, making it compatible with both v14.5 and v15 site collections on SharePoint 2013.


Can you make your host machine appear as a virtual machine?

Question: I keep seeing how people are working to make virtual machines look more like real machines, but I have been wondering about the reverse. I have noticed a trend where viruses will automatically shut off if they think that they are in a virtual machine. Using that train of thought, couldn't you attack this from both ends and make the virtual machine look more like the host and the host more like the guest?
Answer: Presumably you could, installing e.g. fake drivers that look like VirtualBox Guest Additions, or fabricating a PCI card that looks like virtio.
But malware authors check for these things because they are indicative of security researchers trying to sandbox the malware to reverse engineer it, or antivirus trying to sandbox the malware to test its behavior—but if their techniques no longer accurately detect VMs, or if they don't want to detect VMs anymore because valued infrastructure actually runs in them (e.g. cloud hosting), then they will no longer exit on these conditions.
Answer: I think, the answer to "how to make my host look like a virtual machine" is "run a virtual machine on your host".
(the other direction of making a VM look like it's not a VM is far more difficult and interesting)

What exactly does it mean to "fake" your host to look like a VM? It probably means a translation layer for your CPU instruction so that the application sees the CPU behave like a VirtualBox or VMmare CPUt. Wrap your hard drive drivers and other firmware to look like the VirtualBox or VMware drivers. Etc.
At some point this is no longer "faking" and you're actually just running a virtual machine.
Answer: Usually VM detection is based on two common techniques:

checking the MAC address: Virtualbox MAC addresses would probably begin with 52:54:00 or another range assigned to Oracle. I don't have a complete list, but see for example: https://macaddress.io/faq/how-to-recognise-an-oracle-virtual-machine-by-its-mac-address.
looking for the presence of specific DLLs or guest additions software

By leveraging either or both techniques you may be able to "spoof" a VM. The MAC address can be faked automatically by the system. There many ways of doing it, preferably it should be done before the malicious program is executed.
No guarantee this will fool programs 100% of the time as they may use other tricks to determine whether the machine is a VM or not.


Why don't we have particles whose wavefunctions are symmetric wrt one exchange operator and anti-symmetric wrt other exchange operator?

Question: Consider a system with $n$ identical particles. Let the wavefunction of the system be $\psi(r_1,\ldots, r_2)$. Let $P_{a,b}$ represent the exchange operator which exchanges particle $a$ with particle $b$. Similarly, $P_{c,d}$  represent the exchange operator which exchanges particle $c$ with particle $d$. Now, suppose $P_{a,b}(\psi(r_1,\ldots, r_2))= - \psi(r_1,\ldots, r_2)$ and $P_{c,d}(\psi(r_1,\ldots, r_2))= \psi(r_1,\ldots, r_2)$. Why don't we have particles with wavefunctions satisfying the above property?
Comment: Um...take one state with the first property and one state with the second property. Write the combined state. You've got a state with the property you claim we never have. So I don't understand the question.
Comment: Isn't that what you want?
Comment: You mean that particles $a,b,c,d$ are all of the same species? Then $a,b$ can't have exchange properties different from those of $c,d$ since this would make particles $c,d$ distinguishable from particles $a,b$. (It's also not consistent with the group structure on exchange operators, if we are also to be able to exchange $a,c$; $a,d$; $b,c$; and $b,d$.)
Comment: Well, if the particles interact (e.g., they have electric charge), by treating the interaction as a perturbation to the free Hamiltonian, you find an *exchange energy term*. This term will be slightly different depending on if the exchange is symmetric or anti-symmetric. So if you move the pair $a,b$ far away from the pair $c,d$, so that the interaction between the pairs is negligible, you could tell which is which by measuring the energy of each pair.
Comment: @ACuriousMind The combined state will be still anti-symmetric wrt $P_{a,b}$ and symmetric wrt $P_{c,d}$.
Comment: @RobinEkman My question is why can't we have particles satisfy which are anti-symmetric wrt $P_{a,b}$ and symmetric wrt $P_{c,d}$.
Comment: Yes they are all of the same species.
Comment: @RobinEkman Could elaborate on how it would make particles $c,d$ distinguishable from $a,b$?
Answer: It is not possible to have a state with four indistinguishable particles such that $P_{12} \psi = -\psi$ and $P_{34} \psi =\psi$, for an algebraic reason. Namely, the exchange operators have to form a representation of the permutation group $S_4$. It is rather well known that there are exactly two representations of $S_n$: the trivial representation where all exchange operators are $1$, and the parity representation where all single transpositions are represented by $-1$ and this is extended by the group law.
Thus either all $P_{nm} = 1$ or all $P_{nm} = -1$. Anything else is simply not consistent with the algebra of permutations.
Answer: A wavefunction is a normalised vector (or a ray) in the Hilbert space of vector states (I will assume finite degrees of freedom, so the C*-algebra of the system can be taken to be $B(H)$, with $H$ an $L^2(\mathbb R^n)$ space). Spin gives a superselection rule, and therefore there must be superselection sectors. It follows from the general theory that vector states from different sectors cannot be combined to yield another vector state, but just a statistical mixture. So a wavefunction is either bosonic or fermionic. To describe a state with mixed particles you need more general linear functionals which combine as convex combination of states from the superselection sectors.


I get pixel perfect scrolling in native apps, but not chrome or LibreOffice, is it possible to get it?

Question: I'm in ubuntu 14.04 and my trackpad gives me pixel perfect scrolling in all the native apps, but not Chrome or LibreOffice, I've tried the chrome://flags smooth scrolling option, but that just animates the frankly massive jumps that scrolling gives, extensions and apps do the same thing, is there anything I can do? Do any Other browsers support it?
Answer: Regarding your first question, I don't know. As you have stated, there are libraries in Linux which support pixel perfect scrolling, so I suppose it is up to the developers to decide to use them.
As to your second question, the only browser in Linux that I've come across that supports true smooth scrolling is Epiphany (sometimes called "Web").
Answer: I don't know about Chrome or LibreOffice, but Firefox supports pixel scrolling (works in v49, not sure when it was added) if you set the MOZ_USE_XINPUT2=1 environment variable. You can set it by using echo 'export MOZ_USE_XINPUT2=1' >> ~/.xsessionrc, for example.


Measuring the harmonics of a vibrating string

Question: I have a string which is vibrating at a fixed frequency, say 1 kHz.  I know it is vibrating in a purely first harmonic mode because of the (sinusoidal) drive function I am using.  With a microphone I measure the sound wave and do a frequency analysis of this.  I measure several harmonics in this spectrum.  Is this possible? Does the environment of the string generate higher harmonics?
Comment: You can only verify that the string is vibrating at its fundamental frequency if the standing wave on the string is only 1/2 of a wavelength.  A sinusoidal driving function can produce many harmonics on the string (fundamental and higher harmonics), so the fact that you are using a sinusoidal driving function does NOT by itself mean that you are seeing the first harmonic.
Comment: How do you produce your driving AC? Have you cheched the spectrum of the driving voltage or even of the current through the wire?
Comment: How could it not be possible? You have a source for a Time, during such time the Frequency modulates to reflect the amplitude of its position with respect to the observation, during such time the oscillations from the Frequency interfere with itself and some cancel and others cause some spontaneous new waves to be created in a coherent vector to the initial ones. You can see your Frequency, Its compliments and derivates over the course of time of their radiation or emission. I would think more importantly depending on your `microphone` that your also picking up a lot of other `noise`.
Comment: The "string" is a conducting wire in a homogeneous magnetic field.  An AC current is run through the wire that is tuned to the fundamental frequency of the wire.  I would think this excited only the fundamental mode.  I can measure the induced current in the wire and Fourier analyze it, confirms fundamental mode.  Microphone picks up harmonics that must be generated by the cavity, walls, enclosure?  Can David White please comment?  Thx.
Comment: Let us assume that the wire is vibrating PURELY in the fundamental harmonic.  For the moment let's not focus on the driving mechanism.  I do measure the induced current on the wire, and establish by Fourier analysis that it is vibrating in the fundamental mode only.  My question relates to the measurement of the acoustic wave, where a Fourier analysis of the sound wave picked up by the microphone shows first, second, and some third harmonic components.  Can the harmonics be generated by the sound wave interacting with the environment surrounding the wire?
Answer: A linear system driven by pure sine wave will produce a response only at the fundamental frequency.  There will be no harmonics or overtones.  Harmonics are multiples of the fundamental frequency. Overtones are higher order resonant modes of the system. For a vibrating string, the overtones are very close in frequency to multiples of the fundamental frequency.
In order for harmonics to be present, either the source is not a perfect sine wave or there is some nonlinearity in the system. An even-order nonlinearity (e.g. quadratic) will create only even harmonics. An odd-order nonlinearity (e.g. cubic) will create only odd harmonics. The nonlinearity could be, for example, that Hooke's Law is not obeyed perfectly.
In order for overtones to be excited, there must be some mode-coupling present so that energy can flow from the fundamental mode into higher-order modes. This can occur in any real system with damping and especially in situations where energy is strongly focused in a small region (e.g. bending at the ends of the string).


Magento 2 Backup Restoration Issue on AWS EC2 Instance

Question: I am experiencing an issue restoring a Magento 2 backup on an AWS EC2 instance. After successfully restoring the backup, when I try to access the site via the EC2 instance's IP address, I encounter a "Error 503 Backend fetch failed" error, indicating an issue with the Varnish cache server.
Answer: There are multiple reasons for these you can check with the:
<code>-> Varnish issue contact your server administrator
-> Check varnish configuration in the env.php
-> Check the credentials of the Varnish
</code>
It is confirmed that it's the issue of the varnish side.


Calf pain / tightens

Question: When i do a long run (4 miles) or tempo run, I will get a sharp pain suddenly causing me to slow down to a walk. I will then proceed to ice when I get back home. Any ideas what it might be.
Comment: @Andre at least describe where this pain is. In the feet, in your hips, belly area (side stitches) or even in the upper body or neck? At the moment this question forces people to play the guessing game.
Comment: Please talk to a professional, this site is not for giving or substituting medical advice, check out the [FAQ]. Additionally your question is far too vague to be answered.
Comment: How frequently do you stretch (quads,calves,hams,etc)? Do you stretch and/or warmup before going on runs? Has this been a recurring thing or something that only recently started?
Comment: You definitely need to see a doctor about sharp pains you have while exercising.
Answer: I agree with others you should ask a medical professional if it continues to cause pain.
My advice is not professional, but do you think this might be a calf cramp? This can be caused by lack of vitamins, including phosphorus, magnesium, calcium, sodium and potassium. However, it seems that potassium can be the most important vitamin to prevent cramping. I used to get sharp pains in my calves when deficient in potassium. Foods high in potassium include avocados, bananas, dried apricots, mushrooms, spinach, and salmon, among many others.
Happy running!

Calf pain / tightens


Would a small solid block of metal on an electric stove transfer enough heat to a round bottom wok?

Question: I want to see if I can use a round bottom wok on an electric stove (not induction). And I figured would using a solid metal block the width of a large hob work? I figured if it curves up the sides a little then surely it would transfer heat well? But I don't know if there's any dangers with a solid block. Think a wok ring, but solid and curves inwards in the middle (concave, is it).
Answer: It would need really very good contact with both the wok and the electric ring. That would be hard to machine.
For rings that radiate (i.e. ones that glow), they'll reduce the radiant heat reaching the bottom of the wok, and you'd be better off with just a ring that supports the wok, and a fairly flat-bottomed wok. This is especially true for radiant heat sources under glass, which are now quite common.
The only time this idea might be beneficial is with those slightly convex solid metal hotplates that take forever to warm up and cool down. Then even a wok with a flat bottom doesn't make good contact, but contact is important.
Answer: This sounds ill-advised, not just because it's inefficient but also because it's potentially dangerous.
The choice of metal matters here since different metals have different properties when it comes to heat retention and conductivity. That being said, the best metals for this would be stuff like copper, silver, or aluminum, and those would all be prohibitively expensive to make solid blocks out of (not to mention aluminum might just straight-up melt). That means your choice is down to basically either iron or steel, which in sizes that qualify for the "block" description still aren't exactly cheap.
In both cases, the iron/steel will have an extremely high thermal mass which means they will take forever to heat up. It also means that you need to be extremely confident in how much heat you are putting into them because adjustments during cooking will be virtually impossible. Metal-to-metal transfer of heat is also notoriously inefficient due to layers of oxides and imperfections in the surface resulting in trapped air acting as insulation. And once you're done cooking, you will still have a blazing hot metal plate sitting on your hob which could take an hour or longer to cool off, which is just asking for trouble in a household of kids, pets, or the accident-prone.
In short, with the cost, efficiency, hassle, and safety concerns, I'd recommend just getting a specialty electric/induction wok hob instead: https://www.amazon.com/Oster-2124087-DiamondForce-Electric-4-7-Quart/dp/B08B4243TZ/
Comment: Aluminium would be reasonably affordable - and shouldn't melt on an electric stove but I wouldn't risk it. Copper isn't stupid money given what some people spend on kitchen gadgets. I have parts of this sort of scale made from both in work.  It would only need to come a little way up the sides, after all.


Where can I read Bleach legally?

Question: I live in Norway. Is there a site where I can read Bleach online legally? I have tried to look, but I have not found a suitable site yet.
Comment: Take a look at this post. http://meta.anime.stackexchange.com/questions/922/how-can-i-tell-if-a-site-is-legal/923#923
Comment: Check out this site.  I believe they sell electronic subscriptions to WSJ for about $25 per year.  http://shonenjump.viz.com/  They even sent me a promotional paper comic once.  I believe it had a chapter from Naruto gaiden.  For the record, I live in the US, but It's online, so It might be available in norway too
Comment: you might find this post useful: http://anime.stackexchange.com/a/25961/6481
Comment: Do you know where  I can read the latest chapters online? Yes the latest chapters, I cannot seem to get WSJ subscribtion here(after my attempts)
Answer: You can buy digital version of Bleach on a per-volume basis.
According to Viz Media's site, digital versions should be avaible from:

Amazon
Google Play
Nook
iBooks
VizManga

I'm not sure about the region restrictions of these though, as you are living in Norway - Viz may not have the licensing rights for the regions (They usually prioritize the US first). You may have to import physical books if noone owns the licensing rights.
Comment: Do you know where  I can read the latest chapters online?
Comment: @rufaelJ.O I believe VizManga is an online reader

Where can I read Bleach legally?


What does the number below the clan-logo mean?

Question: Attached is a screenshot from the latest major. There is a numerical value presented below one of the clan flags (the side varies). My question is what does the number represent?
Answer: It is the fan level (as the Wiki calls it) of the team.
I found a few Reddits asking about this.  This one states:

[The] Amount of pennants level equipped of spectators in Dota TV. Basically every lvl 1 pennant adds 1 to the number, and lvl 2 pennants adds 2 to the number.

This Reddit says the same thing basically (with reference to Na'Vi):

It's the number of spectators in the DotA2 client who have a Na'Vi team pennant.

The Dota 2 Wiki calls this number the Fan Level on the pennants page:

Pennants are equippable items that allow users to show support for a team during tournaments, by increasing a team's Fan Level - visible in-game to other DotaTV users.
Answer: Those are pennants: They used to be sold on the Dota Store, and it was a way to cheer for your team, there are different levels to existing pennants and the level just multiplies how much a pennant is worth (pennant lvl 1 adds 1).
Iirc you can not buy pennants anymore, and even if you can, there are no pennants for new-ish teams.


Calculating percentage error with significant figures

Question: I have a problem with significant figures. In an assignment, the paper gives us data to $3$ significant figures to calculate some values but afterwards requires us to calculate the percentage difference given an accepted value that is to $4$ significant figures. If we round the accepted value to $3$ significant figures as well, it yields $0 \%$ error. How should I deal with this?
Comment: More on [significant figures](https://physics.stackexchange.com/search?q=is%3Aq+significant+figures).
Answer: That's the point, you weren't meant to round it up. Approximation of numbers comes with error because you are, for instance, adding .005 to 2.545 to approximate it to 2.55. The .005 has a value and adding it when it never existed generates error. Now the question is requesting you to calculate the percentage error (.005s) which I believe should be $$\frac {\sum errors}{\sum accurate} × 100$$
So approximation causes error.
Comment: So do I use the calculated value to 4 s.f to compute the percentage error?
Comment: Yes, it will then be the accurate value in the above formula. The sum of positive difference between the 3 s.f and 4 s.f will be the sum of error.


How to create new Farm in Share Point 2010 on single server?

Question: I want to create new Farm on Share Point 2010 server. I have already one Farm on same SharePoint 2010 server and want to create new Farm with existing Farm on same server.
That means I require multiple farm working on same SharePoint 2010 server.
Is it possible to create new Farm? Please provide step to create new Farm if possible to create.
Comment: I want to create multiple farm on my Share Point 2010 system. Please help me.
Comment: Why don't you try with Virtual Machine?
Comment: I am already using VM for it, but I want 2 different farms working together. So I can configure both farm different way on single server.
Answer: You can not have two SharePoint farm on one server, Main reason is Config DB. One Server can connect to one Configuration Database only. You can Share the SQL Server between multiple farms.
Your Best bet is create another VM and configured the 2nd farm.
Comment: Tank you for reply. http://www.informit.com/articles/article.aspx?p=2131832&seqNum=2  but given articles says that this is possible and I found from others sources that multiple farm is possible but I don't find steps for that.
Comment: did you try with new SQL instance for new farm then we can avoid conflicts.