Find in all open TextEdit documents?

Question: Is there any way to find a string in all open TextEdit documents (rather than just one document?) I have hundred plus such open documents, unsaved.
Comment: @bmike, It's been my experience with unsaved **TextEdit** _documents_ that **Spotlight** doesn't always index them. It seems to be hit or miss. I don't have as many unsaved **TextEdit** _documents_ as the OP but often have a dozen or so. So the answer I wrote, I  saved it as an **AppleScript** _application_ and will use it if **Spotlight** does not find something I think is there.
Comment: I find sublime text more powerful for that. If you have Xcode/ vscode, add all of them to one project and it can search everywhere. If none of them, use grep (can't say about unsaved files there .)
Comment: Why wouldn't you save a document and then use spotlight to index it? I really appreciate you putting this out, but it seems like unless TextEdit is saving the work without asking and you can search in spotlight anyhow this is really something you might change how you work. Great technical question - just not sure it's practical or would help many. +1 for novelty in my book
Answer: The following example AppleScript code when run from Script Editor, or saved as an AppleScript application, will present a search string dialog box for you to type in the search string.
If a match is found, it then creates a new TextEdit document with the name(s) of the document(s) containing the search string. If no match is found, it displays a dialog box with a message.
if running of application "TextEdit" then
    tell application "TextEdit"
        set docCount to count documents
        if docCount is greater than 0 then
            set searchString to ""
            repeat while searchString is ""
                set searchString to my getSearchString()
            end repeat
            set documentNamesList to {}
            repeat with i from 1 to docCount
                if text of document i contains the searchString then
                    copy name of document i to end of documentNamesList
                end if
            end repeat
            if documentNamesList is not {} then
                set AppleScript's text item delimiters to linefeed
                set documentNamesList to documentNamesList as string
                set AppleScript's text item delimiters to ""
                set docText to "The following TextEdit documents contain the search string: " & ¬
                    searchString & linefeed & linefeed & documentNamesList
                make new document with properties {text:docText}
                activate
            else
                display dialog "No documents found containing the search string: " & ¬
                    searchString buttons {"OK"} default button 1 with title "No Match Found"
            end if
        else
            display dialog "There are no open documents to search..." buttons {"OK"} ¬
                default button 1 with title "No Open Documents"
        end if
    end tell
else
    display dialog "TextEdit is not open..." buttons {"OK"} default button 1
end if

on getSearchString()
    return text returned of (display dialog ¬
        "Enter the search string:" default answer ¬
        "" buttons {"Cancel", "OK"} default button 2 ¬
        with title "Search Open TextEdit Documents")
end getSearchString

Note: The example AppleScript code is just that and does not contain any additional error handling as may be appropriate. The onus is upon the user to add any error handling as may be appropriate, needed or wanted. Have a look at the try statement and error statement in the AppleScript Language Guide. See also, Working with Errors. Additionally, the use of the delay command may be necessary between events where appropriate, e.g. delay 0.5, with the value of the delay set appropriately.
Comment: Brilliant logic, I'm hoping TextEdit always saves the text and spotlight searches it, but I could see spotlight avoiding the temp storage space where these all are saved until OP gives a document a name other than the one that's generated when a new app opens by the system...

Find in all open TextEdit documents?


Packaging java web application as exe

Question: Are there any free tools using which I can package my war (java web app) and tomcat as exe
Answer: We distribute our web application Kunagi as a .war, a debian package and also as a windows .exe. The windows versiont works as follows:
The .exe is created by a tool which exists on all windows machines, called iexpress. It is just an archive which is executable. On execution it extracts itself into a temporary directory and then executes a predefined command in this direcotry.
So wie pack a minimal embedded Tomcat (just 5 jars) into it, together with Katokorbo.
Katokorbo is a simple Swing application which downloads a war from the web and starts it with the embedded Tomcat. It also checks for new versions of the webapp on startup, asks the user if he wants to upgrade, starts a browser with the webapp and provides a gui to the user to view log output and for stopping the whole thing.
Answer: Maven can do that (http://maven.apache.org/) and I think Ant can too.

Packaging java web application as exe


Looking for hosting company

Question: I am looking for hosting providers and would like recommendations as well as any horror stories about you to avoid.
Comment: Can you provide more details? Which CMS? What sort of scale? What budget constraints/goals? What kind of access (e.g. developer access vs. only web interface/admin).
Comment: To reinforce what Alan says, you really need to say what level you want to host at. For example do you need CiviCRM expertise from your provider or are you just wanting them to provide a reliable and efficient environment?
Comment: I agree with the comments above. It really depends on what you're looking for. We host a number of Civi sites, but they are often ones we're also doing the maintenance on for Drupal and Civi, so we're the 'superadmin' on their sites. But if you're looking for just basic hosting, the pricing for someone like us might be more than you're wanting. So really the first step is to have a list of what you're looking for.
Answer: The top two complaints we hear the most from organizations about their previous providers are:

lack of responsiveness/customer service to inquiries.
consistency in maintenance and updates.

When we take over hosting and maintenance services, we try to identify any technical debt that exists so it can be addressed as early as possible in the engagement.
I recommend paying attention to what sort of site/code audits the provider does upfront. It will likely save you in the long-term and start everyone off in the relationship with better and more information.
Answer: There is a list of CiviCRM Partners who provide hosting among other services here
https://civicrm.org/partners-contributors?country_1=All&services=Hosting&language=All&cms=All
Comment: Ha! you snuck in while I was still composing!
Answer: CiviCRM tends to place higher demands on hosting than most extensions/plugins/modules, so a common recommendation is to avoid generic shared web-hosting packages and instead look for something that specifically claims to support CiviCRM.
You can find a list of those offering hosting for CiviCRM here.  Do note those are not recommendations (actually, there are some there I would avoid), but they do at least claim to offer support for CiviCRM.
Note that some only offer hosting as part of a bundle of other services whereas others provide hosting for anyone without further obligation.
There are horror stories, but you may not get people giving specifics here.  You are more likely to get those if you ask in person at a CiviCamp or similar!
As already said in the comments to this question, if you provide more details about what you are looking for then we may be able to guide you more specifically.  However, one long-time specialist hoster of CiviCRM offering a range of provision who I have had good experience with is CiviHosting.com (They seem to have fallen off the list above, but there is a note saying the listing is undergoing 'revision and repair'.)

Looking for hosting company


How to set a constant opacity with the Pen tool in Photoshop?

Question: How to change the opacity of the shape pen tool in Photoshop without always having to go and click on the new shape? Every time you create a new shape the opacity goes back to 100, then I read that you can create a group and they stay the same opacity but then the color stays the same on all the shapes.
I am trying to vector a very detailed pen drawing and need the shapes to be low always so I can see the lines I am following in the layer underneath, but there must be a way to set the opacity low constantly to avoid always having to change the new shapes opacity.
Comment: If I remember correctly, select the previous layer created by pen tool, it should keep the same feature as opacity.
Answer: If you don't want to draw your shapes under a group and set the opacity for the group once, you don't need to click on the layer every time. Opacity uses as default shortcut the number keys (1 to 0).
Press 1  to quickly set the opacity to 10%, 2 for 20%, etc. If you want to be more precise, quickly type 2 digits (type 0 7 to set it to 7%, for example).
There's no way to set the opacity of the shape before it is created, because it uses the default 100% layer opacity.


What's that limit, where we start to see infrared galaxies?

Question: All the nearby galaxies we see come in visible range, many are visible from ground based telescopes. And the farthest galaxy that hubble discovered recently, 13.4 billion light years away is in infra red.
Was this Galaxy ever in visible part of spectrum?
How long will it take galaxies like andromeda or whirlpool to go infrared so that they won't be visible to us if we are not using in infraRed lens?
What's the specific limit where the light makes transition from visible to infrared part of spectrum?
Comment: Andromeda and the entire local group will never go infra-red because Andromeda is moving towards us and is due to collide with the milky way in 4 billion years and the entire local group is gravitationally bound.   I'm not sure at what distance galaxies are no longer bound to us and likely to move away via dark-energy.
Comment: Actually you pose the question how big is the visibly (wavelength in Vis) observable universe. I think that because of what @James K said, it coincides with the observable universe, ie till cosmic background.
Answer: Galaxies give off a range of frequencies of light: Visible, but also infrared, microwave, and radiowaves. at longer wavelengths, ultraviolet, Xrays and gamma rays at short wavelengths. But stars give off quite a lot of their radiation in visible light, so nearby galaxies are quite bright in visible light and rather less bright in Ultraviolet.  The cutoff between the types of light is somewhat arbitrary, but usually a wavelength of longer than 700nm is considered to be infrared, and shorter than 400nm is ultraviolet.
Very distant galaxies are moving away from us due to the general expansion of the universe. This means that the light is stretched. Visible light gets stretched to infra-red, ultraviolet gets stretched to visible light. The distant galaxy is very very far away, and so very dim. It is a little bit brighter in infrared, although there is also a little visible light (and other wavelengths too)
Galaxies never go completely invisible in visible light, even if they are red-shifted, because there is always ultraviolet light to red-shift to visible.
However, ultraviolet is an ionising radiation, and the early universe contained a lot of neutral Hydrogen. This Hydrogen can absorb ultraviolet light.  This would make very early galaxies appear dark in the ultraviolet.  Except, due to redshift, that ultraviolet would have been stretched to visible light by the time it reaches us.  This makes them dark in visible light.  This is called the Lyman break. Lyman-break galaxies are more distant than about z=3 (21 billion light years), but Lyman break galaxies with z>7 (30 billion light years) are mostly redshifted to infra-red, and are very dim in visible light.
So the galaxy did emit light in the visible part of the spectrum. The fact it is now only visible in the infrared is a result of redshift and the Lyman break, not because they only emit infrared light.
Galaxies like Andromeda are so close that they aren't part of the general expansion of the universe, so they will never be redshifted to invisibility.
Comment: I wanna know about the distance limit from earth not particularly about the wavelengths.


MSI Parameter Inspection

Question: With a windows MSI file, is there a way to grab all the possible installation parameters in .NET code? I need to make a generic user interface to configure multiple MSI files not known until run-time – then install them together in one go.
Answer: Windows Installer packages are database that can be easily reflected.  WiX DTF has a Microsoft.Deployment.WindowsInstaller namespace with classes that can accomplish that.   From there you just write your .NET code to handle all your requirements and just be very reflective/plug-in oriented in the way you do this.
There are some bootstrapper projects out there (CodePlex) that do this but use pre-generated XML files to describe the MSI's.
Answer: As technically you can provide any public property on the command line, no. You could also update private properties using a MSI transform. You can enumerate existing properties (public or private), but there is no way of knowing what the installer itself does with them.
If you want to know how, download the Windows SDK. Included are a very large number of VBS scripts which show how to use the Windows Installer API. From there you can just use normal SQL, e.g. Select * from Properties
Comment: That's fine - I just want to know how to enumerate them. Any ideas?

MSI Parameter Inspection


Help, I am not able to delete a post

Question: I want to delete my post with a bad reputation and I am getting warnings about being blocked. Here's a link to it Why are badges not awarded as soon as we do a good job?
Comment: @rene: this is far more about warnings than it is about deletion.
Comment: @rene: and it lists *why* the user wants to delete in the question body. Always read the whole question!
Comment: I figure it's about both question deletion **and** concerns of being blocked
Answer: You are not able to delete a question that has a positively scored answer - refer to How does deleting work? What can cause a post to be deleted, and what does that actually mean? What are the criteria for deletion?, particularly in the answers:

When can't I delete my own post?
You can't delete answers that have been accepted.
You can't delete any question that:
has an upvoted answer, or has multiple answers (even if there are no
  upvotes) You can't delete any of your questions or answers if you
  haven't registered your account (that is, associated an OpenID with
  it).

Best to read and act on any information (if available) from the warnings.
If you feel strongly about it, flag your post and select 'Other' and write a message for moderator review - then it is up to them to decide what to do.
Deleting answers still count towards question bans, but one question won't necessarily invoke it.
Answer: You won't be question banned for that. The question ban algorithm on Meta has been severely tweaked to prevent banning over a few negatively-received questions.
Meta is a place for discussion and support, and as such voting works differently.
The warning system on the other hand has not been adjusted (yet). You can safely ignore those here.
Note that even if you deleted your question, it would still count towards a question ban anyway, only now you can no longer improve it to try and attract upvotes!
Answer: A few things to remember:

Question bans only apply on a per-site basis. Your one post getting downvoted won't get you a ban and even if you did get one eventually it would only apply to Meta.SE not any other sites.
While apparently the warning messages are displayed here at the same point as other sites the actual limits for getting a ban are much higher. That's so people don't have to fear being blocked if they post the odd unpopular feature request or similar.

So in general don't worry about it.

Help, I am not able to delete a post


What's the difference between protein and DNA behaviour during agarose gel electrophoresis?

Question: I'm planning a science project about gel electrophoresis, and I'd like to know if there are any measurable, quantifiable (for example, things I could represent in a graph or chart) differences between the behavior of protein and DNA during agarose gel electrophoresis.
Detailed inputs and useful links are greatly appreciated.
Comment: As already mentioned, you don't use agarose for proteins, they're pretty much exclusively run on polyacrylamide gels, typically as an SDS-PAGE. I've never seen anyone run an agarose gel of a protein.
Comment: Proteins are usually not run on agarose gels since the pores of the gel are too big to have a good separation. A 1% agarose gel has pores of around 150nm, poly acrylamide (which is usually used) have 3-6nm depending on the degree of polymerisation and gel strength. You will only use agarose gels for really high molecular weight proteins otherwise you won't see much separation of the sample. DNA samples have such a high molecular weight and can thus be separated on agarose gels.
Comment: @Chris One of the requirements of the project is to run several simultaneous experiments while changing one variable only (in this case, it's the protein/DNA). I'm separating proteins in dyes, which would explain the use of agarose.
Comment: What do you mean by "separating proteins in dyes"? Another thing: While you can't separate Proteins nicely on agarose, you can use low percentage polyacrylamide gels to separate DNA.
Comment: @chris Excuse the typo. I meant that electrophoresis will be run on food coloring dyes... you know... which are made of proteins
Comment: which food coloring dyes will you be using? Most of them are based on small molecules, not proteins.
Comment: Thats in interesting question. I think so too, that these are mostly not proteins, since most proteins are not colored.
Comment: @MadScientist I'm fairly new to this (I'm only a high school freshman) and so haven't done adequate background research on the subject. I was just asking this question to see if such a project fits the required criteria and thus actually conduct a research. I'll consider polyacrylamide, though it's way more expensive and harder to find (I doubt I'll have access to the school lab or that they even have it).
Comment: I'd recommend to simply focus it on DNA and ignore proteins. You should also find out what equipment is available, you need a gel electrophoresis chamber (and they are different for agarose and PAA), power supply, the gel material itself (+ APS and TEMED for PAA), buffer, loading dye, something to stain the DNA or protein, and in the case of DNA also a UV lamp.
Answer: There are two important properties that determine how a molecule will move during gel electrophoresis:

size and shape of the molecule
charge of the molecule

You're applying an electric field, and all molecules will move according to their charge. The gel itself hinders the movement of larger molecules. This means that small molecules will move further than large molecules.
Nucleic acids like RNA and DNA have a uniform negative charge from the phosphate backbone. This means that they will generally separate according to their size and shape (plasmids can be present in different forms like supercoiled, circular or linearized).
Proteins have different charges, some have a positive charge at the pH typically used for gel electrophoresis, some have a negative charge, and some have no charge at that pH. So if you would simply run proteins on a gel, some would move backwards, some forward and some not at all.
To make the proteins separate according to their size we use the detergent SDS to denature the proteins, and to give them a uniform charge (SDS is negatively charged). Proteins are also run on polyacrylamide gels and not agarose as the size of the pores in agarose is a bad fit for the typical sized of proteins.
While I've never seen anyone using agarose for proteins, it seems that it is possible and sometimes used for larger proteins. I found one paper describing a protocol, they used very high concentrations of agarose in the range of 4-5%. I suspect that they won't handle well, but you should try that out yourself. If the proteins you're examining are a bit larger, using agarose should be possible.
Comment: Just a small addition.. Agarose pore size is huge for most proteins. However, agarose gel is used for analyzing antibody-antigen interaction. The complexes that form are huge and can be separated by AGE. See [rocket immuno-electrophoresis](http://en.wikipedia.org/wiki/Immunoelectrophoresis)


Is it possible to have two different Perl versions?

Question: Currently I have Perl 5.8.8. Can I update to Perl 6? I am using Red Hat Linux 5 OS. Is it possible to upgrade Perl on Red Hat Linux 5 or any other OS? If yes, how can I do that?
Answer: I'll try to articulate an answer that addresses all your requests, HTH:

I wouldn't touch system Perl, because other system software might depend on a particular version. If you need a different version of Perl 5 for development, it's arguably better to install it in a controlled, isolated environment
To do so you can use tools like Perlbrew: with Perlbrew you can install distinct versions of Perl 5, and you'll be able to switch back and forth according to your development needs
You say you want to "update to Perl 6". Perhaps you noticed I wrote Perl 5 in the previous paragraphs. Perl 6 is not just a new version of Perl, but a profound evolution of the language: it stems from the same core principles, but it is quite different from its older sibling. Code written in Perl 5 won't run in Perl 6, for example

To sum up:

You can have both Perl 5 and Perl 6 on your system, but they are distinct languages
You can have multiple versions of Perl 5 using Perlbrew
I would suggest not to tamper with the version of Perl distributed with the OS
Comment: @Vicky There are [224 matches of 'excel'](https://metacpan.org/search?size=500&q=excel) among the 30,000+ free packages (170,000+ modules) on CPAN. One or more of these should do what you want to do. Use cpantesters to see whether a particular module that looks good "on paper" is likely to actually work out for you in practice. For example, I see 6 passes out of 6 for [Excel::Writer::XLSX tests on 5.8.8 in today's cpantester results](http://www.cpantesters.org/distro/E/Excel-Writer-XLSX.html).
Comment: Thanks larsen , the reson I am looking for a differenct version of Perl is that I want to work with Excel file in Perl (create , read and write )  but my system Perl that is v5.8.8 does not seem to have any module for that , Would you be able to tell since which module Perl5 included utility for Excel files?
Comment: As far as I know, Perl 5 distribution never included among the core modules a library parse/write Excel files. There are plenty on CPAN, tho': my personal favourite for writing Excel files (should I say I'm lucky that I seldom have to parse them?) is [Excel::Writer::XLSX](https://metacpan.org/pod/Excel::Writer::XLSX)
Comment: @Vivky It's a good idea to tell people what you want to accomplish rather than how you are trying to do it. :)
Answer: Perl 5 and Perl 6 are really different languages that share a name. Installing Perl 6 will not overwrite your Perl 5. I'm guessing that you don't want Perl 6 and instead want the latest version of Perl 5 (v5.26 was just released). You might consider updating everything to something recently released, including your OS ;)
If you're curious what your package manager is going to install, you can see the list. Perhaps How to list the contents of a package using YUM? is interesting for you.
Aside from the system's installed Perl 5, you can download, compile, and install other versions of Perl5 to any location you like. I have all the perls installed, for example, and the system perl is still there.


Malformatted parentheses

Question: Update: StackExchange is still using MathJax v2.7.5, while the current release is v3.2 and has corrected some of this sort of rendering error.  So this report may not be of interest to anyone.

Davide Cervone says this is a good place to report MathJax rendering bugs, so I am doing that.
https://math.stackexchange.com/a/1309167/25554 contains the formula

|x-x_0|<(n+1) \left | \frac{f^{(n)}(\xi_{n-1})}{f^{(n+1)}(\xi_n)} \right |

which rendered as

My browser is:

Firefox 119.0.1 (64-bit)
Mozilla Firefox Snap for Ubuntu
canonical-002 - 1.0

The browser zoom was set to 100%.  My MathJax math renderer is "common HTML".
The formula renders differently, but still  incorrectly (for me) in this post itself, where the browser zoom is set to 120% and the renderer is "HTML-CSS":
$|x-x_0|<(n+1) \left | \frac{f^{(n)}(\xi_{n-1})}{f^{(n+1)}(\xi_n)} \right |$
It looks like this:

A seemingly related earlier bug report. I still see the rendering problems I described there.
Please let me know if there is any other information I can provide that would be helpful.
Answer: This
|x-x_0|<(n+1) \left | \frac{f^{(n)}(\xi_{n-1})}{f^{(n+1)}(\xi_n)} \right |
renders for me as

Safari 14.1.2, renderer HTML-CSS

Malformatted parentheses


Actual modified date of a document

Question: Is there someway to get the actual modified date of a file in a document library. Modified field has the modified date for the item and not the file so if one of the meta data of the file changes the modified field changes.
Is it possible to use Property Promotion or something when uploading the file to get this property into some column?
Answer:
Add a field to your list: "Document Last Modified"
Create an event receiver, easiest probably to override SPItemEventReceiver.ItemUpdated

http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spitemeventreceiver.itemupdated.aspx

Then you will need to update the field ("Document Last Modified") with the value:

SPItemEventProperties.ListItem.File.Properties["vti_lmt"]
You can find out other document properties using this powershell (or convert to c#)
(get-spsite "http://yoursite").RootWeb.Lists["Shared Documents"].Items |% {
    $file = $_;
    $file.Properties.Keys |% {
        Write-Host $_ "=" $file.Properties[$_]
    }
}

Answer: I think the only way you could achieve this by creating an event receiver in code.
So you could check every time a document is uploaded or modified check the time of the file and set it to a desired column
just an idea :)
you can find some info about event receivers here.

Actual modified date of a document


How to linearize the product of two binary variables?

Question: Suppose we have two binary variables $x$ and $y$. How can we linearize the product $xy$?
Comment: This quickreference did help me very well to model logical equations as linear constraints: https://msi-jp.com/xpress/learning/square/10-mipformref.pdf. Since your case is a simple _and_.
Answer: This scenario can be linearized by introducing a new binary variable $z$ which represents the value of $x y$. Notice that the product of $x$ and $y$ can only be non-zero if both of them equal one, thus $x = 0$ and/or $y = 0$ implies that $z$ must equal zero.
$$z \leq x\\z \leq y$$
The only thing left is to force $z$ to equal one if the product of $x$ and $y$ equals one, which only happens if both of them equal one.
$$ z \geq x + y - 1. $$
The general case with $n$ binary variables
This method can also directly be applied to the general case where we have the product of multiple binary variables. Suppose we have $n$ binary variables $x_i$ and we want to linearize the product
$$
\prod_{i=1}^n x_i.
$$
Then you can introduce a new binary variable $z$ that represents the value of this product and model it by introducing the following constraints
$$
\begin{align}
z &\leq x_i \quad \text{ for } i = 1, \ldots, n.\\
z &\geq \sum_{i=1}^n x_i - (n-1).
\end{align}
$$
Further reading
As mentioned by 4er in a comment below this answer: "for quadratic functions of many binary variables, you can often do better than to linearize each product of variables separately". Some suggested references are:

F. Glover and E. Woolsey (1973). Further reduction of zero-one polynomial programming problems to zero-one linear programming problems. Operations Research 21 156-161.
F. Glover (1975). Improved Linear Integer Programming Formulations of Nonlinear Integer Problems. Management Science 22 455-460.
M. Oral and O. Kettani (1992). A linearization procedure for quadratic and cubic mixed-integer problems. Operations Research 40 S109-S116.
W.P. Adams and R.J. Forrester (2005). A simple recipe for concise mixed 0-1 linearizations. Operations Research Letters 33 55-61.
Comment: [1] F Glover and E Woolsey, Further reduction of zero-one polynomial programming problems to zero-one linear programming problems. Operations Research 21 (1973) 156-161.

[2] Glover, F. Improved Linear Integer Programming Formulations of Nonlinear Integer Problems. Management Science 22 (1975) 455-460.

[3] M Oral and O Kettani, A linearization procedure for quadratic and cubic mixed-integer problems. Operations Research 40 (1992) S109-S116.

[4] WP Adams and RJ Forrester, A simple recipe for concise mixed 0-1 linearizations. Operations Research Letters 33 (2005) 55-61.
Comment: And in the general case, look at the McCormick relaxation. If someone is at CPAIOR next week, please write here anything of interest in Toby's talk.
Comment: If you have a quadratic function of many binary variables, then you can often do better than to linearize each product of variables separately. I'll give some references in the next comment.
Comment: @4er is it oke if I add your paper suggestions to my answer such that they are better visible? Of course you will be mentioned :)
Comment: It's OK. Please go ahead and add them.
Comment: @EdwardLam: the slides of CPAIOR you are asking ("Products in Mixed Integer Programming") are vailable at: http://cpaior2019.uowm.gr/wp-content/uploads/CPAIOR_Achterberg.pdf
Comment: I may be wrong, but I don't think $z$ has to be specified as binary. It suffices to set $z$ as a continuous nonnegative variable.
Answer: It is worth noting that this formulation can be derived somewhat automatically by writing the logical proposition in conjunctive normal form:
\begin{align*}
& z \iff x \wedge y \\
& \left(z \implies (x \wedge y)\right) \bigwedge \left((x \wedge y) \implies z\right) \\
& \left(\neg z \vee (x \wedge y)\right) \bigwedge \left(\neg(x \wedge y) \vee z\right) \\
& \left((\neg z \vee x) \wedge (\neg z \vee y)\right) \bigwedge \left((\neg x \vee \neg y) \vee z\right) \\
& (\neg z \vee x) \bigwedge (\neg z \vee y) \bigwedge (\neg x \vee \neg y \vee z) \\
& \left((1 - z) + x \ge 1\right) \bigwedge \left((1 - z) + y \ge 1\right) \bigwedge \left((1 - x) + (1 - y) + z \ge 1\right) \\
& (x \ge z) \bigwedge (y \ge z) \bigwedge (z \ge x + y - 1)
\end{align*}
Comment: @AlexandreFrias I guess you could say it is a consequence of DeMorgan's law: $P \lor (Q \land R) \equiv (P \lor Q) \land (P \lor R)$.
Comment: Do you know the reason for all constraint obtained from the conjunctive normal form result in disaggregated family of constraints?
Answer: As the first answer:
$$
\begin{align}
z &\leq x_i \quad \forall i = 1, \ldots, n.\\
z &\geq \sum_{i=1}^n x_i - (n-1).
\end{align}
$$
We should note that, the property holds for an aggregated version of these constraints (obtained from the sum of the $z \leq x_i \quad \forall i = 1, \ldots, n$.
$$
\begin{align}
n.z & \leq \sum_{i=1}^{n} x_i \\
z & \geq \sum_{i=1}^n x_i -(n-1)
\end{align}
$$
I prefer to use less constraints.
Comment: The aggregated version is correct but weaker.  It is worth trying both ways.
Comment: When I use aggregated constraints in Facility Location Problem, ($\sum_{j=1}^{m} x_{ij} \leq m.y_j $) in place of  ($x_{ij}\leq y_j$), the running time is faster, almost ever. I think simplex algorithm works better using less constraints due to the number of vertex in the polytope.
Comment: Yes, and cut generation probably finds the disaggregated constraints as needed.  It depends on the problem and instance, and so it is worth trying both ways.


It is appropriate to call the professor for this situation?

Question: I have a great relationship with one of my professors(at least I think), and a few weeks ago we discussed the possibility of doing a research project together this summer. However, he never replies to my emails again after the semester ends(2 weeks already, I sent one email and a follow-up, and even a phone message), and I saw him attend an academic panel virtually yesterday. I am abroad, so I'm unable to go to his office. I have his phone number(from the syllabus). Should I call him?
Comment: Normally, "should I" questions are off-topic. However, two weeks out of semester is not much, he may be on vacation, on conference or retreat. Do not lead him to feel pestered. You let him know you are interested, now let it sink in. If he is interested, he will contact you back, else try to contact him early next semester.
Comment: @CaptainEmacs, Early next semester is September. Too late for a summer project. But I agree, that two weeks after the semester ends can involve lots of things.
Comment: but we actually talked about this before and he agreed to do the project during the summer break. but then he just doesn't reply anymore, which is confusing
Answer: It is probably better avoided to call. If they are busy with things, there is little they can do on a phone call but get annoyed.
If you already have any guidance on the project you could start reading or whatever prep work is needed.
Send another email in a few days and say you need some guidance to continue but that you've started (assuming you have).
There are lots of things that might explain the delay, but ignoring you isn't near the top of the list.
Comment: He already sent two mails and left a phone message inside 2 weeks. I would not send the next mail in few days anymore. This is getting naggy. I would wait at least 3-4 weeks now.
Comment: Thanks, bro, for your comment. I will wait for 2+ weeks to send another email and find another supervisor to help me. He is a great candidate for a recommendation also. So sad
Answer: Given the question was asked last summer, I would assume it is too late to answer this right now. However, I believe situations like this is quite common.
Given professors using cannot have a vacation time outside of summer or winter breaks easily, it is common for them to schedule many events and travels to the start of the summer break. And since OP mentioned he had seen the professor in a panel, the professor was indeed busy on some thing.
And given you seems to have a 3.5 month summer break, I would argue 2 weeks into the break is definitely not a long time yet.
Also, it's common for professors to check their school email and phone much less frequently, so you might also want to try to contact them through their personal emails to remind them, if it is possible.


What process is making that sound?

Question: My Windows 7 system makes an intermittent ding sound (like a single chime, or bell).  I don't know which process does it.  So, my question is: Is there software/method out there that can tell me which processes are currently sending output to the sound device?
Comment: @Johannes: Some clock gadgets make a sound every 15 minutes.
Comment: Did you check your clock gadget?
Comment: @Mehper: What does the clock have to do with random sounds?
Answer: Fire up the volume control which will list all applications that recently made sounds. If you have it open while the sound plays you can also see which application is doing it.
Comment: What if instead of the application name I'm seeing "System Sounds"? I do see other apps listed as well but the "annoying" one is being produced by "System Sounds". Is there a way to further find out what exactly is playing it? (I realize that this is from 5 years ago and I'll unlikely get an answer... :) )
Comment: More specifically, after opening the volume control from the system tray, click "Mixer" to view all applications. Resize it so all applications appear in view, and wait. The app causing the ding will be indicated by a brief green peak.
Comment: Because of your advice I was able to figure out what the sound is, as well.  It is the same sound that the sound mixer issues when you adjust volume levels.  In my case it comes up randomly from some other event, but I think now I'll be able to track which one at some point.
Comment: @MihaillR In Windows Sound settings you can change Sound Scheme to "No Sounds", that will remove any digs etc.
Answer: My case is likely different, but solution for me was to right-click the speaker icon on the task bar and select "Sounds".  I cycled through the list until I found the sound that matched what I kept hearing.  In my case it turned out to be the "fingerprint scan failed" notification and I realized I kept accidentally swiping my hand over the fingerprint scanner and triggering the sound, hahaha.  But same method might help you troubleshoot your case.
Comment: Thanks for the tip. Just in case checking the volume mixer is not feasible if the chime sound plays at random intervals, you can use Process Monitor. (http://www.winhelponline.com/blog/find-application-making-sounds-in-background/). In that case, Tracking events containing lines ".mp3", ".wav" should help.
Comment: Thank you @w32sh, your link helped me solve my problem. It turns out that the Netgear software was also the one making sounds on my computer.
Comment: @w32sh Your comment should really be an answer (if you're willing to add a bit more detail). That's an *excellent* solution.
Answer: I had this problem today.  I changed from Windows (modified) sound to Windows default and it disappeared.  Just a thought
Answer: Its most likely the close program sound which only plays a sound in some sound schemes.
It is triggered Normally   programs closing.
But is also triggered by processes (Which you can see in the second tab of
                                                                                Windows task manager.)
When the sound plays you can see the number of processes drops by one so it triggers the sound. (you can see this count in bottom left)

What process is making that sound?


Geometrical Interpretation of Tensors (intuition)

Question: How would one describe to a non-mathematician (an undergraduate physicist actually- so please do use mathematics-i am not even sure if they can be described without mathematics!) what do tensors represent geometrically?
Comment: Depends what you mean by tensors. Are we talking in the sense of "stress tensors" and general relativity, or in the sense of QM (i.e. the tensor product of Hilbert spaces)
Comment: Wow, i didn't think about that as i am yet to encounter them. I would say, all three kinds of tensors.
Comment: Have you taken linear algebra yet?
Comment: Yes. Also, i know a bit of multivariable calculus, differential equations and calculus of variations and complex analysis(i don't know if the last 3 are relevant).
Comment: ...@QuanticMan, linear algebra that includes vector-duality?
Comment: I don't think so..
Comment: Did you look at this question (asked by a physics student): http://math.stackexchange.com/questions/10282/an-introduction-to-tensors?
Answer: Here's the quick way to describe what's going on:
In linear algebra, you learned primarily about linear transformations.  In particular, $T:V \to W$ is a function that takes a single vector, and produces another vector in a linear way.  In particular $T$ satisfies $T(ax + by) = aT(x) + bT(y)$.  It turns out that linear transformations can naturally be thought of as matrices, so that's what you end up working with most of the time.
A tensor, by contrast, is a map $T:V_1 \times V_2 \times \cdots \times V_k \to W$.  That is, it takes several vectors as its input and produces an output-vector in a multi-linear way.  That is, $T$ will satisfy
$$
T(v_1,v_2,\dots v_{k-1},ax + by,v_{k+1},\dots,v_n) =\\
aT(v_1,v_2,\dots v_{k-1}, x,v_{k+1},\dots,v_n) +
bT(v_1,v_2,\dots v_{k-1}, y,v_{k+1},\dots,v_n)
$$
Rather than thinking of tensors as matrices, we think of them as multidimensional arrays.

Another example of a Tensor that can be thought of as a matrix is a "bilinear form" $T:V_1 \times V_2 \to \Bbb R$.  In particular, given a matrix $A$, the function
$$
T(v_1,v_2) = v_1^T A v_2
$$
is exactly this kind of tensor.  One commonly used tensor that works this way is the stress tensor.  The question it answers is "what is the component of pressure on the plane perpendicular to $v_1$ in the direction of $v_2$?"  Two others are the dot-product and, more generally, metric tensors.
Answer: We can add something to the already excellent answer given by Ben Grossmann.
The wonderful Gravitation by Misner,Thorpe and Wheeler (affectionately called MTW) on page 75 describes the most general (m,n) tensor  as:" a linear machine with n input slots for n 1-forms and m input slots for m vectors, given the requested input, it puts out a real number..."
(1-forms are simply the linear operators that take a vector and give out a number).
Tensors are useful in physics because (roughly):
each observer is described by a different 4D basis in spacetime and
each measurement is described by the value of a specific component of a specific tensor in the observer's basis.
Tensor components in one basis are (linearly) related to the components in another basis, so if we know what one observer is measuring, we can find out what another observer will measure.
In short: measurements made by different observers are related in the same way that certain tensor components are related when passing from one basis to another basis


Display Attribute in Edit Product Back end Magento

Question: Please help me!. I have an attribute "manufacture". How can i display this attribute into General tab in Edit Product Page ?
Thank you.
Answer: Simply add the desired attribute to all desired attribute sets by dragging it into the desired tab.  You can get to each individual attribute set edit form by clicking on the corresponding record in the Attribute Sets grid.
Comment: Hi @Luke : thank you for your reply. I drag this attribute set and drop it into General. But i can't find it.
Answer: Go to, Catalog > Attributes > Manage Attribute Sets, Select required attribute set.
Now Drag manufacturer attribute to General block, shown below :

Now click Save Attribute Set, you should be able to see manufacture attribute in General tab
Comment: Hi @Anil Suthar : Thank you for your reply. I did it but i can get it in General. I choose Default attribute set. Do you have any idea?
Comment: Make sure, the product you are editing is from Default attribute set ?
Comment: Sorry i'm newbie magento. How can i determine attribute set which display in product edit page ?
Comment: Go to edit product in admin. You can see the name of product at top. At the end of name you can see an attribut set name in braces `(ATTRIBUTESET_NAME)`. Also you can see this at products grid at column named `Attrib. Set Name`


Permission needed for manage permission set users

Question: what are the Permissions needed for a user to be able to assign/manage users in a permission set? And where those permissions are? at user level or profile level?
Comment: You might want to look at delegated administration if you want to control which permission sets a user can assign. https://help.salesforce.com/HTViewHelpDoc?id=admin_delegate.htm&language=en_US
Answer: There are two permissions to assign/manage permissions set.
There permissions are found under Administrative Permissions section of a Profile.
Comment: Seems, profiles with Salesforce Platform user licenses does not have these permission. You can create a Permission Set to hold these permission and can assign this permission set to User. I have taken the screenshot from System Administrator Profile whih has Salesforce user license.
Comment: thanks, but i'm not able to locate the permission in my profile. My profile is having salesforce platform license. I've attached the screenshot of Administrative Permissions section of my Profile.
Comment: I've tried to do the same. But the problem is that you can assign a Persmission set with Salesforce user license to a profile with the same user license not to a profile with Salesforce Platform user license. And in the Permission Set for Salesforce Platform user license these two permissions are still unavailable same as its profile.
Comment: @user59759 Yes, you are right. The "Salesforce Platform" user license doesn't allow the permission: Manage Profiles and Permission Sets. A profile should be of "Salesforce" license to work on the Permission Sets.


How to move emails

Question: Yesterday, I somehow moved all emails from my inbox to my delete box.  They have not been deleted! Can someone tell me how I can move them back to the inbox?  Maybe a large chunk of them at a time.
Comment: Select all the emails then move the emails back to the inbox.  How you select an email, within hotmail client within a browser, is documented on Microsoft's website.
Comment: @Ramhound: Actually, it's not. Outlook.com documentation is surprisingly lacking. If there is documentation, it's not easily findable from outlook.com.
Answer: When you select the "Deleted items" folder, there is either at the top or the bottom (depending on the version of the web interface) a button that says "Recover" or "Recover deleted messages"
Source: Outlook.com manual
Comment: "Recover deleted messages" is for when you actually delete them. (I think)  My messages are NOT deleted, they are sitting in the delete folder
Answer: Unfortunately, you can't choose more than a page at a time to act on. (See this answer from answers.microsoft.com.)
To select all of the messages on a page, click the checkbox at the top of the list (next to the "View" menu, which defaults to "All").
Open the "Move to" menu at the top of the page, and select "Inbox".
Repeat as needed.
Most likely you used the "sweep" feature, which makes it easy to get rid of messages you don't want, but if you're not careful you may move more than you intended.

How to move emails


Will geosrver run on Windows 2012 R2

Question: I'm trying to allocate a box to install geoServer for my company's intranet site. We have a box with Windows 2012 R2 installed but I can't find any specific documentation if geoServer will run on this OS. Can anyone help me answer this?
Comment: As GeoServer is written in Java it should be no problem. The Java virtual machine is meant to be plattform independent. Also the Windows Server is in most cases usable like a normal OS.
Answer: TLDR; Yes
Long Answer
Yes, of course. You can use the usual windows installer and install GeoServer as a service. Make sure to read about production settings.
Comment: Thank you. Just wanted to make sure and there was nothing specifying the 2012 R2 os, although I suppose it's just standards windows os.

Will geosrver run on Windows 2012 R2


Why adding capacitor to a 10x passive oscilloscope probe

Question: I'm trying to understanding input impedance and its circuitry of a simple, passive oscilloscope 10x probe. From reading Input Impedance of an Oscilloscope and the video EEVblog #453 - Mysteries of x1 Oscilloscope Probes Revealed, I don't understanding why we add these capacitors in the probe circuitry and make things more complicated. The point is to add enough impedance to a passive probe to minimize loading effect of the circuit being measured. A big enough resistor will do and the with just resistors, voltage divider works the same for both AD and DC source regardless of frequencies. If there are intrinsic reactances in the wiring, then can't we just add a big enough resistor in series with those to make any reactance negligible?
Comment: "*Can't we just add a big enough resistor in series with those to make any reactance negligible*" At the expense of sensitivity? and noise? And bandwidth? Remember, RC time constants are a thing.
Answer:
I don't understanding why we add these capacitors in the probe circuitry and make things more complicated.

They make things far less complicated. The low-pass filter that would otherwise occur is eliminated.

The point is to add enough impedance to a passive probe to minimize loading effect of the circuit being measured. A big enough resistor will do and the with just resistors, ...

No. Increasing the probe resistance decreases the high-pass cut-off as it will be proportional to \$ \frac 1 {RC} \$.

... voltage divider works the same for both AD and DC source regardless of frequencies.

No. You have omitted the effect of the scope's input capacitance.

If there are intrinsic reactances in the wiring, then can't we just add a big enough resistor in series with those to make any reactance negligible?

Increasing the resistance decreases the signal available to the 'scope to the point that you won't be able to get high enough resolution and ADC noise will become a problem.

Figure 1. From Introduction to oscilloscope probes.
The trick is to use two potential dividers; one resistive and one capacitive. Since we've got a ratio of 9:1 with the resistive divider we need to do the same with the capacitive divider. Remember that the capacitors impedance is given by \$ Z_C = \frac 1 {2\pi fC} \$ so
$$ \frac {R_1}{R_2} = \frac 9 1 = \frac {Z_{C1}}{Z_{C2}} = \frac {\frac 1 {2\pi fC_1}} {\frac 1 {2\pi fC_2}} = \frac {C_2}{C_1}$$
From this we get \$ C_2 = 9C_1 \$. With the values shown in Figure 1 we can just about achieve this if C1 is 8 pF and CCOMP is wound up to the max to give us 72 pF total (although this model omits the cable capacitance so we have room to spare).
Comment: from the circuit diagram I can't see if the probe is grounding total capacitance or total resistance. Does it form a high pass (grounding resistor) or low pass filter (grounding capacitor) at the tip?
Comment: Everything outside the blue box is in the scope probe and lead. The probe tip doesn't ground anything. It's the *combination* of the probe and the oscilloscope that provides the load between the tip and ground.
Comment: A low pass filter takes in signal through a resistor with a parallel capacitor to ground, and vice versa for high pass filter. In the schematic, both R2 and C2 goes to ground in parallel, while both C1 and R1 takes in signal in parallel. Neither of them forms a low pass or high pass filter.
Comment: Have you tried simulating the various configurations?
Comment: assume we achieve a \$C_{2} = 9C_{1}\$ ratio with 8pF and 72pF and having their reactances, say on a 50Mhz signal, are \$398\Omega\$ and \$44\Omega\$. The input impedance for high frequency signals is only \$442\Omega\$, so much more lower than that given by the resistor pair in lower frequency range or DC (\$10M\Omega\$). Does that mean if the input signal frequency goes high enough where capacitors reactance dominates, the input impedance of the scope significantly decreases resulting in a higher loading effect?
Answer: The cable has capacitance, and the scope input has also capacitance. If you add resistance, it would just reduce the bandwidth.
That's why you add capacitance to the probe, to nullify the other capacitances.
Basically it's the same thing with the resistances and the capacitances. If you want a 10x probe, and scopes have 1M resistance, you add 9M so that it divides DC voltages by 10. If you want also the AC waveforms to attenuate by 10x, and you already have some capacitances in the system, you select a correct capacitance to get 10x attenuation.
Comment: I was going to post [a picture](https://i.stack.imgur.com/T060l.png) showing how RC can perform perfect signal reconstruction. If you want to, feel free to add it. Maybe a picture will say a thousand words?
Comment: Is that the scope capacitance form a low pass filter and adding capacitor to the probe tip to  form a high pass filter?
Answer: You cannot take off Cs nor Cc. Together with Rp they would make a RC lowpass filter. Elementary impedance calculations reveal that the low-pass filtering effect can be compensated by adding Cp. You can consider it a high frequency boost. The total loading of the circuit under measurements is still lighter than without the probe.
General rule for flattest frequency response: RpCp=Rs(Cc+Cs) That's useful as long as the cable is short enough. As the frequency grows the user must finally take into the account that the cable is actually a transmission line which is badly matched at both ends. The compensation becomes gradually worse as the frequency grows. There's no strict limit when this happens.
Comment: I'm confused. So is the compensation Cp for maintaining 10:1 impedance ratio at high frequencies? Or is the compensation to equate the time constance between tip's RC and scope+cable's RC? Or Cp is added as a high pass filter on top of the scope's RC low pass filter?
Comment: It does these all at the same time. The impedance ratio must be calculated by taking into the account Cs and Cc, too. The total impedance decreases as the frequency increases, but it's 10x the impedance made by Cs, Cc and Rs. If you cannot do elementary circuit math you can try to see the effect with simulation.


As an HR manager, should I check the resume of my candidates for any misrepresentations or even blatant lies?

Question: I am just wondering how big the checking of a resume is when it comes to structuring a vetting process for a job position.
Comment: This is a question for your supervisor, not for SE. Anecdotally the contents of resumes are almost not fact checked at all.
Comment: It's entirely situation dependent. If someone with a title in astrophysics from MIT applied for a McJob and proves he's good at flipping burgers, would you fact-check his title?
Comment: If re-phrased to something like: 'Under which circumstances should I as an HR manager fact-check resumes?', would it not be on-topic?
Comment: Instead of ad hoc veracity-keeping, what I am trying to do here is devising a default system of vetting. So I am aware that it depends on the situations. But I am more curious to know what other HR managers do in general.
Comment: @user65173, most companies hire a background check company and then specifies the check done. A minimum check generally checks theemployment history and degree.
Answer: While 'cultural elements' company- or country-wise to some degree determine the degree of fact-checking, the specifics of the role are probably more important.
If the position sought is difficult and time-consuming to fill and candidates are known to occasionally 'get creative', at least basic fact-checking seems to be a good investment early on in the process.
If, however, the job is more mundane, candidates plentiful and local employment laws employer-friendly as regards to replacing employees, it would seem rational to only fact-check if a problem arises.
Answer: I guess it depends largely on the company/role.  In my experience, the hiring manager looks at the resume and judges whether it appears to hang together or not.  The candidate is expected to demonstrate their skill-set and knowledge during the interview process and defend any holes in their resume.
Having said that, there's no reason why the HR department can't make sure that the resume comes from a reputable source and whether the university/college listed actually exists (or whether it's a known "internet college" where people can buy fake degrees).
Most of this is common sense.


What is an application of the dual space?

Question: Does somebody know any application of the dual space in physics, chemistry, biology, computer science or economics?
(I would like to add that to the german wikipedia article about the dual space.)
Comment: In economics prices are in the dual of the commodity space assuming per-unit pricing.  Using this duality pops up in proving some of the existence of equilibrium theorems.  In fact, the existence of a market clearing price is (if I recall) just a statement of the separating hyperplane/ Hahn-Banach theorem (depending on dimension) in classical General Equilibrium theory.
Answer: When you are dealing with a vector space $X$ its dual $X^*$ is there, whether you are willing to apply it or not. It is a fact that the presence of a scalar product in $X$ tends to obscure the difference between $X$ and $X^*$. This is the case when $X$ is our geometrical or physical space ${\mathbb R}^3$ with the "standard scalar product", i.e., is  a euclidean space where an orthonormal basis has been chosen.
An example: When $f$ is a differentiable scalar function of ${\bf x}$ then for "small" increment vectors ${\bf X}$ one has
$$f({\bf x}+{\bf X})=f({\bf x})+ \omega.{\bf X}+ o\bigl(|{\bf X}|\bigr)\qquad ({\bf X}\to{\bf 0})\ ,$$
where $\omega.{\bf X}$ depends linearly on ${\bf X}$. That is to say: The symbol $\omega:=df({\bf x})$ denotes an element of $X^*$. Now the availability of a scalar product $\bullet$ in $X$ allows one to write the above equation in the form
$$f({\bf x}+{\bf X})=f({\bf x})+ \nabla f({\bf x})\bullet{\bf X}+ o\bigl(|{\bf X}|\bigr)\qquad ({\bf X}\to{\bf 0})\ ,$$
where $\nabla f({\bf x})$ denotes the gradient of $f$ at ${\bf x}$ and is a bona fide vector in $X$.
There are situations in physics or economy where the variables are not "geometric" variables $x_i$ but $p$, $V$, $T$ for pressure, volume, and temperature (or similar). In such a case it doesn't make sense to introduce a scalar product making the "norm" of a state $s$ equal to $\|s\|:=\sqrt{p^2+V^2+T^2}$. As a consequence a linear function of the state variables $p$, $V$, $T$ is a genuine element of $X^*$ and cannot be represented by some "gradient vector" belonging to the state space $X$.
Answer: First of all: I think it is impossible to give a complete answer to your question. The reason is that the dual space is such a general and central notion that it is ubiquiteous in mathematics, physics and other sciences. I would only exaggerate a bit if I said you might as well have asked what applications of vector spaces are.
But to give some ideas:

A neat way to define the tangent space of a manifold is as the dual space of the cotangent space. This is rather abstract but can easily be transfered to other settings, e.g. varieties. For example vector fields - which are commonly used in physics - rely on this.
In quantum physics people often use the "bra"- and "ket"-vector notation. In the end these are just other names for a vector and its dual.
A scalar product $V\times V\to k$ (also central in, say, physics) can be written as an isomorphism $V\to V^*$. Many applications actually only need non-degenerate forms, which in turn are injective maps $V\to V^*$.
In constrained optimisation one often passes from the so called primal problem to the dual problem. A great example from computer siences are support vector machines. After some work it turns out that the "dual" vectors (in the dual problem) are indeed dual vectors (in the classical sense) of the data space. This trick makes a huge difference in computations.
Answer: Dual space is used in the lemma's Lax- Milgran wich  guarantees the existence of severals solutions of PDE wich this describe describe movements, minimal surfaces, heat distribution and other.


Electrical isues on j10 nissan qashqai

Question: I have a problem with my Nissan Qashqai, its a late 2010 so its a facelift model. The lights flicker when I am driving, when im parked, basically all the time, my windows roll down slowly, some electronics have started dying, like my alarm system, and the latest is my rear & side mirror heaters. Any idea why is this happening ? its a 1.5 dci, original battery, and the voltage fluctuates, the flickering gets worse if ac is on, heated seats, or phone charger. I can turn everything off but it still continues to flicker.
Answer: You pretty much hit the nail on the head with "original battery". A decent battery will last 3-5 years before it starts to fail/cause issues, so first port of call will be to a store to get a new like-for-like battery. Beyond that, your alternator might be failing but you should get a new battery anyway.
Comment: is there anything less expensive i could try first?
Comment: Borrow a decent battery from a friend? Take your battery to a workshop and have them load/soak test it to get a charge/discharge profile? These things will likely cost money though, and batteries aren't that expensive.
Comment: i will definitely try that once i will have the chance. I know a shop that can test batteries for their health
Comment: Perfect. Let us know how you get on.
Answer: Your symptoms sound much more like a problem with the alternator/charging system. If the car is running, the charging system should be taking most of the load even if the battery is no good, and it generally sounds like yours is having trouble keeping up with the normal demands of the vehicle. Definitely get your alternator tested. (I have personally been in a couple of vehicles when the alternator died, and what your car is doing sounds a lot like that. lights get dim, radio fails, basically all electrics start to go out and then the engine stops)
Also note your battery may still be bad, and a bad alternator can wreck a good battery over time. This also means replacing your battery before having the charging system investigated could be a waste of money, so I would hold off on that till everything else is cleared up first.
Comment: do you know how to check the charging system ? do i need to do a mechanic to do that ?
Comment: You can do a basic voltage check to start, with the engine running. If it's not adequate, then you most definitely have a problem. You can get a false negative though where the voltage looks ok, but will drop when the system is under load. So to do a complete test you usually need a special load tester or to go to a mechanic.
Comment: Its fluctuating between 13.9 - 13.2 with some spikes
Comment: That's ballpark but possibly a little low. If that is not a reading with a load tester I would get that done. A place like Autozone may be able to do this for free and mechanic shops may also not charge for just the test.

Electrical isues on j10 nissan qashqai


Unable to set object permission

Question: As and admin I have cloned a profile and am trying to restrict the access of the new profile to only several objects.
First I want to remove the access to object "Financial goals".
I uncheck all the boxes from the Object permission table and click save.
The following error message pops up( the same happens when I do the same with a different object)
To me it looks like there are some dependencies that do not allow the removal of access.
Can you please help me what to do in this case?
Thank you
Comment: Is Pricing Guidance a field? Did you look at the Field Level Security section?
Answer: Error might be due to Winter '21 release updates for CPQ and Advanced Approvals (AA), profiles are no longer able to grant access to any Salesforce Licensed Custom Objects (LCO) and permissions Licensed Custom Objects (LCO) and their related dependent objects.
The best practice to address this change is to remove any AA or CPQ permissions to licensed custom objects, including related dependent objects, from the profile.
Instead, assign permissions for these objects in a permission set and assign it to users.
Kindly follow below steps for profile editing tip:

Temporarily disable 'Enhanced Profile User Interface' from Setup > User Management Settings > Disable "Enhanced Profile User Interface".  This will allow to mass edit  profile CRUD actions from a single page.

Ensure your profile doesn't have any CRUD permissions for the
associated CPQ objects.

Unable to set object permission


Are regular grammar languages defined from "accepting" states?

Question: In a transition diagram, the language L(D) where D is the diagram is defined as all the words that are formed from following an "accepting" walk. Does the same apply for languages of regular grammars too? They are defined by using 4 sets (terminal, non-terminal, initial non-terminal, rules) so there is no such thing as "accepting states" at the definition. The language of a regular grammar are the words that can be produced from that grammar, but do they always end in an "accepting" state?
Answer: Your question confuses automata and grammars.
Grammars do not have states.
Grammars generate words by substituting substrings in words to form other words according to the grammar's rules. So instead of ending up in a state you end up with a word.
The all-terminal words (i.e. containing no nonterminals) among those are defined to be the words the grammar generates.
So a word being all-terminal is equivalent to a state being accepting. Another notion of acceptance for grammars would be superfluous.
Answer: There is a one-to-one correspondence between NFAs and right regular grammars without productions of the form $A \to a$.
Given a right regular grammar with productions of the form $A \to aB$ and $A \to \epsilon$ and starting symbol $S$, create an NFA in which:

The states are all nonterminals.
The initial state is $S$.
A state $A$ is final if there is a production $A \to \epsilon$.
There is an edge labeled $a$ from $A$ to $B$ if there is a production $A \to aB$.

This NFA accepts the same language as the grammar.
You can also easily carry out the transformation in the other direction.
This shows that in the absence of rule of the form $A \to a$, the analogs of accepting states are nonterminals with productions of the form $A \to \epsilon$.
We can replace a production $A \to a$ by a pair $A \to aX$, $X \to \epsilon$, where $X$ is a nonterminal which is common to all such productions, but doesn't appear anywhere else. We can think of $X$ as the accepting sink. A production $A \to a$ signifies a possible transition to the accepting sink.


Did the early church believe that Jesus was celibate?

Question: Jesus Christ in the gospels was never married nor did he ever have children and it is believed historically that Jesus himself was celibate but did any of the Early Church Fathers believe that Jesus Christ was celibate?
Comment: related [question](https://christianity.stackexchange.com/questions/3515/could-jesus-have-been-married)
Answer: Yes, at least two of the Church Fathers refer to Jesus as being not only celibate but a lifelong virgin.

Tertullian c 200, On Monogamy 3 - the Lord Himself opens the kingdoms of the heavens to eunuchs, as being Himself, withal, a virgin; to whom looking, the apostle also — himself too for this reason abstinent — gives the preference to continence.

St. Methodius of Olympus c. 300. Banquet of Ten Virgins 1.4
It was reserved for the Lord alone to be the first to teach this doctrine [eunuchs for the Kingdom]... He who was first and chief of priests, of prophets, and of angels, should also be saluted as first and chief of virgins. For in old times man was not yet perfect, and for this reason was unable to receive perfection, which is virginity.


Acceptance in a conference

Question: If a paper has 3 weak accepts (in all evaluations, a weak accept in each evaluation),  will it be published in the conference? If this is the case, what is the difference if it has 2 weak accepts and a strong accept or 3 strong accepts?
Comment: I've added the CS tag here, because I don't think this question is relevant to conferences outside of CS.
Answer: This largely depends on the conference. The way that conferences usually work (at least in my field for computer science - subdiscipline software engineering or human-computer interaction) is that once the reviews come in, the program committee meets and then discusses which papers will be accepted and which ones are rejected. This often comes down to how many papers there are, how many they can accept (subject to things including a mandatory acceptance rate, how big the conference can be, etc) and what other papers are like (if your conference has very few "strong accepts" that year then weak accept is pretty good).
Usually, a paper with few "strong accepts" could end up around the "middle" of the pack are more likely to be held up for discussion where they have a chance for rejection. Most PCs won't extensively discuss a paper where all of the reviewers say "strong accept".
So, we don't know if it'll be published in the conference. However, in general, the more strong accepts a paper gets, the more likely the paper will be accepted.
Answer: Note: My answer is computer science and specifically HCI relevant.
This depends on the conference, the discipline and the conference committee. There are variables which determine the acceptance of a paper in a conference.
A paper with three weak accepts may be rejected if there are stronger papers out there or if the committee feels that another paper which describes something really new must be given an opportunity to be presented.
A paper with three strong accepts is most likely to be accepted because this means that there is an almost unanimous consent among the reviewers and the paper is most likely very strong and very relevant to the subject matter.
A paper with any such combinations in between the previously described examples may or may not be accepted depending on various factors. Ultimately, the decision is upto the organizing committee. For instance, I have seen papers in CHI be rejected finally with three 3.0 scores (borderline accepts) but seen papers with one 4.0, one 3.0 and one 2.0 get accepted finally after the revisions were made.
Therefore, ultimately, my first sentence remains valid. It depends on a bunch of factors most of which are out of your direct control. The only thing which you can control is the revision of the paper.

Acceptance in a conference


Missing rasgreeng.dll on VPN server when client attempts to connect

Question: I am running into problems setting up a VPN server on Windows 10 Home Anniversary Edition, which 'ver' reports as:
Microsoft Windows [Version 10.0.14393]
I am following the guide at: http://pureinfotech.com/setup-vpn-server-windows-10/
I have configured the server, and when the client attempts to connect, credentials are requested.  The connection is immediately dropped after the correct credentials have been input, however.
From the server end the event logs show two errors relating to the connection.  The first is the report that rasgreeng.dll could not be initialised:
Remote Access Connection Manager failed to start because the Protocol engine [rasgreeng.dll] failed to initialize. The specified module could not be found.

This is followed by the second, which indicates that IKEv2 failed to initialise:
Remote Access Connection Manager failed to start because the Protocol engine [IKEv2] failed to initialize. The request is not supported.

The rasgreeng.dll is expected under \Windows\System32, but is not available anywhere on the machine.  I have also checked on a machine running Windows 10 Home November 2015, but with no luck.  I have seen references to this DLL available as a KB patch to add Generic Routing Encapsulation to Windows 8, 8.1, and Server 2008 R2.  But my understanding is that this is incorporated into Windows 10.
I have configured the router to avoid handling VPN connections and to pass through VPN requests to the server in question.  The firewall configuration on the server appears correct.  I have also tried setting the host in a DMZ, but with the same effect.
I am operating under the assumption that it is possible to configure a VPN Server on vanilla Windows 10 Home.  Why is the OS attempting to use a non-existent DLL when the client connects?  Are these errors a red herring?
Comment: Did you find a solution for this?
Answer: You need to start RasAuto  service and change launching mode on automatically. Enjoy! ;)
Before:

Service:
Comment: Any chance you could add the rough English translation of whatever are the key elements in the pictures?
Comment: It corresponds to Remote Access Auto Connection Manager. If you look for that on English systems, you'll find it in services. I tried setting it to Automatic as suggested here, but I'm still getting the rasgreeng.dll error in the EventViewer.


How do I see other players' levels?

Question: Is there a way to see the level of the players who join my game or whom I join the game of? I feel like there was only ever one person who could tell what level I was, but I didn't get the chance to ask them how they knew.
Answer: There isn't, not directly.
However, if you turned off local monster scaling, you can tell approximately what level the host is based on the enemy levels, because the monsters will be scaled to the host.
Comment: Good insight. I've done that, but I never registered that consciously as a method. I only ever play in other people's games though, so if there really isn't a way, I can only guess that they guessed my level by presuming I was at the level cap.
Answer: To see the level of other players, look at the PLAYERS tab of the character menu.

How do I see other players' levels?


CORS with only javascript

Question: Doing a javascript only assignment, i was provided an ubuntu machine and would like to spin up a container with a nodejs Serving the HTML, css, javascript.   Then i would like another container with the backend API...since this all happening in the same server or IP , Is that posible no cross Origin calls????
Answer: See the Same-origin policy:

Two URLs have the same origin if the protocol, port (if specified), and host are the same for both.

You can't have two different services listening on the same port, so even if your static content and API servers shared an IP address, they would have to run on different ports.
So you would either need to configure CORS for the API server, or configure your static content server to proxy requests to the API server.
Comment: So if I specificied and allow CORS in the server, that would suffice?...that could work because only my front-end is not allowed libraries, framework, etc
Comment: @user998548 — yes
Answer: You would need to provide the correct CORS settings on your backend API; CORS does take into account port numbers. See this post for reference: CORS error on same domain?

CORS with only javascript


How to reduce the size of all gnome-shell icons?

Question: Is it me or is the size of icons in Gnome 3.2 huge? It makes my 1200*800 resolution look like a netbook interface. Please how do I reduce icons size?
Answer: To configure the layout of the application icons in the GNOME Shell, you have to modify /usr/share/gnome-shell/theme/gnome-shell.css. Note that the contents of this file may vary as it is dependent on the particular theme that you are using. In the case of the Dark Glass theme, here are the modifications necessary to reduce the size and layout of the displayed icons by 50% in Applications Overview.
.icon-grid {
    spacing: 18px;                       /* was 36px */
    -shell-grid-item-size: 35px;         /* was 70px */
}

.all-app .icon-grid {
    -shell-grid-item-size: 59px;         /* was 118px */
}

.all-app .overview-icon {
    icon-size: 48px;                     /* was 96px */
}

Read more here.
Comment: Its changed now. But one can get an idea from this post. Now we have to change spacing, shell-grid-horizontal-item-size, shell-grid-vertical-item-size under ".icon-grid" and icon-size under ".icon-grid .overview-icon"
Answer: For size only: Open nautilus, go to Desktop folder, click in the upper right corner on the icon with the four squares, again the four squares and then set the size using the provided slider.
Comment: Nice! Seems it doesn't need to be the Desktop folder. Sharing the Desktop icon size and the folder icon size is a really simple concept, but hard to figure out. Specially when the Desktop icons suddenly changed size after an update (ie. it's not linked to having just changed the icon size in a folder).
Answer: Facing the same problem (wanted to decrease icons size on the launcher grid), editing the gnome-shell.css file worked fine to change the grid layout only (the grid elements were properly resized and redispatched, but the icons were not resized and stacked all over the place).
In order to sort this out I also edited the file
/usr/share/gnome-shell/js/ui/iconGrid.js

Line 14 in this file now reads
const ICON_SIZE = 48;

instead of
const ICON_SIZE = 96;

This worked fine on Ubuntu GNOME 14.04, fresh install.


Why does Indian Hindustani or Carnatic music not use chords?

Question: Why does Indian Hindustani or Carnatic music not use chords in compositions? I haven't seen any composition that mentioned about chords. Were Indians not aware of chords?
Answer: There are some chords, but they're used in a bit of a different way than the Western classical tradition. It's a stylistic feature of these two genres owing to their origins in the late Medieval and early Renaissance eras.
They both highlight the raga (basically a melodic pattern) and tala (a rhythmic pattern), just like the respective color and talea of the isorhythmic tradition in Central Europe around the same time.
But whereas the isorhythmic tradition often emphasized the motet (and thus polyphony), the Hindustani and Carnatic traditions tend to emphasize a single voice (or vocal line) in a homophonic texture. Often this doesn't result in chords, but sometimes it does.
It's not that they didn't always think of chords, it's just that this is a stylistic trait. It's a bit like asking why Dickens never wrote an illustrated children's book. He could've, he just didn't. (At least I don't think he did.)
Comment: @Sadhana I don't think anyone is trying to suggest that Indian music originated in Europe.  But I agree that the mention of "medieval and renaissance eras" is confusing.  As far as I am aware the development of classical music in the two cultures was largely independent, so the various stylistic developments would be expected to occur at different times.  If anyone does have any specific information about one kind of music influencing the other, or sharing a common influence, it would be interesting to know about.
Comment: @phoog, You're right, I was indeed confused by the mention of Medieval and Renaissance eras. My bad. But Indian classical music very definitely goes back much earlier than the Medieval era, so there's that too. Yes, there certainly have been many influences in both directions. I hope to do some research and write about it at some point.
Comment: As another illustrative example: gamelan doesn't specifically use chords, though the crossing melodic lines may create them; the musical style is about the division of the beat, the melody, and the rhythmic interlocking lines.
Comment: I don't think it's accurate to say that Indian classical music originated in Medieval Europe. The history of Indian classical music going back to the Vedas is very well documented. As an example, we have the Natyashastra, an ancient Sanskrit treatise on the performing arts that has sections on classical music, dance, and drama. https://en.wikipedia.org/wiki/Natya_Shastra
Answer: All traditions of a culture are inter-related. Indian philosophies have focused on the individual not collective. Music is a path for an individual to seek bliss or its variants. Every element of music then immediately takes on either an individual or supportive role. This gives every swara (simplistically a note) a status and character. This explains why creating a sound by combining multiple frequencies is missing. In its place, Indian music works with microtones between swaras.
Comment: If you can cite some sources to your claims then your answer would improve. As it stands, I'm not sure it really answers the question.
Answer: I think it's because Indian classical music is primarily a vocal musical tradition. We have some very beautiful instruments too, but if you've noticed, they all try to approximate the nuances of vocal music.
Most historians agree that the beginnings of Indian classical music go back to the Vedas, the Sama Veda in particular. To explain a bit about the Vedas, they are the world's oldest extant literature. They come in the form of four vast collections of hymns that were orally transmitted from generation to generation.
It was forbidden to write the Vedas down, and yet, there was an unflinching commitment to preserving them at all costs without any changes in the intonation of even a single syllable. You see, the Vedas were considered to be literally a way for humans to communicate with the Gods, and it was thought that even a slight mistake in intonation would change the meaning of the communication and result in catastrophe.
Vedic scholars were, therefore, trained to ensure flawless recitation of the hymns taking care to use the prescribed notes for the prescribed syllables.
In the beginning, only three notes were used in the Sama Veda. Eventually, the number of notes increased to five and remained there for a while, before the sixth and seventh were finally added. So, the Sama Veda is what began this tradition of very disciplined and rigorous training in music, which eventually evolved into the very rich tradition of classical music we have in India today.
So, to go back to your question, Indian classical musicians have always taken their notes very seriously. The purity of the note is considered to be of the utmost importance, especially when you're practicing your music or if music is a spiritual pursuit for you.
I think this is the primary reason we don't use chords as a deliberate musical device.
Having said that, the tanpura is used as a background in Indian classical music, and it is usually tuned to either the 1st and the 5th or the 1st and the 4th, and played continuously in the background. This results in an inadvertent chord-like effect, but since these background notes are simply played over and over again without any deliberate thought given to them, they do not distract the musician from concentrating on the note he or she is focusing on.


Under Memory/Performance tab in Task Manager, what does the cache value means?

Question: In Windows 10, Performance tab/Memory button in Task Manager, what does the cache value mean?
In the picture below it says I have a cache of 1.3GB. Does it means RAM cache? CPU cache? Disk cache? File System cache? and how do I clear it.
Answer: In Vista and later the Cached value is the sum of the Standby and Modified lists as shown in Resource Monitor. This is RAM. The CPU cache is internal to and managed by the CPU and not shown in Task Manager. The file cache is RAM used to contain frequently accessed portions of disk files. It is not part of the Cached value and Task Manager shows nothing about it.
The Standby list is RAM and serves a dual role. It contains application data but has not been recently accessed. In fact much of it will never be used by the application again. If it is later needed the application can quickly reclaim it.
The data in the Standby list is also on the disk. This makes it possible to quickly reassign this memory to any other process that needs it. The details are complex and I will not describe them here.
The Modified list is RAM that contains data that has not yet been saved to disk. When that is done it will go to the Standby list. It's size is usually quite small, probably less than 50 MB on a 4 GB system. I will say no more about it.
Most of the Cached value is available memory and freely available to any process. This is much better than free memory which should be kept to the absolute minimum.
Cached memory is a major contributor to system performance and a high value is a good thing. Clearing it would almost always be bad idea and would negatively effect performance. Windows provides no user accessible means of doing so. There are utilities available that can do this but they are best left to those who have a thorough understanding of the implications.
As a general rule caches are best left alone. They are complex and would not have been developed unless they provided a valuable service.
I see nothing in the screenshot that would be a cause for concern.
Answer: You are on the "Memory" tab of Task Manager, so all the information there has to do with your system's memory (RAM). If you look at your CPU's specifications, you will see that we are a long ways away from having gigabytes of CPU cache.
The goal of caching in general is to increase performance by making resources available before they are needed; in this case, loading data into RAM that the kernel thinks may be useful in the future (which is not always  correct). So even if there is a way to clear it, there is really no need to, and it would just fill up again. Also note that RAM is volatile, so the cache isn't kept when the system is not powered.


Rama advises Lakshmana not to speak ill of Kaikeyi and instead of speak well of Bharata - what is the original verse?

Question: In the Ramayana, Lakshmana is praising Bharata and blaming Kaikeyi. Rama stops him and asks him to simply praise Bharata, but not blame Kaikeyi. Which verse was this?
Answer: I was searching for the same verse just now, and found this question, so posting an answer here for anyone else who may arrive here looking.
My incorrect memory was that it occurs in the Ayodhyā (second) Kāṇḍa on the first evening after Rāma has left Ayodhyā, but actually this verse is in the Araṇya (third) Kāṇḍa, in Sarga 16. The autumn season (śarad) ends and winter (hemanta) begins, and Lakṣmaṇa starts speaking to Rāma about the season. After thinking of the people, the countryside, the sun, mountains, moon, forests, crops, etc, Lakṣmaṇa's thoughts turn to Bharata: how in his devotion to Rāma he must be performing austerities (tapas), sleeping on the ground in cold weather, bathing in the cold Sarayu river, etc. Then:

न पित्र्यम् अनुवर्तन्ते मातृकं द्विपदा इति ।
ख्यातो लोकप्रवादोऽयं भरतेनान्यथा कृतः ॥३.१६.३४॥
भर्ता दशरथो यस्याः साधुश्च भरतस् सुतः ।
कथं नु साऽम्बा कैकेयी तादृशी क्रूरशीलिनी ॥३.१६.३५॥
इत्येवं लक्ष्मणे वाक्यं स्नेहाद् ब्रुवति धार्मिके ।
परिवादं जनन्यास्तम् असहन् राघवोऽब्रवीत् ॥३.१६.३६॥
न तेऽम्बा मध्यमा तात गर्हितव्या कथञ्चन ।
तामेवेक्ष्वाकुनाथस्य भरतस्य कथां कुरु ॥३.१६.३७॥

"They say people follow their mother's nature not their father's, but Bharata has done otherwise. With a husband like Daśaratha and a son like Bharata, how could mother Kaikeyī be so cruel?" When Lakṣmaṇa said this out of affection [towards Bharata], Rāma, not able to bear this, said: "You shouldn't deplore our second mother. But say more about Bharata."

And Rāma continues to talk more about missing Bharata and looking forward to reuniting with him and Śatrughna again.
You can see the verse with translation (it's 3.16.37, i.e. the 37th verse in sarga 16 of book 3, Araṇyakāṇḍa) at valmikiramayan.net or valmiki.iitk.ac.in (commentaries on the sarga that briefly touch on this: Kataka, Tattvadipika).
Just for completeness, here is the verse transliterated into IAST:

na te'mbā madhyamā tāta garhitavyā kathañcana |
tām evekṣvākunāthasya bharatasya kathāṃ kuru ||3.16.37||

and ITRANS:

na te'mbaa madhyamaa taata garhitavyaa katha~nchana |
taam evekShvaakunaathasya bharatasya kathaaM kuru ||3.16.37||
Comment: Beautiful, thank you so much!!


Deriving the relation $\sum (y_i - \bar{y})^2 - \sum (y_i - \hat{y}_i)^2 = \sum (\bar{y} - \hat{y}_i)^2$

Question: $y_i$ denotes the observed values of $y$, $\hat{y}_i$ are the projected values from the explanatory variables, and $\bar{y}$ is the mean. This relation is supposed to hold up when one of the explanatory variables is the constant. So far, I have gotten
$$
\sum (y_i - \bar{y})^2 - \sum (y_i - \hat{y}_i)^2 = \sum(-y_i \bar{y} + 2 y_i \hat{y}_i - \hat{y}_i^2)
$$
It seems that if I can somehow show that $\sum y_i \bar{y} = \sum y_i \hat{y}_i$ then the derivation would be complete. Can someone show me how to proceed from here on?
Comment: It is qualified by stating that this is true only when $\hat{\beta}_0 \neq 0$ so the constant explanatory variable contributes to the regression. I agree that this is not true in the general case.
Answer: Somewhat ugly answer:
$$
\begin{align*}
\sum_i \left[ \left( y_i - \bar{y}\right)^2 - \left( y_i - \hat{y}_i\right)^2 -  \left(\bar{y} - \hat{y}_i \right)^2 \right] &=
\sum_i \left( y_i^2 - 2\bar{y}y_i + \bar{y}^2 - y_i^2 + 2y_i \hat{y}_i - \hat{y}_i^2 - \bar{y}^2 + 2\bar{y}\hat{y}_i - \hat{y}_i^2\right) \\
&= \sum_i \left(  - 2\bar{y}y_i   + 2y_i \hat{y}_i + 2\bar{y}\hat{y}_i- 2\hat{y}_i^2 \right)\\
&= -2n\bar{y}^2 + 2n\bar{y}^2 + 2\sum_i \hat{y}_i\left(y_i - \hat{y}_i   \right)  \\
&= 2 \sum_i \hat{y}_i\left( y_i - \hat{y_i}\right)
\end{align*}
$$
Which equals zero because it's basically the orthogonality condition that's used to estimate your $\hat{b}$ vector in ordinary least squares.
Sketch of linear algebra to show this explicitly (it's so much easier and succinct to use matrix notation...)
$$\begin{align*}
\sum_i \hat{y}_i\left( y_i - \hat{y_i}\right) &=(Xb)'(y - Xb)\\
 &= b'X'y-b'X'Xb \\
&= y'X(X'X)^{-1}X'y - y'X(X'X)^{-1}X'X(X'X)^{-1}X'y\\
&= y'X(X'X)^{-1}X'y - y'X(X'X)^{-1}X'y\\
&= 0
\end{align*}
$$
Comment: @Astaboom good catch, yeah there should be an $n$ there (i just fixed it).
Comment: Thanks for the input. I would have never thought of flipping the LHS to the RHS and equate the whole thing to 0. Nice. Though, just one minor point: when you wrote $\sum (-2 \bar{y} y_i + 2 \bar{y} \hat{y}_i) = -2\bar{y}^2 + 2 \bar{y}$, you actually meant $-2n\bar{y}^2 + 2 n \bar{y}$, right? After all, I do see that $\sum y_i = \sum \hat{y}_i  = n \bar{y}$.
Comment: And going by the matrix form does make everything simpler by a mile. It's uncanny how simple it becomes.


What would happen to the magnetic fields of a solenoid if it were wrapped around a hollow ferromagnetic core?

Question: I'm well aware that a solenoid wrapped around a solid ferromagnetic core produces a stronger magnetic field, but what about a hollow ferromagnetic core? Would the fields farther from the center near the hollow ferromagnetic core become more powerful, or would the middle of the field become more powerful? If something else happens do say so! I'm seeking to understand the fields produced by such a setup.
Answer: The magnetic field would be concentrated in the areas occupied by the mass of the ferromagnetic core. The empty centre of the core would be largely devoid of magnetic lines of flux. This usually means that there will be a higher level of flux density in the material mass of the core compared to a solid core.
However, at the ends of the core (where air dominates), the flux lines would rapidly become very similar the those lines of a solid ferromagnetic core.
Comment: The magnetic field will travel (in the main) via the path of lowest reluctance and the centre of the tube will have high reluctance and there'll be hardly any field in this region but, it depends how much permeability the ferrous material has. So, the flux path has a low reluctance path in parallel with a high reluctance path (air) and it's the same as a high resistance in parallel with a low resistance in that most of the current flows through the low resistance.
Comment: can you point us to a derivation?  Your answer above sounds very reasonable to me.
Comment: @relayman357 which bit do you need deriving? There is [this answer](https://electronics.stackexchange.com/questions/409779/coil-area-vs-core-area) that discusses the flux in a core-tube where there is a significant distance between the core and the windings. It's all about reluctances in parallel. It represents very much a worse case example of the above question so it might be useful to you?
Comment: Thanks Andy, that is helpful.  I was just hopeful this was one of those cases where a nice derivation existed for the magnetic field at center of the hollow cylinder.
Answer: I'm adding this in an answer just so i can show the graphic - the results seem to agree with how Andy explains it in his answer and subsequent comments (Charles answer as well).  I did this model in the free 2-d FEMM software.  I started with the .fem file from this neat page and watched this video to learn how to use the simple program.

The clear rectangle is one side of the current carrying coil that wraps around the inner hollow cylinder.  The inner hollow cylinder is M-19 steel.  Inside the hollow cylinder (far left) is air.  If you take the mirror image of this and place it on the left you can imagine a 2-d view of the full thing.
The magnetic field lines really pack into the low reluctance cylinder, much less in the air in the hollow.  My first look at FEMM, seems like great tool.  Also, all the blue is air.
EDIT:  In the image below i created a mirror image and stuck them together.  If you imagine a vertical field line in the center i think you would have a fair understanding of the field (at least this 2-d slice).
Answer: Iron provides the easiest path for magnetic flux. The flux will be concentrated in that path the extent that is doesn't need to go too far in the air to get to that path. The magnetic field will try to move whatever iron is nearby to become a part of that path. Without the iron, the magnetic field would tend to go through the center and around the outside to the other end. Whatever you put in that path will cause a stronger force to close the part that you leave open. The strongest force would result from a layer of iron in the inside, connecting on one end to another layer on the outside of the coil. That would give the maximum force to pull something to close the open end.
Answer: The magnetic field inside a long solenoid of homogenous material (all air, all ferro rod etc...) is homogenous: the field strength (density of field lines) is the same near/at the center of the core as it is near the edge of the core where the windings are.
If the core of the solenoid is not homogenous, and composed of a hollow cylinder, as in your case, then the H field is still homogenous all around, since it only depends on current that generates it (current density specifically, but that gets into the details of Maxwell's equations).
The H field depends on current only, and not material. The B field depends on H and the permeability plus any magnetization, and so where the permeability varies so does the B field.
The flux is the integral of the B field at a surface. By summing the B field across the inner of the solenoid we can calculate the total flux inside the solenoid. The flux is increased if measured through materials with higher permeability. The flux determines the inductance L of a coil inductor, even if it is an air inductor, or a straight wire.
That's why the "flux is concentrated" in a metal or ferro-metallic core. The B field, -and not H- is the bases for flux, and it is much stronger there, and relative to the surrounding air it appears "concentrated". Where the B field is stronger, the "B lines" are drawn closer together. Each line represents the direction of the B field, and their proximity represents the strength.
The total flux in a solenoid core that is part ferromagnetic and part air (as in the cross section of your cylinder) will be less than if it is all-ferromagnetic.
But the magnetic H field and the B field are not zero in the air inside the cylinder, and the H field is homogenous.


On what types of datasets do tree-based models not do well?

Question: Are there examples where splitting on the best feature/threshold combination is not actually the best way to split the tree, and that better results could be got by choosing a different feature but with a lower gain at that time? Where it makes sense to defer the use of particular features until further down in the tree?
Comment: Related, but not a duplicate: https://stats.stackexchange.com/questions/112148/when-to-avoid-random-forest/228786#228786
Answer: I think this could be the case if a feature exhibits either spurious correlation with the target, or the relationship with the target changes over time. In both of these cases splitting on the "best" feature can result in overfitting. The former can usually be fixed with more data; the latter is a problem for ML in general.
In practice, it may be worth trying feature subsampling, e.g. if you are using gradient boosted trees. This may prevent a few "good" features that don't end up generalizing well from dominating your trees. You could also try removing some of the most "important" features according to your model.
Comment: I'm not so concerned with overfitting actually. What's happening is that the most 'obvious' features are used in the first couple of splits, and then further down, when it starts to introduce new features, there are much fewer examples in the nodes => and I wonder is this impacting its ability to learn stuff beyond the most obvious?