Can We give any value to anything in truth?

Question: Isn't everything in this world equal in value? Can we say that the value of a human being is greater than the dust?
Answer: Your question reminded me of this Zen koan

Dead Cat Treasure
There once was someone who asked Ch'an master Ts'ao Shan, "What is the most expensive thing in the world?"
"The head of a dead cat," was the answer.
"Why?"
"Because nobody gives it a price."
Commentary: By using the image of a dead can, Ts'ao Shan tried the destor the common virtues of the ordinary mind. On the other hand, [etc.]

That might be memorable or striking -- but I didn't find it easy to understand when I first read it.
There appears to be some explanation of it here (but beware that people say that explaining a koan will spoil its effect on the reader). This explanation seems to criticise the master:

In his book Pointing at the Moon , Alexander Holstein offers an explanation to the  above mentioned answer of Zen master, as being his attempt to teach his disciple to "destroy the common values of ordinary mind".
As it is evident in this teaching, the answer to "what is valuable?" - was answered here  based on "what is not valuable" in the ordinary view of people. Zen master of this koan does not know how to answer a question on what is valuable in Buddhism, and takes what is regarded as not-valuable (in the mind of common people) as a reference to say something.
Additionally, the master's aim to "destroy the values of ordinary mind"  - is non-Buddhist in essence. Nichiren teaches, that the ordinary mind of ordinary people (of the Nine Worlds) contains within it the Buddha mind (Buddhahood) as well.

I think that's saying that to ask "What is expensive?" or "What is valuable?" is ordinary and unenlightened thinking -- i.e. what I might think of as, "the wrong question to be asking".

There is incidentally a proverb or idiom in English (not Buddhist), "The best things in life are free."
What Does The Best Things in Life Are Free Mean?

Someone might say, "The best things in life are free" to celebrate something that he enjoys that has no monetary value [...] for example, after spending a day on a hike through nature
Someone can also use this phrase as a warning, [to] indicates that a person is forgetting about the things that truly matter in life.
The phrase the best things in life are free expresses that happiness comes from places other than money and objects.

I think that may normally be non-Buddhist if it involves delighting in and attaching to experiences, but even so.

I'm not sure whether this is inline with Oyamist's answer, but here's another Zen story:

Inch Time Foot Gem
A lord asked Takuan, a Zen Teacher, to suggest how he might pass the time. He felt his days very long attending his office and sitting stiffly to receive the homage of others.
Takuan wrote eight Chinese characters and gave them to the man:
Not twice this day
Inch time foot gem.
This day will not come again.
Each minute is worth a priceless gem.

The suttas tend to talk about what's "praiseworthy" rather than about what's valuable -- virtues like harmlessness, generosity, ethics, good will, discernment, right speech, wisdom.
Perhaps we should also consider as "valuable" that which is "instrumental" -- for example, a hammer is valuable (a useful or essential instrument), when you want to hit a nail.
Similarly the noble eightfold path is valuable; the Three Jewels (Buddha, Dhamma, and Sangha); or see for example AN 11.1.
Answer: The first question a native spirit once asked the Buddha:

SN10.12:2.1: "What's a person's best wealth?

His answer was:

SN10.12:3.1: "Faith here is a person's best wealth.

To the second question, the Buddha once compared the chance of the gift of human life to the fate of a turtle in a vast ocean attempting to find and poke its head through a yoke with a hole throw into the ocean:

SN56.47:2.1: "That one-eyed turtle would poke its neck through the hole in that yoke sooner than a fool who has fallen to the underworld would be reborn as a human being, I say.

To the original question about value and truth, the Buddha also told that native spirit:

SN10.12:10.3: See whether anything better is found than truth, self-control, generosity, and patience."

Human life is a rare gift. Let us use that gift well to end suffering for ourselves and others.
Answer: According to the Bhikkhu Patimokkha (quoted below), which are rules for monks, killing a human is grounds for immediate and irreversible dismissal from the monastic order (parajika).
However, deliberately killing an animal is an offense that requires only confession (pacittiya) within the monastic order, usually with the intention not to do it again. It's not as severe as killing a human.

Intentionally bringing about the death of a human being, even if it is
  still a fetus — whether by killing the person, arranging for an
  assassin to kill the person, inciting the person to die, or describing
  the advantages of death — is a pārājika offense. (Pr 3)
Pouring water that one knows to contain living beings — or having it
  poured — on grass or clay is a pācittiya offense. Pouring anything
  that would kill the beings into such water — or having it poured — is
  also a pācittiya offense. (Pc 20)
Deliberately killing an animal — or having it killed — is a pācittiya
  offense. (Pc 61)
Using water, or getting others to use it, knowing that it contains
  living beings that will die from that use, is a pācittiya offense. (Pc
  62)

According to AN 6.87, there is actually a list of people a person could kill or injure, and such a person will never be able to have the right mental state or moral capacity to learn the Dhamma:

"Endowed with these six qualities, a person is incapable of alighting
  on the lawfulness, the rightness of skillful mental qualities even
  when listening to the true Dhamma. Which six?
"He has killed his mother; he has killed his father; he has killed an
  arahant; he has, with corrupt intent, caused the blood of a Tathagata
  to flow; he has caused a split in the Sangha; or he is a person of
  dull discernment, slow & dull-witted.
"Endowed with these six qualities, a person is capable of alighting on
  the lawfulness, the rightness of skillful mental qualities even while
  listening to the true Dhamma. Which six?
"He has not killed his mother; he has not killed his father; he has
  not killed an arahant; he has not, with corrupt intent, caused the
  blood of a Tathagata to flow; he has not caused a split in the Sangha;
  and he is a discerning person, not slow or dull-witted.

According to MN 86, Angulimala killed many human beings, but he could still change and become an arahant. So, probably, he did not commit the transgressions above (killing father, killing mother, killing arahant, injuring Buddha)
So this shows the value of humans above animals, and the value of the Buddha, the arahant and one's parents above all other humans.
How about a different perspective?
From Iti 100:

"There are these two kinds of gifts: a gift of material things & a
  gift of the Dhamma. Of the two, this is supreme: a gift of the Dhamma.
"There are these two kinds of sharing: sharing of material things &
  sharing of the Dhamma. Of the two, this is supreme: sharing of the
  Dhamma.
"There are these two kinds of assistance: assistance with material
  things & assistance with the Dhamma. Of the two, this is supreme: help
  with the Dhamma.
"There are these two kinds of mass-donations: a mass-donation of
  material things & a mass-donation of the Dhamma. Of the two, this is
  supreme: a mass-donation of the Dhamma."

This shows the value of certain kinds of gifts, sharing, assistance and mass-donations over others.
So, the Buddha certainly gave certain things more value than other things.
Answer: I once asked a Tibetan Buddhist nun whether anything mattered. She said "well ultimately no. The question is, does it matter to you?"
Value is a subjective experience, so asking whether something has value is a bit like asking us "what do I want for breakfast?"


Picasa 3.9 login fails with 2-factor authentication

Question: I've installed Picasa 3.9 via the instructions at webupd8, however the login window keeps failing with the message, "You must be connected to the Internet to use this feature." If "Try again" is tried I'll successfully pass the first login screen of username and password. Next I'm prompted for the verification code which then takes me back to the "You must be connected to the Internet to use this feature" screen again.
Answer: Only solutions that works for me is downgrade to Picasa 3.8
See more info in answer to other question
Answer: I wonder if you'll be better off creating an application-specific password, which you can do from within the account settings section of your Google profile.
Comment: Application-specific passwords are disallowed in Picasa 3.9
Answer: install iexplorer first:
winetricks ie7
reboot.
you can login to picasa web albums and post photos to Google Plus.
Answer: I tried a number of different tutorials trying to get Picasa 3.9 running under Wine on 12.04 64-bit. They all left me with a broken login screen, even after installing IE6 using Winetricks.
After reading the above comment referencing IE7, I ran winetricks ie7, opened IEe7 and tested logging into picasaweb.google.com.  Though somewhat buggy, I authenticated properly.  Sure enough, Picasa 3 allowed me to authenticate as well, though when checking "trust this computer", a pop-up displayed (also blank, like the previously broken login window when using IE6).
After dismissing the popup and closing the "Processing" window I was able to hit the "Share" button and was presented with a somewhat familiar Google+ share dialogue.
Thanks to Tomasz for leading me in the right direction.


Which function to hash 128 bit API key with?

Question: I'm generating 128 bit API keys. AFAIK 128 is totally secure for generated key. In the DB I want to store hashes, not the plain text (to be protected against DB leak), but what hashing algorithm should I use? MD5 and SHA-1 are not considered secure. SHA-256 produces bigger output than the key itself so it seems like it doesn't make sense to use a 128 bit key with SHA-256.
Answer:
but what hashing key should i use? md5 or sha1 are not considered
  secure. sha256 produces bigger output than the key itself so it seems
  like it doesn't make sense to use 128bit key with sha256

It's okay for the output hash to be longer than the input being protected. Sha1 and Md5 are both deprecated for certain applications, so probably best to avoid those options.
Since you are hashing 128 bit keys you may be fine just using one round of sha256. This is based on the understanding that you are hashing random 128-bit api keys and not passwords. The advice for hashing passwords will be very different.
Comment: Everything between the first paragraph and the last two sentences is somewhere between misleading and just bad advice. For a securely-generated 128-bit random key, you *should not* use multiple rounds of hashing or anything like bcrypt; the entropy of the input is so high that brute-forcing it is already impossible (practically speaking). Adding cost is pure negative. In fact, from a security perspective, SHA1 would probably be OK if it weren't for the fact that it'll cause any competent static analysis tool to yell at you.
Comment: Small pedantic correction: PBKDF2 is doing multiple rounds of a hashing algorithm like SHA256...  bcrypt is similar, but it uses the blowfish cypher, rather than hashing algorithms.  (Such details only matter if you're trying to pick which key stretching algorithm to use, though, and in OP's case, doesn't matter at all since they don't need to stretch their keys to resist offline cracking.)
Comment: i need it to be fast as the overhead of an api key should be minimal
Comment: I see. Actually, I just updated my answer. Since your input is 128 bit keys rather than passwords the threat of offline cracking is not as likely. You're hashing it server side tho?
Comment: You don't need a KDF if the key is a "generated key" and not a password... @CBHacking is correct.
Comment: Agree. Updated.
Answer: In theory, it should be safe to use MD5 here since it is only vulnerable to collision attacks, not the much more dangerous preimage attacks which would be required to forge an API key. However, it's certainly not a bad thing to avoid MD5 on principle, since it looks bad for auditors.
Assuming the value you are hashing is randomly generated and is not a human-provided and potentially weak password, then you can use SHA-512 and truncate the output. If you want to use a standard, then there is a SHA-512/t hash defined in FIPS 180-4 in section 5.3.6 which outputs a digest of t ≤ 512 bits. If a standard is not important to you, then it's fine to just truncate the output of the hash to 128 bits.
I specify SHA-512 rather than SHA-256 because, paradoxically, it's actually faster on 64-bit systems. If your system is not 64-bit, then you will probably have better performance with SHA-256.
Answer: You can and probably should use SHA-512 (or SHA-256 if you prefer) and just use the first 128 bits of the output. There is no reason to be afraid of just throwing away part of the output.
Comment: It does technically reduce the cryptographic strength (increased risk of collisions, etc.) but practically speaking it's fine, yeah. On the other hand, why bother? Just store the extra 16 bytes. Your database isn't going to care, and the I/O and compute difference is negligible.
Comment: @CBHacking Sure the resistance is lower, but with 128 bit, it is very unlikely to be important. As for the DB, I assumed he cares about the space if he asks this question instead of just using the (overkill) sha-256


Gifts ungiven vs. hexproof

Question: What happens when my opponent cast Gifts Ungiven while I have hexproof (like from Veil of Summer)? Does it fizzle or give them all four of the cards?
Answer: If you already have hexproof when your opponent attempts to cast Gifts Ungiven, then Gifts Ungiven cannot be cast because it cannot target an opponent; attempting to do this is an illegal action and results in the game returning to the state before your opponent attempted to cast the spell (CR 601.2c, 601.2e).
If you acquired hexproof between the spell being cast and the spell resolving (e.g. by casting Veil of Summer in response to Gifts Ungiven going on the stack), then it will fizzle as all its targets are now invalid, or more formally not resolve and be placed into its owner's gravecard (CR 608.2b).
Comment: @Acccumulation In a competitive situation, you call for a judge because the player should not have searched their library: that is part of the spell _resolving_, not part of it being cast.
Comment: @DavidZ _Nothing_ more than that, with the very small change that any mana abilities can be reversed, not just tapping lands, and stuff like a spell which was cast from the graveyard goes back there rather than going into hand (obviously). Specifically here, actions which caused cards to be revealed from a library explicitly cannot be reversed (all from CR 723.1).
Comment: If someone proposes to cast the card, searches their library for four cards, reveals them, and then their opponent points out that they have hexproof, I take it "return to the state before" means that the cards are shuffled back into the library, even though this isn't exactly the same state?
Comment: @Accumulation "return to the state before" might mean things like untapping lands which were tapped during the process of casting the spell, and moving the card from the stack back into the player's hand. Usually not much more than that.
Comment: @Philip Yes, that's exactly what I meant by "usually not much more than that." I intentionally did not try to give a comprehensive list of details.
Comment: While I will definitely be using that typo on purpose in the future, I think it's the "owner's grave*y*ard".  but the rest of the answer is so tight I can't edit it out myself.

Gifts ungiven vs. hexproof


Can bert uncased predict text classification on foreign data?

Question: I am trying to do the fake news/real news classification and used a pre-trained bert uncased model as transfer learning and it gave a solid 81% accuracy. But the problem is while doing sanity checks, I found my dataset has some Korean/Chinese text articles and these are some real news and it gave the trustworthy score(basically probability) as 60-70%. If Bert-uncased is only for the English language, I'm just thinking about how it processes those languages. Does anyone have any insights?
Answer: BERT is a pre-trained model that is trained on a large amount of text data in multiple languages. While the BERT-uncased model is primarily trained on English text, it also has some understanding of other languages due to the multilingual nature of its training data.
However, its understanding of non-English languages is not as robust as its understanding of English. This is why it might be able to give a somewhat accurate prediction for Korean/Chinese text articles, but the accuracy is not as high as it would be for English text.
If you want to improve the accuracy of your model for non-English languages, you might want to consider using a multilingual BERT model, such as BERT-Base, Multilingual Cased (New, recommended). This model is trained on 104 languages and might give better results for non-English text.
Another option would be to use a language-specific BERT model, if one is available for the language you are interested in. For example, there are pre-trained BERT models available specifically for Chinese and Korean.
Lastly, you could also consider cleaning your dataset to remove non-English articles if your primary focus is on English news classification.
But to improve your score and if you wish keep your current data, then try to use the models like bert-base-multilingual-uncased or xlm-roberta-base.
Comment: Thank you. I just wanted to know if it does any prediction at all on foreign language using bert-uncased. Yes, I do have something that translates the title of foreign language to english but maybe some of them got missed ended up in my dataset anyway.


I get two of the same root view

Question: I am testing my app on iphone and the software version is 4.2.1. I find some problems happened when switching from a customer launchview controller to the rootview controller. The code is as below:
 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
 ....
launchViewController = [[[LaunchImageTransition alloc] initWithNibName:@"LaunchView_iphone" bundle:nil controller:self.viewController animation:UIModalTransitionStyleCrossDissolve] autorelease];

self.window.rootViewController = launchViewController;
 ....
}

In the "LaunchImageTransition.m":
//do some initial work
[self presentModalViewController:self.rootViewController animated:YES];

The rootViewController is initialed in the "MainWindow.xib".
When I test on the iphone simulator, everything is ok. But when I test on the real device, I find that the viewDidAppear method of the rootViewController is called twice while the viewDidload method is called once. This result in two of the same view。
I want to know why this only happened on real device and how to fix it?
Answer: I think that the problem is that you are using the view system in a way that it is not the way it has been thought it should be used. My advice is to change the way you present your views.
I don't know if you have to do this exactly this way, but I think that a better way to go is to let the rootViewController as it should be, like the mainViewController.
At the end of the - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions method you can present the launchView as modal on the mainViewController.
    [mainViewController presentModalViewController: launchViewController animated:YES];

And on the viewWillAppearMethod  or viewDidAppearMethod of the mainViewController you can dismiss the launchViewController.
    -(void) viewWillAppear:(BOOL)animated{
        [super viewWillAppear:animated];
        [self dismissModalViewControllerAnimated:YES];
    }

I hope it helps...

I get two of the same root view


Feed Me not processing until sign-in

Question: I've set up a front-end action that calls the Direct Feed URL to update content on the site, however, the feed update doesn't actually process until the control panel is accessed. Is this normal behaviour? Ideally, I need the feed to be processed as soon as the call is made, regardless of whether admin is logged in. Thanks!
Answer: Feed Me adds jobs to Craft's native queue, and by default, Craft's web-based queue runner won't process that queue until a request is made to the site.
You can look at alternative (and typically more reliable) ways of processing Craft's queue here: https://nystudio107.com/blog/robust-queue-job-handling-in-craft-cms

Feed Me not processing until sign-in


How to start as a control system engineer and to make advanced projects using PID

Question: I am new to the field of control systems, PID and robotics and I want to enhance my knowledge in the field. Can you recommend me books where I can start learning about control system engineering (with mathematical and practical examples) so I can finally finish my project. (I am working on quad copter and I can find all codes online but can't understand it because some people here told me that I should start reading on these subjects first).
Comment: `can't understand it` ... which part do you not understand .... there is no way to answer your question because we have no way of knowing how much you already know
Comment: Okay. I need to start from the begining, to learn the control theory and how it is  related to PID and then go to some practical examples @jsotola
Answer: I can see two parts to this question!

You need to learn the math needed to develop such control systems in an advance manner.

Look for Author: Norman S. Nice - Control Systems Engineering. Sixth Edition I found this PDF online and was used in my course.

the programming skills needed to convert this math into a usable system.

Warning - Controlling a quadcopter is not beginner level task and requires at the least.

Good calibration and a Kaman filter on the accelerometer(acc) data.
The ability to transpose the the filtered acc data to a real world coordinate frame.
Power algorithm to determine the needed PWM output at a given motor to achieve flight.
PID control that uses the filtered acc data to determine error between set-point and actual data.
A good PID tune to make the system function as intended.
Programming skills in data manipulation and math.

Assuming you would be using Arduino or C/C++ you could simply google "quad*copter PID Arduino" and you would get 100's of matches.
Comment: Thanks. I dont want premade algos. I need to make them from scratch so I can understand them. Ok I will find the book and buy it. But how can I study the second part of the question which is controlling the quadcopter
Comment: Be a little more specific, when you say controlling the quadcopter! what exactly do you mean?
Comment: Make it stable when I stop working with RC. Gather information so it will prevent hitting walls or trees, fly with it normally without any movement perturbations.
Comment: By the way, what is your course Ben and can I find it online ?
Answer: Making advanced projects with PID control is easy. At first, a uav-testbed is needed. This consists of two UAVs at the same time. The left UAV is controlled by the human operator with a joystick. And the right UAV is controlled by the pid-tracking controller. The idea is, that the pid-controller follows the human-demonstration in realtime and reduces the error. Such a set-up results not to the Artificial Intelligence itself, but it is only a development platform for testing out different kinds of pid-controllers. A more advanced form is model-predictive control, in which the error between the demonstration and the autonomous controlled vehicle is reduced by a dedicated model which can be a physics-engine, a transfer function or a neural network.
Finding good books about the topic is indeed a problem. I can only provide a link to paper which is not very useful Real-Time Predictive Control of an UR5 Robotic Arm Through Human Upper Limb Motion Tracking because it has nothing to do with UAV control. Another problematic source Designing Interactive Blimps as Puppets is unscientific because it is from the area of animatronics.
Comment: Thanks. It is really hard to find resources related to this field.


How to use article THE?

Question: The number of ballot papers did not tally with the number of voters. Why here in this question article THE is not used before BALLOT PAPERS and VOTERS while we are talking about certain ballot papers and certain people who voted?
Answer: because they used an adjective of quantity "number of" before the noun "Ballot".
so  the definite article "the" which placed at the beginning is so goes  with the noun phrase " number of ballot"
"The number of ballot papers " is a noun phrase....'the' defines the noun "ballot papers"
so we couldn't put  another "the" for the second time with the noun 'ballot papers'.
when we avoid the adjective "number of",  the article "the" directly puts before the noun;
(The ballot papers.......) This sentence hasn't adjective which express the amount of the ballots.

How to use article THE?


Scattering matrix Transmission Matrix lasers

Question: I would like to ask if anyone can suggest me a good tutorial about Scattering and transmission matrices for lasers.
I am really struggling with some issues and the majority of the literature analyses them from the microwave perspective.
To be honest I find it very difficult to understand even the very basics, like how do we derive the transmission and reflection coefficients and where do all these things find application.
Comment: Scattering parameters ("s-parameters") are inherently a microwave/rf way of looking at things. If you don't understand s-parameters, then it won't help you to use them to understand lasers. Can you be more specific on what you want help with? Are you trying to learn more about lasers, or are you trying to learn more about s-parameters?
Comment: We could probably attempt sources all day, or you could ask about specific cases where you are having issues and we could attempt to answer those questions here. As a side note, [this professor](http://www.youtube.com/user/kridnix) has a number of videos on lasers, along with other subjects. Try just skipping by all of the other material and looking at some of the material he has for optics and lasers.
Comment: In the material where it is supposed that i should understand the Fabry-Perot etalon,is expressed as a three scattering networks cascaded,two dielectric interfaces and one transmission line.However,i am trying to understand the main concept of this things and as you said above the majority of the literature i have read until now is on microwaves making it more complicated.I already know that i could attempt sources all day,and thats why i am asking for something that could simplify that.
Comment: I would be very much interested in how you appeared at these matrices studying lasers. After studying this field for about 10 years now, I have never stumbled over them until today.
Answer: Apparently, these matrices are difficult to measure in the optical domain, that's why there is not much information on them, especially very little easy-to-understand references. However I have found one paper, which is short and very practical and therefore easy to read: Measuring the Transmission Matrix in Optics: An Approach to the Study and Control
of Light Propagation in Disordered Media, PRL 104, 100601 (2010).
UPDATE: And a nice, though a bit longer, paper on scattering matrices in lasers: Scattering matrix analysis of a triangular ring laser, JLT 12, 202 (1994).
The following is apparently the first use of the scattering matrix for lasers: Studies of semiconductor lasers of the interferometric and ring types, IEEE JQE 18, 610 (1982).
Comment: I think the poster is asking about basic ray matrix approach to optics, but I could be incorrect.
Comment: @Kortuk: AFAIK there are no scattering matrices in matrix optics. Besides, the OP mentions MW physics, and that's where the scattering and transmission matrices mentioned in my answer are used.
Comment: How did I miss the scattering part, I may never know.


What if a Dog attacks an intruder?

Question: If your pet dog were to attack an intruder during a violent home invasion and seriously injured him, does the dog need to be put down?
Comment: Which state, or country does this question apply to?
Answer: Generally no (it does vary state by state in the US). The intruder took a risk when breaking in and therefore knew that there might be a threat to his life. A judge would generally side with you if the intruder broke into your house, and got attacked by the dog in the house he broke into.
http://blogs.lawyers.com/attorney/dog-bites/can-a-burglar-sue-me-if-my-dog-attacks-them-29325/
http://doglaw.hugpug.com/doglaw_082.html
Comment: But that's not the question asked. If you have a seriously dangerous dog, and his victim is a burglar, that may be tough luck for the burglar. But the police would still find out that you have a vicious dog that might kill your neighbour's young children, and do something about it.
Comment: @gnasher729 In practice, a dog attacking a burglar is almost never going to be considered evidence that you have a vicious dog.

What if a Dog attacks an intruder?


How to calculate PCB track width on proteus?

Question: The current in my circuit is 60A and voltage is 36V. How wide should the tracks on my PCB be?
Comment: I am not sure about Proteus, but there are numerous online calculators. PS 60 amp track will be super wide!
Comment: For traces on 2 oz copper board at 10 degree temperature rise from 25 degrees ambient, you'll want 111mm wide internal traces and 42.6 mm wide external traces.  For 4 oz copper board, half that.  Perhaps consider using wires instead.
Answer: You'll need it wide, and thick if you can (2 oz copper vs 1 oz copper).  There are calculators like this one  https://www.4pcb.com/trace-width-calculator.html that take into account current, copper thickness, allowed heat rise, internal or external trace, trace length into account and calculate a trace width. Other board houses have calculators also.
Answer: If you do this, you will melt the track

simulate this circuit – Schematic created using CircuitLab
Answer: This is not determined by board houses or PCB design software, but by IPC standards. IPC-2221A Section 6.2 states:

The minimum width and thickness of conductors on the finished board shall be determined primarily on the basis of the current-carrying capacity required, and the maximum permissible conductor temperature rise.

The formula provided in the standard is:
$$
I=k\Delta T^{0.44}A^{0.725}
$$
where:

\$I\$ is the current handling requirement in amperes
\$\Delta T\$ is the allowed temperature rise of the trace in degrees Celsius
\$A\$ is the the cross-sectional area of the trace in square mils
\$k\$ is a constant which equals 0.048 for outer layer traces, or 0.024 for inner layer traces.

The cross-sectional area is determined by your trace width and your copper weight (measured in mils, millimeters, or oz/ft^2). If you don't want to do the math by hand, there are certainly plenty of calculators out there on the net. My point is that it is not a custom value depending on your board house, your design software, or anything of that sort. They will all point to this formula, so I simply prefer to skip the middle man and calculate the required trace widths myself from the start.
Comment: That formula does not depend on trace length, but a long trace will get hotter than a very short one.
Comment: @Uwe Source? You may be right, but the formula used above is what is called out in what can be considered THE bible of PCB design.
Comment: If it is a good bible of PCB design, there should be some sentences about the conditions when this formula is applicable. A large PCB filled with a high current coil with many windings would get much hotter than calculated.


Using includes for templating a PHP site and javascript/css

Question: I would using includes for templating a PHP website. I intend to create a header.php file which will contain the doctype, head tag, and everything upto the body tag. My problem is that I don't want the same title or same javascript/css files on every page. What would be a good way to make this more dynamic so that I can set the tile for a page and only include the javascript, css files that I want to include ? I wouldn't be using any frameworks or template engines for this project. So far I have come up with this,feedback would be greatly appreciated:
http://pastebin.com/drdKnEn2
Answer: I would suggest, keep it simple,,, dont use php function to include metaname and favicon nd stuff.
I would rather keep writing these stuff on every page... coz everypage on website is not the same... and if you are using dynamic php, there wont be too many pages! It will look neat and clear to understand/access.


Sand/silt in my well water after a power outage

Question: I am wondering why we have fine sand and silt in our well water after a power outage? We did use a little water while the power was out, and after the power returned, there was fine sand in our water for a few hours. The sand did disappear after running the water for a while. Is this a sign of a bad  tank or screen issue? The few people I've asked told me it sounds like our well is compromised.
Comment: Details about your well? Does the pump live in the well or on the surface? Is there one pipe down the well or two?
Answer: At a guess, some insignificant amount of sand was suspended in the well pipe. Once pumping stopped, it settled to the bottom, and the came out in one noticeable "lump" when pumping restarted and the tank was pressurized.
The test is simple: let water flow a few minutes, take a glass-full of water, and let it stand. If the water is clear, or has only a few specks of sand on bottom, then no worry.


Relationship between Gibbs free energy and surface energy

Question: I am currently studying interface engineering, a field sometimes referred to as surface tension engineering. In the course, it has been mentioned that surface energy, also known as surface tension in the context of simple fluids, is considered a form of Gibbs free energy. I am attempting to grasp whether this classification is purely a matter of terminology or if there is a deeper connection between surface energy and Gibbs free energy. The Gibbs free energy (G) is expressed in various forms, and one common representation is:
G = U + PV − TS. My question pertains to whether surface energy could be conceptualized as a component of the PV term in the Gibbs free energy formula. Since surface energy represents the energy required to create a unit area of interface, is it plausible to interpret this as a form of work performed in establishing space for the material, thus linking it to the PV term?
Answer: I believe this is just a matter of terminology rather than a direct connection. The Gibbs free energy (G) is a thermodynamic potential that combines enthalpy (U), pressure-volume work (PV), and entropy (TS) to describe the maximum non-expansion work that can be extracted from a system at constant temperature and pressure. In simple words, it is a measure of the system's ability to do useful work.
On the other hand surface energy is the excess energy associated with the creation of a new surface or interface between two phases. It represents the energy required to increase the interfacial area by a unit amount. For example, in the case of a liquid-gas interface, surface tension is a measure of the surface energy per unit area.
While surface energy does involve work in the sense that energy is required to create an interface, it is not directly related to the PV term in the Gibbs free energy equation. The PV term in the Gibbs free energy equation typically refers to the mechanical work done by or on the system due to changes in volume under pressure. It does not specifically account for the work associated with the creation of an interface.
However, there is a connection between surface energy and the thermodynamic concept of excess free energy. Excess free energy (ΔG_excess) is a measure of the departure of the Gibbs free energy from its ideal behavior in a non-ideal solution. In the case of a binary liquid mixture, for example, the excess free energy can be related to the interfacial area and composition of the mixture.
Comment: One can happily add terms for any other energies to G. For example, magnetic terms are commonly needed for many element crystal structures. A surface energy term is quite appropriate.


Is there any tool or IDE available for creating wso2 human task flow or do we need to do manually

Question: Please suggest how can I create human task and its corresponding UI for WSO2 BPS server. The documentation given in WSO2 website contains only information about how to use it, but I did not get any documentation for Human task creation.
Also let me know, Is it possible to create human task in WSO2 eclipse IDE, if not then which IDE or technology I can use for human task creation.
Please comment ASAP as I need to give Demo for BPEL workflow with human intervention using WSO2.
Answer: Creating humantasks for WSO2 Business Process Server is explained at [1]. A sample bpel process and a humantask is explained at [2].
WSO2 Business Process Server provides a humantask client API. so that you can even implement an external task UI as explained in [3] & [4].
1 http://docs.wso2.org/display/BPS300/Writing+a+Human+Task+Artifact
2 http://docs.wso2.org/display/BPS300/Claims+Approval+Task+Sample
3 http://nandikajayawardana.blogspot.com/2013/05/how-to-implement-your-own-task-ui-on.html
4 http://thiliniishaka.blogspot.com/2012/12/approval-based-user-registration.html
I would recommend you to try out this as the various functionalities available with WSO2 process server and supporting standards.
Thanks
Thilini
Answer: Welcome to the BPEL world. I warmly recommend you try out Intalio|bpms.
It is using Apache ODE for process execution, coupled with a rich Designer tool allowing you to create graphically complex business processes and deploy them in a click to the server.
Full disclosure, I am the Chief Architect of Intalio.


Running time analysis of problems with a variable in problem definition

Question: I am a research scholar in the field of algorithms and complexity theory. The problem that I am currently working is the $[1,j]$-domination problem. Given a graph $G = (V, E)$, $n = |V|$, the problem asks to compute a minimum dominating set $D$, such that all the vertices outside the solution set $D$ have at most $j$ vertices in $D$. Let's say, I have an algorithm for some particular graph class $C$ with the running time $2^j*poly(n)$. Can I say that the problem is polynomial time solvable for graph class $C$?  My main question is, should I always consider $j$ to be a constant, can't it be some function of $n$ that ruins everything? Please clarify.
Comment: The usual convention is that if the variable is in the name of the problem, then it can be considered to be a constant. So if the problem name is "[1,j]-domination", then $j$ is considered to be a constant.
Comment: If $j$ is allowed to vary, you can also say that the problem is fixed-parameter tractable, with $j$ being the parameter.
Comment: So, do you mean I could safely say that the problem is polynomial-time solvable for graph class $C$ without worrying about what $j$ can be (as $j$ is assumed to be a constant)? @Laakeri
Answer: You seem to be studying the parameterized complexity of the problem. This is a branch of Complexity Theory where you add a parameter, which is part of the input but is seen as a separate value.
For example, if one looks at the $k$-Clique problem, where $k$ is a fixed constant, then it is trivially solvable in polynomial time with a $O(|V|^k\times|E|)$ algorithm. However, in Parameterized Complexity there is a finer notion called fixed-parameter tractable, which states that for an input $(x, k)$, where $k$ is the parameter of the input, the problem can be solved in $O(f(k)\times n^c)$ time for some constant $c$. There is a long-standing conjecture that says the $k$-Clique problem, where $k$ is the parameter, is not fixed-parameter tractable. If that were true, it would be in a sense harder than other NP-complete problems such as finding a vertex cover of size $k$, for which there is a known $O(2^k\times |G|^c)$ algorithm.
To answer your question, I would suggest you say the $[1,j]$-domination problem, where $j$ is the parameter, is fixed-parameter tractable for the class $C$ like @emil-jeřábek said. That way it is clear that your algorithm runs in $O(f(j)\times n^c)$ time, and that $j$ does not depend on $n$. If you just say that the problem is polynomial when $j$ is fixed, it would still be true, but it could still mean that your algorithm runs in $O(n^j)$ time.
As a last comment, if you simply say the algorithm runs in polynomial time for class $C$, without saying anything regarding $j$, then it could mislead people into thinking that your algorithm runs in $O(n^c)$ time.
Comment: In order to prove that the problem is W[1]-hard for some parameter $P$, in the solution size of the reduced instance am I allowed to have $j$ in some form?
Comment: You'd typically say that the problem is W[1]-hard under [FPT-reductions](https://en.wikipedia.org/wiki/Parameterized_complexity#:~:text=a%20parameterised%20notion%20of%20reductions%20called%20fpt%2Dreductions) (or simply "under parameterized reductions"), which is a finer version of Karp reductions. In short, yes you can have $j$ in the size of the new instance, but not as an exponent of $n$.
Comment: But wouldn't the reduction collapse if $j$ is some function of $n$? say $n^{0.2}$
Comment: It would, so don't do that. When you express a complexity bound as a function of different parameters they are considered independent. Like, a graph algorithm that runs in $O(|V|^2\times|E|)$ means that the runtime grows quadratically if you increase the number of vertices **while** keeping the number of edges constant.


Is there any c++ class that can't be used in STL?

Question: Just come up with this question. Any hint?
Comment: you mean with STL containers?
Answer: classes that can't be copied. STL containers require objects to be copyable since the container owns a copy of that object, and needs to be able to move it around.
Comment: Though *pointers* (and smart pointers) to classes that can't be copied are OK.
Comment: Except `std::auto_ptr`. Don't do it! `std::tr1::shared_ptr` is okay though.
Answer: My favourite thing not to put into a STL container is an std::auto_ptr... very bad things happen. .. mostly unexpected loss of objects I think.
In general anything that is not copyable can't go into a container - you'll get compile errors. Something with abnormal copy semantics (like auto_ptr) should not go in a container (but you probably wont get any compiler errors). As the container is free to create various temporary copies.
I think that without a "sane" default constructor and assignment operator you are also in for some pain.
Answer: Depending on the operations you perform, you oftentimes need a default constructor in addition to being copyable for objects stored in containers. For objects passed to algoriths, there are other requirements, like being callable or incrementable. The requirements are well documented.
Answer: The class may not throw exceptions in the destructor ...well no class ever should throw in the destructor
Answer: Depends on the container, for more information, section 23 of the Standard specifies the requirements for all containers and methods.
To be safe though, you should assume that the following are always required:
Default Construction and Copy construction


What is the different between a .msi and .zip Blender installer file?

Question: Are there any feature differences between a .msi and .zip Blender installer file?
Answer: Both versions of blender have the same functionality, features, plugins, etc.
The main difference is that the Zip file does not get installed in the system as a program, meaning that the executable files are not in the programs folder, the application does not appear on the start menu, or as part of the programs menu. Also the operating system will not associate .blend files to open with blender automatically.
The zip file can be extracted to any folder you want, and the contained blender.exe program can be run from there. It can even be executed from an external drive, so that it can also be run on computers where the user has no access to modifying the operating system (in schools, public computers, your parent's computer, etc).
The zip file allows you to use different versions of the program, whereas the installed version will use only the latest one installed.
The files used on the zip file don't need to be uninstalled from the system, you can simply delete the containing folder.
To uninstall the .msi file you need to use the OS uninstall tools.
Answer: An .msi file is an installer. When you launch it, you start, by default, installing software. A .zip file is just an archive that doesn't have to contain a setup file as sometimes software can be used without installation (you doubleclick the .exe file). To work from zip file you first need to extract it. After that you can get the actual software.


How do you make a value-dependent variable scoreboard objective? (Command Blocks, 1.16.5)

Question: It's a bit difficult to explain in the title - basically, what I'm doing is making a Red vs. Blue team game that's almost completely powered by command blocks for its inner workings. A friend of mine helped me with the start, but he's become burned out and has shown me how a lot of it works so far so that I can continue it on my own.
The gamemode puts people in a small arena separated by a wall cutting off the entire middle, where people fight it out after the walls fall in a certain amount of time. Command blocks power most of it, but there's also an operator that controls a panel above the arena. I could just have the operator press a button to trigger some command blocks to say a team has won, but I want to cut out as much of this manual operation as possible.
The teams win via a kill requirement that varies based on how many teammates there are. Teams are selected evenly, but there can be times when there is an extra member on one of the two teams due to it not being even. This is fine, as the win requirement is that teams must get to 5 kills per person on the team. If there were 7 people on a team, it would require 35 kills to win. If the other team had 6 people, it would require 30 kills.
My problem: I've already worked out the combined number of kills. I don't know how to set a variable based on the number of players on the team, which (once the requirements are met) then triggers a series of command blocks to say a team has won.
It should also be noted that this is being done on a 1.16.5 (latest) Paper server with EssentialsX, WorldGuard, and some other QoL plugins.
TL;DR - Need a command, based on a # of teammates on one of two teams, that determines a playercount-based win requirement of kills.
Answer: What you will need to do is compare the scores against one another. Here I store the kill quota in another score:
<code>execute if score RedTeam kills >= RedTeam killQuota run say Red wins!
execute if score BlueTeam kills >= BlueTeam killQuota run say Blue wins!
</code>


Avoiding ubiquitous language clashes

Question: I have been reading DDD Quickly and wondered about how to avoid naming clashes with technical terms and domain terms. For example, if I commonly used the repository pattern (with classes such as AddressRepository), but a customer also has something called a repository in their domain. How would I best avoid confusing the two?
Comment: Just because you are implementing a certain design pattern doesn't mean that you have to name everything according to how it's named in the Design Patterns book.
Comment: This is a tough one, by "technical terms" I think what you're referring to is commonly called a "Pure Fabrication" in DDD terms -  *"A Pure Fabrication is a class that does not represent a concept in the problem domain"*.
Answer: I would say that in the spirit of DDD's Ubiquitous Language, the Domain definition of the clashing term should take precedence over the programming infrastructure term.
In your case, if there is already a Domain definition for "Repository", then you should choose another name for your AddressRepository that doesn't clash, even though the class is implementing the DDD repository mechanism. After all, you don't have to append "Repository" to the end of the class name, it's just a convenience to you, the programmer. I would probably just call it "Addresses".
Answer: In most of cases, when a clash exists you can find with the domain expert a perfect synonymous that removes the ambiguity.
When no synonymous exist, the problem is not about the code base since the compiler knows about namespaces (and btw no repository should be in the same module of the domain), but about developers' cognitive load.
Indeed, when new developers join the project, they will have to learn about the "different" meaning of "that one term" and they will take some time to become able to understand from the context if you are talking about the technical concept or the domain's one (and believe me, this is both annoying and expensive).
Thus, I suggest to

Find a satisfying synonymous with the domain expert
If (and only if) no synonymous exist

use the term from the ubiquitous language as it is (Repository, in your case) for the domain concept
use the naming convention that developers already adopt for the technical concept (AddressRepository here) or you will have to spend time to explain the exception a lot of times!

This might look too pragmatic, but works well.

Avoiding ubiquitous language clashes


SQL Server : Tracking a slow running query on completion

Question: Am trying to work on script for slow-running queries. I understand that we can get the list of slow running queries using sys.dm_exec_requests. Say, I have a query Q1 which is running very slow, say, 1 hour. Till Q1 is running i.e. executing, I can track it using sys.dm_exec_requests DMV. If I understood it right, once Q1 is completed, its statistics will be no more available in this DMV. Instead, we need to look at sys.dm_exec_query_stats. But how do I get the statistics of that specific query Q1 which had been slow-running ? Meaning how do I relate the data I earlier got in sys.dm_exec_requests and sys.dm_exec_query_stats?
Comment: for the exact statement you'd relate the two based on the `sql_handle` (assuming you've captured that). for similar queries, you'd related the two based on the `query_hash`.
Comment: @swasheck thanks! I think this works! +1
Comment: If you can add this as an answer, I can mark it right @swasheck !
Answer: A quick-and-dirty way to get this information is to run something like this query while the query you wish to observe is still running.
select
    st.text,
    r.wait_type,
    r.wait_time,
    r.wait_resource,
    qs.creation_time,
    qs.*
from sys.dm_exec_query_stats qs
join sys.dm_exec_requests r
    on r.sql_handle = qs.sql_handle
cross apply sys.dm_exec_sql_text(qs.sql_handle) st

Note: this will only capture queries that are running at that moment. Additionally, the query stats DMV does not persist across reboots and may also be flushed when under pressure. Joining on sql_handle gets you query stats for that exact statement. You can find query stats for "similar" queries (similar logic with difference occurring only in literal values) by joining on query_hash.
Answer: What I've been using is Adam Machanic's Who_IS_ACTIVE to track the stats for slow running queries. The prod uses the DMV's and will track the stats as mentioned.
One of the great things about sp_whoisactive is that it's very quick to generate a table to collect the data you need, then run the procedure in a loop with a wait statement to regularly collect the data you want over an interval.
Please read How to Log Activity Using sp_whoisactive in a Loop
Also, read here on how to use it to find stats on slow running queries.
Apart from DMV's, you can use SQL profiler or Extended events to find the stats on slow running queries and troubleshoot the same as explained in Identifying slow running queries


Calculate maximum velocity that one can reach given the accel, decel, distance of the 'road', initial velocity and final velocity

Question: I am programming a robot that has to be able to accelerate do the maximum velocity possible within a known distance knowing the initial velocity, final velocity, acceleration and deceleration. Is there a formula? Or do you know of an algorithm that might calculate it? Any help is appreciated.
Comment: Just google kinematic equations
Comment: Sketch a velocity against time graph noting that its gradient is the acceleration and the area under it is the displacement.  This may help you set up the relevant equations.
Comment: Kinematic equations won't do the job.  If this is a real world robot, it moves in 3 dimensions, and probably has one or more rotating joints.  The solution is quite complicated, and consists of matrices that describe the motion of different parts of the robot in terms of acceleration, velocity, and displacement.
Answer: Your robot surely needs this...
Consider your robot (Let's name him Rob!!) has been destined to have a maximum acceleration $\alpha$ and maximum deceleration  $\beta$. For this time interval $t$, Rob covers a distance of $s$. Let's work this from a graphical approach rather than using derivatives :

Now Rob's maximum velocity $v_m$ is represented by the peak Q.
All inferences has been based on the graph.
$T=t_1 + t_2$
Slope of OQ curve= $\alpha$=$\frac {v_m}{t_1}$
Slope of PQ curve=$\beta$=$\frac {v_m}{t_2}$
From here let's put the values of $t_1$ and $t_2$ in the first equation which goes by-
$$T=\frac {v_m}{\alpha} + \frac {v_m}{\beta}$$
$$\Rightarrow v_m=\frac {\alpha \beta T}{\alpha + \beta}$$
For Rob's  $v_m$ to be a function of $s$ you can easily do by using other physical consequences of the graph that I leave upto you.
Now Rob looks polished.
Cheers!!


What exactly is "briefly explain your master research project" in a PhD application? (CS field)

Question: Are they actually interested in my project or do they want to know how I solve problems? How can I ace this part of the application?
Answer: Even before you try to answer this, think about developing an "Elevator Talk" about your research. The idea is that if someone bumps in to you in the elevator and asks about your research you can explain it in the two minutes you have in the ride. Think about the key question(s) you are asking. Think about how you approach the solutions. Think a bit about the current state of it.
Once you have your elevator talk you just want to translate it into a slightly more formal written form. Key Question. Approach. Current state of progress.
It doesn't need a lot of detail and should fit on less than a page.

You might want two versions of your elevator talk. One for professionals in the field and another, less formal one, for other people you meet but who aren't in the same field. The one you want in the application is the formal one, of course.
Comment: @ Buffy give "not more than 1000 words", do you think i should write ~900? or should i be concise (as you said explained in two mins). And I am really curious about what can they can out from this? I'm applying for a course-based phD!
Comment: Use what you need, but no more, and not more than 1000. And explore the actual meaning of a "course based PhD". I worry that it might not be accepted for all purposes. Most PhDs are research based, though there are other doctorates.
Comment: great, thank you :)


Can a Cube of Force block breath attacks?

Question: Will side 1 of a Cube of Force, which blocks gasses, block a breath attacks? The flames of a dragon spawn from its breath and therefore are based on a gas. Would the first side of the Cube of Force stop the attack? This would also apply to any type of elemental breath attacks of dragons, or even dragonborn racials.
Answer: No (mostly)
Breath attacks that aren't based on gas or wind would be unaffected. A red dragon's flaming breath attack is not harmful because it's windy or gassy, it's harmful because it's fire. Similarly a blue dragon's lightning "breath" and a black dragon's acid breath are harmful because they spit streams of lightning and acid, not because they're blowing on you.
Breath weapons based on gas would be affected just fine though: a gorgon's petrifying breath or a green dragon's chlorine gas breath are both harmful gasses, which the Cube of Force could block. You can tell because their descriptions call them "poison gas" and "petrifying gas", respectively. Similarly, the Cube would keep you safe from an air elemental entirely because it is made of wind.
If you want to block non-gasses, use the other faces of the Cube — that's what they're there for. A gout of acid would be blocked by face 2, and something like a red dragon's fire would be blocked by face 5. Sure, they cost more charges, but the Cube is self-charging, so there's no need to lawyer-up (or worse, suddenly assert that D&D is science fiction and science-up; you do not want to dive down the science rabbit hole when dragons are involved, nevermind the lesser but still Gordian metaphysical knots you'd tie yourself into trying to define the distinctions made by the Cube's other face's effects in scientific terms) just in order to save a couple of charges you'll get back soon anyway.
Answer: It depends on the breath attack
SevenSidedDie has the correct principle in mind -- breath attacks and spells based on vapors or fogs (since the cube of force blocks fog) would be blocked by the cube of force effect in question, while those that are not would likely not be.  However, the details get a bit trickier, due to the way things like acid breath and fire function.
Going by element:

Fire: Partially -- the combustion reaction takes place in the vapor phase, and only in the vapor phase.  (If you had a tall Pyrex beaker full of diesel, and lit it on fire with a barbecue lighter, you'd see that the fire burns at the surface of the liquid, while the rest of the fuel remains unburned.)  The other side of the cube of force would be plenty hot, though!
Acid: No -- the line-like acid-breath of a black dragon is more of a "caustic spitball" than a gas or a mist/fog (if it were a cone effect, I'd rule it as something more like an acid fog, but it's a line-effect).
Poison: Yes -- this is by RAW: the MM explicitly states that green dragons exhale "poisonous gas".
Cold/Ice: Partially -- while the actual fog of moisture generated by a "cone of cold" breath effect may not penetrate the cube of force -- the thermal effects still conduct through the cube and affect someone on the other side.
Lightning: No -- lightning breath either punches a hole through the cube of force due to dielectric breakdown, or jumps across it due to dielectric polarizability and breakdown of the air on the other side, as if the cube of force was the dielectric of an improvised capacitor.
Sleep Gas: Yes -- Again, this is by RAW.
Repulsion: No -- this is by RAW, as the effect is listed as "repulsion energy"
Slowing Breath: Yes -- this is by RAW again, the effect is listed as "exhales gas"
Weakening Breath: Yes -- yet again, this is by RAW, the effect is listed as "exhales gas"
Paralyzing Breath: Yes -- again, by RAW, same as the past two
Steam Breath: Yes -- a cone of "scalding steam" is a cone of gas or vapor (think of holding your hand right next to the nozzle on a teakettle).
Euphoria Breath: Yes -- again by RAW, this effect is listed as a "puff of euphoria gas"
Petrifying Breath: Yes -- once more, by RAW, this is listed as "exhales petrifying gas"
Comment: I believe this is exactly what SevenSidedDie meant by "Sciencing-Up".


Can I be turned to stone if I target an area of effect spell at a medusa's space?

Question: In our last campaign we were fighting a medusa with our eyes averted. With that blinded condition, can I cast an area of effect spell on the space that a medusa is standing in without looking at the medusa itself?
Answer: If you avert your eyes from the Medusa, you still know where she is, but you do not actually see her.
You can still hear her voice/movement/breath etc. unless she hides from you. Thus you have a good idea where she is, but you are not actually seeing her so you are attacking an unseen target (PHB p.194f), which should be irrelevant for most area of effect spells.
Knowing where she is, you can cast an area of effect spell on the Medusa. If the spell has to be cast 'at a point you can see' you must see this point, thus you would have to choose a point next to the Medusa, so you can avoid looking directly at her.
If she hides from you (which is possible when you avert your eyes) you would have to guess her location and cast the spell at a point of your choice, hoping she is in the area, but there is no guarantee that you hit.
Comment: Do you mean something by "mechanically hidden" that is different from the result of taking the Hide action. If so, please explain. If not, please stick to the terms the game uses.
Comment: @DaleM I do not think 'being hidden' is a game term, so I used 'to hide'. I guess this is what you meant?
Answer: You can target by sound. You will still have disadvantage on the roll though. If they are hiding (using the stealth skill to remain unseen and unheard) you will have to guess or use special skills or senses to pinpoint their location.
PHB p194 (Emphasis Mine)

When you attack a target that you can't see, you have disadvantage on
  the attack roll. This is true whether you're guessing the target's
  location or you're targeting a creature you can hear but not see.

This would also allow you to center an area spell so that it would include the medusa.
Comment: There is no emphasis in the quote...


Can I get from Basel to Niesen Mountain by public transport?

Question: I am traveling to Basel (Switzerland) this summer and wish to take a day-trip to the Niesen Mountain. Can I go there by public transport, how much would it cost?
Answer: There is a cable-car going up to Niesen Mountain. As the Wikipedia article says, it is one of the longest cable-cars in Europe.

An overview about the prices is available on the official homepage. You should look for the station at the top of the mountain which is called Nielsen Kulm. The price is around 53 CHF for a return ticket if you don't have any reduction price plans.
The funiculair starts at Mülenen which is rechable by public transport from Basel. Checkout the official SBB homepage, and you will see that you can get there in 1h46, changing the train once in Berne, for a total of 112 CHF (retour ticket).
So in total you will have to pay around 165 CHF for the whole trip. Keep in mind that there is the so called Halbtax Abo in Switzerland that costs 150 CHF and allows you to use all the trains and a lot of cable-cars for half of the price for a whole year. So if you plan to do more such trips, it can be worth to invest in such an card.
In this particular case you would already save 82.50 CHF. So if you think you're going to spend another 135 CHF for train tickets in the next 365 days, I would recommend to buy a Halbtax Abo.
Comment: Can you get a concession with the Eurail pass here?
Comment: Eurailpass wil give you free travel on the train from Basel to Mülenen. With a Swiss Pass, or a Swiss Half Fare Card you get 1/2 off on the Niesenbahn.


Network Ad UTM Tracking Issue with GA

Question: We have placed ads through an ad network targeted to our state's geo. We have doublechecked that the placment is correct, but our Google Analytics shows significant traffic from these UTM's coming from out of state. When we drill down the traffic seems to be coming from hubs for Amazon Web Services, Level3 or other web hosts. Does anyone have an explanation?
Comment: Could it be crawlers on these ad networks?
Answer: This sounds line someone might be crawling or tracking your site. I doubt it is the Googlebot or Adbot as these crawl from Google owned IP addresses and are identifiable as belonging to Google but that doesn't mean that other crawlers aren't crawling your site based on these ads as when they crawl a site that is showing your ads then they will have a link to crawl your site from the ad link and that will include the UTM's you added to the code.
If it is a significant amount of traffic you can try blocking the IP's in question from browsing your site but if the amount of traffic it is generating does not bother you then you probably don't need to worry about it.

Network Ad UTM Tracking Issue with GA


What is X Server and Remote Terminal Server?

Question: Can someone explain what is the difference between X server and Remote Terminal servers in simple terms?
For example, Hummingbird Exceed is an X server and Citrix is a Remote Terminal Server. How do these servers work?
Answer: A terminal server runs at the "other" machine while you use a remote desktop client to view the other machine's screen.
A X server (of the X11 Window System) runs on your machine while another machine (or several thereof) send their output to your computer.
The most important difference to the end user is probably "culture": With the X Window system you typically work with windows that run on several hosts. (You often sit in front of a quite stripped down workstation, get one application from one computer, another one from another computer.) When working with X things feel very heterogeneous - a special application only runs on a HP workstation while your company is stuffed with suns or linux boxes? No problem, just buy one HP, everone can use that application over the network like as it was local.)
Remote terminal services feel more like another computer sends its complete screen to you, more like you have a 100-Mile-Long monitor and usb cable (with a little lag built in). You typically use a remote desktop client that sends a complete desktop to you.
However in recent times both techniques get close to another - windows remote desktop (which is based on citrix) can send only application windows to your desktop, while a lot of programs based on X11 are theoretically network transparent but practically need to run on the local machine. (Sorry, no 3D shooter over the network - an extreme example).
Which one is better? I don't dare to say. White X11 is a lot more flexible (it was designed with network transparency in mind - it makes absolutely no difference if an application runs local or remote - it is in many aspects more complicated. As long as there was no remote desktop sharing there was a clear advantage, but slowly the gap is closing, for example by terminal services now allowing you to do many things that were available with X11 only in earlier times.)
By the way, the main reason many X11 application still feel a little "snappier" over the network than windows counterparts is the thing that many application programmers on windows still think they always run local and dump a lot of bitmap graphics on the screen - like custom toolbars in ZIP tools. X11 applications did not do this for a long time and chose "ugly but fast" because X11 forces you to think about the network. But as X11 applications get more pretty and Windows programmers more aware about terminal services the difference will dwindle.
Oh and an important point: X11 is deeply ingrained in the Unix way of things, Citrix is mainly used on Windows (in the form of Microsoft's Windows Terminal Services - which originated in Citrix code). So lock a terminal services admin and a X11 operator into a cage and step back watching bloodshed when they figure out who they are locked in with ...
Answer: An X server most likely refers to the X11 windowing system, which is the GUI that most unix flavors (including linux) use.  It's a client/server setup, and has been around for a very long time
A remote Terminal Server in the case of Citrix is a remote windows instance that can be connected to with a special Citrix client.  The Citrix environments I'm familiar with are all MS Windows solutions, ie they work similar to X, but are for Windows Servers only
They both sort of operate in similar fashions, which is serving a remote client a windowing solution. IE, they both let a server run the actual application while the display of that application is sent back over the network to a client PC.
Comment: After a little research:
A good overview of X in general: http://www-h.eng.cam.ac.uk/help/tpl/graphics/X/X11R5/node3.html

And it appears from http://www.windowsnetworking.com/articles_tutorials/Overview-Terminal-Services.html that Citrix is capable of more than just MS but can do Unix as well
Answer: A 'Terminal Server', as it's called, basically allow you to connect to a Windows session remotely. They employ a bit of magic to make the experience snappy over connections with latency. The Windows GUI system isn't network transparent like X, so it took a while longer to get this feature. Windows Server 2008 and Citrix products have the ability to let you use a single application, unlike the traditional Terminal Server.
X is the GUI protocol for Unix/Linux. The X server accepts connections and displays their windows. The clients are actually the programs themselves. These clients can be local or remote, it doesn't matter to X. X just displays them as requested, on the local screen or over a TCP connection. This is lower level stuff than terminal servers, and allows graphical programs to run on one machine and display on another. X11 doesn't compress or encrypt the traffic like RDP does (although SSH can help you out there).
The linux equivalent of RDP is NX. They provide free software to run NX servers/clients. I've used it and it works pretty well.


Cannot distribute AdHoc ipa file

Question: I have a xcode project that I would like to distribute to collegues of mine, I have therefore added all my collegues UDID in the devices section of the provisioning portal, I then downloaded the distribute and the Ad hoc provisioning files and clicked on them so that they came in to my organazizer. I then used them in xcode and selected "build-archive", I then followed this guide http://gknops.github.com/adHocGenerate/ to make a wireless app distribution. And uploaded the provisiong file, plist file and the ipa file. But when I try to install the app using the link in my html file it start to install but fail with this message " "Appnamexxxx" could not be installed right now". I dont know what I'm doing wrong and the error I get doesn't tell me anything...
Comment: Please! confirm me, after build archive did you try to install IPA in your device through iTunes etc. still not sure your IPA has problem or after sending over the network you having trouble.
Answer: I found the reason why it didn't work. I had entered the UDID of all the devices in the provisioning portal, but I didn't check that they where supposed to be used with that profile. I thought that if I entered UDID they where automatically selected to be used with the profile, this I found out by pure luck when trying to find the reason for this in the portal. So one have to select the provisionig and choose edit, then you have the reason to check/uncheck the UDID's you want in that profile. Hope this can help others too.
Answer: Hello there try to use betabuilder.http://www.hanchorllc.com/2010/08/24/introducing-ios-beta-builder/

Cannot distribute AdHoc ipa file


Disassembling a RC car for a Arduino Robot

Question: I am looking at making an Arduino robot car. I have a RC car( photos below). I was wondering if I could take the chassis of the car and modify it to make it Arduino controlled, if so how could I do that?(I have an Arduino UNO R3). I would like to make it into a wall avoiding robot. I have never soldered a thing in my life, and I don't own a soldering iron.
Comment: Depends what you want to do? But if you're good with soldering and electrics it should be easy... Tell us what you want your robot to do, and we will try to help..
Answer: Sometimes modifying something can be harder than starting from scratch. This is probably one of those cases, but it is over all not too difficult if you have the courage.
Start with a good example, like this robot.  It will give you an idea of what hardware you must add to your RC car and how to program the Arduino.
Answer: Someone has done exactly this, and written detailed instructions at http://www.instructables.com/id/Autonomous-Control-of-RC-Car-Using-Arduino/
Some remote control devices (usually not the really cheap ones, like the one shown here) will have a standard transmitter/receiver. See http://www.alibaba.com/product-detail/3-channel-radio-control-receiver-box_311659816.html for a picture of the receiver. If you can find this in your remote control device, you should be able to unplug it, and replace it with an Arduino. You will need the "Servo" library - see https://www.arduino.cc/en/reference/servo
You can probably get away without soldering - you will probably need to strip some wires, and you can use crocodile clips, and/or breadboard jumpers to connect everything up. It won't be pretty.
If you want to learn to solder (I know it's intimidating, but it's not so bad) I recommend that you find a local hackspace/makerspace, and find someone there - they will probably be more than happy to teach you. They probably have everything you need, be nice to them, and if you want them to continue, join up & pay regular subs. And take every opportunity to teach the skills you have to anyone else who asks for help.


Proxy app which doesn't requie any root access in android 2.3.6

Question: I recently installed proxydroid app in my android 2.3.6 This application requires root access. Every time to use it, I need to make root access to my device.Is there any proxy app which does not require any root access?
Answer: Simple answer: No.
Long answer:
No, as these app use a native binary installed onto the system to reroute data through the proxy. This is done at kernel level (actually it's done using the terminal commands, but it is done at kernel level), because of this root access is needed.
There are 0 apps that allow you to use a proxy without rooting first. Android 4.x natively supports proxies however.
Comment: I was not aware of this fact about proxy in android 2.3. Amazing... Thank you.
Answer: Short answer:
No, proxy apps available on the playstore all need root (to my knowledge). But you can use the native proxy -- even with Android 2.1.
Longer answer:
As Liam wrote in his answer, an explicit proxy requires kernel level access. But Android has a native proxy built in.
Before Android 4.x, its settings were simply hidden. So all you need is access to its settings page -- which is what some apps provide, as e.g. Proxy Settings does:

From the app's description:

It provides a set of tools to ease the access and the modification of the proxy configuration into your Android device. Proxy Settings offers to the users a set of tools to check and troubleshoot the selected proxy configuration

Proxy Settings works with Android 2.1 and higher.
Comment: This doesn't actually work. It never did for me at least. Maybe that is why they were hidden...
Comment: I never needed them, so I never tried them. I just remember there was one more app giving access to those settings -- just could not find it. Ah, I'm stupid! I mentioned it in one of my books... Here it is: [HTTP Proxy-Settings](https://play.google.com/store/apps/details?id=org.credil.proxysettings)


Minkowski sum of small connected sets

Question: Suppose that the convex hull of the Minkowski sum of several compact connected sets in $\mathbb R^d$ contains the unit ball centered at the origin and the diameter of each set is less than $\delta$. If $\delta$ is very small (this smallness may depend on $d$ but on nothing else), does it follow that the sum itself contains the origin?
Comment: WRONG TAGS --- it should be geometry or/and convex-geometry...
Comment: This was asked long before such tags existed and before I would be able to create them. I'm not really sure what are the best tags for this now (I chose these two because the question arose in a purely analytic setting and it seemed topological in nature) but I do not mind in the slightest if somebody more comfortable with the vast forest of the current tags will retag it. I am currently completely lost in the aforementioned forest, so I'll take no action myself.
Answer: I finally figured it out. My solution is here. I would repost it on mathoverflow but until LaTeX is enabled, it is quite hard for me to communicate such things here...
Answer: Argh! I tried to add this as a comment but when submitting it, I was told that there was a 600 character limit and all my typing just disappeared without trace.
Anyway, my point was that you can get "straight paths". The reason is that if $a=\sum_ i x_ i$ and $b=\sum_ i y_ i$ are in the sum, then the vectors $v_ i=y_ i-x_ i-(b-a)/n$ are small and add up to $0$. There is a cute result that then you can rearrange them in such order that all partial sums are small (just constant times larger than the vectors themselves). If you switch from $x_ i$ to $y_ i$ along the corresponding compact in this order, you get a curve that travels from $a$ to $b$ within a small neighborhood of the segment $[a,b]$.
Another observation that may be useful is that the sum is $d\delta$ dense in its convex hull. Indeed, if $a=\sum_ i v_ i$ and $v_ i$ are in the convex hull of $K_ i$, then we can start moving $v_ i$ until their representations as convex combinations of points in $K_ i$ get shorter and we can do it as long as there are at least $d+1$ vectors $v_ i$ that do not belong to $K_ i$ themselves (any $d+1$ vectors in $\mathbb R^d$ are linearly dependent). Thus, in the representation of every point in the convex hull as a sum, we need only $d$ vectors from convex hulls and the rest may be taken in $K_ i$.
I feel that these two observations put together should be enough and I just do not see how to add 2 and 2 here.
Answer: I don't have a proof yet, but here are some ideas that might lead to one. I'll stick to two dimensions. Suppose that your sets are X_ 1,X_ 2,...,X_ m and in each X_ i-X_ i you take a vector x_ i. Now let's suppose that x_ 1+...+x_ r=x and x_ {r+1}+...+x_ m=y, and that x and y are quite a lot bigger than the x_ i and point in very different directions. Then the Minkowski sum of the X_i contains a path that goes from some z to z+x and from there to z+x+y, using bits out of different sets for the two parts of the path. Now we could get from z to z+x+y using the same bits in a different order. For exampe we could go first to z+y and from there to z+x+y. And I'm fairly sure that a topological argument will show that the region bounded by those four bits of path will all be in the Minkowski sum. So it would be enough to show that we can get paths that are reasonably straight.
Why should the bits in between be in the Minkowski sum? It's enough to prove that in the case r=1 and m=2. (After that one just keeps swapping xs from the first half with xs from the second half -- I hope all this is making sense, but I haven't thought about it carefully enough to be sure it isn't stupid in some way.) If X_ 1 contains a path P_ 1 from 0 to x (WLOG) and X_ 2 contains a path x+P_ 2 from x to y, and if the four paths P_ 1, x+P_ 2, P_ 2, y+P_ 1 do not cross and bound some region, then the sets P_ 1+u with u in P_ 2 trace out that region I think.
There are plenty of details to check there and even if they all work one still needs to prove that in the Minkowski sum you can get from any point to any other using a "reasonably straight path", whatever that means. So this is just my preliminary thoughts.
A very nice problem, though!
Answer: In dimension 1, why are the sets {-100}, {80},{120} not a counterexample?
(In particular, they are compact connected sets with 'diameter' 0; their Minkowski sum, going by the wikipedia definition, is {-20,20,200}, which does not contain 0, but whose convex hull [-20,200] contains a large ball around 0)
This example of course has nothing to do with dimension, and you can easily flush out the points into tiny balls, if you like. I suspect that this is based on a misreading of the question.
Comment: The Minkowski sum of those sets is the set {100}. The Wikipedia article discusses the Minkowski sum of two sets. But this is a commutative and associative operation, so we can discuss the Minkowski sum of any finite number of sets.
Comment: As David Speyer points out, the Minkowski sum is a singleton in this case. My only reason for making this comment is to say that I came up with exactly the same "counterexample" myself at one point, and even started writing an answer based on it. But then I realized my mistake.

Minkowski sum of small connected sets


Farming using Mob Spawners in Minecraft

Question: I have a couple of Mob Spawners surrounded by torches (thus rendered inert), and I want to try using them to farm enemy drops. What's the most efficient setup to automatically kill spawned mobs and collect their spoils?
Answer: Most mob farming techniques use a stream of water which collect all the monsters in the room to a central point, and then drowns them by pulling them underwater. Some other ways to kill them are:

Pushing them via a water current into cacti
Using lava to kill them
Making them fall really far so they die from the impact

Just as a note, most people just build enormous completely dark rooms (like this one) to farm mobs rather than using the actual mob spawner blocks.
Here are some screenshots from the link above:
Comment: The zero chunk may no longer be the best spot for your spawning tower.  Apparently, changes have been made to the spawning algorithm reducing the effectiveness of this style spawning tower.
Comment: As mentioned in the link above, the most efficient location is on the zero chunk.  The easiest method for finding this chunk is using external map tools (viewers or editors).
Comment: They may all be equal in terms of lethality, but considering you're probably after items/hr (max) then I'd suggest a lava trap to kill them. The one I use is the one from a youtube video. Make sure you put glass blocks over the top of most of the lava so that monsters can't walk into it (you lose the drops).
Answer:       I found a really neat video a while ago of a Mega Mob Factory someone had made for farming Ham.  I'm sure you could do the same with a mob of creepers.

      This works on the same principle as most mob farms: it uses water currents to trap pigs and pull them underwater, drowning them.  All of the spoils end up at a singular point below the structure, that can be accessed by a ladder.
Answer: The most efficient way I've found for farming items from zombie and skeleton spawners is to place a water block in one corner of the dungeon, a lava block held up by signs in the opposite corner, and a water stream carrying items out.
For spiders the previous design doesn't work because they can get pushed past the lava block and under the walls where they get stuck. Instead I dig the dungeon a bit wider, have water flowing from the walls to the center and in the center have a 3x3 hole with a cactus block in the center of the hole. The hole has to be at least 7 squares deep so that the cactus can remain below the rim even when fully grown and is 3x3 because spiders fall in easier than with a 2x2 hole. Under the cactus use water to get the items to a collection point, or just stand there if you like watching the spiders die. I suppose a column of lava would work as well as a cactus, but you'd have to make sure that the column was tall enough that any spider falling through spent enough time in the lava blocks to die and you'd need a lot of signs.
Make sure to light all the areas outside of the dungeon and that no light is getting in.
Also make sure to keep your collection point close enough to the spawner for it to keep spawning while you wait. (According to the wiki you need to be within 16 blocks of the spawner.)
I've not done a comparison between the item drop rates of these compared to drowning traps, but I suspect that the items destroyed by cactus/lava contact are balanced out by the slower kill speed of drowning. If not, both of these could be modified to be drowning traps.
Comment: And start them with 4 spaces to trigger `pre`
Comment: You could also just grab a screenshot from within Minecraft using F2, then place the image in your answer.
Comment: You can end lines with two spaces to force a new line.
Comment: I tried to include some text art to diagram this, but SE ignored my newline/carriage return and put all the characters on one line. Anybody got some tips on avoiding this?
Answer: ERR: If you want to make a mob farm to collect drops, DO NOT use lava or cactus. Both can destroy items. I would suggest putting flowing water around the spawners, and then making a deep channel at one end, at the ege of the water so the water comes right up against the channel, but does not flow down. Then, put hoppers at the bottom of the channel and make an access shaft with a chest connected to the hoppers.
Comment: Editing is a core activity here at Arqade, MTWTech.  Any user has the ability to suggest edits.  Ensure that your answers only answer the question.  Information that's not related will be deleted.
Comment: You can comment on your own posts, yes.  You can also edit your existing posts to try to make them better.  If you edit one of your deleted ones, you can flag it for us to take a look at, and maybe undelete.  That might be able to lift the ban.  I'd highly recommend taking our [tour](https://gaming.stackexchange.com/tour) and perusing our [help center](https://gaming.stackexchange.com/help) to learn more about how Arqade works.
Comment: @Frank okay, i see. I got stuck in an answer ban, so all i can do is comment(At least i can still comment though.).
Comment: i dont even know how to delete my posts

Farming using Mob Spawners in Minecraft


Why don't these two different methods of counting give the same result?

Question: We have 4 bananas, 5 apples, 6 oranges. How many ways can we choose 7 fruits with at least 4 oranges?
The straight forward method is to divide this into cases with 4, 5, or 6 oranges and then picking from bananas and apples, so that we have chosen 7 fruits. If we compute each case and add them up, we get: $$\binom 64\binom 93+\binom 65\binom 92+\binom 66\binom 91=1485$$ But there is a simpler way; first pick 4 oranges from those 6 oranges (so that we have picked at least 4 oranges), and then choose 3 fruits from the remaining fruits (2 oranges, 5 apples and 4 bananas which sum to 11 fruits). This way we do have picked 7 fruits and at least 4 of them are oranges but the result is: $$\binom 64\binom {11}3=2475$$ which is different from the actual answer.
How can I rigorously check which method works without having to list all the combinations?
Comment: I am using the rule of sum and rule of product. The binomial coefficients represent the number of combinations. I want know what went wrong that I got two different answers from two different but seemingly logical and correct methods of counting. How can I avoid such counting errors by rigorously proving the right method without having to list all of the combinations? I don't know much beyond the rules I stated, so please consider that while answering.
Answer: Your second method counts each selection that has $5$ oranges $\binom54=5$ times, and each selection that has $6$ oranges $\binom64=15$ times. In each case you count the selection once for each set of $4$ oranges contained in it: any one of those sets could be the set of $4$ that you preselected.
Comment: So, I just counted the same objects more than once? But, the method's logic seems correct. What is the right way of applying the logic if the second method I mentioned, is not? And how to deduce that the method is counting things correctly? In this problem, the correct answer was given by the first method, so the second method has indeed counted some objects more than once. But in an exam situation, I can't try both methods.
Comment: @M.Mahdi: In general you need to ask yourself whether a method of counting could possibly count the same collection or arrangement of things more than once. Notice that your second approach singles out $4$ oranges for special treatment. This means that whenever we end up choosing more than $4$ oranges, we're actually counting our oranges in two groups, the original $4$ and the one or two that we added later. But we can get the same $5$ or $6$ oranges with a different division of them into original $4$ and extras, and each of those divisions gets counted separately. This is something to ...
Comment: ... watch for whenever you single out a specific subset of some collection whose elements should be treated identically. In this case we're singling out $4$ oranges as the ones originally chosen, distinguishing them from any that we choose later, even though all that we care about is which oranges were selected.
Comment: Thanks. This works.
Comment: @M.Mahdi: You're welcome.


Confidence interval interpretation in linear regression when errors are not normally distributed

Question: I've read that "If the error distribution is significantly non-normal, confidence intervals may be too wide or too narrow" (source). So, can anyone elaborate on this? When are the confidence intervals narrow and when are they wide? Does it have anything to do with skewness?
Answer: In case you might want to try another way to find confidence intervals, and in addition to the nice and rigourous answer by Peter, I would also consider a resampling method like bootstrapping as a robust way to find confidence intervals.
One key advantage is that it does not assume any kind of distribution, being a distribution-free method to find your coefficients estimates.
In the case of finding a confidence interval for a linear regression, the steps would be:

Draw n random samples (with replacement) from your dataset, where n is the bootstrap sample size
Fit a linear regression on the bootstrap sample from step 1
Repeat steps 1 & 2 n_iters times, where n_iters will be the number of bootstrap samples and linear regressions made on them
Now that we have n_iters values for the linear regression coefficients, we can find the interval limits via the min, median and max percentiles (e.g. for a 95% CI: percentile 2.5, 50 and 97.5) to find the coefficient estimate together with the CI limits

Please mind the variability of the confidence intervals along the x-axis values, taking into account the sampling error of the coefficients estimates (good source of read: https://greenteapress.com/wp/think-stats-2e/)
The associated code of my example including the plot can be found here
Comment: Good alternative (upvote!). However, I think this would yield similar reults like using "robust" standard errors. The latter option is much more efficient, I guess. https://stats.stackexchange.com/a/56888/224077
Comment: a great answer. very clear and substantiated.
Answer: OLS Model:
One of the assumptions behind OLS (aka linear regression) is homoskedasticity, namely:
$$ Var(u| x ) = \sigma^2.$$
Recall that the linear model is defined:
$$ y = X \beta + u, $$
where $u$ is the statistical error term. The error term (per OLS assumptions) need to have an expected value $E(u|x)=0$ (orthogonality condition) with variance $\sigma^2$, so that the error is distributed $u \sim (0,\sigma^2)$.
Heteroscedasticity:
In case the variance of $u$ is not "harmonic" and the assumption above is violated, we say that error terms are heteroscedastic. Heteroscedasticity does not (!) change the estimated coefficients, but it does affect the (estimated) standard errors and consequently the confidence bands.
The error variance is estimated by:
$$ \hat{\sigma}^2 = 1/(n-2) \sum{\hat{u}^2} .$$
The standard error (of coefficient $\beta$) is estimated by:
$$ se(\hat{\beta}) = \hat{\sigma} / (\sum{(x_i-\bar{x})^2})^{1/2}.$$
The assumption of homoskedasticity is required in order to get proper estimates of the error variance and the ("normal", in contrast to "robust", see below) standard errors. Standard errors in turn are used to calculate confidence bands. So in case you cannot trust the estimated standard errors, you can also not rely on the confidence bands.
The problem here ultimately is, that given heteroscedasticity, you cannot tell if some estimated coefficient is statistically significant or not. Significance here is defined (95% confidence) so that the confidence band of some estimated coefficient does not "cross" zero (so is strictly positive or negative).
There are different options to deal with heteroscedasticity:

The most common solution is to use "robust" standard errors. There are different versions of "robust" errors (HC1, HC2, HC3). They all have in common, that they aim at getting a "robust" estimate of the error variance. Most software allows you to calculate robust SE. Find an example for R here.
Another alternative would be to estimate a "feasible generalised model" (FGLS) in which you first estimate the scedastic function (to get an idea of the distribution of errors) and you try to "correct" problems in the error distribution. However, this is not something you would use very often in practice. It is more an academic excercise.

Testing heteroscedasticity:
Usually, you would test if there is heteroscedasticity. You can look at the "residual vs. fitted plot" to get an idea of how the error terms are distributed.
However, a proper test can be done using the White or Breusch-Pagan Tests. Here is an example in R.
Comment: Thank you for answering, is it that the homoscedasticity and normal assumption are interlinked?
Comment: When the normality assumption $u \sim (0,\sigma^2)$ is met, you say that error terms are homoscedastic. Heteroscedasticity describes situations in which the normality assumption is not met.
Comment: Is it not that heteroscedasticity refers to variance being not same throughout the regression line?
Comment: Homoskedasticity is defined as: $Var(u|x)=\sigma^2$. See the OLS assumptions: https://en.wikipedia.org/wiki/Ordinary_least_squares. Having "non harmonic" variance at different values of $x$ can be a result of heteroscedasticity.


How to shuffle the order of if statements in a function in Python?

Question: I have a functions in Python which has a series of if statements.
def some_func():
    if condition_1:
        return result_1
    if condition_2:
        return result_2
    ... #other if statements

But I want that the order of these if statements is changed every time I call the function.
Like if I call the function there can be a case when condition_1 and condition_2 both are true but since condition_1 is checked first thus I will get result_1 but I want that when I call the function second time some other random condition to be checked. (since I have only five if statements in the function therefore any one of the five conditions).
So is there any way to do this like storing the conditions in a list or something.
Any help will be appreciated.
Answer: You can create list of condition and result then shuffle them like below:
import random
def some_func(x):
    lst_condition_result = [((x>1), True), ((x>2), False)]
    random.shuffle(lst_condition_result)

    for condition, result in lst_condition_result:
        if condition:
            return result

Output:
>>> some_func(20)
True

>>> some_func(20)
False

>>> some_func(20)
False

Answer: This one only evaluates as much as necessary, i.e., just as much as literally shuffled if-statements would:
def some_func():
    conditions_and_results = [
        (lambda: condition_1, lambda: result_1),
        (lambda: condition_2, lambda: result_2),
        ...
    ]
    random.shuffle(conditions_and_results)
    for condition, result in conditions_and_results:
        if condition():
            return result()

Or more efficiently (at least for large lists), reusing the same list every time and only shuffling as much as needed:
ifs = [
    (lambda: condition_1, lambda: result_1),
    (lambda: condition_2, lambda: result_2),
    ...
]
def some_func():
    for i, if_i in enumerate(ifs):
        j = random.randrange(i, len(ifs))
        condition, result = ifs[i] = ifs[j]
        ifs[j] = if_i
        if condition():
            return result()

Demo (Try it online!):
import random

ifs = [
    (lambda: x > 0, lambda: '> 0'),
    (lambda: x > 1, lambda: '> 1'),
    (lambda: x > 2, lambda: '> 2'),
    (lambda: x > 3, lambda: '> 3'),
]
def some_func():
    for i, if_i in enumerate(ifs):
        j = random.randrange(i, len(ifs))
        condition, result = ifs[i] = ifs[j]
        ifs[j] = if_i
        if condition():
            return result()

x = 2
print([some_func() for _ in range(10)])

Sample output:
['> 1', '> 0', '> 1', '> 0', '> 0', '> 0', '> 0', '> 1', '> 0', '> 0']

Answer: If you want to shuffle at run-time, then put your conditions and results as functions in a list of functions (once) and shuffle it (each time). Then evaluate those functions in that shuffled order until you get a non-falsy value (assuming the return statements always return a non-falsy value).
At the time of writing you did not provide a concrete example, so I'll work with this one:
def odd_or_multipleof3(n):
    if n % 2:
        return "odd"
    if n % 3 == 0:
        return "multiple of 3"
    return "neither"

Here odd_or_multipleof3(9) will return "odd", but when the if blocks are swapped, it would return "multiple of 3". To let the evaluation of blocks happen in a random order, so that you could get either of these return values, you could do this:
from random import shuffle

funcs = [
    lambda n: "odd" if n % 2 else None,
    lambda n: "multiple of 3" if n % 3 == 0 else None
]
def odd_or_multipleof3(n):
    shuffle(funcs)
    return any((result := func(n)) for func in funcs)  and result

print(odd_or_multipleof3(9))

This way of working will guarantee that conditions are only evaluated for as long as they don't return a truthy value, not more.