Trying to understand externality

Question: I am trying to understand about externality in simple words, the book is quite confusing. So I wanted to know how externality makes the demand curve or supply curve shift attached the below diagram for reference
Comment: If any of the answers helped you, please consider accepting it. Otherwise, you can ask for clarification.
Answer: There are just demand shifts (changes in quantity demanded) in your picture.
For education:
The better education, the more educated the work force, the economy will have more professionals, and generally be better of. Since anyone deciding to get educated does not take this into account, education is under allocated and overall social demand, considering this external benefit, would be higher than the actual demand in the market. The free-market allocation is therefore resulting in a deadweight loss, represented by the triangle.
Smoking:
Cigarettes are harmful to people and smoking in public (next to other people) causes a negative externality. Also, someone needs to pay for the health bills of smoker who get sick over time. There is no compensation for this spill over effect on third parties and the marginal benefit for the consumer is greater than it is for the society.
Both explain the same logic, just in opposite directions - namely that marginal social benefits are different from marginal private benefits because the decision to consume will (indirectly) impact others.
Edit
Social demand may not be used uniformly but there are sources that use the term social demand. After all, it is differences in quantities of demand that are the problem. A (normal market) demand curve represents the marginal benefit that accrues to consumers of the good - in other words, each point on the demand curve reflects the willingness to pay of the last consumer to purchase the good at the respective price. This does not incorporate the benefits to society though, which is why there is a social demand curve as well (which is the marginal social benefit curve).
For example Department of Economics University of California, Berkeley on P.4 where it is stated that

social demand = private demand + XB

where XB stands for eXternal Benefit.
Wikipedia

Similarly, there might be two curves for the demand or benefit of the
good. The social demand curve would reflect the benefit to society as
a whole, while the normal demand curve reflects the benefit to
consumers as individuals and is reflected as effective demand in the
market.

Also,
K. Härnqvist, Social Demand Models
In a nutshell, externalities lead to individual decisions that are not optimal for society. The two examples above are affecting the demand side. On the supply side, you can have too much production with negative externalities (pollution for example) because firms do not consider the costs incurred to society.
In economics jargon, in perfect competition, the industry supply curve is the horizontal sum of all the individual supply curves of producers in a particular industry, which in in turn correspond to the producers marginal cost curves. However, this marginal cost does not include external costs / benefits that production imposes on others.
If there is a mechanism that considers the external costs, production (hence) supply will be lower.
Ironically, you asked for simply words and ended up with a lot of jargon. Entire books are filled with this topic and its either too simple, so that it is deemed incorrect, or too complex so that it cannot be understood. Either way, it will likely not help you much. Therefore, I recommend you to get a copy of Economics: European edition by Krugman et al. which provides the basic theory to understand why marginal cost / marginal benefit relates to supply / demand in chapter 9, and discusses externalities in chapter 19.
The book is far from being rigorous, but written by a a winner of the Nobel Memorial Prize in Economic Sciences, who wrote in his book The Return of Depression Economics and the Crisis of 2008 that

ideas must be presented in a way that is accessible to concerned
people at large, not just those with economics Ph.D's. Anyway, the
equations and diagrams of formal economics are, more often than not,
no more than a scaffolding used to help construct an intellectual
edifice. Once that edifice has been built to a certain point, the
scaffolding can be stripped away, leaving only plain English behind.

I think he is very good at achieving this (especially in the book I recommended) and imho no one would be able to write a better answer here than the two chapters I referenced will give you.
Comment: I'm not sure that it is helpful in this context to use the term 'demand shift' or to describe social benefit as 'social demand'.  Do you have a reputable source for these usages?  Isn't the standard terminology here to equate private benefit with demand (ie market demand) and the second curve as just social benefit?
Answer: Each picture shows two different demands. One demand where people only consider private benefit and second counterfactual demand that takes into account also social benefits. This is not shift per se rather they are two counterfactual scenarios. Shift would occur if externality was not there before and then got introduced (let's say because of technological change).
With positive externality demand based on private benefit only will be lower. The reason for that is that at every price people ignore the extra benefit to society so they consume less than they would if the externality would be internalized.
With negative externality exactly opposite happens. People do not take into account negative effect on society. Hence at any price people will demand more of the good than they would otherwise do.
The whole counterfactual demand is shifted because the societal benefit and societal costs are ignored at any price not just particular price.
For example, if a liter of gas costs $p$ and the societal damage from pollution is $x$ then the total social cost of liter of gas is $p+x$. In free market you only pay $p$, but in a counterfactual world where the externality is accounted for you would pay $p+x$. If original demand was for example $Q=100-2(p)$ and counterfactual demand is $Q=100-2(p+x)=100-2p-2x$. As you can see if you plot this, this extra $2x$ will make the counterfactual demand be shifted down.

Trying to understand externality


Why doesnt Allah (SWT) destroy the Tyrants?

Question: I heard about a tyrant called Nimrood that challenged Allah and tried to fight the Almighty, but then Allah (SWT) sent a mosquito which killed Nimrood, why doesnt this happen to tyrants that try to challenge the Lord nowadays, i always hear that nations were destroyed for doing evil centuries ago, but there r still nations to this day that r still corrupt and evil, why doesnt Allah (SWT) destroy them just how Nimorood was desttroyed or how Sodom was destroyed, etc etc?
Answer: Every tyranny has an end, but if Allah started ending tyrants the moment they start then they won't be exposed and will never exist. It is Allah's discretion how long he keeps something and how long age he gives to it. From the perspective of those who are suffering from it; Allah can protect them from hardships even before start of hard times. But that is not the design of this life. This life is meant for testing of us humans and hardships are part of this life and even in this life hard times and tyrants imposed on us are because of our wrong doings.


Actionscript block until request completes

Question: I want to make a synchronous request to a server. I want the entire program to stop processing anything until the request is complete and the server has responded; what is the proper way of doing this?
Answer: You actually don't want the entire program to stop processing anything until the server responds, because this runs the risk that the swf could trigger the "Script has executed for 15 seconds" modal dialog warning to appear in front of your user, at which point you might as well consider your action a lost cause.  This is generally considered to be a "crash" and is "not a good idea."
What is it that you're trying to accomplish that you believe halting all execution (including rendering) will achieve?
If what you really want is to just make your application completely non-responsive to user activity during the request, then you might be able to get away with setting mouseChildren = mouseEnabled = false on your application's root movieclip.  If you need to stop the timeline animations, then you'll have to come up with a way to globally find / stop them all yourself.  Obviously, any enter_frame events you're listening for, or timers you're running should stop when you make the request.
You might be able to get away with setting the swf's framerate to 0fps in your code (it won't stop the timers, but probably will stop the enter_frames), but if you are writing a 3rd party module then this will definitely make the consumers of your swf very angry.
Answer: You cannot (and that is, in fact, good thing). Loading is done by player internal code which does not start until user code is finished for frame. That's why you can call Loader.load and add event listener for COMPLETE later.


Is is better to search for the stages of insight while meditating or to allow them to arise "naturally"?

Question: Are there differences between a person who progresses through insight while looking for the different stages and someone who progresses through insight ignorant of the stages? What are the pros and cons of each approach?
Answer:
Aware of stage - If you develop craving to move to the next stage this will make excessive Effort and Striving, which isn't balanced by Focus and Concentration, which will lead to Restlessness and Worry.
Unaware of stage - You might not know what is happening. Also you may not know what to do next.

So best is to balance both. Occasionally look into the stage you are, but not frequently. Perhaps once a month review would be OK.
NB: any stage of Insight Meditation happens naturally. You cannot force it. Trying to force if you will not reach the insight you are trying to achieve.
Answer: Anupada Sutta  where Buddha explained the enlightening process of ven. Sariputta.  Ven Saripitta had the insight DURING meditation. It is very detail. basically, Ven Sariputta (was a very detail oriented person) looked into each state of meditation and observed what features came to be and ended with each state of meditation on all levels, and with the last two, cessation and neither perception nor non-perception, one no longer has enough consciousness to pay attention to detail so he had to move in and out of these two states to see the truth. Ven, saw raise and fall and three marks of existence and achieve full liberation.
Answer: i'd think the difference as between people who travel by the map and who just roam
the second method of traveling might be more exciting, but it will take longer to get to the destination if ever


Raspbian 8 upgrade to Raspbian 9

Question: What were the specific changes in the communications or network settings between Raspbian 8 versus Raspbian 9?
Comment: Could you describe the specific problem that you have, or at least what you want to achieve and why do you think that changes in network settings would prevent you from achieving what you wanted?
Answer: Raspbian is based on Debian so a first look about changes from Debian 8 to Debian 9 you should have at What's new in Debian 9. For specific upgrades about Raspbian look at Raspbian release notes.
Answer: If you are having a specific networking issue it's better if you add a bit of context to help us with some context.
Off the top of my head only:

Added the predictable interface names option (configurable in raspi-config, disabled by default in some cases, e.g. dist_upgrade)
Quite a lot of new networking chip drivers

If you updated to 9 and your network/wifi stopped working you should verify if (1) is disabled with ifconfig (your interfaces will have weird new names).
If you are using an old raspbian8 SD in a newer Raspberry, you have updated to 9 but the network doesn't work, your problem is (2), you'll have to grab the missing interface firmware descriptors manually form raspbian's github.
Comment: `ifconfig` is deprecated you should use `ip` instead.

Raspbian 8 upgrade to Raspbian 9


Translation to Latin: "Forward engineering"

Question: I am looking for a new name for my engineering company. I want to translate the English phrase 'Forward engineering' into Latin language.
Answer: As luchonacho suggests, ars ingeniaria is good for "engineering".
To express the direction, I would add the adjective prorsus, meaning "straightforward, straight, direct" and giving rise to the concept of prose.
Thus, I'd suggest ars ingeniaria prorsa.
Prorsus is more common as an adverb, but it is also an adjective.
The kind of use of this adjective I proposed appears to be post-classical, but I did not consider that an issue as you did not specify an era.
I cannot think of an equally appropriate adjective that, say, Cicero would have used.
Answer: What about something like perge ars ingeniaria?
Perge is the imperative singular of pergo, which in the intransitive (without a verb, as in this case) means to "go on, proceed, hasten, press on".
Ars ingeniaria is the nominative Latin of engineering, according to Wikipedia.
Also see this post.
Comment: Hmm... I think "forward" in "forward engineering" should be parsed as an adjective, not as an imperative. Your suggestion sounds like the order "[go] forward, engineering!" rather than a name for a type of engineering. I gave an adjectival version in an answer.
Comment: @JoonasIlmavirta Oh, then I didn't understand the focus of the phrase. I was indeed trying to think on an imperative.


IP Ranges Question - Integration

Question: I have a custom .net integration where users log on via a c# component. I want to do away with the need for them to include their security token, so presumably i need to set up trusted IP ranges, they will all be office based when accessing via the API so no problem providing these ranges.
However, i still want users to be able to access from home/wherever they are and so cannot specify the IP range for all these locations. Anyway of achieving this?
Answer: Use OAuth, the interactive flows use the same device activation features/detection as regular browser logins, rather than the security token approach. see http://help.salesforce.com/help/doc/en/remoteaccess_authenticate.htm
Answer: *This answer is assuming you want to access salesforce over the web as normal *
One alternative for working away, is the security token as youve stated.
When you access from an unidentified location, you are challenged to prove via a  code which is sent to your email.
So when your users are accessing from outside the trusted network (non Api) and they get challenged, they get the Email me a verification code link. You can also set up your org to Text you the verification code in most countries.
Once you've entered this verification code, salesforce will set a cookie in the browser which marks it as recognised.
The next time your users login from the same location, they won't be challenged and will be able to login okay.
So this approach works if your users shuttle between a few fixed locations. However if its a different one each time, they will have to request a verification code which will need to be entered to proceed.
A word of caution about not accessing from dodgy locations!

IP Ranges Question - Integration


Pulled headset wire

Question: The mic on my headset has stopped working and I think it is because I pulled the wire that connects it from the setting panel halfway up the wire to the headset itself to hard. If I wiggle the wire I can hear something moving on the inside. The headset is a Kotion Each g9000. How do I fix this?
Comment: If the wire is broken or ripped off, the only reasonable thing you can do is buy a new headset. In theory you could open the headset, find the defect in the cable and solder it, but realistically the result will be subpar at best, if it works at all. Most devices are designed in a way that prevents you from opening them without breaking something.
Answer: The wires inside most headsets are extremely thin. I have tried to repair some in the past and have only succeeded once. You can try to cut out the dodgy bit and connect the wires up again but my honest opinion would be to buy new ones

Pulled headset wire


Carrier AC Air Handler Model #FC4DNF060 Filter Access Panel

Question:
I have a Carrier AC Air Handler Model #FC4DNF060.  The filter access panel is blocked as shown in the photo (at bottom of unit).  Has anyone had a similar situation or advice on how I might be able to access in order to change the filter?  Thank you.
Answer: Are you sure there is a filter there? Is there a return-air vent somewhere else in the house/office? The situation you show is common, but typically the filter has been relocated somewhere else in the return-air ductwork system.


Why C# get so related with .NET framework?

Question: Maybe there are VB.net and other language that related with .Net framework.
When I install the Visual C++ 2008 ,I have to install the .Net framework 3.5.
However,why people think .Net gets mainly related with C# language?
Answer: The easiest way of putting this is to compare it to the C languages. The C language is known as the "scripting language of the Von Neuman machine". It is this most expressive of what happens in the underlying machine code.
C# is basically the scripting language of the .Net framework. The .Net framework was designed with C# in mind as its main language, partially because Anders, who designed C# (also Turbo Pascal and Delphi in the past for Borland), was one of the main designers of the .Net framework.
The .Net framework was designed with having high language compatibility in mind, but C# will probably always be the language that is "closest to the metal".
Comment: Thanks.  I just edited and added quotes around it just cause it now sounds even better.
Answer: Because people love {curly braces}!
As the top three most popular programming languages are all curly-braced, it is easy for most programmers to understand and code C# quickly.
C# was also built from the ground up to be .NET language. While VB.NET, in my point of view, is initially created for the existing VB Classic programmers to move to .NET world quickly, and to expand the brand of Visual Basic which people know and love.
Answer: It's the most popular language used with .NET.
Answer: C# was a cleanly designed object-oriented language that runs with little or no impedance between it and .NET. At least VB was beginning to acquire quite a lot of signs of age, and to be quite frank there were some changes that had to be made to VB when introducing .NET that made a lot of people move on to newer technology.
Answer: C# was invented with object oriented programming in mind and .NET Framework relies heavily on OOP concepts. Also, C# was built along side .NET as the language it would primarily support it. .NET has been ported over to C++ and VB as a favor for developers stuck on aged projects.
VB.net is basically an upgraded version of VB that supports OOP but it's not natural because of the structure the original VB has. You'll notice that the syntax in VB will appear confusing or unnatural for complex OOP operations. This is very similar to what happened to C when it became C++.


How can I configure Touchegg on Ubuntu 14.04

Question: how can I configure touchegg on ubuntu 14.04 and use the gestures instead of unity gestures
I have Dell xps L502x and synaptics trackpad
Comment: I achieve my score with this:
http://askubuntu.com/questions/451386/how-to-achieve-multi-touch-gestures-in-ubuntu-14-04

Hope this is helpful,
Matteo
Answer: I have found a much easier solution: just create a file ".xprofile" in your home folder with the following content:
synclient ClickFinger3=0
synclient TapButton3=0

touchegg &

The first two lines are only needed if you want to use gestures with three fingers. If you leave them out, touchegg will only recongnize gestures with 4 or more fingers.
Alternatively, run the following command that does the same:
echo "synclient ClickFinger3=0
synclient TapButton3=0

touchegg &" > ~/.xprofile

Tochegg will also start on every boot. This worked for me on Ubuntu 15.04 and Ubuntu Gnome 15.04 and should work on any other Ubuntu version.
Answer: You can't override Unity's 3 and 4 fingers gestures just like that. From Touchégg's FAQ

Unity reserves to itself gestures with 3 and 4 gestures making impossible to Touchégg make use of it.

In this post, the author explains how to disable the buid-in gestures modifying Unity's sourcecode. Is written for Ubuntu 12.10 but some comments say that it works on 14.04 too. The relevant part for your question is (copy-pasted)

We obtain Unity sourcecode with the following:
sudo apt-get build-dep unity
cd /tmp
mkdir unity
cd unity
apt-get source unity

To disable its built-in multitouch gestures, we open the file
  /tmp/unity/unity-*/plugins/unityshell/src/unityshell.cpp with a text
  editor (e.g., gedit or Sublime Text 2).
After we locate the method UnityScreen::InitGesturesSupport() (line
  3381 for Unity 6.10.0, line 3287 for Unity 7.0.0), we comment all the
  lines starting with gestures_.
This is how it will look like:
void UnityScreen::InitGesturesSupport()
{
  std::unique_ptr<nux::GestureBroker> gesture_broker(new UnityGestureBroker);
  wt->GetWindowCompositor().SetGestureBroker(std::move(gesture_broker));
  /*
  gestures_sub_launcher_.reset(new nux::GesturesSubscription);
  gestures_sub_launcher_->SetGestureClasses(nux::DRAG_GESTURE);
  gestures_sub_launcher_->SetNumTouches(4);
  gestures_sub_launcher_->SetWindowId(GDK_ROOT_WINDOW());
  gestures_sub_launcher_->Activate();

  gestures_sub_dash_.reset(new nux::GesturesSubscription);
  gestures_sub_dash_->SetGestureClasses(nux::TAP_GESTURE);
  gestures_sub_dash_->SetNumTouches(4);
  gestures_sub_dash_->SetWindowId(GDK_ROOT_WINDOW());
  gestures_sub_dash_->Activate();

  gestures_sub_windows_.reset(new nux::GesturesSubscription);
  gestures_sub_windows_->SetGestureClasses(nux::TOUCH_GESTURE
                                         | nux::DRAG_GESTURE
                                         | nux::PINCH_GESTURE);
  gestures_sub_windows_->SetNumTouches(3);
  gestures_sub_windows_->SetWindowId(GDK_ROOT_WINDOW());
  gestures_sub_windows_->Activate();
  */
}

We re-build Unity .deb packages and install them in our system.
cd /tmp/unity/unity-*
dpkg-buildpackage -us -uc -nc
cd ..
sudo dpkg -i *deb
sudo apt-get -f install
sudo apt-get autoremove

Optionally, we may want to block upgrades to Unity packages. In this
  way, we do not have to repeat the patch steps every time an upgrade is
  released. However, we might miss important bug fixes.
What follows blocks updates to Unity:
echo "unity hold"|sudo dpkg --set-selections

After a logout and a login, we can see that (among the others) Unity
  3-fingers drag gestures has disappeared.

Another solution would be to get a different desktop.
Answer: I use Ubuntu 14.04 and did not need to make any changes on Unity. I remember last versions of Ubuntu it was a necessary step.
Below a video I did long time ago; however, as I said, I use Ubuntu 14.04 and just installed touchegg following this link (but not doing the Unity change part):
OS X-like multitouch gestures for Macbook Pro running Ubuntu
And my home made video showing that it works fine (even five fingers it is possible). The touchegg config file is in the video description.
Ubuntu 12.10 Multi Gestures (Pt) - Tutorial Link in English
Hope it works.
Comment: One more thing: install touchegg from the website.
If does not work, install via apt-get.
You wont have any issue with unity,
Comment: For ubuntu 16.04 I didn't need to modify Unity either. I've added installed from ubuntu repos 'touchegg' and added to the .xprofile the 'touchegg &' command


WSP for Site Definition does not show up when creating a new site

Question: WSP for Site Definition does not show up when creating a new site. I uploaded a new wsp under the solution gallery of the site collection. I went to a sub site and click on Create from "all content" and I dont see the site def (wsp) that I uploaded and activated in the solution gallery.
Answer: Site definitions can not be deployed as sandboxed solutions. You must use a farm solution. If you built your wsp in Visual Studio, you need to change the Sandboxed Solution property of your project to False.
Comment: A farm solution is not deployed to the solution gallery; that is only for sandboxed solutions. Farm solutions require Add-SPSolution/Install-SPSolution. If you are deploying through Visual Studio, look at the Ouput window to see what actions are being done for you. Depending on your deployment configuration in VS, you may need to activate your feature after the wsp is deployed.
Comment: it is set to False
Comment: Let me correct my previous comment. Your Site Definition in Visual Studio is probably just a mapped folder to your onet.xml file and webtemp*.xml file. There is no feature to activate.
Answer: In addition to your site template (onet.xml), you need either to add webtemp*.xml file or to include WebTemplate element in your solution.
WebTemplate element (recommended)
WebTemplate elements are added starting from SharePoint 2010. You can use features to add them to your portal, and this is the only approach which is avaliable for sandboxed solutions. Farm solutions can use WebTemplate elements too, of course.
Awesome article from Stefan Stanev about this:

SharePoint 2010 - WebTemplate feature

WebTemp*.xml
Farm solutions can use webtemp*.xml files for the same purpose. Actually, it is an old way to provision information for your web template (inherited from SharePoint 2007), so I don't recommend you to use it.
This file should be placed to {14 hive}\TEMPLATE\{LCID}\XML\ folder, where {LCID} is your locale ID, for example, 1033.
This could be achieved with SharePoint Mapped Folder.
File should contain XML code, for example:
<Template Name="ContosoBase" ID="10001">
    <Configuration ID="0" Title="Contoso Basic Site" Hidden="FALSE"
ImageUrl="/_layouts/images/contosoprev.png" Description="This template provides a standard site configuration
for basic Contoso sites." DisplayCategory="Collaboration">
    </Configuration>
</Template>

Additional MSDN articles:

Understanding WebTemp*.xml Files
How to: Create a Custom Site Definition and Configuration
Comment: wow. thanks for posting in details. I sure appreciate it. It helps.


Fisher's exact test for results of Wilcoxon-Mann-Whitney

Question: I have two groups of subjects (9 and 13 people). And data from two condition for this groups. In each condition for each subjects I have some measurements. But number of measurements are different for conditions (for second condition more then for first). First I use Wilcoxon-Mann-Whitney test for every subject to find subjects with significant difference between conditions. Second I use Fisher's Exact Test for understand is there significant difference in numbers of subjects with difference between condition for my two groups. Say, in first group 4 subjects show significant difference, and 3 in second. So my fisher's table is [[4,5],[3,10]].
Is this make any sense? and if so, Shall I use any correction for multiple comparisons?
Comment: Can you tell us more about your research design?  Is the following example more or less what you are doing?  You have two groups, say men and women.  You have two types of data for the men, say height and weight. You have the same two types of data for the women.  You want to know which are heavier, men or women. You also want to know which are taller, men or women.  Or is your design something different?
Comment: First of all, thank you for your attention. In term of your example, yes I have two groups - man and women. But I have one type of data, say blood pressure. I measured blood pressure n times for each subject. Then, say, they did physical exercises. And after it I again measured blood pressure for each subject, but m times. So m>n. I want to know in what group - man or women - chance of significant increase of blood pressure is more.
Comment: Perhaps adding some more details and context would make this question clearer.  For example, do you have repeated measures on each subject? How many Mann-Whitney tests did you do?
Comment: Yes I have repeated measures on each subject. But in second condition there are more measurements for each subject than in the first. I do 1 Mann-Whitney test for each subject. So it 9 for first group and 13 for second.
Answer: The two-stage approach seems to be "double-dipping" and is likely to result in an overall highly inflated type I error.
Answer: I assume you measured blood pressure (BP) multiple times before the physical exercise because you thought the BP measure is somewhat variable.  If so, you could average all the pre-exercise BP measures and get one more reliable value for each person.  As to the post-exercise measures of BP, you might do the same thing.  If you think the post-exercise measures of BP will slowly return to baseline, you might average the first few post BP measures for each person to get one, more reliable post-exercise BP value for each person.  At that point you will have one pre-exercise BP value (i.e., the before average) and one post-exercise BP value (i.e., the after average) for each person.  Then you can analyze the data in various ways.  One simple but effective approach is to calculate a before-after difference score for each person.  Then you can do a Mann-Whitney test between men and women on these difference scores.  (You could also consider using a t-test because it might have higher power, especially with your sample size.)  Good luck.
Comment: If you have a reason for not wanting to use average before and after scores, what is that reason?  Do you think you will get more power by using a Fisher Exact Test to detect higher rate of significant multiple Mann-Whitney tests?  I think it is likely that such a two stage approach has lower power than just doing a t-test on the before and after averages.  In any case, if you want to "use all the data" have you considered doing an AVOVA with subjects as blocks?
Comment: What are you hoping to learn with that approach?  What is your research question?
Comment: My research question is: how BP is changed and is any difference in this change between groups. But I want to use all data not just average. Because this approach yielded interesting, and slightly different results, and I try to understend is this method make any sense, or it is just an accident.
Comment: Thanks, but I already did so. What I am interesting is MU+Fisher approach. Is this method make any sense?
Answer: If you're getting different answers with your approach versus a more traditional ANOVA, then it's probably because each subject brings their own variability to the BP measurements.  ANOVA assumes homogeneous variances and lost information in your case.  Unfortunately, the MU-FE approach is conditional upon the alpha-level you're using to test the conditional difference; if you had compared the before-after using alpha=0.25, would you get the same FE result?  Your design appears to be a split-plot (whole plot=sex, subplot=before/after) aka repeated measures.  And you are interested in testing to see if there is a significant interaction between the two factors.  In this case, you maximize power by using all of the information.  The suggestion of using the MU on the differences is a good step, but it assumes the differences across the subjects are measured with the same accuracy.  Consider using a weighted t-test on the differences, where the weights are the sums of some (robust) measure of the before and after BP sample variabilities.  If the number of measurements is the same across subjects, then just adding these measures of variability will incorporate the difference in number of observations between before and after.  As long as the populations of differences are not too skewed, the t-test should provide a reasonably robust test.


AppleScript works wonders on its own but does not work when called from the plugin

Question: I know that using AppleScript cannot get access to the content of the newly created user-writing, so I use GUI Scripting. But I want Mail.app to contain its own button, which has added to the newly created files I send from my desired directory. I have a plugin for Mail.app have a script that is called by my own button. The script works wonders on its own, but it does not work when called from the plugin. What am I doing wrong?
error
{
NSAppleScriptErrorAppName = "System Events";
NSAppleScriptErrorBriefMessage = "System Events get error: Can not catch window 1 of process "Mail". Wrong index.";
NSAppleScriptErrorMessage = "System Events get error: Can not catch window 1 of process "Mail". Wrong index.";
NSAppleScriptErrorNumber = "-1719";
NSAppleScriptErrorRange = "NSRange: {0, 0}";
}

and script
property theMessage : ""
property allMessages : ""
property myPath : ""
property mySubfolder : "prettyAttachment"

tell application "AppleScript Utility"
    set GUI Scripting enabled to true
end tell

tell application "Mail"

try
    set allMessages to outgoing messages
    set theMessage to front outgoing message
end try

if theMessage is not equal to "" then
    tell application "Finder"
        activate
        set myPath to quoted form of POSIX path of ((path to downloads folder as string) & mySubfolder)
        set shellScriptText to "open " & myPath
        do shell script shellScriptText

        tell application "System Events"
            keystroke "a" using command down
            keystroke "c" using command down
            keystroke "h" using command down
        end tell
    end tell

    activate --mail.app

    tell application "System Events"
        tell process "Mail"
            --?set visible to true
            set allUI to every UI element of front window
        end tell
        repeat with anUI in allUI --as list
            set theRole to role of anUI
            if theRole is equal to "AXScrollArea" then
                set allSubUi to UI elements of anUI
                if (count of allSubUi) is equal to 2 then
                    --set focused of anUI to true
                    set value of attribute "AXFocused" of anUI to true
                    tell application "System Events"
                        keystroke "v" using command down
                        return true
                    end tell
                end if
            end if
        end repeat
    end tell
    end if
end tell

So for testing you can add some files to prettyAttachment folder in Download folder -> Open Mail.app and create message -> start script
But why didn't script work in xCode bundle?
Regards and hope for help.
EDIT1 also see Not able to Execute AppleScript within "Mail" application
Answer: Not very elegant solution, but it works. Although this is a pair of crutches in every way =)
I,m fired my script in my swizzle MailDocumentEditor class.
I removed from the script everything about focus to the body of the message and the method:
@interface MailDocumentEditor : DocumentEditor<...>{...}
...
- (EditingMessageWebView)webView;
...

and
@interface EditingMessageWebView : TilingWebView <...>{...}
...
- (BOOL)isActive;
- (void)paste:(id)arg1;
...

and all together
[[PrettyBundle sharedInstance] attachPrettyFiles];//fired first half of script (copy to clipboard)

MailDocumentEditor *prettyResult = (MailDocumentEditor*)self;
id prettyWebView = [pbResult webView];
[prettyWebView paste:nil];

that's all =)


How to calculate geocentric transformation to heliocentric coordinates?

Question: I have Sun data (lon+lat+distance) in geocentric coordinates:

but I want to visualize in heliocentric way. How to calculate that?
Answer: Earth's position as seen from the Sun is directly opposite the Sun's position as seen from Earth, at the same distance.
In ecliptic coordinates,
$$ \begin{align}
l_\oplus &= \lambda_\odot \pm 180^\circ \\
b_\oplus &= -\beta_\odot \\
r_\oplus &= \mathit{\Delta}_\odot
\end{align} $$
The heliocentric position of the Sun is always at the origin ($r=0$) by definition.
Comment: so, when i calculate geosentric, just skip L+180 and get heliocentric.
Answer: For some reason, I just saw this question only now… Maybe I'm too late, but anyway: Here goes…
To convert from heliocentric to geocentric and vice versa is more than just adding 180° to the longitude, because you're also changing point of view. You have to first convert your spherical heliocentric (or geocentric) positions into rectangular positions. This is done with the following formulas:
$ X = R\ \text{cos}\ B\ \text{cos}\ L\\
Y = R\ \text{cos}\ B\ \text{sin}\ L\\
Z = R\ \text{sin}\ B $
Where R is the distance to the object (which is lacking from your table; hopefully, you have the data somewhere else), B is its latitude, and L is its longitude.
Then you need to somehow find the heliocentric position of the Earth or the geocentric position of the Sun. Let's call those $X_0$, $Y_0$, and $Z_0$.
Then the geocentric (or heliocentric) position is found by $X_h = X + X_0$, $Y_h = Y + Y_0$, $Z_h = Z + Z_0$, which you can convert to longitude, latitude, and distance once again by:
$ r = \sqrt{X_h^2 + Y_h^2 + Z_h^2} \\
l = \displaystyle \text{atan2}\ \frac{Y_h}{X_h} \\
b = \displaystyle \text{asin}\ \frac{Z_h}{r} = \text{atan2}\ \frac{Z_h}{\sqrt{X_h^2 + Y_h^2}} $
Where atan2 is the second arctangent function that's available in most programming language, and which gives you the proper quadrant.
Hope this helps.


Where in microwave ovens things warm faster?

Question: I want my mug to boil as soon as possible and I prefer not to throw energy away. Where in microwave ovens things warm faster?
Comment: Be careful about using a microwave oven to boil water. If your mug is very clean and very smooth, and if the liquid contains no solid particles or significant dissolved gasses, then you can accidentally _[superheat](https://en.wikipedia.org/wiki/Superheating)_ the water.  Search YouTube for "microwave superheated water" to see examples of why that could be a Bad Thing.
Comment: Interesting that superheat thing. Now I understand why I always need to clean when I warm water in the microwave and then put rice in it.
Answer: Microwave ovens are designed to spread their energy around inside the oven chamber in the most uniform way possible, so that any food placed in them will get uniformly heated and cooked. This means it shouldn't matter where in the oven you place your mug when heating it.
Depending on the design of the oven, uniformity can be aided by something called a mode mixer which bends the microwave beam around in a variety of directions as it enters the oven chamber, and by the use of a turntable which rotates the food item around under the beam so it gets uniformly "illuminated".
You can map the uniformity of the microwaves in the oven if you want by covering the bottom surface of the oven with marshmallows and then turning it on until you first notice the marshmallows beginning to melt. The first ones to melt are sitting in a "hot spot" where the microwaves are concentrated.
Don't let this process carry on too long, for the melted marshmallows are messy to clean up!
Comment: Looks like a sweet experiment. I'll try it and bring some photos ;). Any bets? i would say corners will get melted earlier.
Comment: no bets! but have fun!
Answer: Consider the microwaves as a light. It is absorbed first at the surfaces. The plate rotates to make the light heat the water more uniformly. The oven walls reflect the light, so it is not lost.
Comment: Thank you. It don't really reflect ALL the light. And my microwave oven doesn't have turning plate.


Can I use my Nexus 4 charger to charge an iPhone 4s?

Question: I have a Nexus 4 charger (the block with the USB port on it) lying around. Can I use it to charge my iPhone 4s? Is it going to cause any trouble?
Answer: Because USB is a standard of 5V at 100mA increments, the charge should work without any problem.  Some chargers sadly prevent themselves from working unless you use their device with their charger.  You are much more likely to find a charger decides not to work with your phone than the charger will break your phone.


What is this tree/shrub growing in my front yard?

Question: I have this in some landscaping that came with the house when I bought it.  I have asked the neighbors and no one can tell me who the landscapers were that planted it, or what kind of shrub/tree it is.
Comment: This isn't Prunus laurocerasus, and  that red stem doesn't fit with Prunus varieties other than maybe P. lusitanica, but I'm not seeing the wavy edge to the leaves on that, and the leaves look too pale. What USDA zone  are you in, or where are you in the world?
Comment: I'm in south Louisiana, zone 9a.
Comment: In that case, it might be Arbutus unedo,  image below, but I'm not sure at all - do you know how long its been planted? http://www.jacksonsnurseries.co.uk/arbutus-unedo.html#/product/3054
Answer: It is a Photinia more likely the more common one available P x fraseri than P serratifolia. Often the one you'll find in most peoples gardens is variety called "Red Robin" The  bottom photo gave it away as its new growth is bright red and then later in the season it slowly changes to a mid green colour, often used for hedges and is evergreen.
Prunus laurocerasus has a very much larger leaf and the green colour is a light to mid green, plus the leaves are much larger, flower arrangement is also different and the branches at the base of the plant are much larger than Red Robin. Prunus lusitanica is the only other similar plant I know but again its colour is wrong and the flowers again are different- neither one has new growth that is red or red tinged- hope it helps
Comment: I have Photinia 'Red Robin' and this looks very similar if not the same.
Comment: After going through many images, I feel the Photinia 'Red Robin' is the correct answer.
Answer: This is Prunus laurocerasus or a closely related cousin.  It needs to be pruned, possibly the fertilizer adjusted, the bark on top of the bed removed.  This is a well used hedging shrub, a shrub that can be pruned to fit its unhappy environment to be happier.  It will do just fine.  Have you fertilized it ever?  How long have you been it's 'steward'...grins?  Is there a lawn close to this shrub where it has been getting fertilizer?
To get started I would prune the branches growing into the brick wall back to the main trunk.  Use alcohol on sharpened by pass pruners first.  Cut the top long leader down to the twelfth SET of leaves.  There is a third little leader to the right of your picture...that is the height and do the same with that second leader on the left side. Cut just above an outside leaf.
Let us know what the fertilizer is was how long ago before messing with fertilizer.  Get rid of that bark and get rid of the staking or ribbons.  There is absolutely no need for that at all and will weaken your shrub for withstanding snow load?
Show me what you've pruned and I can give you feed back from there, okay?


How to repair a fault in roof

Question:
We just found this dip in our roof that it causing rain water to leak through the wood directly under it. (It covers an open patio, not interior living space.) We'd like to make the repair ourselves instead of hiring a roofer, but I'm not sure where to start. The roof has asphalt architectural shingles and we live in the northeastern U.S. where we get a lot of rain, snow, and wind. Basically, our roof takes a beating so we need to make sure the repair is sound and will hold up in nasty weather.
Comment: Can you lift up the bottom shingles to see what's underneath? My bet is it's the gutters, but there's a myriad of reasons for this.
Comment: My recommendation is to use your neighbor's roofer. If you look closely at his roof you'll notice his gutter supports (spikes) are installed at about 24" oc.  Yours are about 36" oc.  In an area with, "lots of rain, snow and wind," this is important. Plus, I'll bet that roofer won't cut corners when he fixes your roof.
Comment: Our neighbor's roofer put holes in the roof to install the gutters which even if know is a big no-no. Any holes in the roof is an invitation for a leak. Regardless, that house is occupied by tenants and we do not know the owner.
Answer: This problem is likely caused by one of these things:

The wood roof sheathing under the sag area is rotted away eliminating the support for the shingles.
There is a gap between the sheathing edge and the rain gutter with no support for the shingles. Over time with heat and freezing cycles and winter ice build up the shingles has just sagged into the gap.
The rain gutter was installed too high on the rafter end fascia and it pushed up the tails on the lower course of shingles.

The fix needed to take care of the problem will require detailed analysis to determine the exact cause of the dished shingles. Once that is understood you can proceed with the proper fix.

How to repair a fault in roof


What are the key differences between controlled and uncontrolled airspace under the FAA jurisdiction?

Question: The FAA utilizes the ICAO definitions for class A-E airspace as controlled and class G as uncontrolled (class F airspace is unused under the FAA). What are the key differences between controlled and uncontrolled airspace in general?
Answer: This Document covers all the regs pretty well. But in short the key point on class G (uncontrolled) is

Although ATC has no authority
  or responsibility to control air traffic, pilots should remember
  there are visual flight rules (VFR) minimums which apply
  to Class G airspace.

Class G airspace also holds no specific entry requirements (aside from VFR minimums), no specific aircraft equipment (no radio, no transponder etc) and no minimum pilot certificate requirement (but you still need a license (one of a few varieties) you just don't need anything in addition like the instrument rating requirements for class A). On the contrary glass G airspace (uncontrolled) is not a free for all and you are not free to do as you please in some regards. While ATC has no reach into Class G the FAA does and you are still bound by the regulations the FAA puts forth that apply to class G airspace.
Likewise the definition they provide for controlled is

Controlled airspace is a generic term that covers the
  different classifications of airspace and defined dimensions
  within which air traffic control (ATC) service is provided
  in accordance with the airspace classification.

If you are wondering what the specific purpose of ATC is they define that as well,

The primary purpose of the ATC system is to prevent a
  collision between aircraft operating in the system and to
  organize and expedite the flow of traffic.
Comment: You might want to rephrase your comment about "no minimum pilot certificate", it makes it sound like you can go flying in class G with no certificate at all. The document you quoted actually says "no specific requirement", which also applies to class E (and C and D).
Answer: The shortest answer is: in uncontrolled airspace, you fly IFR without a clearance (and no clearance is available); in controlled airspace, you cannot fly IFR without a clearance.
That is the only real difference. Everything else (like weather minimums for VFR) follows from that.
BTW Class E is controlled airspace, and has no specific entry requirements for VFR either.


Where are the brachot written down?

Question: I hope this isn't an ignorant question, but I wonder if there is one place that all the b'rachot are written down, and if so, where is it? Are they all in the Mishnah?
Comment: Hello Tanya and welcome to Mi Yodeya.  Thank you for bringing your question here (which is definitely not ignorant!).  Are you looking for a common *source* for the brachot, or a *practical compilation* (what to say when)?
Comment: Most of them are in a Siddur.
Comment: http://www.nehora.com/birkhoth-eliyahu-guide-laws-of-blessing/
Answer: They are written down several places, along with their various rules.  The source for them (as well as reference to the various sources) is the sixth chapter (Keitzad Mevarchin) of the Gemmarra Tractate Berakhot, starting on page 35a.
The Ayin Mishpat Ner Mitzvah section of the page (found in the upper corner of the outer margin) will tell you where to locate the halakhot discussed on each page in the appropriate Jewish legal codes (which will also there have the Berakhot and their rules).
Comment: There are many blessings not sourced in the 6th chapter of Tractate Brachot, or even in Tractate Brachot at all.
Comment: I haven't ever learned _Ketzad M'var'chin_, and am astounded to learn that every single _b'racha_ is sourced there.
Comment: When you say the sources and references are in the 6th Perek, do you mean to say the Perek tells us the sources, or that the Perek is the (written) source?
Answer: In the book 'Birkhoth Eliyahu' the English version You will find all of them in Hebrew and English with transliteration. You can find there all the types of food + photos with their blessings
Comment: Hi Avi, welcome to mi yodeya, thanks for this answer. could you provide a link to the work you cite?

Where are the brachot written down?


How to fill these squares easily

Question: I have an array with holes that I have to fill with different materials. My question is there is an easy way to fill them directly? I tried array, array draft and it is annoying to adjust them. In Blender, it easy to select the vertices and fill. Maybe it is a stupid question, but I am not really an expert.
Comment: Have you tried sketching a new object in a hole and arraying that object? That way you can have separate FreeCAD bodies to export for printing
Answer: The problem
FDM printers slice models in STL or OBJ format. Neither of these formats can transmit properties like Materials: they consist fully of surface definitions.
But... Multi-Material printing is a thing, yes?
Yes, but Multi-material prints use a simple trick: a single STL object can contain more than one surface definition, and you can slice more than one STL at once. But since slicers usually can't separate these from one another, they usually load multiple STLs and define the materials for each differently. For example, Adalinda has 4 different STLs, some containing multiple chunks of material, each STL corresponding to one printed color. And in this video Joel explains how printing that way works for an older version of the MMU.
So, to print the "cubes" in a different material, you'd need to have two STLs: The grid as one export, and the cubes as another. Then the Rest is slicing.
Way around?
Now, you might not have a Multi-Material Printer? Then you might want to design your item in parts that snap into place or have an interference fit. For example, you might print a plate with all the cubes on one side, and a grid that has a relief on the back where the plate goes. Then you print two times with different materials and push the cube part into the grate, some glue in between, and voila! It looks like one print from the surface. With a clamshell design, you might even completely hide the existence of the carrier plate - by having two grates that surround a hollow cavity for the cube-plate, and the cube plate pushes out into either of the clamshells.
Comment: Thank you guys! I figured out the solution, I will share in the post shortly.
Answer: If you are asking for print then it is yes with FDM (fused deposition modeling) with multiple extrusion you can fill with different material easily. But if you are trying to change the material in your digital design then you need to work on every hole in the array, especially with FreeCAD. If you find any, please update here.

How to fill these squares easily


Difference between graph neural network and graph convolutional network

Question: Which characteristics my neural network (NN) model should have to be considered as a graph convolutional network (GCN) instead of a graph neural network (GNN)? I know that GCN is a variant of GNN, but what is the difference between these two types of NNs?
Answer: I think it's a reasonable claim that all graph convolutional networks are graph neural networks, since they operate on graphs, and are NNs. However, there are graph neural networks which don't use graph convolutions.
For example, graphRNN is a generative neural network for graphs where an RNN is given all the previous nodes and edges, and decides whether or not to add a new node/edges to the existing graph, or to terminate the generation process.


20 word recovery phase Metamask

Question: I had a problem with transactions from Binance to Trezor, namely, the amount transferred did not appear in the app. So I am trying to connect my Trezor hardware wallet to a third-party one like MetaMask to manage transactions from Binance. However, when I try to access MetaMask, it just gives me an alternative for 12,18 or 21 recovery phrases and not for 20 words, which I currently own. It seems strange to me that it would not account for different numbers of recovery phrases. Any ideas on the solution and maybe some alternative suggestion on how to manage transactions from Binance
Answer: You are not transferring funds to trezor or metamask or anything for that matter. The funds are transferred to ur blockchain address for which you own the private key. Metamask or Trezor are wallets helping you access it. If you sent funds from Binance and it hasnt reached your address, it has nothing to do with Trezor or metamask.
On the question of why you have 21 words in recovery is because when you created a Trezor wallet, you would have created a passphrase. It is one extra word added to the mnemonic seed phrase to create a new wallet for you. The normal browser wallets like metamask or trustwallet generally dont work with it since they cant decode the extra one word/letter like how Trezor would do.
Comment: So what is the issue if my tokens do not appear in the Trezor app nor in MetaMask. I searched for my transaction address in Etherscan and it shows that the transaction only happed through a Binance Smart Chain. This seems like the two are not connected, so how can I access these tokens?
Comment: Is it a token ? Trezor app doesnt show most of the tokens. But if the address has the tokens, means you have them.

20 word recovery phase Metamask


How to deploy GeoServer on WildFly

Question: I was deploy geoserver.war using WildFly, it can be deploy but the unzip file will be shown at TMP folder. Is there any way to change the path and make it unzip to "deployments" file?
Answer: If that you need is to change the data directory, you can configure this using this post.
http://docs.geoserver.org/latest/en/user/datadirectory/setting.html
On this section of the documentation of GeoServer, explained how to configure the data directory using another folder of your file system, you can establish the directory that you want to use.
If you deploy using standalone (my case), you cant add the JAVA_OPTS parameter on the file $WILDFLY_INSTALL/bin/standalone.conf.
<code>-DGEOSERVER_DATA_DIR=/folder/in/your/filesystem/geoserver/data
</code>
Comment: thanks @jbchurchill, I added some additional comments, i hope i have been clear.
Comment: Can you add some more background about what the link details? Short link-only answers are likely to get deleted. Also links don't always last forever.

How to deploy GeoServer on WildFly


Do I need to pay capital gains on real estate purchased in india from funds provided by my father?

Question: My dad purchased a flat for me in 2006 when I was an NRI, resident country USA. The money came from his bank account in India.  The title of the flat was always in my name. I would like to sell the flat. I am aware that I am liable for a 20% capital gains tax in India if I do not reinvest the gains in real estate again. My question is regarding declaring and paying the taxes in the USA. Am I still liable if the funds came from my father's account ? The goal of the U.S govt, it seems, was to ensure that US citizens paid a fair share of the profits for investments made through off shoring. In my case, the money never came from the U.S.A and it seems unfair to pay taxes to uncle SAM when it had no contributions in  how the money was made.
Answer:
Am I still liable if the funds came from my father's account ?

Obviously yes. The original money came from your father (and was  gift and I assume properly taxes). The profit from the sale is not "from your father" in any means - it is the gain in value in the years since purchase made on a flat in your name.
The devil now is in the details - double taxation agreements in particular. For which you WANT not to ask on the internet but talk to someone who can give you a qualified answer. Qualified not as in "random dude" but "somoene running a business and legally bound to compensate you for damages". "I asked on the internet" is a VERY bad reason not to pay fines if you get something wrong because of internet. "My accountant told me xxx" is a very valid answer that it was not your fault - and backed up by the accountant's liability insurance.
Comment: Thank you TomTom. I agree that I do need to get in touch with an account rather than rely on advice from internet. At the same time, I find it strange that uncle sam needs a share of the wealth that he had no hand in creating. My understanding that  these reporting needs came in only a few years ago.


freelance web sites: is personal opinion a good idea?

Question: I've noticed that there's a lot of questions that include names of freelance sites.  To my disappointment it's not many web sites.  My question is: whether positive or negative opinions, what does SE think of expressing opinions of freelance web sites?
Answer: I think that we should disallow recommendations of what site(s) to use, as it is easy to just answer with a list. That also makes the site quality go down as time goes on, unless the list stays updated, does not include spam, and is referred to often, instead of multiple questions asking the same thing.
If that's not what you're asking, then please edit your question to be more specific.
Comment: I thought of a few negative things about a couple of freelance sites.  I'm afraid to voice my opinion.  On the one hand they might improve.  On the other I don't have a strong client base and it could hurt me instead.  But your answer did the trick.  Also, the amount of time the question's been out there with only one response also speaks to me.  Thanks.
Answer: Instead of evaluating actual freelance websites, where the results are opinions and also information that may quickly become outdated, it's best to instead ask how to evaluate a freelance website.  This information would be useful for years to come, and it would teach not just tell.
If we teach people what to look for in a good freelance website, then they'll be empowered to do their own research, no matter how many of these sites come and go in and out of business.
Answer: I don't think the mention of any website should be needed. A question should be asked, and answered, without ever needing to mention any of these web sites.
If the question can't be asked or answered unless you mention the site, then I feel the question is off topic per the "not a support site for (website)" guideline.
The truth of the matter is, like all services, you'll find some users like it, some don't. I don't think it should be the goal of this stack to neither support nor detract from any other site specifically.


pdf font and graph formatting (win.graph)

Question: I recently came upon a problem in R which in that combination I have tried to solve and also searched for in the internet, but which I could not solve yet. I hope someone can help me.
I run R(x64) on Windows 7. The graphic device itself automatically uses Arial as font, and when I save graphs as bitmap the "font" naturally remains as it is. However, I prefer saving graphs as pdf, in which case the font in the resulting pdf is exchanged with Helvetica when I simply save via the GUI save button.
I found a solution for that in the internet, using the Arial afm-Files and pdf("Test_Auto.pdf", family = "Arial"), which resulted in a pdf using Arial as font---so far so good.
Now I also often have to/want to change the graph layout using win.graph, and that is where the problems start. Here is an example:
Arial <- Type1Font(family = "Arial", metrics = c("C:/R_Fonts/ArialPlain.afm", "C:/R_Fonts/ArialBold.afm", "C:/R_Fonts/ArialItalic.afm", "C:/R_Fonts/ArialBoldItalic.afm"))
pdfFonts(Arial = Arial)

setwd("C:/PDFCrop")
D1<-matrix(c(1,2,3,4,6,3),3,2)
D2<-matrix(c(1,2,3,5,3,1),3,2)

#pdf("Test_Auto.pdf", family = "Arial")
win.graph(8.3,12,12)
layout(matrix(c(1,2),1,2,byrow=TRUE))
plot(D1,type="l",main="Gobble R")
plot(D2,type="l",main="Gobble R")
#dev.off()

Now this code as it is works to create a graph that looks like I want it to look, but I have to save the graph manually (File->save as) and then I get Helvetica as font in the pdf.
Alternatively I can change the lower part in
pdf("Test_Auto.pdf", family = "Arial")
#win.graph(8.3,12,12)
layout(matrix(c(1,2),1,2,byrow=TRUE))
plot(D1,type="l",main="Gobble R")
plot(D2,type="l",main="Gobble R")
dev.off()

And that produces a pdf-file that actually uses Arial, but the graph has other dimensions as I was intending. When using both together I get a pdf which "cannot be opened because it does't contain any pages" (though it is not 0KB in size).
Is there any way to get this to work, or an alternative to win.graph which I can use between pdf() and dev.off()?
Thanks for you help.
Comment: Set the dimensions of the pdf device. Trying to mix two different devices seems a prescription for insanity.
Answer: Oh my god, I'm sorry, I was so stupid!
During all that I completely overlooked, that the pdf-device has its own size parameters.
Arial <- Type1Font(family = "Arial", metrics = c("C:/R_Fonts/ArialPlain.afm", "C:/R_Fonts/ArialBold.afm", "C:/R_Fonts/ArialItalic.afm", "C:/R_Fonts/ArialBoldItalic.afm"))
pdfFonts(Arial = Arial)

setwd("C:/PDFCrop")
D1<-matrix(c(1,2,3,4,6,3),3,2)
D2<-matrix(c(1,2,3,5,3,1),3,2)

pdf("Test_Auto.pdf", width=8.3, height=12, family = "Arial")
#win.graph(8.3,12,12)
layout(matrix(c(1,2),1,2,byrow=TRUE))
plot(D1,type="l",main="Gobble R")
plot(D2,type="l",main="Gobble R")
dev.off()

Thank you for the hint, DWin


Custom group in characters viewer

Question: I am trying to start with Gitmoji and so far it takes me some time to find the appropriate emoji in the Characters viewer on macOS. Is it possible to define custom group of characters? There is already Emoji, Arrows, Bullets/Stars. I am looking for a way how to add my own. I am not interested into workarounds like using Favorites group
Answer: The easiest way is to use each of the gitmoji emoji a bunch of times and then they will be in your frequently used list in the Emoji & Symbols picker.
The categories/groups are defined by Unicode as ranges of the character set. I am not aware that it is possible to define your own. There are no clues in CharacterPicker.framework.
You could also setup keyboard text replacements so you can type :apple: and it will be automatically replaced with . I use Alfred to do this, but you could use System Preferences > Keyboard > Text to do it.
You could also try Dash, a document viewer/browser, that can be configured to show a Gitmoji cheat sheet. I have assigned a custom keyboard shortcut for Dash to appear.

Custom group in characters viewer


Why does my controller stop working in GTA V after opening Steam overlay?

Question: I have GTA V for PC, bought through Steam.  I play with an Xbox 360 controller.  When I'm playing the game, if at any point I or the game opens a Steam overlay (be it the text input or the regular overlay), when I return to the game NONE of my inputs work anymore.  Not the controller, not my keyboard.  I can open task manager and close the game but the game just stops accepting input.  Has anyone else experienced this or know of a way to fix/prevent it?
Answer: Happens the same to me but i found the solution: When you are at the Steam overlay just go back to the first menu, and don't leave any other screen open. Then it will work again.
Seems to be some unsovled bugs with the Steam overlay.
Hope it helps :)
Answer: It could be because of more reasons:

The Steam overlay "keeps" the controls for itself - this could be considered a bug/glitch (report?).
The overlay is the active part - try terminating the program (Ctrl+Alt+Delete --> Task Manager --> Steam program --> end program (on Windows)) If it still doesn't work, I don't know.
Comment: That's a cool idea, I'll have to try that if I encounter it again.  I don't really play anymore :P


502 bad gateway in winginx+nginx

Question: I have joomla 3.x  installation along with few custom component and modules. admin part is working very well but on front side I receive 502 bad gateway error. I check the error log and found the error message given below.
upstream sent invalid header while reading response header from upstream, client: 127.0.0.1, server: hospital, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000"
Appreciate if anybody can help or provide a clue to solve it.
Thank you.
Answer: It uses 9054 port, simply edit following files in %WINGNIX%\conf:

template.vhost
nginx.conf
tools-phpmyadmin.conf

Replace port value with:
fastcgi_pass localhost:9054;

502 bad gateway in winginx+nginx


Ortho vs para alkylation of chlorobenzene

Question: I have a question to the solution regarding the product formed in a reaction with chlorobenzene with the use of (i) $\ce{CH3CH2Cl}$ and (ii)$ \ce{AlCl3}$. Since the -Cl substituent is ortho- para-directing shouldn't the answer then be a mixture of 1-chloro-4-ethylbenzene and 1-chloro-2-ethylbenzene? - I suppose that the para-orientation is the major product. But how is that determined?
Comment: Chlorine is $\sigma$ acceptor, thus para > orto. But in general orto/para orientation it poorly controlled and separation step is usually needed. Notable exceptions are reactions with sterically hindered orientants and and cases when both aromatic compound and active particle coordinate to the same Lewis acid. (acilation of phenols with TiCl4, for example)
Comment: https://chemistry.stackexchange.com/questions/47088/reaction-between-chlorobenzene-and-methyl-chloride
Comment: Thanks. The answers in the given link are very helpful. Though i still dont understand, why the mayor formed product is the para-orientation instead of ortho. Is the para vs ortho only determined experimentially? Because I dont know which orientation to choose in other excersises that include reactions with benzenes that have an ortho- and para-directing substituent.
Answer: In general para isomera are thermodynamically more stable than ortho isomers (except in cases when ther is hydrogen bonding in ortho isomer). There are several reasons:-
1. Steric hindrance makes para isomer more stable.
2.Benzene substituents rotate and change thier plane due to steric hindrance. It stops delecolaization of lone pair of electrons (if present in substituents) causing elevation in energy.
Both proper orientation (steric hindrance) and appropriate energy (temperature) is required for formation of product.
Para isomer satisfies these conditions readily and hence are major product.


Uninstall Haskell Platform

Question: I mispelled the Prefix, after creating the directory under /usr/local as haskell-platform (suggested by the instructions), as /usr/loca when I ran configure, but didn't notice until later.  Rather than leave a munged directory out there, I moved it to its proper location.  Of course, it all broke.  Turns out that /usr/loca is embedded all over the place.
I then Synaptic removed ghc6 (this is ubuntu 10.04, and the instructions day to run 6.12.1/2010.1).  When I reinstalled, it still thinks that the packages are on /usr/loca ???  I even removed package.cache, but it was recreated with /usr/loca in the file paths, even when I run configure with the correct path on /usr/local.
Where is this prefix coming from?  At this point, I'd just as soon get rid of the whole thing.  Where do I look for the bits and pieces to delete?  None of the wiki's or docs discuss how to get rid of this thing.  There seems to be an Uninstaller in the Mac distro, but none that I can find for *nix.
Answer: Old question, but the answer, I'm pretty sure, is that embedded paths were in the cabal config file in the <code>~/.cabal</code> directory.

Uninstall Haskell Platform


Set default value in a document library column via Powershell?

Question: I'm looking for a powershell script that allows me to set the default value for a column in SharePoint.
Thanks
Answer: The main point here is that you can work with SharePoint Object Model from PS.
So, your task is just to find out the way to change default field value using SharePoint Object Model, and translate it to PS notation.
The default value for a column in SharePoint object model is set using SPField.DefaultValue property.
So, let's try use this knowledge in PS. I have SampleList2 of type Contacts on my local SharePoint portal, and will try to change default value for a 'First Name' field.
Below is my PowerShell script:
<code>$w = Get-SPWeb http://localhost
$l = $w.GetListFromUrl("/Lists/SampleList2/AllItems.aspx")
$f = $l.Fields["First Name"]
$f.DefaultValue = "my default name"
$f.Update()
</code>
Let's try to create new item using GUI now:

Enjoy! :)
Answer: Check this blog post Use PowerShell to Manage Lists, Views, and Items in SharePoint on how to update SPListItem via PowerShell.
Sample:

We can assign additional values to
  fields as well. In the next example,
  we add values to the TextField and
  ChoiceField, which we created earlier
  in this example:

<code>PS > $spListItem["TextField"] = "Hey hey"

PS > $spListItem["ChoiceField"] = "First Choice"
#Finally, we use the Update() method to create the new list item:
PS > $spListItem.Update()
</code>


Should I use filter and compressor in FX Channel (aux send) in Nuendo?

Question: Is there really any difference if I put only reverb through FX channel or put compressor and filter through FX channel reverb?
Answer: It is not totally clear what you're asking. To my knowledge there is no such thing as a "reverb channel" in Nuendo. You have FX Channels ("aux sends") - and what you put on them is completely up to you and what you want to achieve.
Mostly temporal effects (delays and reverbs) are used on FX channels, because it makes sense to use them with several sources (traditional live setup: a hall or plate reverb and a tapped delay of some sort). On a DAW this also makes sense as this category of effects often are the most CPU hungry.
This does not mean you cannot use FX channels / auxes for other purposes. Parallel Compression is a popular compression technique. You put a hard comp on the FX channel and then send whatever you need beefed up a little to that channel. Parallel compression  ("new yorker compression") will preserve transients and mostly raise the more quiet parts.
Sometimes I've used subharmonic enhancers and similar "magic" plugins on FX channels too - and in general if I encounter a plugin without a Dry/Wet function I find FX channels/auxes a great help.
Because of the parallel nature, you should be aware of is comb filtering (weird phase issues) - in particular with non temporal effects. Sometimes in Cubase (and Nuendo also I guess) when a "glitch in the matrix" (or Cubase's rendering engine) occurs, I get an awful phased sound. I then stop and restart playback and it dissappears. Other hosts may be more or less suited for parallel non temporal effects - it is all about how they manage sample delay compensation for fx channels / auxes.
Comment: Thanks,I am sorry,I should have been more specific.Anyways,your answer is quite satisfactory.
Comment: I don't think I've ever noticed phase problems with aux channels in Cubase. I utilize them **a lot** along with group channels for non-temporal effects in my projects. Sometimes the routing gets crazy! I use pre-fader a lot too. I wonder if that would make a difference with minute delays. If it get's bad, the phase invert switch might help anyway.
Comment: @MarcW - It may be plugin related - the playback issue is not something I encounter often. I have tried a few plugins though that fail to report their latency correctly which cause such phase issues. When used as inserts i.e. in serial, there is no problem
Comment: Oh right. How do you know what latency the plugins are reporting?


xdg-open without an option to "remember"

Question: On a brand new Ubuntu 19.04, the latest chrome Version 77.0.3865.90 (Official Build) (64-bit) refuses to remember my selection. I'm trying to open a zoom URL, I'm getting the [Open xdg-open?] and just the action buttons without the checkbox to store my selection. I have removed ~/.config/google-chrome options in order to reset it but still same behavior
Comment: Did you find a solution. I've two machines with the same debian on and one is prompting without the option to remember too.
Comment: Well.. I know why it does that but I haven't found a solution. It's Google's stupidity I guess. They have disabled the checkbox to store your selection in version 77: https://support.google.com/chrome/thread/14193532?hl=en
Answer: Create following path and file:
sudo mkdir -p /etc/opt/chrome/policies/managed/
sudo touch /etc/opt/chrome/policies/managed/managed_policies.json

Open permissions for this file:
sudo chmod -R 775 /etc/opt/chrome/policies/managed

By default adding following content to this file should add the checkbox to remember your choice:
{
    "ExternalProtocolDialogShowAlwaysOpenCheckbox": true
}

This worked for all external website for me. For custom link, you may need to add those links to the whitelist:
{
    "ExternalProtocolDialogShowAlwaysOpenCheckbox": true,
    "URLWhitelist": [
        "telnet://*",
        "rvlink://*"
    ]
}

Same question on different community: Stop chrome from prompting when running external URL handler?
Comment: Probably works only for `https` sites?

xdg-open without an option to “remember”


Are Reform Jews heretics?

Question: Reform Jews believe in the messianic age but not specifically in a personal miraculous messiah. According to Rambam's 13 principles of faith, is this heresy? Are Reform Jews heretics?
Comment: Are you asking specifically on that principle, because they don't believe in Toras Moshe
Comment: Citation please that they believe in a messianic age. This has not been my experience with reform.
Comment: There are grounds to view them as heretics for other reasons, too - not believing in Torah min hashamayim, hence also not believing in prophecy. But one could also argue that they are tinokot shenishbu. The first Reformers - not, but today, probably so.
Comment: https://judaism.stackexchange.com/a/92863/13438
Answer: B"H
The question of "reform jews" being heretic would be no different from a specific Jew being heretic (choss vishawloym), there are rules for determining who is considered such, if those rules and conditions are not fulfilled, regardless of whether the Jew identifies as "reform" (whatever exactly that would imply) or not doesn't generally make a difference
In the Rambam, beginning of hilchos mamrim, the basic criteria for who is considered a heretic are given, and he explicitly excludes those who were raised and brought up in a heretical society
https://www.chabad.org/library/article_cdo/aid/1181854/jewish/Mamrim-Chapter-3.htm

A person who does not acknowledge validity of the Oral Law is not the rebellious elder mentioned in the Torah. Instead, he is one of the heretics and he should be put to death by any person.
א
מִי שֶׁאֵינוֹ מוֹדֶה בַּתּוֹרָה שֶׁבְּעַל פֶּה אֵינוֹ זָקֵן מַמְרֵא הָאָמוּר בַּתּוֹרָה. אֶלָּא הֲרֵי זֶה בִּכְלַל הָאֶפִּיקוֹרוֹסִין [וּמִיתָתוֹ בְּכָל אָדָם]:
2
Since it has become known that such a person denies the Oral Law, he may be pushed into a pit and may not be helped out. He is like all the rest of the heretics who say that the Torah is not Divine in origin, those who inform on their fellow Jews, and the apostates. All of these are not considered as members of the Jewish people. There is no need for witnesses, a warning, or judges for them to be executed. Instead, whoever kills them performs a great mitzvah and removes an obstacle from people at large.
ב
מֵאַחַר שֶׁנִּתְפַּרְסֵם שֶׁהוּא כּוֹפֵר בַּתּוֹרָה שֶׁבְּעַל פֶּה [מוֹרִידִין אוֹתוֹ] וְלֹא מַעֲלִין וַהֲרֵי הוּא כִּשְׁאָר כָּל הָאֶפִּיקוֹרוֹסִין וְהָאוֹמְרִין אֵין תּוֹרָה מִן הַשָּׁמַיִם וְהַמּוֹסְרִין וְהַמּוּמָרִין. שֶׁכָּל אֵלּוּ אֵינָם בִּכְלַל יִשְׂרָאֵל וְאֵין צָרִיךְ לֹא לְעֵדִים וְלֹא הַתְרָאָה וְלֹא דַּיָּנִים [אֶלָּא כָּל הַהוֹרֵג אֶחָד מֵהֶן עָשָׂה מִצְוָה גְּדוֹלָה וְהֵסִיר הַמִּכְשׁוֹל]:
3
To whom does the above apply? To a person who denied the Oral Law consciously, according to his perception of things. He follows after his frivolous thoughts and his capricious heart and denies the Oral Law first, as did Tzadok and Beitus and those who erred in following them.
The children of these errant people and their grandchildren whose parents led them away and they were born among these Karaities and raised according to their conception, they are considered as a children captured and raised by them. Such a child may not be eager to follow the path of mitzvot, for it is as if he was compelled not to. Even if later, he hears that he is Jewish and saw Jews and their faith, he is still considered as one who was compelled against observance, for he was raised according to their mistaken path. This applies to those who we mentioned who follow the erroneous Karaite path of their ancestors. Therefore it is appropriate to motivate them to repent and draw them to the power of the Torah with words of peace.
ג
בַּמֶּה דְּבָרִים אֲמוּרִים בְּאִישׁ שֶׁכָּפַר בַּתּוֹרָה שֶׁבְּעַל פֶּה בְּמַחֲשַׁבְתּוֹ וּבִדְבָרִים שֶׁנִּרְאוּ לוֹ. וְהָלַךְ אַחַר דַּעְתּוֹ הַקַּלָּה וְאַחַר שְׁרִירוּת לִבּוֹ וְכוֹפֵר בַּתּוֹרָה שֶׁבְּעַל פֶּה תְּחִלָּה כְּצָדוֹק וּבַיְתּוֹס וְכֵן כָּל הַתּוֹעִים אַחֲרָיו. אֲבָל בְּנֵי הַתּוֹעִים הָאֵלֶּה וּבְנֵי בְּנֵיהֶם שֶׁהִדִּיחוּ אוֹתָם אֲבוֹתָם וְנוֹלְדוּ בֵּין הַקָּרָאִים וְגִדְּלוּ אוֹתָם עַל דַּעְתָּם. הֲרֵי הוּא כְּתִינוֹק שֶׁנִּשְׁבָּה בֵּינֵיהֶם וְגִדְּלוּהוּ וְאֵינוֹ זָרִיז לֶאֱחֹז בְּדַרְכֵי הַמִּצְוֹת שֶׁהֲרֵי הוּא כְּאָנוּס וְאַף עַל פִּי שֶׁשָּׁמַע אַחַר כָּךְ [שֶׁהוּא יְהוּדִי וְרָאָה הַיְהוּדִים וְדָתָם הֲרֵי הוּא כְּאָנוּס שֶׁהֲרֵי גִּדְּלוּהוּ עַל טָעוּתָם] כָּךְ אֵלּוּ שֶׁאָמַרְנוּ הָאוֹחֲזִים בְּדַרְכֵי אֲבוֹתָם הַקָּרָאִים שֶׁטָּעוּ. לְפִיכָךְ רָאוּי לְהַחְזִירָן בִּתְשׁוּבָה וּלְמָשְׁכָם בְּדִבְרֵי שָׁלוֹם עַד שֶׁיַּחְזְרוּ לְאֵיתָן הַתּוֹרָה:

So the answer to the question is: it depends on each specific case
If one was brought up by aliens (idolatry) or in an idolatrous society and doesn't know, truly, what the Torah really means, even if s/he sees other people keeping it, then that person is not considered a heretic at all according to the above, even if they identify as a "reform" Jew
The case might be different for someone who definitely knows about the truth of the Torah and consciously denies Torah shibawl peh etc. like yushkuh or others from the earlier generations
Blessings and success
Comment: Thank you for your answer. So, it appears that "reform" Jews are not anus but shogeg (an inadvertent sinner).
Comment: @turk exactly, but again it would depend on the context, and it would depend on the exact meaning of a "reform" Jew, if someone grew up in the idolatrous society etc then it would be shoygayg regardless of it they consider themselves "reform", and on the flip side of someone truly knows about the Torah and anyways denies it choss vishawloym then he wouldn't be shoygayg, regardless it whether or not he calls himself (or others call him) a "reform" Jew
Comment: I see this point.
Comment: It's a dispute I believe between Rav Chaim Soloveitchik and Rav Elchanan Wasserman if someone who is a heretic without fault is still considered a heretic or not.
Comment: @robev *heretic without fault* an internal contradiction,  I don't believe that there's a dispute about this, I would have to see the original source for that statement
Comment: What's the contradiction @bluejayke? https://judaism.stackexchange.com/a/51126/1739
Comment: @robev the link says `I believe that the true explanation, as indicated by several of the sources quoted above, is that while the 'unfortunate heretic' is not a halakhic heretic for the purposes of wine and slaughter etc. he is still a metaphysical heretic.` and then goes on to explain the difference, but that is all complete speculation and not mentioned anywhere j the rambam or any other rishon as far as know, anyone who is a heritik regarding oyluhm hawbaw also forbids the wine, unless a distinction can be provided from the rishoneem, or even any other Torah, source, then it's not true

Are Reform Jews heretics?


Are there nonlinear operators that have the group property?

Question: To be clear: What I am actually talking about is a nonlinear operator on a finitely generated vector space V  with dimension $d(V)\;\in \mathbb{N}>1$. I can think of several nonlinear operators on such a vector space but none of them have the requisite properties of a group. In particular, but not exclusively, are there any such nonlinear operator groups that meet the definition of a Lie Group.
Comment: Are you asking "*are there any non-linear operators from $V$ to $V$ that are group homomorphisms?*" or are you asking "*are there any collections of non-linear operators from $V$ to $V$ that form a group?*" ?
Comment: I'm asking if there are any collections of nonlinear operators from V to V that form a group.
Comment: Does "nonlinear operator" have any particular meaning here I'm not aware of, or is it just an arbitrary map (of sets)? Pick your favourite three points in V, say a, b and c, and permute them around. (This is just a non-linear action of $S_3$ on V - you can do this with any group you like on any V that has enough points.)
Comment: Yes it does, billy. If V is our n-dimensional vector space,f is a mapping from V to V, and A & B are any 2 vectors in V,then f is *linear* iff f(A+B)=f(A)+f(B) which is called the superposition principle. A nonlinear map f from V to V is one where f(A+B)!=f(A)+f(B).
Comment: **[Now posted on MathOverflow](http://mathoverflow.net/questions/132692/nonlinear-operatorswith-the-group-property)**.
Answer: As some guy once said, dividing operators into linear and nonlinear is like dividing the world into bananas and nonbananas. If you're ignoring the vector space structure on $V$ then it's just a set, and you're just asking for a group action. It is easy to write down group actions, even Lie group actions (see homogeneous space), on a vector space that just don't happen to be linear. Probably the simplest example is $\mathbb{R}$ acting on itself by translation.
Comment: Based on Mr X's clarification in the comments, the $\mathbb{R}$ action on itself by left translation is "linear".  (Mr X, perhaps nonstandardly, doesn't mention scalar multiplication!).  That said, examples still abound.  Pick your favorite nonlinear automorphism $f$ (in whatever category you wish, so long as the category contains the linear maps).  Then conjugating $Gl(V)$ by $f$ will givea group of nonlinear things.
Comment: Er... no it's not?
Comment: Wow - I really shouldn't be doing math after midnight I apologize!  I can delete my whole rant if you'd prefer.  (And that would be my preference, but whatever.)
Comment: Thanks, Jason DeVito! And Quiaochu Yuan, I was asking for examples of nonlinear transformations on a vector space $V^{n}\;$ where n > 1. I'm aware that a nonlinear maps of the form $f:\mathbb{R}^{1} \to \mathbb{R}^{1} \;$ form a translation group.
Comment: Examples are just as easy to write down in the higher-dimensional case. Jason DeVito's comment works in all dimensions.
Comment: That's true Mr Yuan. As DeVito pointed you, you can conjugate a nonlinear transformation with a linear transformation from GL(V,n) and that forms a group. But I'll keep on lookin for one that has the group property by itself under some binary operation besides addition & multiplication. ;-)
Answer: Oh I've got one....
Let A by a non-singular, invertible square matrix whose elements are components of vectors in $V^{n}$. Now consider the operator $T(\hat{v}) = e^{A\hat{v}}, \; \;\forall \hat{v} \in V^{n}$. So if $\alpha,\beta$ are any such operators with corresponding  invertible non-singular matrices (A,B) respectively, than the binary group operation is $\phi(\alpha,\beta) = e^{AB\hat{v}} = (e^{A\hat{v}})^{B}$ where AB is the product matrix A*B. The inverse operator is $T^{-1}(\hat{v}) = A^{-1} ln(\hat{v})$.The identity mapping is $\hat{I}(\hat{v})= e^{ln(\hat{v})}=\hat{v}$.
Answer: How about the following construction. Let $M \in R_{d}(G)$ be a $d$ dimensional representation of some Lie group (e.g. $SL(2,R)$ and $V$ is some $d$ dimensional vector space. Now define:
$$
f(x,M,\epsilon)= \frac{M x}{(1+\epsilon w.x)}
$$
where the vector $w$ is chosen so that $w.M= w$ for all $M\in SL(2,\mathbb{R})$. Such vectors exist, for instance, if $d=4$ and $R_4(G)=R_2(G) \otimes R_2(G)$ then $w=\begin{pmatrix}
0 \\
1\\
-1\\
0
\end{pmatrix}$ is one such vector. It is now not too difficult to convince oneself that:
$$ \begin{eqnarray}
f(x,I,0) = x \\
f(f(x,M_1,\epsilon_1),M_2,\epsilon_2) = f(x,M_1 M_2,\epsilon_1+\epsilon_2)
\end{eqnarray}$$
so that the mapping $f$ is nonlinear and satisfies the group property.


Jenkins running at very high CPU usage

Question: I recently upgraded from Jenkins 1.6 to 2.5.  After I did this, I noticed very high CPU usage, sometimes over 300% (there are only 4 cores, so I don't think it could go over 400%).  I'm not sure where to begin debugging this, but here's a thread dump and some screenshots from top/htop
htop

top:
Comment: Profiling with [visualvm](https://visualvm.java.net/profiler.html) might reveal something
Comment: Did you upgrade all the plugins?
Answer: As it turned out, my issue was that several jobs had thousands of old builds.  This was fine in Jenkins 1.6 but it's a problem in 2.5 (I guess maybe Jenkins tries to load all the builds into memory when you view the job overview page).  To fix it, I just deleted most of the old builds from the problem jobs using this strategy and then reloaded jenkins.  Worked like a charm!
I also set the "discard old builds" plugin to keep only the 50 most recent builds, to prevent this from happening again.
Answer: Whenever a request comes in, Jenkins will spawn some threads to serve the request. After upgrading Jenkins, it might have invoked at high throttle at that time. Plz check the CPU and memory usage of Jenkins server while the following scenarios :

Jenkins is idle and no other apps are running on the server.
Scheduled a build and no other apps are running on the server.

And compare the behaviors which could help you out to determine whether Jenkins or running jenkins in parallel with other apps are really making trouble.
As @vlp said, try to monitor the jenkins application via JVisualVM with Jstad configuration to hook in. Refer this link to Configure JvisualVM with Jstad.
Comment: Additional info with this answer, If you are scheduling & running jobs on server itself, that too might cause some load on system. Then you have to offload the jenkins server from those jobs and move it to slave nodes and keep the executor value as 0 in the node configuration for the server.
Answer: I have noticed a couple of reasons for abnormal CPU usage with my Jenkins install on Windows 7 Ultimate.

I had recently upgraded from v2.138 to v2.140 plus added a few additional plugins.  I started noticing a problem with the Jenkins java executable taking up to 60% of my CPU time every time a job would trigger.  None of the jobs were CPU bound, just grabbing data from external servers, so it didn't make any sense.  It was fixed with a simple restart of the Jenkins service.  I assume the upgrade just didn't finish cleanly.
Java Garbage Collection was throwing errors and hogging the CPU when running with the default memory settings.  It was probably overkill, but I went wild and upped the Java Heap Space for Jenkins from the default 256mb to 4gb; which solved this problem for me.See this solution for instructions:
https://stackoverflow.com/a/8122566/4479786
Comment: Add some formatting to your answer, it will look awesome
Answer: 2.5 seems to be a development release, while 1.6 is their Long Term Support version.  Thus it seems logical that you should expect some regressions when using the bleeding edge version.  The bounty on this question is proof that other users are experiencing this as well.  The solution is to report a bug on the Jenkins bug tracker.  You can temporarily downgrade to the known good version for now.
Answer: Try passwing following argument to jenkins:
<code>-Dhudson.util.AtomicFileWriter.DISABLE_FORCED_FLUSH=true
</code>
as mentioned here: https://issues.jenkins-ci.org/browse/JENKINS-52150

Jenkins running at very high CPU usage