Behavior of Pion-Mediated Nuclear Force before Electroweak Symmetry Breaking?

Question: When Chiral Symmetry was exact, as it was before EWSB due to the lack of mass terms for quarks, would the residual strong force have infinite range? Related to this, does the Negative Beta Function apply for the Nuclear Force, or does it only affect the Strong Force within nucleons?
Answer: Before EWSB, chiral symmetry is still broken by the yukawas, that is there is a Higgs quarks vertex that breaks explicitly $SU(2)_L \times SU(2)_R$. Therefore, the pions would still be massive and hence mediating a short range residual nuclear force. Moreover, it doesn't make much sense thinking about 'before' the EWSB since you are looking at pions interacting with nucleons, that is at scales well below the Higgs vev.
As for the last part of your question, I don't think I understand what negative beta function you are referring to.
Comment: But I thought massive quarks made chiral symmetry only an approximate symmetry, and thus the symmetry breaking creates pseudo-goldstone bosons with a mass rather than massless goldstone bosons?
Comment: Indeed, but the quark masses come from the yukawas, that is the couplings to the Higgs bosons. And, as I said in the answer, as long as the yukawa aren't zero (well, in fact, equal) the chiral symmetry is broken even with no Higgs vev and no quark mass. In such a case it is the interaction (eventually responsible for the masses after EWSB) that breaks chiral symmetry.
Comment: Ah, so higgs interactions exist before EWSB. So, let me get this straight, higgs interactions always give things mass, but the presence of a nonzero VEV leads to all fermions interacting always?
Comment: Higgs Interactions are there before and after EWSB.
Comment: Ah! That makes sense! Another question, though. Is it that there is the POSSIBILITY for there to be a Higgs-quarks interaction vertex that breaks the symmetry, not necessarily that the interaction is something that's ACTIVELY happening?
Comment: I am sorry, I don't understand the question
Comment: let us [continue this discussion in chat](http://chat.stackexchange.com/rooms/14559/discussion-between-plasmamaster-and-twobs)


photoshop selection dragging during creation of a shape

Question: Is there a way to drag a selection and move it around while you create it? I know there's a program that supports this but I don't remember which.
like some sort of a key combo.
for example holding shift while sizing you shape keeps the aspect ratio and holding alt duplicates your sizing in the opposite direction. I would think that holding ctrl would let me move the shape around.
Answer: Sure is.
Hold the Space Bar down while you are dragging out a selection.
This works with the Rectangular Marquee, Elliptical Marquee, Single Line Marquees, and all the Shape tools.
Comment: Thanks! I remembered there was such a functionality but I couldn't recall where.
Comment: I also just realized you've answered another question I had before. you seem like a very active user here so I wanted to thank you for that as well.
Comment: Glad I could help :)


How can I UN-attach media from a post?

Question: I'm having a trouble un-attaching media from a post without deleting it entirely from my site. Is there a simple way to unattach an image from a post for instance?
Answer: I learned from Brian Fegter that you can Un-attach an image from a post while participating in this question:
Can I attach an image to a different post?
It isn't exactly "simple", but not to difficult. It's the only solution I've been able to find.
Answer: Is this what you're looking for?
e.g. Remove all image attachments from a post
//get all image attachments
$attachments = get_children(
                    array(
                        'post_parent'       => $post->ID,
                        'post_mime_type'    => 'image',
                        'post_type'         => 'attachment'
                    )
                );

//loop through the array
if( !empty( $attachments ) ){
    foreach( $attachments as $attachment ){
        // Update the post into the database
          wp_update_post( array(
                    'ID' => $attachment->ID,
                    'post_parent' => 0
                )
            );
    }
}

However, please take note of the caution when using wp_update_post.
Alternate method using $wpdb
//replace this with the above inside the foreach block;
global $wpdb;
$wpdb->query(
    "
    UPDATE $wpdb->posts
    SET post_parent = 0
    WHERE ID = $attachment->id
        AND post_type = 'attachment'
    "
);

Answer: As of WordPress 4.2 this functionality is built in. Click the Detach link in media list view.
For older versions, there's a plugin which does the same thing: https://wordpress.org/plugins/unattach/

Unattach is a very simple plugin which allows detaching images and other media from WordPress posts, pages and other content types.

How can I UN-attach media from a post?


New Eaton Breaker Tripping

Question: After replacing 20 amp Eaton breaker and the four receptacles that are attached, breaker continues to instantly trip with a heavy arc.
Comment: Was the old breaker doing the same thing?   Can you go ahead and remove the wire from the breaker?  And then test to see if the breaker holds then. Make sure to cap off the wire so it can't hit something.
Comment: Did you change the receptacles also or just the breaker?  If you also changed/worked on the receptacles then you have a hot wire/screw too close/touching ground, easy to find since there should be a nice black mark showing.  If just the breaker the same, but is harder to do/miss.
Comment: Does the new breaker have a TEST button on it?
Comment: Welcome to [diy.se]. If you'll take the [tour], you'll note that this is a _Question_ and Answer board. Please [edit] your post to actually ask a question. As it stands, it just a couple of statements.
Comment: Certainly sounds like you have a hard fault that your breaker was protecting you from, but you wanted to blame the breaker, so you changed it out, and the new breaker is also protecting you from it. Bad breakers do happen, but *rarely* compared to actual faults.
Answer: As with a lot of problems, the way to troubleshoot is one piece at a time.

Breaker/Panel

Disconnect the wires from the breaker. Turn it on. Does it trip? Bad breaker or serious bus problem. Move it to another space in the panel and turn it on. Does it trip? Bad breaker - replace it. If it works OK then you have a serious bus problem in the original location.

Receptacles

Disconnect all receptacles. That will likely be two sets of wires on most of them and one set of wires on the last one.
Turn on the breaker. If it trips then you have a problem in the wiring in the wall (e.g., mouse chewed through the wires or a nail punched through the wires) or you have another receptacle or switch or junction box in the circuit that you have not identified yet.
If it doesn't trip, identify the first receptacle (it will be the only one with a hot wire), turn off the breaker and connect only the wires from the panel to the receptacle. Turn on the breaker. If it trips, the problem is either the receptacle itself or, more likely, the way the wires are connected or the way the wires are stuffed in the box. Replace the receptacle, wrap the screws with electrical tape or do whatever other fix is needed.
Lather, rinse, repeat.

New Eaton Breaker Tripping


I want to get all SPL tokens that are created and have some metadata

Question: Earlier this was done through Solana token registry, although since its shut down what is the new way of fetching the latest tokens
Answer:
Aggregate mint accounts from onchain.
Get metadata from onchain for aggregated mint accounts.
Keep track of token program transaction history and parse create_token transactions to get newly created mint addresses seamlessly.

However, the easist way to get available tokens is to use 3rd party apis.
https://api.cryptorank.io/v0/coins?platformKeys=solana


Indexing json on Solr, it indexed as a List instead of as an item

Question: I'm trying to index a JSON file in Solr and it works, but i don't understant why Solr is indexing elements as an array instead of an element.
When I indexed the example json file "books.json" it works fine, but if I index another file "items.json" it generates a different output.
I show below:
Books.json
 [{
    "id" : "978-0641723445",
    "cat" : ["book","hardcover"],
    "name" : "The Lightning Thief",
    "author" : "Rick Riordan",
    "series_t" : "Percy Jackson and the Olympians",
    "sequence_i" : 1,
    "genre_s" : "fantasy",
    "inStock" : true,
    "price" : 12.50,
    "pages_i" : 384
  }]

 OUTPUT

{
    "id": "978-0641723445",
    "cat": [
      "book",
      "hardcover"
     ],
    "name": "The Lightning Thief",
    "author": "Rick Riordan",
    "author_s": "Rick Riordan",
    "series_t": "Percy Jackson and the Olympians",
    "sequence_i": 1,
    "genre_s": "fantasy",
    "inStock": true,
    "price": 12.5,
    "price_c": "12.5,USD",
    "pages_i": 384,
    "_version_": 1457847842153431000
},

Items.json
[{
    "title" : "Pruebas Carlos",
    "id" : 14,
     "desc" : "Probando como funciona el campo de descripciones"
}]

OUTPUT

{
    "title": [
       "Pruebas Carlos"
    ],
    "id": "10",
    "desc": [
      "Probando como funciona el campo de descripciones"
    ],
    "_version_": 1457849881416695800
},

My Schema, where i only added the new fields that i need.
Can someone explain to me how I have to do to index the elements without []?
Thanks
Comment: Could you edit your question and add the `schema.xml` of that core?
Comment: Done, i uploaded it to pastebin
Answer: You have set both fields (title, desc) as multivalued, that is why, do this if they have a single value:
<field name="desc" type="text_general" indexed="true" stored="true" multiValued="false"/>
<field name="title" type="text_general" indexed="true" stored=" true" multiValued="false"/>

Answer: In short, these fields are configured to be arrays by your schema, this is why they are written as JSON arrays to the response. Even if they only have one member in your samples.
You need to configure them as multiValued="false" if they are only single-valued.

The fields you worry about title and desc are configured as multiValued="true" as you can see in this excerpt from your schema
<field name="title" type="text_general" indexed="true" stored="true" multiValued="true"/>
<field name="desc" type="text_general" indexed="true" stored="true" multiValued="true"/>

If you scroll up a little (to line 82) in your schema, you can read what this stands for

multiValued: true if this field may contain multiple values per document

You can read what this is good for and what the consequences are in several sources

here on SO - What is the use of "multiValued" field type in Solr?
on Solr's Nabble - How are multivalued fields used?
Comment: ouch, it was very easy. Thanks :)
Answer: Looks like you have a problem associated to nested Jsons, you can use -
(i) /solr/update/json?commit=true?split=/&f=txt:/**
(ii)    Using Index handlers - https://cwiki.apache.org/confluence/display/solr/Uploading+Data+with+Index+Handlers


Can't find Takemura on the mission "Down the Street"

Question: I was playing "Down on the street" and when I got the choice to ride with Takemura I selected to go alone. When I arrived to jig-jig street I instantly got a different objective and didn't get the chance to meet with Wakako. The new objective was to "talk to Takemura" when I arrived there it looked like Takemura was somewhere under the ground. There was a door that looked like it led there but it was locked. Is there any way to get there or restart the mission entirely? I've tried restarting the game and this is the only main quest I currently have.
Answer: Takemura is not present at the mission marker, the mission marker indicates a location near a barrier that you need to go to and then "use" to wait for Takemura to arrive.

You need to go down to the docks (which is on a very low level, underneath the main city but the sky is still visible) and then lean against a barrier at the mission marker. This will start a conversation with Takemura when he arrives.


Why non-flavored variant is usually vanilla?

Question: Usually the "flavorless" version of various desserts or drinks is in fact vanilla flavored -- why not leaving the product just as it is, especially when the "flavoured" versions usually don't contain vanilla? Any why vanilla, not anything else?
Comment: I don't have an answer, but the "non-flavored" ice cream is actually used occasionally. It's called sweet cream, and usually has some strongly flavored mix-in. See http://www.seriouseats.com/recipes/2011/02/the-secret-ingredient-black-pepper-sweet-crea.html
Comment: At Amy's Ice Cream, in my hometown, most people get "crush'ns" in their ice cream - and they actually have a sweet cream flavor!
Answer: Why Vanilla???
Vanilla is a rich and powerful flavor, with over 200 flavor compounds besides the basic vanillin.  Due to its complexity and neutral flavor, it can be combined with a plethora of other flavors without conflicting.  It just provides a good neutral base to build on.  The vanilla also enriches the products if they are combined with additional flavorings, adding body and depth to the final result.

Ok, so Vanilla makes sense, but why add ANY flavoring?
On their own, sweet products may not have much flavor (remember, ice cream is just milk, sugar, and cream).  Vanilla gives them a little flavor as a starting point.  It also masks any unpleasant flavors present as a result of ingredients.  For example, truly unflavored yogurt has a  fairly strong lactic acid flavor of its own; this is something where you can get a TRULY unflavored yogurt and see what I mean.   It's a whole different animal, and brings to mind that it's simply soured milk. Carbonated water similarly has a fairly unpleasant bite to it when no flavoring is added, as a result of the carbon dioxide reacting with water to produce carbonic acid.

Why can't I find stuff without ANY flavoring?
You can, if you know where to look!  The truly unflavored products are generally used differently than their vanilla-flavored "unflavored" counterparts.  Club soda / seltzer water is simply unflavored soda, and is stored with the stuff for mixed drinks, since that's where it is normally used. Unflavored yogurt is used in cooking savory Mediterranean dishes, and may be to the side of the flavored yogurts.  As the comment mentions, unflavored ice cream is available as sweet cream.
I can't think of any other normally-vanilla flavored products, but if you can come up with some, I can probably find them for you under a different name.
Comment: You discussed the general aim of adding vanilla, I was thinking mainly about those supermarket dairy creations made by Danone and similar companies. In fact, I expected that it is about sugar; this is the common factor among products with this vanilla version, so it seemed logical that vanilla helps to neutralize this boorish sweetness an unflavored product could have.
Comment: Well yes, you don't generally add vanilla to foods that are salty.  Obviously this is all within the context of sweet foods, and primarily dairy products.


Building a Battery Charger with an LM317

Question: I was told that i could make a simple battery charger from a LM317 and a resistor to charge some Ni-MH Batteries. Can someone just expand on this a little such as how it works as I don't really understand it. Some more information is that there are 12 AAA batteries that hold a charge of 1000mAh and 1.2v per cell.
Answer: This page apparently describes a LM317-based charger with auto-shutoff, though it has a few more parts than a resistor.
At the most crude, you can use an LM317 and resistor to form a regulated current source, which is how NiMH/NiCd's should be charged.  See "Precision Current Limiter" (p. 19) on the LM317 datasheet.  The regulator functions as a current source by attempting to supply as much current as possible to have Vout - Vadj be 1.25 V.
Note that there is nothing inherent in the LM317 to shut off a charge, so if the batteries are fast-charged (~C/2 or higher), they will fail if you do not terminate the charge at the appropriate time.  With a trickle-charge (C/20), you "can" leave them alone with no ill-effect.
So in your specific case, the 2-part charger would be a LM317 and a resistor to charge the pack at C/20.

Charge rate: 1000 mA·h @ C/20 => 50 mA
Resistor value: 1.25 V / 50 mA = 25 Ω

You need to provide a voltage to Vin at least 2.0 V (dropout voltage) + 1.25 V (reference voltage) = 3.25 V greater than the maximum charging voltage.  The resistor would be connected between Vout and Adj, and your load is connected to Adj (not Vout)
Comment: Shouldn't the Charge rate be equal to the total of all the batteries to 12000? As they are connected in series to give me a voltage of 12 volts.
Comment: @Dean - No, your battery's capacity is 1200 mAh @ 12 V.  Assembled in parallel, the current capacity increases, in series, only the voltage increases.  By your logic the power contained in a battery increases with the square of the number of cells (your voltage *and* current capacity increased by 10x, yielding 100x the energy.) If you build this charger, let me reemphasize that the "LM317 + 1 resistor charger" is more of an academic curiosity, not something to be used for everyday use.
Comment: Yes i know i'm just implementing it in to my project so i don't have to take out 12 batteries and charge them i can just plug it in to my power supply and let it charge.
Answer: A good tutorial using a microcontroler to automatically disconnect the charger when the battery is full is available on http://www.shapely.asia/charge1.html
Answer: You can use this for simple trickle charge. Use the resistor to ensure that the charge delivered to the battery is less then C/10 (capacity of battery divided by ten, ie. 1200mAH batter gets 120mA or less). Most NiMH batteries can handle this for quite a while.
There are some pretty cool designs out there for this. As long as you keep your charge current low you can accidentally leave the battery on the charger for many hours past the point of full charge without having to worry about overcharge damage, the downside being that they will take 12 or 15 hours to charge in general.

NiMH have very interesting charge characteristics. They need to be changed very intelligently to stop from possibly shortening their life. If you want something that charges in a time like 4 or 5 hours from fully dead you need an intelligent controller.
Comment: Pretty much the same idea I was going with but with some useful additions.  All the parts besides R1 and the 317 are "optional"; D1, T1, R2 just provide a charging indicator, C1 for some basic filtering.
Comment: I was having internet issues. Sorry, did not see yours. They have similarities, but I was focused on giving a simple solution while you focused on a general explanation of the problem, +1 to you also!
Comment: I understand that. They also note that most people are doing trickle charge for months. I specified you can get away with a few extra hours. They suggest never ever trickle charging for extended periods, and I agree.
Answer: Quoting Russell from the PIClist: "AA cells of over 2000 or so mAh from reputable manufacturers recommend NO trickle charge or low AND extremely short duration trickle charge." Low capacity cells (e.g, 800 mAh AA) are OK with trickle charge.
You are definitely into high-capacity cells with 1000 mAh AAAs.  Check the manufacturer's datasheet before charging them with the indefinite-trickle method. However reputable manufacturers place a catalyst that will handle small amounts of excess trickle charging and will be able to handle a few extra hours of C/40 or less charge rate after charged.
The most dependable smart chargers(in relation to ensuring full charge) must use overcharge heating to detect overheating. It is almost unavoidable.


What is the elevation angle of sun at lunar poles?

Question: The Moon's orbital plane is inclined by about 5.1° with respect to the ecliptic plane, whereas the Moon's equatorial plane is tilted by only 1.5°.
Answer: The picture shown below holds the key to the answer. The maximum elevation angle the Sun can make is the sum of the Moon's own equatorial tilt (1.5°) and the angle formed by the ecliptic plane and the Moon as viewed from the Sun. As shown in the diagram, the Moon makes a 5.1° angle with the ecliptic when viewed from the Earth, for the Moon is directly orbiting the Earth. Because the Sun is so much farther away, the ecliptic angle viewed from the Sun is correspondingly smaller, only about 0.01°, and so the Sun's maximum elevation angle at the lunar poles is essentially the 1.5° tilt angle (the 0.01° figure is not a significant digits given the rounded values of the angles).

This low angle has some physical significance. Because many of the crater walls on the Moon slope with much larger angles than that 1.5°, the craters near the poles contain shadows within where the Sun is too low for its light (and heat) to get past the rim. Where these shadows reach the bottom, the bottom is permanently dark and cold, and scientists believe that water ice may be embedded in such shadowed places (crater bottoms near the poles). The planet Mercury presents a similar situation and despite its being close to the Sun, it could harbor water ice in crater bottoms near the poles too.


Splitting a document on artboards into separate documents. (adobe illustrator)

Question: How save from one document all artboard to individual documents (in ai format).
Answer: Thank you for trying to help. But I myself remembered how to break a document on artboards. This is done simply:
1 - use the comand -Save as-
In the menu that appears, the checkbox "use artboards" is not active. But it's not scary. You need to click "Save"
2 - In the next menu that appears, check the checkbox:
"Save each artboard in a separate file"
Mission complete. Thanks to all.
Answer: Why don't you use Illustrator EPS format?
You can save all your Artboards by choosing: File -> Save As.. -> Illustrator EPS and then check box "Use Artboards" and select "Range"
Answer: Note: I Use adobe Illustrator CS6 I dont know it the new versions are capable of doing it in AI format
In CS6 I also cannot save artboards directly in AI format but you have an Option for EPS and SVG which is also 100% vector and layers are kept tidy/arranged.
For me I do it in a long method. You may try it if you want to. Shown are screenshots of what options we can use.

Like yours I have no option for artboards to Ai.

But you can use EPS, SVG or PDF Instead (it will retain the vector). Be sure to check Use Artboards (select all or specific boards or details only)

Re-open the EPS files and delete unwanted areas then save now for Ai.
Or better rename the artboard files as <>.ai directly.
Answer: When you save your file, simply check the "Save each artboard to a separate file" checkbox. This can be found when the Illustrator Options window pops up while saving your file to the .ai format.


Johansen Cointegration Test at Levels or First Differences in a VAR Model

Question: I have multiple variables that I am trying to perform a VAR model with, but all my variables are non-stationary at levels as they fail the Augmented Dickey Fuller test. Having taken the first difference, they do all become stationary at I(1).
I was wondering, do I perform the Johansen cointegration test on the I(0) variables or the I(1) variables.
Thanks in advance
(I also have a couple other questions, please do answer this as well if you know the answer: 1) I am right in thinking I should perform the VAR regressions on the I(1) variables, right?
2) If I have cointegration present, and my I(0) variables are non-stationary, I should switch to a VECM model? )
Answer: You do the cointegration analysis/test on I(1) variables, because no cointegration is possible among I(0) variables. (This is textbook material; try some of these.)


What is the best method/ readings to learn WWII

Question: I am reading "The Dictators" about Hitler and Stalin's lives and paths to power. However, I find it very difficult to follow, because after every page, I must stop and look for some concepts on wikipedia before continuing, like tsarist war, communism, fascism, the allies and their interests. Most of my previous knowledge on WWII comes from movies, but it's very sparse/ scattered tough, and I still don't fully understand the purposes of war. Should I first study some geography and economy? I'd appreciate any tips and recommendations, if possible, in a structured/ chronological way.
Comment: I'm voting to close this question as off-topic because it asks for a source.
Comment: The leading current authority on the Hitler period (in English) is Professor Sir Ian Kershaw. Try [this reading list](http://www.amazon.co.uk/Ian-Kershaw/e/B001ITX4WI) for size
Comment: I'm afraid that [reference requests](http://meta.history.stackexchange.com/q/2185/1401) are still out of scope for H:SE. Please feel free to contribute to the discussion on meta and help us find a way to address the reference request question.  Until we resolve that issue, questions like this one are probably out of scope.
Comment: As worded, you are asking for an encyclopedic reference. I suggest you ask specific questions on concepts and topics you are struggling to understand. Provided they are not trivially answered by Wikipedia or Google, those **will** be *on topic* here.
Comment: It seems that you need some general 20s century history. I recommend Paul Johnson's, A History of the Modern World from 1917 to the 1980s.
Answer: For me I had lots of trouble with WWII (and in fact most wars), due to the way history tends to be taught as a jumbled set of disjointed facts and incidents, rather than a coherent story.
So for me at least, the best way to start to make some sense of WWII is to first learn from a good chronological-based narrative-style source. Preferably one with maps. The New Penguin Atlas of Recent History is one good such resource (also covering WWI and the Cold War). For the Pacific theater, the Penguin Historical Atlas of the Pacific is also a great resource. Despite the scope spanning human history, I remember nearly half the maps covering that exact war.
Once you've got the basic chronology in your head, drilling down to specific things without getting totally lost is far easier. Different people learn different ways though. This is just what made things start to click for me.


Symbol's value as variable is void: shell-mode-map

Question: Windows 10, Emacs 25.1
In my init.el
(define-key shell-mode-map (kbd "C-c C-l") 'helm-comint-input-ring)

But when I start emacs I get error:
Symbol's value as variable is void: shell-mode-map

Comment: You need to load the library that defines `shell-mode-map` before you try to use it.
Comment: Possible duplicate of [Defining key-bindings within \`helm-map\`: getting a \`void-variable helm-map\` error](https://emacs.stackexchange.com/questions/2539/defining-key-bindings-within-helm-map-getting-a-void-variable-helm-map-erro)
Answer: Drew is right you need to load the package, which defines shell-mode-map
(require 'shell)
;; your code based on functions and variables defined in shell.el

Explanation
At the end of your Emacs's shell.el file you should find a line:
(provide 'shell)

This line holds the trick, because Emacs elisp and Common Lisp have their own unusual import solution, every package provides a FEATURE which can be used to load a package into memory, which is uncanny at first because the file must be read even if it won't be loaded.
My educated guess is it happens because lisp code can be read without evaluation, which maybe used to achieve some optimization and security solutions. Imagine you can write lisp code to reprogram your lisp code before loading the package, which is a way of meta programming.
So require uses the provided FEATURE as quoted argument to load a package.
Hint:
If you don't know the feature name, check Emacs feature list variable, by hitting C-h v and typing features, or seek the provide function in the source file.
Update:
phils pointed out that provide tells Emacs that the library is loaded, so a next require call will not load it again. So my guess (stroke out text) was wrong.
Comment: `provide` simply tells Emacs that the library is now loaded, so any that additional `require` calls for that library can bail out without actually (re)loading the library. If it is not already loaded, `(require 'shell)` will `load` the library `"shell"` (simply using the symbol name as the library name).
Answer: you can also use with-eval-after-load. In particular:
(with-eval-after-load 'shell
  (define-key shell-mode-map (kbd "C-c C-l")
                             'helm-comint-input-ring))


Old switch has four wires and no discernable ground

Question: I am trying to install a decora smart switch for my front home lights. The switch is in a box with the hall light switch and a switched outlet switch. I think the front lights switch is a single pole but not sure how to connect everything. Thanks in advance.
Comment: Does it work now, with the wiring shown, and you just want to replace the existing switch?  Is there another switch somewhere that also turns that light on and off?
Comment: Since the switch next door is a stack switch is this one also?  You didn't show the front of the old switch.  Also what does the yellow wire attach to in the box?
Comment: Yes, it works now with the wiring shown. It is a simple toggle switch and there is not another switch in the house that controls the front lights. It is not a stack switch on this side of the box. Not sure what the yellow wire attaches in the box. How do I figure that out?
Comment: Are there two different front lights controlled by this switch?
Comment: There are three lights. One by the front door and one on each side of the garage.
Comment: Can you post a clearer photo of the inside of the box? I have reason to suspect this is a conduit job...
Comment: https://photos.app.goo.gl/kCcsMuWvQvAleMZN2
Comment: So I installed a different switch in the living room and got it to work. In that box there were two white wires connected to each other and tucked in the back of the box. I took them apart and hooked both to the new switch to get it to work. Is it possible I will need to do the same in the other box? It looks like there might be three white wires hooked together and tucked in the back of this box too.
Comment: Actually there are four white wires connected with a wire nut in the back of the box.
Comment: Don't mess with those white wires. Leave them in the back of the box.  Switches need to operate on hots, not other wires.
Comment: @Harper - As I understand it, he's installing a smart switch, so he needs a neutral.
Answer: I think I see what is happening.  Many devices (switches, outlets) allow you to connect via either the screw terminals or the "backstabs" as we call them (with some contempt because they tend to fail a lot).
You're supposed to use only screws or backstabs.  But the screw is connected to the backstab internally, so this is a possible way to use both, which splices the  two wires and also connects to the device.
It's just a lazy cheatey way to splice both those wires to the same screw without using a wire nut and pigtail.
Now, I think this is a 3-way switch, but you didn't mention it being controlled in a second location, and the wiring doesn't make sense for a 3-way, so I think this is being used as a 1-way switch simply by not using one of the brass screws.
The two yellow wires are definitely using the "use the switch as a splice" trick.  Both those wires should go to a wirenut, with a third short pigtail going to that same switch's screw.  Since your lights are in three locations, my guess is the two yellows are both switched-hot running in different directions out to the lamps.
I can't quite tell if the black wires are on the same "screw", but it looks that way. Note how the
It's a little harder to tell whether the blacks are on the same "screw"... But you see the stabbed black is a pigtail to a wire-nut. That is surely supply hot being distributed to several switches. Which would make the screw trick simply extending that hot further. If so, the wire on the screw now should go into that wire-nut, and the pigtailed wire should use the screw.
If it works out as I describe, now you have 2 wires going to that switch: the black is supply/always-hot/line, the yellow is switched-hot/load.  If your smart switch needs neutral, you can add a white pigtail to that bundle of neutrals in the back of the box.  (which you should not otherwise be messing with!)
Comment: Thanks for this explanation. It seems to be similar to the other one by Stanwood and is much appreciated.
Answer: If there were no switch you would have a hot wire bringing power from your service panel and a neutral wire returning to the panel.  Connect these to a lamp and you get light. The hot wire is on the "line" side and the lamp is the "load". The neutral wire can be white or grey. The hot wire can be most any color but not white or green; black is the most common.
If we disconnect either wire, hot or neutral, the lamp goes out. However, for safety reasons we must never disconnect the neutral wire. This is an important rule and we will return to it later. A single-pole switch is connected inline with the hot wire on the way to the load. The line is connected to the darker screw terminal and the load is connected to the lighter screw. When the switch is on the hot line is connected to the load. When the switch is off the hot line is disconnected from the load. In either position the neutral wire remains connected to the load.
On your existing setup it looks like the black wire attached to the dark screw terminal on the switch is the hot line. The two yellow wires are connected to the line voltage when the switch is on and these presumably go to the front door and garage lights. The other black wire in the back of the switch is always connected to the hot line. I expect that the pigtailed wires attached to it are then connected to the two switches on the right hand side of this box but they could be used to expand this circuit elsewhere as well. Finally, one of the white wires in the back is the neutral wire returning to the circuit panel and the other white wires pigtailed to it are connecting various circuits to neutral.
This installation is OK but a bit lazy. It would be preferable to pigtail all those black wires together and connect a short extension wire to the dark screw on the switch. Same thing for the yellow wires.
To install the Leviton DZ15S light switch in a single-pole configuration (1) pigtail the other black wires to the black line wire and run an extension to the dark screw marked BK, (2) pigtail the two yellow load wires and connect an extension to the magenta screw marked RD, and (3) pigtail the white neutral wires and connect an extension to the light screw marked WH.
At this point the light should switch but to have a safe installation you need to connect a grounding wire to the green screw. If there is already a bare Cu or green grounding wire in the box then you may pigtail off it to connect to the green screw. Alternatively, the box may be grounded through a metal conduit in which case you need to connect a short jumper between the green screw on the switch and either a grounding screw in a spare hole in the box or a grounding clip attached to the edge of the box.
In the comments you reported installing an unrelated circuit by taking apart two white wires and connecting them to either end of a switch. These are quite possibly the neutral wires of that circuit in which case you have created a break in the neutral wiring whenever the switch is off. This is a serious electrocution hazard. You may want to open a separate question regarding how best to wire that circuit.
Comment: Thank you for this detailed explanation. I think I am following everything but will read through a few more times before attempting the installation. With regard to my other installation, based on your comments, would it make sense for me to disconnect the two white wires and pigtail from the them to the switch instead of connecting both white wires the way I have them now? Thanks again!
Comment: If you are installing a "smart switch" or timer that calls for a neutral wire (to power its internal electronics) then yes you pigtail onto the existing white wires. But the switched wires would not normally be white. So two other wires are required as in this install.
Comment: Thinking about that other switch now. Should I keep that switch on until I can adjust the installation?
Comment: Just to clarify my question, I would leave the other two wires (they happen to be red and yellow like the other switch) but would pigtail the white to connect to the switch. AND, leave the switch on until I can fix it.
Comment: I suggest submitting another question.


Does enabling dhcp stops broadcasting within the network (currently on static)?

Question: I have recently found the broadcasting in a network which is running on static IP's. If I enable DHCP will the broadcasting stops?
Which is the best way to prevent broadcasting?
Comment: What would be the need, or desire, for reducing the minimum amount of congestion that this produces?
Comment: Did any answer help you? If so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you can provide your own answer and accept it.
Answer: DHCP will add more broadcast on your network.
see: https://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol
Answer: A layer-2 network depends on broadcasts in order to function. The way one host discovers the layer-2 address of another host (including the gateway) on the same network is by using ARP to resolve the layer-3 address to the layer-2 address. ARP sends a broadcast since it doesn't know the layer-2 address (what it is looking for).
Broadcasts are an essential part of networking, and preventing broadcasts will kill your network.
Answer: With DHCP you can set flags for Windows hosts to never use brodcasts to find each other. This way you could potentially have less broadcasts, but...
you need to check with network analyzer like tcpdump or Wireshark to see which machines are broadcasting what. Then you can turn off protocols and/or applications which are causing this and are not needed. Also if you have smart switch you could enable protocol vlans to limit protocol broadcasts only to proper hosts, etc.


How can I choose num of epochs and batch size?

Question: I have the coco 2014 dataset and need to train it as training is around 82700 and testing is 40500. However, I got the same sentence with different values every time with model.pedict() as I used one epoch only. Now, how can I decide the right number of epochs? I am trying 20 epochs now, but without batch size. Is that right?
Answer: Epoch

One epoch leads to underfitting of the curve in the graph (below).

Increasing number of epochs helps to increase number of times the weight are changed in the neural network and the curve goes from underfitting to optimal to overfitting curve.
Number of epochs is related to how diverse your data is. Read this article for better understanding
Batch size
Good batch size can really speed up your training and have better performance
Finding the right batch size is usually through trial and error. 32 is a good batch size to start with and keep increasing in multiples of two.
There are few batch finders in Python like rossmann_bs_finder.py
This article can help you better understand batch size,
How to get 4x speedup and better generalization using the right batch size
Comment: Do provide the link of coco2014 dataset
Comment: thanks a lot for replying .. can you please see the edit post


Algebra over line segments

Question: I have a question probably related to pure mathematics, but I'm not sure. I have some line segments (in 1-dimensional space), where I want to define a function over them to make a union of them. However, my definition of union means a new line segment starting from the minimum position between line segments, and finishing at the maximum position of end positions between line segments. Is there any algebra where some operator (for example + or $\cup$) in it satisfies my requirement.
Answer: There is certainly an algebraic structure you can use. Let $A_{min}$ be the min-plus algebra and $A_{max}$ be the max-plus algebra (don't be fooled by the names, these are technically semirings). Consider the semiring $A_{min}\times A_{max}$, which consists of pairs $(a,b)\in [-\infty,\infty)\times (-\infty,\infty]$. Then you are looking for the subsemiring of $A_{min}\times A_{max}$ with $a<b$ (or $\leq$ if you allow degenerate intervals).

Algebra over line segments


QuickContactBadge on an unknown contact

Question: I'm downloading a list of contacts from a company website.  The contacts may or may not be on the phone.  I'd like to use the QuickContactBadge since the downloaded information will contain: office phone number, mobile number, email, name.  This way users can quickly view and contact the people listed on the company website or add them to their list of phone contacts.
All the examples show how to use existing contacts.
When I want to add an unknown contact name, email and phone numbers I call from my listview adapter:
QuickContactBadge badge = (QuickContactBadge) baseAct.findViewById(R.id.badge_small);
badge.assignContactFromPhone("888-555-1212", true);
but it crashes on assignContactFromPhone.
Can I use the quick contact badge for this or should I just create a separate view that has a button for phone, email, and importing a contact?
SamB
Answer: I suggest you have a look at this. As QuickContacts refer to the RawContacts.CONTENT_URI : prior querying it you should add those contacts to this provider, or work around with the source to get your own version !

QuickContactBadge on an unknown contact


Magento SSL Sagepay empty cart issue

Question: Trying to setup SSL on the Magento checkout pages but have run into this issue:
After payment details are submitted, the payment goes through fine (checked with sagepay) but when sagepay redirect to the success page (/sagepay/server/success/?SID=session_id), it then tries to redirect to /checkout/onepage/success/, where I get an error saying my cart is empty.
This only happens when SSL is enabled, if I turn off secure urls (in the magento backend), everything works fine.
I'm using the Pod1_SagePay extension, in the iframe mode.
Any idea where it might go wrong?
Answer: Did you check Ebizmarts Sage Pay Suite CE ?
I've tried the new free ebizmarts extension, Sage Pay Suite CE, it supports Server integration and it works pretty well.

Magento SSL Sagepay empty cart issue


How can a project prolong a parachain slot lease in Kusama?

Question: I believe, some of the Kusama based projects have done that already. What exactly did they do and what are the options if a project wants to prolong or renew the parachain slot?
Answer: How to extend a slot on the relay chain
To extend a slot on the relay chain the parachain team needs to secure a new slot via an auction. There are several approaches to doing so. Therefore your team needs to see what is the best fit for your case.
Each slot can be a most 8 lease periods (LP). That means your team will need to acquire a new slot of 8 LPs via auction.
To avoid downtime, your team will either need the new LP to start immediately after your existing one or you can have the slots "overlap" each other.
Option 1: Overlapping Slots
Aquire a slot where the first LP is before the last LP of the current slot.

Register a new paraId
Win a slot auction with the new paraId

Your team will now have two slots: one that will end soon, and one that just started.
Both slots will have at least one LP in common

When the old slot transitions to their last LP, your team can do a swap to swap to the new slot.

By calling swap, your original paraId will be kept.

Currently this has to be done via on-chain governance example but their are discussions to improve the process.

Note: This method has the benefit of giving flexibility to the team on when to bid for a slot, however it has the disadvantage of having more than one slot being active during the same LPs.

Option 2: Non-overlapping Slots
Aquire a slot where the first LP starts right after the end of the last LP of the current slot.
In this case, the team can bid directly with their current paraID, and it will be automatically extended without the need of swapping.
This method has the advantage of not having superposing LP's on different slots owned by the same team, however it has the disadvantage of losing flexibility on when to win a new slot: if the team does not win the exact slot, then it will suffer some downtime until it wins a new slot.

UPDATE - Feb2024
After RFC14 was added on to Polkadot, teams need to know that when using a new paraID (overlapping slots), there's no need for the new paraID to actually run in order to call the swap function. The reason being is that the paraID will not be locked anymore until the parachain produces the first valid block, and therefore the account on the Relay Chain that owns the paraID can call the swap function directly.
Comment: How are slots swapped via XCM? https://twitter.com/Polkadot/status/1546508812122734593


Intuition in infinite grounded conducting plane with a point charge above it

Question:
In this problem, we use the Method of Images and get the resulting properties of the charge distribution on the plane. At the end of this process, Griffiths, in Introduction to Electrodynamics, comments that we could have said that the charge on the plane was going to be $-q$ with some hindsight. How can this result have been obvious before arriving at the solution mathematically? I can't think of any thought process that would lead to the same conclusion.
Answer: Maybe if I say this less laconically it will be clearer: We are assuming there is no E field below the grounded plane. Look at how your charge density formula was derived. If you don't make an assumption like this you can't figure out the charge density. For instance if the image charge was a real charge there would be field below the plane and the charge on the plane would be zero.
There is no E field below so if we take a Gaussian surface with one side below the plane and the other sides going off to infinity, there is no flux, therefore no net charge, therefore the plane must contain -q.
Answer: I think that the "hindsight" goes as follows?
Electric field lines start on a positive charge and end on a negative charge so where else can the electric field lines from the $q$ charge go but to the infinite grounded conducting plate?
Comment: I understood the part that the grounded plate is going to be negatively charged and the field lines will terminate perpendicular to the surface. I specifically want to know how does one guess that the charge will be __$-q$__ exactly
Comment: By assuming that there are a certain number of electric field lines leaving a $=q$ charge and the same number are arriving at a $-q$ charge. Gauss can be used by having a Gaussian surface around the $+q$ charge and another Gaussian surface above the infinite conducting plane.


How are members of the Communist Party of China assessed for promotion?

Question: How are party members promoted to a higher CCP appointment? Is there a system of periodic assessment by senior party officials?
Comment: These two questions seem very similar: https://politics.stackexchange.com/questions/62620/relation-between-communist-party-of-china-and-civil-admistration
Comment: The difference is one is bureaucracy and other is CPC leadership. They are two different in many countries. The Chinese synergy seems unique.
Comment: When everything else is equal, loyalty to the prevalent doctrine of the communist party and personal favoritism is the ultimate tie-breaker.
Answer: I am sure there is a healthy share of insider's politics, especially when considering the common purges in the name of 'eradicating corruption' taken to a whole new level by Xi Jinping but to a lesser extent by all 4 CCP leaders since Mao.
A big part of the answer since Deng Xiaoping has been simply the Economic performance of the area they were in charge of. More specifically GDP seems to have been used as one of the main indicators. The way we know this is the recent explicit shift enacted under Xi Jinping of asking his party members and local leaders to stop putting GDP growth above everything else like the environment, as well as his whole narrative of common prosperity.
Of course, even if you had strong economic performance, it wouldn't shield you from a purge as discussed earlier, nor being used as a scapegoat for any events in your region that caused a big enough outrage online that censors couldn't keep up with.
I believe the recent shift from GDP as the main measure is bringing a lot of interest among China-watching communities to identify what will take its place. Contenders seem to be the development of any strategic industries (like microchips, aerospace, not social media apps nor video games)
Answer: There are more than 90 million Party Members in China, not all of whom hold government positions. Some are university students, some are employed in private companies, and some are within the government bureaucracy as civil servants. There are no mandatory requirements for joining the Party to be in any of the positions mentioned above, but it certainly helps them getting promoted or some preferential treatment. Only government leadership positions, or party mechanism positions require Party Membership to be considered for appointment (source).
According to this Party document, there are four kinds of assessment: Regular assessment, occurring at each local Party Member Conference; Annular assessment; Task-specific assessment; and Per-term assessment. The assessments assess the work efficiency, work ethics, adherence to Party policy, Leadership ability, emergency response ability, and so on. The assessments are done by fellow Party Members within the facility, their superiors, and special envoys sent from the Central Organizational Department. The results of assessment determines whether the person is to be promoted, demoted, or fired.
(Note that this is the official policy; whether it is actually adhered to is another matter.)


Biologically sound reason why underground dwelling Drow have dark skin?

Question: The Drow from Dungeons and Dragons are a race of elves with dark skin and pale hair that live mainly underground. How could these elves develop such a coloration when they live underground, away from sunlight, and by all means should be pale like many other creatures that live entirely in caves?
Comment: [Related](https://worldbuilding.stackexchange.com/questions/74045/can-long-term-exposure-to-high-energy-radiation-without-corresponding-visible-ra)
Comment: This is not a duplicate. The question of Drow having dark skin is separate from the question of such dwarves. The Duergar are not the Drow, and to dismiss the difference as, "Meh, both dark-skinned underground races," is not for everybody.
Answer: Radiotrophic melanin.
Underground there is more ambient hard radiation.  Radon gas is a prime example and a major source for radiation exposure in subterranean spaces.  The Drow use this radiation to supplement their metabolic activity in the same manner as radiotrophic fungi.
http://large.stanford.edu/courses/2017/ph241/white-t2/

. Robertson et al. studied black yeast (Wangiella dermatitidis)
  subjected to low-dose ionizing radiation. [5] They wanted to deduce
  the impacts of chronic radiation on the melanin-containing yeast
  (recall that melanin is the pigment that results in human skin color),
  as well as melanin-lacking yeast. They discovered that radiation led
  to increased survivability in the melanin-containing fungi, as they
  were able to absorb more nutrients and export more toxic metabolites
  from their cellular systems. The scientists even found that fungi were
  able to safeguard their DNA and utilize ionizing radiation as energy
  for DNA repair in some extreme cases. [5] Dadachova et al. also noted
  that while melanin-lacking fungi grew better in non-irradiated
  environments, this observation quickly reversed in the presence of
  radiation, with melanin saturated fungi actually increasing rapidly in
  dry weight in the presence of continual radiation.
This growth can be at least partially explained by melanin's ability
  to catalyze an oxidative-reduction reaction typical of cell
  metabolism. According to Dadachova et al., the electron transfer
  properties of melanin in the NADH oxidation/reduction reaction
  sequence necessary to supply cellular energy increased 4-fold after
  prolonged exposure to radiation.  Furthermore, even melanin-containing
  fungi cells subjected to limited nutrient conditions responded by
  growth when exposed to radiation as compared to their non-melanized
  cell counterparts.

Maybe the Drow use this for energy.  Better would be for the melanin catalyzed oxidation /reduction to serve the same role UV light does on the surface - UV hitting the skin makes vitamin D for humans.  In circumstances where UV light on the skin is scarce (people wear a lot of clothes, or days are short) humans evolved paler skin to maximize the ability to capture what UV there was.
Assuming human-type vitamin D metabolism in the Drow, they get essentially no UV light.  They instead use melanin pigment (the only human pigment) to capture hard radiation to make vitamin D.  The Drow are actually cave adapted albinos who secondarily acquired the ability to capture hard radiation energy via pigment, which is why they have white hair and pink eyes but skin that is nearly coal black.

Thinking more about what phenotype would result from this use of melanin, it would not look like humans exposed to UV.  UV stops at skin, but hard radiation penetrates tissues.  The drow would therefore have melanin through and through - not just on skin but also interior tissues and organs, blood, sclera and everywhere.  Their sclera would be black and their blood would be black.  This could happen if there were an organ that secreted melanin into the blood stream - occasionally this sort of global pigmentation can happen to people with widely metastatic melanoma - depicted.

Diffuse cutaneous melanosis in metastatic melanoma
Hair does not have a blood supply and so would stay white.  Apparently irises are unaffected too so they would stay albino red.
Comment: Noteworthy that underground "radiation" (of unspecified/magical type and origin) is canon from the earliest appearances of drow in D&D, and is what the special properties of their equipment is attributed to.
Comment: @ShadoCat And gave an excuse for it all disintegrating when brought to the surface. (RPG related questions showing up elsewhere has broken the binding circle and loosed me upon the world. ;)
Comment: @SevenSidedDie, yes.  It explained how everyone down there could have +1 or better equipment when magical equipment was so rare on the surface.  Also, who let you out of the RPG forum?
Comment: Black hearted indeed.
Comment: @SevenSidedDie That seems ominous. :-)
Comment: Darn it, Willk.  You beat me to it again and in better detail, I might add.  +1
Answer: The Drow were dark skinned before they migrated to the Underdark.
They migrated a long time ago by human standards - possibly enough time for humans to start speciation (we have only a vague idea how long it takes in humans), but elves reproduce very slowly. An elvish generation can be 40-500 years.
Add to that that their population is very small to begin with - The largest drow city has only 20,000 people. There might not be a million drow in the world.  There is not a lot of opportunity for a mutant, pale skinned drow to be born. When a mutant drow is born, it is often killed at birth. For example, Drizzt was almost killed as a babe for having a different eye color.
Additionally, species tend to be much slower to lose traits with no benefit than they are to gain traits which provide one. For example, in giraffe necks, the nerves for their vocal cords travel down into their chest, around their heart and back up to their voice box. Why? Because it never stopped a giraffe from reproducing.
Intelligent species are even less likely to fail to reproduce due to some vestigial trait. Animals with culture and the ability to pass on knowledge are more likely to adapt their culture or their education than to adapt genetically.
Comment: Some numbers; they were forced underground about 10 000 years ago and have an average lifespan around 750 years.
Answer: From this question/answer, we see that melanin can slightly protect against radiation - but only slightly.
So, if you lived somwhere surrounded by radioactive rocks - such as in underground caves - an extremely high level of melanin (leaving your skin nigh-on completely black rather than a deep brown) might provide just enough protection that you and your progeny do not suffer the DNA damage present in your paler bretheren, granting your descendants an evolutionary advantage.
Answer: The reason for having an advantage from Dark skin is that the pigment melanine blocks UV from the sun light. A possible explanation for drows' dark skin could be a natural source of UV radiation in the underground caves where they live as constant exposure would lead to fair skinned creatures dying of cancer most likely before reaching adulthood.
Answer: Though I couldn't find a real-world equivalent for the things I'm going to list, a few possibilities come to mind:

Symbiotic relationship with a fungus/lichen that protects the Drow skin from excess moisture or cave-dwelling parasites. This would require the fungus/lichen to be darkly pigmented.
Hyperpigmentation caused by a melanin disorder that (somehow) improved their ability to reproduce (the darker skin seems more attractive or allows them to evade predators more easily). Evolutionary pressure would eventually crowd out the non-pigmented Drow.
A mineral or other substance found primarily in a food essentially only the Drow eat. This substance would need to collect in the skin of the Drow to darken it, similar to how bilirubin collects to cause jaundice or how silver can collect in humans.

I hope this helps!
Answer: According to the D&D lore, the Drow once used to populate the (sub)tropical region of Ilythiir, from which they were driven underground by other races:

We know very little of the Ilythiiri, or "Elves of the South," before
  this crucial event[the Descent]. Even then they were known as "Dark Elves" for the
  hue of their skins. They dwelt in the jungles and hot forests of the
  South. A proud, warlike, culturally advanced (some sages of other
  elven people say "decadent") folk, the Ilythiiri attacked all
  neighbors, including other elven tribes. Their cruel raids and
  depredations, ordered by warlike nobility and the clergy of their two
  cruel deities, Ghaunadaur and Lolth, forced elves, humans, dwarves and
  others to ally against them.

Considering the above, their skin color could have been an evolutionary defense against the harmful ultrawizard radiation.
Comment: It should be noted that the "D&D lore" referenced is specific to the Forgotten Realms campaign setting - Drow as creatures in D&D predate that specific setting and the background details are obviously highly variable between settings/worlds.
Comment: @Carcer Good point! IIRC the Drow on Eberron live in the jungle above ground as well though, so it appears to be a recurring theme throughout multiple settings.
Answer: A simple answer would be that elves use something other than melanin to protect themselves from sunlight.  And something other than melanin to make their skin dark.  So extrapolating from humans and other animals similar to humans is a mistake.  In humans, dark skin is caused by melanin, which protects the skin from sunlight.  In elves, dark skin is a natural color, as easily maintainable if not more than white skin.
Perhaps drow are albinos.  It's just that in elves, the equivalent of albinos have dark skin.
Answer: In the forgotten realms (the main D&D universe), drows have for ancestors dark elves, who lived in the surface and had brown skin. However, it's clearly stated that drows have not only brown, but ebony-black skin. Their ancestors also probably didn't have the distinctive white hair of the drows, but black one.
During the Descent, however, divine magic was used by the elves main god to turn them into drows.

Corellon Larethian's magic, channeled through his clerics, turned all
  dark elves into drow. By that point some dark elves modified their
  bodies, and were thus not changed. The entire subrace of dark elves
  was turned into drow, including the survivors from Miyeritar. Elves
  believed it was done as collateral damage due to the elves not
  properly understanding elven high magic.

Source : http://forgottenrealms.wikia.com/wiki/Drow
It's to note that drows, due to their link to their goddess Lolth, and possibly from demonic blood (see Wendonai), are inherently magical creatures, and have many innate magical abilities, as well as a strong resistance to magic.
So as disappointing as it is, at least in this D&D universe, the answer would probably be simply magic / divine curse.
Comment: Because the evolution tag is on this question it makes me think OP is just asking how a race could evolve to have dark skin when dark skin is usually found in tropical, sunny climates. Your answer may be correct but I don't think it's what OP is looking for.
Answer: Periods of Drow history were desperate and violent, with both civil warfare and outside invasion.  Darker skin was selected for because it helps both a predator and prey to hide.


How to increase APFS volume size

Question: I used to have 160 GB macOS APFS container and I upgraded my laptop's SSD with a bigger one and I wanted to increase the size of APFS container to 260 GB. I created an APFS partition and copied old APFS volume to new one with dd command. See the attached picture for the result. APFS container is 260 GB but APFS volumes are still 160 GB. As far as I know only APFS containers can be resized, so how can I match APFS volumes size with the container size (260 GB)?
Comment: When you find a question/answer which solves your problem, then you can [elect to up vote](https://apple.stackexchange.com/help/privileges) the question and/or answer. I believe posting another question followed by a duplicate answer is the wrong approach.
Comment: The OP has already stated in the OP's answer that this is an identical problem with an identical solution. See: [APFS Container Disk & APFS Container Scheme Mismatch - Cannot Resize](https://apple.stackexchange.com/questions/360686/apfs-container-disk-apfs-container-scheme-mismatch-cannot-resize)
Comment: Yes. I added this as answer.
Answer: I found the solution from another post: APFS Container Disk & APFS Container Scheme Mismatch - Cannot Resize
I need to resize the container to smaller to fix the mismatch and then resize with 0 like this:
<code>diskutil apfs resizeContainer disk1s6 200g
diskutil apfs resizeContainer disk1s6 0
</code>

How to increase APFS volume size


Mean and Variance of maximum of random variables

Question: Given a set of random variables $x_1,x_2,...,x_n$, and we know their means and variances $(\mu_1,\sigma_1),(\mu_2,\sigma_2),...,(\mu_n,\sigma_n)$. How to compute mean and variance of the maximum distribution of $x_1,x_2,...,x_n$? We can assume $x_1,x_2,...,x_n$ are gaussian distributions.
Comment: Do you just want an answer and don't care about having an elegant solution? Then do it by stochastic (Monte Carlo) simulation. You can incorporate whatever dependencies or distributions you want.
Comment: @TobiasFritz -- those references are for the case of identically distributed Gaussian variables; the OP asks for the non-identical case, which seems quite a bit more complicated.
Comment: Maybe this is helpful: https://ocw.mit.edu/courses/civil-and-environmental-engineering/1-151-probability-and-statistics-in-engineering-spring-2005/lecture-notes/app11_max.pdf
Comment: See https://stats.stackexchange.com/questions/18433/how-do-you-calculate-the-probability-density-function-of-the-maximum-of-a-sample and references therein, such as [Wikipedia](https://en.wikipedia.org/wiki/Order_statistic). Also again [stats.SE](https://stats.stackexchange.com/questions/9001/approximate-order-statistics-for-normal-random-variables) for the Gaussian case.
Comment: @CarloBeenakker: right, I wasn't paying proper attention. Thanks.
Answer: For independently distributed $x_i$'s, each with cumulative distribution $$F_i(x_i)=\tfrac{1}{2}+\tfrac{1}{2}\operatorname{Erf}\,[(x_i-\mu_i)/(\sigma_i\sqrt 2],$$ the cumulative distribution of the maximum is given by $$P(\max_i \,x_i<X_{\max})=\prod_{i=1}^n P(x_i<X_{\max})=\prod_{i=1}^n F_i(X_{\max}).$$
For small $n$ you can now calculate moments of $X_{\rm max}$ by integration,
$$E(X_{\max}^p)=\int_{-\infty}^\infty x^p\frac{d}{dx}\left(\prod_{i=1}^n F_i(x)\right)\,dx.$$
There is unlikely to be a closed-form answer for arbitrary $n$, in fact, even the $n=2$ integral seems problematic (Mathematica fails to evaluate it). If you take the $\mu_i$'s and $\sigma_i$'s to be the same, then progress can be made, for $n=2$ I find
$$E(X_{\max})=\mu+\sigma/\sqrt\pi,\;\operatorname{Var}(X_{\max})=(1-1/\pi) \sigma^2.$$
Perhaps you are satisfied with a large-$n$ approximation. For identical $\mu_i$'s and $\sigma_i$'s it is given by the Fisher–Tippett–Gnedenko theorem, see for example  this MSE posting. I have found one paper that generalizes this to arbitrary $\mu_i$'s and $\sigma_i$'s: On the distribution of the maximum of n independent normal random variables: iid and inid cases, but I have difficulty parsing their result (a rescaled Gumbel distribution).
There is more in that reference that I do not understand. They give the inequality
$$\frac{1}{n}\sum_i\mu_i\leq E(X_{\rm max})\leq \frac{1}{n}\sum_i\mu_i+\frac{n-1}{n} \max_i\,\mu_i$$
which contradicts the $n=2$ result given above.
Comment: I changed several instances of {\rm max} to \max. That affects spacing: with the latter the amount of space to the right and left depends on the context without any manual adjustments, and you formerly saw ${\rm max}_i$ rather than $\displaystyle\max_i$ near the bottom line.


How do I delete a directory from a zip file using a bash script?

Question: How do I delete a directory from a zip file using a bash script?
Answer: From man zip:
      zip -d foo foo/tom/junk foo/harry/\* \*.o

will  remove  the  entry  foo/tom/junk,  all  of  the  files  that  start  with
foo/harry/,  and  all  of  the files that end with .o (in any path).

If that doesn't help, can you provide some details about the commands you've tried and the output?
Answer: If you want to delete all files from a specific dir, you could do this:
zip --delete file.zip "assets/*"

Answer: Maybe it could be done with a script, but in command line if you want to delete a directory from the zip file, make sure the directory is empty. If the directory is not empty, then first delete all the files from the directory. Then you can able to delete the directory.
Comment: Can you give command lines? Please [edit](https://askubuntu.com/posts/1190847/edit) your answer


Is that IGBT will failure if apply Vce with out gate pulse, and driver supply

Question: I gave 100v dc in the Igbt with out gate supply, The IGBT gate section went failure. Please tell me whether the method  I tested will create problem.
Comment: What is the specification of the IGBT, link to a data sheet would be the best thing to do. What does 'with out gate supply' mean? Open circuit, 0v, other? How do you know the gate section has failed, rather than some other part? Tell us what measurements you have made, and what it does do, guessing at what's wrong doesn't help.
Comment: Actually the rating of my IPM module is 1200V. There is a separate  connector for driver and PWM logic. I planed to give DC supply first and then to give gate driver voltage and pwm. so I didnt switched on the driver supply and pwm. i applied the 100V dc. suddenly the DC voltage drops to 16V. I removed the IPM and then I checked the DC sourec its fine. Than I tested the ipms gate connection. It shows sorted.
Answer: If you left the gate open and applied 100VDC of the correct polarity the IGBT can and will fail even though nobody makes IGBTs with drain source ratings so low .                           This can be because the high impedence           gate can have a static charge on it .If the static voltage isnt enough to destroy the gate oxide layer its often enough to turn the device half on .This could result in extremely high power dissipation destroying the device .IGBTs arnt happy in analog mode and generally are not specified for linear operation.Place a 1K resister between gate and source to avoid blowing up the next device .Nondestructive testing .
Comment: thank you Reply Autistic.. I have connected the driver circuit, but didn't gave supply for the drivers.


Are black filaments more brittle?

Question: I've been 3D printing for a while and I've noticed that, when printing small parts, my colored plastics (PLA, PLA+ and ABS) have better layer adhesion than black ones.
Did you notice this?
What could be the cause?
Comment: is that about several manufacturers or are you only testing one?
Comment: Several, mostly chinese manufacturers. My theory is that black filaments specially PLA ones have most scrap materials in it.
I've printed the same piece in all materials that I have and colored prints are almost indistructible while black ones are fragile and delaminate easily.
Comment: Would you be able to quatify your findings for example with a tension test of some sort?
Comment: No, I did not test. I just tried to twist pieces until the broke, I couldn't break colored prints while I could easily break black ones.
Comment: what is your sample size on the test? I mean, how many different filament batches did you do this test on?
Comment: The print is the middle one here: https://www.tinkercad.com/things/glwhcfspvjz (watch in 3D). Obviously I used supports to print it. I have tested about 3 colors (black included) for each print, same material.
Comment: sample size = how many prints per sample color & Shape.
Comment: Around 3-5 prints for each spool. Black ones consistently destroied when tension was applied. Can you suggest me a great spool (1/1.2Kg) of filament from a brand you trust?
Comment: Have you tried to dial in the settings for each filament color/manufacturer separately? You might have got just bad settings. Try to play with temperature a little!
Comment: Sure, I've tried dialing settings. I have tried dialing both temperatures and flow. All prints are looking good in the end... PLA+ have the greatest finish but it's the most fragile of all. For PLA filaments I've tried flows from 90% up to 110% (in steps of 5%) and temperatures from 190° up to 220° (in steps of 10°). For ABS I've a full enclosure and a plate at 110° I've tried flows from 100% up to 110% and temperaturs from 240° to 250°. After all I've had great looking prints for all materials despite black ones were all brittle.
Comment: To be honest  I have had great black prints, as I had bad white ones. It is often either the settings being messed up, but you just might have grabbed a bad batch of black filaments. I suggest to look at filament reviews, for example Thomas Sanladerer's Filaween series or CNC Kitchen's filament reviews, to check for a different supplier.
Answer: Not inherently.
There are two things at work that might cause one color to test weaker than others even as its properties otherwise are functionally identical:

A bad print among good ones.
A bad roll among good ones.

Let's take a look at both, then do a little excursus into plastics and color.
A bad print
There are probably thousands of reasons a print might fail, but bad layer bonding and squish-ability under torsion strongly hint to under extrusion. Now, under extrusion itself can be caused by a plethora of reasons: a clogged nozzle is equally as possible as too thinner diameter as is just a bad temperature. The last one is, in my opinion, the most likely culprit: filaments may look the same and feel the same and bond the same, but in different colors, they sometimes demand different print settings.
As an example, I print most of my Kaisertech PLAs at 200°C, as that offers a quite good result for all of them. Yet when I started I had a white China PLA and a crystal clear PLA from the same manufacturer, both came from the same warehouse in the same shipment. The clear one is quite more brittle on the roll, but their starting-to-print temperature differs by 5°C - the white started to extrude at 180°C decently and printed ok at 195°C-200°C, while the clear needed only 175°C to start to be extrudeable and was really printable at 190°C. Yet recently I tried the same roll again to achieve fully clear prints, and with 210°C and lots of overextrusion, I managed to go almost solid-clear. Because of such experience, I suggest tweaking the settings.
A Bad Filament
There are several reasons why one roll might resulting in bad prints, but the most prominent are that the roll has gone bad over bad storage. It might be stored too hot or too humid, making it brittle or bubble in the hotend. Aging under UV plays a role (it degrades PLA). And dimensional accuracy plays a role because it affects the whole roll of filament. This is why tests should always be performed with equally treated and measured samples to achieve comparability.
Excursus: Plastics and color
What gives a plastic its color? Pigments added to it. Now, pigments can be of varied kinds. Usually, they are embedded in the plastic (=not bonded to the carrier plastic), and the plastic polymer is often either inherently transparent(ish) or white. Let's take some examples to look at...

Yellow. Yellow can be made from a lot of stuff but many yellow pigments react to UV light by decay more than other colors, leading to yellow to fade quickly in comparison to other colors. It has varied chemical compositions, often they can become quite complex.
Black. Black pigment is typically the most simplistic coloration to achieve: pure powdered carbon is one of our most potent black pigments, and also one of the cheapest, making black plastic one of the most common plastics. In contrast to other colors, carbon can't fade. But the plastic around it decomposes and turns white, fading the color this way.

Now, most colorings are - in physical terms - sizeable. Some few to a couple dozen atoms, making them range in the Angström (~Atom diameter) to few nanometer area overall. However, even something as complex as $C_{22}H_{20}O_{13}$ (Carmine) is relatively small compared to the $(C_3H_4O_2)_n$ of PolyLacticAcid, aka PLA. Poly tells us that n is at least 100, because shorter chains are oligomers, not polymers. In comparison, our red carmine pigment is more dense, much more compact in fact. As a result, a 100-chain of PLA is not just in the Angstöm area but in the dozen nanometer to micrometer range - a magnitude of at least 2 larger. Unless we have a huge excess of pigment or a pigment that reacts with the plastic under heat, then the impact of it on the strength should be neglectible to the other fillers often used.
Answer: Your heading is about how brittle the material is, but the question is asking about layer adhesion. I'll go ahead and tackle the layer adhesion portion. There are many variables at play here but unless you are using two filaments fresh out of the box, I would guess moisture might be the issue.
Moisture
The filaments pick up moisture as they are left out or even just store. I've tried to prevent it, but nothing seems to work. When this happens you generally need to run the same filament a bit hotter to get the same results as a new roll. Comparing a new roll to an old roll, or even two rolls of questionable quality, will result in slight changes.
Bad Quality
Filament quality goes a long ways to making sure the print comes out consistently. Dimensional sizing is the main one the gets thrown around, but once again, moisture may creep in if the manufacturer is questionable. I use Hatchbox mainly and have not had an issue on either of these fronts. Poor dimensional quality will cause either under or over extrusion which can make the layers appear worse and is impossible to fix without buying a new roll as the filament itself is the issue.
Color
Can color make a difference? Perhaps. I've wondered if black heats up quicker than white filament. I have gone through quite a bit of white and black PLA from the same manufacturer and so far have notice no major difference between the two.
Brittleness and Layer Adhesion
I don't see how these two would have much to do with each other. There are too many variables between the heating and the cooling of the material for brittleness to have a major effect. For example, PLA is brittle but prints well. TPU is very flexible and prints well - it all depends on what your setup is.
Answer: I have some experience in the textile industry and it is known that items, whether piece goods or yarn, which are black (for most fibers) it is likely an over-dye; colors that failed to match the color that was intended, goes into a pile for black re-dye.  It is easy for most fibers to over-dye something black.  I imagine that for filaments it is something similar.  My experience with black filaments is generally one where black breaks easier, and generally you can find PLA on sale if it is black.
Comment: Welcome, Jim. I'm not sure the process is analogous, since the filament would have to be melted down to be re-colorized. Please take the [tour](https://3dprinting.stackexchange.com/tour) and thanks for joining.
Comment: I was speaking in general terms, that black is a re-process of other, generally failed, colors.  I agree with you that it would likely be re-melted, and I guess that is my point; black is a re-melting and re-dyeing result and - probably because of this - is somehow inferior in strength.  I imagine the re-melting is the cause. Jim
Comment: Yeah, re-dye can be done. And I think you are on spot with your answer. I've printed Km and Km of filaments as of today and the fact that black filaments are more brittle, indipendently of the brand, is a costant to me.

Are black filaments more brittle?


What is the definition of a property?

Question: What is the definition of a property? Like, for example, "that apple has the property of being red". I know that properties aren't the same thing as sets. But what are they, exactly?
Comment: Basic properties (and relations), like red, only have operational "definitions", that is procedures for determining if something has them (spectral frequency can be used for red). Composite properties can be defined in terms of basic properties and relations using logical connectives and quantifiers, e.g. red-or-green.
Answer: A very controversial issue in modern philosophy, as both your likening them to sets (or maybe Quinean classes) and @Conifold's arguably cryptic [though correct] comment.  Though I am way out of my depth here, you may wish to peruse the following article, which will give you a fair working definition of what, traditionally, as elucidated by moderns, a primary property, or attribute [of an object] "is", as opposed to it's secondary "qualities":  https://www.academia.edu/6652802/The_distinction_between_Primary_Properties_and_Secondary_Qualities_in_Galileo_Galileis_Natural_Philosophy.
Here you will find the following:

[i]n this passage, Galileo in fact introduces a new definition of a
body. A body in itself is a piece of matter with only primary
properties.  About twenty years later, Descartes would write in his
Principia (1644) that a body is essentially an extended thing, a res
extensa. So, a body is for the French philosopher a way or a mode of
being extended. For Galileo, a body is not limited to this one unique
property, but also includes several primary properties, such as size,
motion, and shape [also number, location, and touching or not-touching another body]. A body is thus for Galileo, in 1623, a mode or a
way of being a whole cluster of primary properties.
This new doctrine of properties-qualities is one of the elements of
Galileo's natural philosophy that make our common -sense pictures of
objects in particular, and nature as a whole, illusory. Galileo argued
that  contrary to our intuition  the sun does not move around the
earth. He also argued in his new theory of motion, which he developed
in the second part of his  Dialogo (1632),  that we don't need a force
to maintain the motion of a heavy body in a horizontal plane. On the
contrary, we need an external force to stop such motion. And,
importantly for this discussion, bodies in particular and corporeal
substance in general do not have any sensible qualities such as odors,
sounds or colors. On the contrary, our imagination ("imaginazione")
simply attributes these qualities to external bodies, so that they can
be stripped off again by means of our imagination (see Galilei,
1890-1909: VI, 348). Primary properties, by way of contrast, cannot be
stripped off. For example, a ball would not be the same body if we
stripped off its spherical form. Galileo would argue that it can be
geometrically demonstrated with certainty that the ball is spherical
and not triangular or cubic.

As well as the following quote taken from Edwin A. Burtt's The Metaphysical Foundations of Modern Physical Science. A Historical and Critical Essay:

This form of the primary secondary distinction in Galileo is worth a
moment's pause, for its effects in modern thought have been of
incalculable importance. It is a fundamental step toward that
banishing of man from the great world of nature and his treatment as
an effect of what happens in the latter, which has been a pretty
constant feature of the philosophy of modern science, a procedure
enormously simplifying the field of science, but bringing in its train
the big metaphysical and especially epistemological problems of modern
philosophy.

Please do not ask me to elaborate this answer further.  For I can not.  And fear that I would be forced, embarrassingly,  to refer you to David Hume or John Locke; before Kant irredeemably muddled the waters.

What is the definition of a property?


Where is the application of Calculus (of continuous quantities) in Computer Science or programming

Question: I am a Software Engineer professional. I have studied calculus as a core course in my graduation studies. I want to ask question, that what/where is the implementation of calculus in computer science?
Comment: its mostly useful for physical things so mainly where something physical is involved in the problem domain
Comment: @jk. What you mean by "physical things"? Do you mean something tangible? Then what about Time? Time is abstract. We can always differentiate and integrate it. And same goes for other physical quantitiies which are continous in nature. Please explain.
Comment: as in any physical data that is externally measured so time can be externally measured, voltages and currents can be externally measured using physical devices
Comment: This is where analog devices comes into play. Continous physical quantities are measured using analog devices and digital devices like for example speedometer and odometer. So when a continous quanitity is translated into discrete then is that the occasion when we differentiate or integrate them?
Comment: What is "Calculus of Continious Quantities"?
Comment: @EmmadKareem This what i meant: http://en.wikipedia.org/wiki/Infinitesimal_calculus. Correct me if i am wrong.
Comment: @Maxood, thanks for the clarification, I am not a mathematician, but I see no relationship between "Continuous Quantities" and Infinitesimal calculus. If you agree with me, maybe you want to change the title.
Comment: @EmmadKareem calculus is always continuous (not discrete). Infinite discrete sums can be solve with their continuous counter-parts. This is what calculus is used for in complexity calculations - solving infinite discrete sums. See my answer for references.
Comment: @DannyVarod, Thanks for your comment, but We can't say that "Calculus is always continuous". Continuity in Calculus is a property of a special type of relation called 'function'. Some functions are continuous over all points or some points of their domain.
Comment: @EmmadKareem true, however, calculus is over a continuous domain e.g. R or C and not over a discrete one e.g. N or Z. - I was referring to the domain and not to the functions.
Comment: @Danny Varod - The term "discrete calculus" is definitely in use. I always thought some discrete summation systems were considered discrete calculus, but I'm not sure. However, there's topics such as "derivatives of regular expressions" where calculus is used as a kind of analogy, or perhaps in an abstract algebra sense, so "discrete calculus" may not really mean "discrete calculus" IYSWIM.
Answer: Calculus can be used to solve recursion complexity calculations.
(The recursion's complexity can be expressed with infinite discrete sums which can be solved with their continuous counter-parts.) [ 1 ][ 2 ]
Also both calculus and other forms of maths are used in various applied computer science.
E.g. Physics Engines, Signal & Image Processing, Computer Vision, Information Theory.
Answer: It depends. Are you going to just be told what to program, or are you going to know much about the content area?
I've worked for years in graphics UIs and mathematical modeling, specifically pharmacometrics and biostatistics.
I need to understand ordinary differential equations, frequentist and bayesian statistics, pharmacological modeling, and optimization algorithms.
Every so often I need to solve calculus problems that nobody has figured out before, or if they did, they didn't publish it, or if they published it, they only did easy cases.
I have to handle the hard cases as well.
All this is in a field where mistakes can be very costly, so it's important to be able to make air-tight justifications.
Programming is fine, but it's only part of the story.
Answer: Computer science usually deals with finite things. However there are cases where you use real functions and apply analytic methods, sometimes including infinitesimal calculus.
One is when you need to express relations for problems of arbitrary size and granularity. This often happens in information theory e.g. in Shannon capacity or information entropy. Another sometimes occurs when calculating upper or lower bounds. Many quantities in graph theory are complex sums, that cannot be directly calculated, but can be limited by real functions or integrals. And even basic stuff like asymptotic behaviour is defined in terms of limits, so you need at least the basic concepts.
As practitioner, you probably won't need to do those calculations, but understanding the concepts makes it easier to reason about choice of algorithms and practical limits you are to encounter, especially when you get to something that involves correction codes, compression or just some complex graph algorithm. Or statistics, which also uses analysis a lot.
Also it's difficult to teach just part of mathematics without ever touching infinitesimal calculus, which includes the mathematics mainly used in computer science (graph theory, linear programming, optimization etc.)
Answer: For this topic, I highly recommend the following book: Concrete Mathematics by Ronald L. Graham, Donald E. Knuth, and Oren Patashnik.    It is about CONtinuous and disCRETE mathematics, and how they are applied in computer science.  Topics include stuff like sums, recurrences, binomial coefficients, number theory, discrete probability, among others.  I reference my copy all the time.
Answer: There are a few areas where calculus is needed, more specifically differential equations.
Every car company has to test its models to see how it behaves in crash situations. They do this by placing a multitude of sensors all over the car and crashing it. The information received from those sensors needs to be interpreted and analyzed.
If you ever write software that does this, then you'll be dealing a lot with differential equations. The angles at which each part of the car is bent from the crash are passed through these equations to get the values of the forces involved. The deceleration values must also be computed using such equations. I don't know too much about this, though...
This is only one of the applications of calculus in computer programming. Maybe someone knows other scenarios.

Programmers have always complained that various areas of mathematics don't ever apply in their work (and therefore there's no reason to learn it). This is mostly true, but sometimes you do need to know such concepts to get the job done. For example, vector spaces knowledge (from linear algebra) can be of tremendous help when making 3D rendering engines (for games, for example).
Comment: What you've described is an application of physics (and, by extension, calculus) in automotive engineering.  People involve computers because it's faster than processing the data by hand.  The act of designing and writing a program to carry out the steps doesn't really require an understanding of the math if the steps are well-defined.
Comment: @Blrfl I would with SoboLAN as the area of Physics where this kind of Calculus is used, typically called Mechanics is very much involved in writing the functions or methods to work correctly. But again the answer is a scenario based application and does not address as to where we need Calculus(differentiation and integration of physical quantities) in Computer Science or programming in general.
Comment: @Maxood: That's the thing. Programming in general is only useful to the extent that it is *in specific*. It's like writing or journalism. It has its own rules, but without the content it's empty. I'm afraid programmers often see their function too narrowly.
Comment: @MikeDunlavey:  Sure, but the rules of journalism are still a domain unto themselves and don't have to be tied to anything else in particular to be useful.  Making the argument that higher math is somehow essential to being a good programmer is tantamount to arguing than an in-depth knowledge of foreign policy is essential to a journalist covering NASCAR.
Comment: @Blrfl: I think we're in violent agreement :-)
Answer: I used a lot of calculus for creating continuous interpolations.
For example, I use this in fractal animation software, where smooth transitions are desired.
Furthermore, everything that has to do with continuous motion, like a game with a bouncing ball, etc. or acceleration sort of becomes easier with calculus.
Thirdly, a lot of the stuff mentioned above can be simplified/optimized if one has a basic understanding of trigonometric functions.
Answer: Calculus is useful for looking at changes in physical quantities so is mainly useful in the physical sciences. Programming mostly only deals with calculus when the problem domain requires it.
But of course there is also the meta-problem of algorithms for good numerical approximations of integrals or differential equations e.g. http://en.wikipedia.org/wiki/Numerical_integration and http://en.wikipedia.org/wiki/Runge%E2%80%93Kutta_methods
which are certainly computer science orientated.
I've not used calculus in programming since university (which was to implement integration by simpson's rule in FORTRAN)
Answer: Computer Science and Calculus have nothing to do with each other, besides the somewhat incorrect assumption by academics that practicing programmers will require higher math.  I say "somewhat incorrect", because whether you will or won't will depend entirely on what your "problem domain" will be.  If you're writing "business logic", like many programmers, you'll probably never use any math higher than basic arithmetic.  If you're writing molecular-modeling, like a physical- or chemical-scientist, you'll use it every day.
I have to say that in over 30 years of programming for a living, writing operating system, systems management, web server, and other complex programs, I've only ever needed higher math once, and only because I didn't know where to find the already-published algorithm that required only arithmetic.
Comment: Your talking about programming. OP was asking about computer science
Comment: @Maxood: Despite not using the proper term, I think the question is sufficiently clear on meaning infinitesimal calculus/mathematical analysis.
Comment: Depending on your problem domain, you might never need SQL in your whole programming career (think e.g. embedded systems, computer games) or OOP (think numerical computing, or Erlang-style high-availability applications). But that doesn't mean that OOP and SQL have "nothing to do with programming", right?
Comment: i agree with you. But this also depends what branch of Calculus you are talking about. If you talk about Labda Calculus then it does have application in computation and recusrive functions. FYI:http://en.wikipedia.org/wiki/Lambda_calculus
Comment: OP described himself as a "Software Engineer professional", which I read to mean a practitioner.  Perhaps I misread.
Comment: -1: Yes, there are a lot of programmers who never use calculus.  But very few C.S. graduates are able to apply any of the theory they were taught.  C.S. is a branch of mathematics, and calculus is a powerful tool in any sort of numerical reasoning.
Comment: @Tom the title of the question says "in computer science or programming"
Answer: A developer needs calculus to the extent it is important to the problem domain.  The developers of Twitter don't need any calculus. Developers at Boeing or Airbus need a good understanding of calculus.
Answer: I work in the Aerospace industry on spacecraft (mostly satellites) modeling and simulation software.  Most recently, I was was responsible for developing a simulation model for a satellite's attitude determination and control system.
Yes, I had to use a lot of math, mostly linear algebra and calculus.  While many of the physics calculations my software had to perform were well known, and the scientists and systems folks basically handed me documentation (or sometimes, their matlab scripts) for most of them, being able to convert math formulas into code is easier if you understand what the formulas are doing :)
Also, tracking down bugs and finding the occasional error in the equations I was handed would have been nigh on impossible if I had absolutely no math background.
Answer: I'm brushing up on my calculus because of the problems I've been encountering in the field in which I wish to become expert in: ANN's - artificial neural nets, and signal processing, which are a mixture of programming and physical systems, the physical being the relationship between the neurons, and what kind of neurons you wish to develop and what kind of network you wish to build, what you want it to do. Calculus is not handy for ANN's - it's essential.
So I suppose to answer when do you need higher math for programming I imagine the answer depends upon what problems you wish to tackle in real life. Also I imagine game programmers modelling real life would need higher math as well.


Clarinet Ligature on Alto Sax?

Question: I bought a semi expensive ligature for my clarinet, and I would like to know if it is a good idea to use it on an Alto Sax. I've tried using a cheap one on my alto sax, and it seemed to work alright (they're not that different in size). I hope I can use my good ligature on my alto sax because it makes quite a difference on my clarinet. Is this in any way bad for the instruments? If it isn't, is it worth it getting an Alto Sax ligature?
Comment: If the ligature fits it should be ok for the instrument.
Comment: Are you asking about metal ligatures or leather/synthetic ones?
Comment: @tim Leather/synthetic. Although the cheap one I tried was metal.
Answer: I am surprised that the clarinet ligature fits on the alto saxophone mouthpiece (I play both.) What do you mean by "fit"? The ligature should fit snugly on the mouthpiece under the "u" part of the reed. It should secure the reed just where the reed and mouthpiece naturally meet. If the ligature is too high, the reed will not vibrate properly.
Comment: @Erik, then it should be fine.
Comment: It is well beneath the u and the line.
Comment: Is it in amy way damaging to the ligature?
Comment: @Erik, if it is tightening properly, I don't think so. However, I have heard that the leather ligatures do change over time. (I never had one long enough to notice.) I currently have a Vandoren metal ligature with the interchangeable plates, which I love.

Clarinet Ligature on Alto Sax?


Unable to set cart currency in index.php

Question: Craft: 2.6.2976
Commerce: 1.2.1341
I want to force currency depending on language (en_us and no). The user should not be allowed to choose.
I've added two currencies 1) EUR - base, 2) NOK.
Putting define('COMMERCE_PAYMENT_CURRENCY', 'EUR'); in the index.php for the english site, and define('COMMERCE_PAYMENT_CURRENCY', 'NOK');in the index.php file for the norwegian site does not work.
The currency is always EUR.
To be clear: Using {{constant('COMMERCE_PAYMENT_CURRENCY')}} does output the correct currency as set in index.php, however the cart is what always remains in EUR (base).
Is this a bug in Commerce?
Answer: How do you render the cart?
Using {{ item.price|commerceCurrency(cart.paymentCurrency,convert=true) }} instead of {{ item.price|commerceCurrency(cart.currency) }} works for me.
Answer: Just tried setting define('COMMERCE_PAYMENT_CURRENCY', 'EUR') in the index.php file and it works fine.
You just need to use
{{ cart.paymentCurrency }}
Not
{{ cart.currency }}