How to train in order to perform a "good" drum solo?

Question: This question might be a little weird, but I was wondering, since there are a lot of different ways to perform a drum solo, how to practice for them.
I'm looking forward to play something clean, not the noisy ones sounding more like an elephant jumping on a desk than real music. Two of my favourite solo drummers are Simon Phillips and Tal Bergman.
But even after long years of training, I still don't manage to do a proper drum solo. I mean, I can punch everywhere in the tempo without any problem, but it's not well structured, and a little messy. So every live concert I do, I try to avoid this part as much as possible, and it goes over and over again.
So, how can I do if I want to improve myself in soloing on drums?
Answer: With any solo, you want to tell a story.  The licks, riffs and grooves are your words.  Writers structure stories as narrative arcs.
A narrative arc is usually:

Exposition: The introduction the story in which characters are introduced, setting is revealed.
Rising Action: A series of events that complicate matters for the protagonist, creating a rise in the story's suspense or tension.
Climax: The point of greatest tension in the story and the turning point in the narrative arc from rising action to falling action.
Falling Action (Anti-climax): After the climax, the unfolding of events in a story's plot and the release of tension leading toward the resolution.
Resolution: The end of the story, typically, in which the problems of the story and of the protagonists are resolved.

In good stories there's usually a series of rising actions (and slight falling actions) that gradually get bigger to the big climax and the resolution of the story.
So a (longer) drum story might go like this:

Exposition: splash cymbal then a phat beat that's a slight elaboration of the original groove.
Rising Action 1: Move the groove to different parts of the kit
Falling Action 1: Start removing parts of the groove, maybe all the way down to the kick and a light tap on the snare
Rising Action 2: Add back the removed but now elaborated parts and add splash cymbal
Falling Action 2: Remove splash
Rising Action 3: Start playing a completely different groove
Falling Action 3: Go back to original groove
Rising Action 4: Start combining parts of the original groove and the new groove and switching between the two. This is dialog and conflict and interesting.
Rising Action 5: Keep combining and switching until combined groove is now really intense and difficult to play and busy.
Falling Action: Take out the parts that jar (or skip this step)
Climax: Add your special sauce, whatever makes listeners go "Woo!"
Resolution: back to the original groove a little quieter and less busy than before your solo.

(Bonus points to nerds who noticed that this drum solo is in sonata form.)
The conflict in the rising actions are usually described musicians as "tension and release" and the tension can be anything that is unsettled: busy vs. sparse, funky vs. straight, quiet vs. loud, toms vs cymbals, playing behind the beat or in front of the beat, slow vs. fast, etc.
Comment: I was exactly thinking about this solo by the way, really clean. Didn't realize the different parts of the solo were making such a "regular scheme" though. Thanks!


Quadratic equation with natural number coefficients

Question: Let $a,b,c $ be Natural Numbers, such that roots of the equation $ax^2-bx+c=0$ are distinct and both lie in the interval

(0,1)
(1,2)
(2,3)

(Brackets signify open interval, roots are  $IN BETWEEN $ the numbers in each part.)
Find minimum possible value of $a, b, c.$
On my part, I solved for part 1, i.e. for distinct roots between (0,1). But for the next two parts, the things are getting a too bit messy.
While it may have similarity in question for given part 1 in stack exchange, there is no generalized method so that we can solve for other such intervals.
So please help, I am new to stack exchange.
For part 3, I tried by taking $0<m-2, 3-m, n-2, 3-n <1$ where m, n are the roots of the equation, and then using A. M. - G. M method, but i failed.
Please check another question of this type, But please don't provide with such answers as given in the link, as this is a question of an entrance exam, to be solved by hand, and not wolfram mathematica.
Consider the quadratic equation $ax^2-bx+c=0, a,b,c \in N. $ If the given equation has two distinct real root...
Please also tell me whether such numbers correspond to any famous known series.
Many are telling that there can be no such coefficients, then for part 1, please check $5x^2-5x+1=0$. It has it's roots between 0 and 1, and the coefficients are natural numbers to be sure, namely $a=5,b=5,c=1$.
Comment: I want to say that the roots are between, say for example, in between 2 and 3, and the equation has natural numbers as coefficients. Find the least  possible such natural number coefficients.
Comment: The midpoint between the roots is $\frac{b}{2a}$. Since the midpoint should be in the interval, that gives you two linear inequalitties. For example, for $(1,2)$ it gives $2a<b<4a$. The distance from the roots to their midpoint is $\frac{\sqrt{b^2-4ac}}{2a}$. This distance should be smaller than the distance from the midpoint to the endpoints of the interval. This gives two more linear inequalities. In the same example $\frac{\sqrt{b^2-4ac}}{2a}<\frac{b}{2a}-1$ gives $0<a+c-b$, and $\frac{\sqrt{b^2-4ac}}{2a}<2-\frac{b}{2a}$ gives $0<4a+c-4b$.
Comment: I tried all this, but without results. There are no bounds for any of the integral coefficient. I would like you to please provide the entire solution, I am just stuck.
Comment: The bounds come from the coefficients being natural numbers. Once you have one solution, there are a finite number of smaller possibilities.
Comment: Those are bounds on the coefficients. The locus where each inequality is an equality are planes. You can draw those planes in $3$-D Cartesian coordinates and pick those integer points in the first octant that lie inside the approprieate half-spaces.
Comment: The other thing is. If you have solved the first problem, then you have the solution for the other two. If $p(x)=0$ is one of those quadratics with its roots in $(0,1)$, then $p(x-1)$ has its roots in $(1,2)$. Likewise $p(x-2)$ has its roots in $(2,3)$.
Comment: @logarithm That is a neat observation. It doesn't find the minimum directly, but I think if it is possible to prove $a\gt 4$, this would be enough. It certainly finds a polynomial of the shape required.
Answer: So multiply through by $4a$ to obtain $$4a^2x^2-4abx+4ac=(2ax-b)^2+4ac-b^2$$
Now with $a$ positive the quadratic has a minimum value at $x=\cfrac b{2a}$ and the value must be negative at this point so that $4ac-b^2\lt 0$. You also need $\cfrac b{2a}$ in the relevant range of values for $x$, and if the range is the interval $(p,q)$ you need the values at $p$ and $q$ to be positive.
The question is then about controlling for these conditions whilst keeping $a,b,c$ small.

So let's try it for the interval $(2,3)$
We need $4a-2b+c\gt 0$ and $9a-3b+c\gt 0$ from the conditions at the endpoints.
We also need $2\lt \frac b{2a}\lt 3$ ie $4a\lt b\lt 6a$
The smallest possible value of $a$ is $1$ which would make $b=5$ and we'd need $-6+c\gt 0$ ie $c\gt 6$
Now $4ac-b^2=4c-25$ must be negative and that is impossible for $c\gt 6$
So try $a=2$ with $b=9,10,11$
With $b=9$ we need$-10+c\gt 0$ and $-9+c\gt 0$ ie $c\gt 10$, and $8c-81\lt 0$ which is impossible for $c\gt 10$
With $b=10$ we get $c\gt 12$ and need $8c-100 \lt 0$ which is again impossible. But there is more margin here than with $a=1$ or with the asymmetric $b=9$.
Looking to be efficient, let's try for a symmetric solution with $a$ as small as possible and $b=5a$. We can the check other possibilities later.
The edge conditions are then $4a-10a+c\gt 0$ and $9a-15a+c\gt 0$ ie $c\gt 6a$
(or for later $4c\gt 24a$)
Then $4ac-b^2=4ac-25a^2\lt 0$ so that $25a\gt 4c\gt 24a$. So we need $a$ large enough that there is a multiple of $4$ between $24a$ (which is divisible by $4$) and $25a$. The least value of $a$ is $5$ and gives $b=25$ and $c=31$
I will leave you to do the extra checking. It is tedious going through the cases, but perfectly possible to do.
Note that (as suggested in comments) this is $5(x-2)^2-5(x-2)+1$
Comment: I know that, but that doesn't provide the answer, it is merely an equation
Comment: There can be more equation like taking the higher root less than upper bound, f(x) >0 at the two bounds and so on, but non provides the answer
Comment: @user10595795 I have added some workings to show what I intended. All the steps are straightforward. I have shown a polynomial for $(2,3)$ but left some work for you to do.
Comment: I must admit that you have done it quite correctly, but this is just one of the question among 54 other questions to be solved within 3 hours, namely jee advanced. Can you provide a solution which is less tedious and can be solved in such a time crunch?
Answer: Hint:
A quadratic polynomial $ax^2-bx+c \in\mathbf R[x]$ has distinct reals in the interval $(\alpha,\beta)$ id and only if

It has two distinct roots, i.e. $\;b^2>4ac$
Neither $\alpha$ nor $\beta$ separate the roots, i.e. $\begin{cases}a\mkern1mu p(\alpha)>0,\\a\mkern1mup(\beta)>0.\end{cases}$
The arithmetic mean of the roots is in $(\alpha,\beta)$, which is equivalent to
$$(b-2a\alpha)(b-2a\beta)<0.$$
Comment: This is something even i tried, but it literally provides nothing. I think i have provided what i tried in the comments and the question, kindly please read it.


Non-catchable FileNotFoundException when using XmlReader.Create

Question: I am currently designing a program where a string array saves every time a button is pushed and loads at the start of the program. I have two issues: one, when trying to load the file, it hits the using statement and it gives me the exception of System.IO.FileNotFoundException. Later after the third button pushed, it gives me the exception of System.UnauthorizedAccessException and crashes with a System.Exception. Any ideas on how I can fix this? Note: this runs on Windows 8.
public static void excecuteload()
{
    try
    {
        XmlSerializer ser = new XmlSerializer(typeof(string[]));
        string[] loadednames;
        using (XmlReader reader = XmlReader.Create("filenamestr")) //Causes an exception: System.IO.FileNotFoundException
        {
            loadednames = (string[])ser.Deserialize(reader);
        }
        names = (string[])loadednames.Clone();
    }
    catch (Exception)
    {
        ;
    }
}
public async static void excecutesave()
{
    try
    {
        StorageFolder folder = ApplicationData.Current.RoamingFolder;
        XmlWriterSettings setstr = new XmlWriterSettings();
        setstr.Encoding = Encoding.Unicode;
        XmlObjectSerializer serializerstr = new DataContractSerializer(typeof(string[])); //Gives error of System.UnauthorizedAccessException on the third go through
        Stream streamstr = await folder.OpenStreamForWriteAsync("filenamestr", CreationCollisionOption.ReplaceExisting);
        XmlWriter writerstr = XmlWriter.Create(streamstr, setstr);
        serializerstr.WriteObject(writerstr, names);

    }
    catch (Exception)
    {
        MessageDialog oops = new MessageDialog("Oops... we couldn't save your score :(");
        oops.ShowAsync();
     }
}

Comment: Note how I updated the title and refined the tags. There is no need to worry about "Serialization" when the file can't be read by XmlReader. Focus on and report the *immediate* problem (and only ask about *one* problem/question per post) - also, generally Exceptions aren't considered "crashes". I have no idea what the UnauthorizedAccessException exception is about, but see above.
Comment: erro explain itself.FileNotFoundException so check your path
Comment: No, it actually crashed the program, despite having a catch
Comment: @user3439632 Ahh, that's indeed .. curious. (If the question is about that specifically, make sure to isolate it from everything else.)
Answer: create an XML file called filenamestr in your programs working directory.
If you want to create a file called  filenamestr.xml instead, than you have to change the using statement.
using (XmlReader reader = XmlReader.Create("filenamestr.xml"))

Comment: I might be able to edit this answer to be more useful if you edit your question to tell us why you think that the file ought to be found in wherever your program is looking for it.


Gevent/Flask app not listening on external IP on Windows 2012 R2

Question: Windows 2012R2 server with the only installed feature being IIS which is listening on port 80.
I have a GEvent/Flask application that listens for inbound TCP connections on 5000 (and exposes a REST API), and cannot work out why inbound connections are not routing to the application. This is what I have checked:

The application is started and listening on port 5000
An inbound port rule is configured to allow all inbound TCP traffic on port 5000. I've more or less rules out this as an issue, as the config is identical to other ports which do route correctly and the steps outlined below fail even if the firewall is entirely disabled.
DNS is correctly configured, confirmed by Remote Access working and the IIS server responding to web requests on port 80 when targeted by DNS name
Confirmed with network guys that no firewall or filtering exists in front of the server

The following tests from Internet Explorer demonstrate the problem:

IE running on the server, connect to 'http://localhost'. SUCCESSFULLY HITS IIS
IE running on the server, connect to 'http://localhost:5000'. SUCCESSFULLY HITS THE APP
IE running on the server, connect to 'http://servername:5000' shows 'page can't
be displayed'. FAILS
IE running on remote machine, connect to 'http://servername'. SUCCESSFULLY HITS IIS.
IE running on remote machine, connect to 'http://servername:5000' shows 'page can't be
displayed.' FAILS.

I'm at a loss as to what to check next, any suggestions on what could be blocking the traffic to port 5000?
Thanks
Ian
Comment: Then it depends on how you wrote it, and that's more a Stack Overflow question. Most application frameworks (like ASP.NET Core/Kestrel) have specific settings for that (like https://docs.microsoft.com/en-us/aspnet/core/fundamentals/servers/kestrel?view=aspnetcore-3.1#endpoint-configuration)
Comment: Open the TCP ports and then set right bindings, https://docs.jexusmanager.com/tutorials/binding-diagnostics.html#background
Comment: Surely that for the situation where you want the traffic to the TCP port to route into IIS? That's not the outcome I want, I want the traffic to route directly to the application listening on port 5000.
Comment: The same applies to that application. If it only listens to localhost traffic, the behavior you observed is perfectly normal (you can reproduce the same error with IIS if you use localhost bindings). Thus, time to check the application's manual or talk to its technical support.
Comment: It's an application I wrote, so I am the user manual :-) It's simply binding to a TCP port, so I don't understand how/why it would ever know/care that the route in was via localhost, IP address or DNS entry. It'd all just resolve to the IP address, no?
Comment: It's an application I wrote, so I am the user manual :-) It's simply binding to a TCP port, so I don't understand how/why it would ever know/care that the route in was via localhost, IP address or DNS entry. It'd all just resolve to the IP address in the IP layer, no? Netstat is showing the app as bound to the single IP address of the server on port 5000.
Comment: Thanks that was helpful, you were right the Gevent framework had defaulted to binding only to localhost, though for life of me I can't see that 'feature' in their documentation. If you want to add an answer I'll mark it as accepted.
Answer: To handle incoming TCP/IP traffic, it is important to open the TCP/UDP port(s) on Windows Firewall. But that's just the first step. After that, the application must hook itself to that port and set up a binding to handle incoming packets.
In your specific case, HTTP packets for http://servername:5000 are rejected, not because of the firewall, but because that your application does not set up a proper binding at port 5000. Requests at http://localhost:5000 works, so we can assume that its binding is in fact on localhost:5000 only, as a result only localhost traffic can be handled.
To resolve this, you have several options,

Modify your application to bind to *:5000 (or +:5000),
Or set up a reverse proxy (like nginx) to bridge external traffic to localhost:5000 (in fact, that's why many frameworks by default take only localhost traffic, as they expect developers to set up a reverse proxy in front).
Answer: Further to Lex Li's answer, in this specific situation the GEvent package was selected as the production deployment option for a Flask app inline with the Flask production deployment options given here.
This configuration was chosen specifically to avoid the complexity of  a fully fledged web server such as IIS or a reverse proxy.
The Flask documentation gives the following example for deploying an application using GEvent:
from gevent.pywsgi import WSGIServer
from yourapplication import app

http_server = WSGIServer(('', 5000), app)
http_server.serve_forever()

The issue that is not clearly documented is that this configuration still only binds to the localhost, despite being listed under the section for production deployments.
The following modification to the example code causes the application to correctly bind to the external IP address on port 5000:
from gevent.pywsgi import WSGIServer
from yourapplication import app

http_server = WSGIServer(('0.0.0.0', 5000), app)
http_server.serve_forever()


How often do people in the golf tournament crowds get seriously hurt or killed by errant golf shots?

Question: You couple the guys who can hit the ball the hardest... and the greatest gatherings of people to within just feet of the fairways and greens, it would seem that crowd members would regularly be hit.
Catch someone on the temple or a weak bone, and I'd imagine there could easily be serious injury.  Yet I don't remember any big stories about this happening.  And the only remotely helpful result from Google seemed to be this Quora discussion.  Is this an under-publicized problem?  Or an insignificant danger?  Or a disaster waiting to happen?
Comment: Here's a [fairly notable story from the 2018 Ryder Cup](https://www.businessinsider.com/ryder-cup-spectator-blinded-eye-exploded-from-brooks-koepka-shot-2018-10).  If somehow it managed legal traction, might bring the issue forward more... you'd think it should be a common sense danger of attending a golf event, but we'll see.
Answer: Some internet sleuthing led me to this article from 2010 wherein the author has listed cases where being struck by a golf ball led to a fatality. The author's research has provided 8 instances of death by a golf ball over a roughly 17 year period. What is important to note is that all these deaths seem to involve amateur golfers or the unfortunate victims being on the fairway or greens at the wrong time.
On the PGA Tour, I believe this is not a major hazard as the chances of wayward shots into (significantly large) crowds would be negligible considering the skill level of the players. My research has not uncovered incidents of golf ball induced death on the PGA Tour, so it seems that this is a negligible hazard for crowds at PGA Tour events.
Edit:
Some more research led me to this feelgood story from May 2016 where an onlooker was hit on the head by PGA Tour golfer Tony Finau. There are a few more instances of such injuries on the PGA Tour. However, the odds of them being fatal are significantly less as such events usually have a competent medical staff available during the tournament, which greatly reduces the chances of injuries to players or onlookers turning fatal.
Comment: One thing I wouldn't say is that the odds of a shot into the crowds is small... despite their skill.  They miss quite a few greens/fairways per round, and you see it go into the crowd regularly watching golf on tv :-)


How to make a loop over all keys of a HashMap?

Question: I try to do it in the following way:
public String getValue(String service, String parameter) {
    String inputKey = service + ":" + parameter;
    Set keys = name2value.keySet();
    Iterator itr = keys.iterator();
    while (itr.hasNext()) {
        if (inputKey.equal(itr.next())) {
            return name2value.get(inputKey);
        }
        return "";
    }
}

And I get an error message: cannot find symbol method.equal(java.lang.Object).
I think it is because itr.next() is not considered as a string. How can I solve this problem? I tried to replace Set keys by Set<String> keys. It did not help.
Comment: Why the downvote?  This is a legitimate, specific and well-written question.  Downvoting questions just for being beginner questions will scare new users away.
Answer: The method you want is called equals not equal.
However there are a few other flaws in your code.
Firstly you should not be looping through all keys in a Map to find a specific key, just use get and/or containsKey.
The second return is also wrong.  It will return "" if the first key does not match.  If you want to return "" when none of the keys match, the return should go at the end of the method e.g.:
public String getValue(String service, String parameter) {
    String inputKey = service + ":" + parameter;
    String value = name2value.get(inputKey);
    if (value == null) {
        return "";
    } else {
        return value;
    }
}

Answer: Firstoff,The method is equals()
Secondly, cast itr.next() to string instead of Set.


Why getFrameAtIndex faster than getFrameAtTime()

Question: I'm trying to get all frames (one by one) from a video, right now I'm using this :
    int framesCount = videoInformation.getFramesCount();
    for (int i = 0; i < framesCount; i++) {
         Bitmap currentFrame = mediaMetadataRetriever.getFrameAtIndex(i);

For 5 sec video, it's take 13 seconds to extract all frames (159 frames).
Since getFrameAtIndex(i) requires API 28, I tried to use getFrameAtTime()
    long timeS = videoInformation.getDuration() / videoInformation.getFps();
    int framesCount = videoInformation.getFramesCount();
    for (int i = 0; i < framesCount; i++) {
          Bitmap currentFrame = (mediaMetadataRetriever.getFrameAtTime(i*timeS*1000, MediaMetadataRetriever.OPTION_CLOSEST_SYNC));

For the same 5 sec video, it's take almost 48sec to get all frames.
Answer: I cant speak for the native implementations for both, as both of these functions call their respective native functions, however, if you look at the getFrameAtIndex, you can see that it:
Has access to the total framecount by reading the metadata, and retrieves a frame using an index, similar to Arrays.
int frameCount = Integer.parseInt(extractMetadata(MediaMetadataRetriever.METADATA_KEY_VIDEO_FRAME_COUNT));

getFrameAtIndex() calls getFramesAtIndexInternal()
   private @NonNull List<Bitmap> getFramesAtIndexInternal(
            int frameIndex, int numFrames, @Nullable BitmapParams params) {
        if (!"yes".equals(extractMetadata(MediaMetadataRetriever.METADATA_KEY_HAS_VIDEO))) {
            throw new IllegalStateException("Does not contain video or image sequences");
        }
        int frameCount = Integer.parseInt(
                extractMetadata(MediaMetadataRetriever.METADATA_KEY_VIDEO_FRAME_COUNT));
        if (frameIndex < 0 || numFrames < 1
                || frameIndex >= frameCount
                || frameIndex > frameCount - numFrames) {
            throw new IllegalArgumentException("Invalid frameIndex or numFrames: "
                + frameIndex + ", " + numFrames);
        }
        return _getFrameAtIndex(frameIndex, numFrames, params);
    }

while getFrameAtTime is not really index based, but rather seeks/searches until it matches a Frame timestamp with the required time you passed, or the closest one:
public @Nullable Bitmap getFrameAtTime(long timeUs, @Option int option) {
    if (option < OPTION_PREVIOUS_SYNC ||
        option > OPTION_CLOSEST) {
        throw new IllegalArgumentException("Unsupported option: " + option);
    }

    return _getFrameAtTime(timeUs, option, -1 /*dst_width*/, -1 /*dst_height*/, null);
}

https://github.com/aosp-mirror/platform_frameworks_base/blob/master/media/java/android/media/MediaMetadataRetriever.java


No IP address on Windows SBS 2008

Question: We have a strange problem in our Windows SBS 2008 and it just came over a night.
The problem is that Windows says that we are not connected to any IP4 or IP6 network but it recognises that the network cable is plugged in.
The server is Domain Controller, DNS and DHCP server.
Things we have tested

Uninstall the NIC and installed the latest driver from the manufacturer
Reset both winsock and ip settings by using netsh command
Installed a new Network card (PCI), still the same problem.
Tested the network cable in another computer.
Upgraded the BIOS
Many restarts
Test both manual IP address and auto (the auto does not get the default 169)
New router

Please check the following pictures

OS is Windows 2008 (not R2)
If you see above, the command ipconfig /all does not get any IP address information at all.
Any clue, someone?
Answer: Run the Fix My Network Wizard. SBS is a different beast, and must be appeased with different tactics than other Windows Server beasts. Usually on SBS it involves wizards. The Fix My Network wizard runs through many of the things that you've already done, and more, all from a SBS-specific vantage point.
If that doesn't work, I suspect some kind of corruption in a system file that networking is reliant on. Check out running sfc /scannow. Make sure an installation disc is nearby to pull clean systems files from if the utility needs them.
Comment: Thx for answer. Already tested, without result.
Comment: @anpe Did you run `sfc` with the `/offbootdir` and `/offwindir` options set? http://social.technet.microsoft.com/Forums/en-US/winserversetup/thread/cd3d665f-3d95-4617-946d-55d8c03448fe/
Answer: I would be running the "Connect to the Internet" & "Setup your Internet address"
SBS is very picky with people not running their wizards.
Comment: Thx for answer. Already tested, without result.

No IP address on Windows SBS 2008


How do I choose which parameters to estimate in an ARMA model in python statsmodel?

Question: Say I have come to the conclusion that the model for a specific data set should be an ARMA model with parameters a1, a2, a3, a9, a10, a11 and c1, c2, c3, c9, c10, c11, c12.
How can I do a model fitting using only these parameters, and thus setting all other possible parameters to zero?
Comment: I think more detail is going to be needed for someone to answer this.
Answer: I guess that you want to estimate the $a$ and $c$ parameters of the following model:
$$
y_t = a_1 y_{t-1} + a_2 y_{t-2} + a_3 y_{t-3} + a_9 y_{t-9} + a_{10} y_{t-10} + a_{11} y_{t-11} + \varepsilon_t + c_1 \varepsilon_{t-1} + c_2 \varepsilon_{t-2} + c_3 \varepsilon_{t-3} + c_9 \varepsilon_{t-9} + c_{10} \varepsilon_{t-10} + c_{11} \varepsilon_{t-11} + c_{12} \varepsilon_{t-12}
$$
If this was a pure AR model (i.e. without any of the $c$ parameters), then you could simply run OLS on the lagged data and exclude the lags you didn't care about (like $y_{t-4}$).
However, since this is an ARMA model, you can't estimate it via OLS. Depending on the software you're using, there would be different commands.
For example, in Stata you would do (edit: added the noconstant command to not include an intercept):
arima data, ar(1 2 3 9 10 11) ma(1 2 3 9 10 11 12) noconstant

and in Statsmodels (Python library) you would do:
ar_order = np.ones(11)
ar_order[[3, 4, 5, 6, 7]] = 0
ma_order = np.ones(12)
ma_order[[3, 4, 5, 6, 7]] = 0
mod = sm.tsa.SARIMAX(data, order=(ar_order, 0, ma_order))
res = mod.fit()

(The reason you set the 3, 4, 5, 6, and 7 indexes to zero is that python arrays are zero-indexed, so this corresponds to lags 4, 5, 6, 7, and 8).
the result of e.g. the Python call is:
                                               Statespace Model Results
======================================================================================================================
Dep. Variable:                                                              y   No. Observations:                  123
Model:             SARIMAX((1, 2, 3, 9, 10, 11), 0, (1, 2, 3, 9, 10, 11, 12))   Log Likelihood                 382.923
Date:                                                        Thu, 22 Dec 2016   AIC                           -737.845
Time:                                                                19:26:13   BIC                           -698.475
Sample:                                                                     0   HQIC                          -721.853
                                                                        - 123
Covariance Type:                                                          opg
==============================================================================
                 coef    std err          z      P>|z|      [0.025      0.975]
------------------------------------------------------------------------------
ar.L1          0.4821      1.671      0.288      0.773      -2.794       3.758
ar.L2          0.4694      1.962      0.239      0.811      -3.376       4.315
ar.L3         -0.0187      1.111     -0.017      0.987      -2.195       2.158
ar.L9         -0.1609      0.494     -0.326      0.745      -1.129       0.807
ar.L10         0.2037      0.791      0.258      0.797      -1.347       1.754
ar.L11         0.0034      0.717      0.005      0.996      -1.402       1.409
ma.L1         -0.0472      1.705     -0.028      0.978      -3.389       3.295
ma.L2         -0.2908      1.428     -0.204      0.839      -3.090       2.508
ma.L3         -0.0534      0.615     -0.087      0.931      -1.258       1.152
ma.L9          0.0396      0.477      0.083      0.934      -0.895       0.975
ma.L10        -0.1194      0.601     -0.199      0.843      -1.298       1.059
ma.L11        -0.0876      0.388     -0.226      0.821      -0.848       0.673
ma.L12        -0.0665      0.272     -0.244      0.807      -0.600       0.467
sigma2         0.0001   1.01e-05     11.306      0.000    9.43e-05       0.000
===================================================================================
Ljung-Box (Q):                       29.93   Jarque-Bera (JB):                63.00
Prob(Q):                              0.88   Prob(JB):                         0.00
Heteroskedasticity (H):               3.04   Skew:                             0.42
Prob(H) (two-sided):                  0.00   Kurtosis:                         6.41
===================================================================================

Warnings:
[1] Covariance matrix calculated using the outer product of gradients (complex-step).

Answer: If you want the other parameters to be set to zero for the entire model, you simply don't include the other variables. I'm not sure exactly what kinds of data you're working with, but it seems like you're examining 11 or 12 "things" with an "a" parameter and a "c" parameter. As I understand you, you've collected data with a4, c4, a5, c5, etc., and you've decided you do not want those in your model.
You're under no obligation to include all your data in the ARIMA model. Simply run it with the variables you listed and no others. If you require speciffics, please let us know what software you're working with.
You may or may not need to explain why you decided not to include variables 4, 5, etc. in the final model. For example, "p<.10 was used as cutoff for inclusion in the model. Additionally, item 7 was excluded due to an insufficient number of observations to allow for quality analysis. The final model used items 1, 2, 3, 9, 10, 11, and 12 to explain [the dependent variable]."


What is the norm of this operator?

Question: Consider the Banach space $B=C[-1,1]$, with $\sup$ norm, for $f\in B$ define $\tilde f(x)=f(|x|)$, $T:B\rightarrow B, T(f)=\tilde f$ we need to show $T$ is a bounded linear operator on $B$, what is $||T||?$
$T(cf+g)= (f+g)(|x|)=cf(|x|)+ g(|x|)=c\tilde f+\tilde g$ so $T$ is linear as we know continous functions over compact set is bounded so clearly $T$ is bounded?
I am not able to determine $||T||$.
Comment: The domain of $T$ is $B$ not $[-1,1]$.
Answer: $$ \|T\| = \sup_{\|f\|_\infty = 1, f \in B} \|Tf\|_\infty = \sup_{\|f\|_\infty = 1, f \in C[0,1]} \|f\|_\infty  = 1$$
Hence $T$ is bounded.
Comment: just to recall myself, $||T||=sup_{||x||=1}||T(x)||$?
Comment: @Flute Well, that is one of [many](http://en.wikipedia.org/wiki/Operator_norm#Equivalent_definitions).

What is the norm of this operator?


Having a bit of trouble reading in a file that contains specific information in each line

Question: So I am having trouble reading in a file. The file contains 2 integers in the first line, and the rest of the file contains Strings in seperate lines. For some reason my logic in this code, it does not seem to consume each line in the file correctly. I tried to troubleshoot this by printing out what was happening, and it seems like the second nextLine() is not even executing.
<code>  while(inputFile.hasNext())
    {
        try
        {
            String start = inputFile.nextLine();
            System.out.println(start); // tried to troubleshoot here
            String [] rowsAndCols = start.split(" "); // part where it should read the first two integers
            System.out.println(rowsAndCols[0]); // tried to troubleshoot here
            int rows = Integer.parseInt(rowsAndCols[0]);
            int cols = Integer.parseInt(rowsAndCols[1]);
            cell = new MazeCell.CellType[rows+2][cols+2];

            String mazeStart = inputFile.nextLine(); // part where it should begin to read the rest of the file containing strings
            String [] mazeRowsAndCols = mazeStart.split(" ");
            MazeCell.CellType cell2Add;
</code>
Comment: `while(inputFile.hasNextLine()) ....`
Comment: Welcome!   You're going to want to give us a little more to go on.   Please show us more of the code, and what you're expecting to happen, and what is happening.   We can't see how inputFile is created or opened, and your while/try blocks aren't complete (feel free to remove irrelevant bits, but make the structure complete).
Comment: Still having issues where each line is read in through String start = inputFile.nextLine();
Comment: We need more to go on, but one thing to look at, if the first line of the file is the only one that contains the rows and cols, you'll want to read and parse that line outside of the loop.  Right now, it's trying to read two lines each cycle through the while loop.
Answer: Based upon your description above, only the first line contains Integers, so your while loop is wrong as it is trying to convert every line into Integers.
Split into the code into
<code>if (inputFile.hasNextLine())
{
    String start = inputFile.nextLine();
    String [] rowsAndCols = start.split(" "); // part where it should read the first two integers
    int rows = Integer.parseInt(rowsAndCols[0]);
    int cols = Integer.parseInt(rowsAndCols[1]);
}
</code>
then a while loop for the String reading


How to do something when available with jQuery?

Question: I've loaded a <textarea> with javascript,
and need to focus on it as soon as it's available.
The live() in jQuery must specify a "type" which doesn't exists in my case.
I need to do something like below:
$('#target').onAvailable($('#target').focus());

How to implement this with jQuery?
Comment: http://stackoverflow.com/questions/1387414/is-there-a-onavailable-function-in-jquery
Answer: Use a callback:
$("...").load("/something/to/load.html", function() {
  $("textarea", this).focus();
});

Comment: you can still add a callback there
Comment: In fact I'm doing something like :
$('#loader').clone().removeAttr('id').load("Views/chatBox.html").appendTo('body');


Logically Equivalent? $(((P\land R) \rightarrow (\lnot P \lor Q)) \lor (\lnot(P \land \lnot Q))$ and $ \lnot P \lor (\lnot Q \rightarrow \lnot R)$

Question: I've been working through Logical Equivalence problems, and this one seems to have gotten me stuck! Can somebody help?
I'm trying to use Logical Equivalence Laws to show the LHS is equivalent to RHS
$$(((P\land R) \rightarrow (\lnot P \lor Q)) \lor (\lnot(P \land \lnot Q))
\equiv  \lnot P \lor (\lnot Q \rightarrow \lnot R)$$
Comment: What exactly is the problem? Do you need to show that this is a tautology?
Comment: @mrp - I need to show the Left Hand Side is equal to the Right Hand Side
Comment: For this kind of problems, just reduce each side separately by eliminating implications and equivalences and using absorption and distributivity to get as simple forms as possible before trying to make them match. Unless cunningly designed, almost all such problems will be solved easily.
Answer: $$\begin{align}(((P\land R) \rightarrow (\lnot P \lor Q)) \lor (\lnot(P \land \lnot Q))
& \equiv  ((\lnot(P \land R) \lor (\lnot P \lor Q)) \lor (\lnot (P \land \lnot Q))\tag{1}\\ \\
&\equiv \lnot P \lor \lnot R \lor \lnot P \lor Q \lor \lnot P \lor  Q\tag{2}\\\\
&\equiv \lnot P \lor \lnot R \lor Q \tag{3}\\ \\
&\equiv\lnot P \lor (R\rightarrow Q) \tag{4}\\ \\
&\equiv  \lnot P \lor (\lnot Q \rightarrow \lnot R)\tag{5}
\end{align}$$
Comment: How did you get from line 2 to line 3?
Comment: It's called simplification (some call it reiteration): $P\lor P \equiv P$ and also (not needed here) $P \land P \equiv P$. (Also, by associativity and commutativity, you can rearrange the propositions so you have the repetitions side by side. Note: I just numbered the lines. Did you mean $(2) \to (3)$? Or $(1)\to (2)$?
Comment: Yes from (2) - (3)
Answer: $[[(P\land R)\implies(\neg P\lor Q)]\lor\neg(P\land\neg Q)]\equiv$
$[[\neg(P\lor R)\lor(\neg P\lor Q)]\lor(\neg P\lor Q)]\equiv$
$[[(\neg P\lor\neg R)\lor(\neg P\lor Q)]\lor(\neg P\lor Q)]\equiv$
$[(\neg P\lor (\neg R\lor Q))\lor (\neg P\lor Q)]\equiv$
$(\neg P\lor\neg R\lor Q)$ (The rest are eliminated because they are already present)$\equiv[\neg P\lor (Q\lor\neg R)]\equiv$
$[\neg P\lor (\neg(\neg Q)\implies \neg R)]\equiv$ (contraposition)


Clarify $\lambda - \frac{\lambda(\lambda - 1)}{2!} + \frac{\lambda(\lambda-1)(\lambda-2)}{3!}-\ldots = 1 - (1-1)^\lambda = 1$.

Question: The expression
$\lambda - \frac{\lambda(\lambda - 1)}{2!} + \frac{\lambda(\lambda-1)(\lambda-2)}{3!}-\ldots = 1 - (1-1)^\lambda = 1$.
arises from a derivation of Euler's totient $\phi(n)$ that uses inclusion/exclusion rather than induction. The expression appears in G.B. Mathews' book Number Theory. It isn't necessary to read his derivation for the totient in which this expression arises, but that is the context, in case anyone is interested.
By successively factoring $\lambda, \lambda-1, \ldots$ I can see how it works intuitively, for example
$$\lambda(1-(\lambda-1)(1+(\lambda-2)(\frac{1}{3!}-\frac{\lambda-3}{4!}+\ldots)))$$
leads to cancellation of $\lambda$.
My main questions are how one sees that this precisely is 1 minus the binomial expansion $(1-1)^\lambda$ and how one deals with whether or not $\lambda$ is even or odd (hence affecting whether the cancellation in my intuitive statement results in a $\lambda$ left over or not).
Comment: The problem is an easy consequence of binomial theorem if $\lambda$ is positive integer. The result is true even if $\lambda$ is a positive real number and then the result follows from general binomial theorem.
Answer: You have by the binomial formula that
$$(a+b)^n=\sum_{k=0}^n\binom{n}{k}a^{n-k} b^{k}$$
so if you put $a=-b=1$ you get
$$(1-1)^\lambda=\sum_{k=0}^\lambda\frac{\lambda!}{k!(\lambda-k)!}(-1)^k=1-\frac{\lambda}{1!}+\frac{\lambda(\lambda-1)}{2!}-\dots\pm \frac{\lambda!}{(\lambda-1)!\cdot 1!}\mp\frac{\lambda!}{\lambda!\cdot 0!}$$
which is exactly what is claimed.


Post hoc test of adjusted means (after ANCOVA)

Question: When doing ANCOVAs, software usually gives both unadjusted means as well as adjusted means. However, the post hoc tests for most statistical programs are limited to unadjusted means. Yet, sometimes, if one is doing an ANCOVA, post hoc comparisons of adjusted means is what is desired, not the unadjusted comparisons. Or am I mistaken – should post hoc tests of adjusted means be avoided for some reason?
Post hoc tests for adjusted means have been around for quite some time, such as the GT2 method of Hochberg (1974). A modified version of the GT2 test appears in Sokal and Rohlf's Biometry (1981 2nd edition, and presumably in newer versions) specifically for adjusted means. There is also the T-method (Spjotvoll and Stoline 1973), also modified in Sokal and Rohlf (1981) for comparing adjusted means.
Why then do statistical programs not give post hoc tests for adjusted means, if one wants to know which treatment (A vs B, A vs C, etc) differ, after removing some of the variance of the covariate?
Hochberg, Y. 1974. Some Conservative Generalizations of the T-Method in Simultaneous Inference. Journal of Multivariate Analysis, 4:224 -234.
Spjotvoll, E, Stoline, MR. 1973. An extension of the T-method of multiple comparison to include the cases with unequal sample sizes. J Am Stat Assoc. 68:976-978.
Comment: Not the worst question ever (i.e., +1), but I somehow question that most post-hoc test report unadjusted means for the covariate. Can you give an example for at least one software?
Comment: I think you make a good argument. Sometimes post hoc analyses are done on subpopulations in which case the conditional information relative to the subpopulation would justify doing that analysis on adjusted means. However in clinical trials the only thing that really matter regarding say FDA approval of a drug is the treatment difference on the entire target population.  Post hoc subgroup analysis may be accepted as good exploratory information.  But it would not be accepted for labeling purposes.  To make a claim on subgroups would require an independent prospective trial.
Comment: @Henrik, Statistica and SPSS done all posthoc tests using the non-adjusted means. I agree that one have to be very careful when running posthoc after ANCOVA since most of the softwares that do post hoc comparison after ANCOVAs do it BUT on non-adjusted means. Bryan Paulson Tukey (BPT) test is recommended for pairwise comparison on ADJUSTED means, another procedure could be the conditional Tukey Kramer test. The SPSS has a pariwise comparison using adjusted means.
Comment: @Henrik, According to the Statistica website, "STATISTICA will always compute post-hoc tests using observed means, taking the estimate of Sigma (when appropriate, i.e., when called for by the respective test) from the overall analysis (ANOVA). For ANCOVA designs, even though all post-hoc tests are performed on **observed means**, the estimate of Sigma for the tests will be "adjusted" by the presence of covariates in the model (because the MS-error for the between-group design will have been effectively adjusted)."
Comment: @Michael Chernick, I was hoping for a more general consideration. Say I was interested in comparing concentrations of a certain protein in animals on different diets, but there was a range of ages among the animals, age also varied among treatments, and  protein concentration was proportional to age. If I want to know the differences in protein concentrations between diets, I could have age as a covariate. If I wanted to make claims whether diet A caused lower protein than diet B and C, etc, _independent_ of age, would I not want to use post hoc tests on adjusted means?
Comment: @Damian, I will look into those post hoc tests you suggest, thanks. But I guess I am wondering why the use of post hoc tests on adjusted means is not more common. Semi-rhetorical question: Do most people (non statisticians, but users of statistics) know that ANCOVA post hoc tests are often on original means?
Comment: SAS and their other program JMP do comparisons of means using adjusted means. I was unaware that anyone used unadjusted means for these tests.
Answer: Did I understand that you were looking for a software capable of calculating ANCOVA based on adjusted means? There is a free statistical software called PAST that does use adjusted means for ANCOVA.
It  is available at http://folk.uio.no/ohammer/past/
Answer: In STATISTICA (StatSoft), when performing ANCOVA, post-hoc values are related of adjusted means. Even though in top-X axis are present the "non-adjusted means".
Do the test... compare means and do the post-hoc with and without the covariates... P values are different.


Windows HPC Server 2008 R2 SP3 upgrade

Question: It's not clear to me from reading the documentation if I must update the clients, or whether I can just update the head node and compute nodes.
Does anyone have any experience of this? I don't want to update my cluster and find that my customers can no longer connect.
Answer: I have received clarification. I repeat it here in case it is useful to other HPC administrators.
It is the client PCs used for admininstration that must be updated.
It is not necessary to update the client PCs of the general HPC users.

Windows HPC Server 2008 R2 SP3 upgrade


Postfix smtp relay can send emails but not relay other hosts

Question: Use Case: We have several Eaton PDU/PSUs that don't support SSL/TLS authentication. I was tasked with building a SMTP relay server that can take the basic SMTP/25 emails and forward them to our email provider via SSL.
Note: The relay host makes the smtps connectione on 465 using stunnel.
I am at a point where my SMTP Postfix Relay Server is able to send mail successfully via our email provider, alimail. But I cannot get it to relay emails from other hosts on our network.
/etc/postfix/main.cf
smtpd_banner = mail01v-la ESMTP
inet_interfaces = all
inet_protocols = ipv4

mynetworks = 127.0.0.0/8, 10.96.80.0/24
relayhost = [127.0.0.1]:5000
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_tls_CApath = /etc/ssl/certs
smtp_use_tls = no
smtp_generic_maps = regexp:/etc/postfix/generic

/etc/postfix/sasl_passwd
[127.0.0.1]:5000 email@example.com:notifypwd

/etc/postfix/generic
/^root@(.*)$/ email@example.com

/etc/stunnel/stunnel.conf
client = yes
foreground = no

[smtps]
accept = 5000
connect = smtp.mxhichina.com:smtps

SMTP Telnet to Provider
[root@mail01v-la ~]# telnet smtp.mxhichina.com smtp
Trying 188.8.131.52...
Connected to smtp.mxhichina.com.
Escape character is '^]'.
220 smtp.aliyun-inc.com MX AliMail Server
ehlo google.come
250-smtp.aliyun-inc.com
250-STARTTLS
250-8BITMIME
250-AUTH=PLAIN LOGIN XALIOAUTH
250-AUTH PLAIN LOGIN XALIOAUTH
250-PIPELINING
250 DSN

Checking Stunnel Connection
[root@mail01v-la ~]# telnet 127.0.0.1 5000
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
220 smtp.aliyun-inc.com MX AliMail Server

Sending an Email from the Relay Server
echo "Stack Body" | mail -s "Test Subject for Stack" email@example.com

Results
Feb 14 18:30:29 mail01v-la postfix/pickup[4812]: 3194940DE2: uid=0 from=<root>
Feb 14 18:30:29 mail01v-la postfix/cleanup[4865]: 3194940DE2: message-id=<email@example.com>
Feb 14 18:30:29 mail01v-la postfix/qmgr[2606]: 3194940DE2: from=<firstname.lastname@example.com>, size=481, nrcpt=1 (queue active)
Feb 14 18:30:30 mail01v-la postfix/smtp[4867]: 3194940DE2: to=<email@example.com>, relay=127.0.0.1[127.0.0.1]:5000, delay=1.3, delays=0.01/0.01/0.85/0.46, dsn=2.0.0, status=sent (250 Data Ok: queued as freedom)
Feb 14 18:30:30 mail01v-la postfix/qmgr[2606]: 3194940DE2: removed

Email
Testing with other hosts
Random CentOS Server
/etc/postfix/main.cf

relayhost = [10.96.80.126]:5000

Result
Feb 14 18:06:52 test01v-la postfix/pickup[1247]: BB87C305A42F: uid=0 from=<root>
Feb 14 18:06:52 test01v-la postfix/cleanup[1387]: BB87C305A42F: message-id=<email@example.com>
Feb 14 18:06:52 test01v-la postfix/qmgr[1248]: BB87C305A42F: from=<email@example.com>, size=477, nrcpt=1 (queue active)
Feb 14 18:06:53 test01v-la postfix/smtp[1389]: BB87C305A42F: to=<email@example.com>, relay=10.96.80.126[10.96.80.126]:5000, delay=0.78, delays=0.01/0.01/0.61/0.15, dsn=5.0.0, status=bounced (host 10.96.80.126[10.96.80.126] said: 553 authentication is required (in reply to MAIL FROM command))

Eaton PSU
config
creds
Eaton Result
email[17131]: message error -110 in function smtp_start_session test - (Connection timed out) retrying smtp_start_session test email[17131]: Failed to connect to SMTP server 10.96.80.126:5000 with username email@example.com

__
This is my first time doing a setup like this. Theres likely a lot of holes in my knowledge that are causing me grief.

In a proper setup, do you even need to re-type credentials for any hosts that want to use the relay server? For example, in the eaton smtp config, should it be the creds of the email used in the sasl file? Or a system account permitted for forwarding with postfix? Or an account name defined in the postfix/generic file? A bit lost.
Is stunnel even the proper way I should be connecting via ssl/tls? I see starttls available in the telnet prompt for smtp.mxhichina.com.

Honestly, I think I'm overcomplicating this or am missing something obvious. If anyone has a better setup to accomodate my use case, it be greatly appreciated as well.

Switching SSL connection from Stunnel to Postfix only
Results
Feb 20 11:27:22 mail01v-la postfix/qmgr[1537]: 6B38AE5EE: from=<firstname.lastname@example.com>, size=479, nrcpt=1 (queue active)
Feb 20 11:27:22 mail01v-la postfix/smtp[1558]: CLIENT wrappermode (port smtps/465) is unimplemented
Feb 20 11:27:22 mail01v-la postfix/smtp[1558]: instead, send to (port submission/587) with STARTTLS
Feb 20 11:27:40 mail01v-la postfix/smtp[1558]: 6B38AE5EE: to=<email@example.com>, relay=smtp.mxhichina.com[18.104.22.168]:465, delay=613, delays=595/0.02/19/0, dsn=4.4.2, status=deferred (lost connection with smtp.mxhichina.com[184.108.40.206] while receiving the initial server greeting)
Feb 20 11:32:22 mail01v-la postfix/qmgr[1537]: A3F736B2: from=<firstname.lastname@example.com>, size=477, nrcpt=1 (queue active)

main.cf
inet_interfaces = all
inet_protocols = ipv4

mynetworks = 127.0.0.0/8, 10.96.80.0/24
relayhost = [smtp.mxhichina.com]:465
smtp_use_tls = yes
smtp_enforce_tls = yes
smtp_tls_wrappermode = yes

soft_bounce = yes
smtp_sasl_auth_soft_bounce = yes

/etc/postfix/sasl_passwd
smtp.mxhichina.com firstname.lastname@example.com:notifypwd

Comment: Tutorials I was following for the setup.

http://archive.eglug.org/book/export/html/1923

http://blog.tremily.us/posts/Postfix/
Answer: Your line
  mynetworks = 127.0.0.0/8, 10.96.80.1/24

Looks incorrect - you have specified a single host (not sure how it interprets the associated network.) Try changing the second entry  to 10.96.80.0/24
Comment: Thanks, good catch. Definitely need for me to connect from any hosts in that subnet. Unfortunately, still having the same issue. Do you think this looks to be an auth issue with my own smtp server, or the the provider one I'm relaying too?
Answer: As far as I can tell
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd

are used when postfix acts as a SMTP client, not a server and enables authentication of the postfix itself to the remote server. More details in http://www.postfix.org/SASL_README.html.
I think you should be enabling
smtpd_sasl_auth_enable = yes

and looking at "Enabling SASL authentication and authorization in the Postfix SMTP server" section of the abovementioned readme.
Answer: Unless you are using an old Postfix version, you don't need to configure stunnel to talk to your e-mail provider using SSL/SMTPS. Postfix >= 3.0 can do so directly by setting the following parameters in your /etc/postfix/main.cf:
relayhost = [smtp.mxhichina.com]:465
smtp_use_tls = yes
smtp_enforce_tls = yes
smtp_tls_wrappermode = yes

# Optional, but recommended to prevent mail loss
soft_bounce = yes
smtp_sasl_auth_soft_bounce = yes

Then, in your /etc/postfix/sasl_passwd, have the following entry defined:
smtp.mxhichina.com firstname.lastname@example.com:notifypwd

Once you change /etc/postfix/sasl_passwd file, make sure that the command line postmap /etc/postfix/sasl_passwd has been run. In addition, run the command line postmap -q smtp.mxhichina.com hash:/etc/postfix/sasl_passwd to ensure that authentication credentials have been stored correctly.
Reference: http://www.postfix.org/TLS_README.html#client_smtps

Regarding Eaton PSUs and the other CentOS server in your network, I believe that you just have to set the address of your relay server and the port 25/tcp as the SMTP server/relayhost:
relayhost = [10.96.80.126]:25

By doing so, Postfix server will receive e-mail messages using plain and unauthenticated SMTP connections, store them in its own e-mail queue and, then, forward messages to your provider using SSL/SMTPS connections and proper credentials.
Comment: I get the same result from before I started using Stunnel, wherein it states STARTTLS is unimplemented and recommended I use 585 instead. The documentation for that smtp server from my provider however, states to use 465. Results added in edit.
Comment: Trying to change the port to 587, I get "connection timeout"

Trying smtps, I get the same as the 465 result.
Comment: Oh, right... I overlooked the information stating that client-side SMTPS in Postfix requires at least version 3.0 to work ( http://www.postfix.org/postconf.5.html#smtp_tls_wrappermode ). That is why you are getting the message `CLIENT wrappermode (port smtps/465) is unimplemented` in your logs. Therefore, STUNNEL is required. I am going to edit my answer.
Comment: Have you tried to configure the PSU to use `10.96.80.126:25` as SMTP server? If so, please could you also provide logs from the Postfix's receiving side (`postfix/smtpd`)?
Comment: Thank you.. that was part of the issue. I was trying to use port 5000.
Answer: Thanks for the help everyone. My original setup was correct except for the port I was trying to connect to from the other clients, which should've been 25, instead of 5000.
EX. In Random CentOS Server:
/etc/postfix/main.cf

relayhost = [10.96.80.126]:25

The reason the Eaton wasn't working was because the network wasn't defined in mynetworks in /etc/postfix/main.cf and because of a routing issue to my OOB network.
Thank you all for the help.


VMMap - Why is Committed memory 13.4GB for one exe? Working Set is only 1.7GB

Question: So my question is about this one exe that seems to be eating my server's RAM up.  It is a Windows Server 2008 R2. Rebooting doesn't seem to help, as the Commit Size will remain more or less 13GB.  This came to my attention because the vendor wants more RAM because of performance issues with the program.
The main thing that worries me is that it doesn't look like the program is actually using all of the RAM it has asked for.  I haven't yet seen that Private Working Set memory get above 4GB.  I have watched the server while users are complaining about slowness and locking up workstations and it still isn't using all of the committed memory.
Is this a memory leak?  What is going on with this exe to cause this and why isn't it using all of its committed RAM when it actually needs it?
Namely I am trying to come up with concrete proof that this is the vendor's problem so the vendor stops trying to blame me.
This is a VM, as a troubleshooting step I went into the VM settings and made sure the memory was allocated properly, it is not overcommitted, and I checked "unlimited" for the memory resource allocation.
Thanks for any advice or any additional troubleshooting I can try!
Comment: Your program is leaking memory like a sieve.  Handles is also quite high.  Buying more RAM is not a fix, it just delays the moment your user has to restart your program to stop it from thrashing the machine.  Use a memory profiler to find the bugs.
Comment: That sounds like what I was getting from searching on Google.  But any advice on how to convince the program's vendor that it is their problem?  Is it the handles?  Any good memory profilers?  Thanks
Comment: Windows Performance Toolkit.
Answer: Processes in Windows don't ever "commit RAM". They commit virtual address space.

The main thing that worries me is that it doesn't look like the
  program is actually using all of the RAM it has asked for.

Programs don't "ask for RAM"! They ask for committed virtual address space.
What Windows shows as "committed" storage is not RAM. It is a guarantee of availability of virtual memory, should it actually be accessed. If it's ever used the storage may be partly in RAM and partly in the pagefile (assuming you have a pagefile).
The "working set (private)" counter shows approximately how much of the process's committed virtual address space is in RAM.  I say "approximately" because part of committed memory, after it's been in the process working set for a while, may be moved to the modified page list. From there it will be quickly written to disk and moved to the standby page list, from which the RAM can be repurposed for something else. (Or if it's brought into the process and not written to, it can be dropped from the working set directly to the standby list.)
These lists are in RAM but they're not in the working set. If the process references a page  while it's still on one of those lists, that's a page fault, but it's a soft page fault that's resolved without going to disk. It's just taken from the list and put back in the process working set.
"Committed" allocations of virtual address space will only consume, at most, as much RAM as they have actually accessed. It is not at all uncommon for a program to commit more than it actually uses on any given run... although the ratio is usually not quite this large! "At most" because the OS memory manager may remove long-ago-referenced private pages from the working set in order to free RAM for things that are being accessed more often.
If this program is causing other programs to fail with "low on memory" or "out of memory" errors, this would be an excellent time to enlarge your pagefile. Those error messages have to do with commit limit, not RAM. Enlarging your pagefile will raise the commit limit (hence eliminating the error messages) but since this program is not actually using that much RAM it won't cause any more actual pagefile IO!
The "commit" mechanism simply guarantees that once the OS has told a process "since you have successfully committed this amount of virtual memory, it is guaranteed that the OS have a place to keep it even if you happen to use it all,  later in your run." But if the program doesn't actually reference it all, the part it doesn't use doesn't take any significant physical storage anywhere. Not in RAM, not in the pagefile, not anywhere.
Answer: Profiling tools: If the program is written in .NET, try Yourkit, ants, dotTrace, etc. If native, debugging tools available through Windows Development Kit such as UMDH are good tools for tracing memory leaks. Although it will only make sense to you if you have debugging symbols for the program and its dependencies, and preferably the source code.
Although memory leaks have different culprits, if the process' memory consumption is not going gradually up, it would seem to me that the way the application is used after it got to such memory footprint doesn't leak memory anymore. Or maybe it's just inefficient. Or maybe it does require 13GB for some reason.
Now if it'll consume memory until it exhausts the resources of the computer of goes beyond the limits of the OS, then it's most likely there's a leak.
I would also recommend trying to find if any operation will trigger the leak. Giving steps to reproduce to your vendor helps.
As for your original question
check this SO question.
References

YourKit: memory profiler
RedGate: Ants memory profiler
JetBrains: DotTrace memory profiler
Microsoft: User-Mode Dump Heap (UMDH)
Answer:
The main thing that worries me is that it doesn't look like the
  program is actually using all of the RAM it has asked for. I haven't
  yet seen that Private Working Set memory get above 4GB.

It must be 32bit in which case WS will never climb higher than 4GB.
Please see my answer here.
https://stackoverflow.com/a/44615376/8177258
In Task Manager:
Working Set is NOT a measure of memory use. The Commit Charge is.
That's why Task Manager Graph from W8 now shows Committed instead of WS.
WS is the amount of - RAM - which the OS Balance Manager has locked for a process or processes. It is NOT load.
32bit applications are allowed to LOCK a maximum 4GB in RAM.
64bit can LOCK a maximum of 8GB.
On x64 (Intel64/AMD64) the WS for 32bit apps is irrelevant because address space available to any process is 256TB.
It's only limited by the CPU and available storage.
The memory in use by a 32bit application can easily be more than it's WS,
It just doesn't get counted because the 32bit API is 20 years old and pages outside 4GB are deemed to be on a pagefile.
These days half the machines out there have no pagefile and 8GB-16-32GB of RAM.
The system commit charge reported by the CPU however will still climb.
Open RamMap and look in Physical Pages for standby pages, on 32bit apps that's where the missing working set data is.
Regarding RAMMap and VMM.
RAMMapp is fantastic because it shows physical memory addresses (well to an extent). You can literally see where pages are.
Committed Memory in Task Manager is more reliable because that's what the CPU reports.
VMM shows pagefile backed for anything outside the process view because a process sees nothing outside it's little virtual world.
Even though it's improved with W7/W8/W10. Task Manager is still unreliable...Resource Monitor in W7 isn't too bad..limited though.
As someone mentioned already since the app doesn't exhaust all resources it's probably not a leak.
A leak generally occurs when committed pages are not decommited.
And I just noticed how old the OP question is...
@Rick Brant

What Windows shows as "committed" storage is not RAM. It is a
  guarantee of availability of storage, should it be needed. If it's
  ever used the storage may be partly in RAM and partly in the pagefile
  (assuming you have a pagefile).

Wrong.
Committed Memory in Task Manager is reported by the CPU.
The only pages it knows about are pages written to physical storage, either RAM or the HDD, because the CPU put them there.
The committed amount in Task Manager is absolutely RAM.
Btw, that screenshot you showed me the other day looks like it was taken on a VM.
Which Intel processor do you have that has 3 cores?
Also related: that 2nd test is leak test, the pages were not decommited it doesn't mean they aren't in RAM. PS..What makes you think DB2 is relevant?


ROW START and ROW END in SQL Server temporal tables

Question: I've been using SQL Server system-versioned temporal tables for a while now, and they seem to work really well. I need to write a query with a self-join to the subsequent version of the record, and I'm not sure I'm doing it right.
I need to find cases where a value changed from one value to another, say from "A" to "B" specifically.
Here's my query
SELECT t1.Id,
       t1.MyValue OldValue,
       c2.MyValue NewValue,
       t2.ValidFrom DateChanged
FROM MyTable FOR SYSTEM_TIME ALL t1
JOIN MyTable FOR SYSTEM_TIME ALL t2 ON t2.Id = t1.Id AND t2.ValidFrom = t1.ValidTo
WHERE t1.MyValue = 'A'
AND t2.MyValue = 'B';

"Id" is the primary key and "ValidFrom" and "ValidTo" are the ROW START and ROW END columns.
This seems to work, but I'm wondering about the reliability of that join t2.ValidFrom = t1.ValidTo

Is it always the case that the subsequent record in the history has ValidFrom exactly equal to ValidTo of the previous record? Are there ever gaps in the sequence?
Is there any possibility of two records in the history table having the same ValidFrom date?
Comment: Why do you need a self-join, why not just use `LEAD` or `LAG`?
Comment: *"Is it always the case that the subsequent record in the history has ValidFrom exactly equal to ValidTo of the previous record? Are there ever gaps in the sequence?"* - For updates yes, but this is not enforced by `PERIOD FOR` because there are valid reasons for not matching. If a record is deleted, then re-inserted the end date of the deleted record would not match the start date of the inserted record.
Comment: *"Is there any possibility of two records in the history table having the same ValidFrom date?"* - Yes - if you perform a non-deterministic update that updates the same row twice that will generate two history records, but one will have an end date that matches the start date, but that will be filtered out automatically by `FOR SYSTEM_TIME` so should not be an issue for your query. There is no possibility of two "valid" records with the same start date
Comment: @GarethD A single `UPDATE` or `MERGE` statement cannot update the same row twice. What can happen is that two statements in the same transaction happen, where `ROW START` is fixed at the beginning of the transaction.
Comment: @Charlieface Yes fair, I skim read the documentation and pretty much stopped reading after this part *"if you perform multiple updates on the same primary key"*, at which point I stopped reading I drew a conclusion in my head that this would be from a non-deterministic update as a result of a join with each of the possibilities being recorded. I should have read/thought further
Answer:
Is it always the case that the subsequent record in the history has ValidFrom exactly equal to ValidTo of the previous record? Are there ever gaps in the sequence?

That depends on what you mean by "the previous record". If you only ever do UPDATE rather than DELETE and INSERT then yes that will be the case.
But you could delete and reinsert the data, in which case it won't line up. Whether that's what you want to know about is your decision.

Is there any possibility of two records in the history table having the same ValidFrom date?

If you make two updates on the same row within the same transaction then this could happen. The ValidFrom is calculated only once at the beginning of the transaction for all rows.
Using FOR SYSTEM_TIME ALL, no it's not possible, because it uses a filter ValidFrom <> ValidTo automatically, thereby excluding such rows. The issue only appears if you query the history table directly.

A safer and more efficient option to get the next value is to just use LAG or LEAD. Do note that in the case of duplicate ValidFrom you will get non-deterministic results (if you query the history table directly), but it will still be a single row.
SELECT
  t.Id,
  t.OldMyValue AS OldValue,
  t.MyValue AS NewValue,
  t.ValidFrom AS DateChanged
FROM (
    SELECT *,
      LAG(t.MyValue) OVER (PARTITION BY t.Id ORDER BY t.ValidFrom) AS OldMyValue
    FROM MyTable FOR SYSTEM_TIME ALL t
) t
WHERE t.MyValue = 'B'
  AND t.OldMyValue = 'A';

Comment: Interesting, I didn't know that. "`FOR SYSTEM_TIME` filters out rows that have a period of validity with zero duration `(ValidFrom = ValidTo)`." https://learn.microsoft.com/en-us/sql/relational-databases/tables/temporal-tables?view=sql-server-ver16#how-do-i-query-temporal-data so in theory the results should have been the same. I note that the query plan has a `ValidFrom <> ValidTo` predicate, so it seems this is by design.
Comment: I'm not sure it would get non-deterministic results would it? Since `FOR SYSTEM_TIME` will remove any records with a period of validity with zero duration, so wouldn't it only be nondeterministic if querying the history table directly? https://dbfiddle.uk/FBtVsfKe


Can a preprocessor macro expand just some pasted parameters?

Question: I know that in expanding a function-like preprocessor macro, the # and ## tokens in the top-level substitution list essentially act "before" any macro expansions on the argument.  For example, given
#define CONCAT_NO_EXPAND(x,y,z) x ## y ## z
#define EXPAND_AND_CONCAT(x,y,z) CONCAT_NO_EXPAND(x,y,z)
#define A X
#define B Y
#define C Z

then CONCAT_NO_EXPAND(A,B,C) is the pp-token ABC, and EXPAND_AND_CONCAT(A,B,C) is the pp-token XYZ.
But what if I want to define a macro that expands just some of its arguments before pasting?  For example, I would like a macro that allows only the middle of three arguments to expand, then pastes it together with an exact unexpanded prefix and an exact unexpanded suffix, even if the prefix or suffix is the identifier of an object-like macro.  That is, if again we have
#define MAGIC(x,y,z) /* What here? */
#define A X
#define B Y
#define C Z

then MAGIC(A,B,C) is AYC.
A simple attempt like
#define EXPAND(x) x
#define MAGIC(x,y,z) x ## EXPAND(y) ## z

results in an error 'pasting ")" and "C" does not give a valid preprocessing token".  This makes sense (and I assume it's also producing the unwanted token AEXPAND).
Is there any way to get that sort of result using just standard, portable preprocessor rules? (No extra code-generating or -modifying tools.)
If not, maybe a way that works on most common implementations? Here Boost.PP would be fair game, even if it involves some compiler-specific tricks or workarounds under the hood.
If it makes any difference, I'm most interested in the preprocessor steps as defined in C++11 and C++17.
Comment: _"then `MAGIC(A,B,C)` is `AYC`."_ Well, let's agree that asking for _magic_ is at least _off-topic_.
Comment: @πάνταῥεῖ No, I disagree, this way of using "magic" (the word) to represent the solution is a good way. That way I use magic regularly at my job.
Answer: Here's a solution:
#define A X
#define B Y
#define C Z
#define PASTE3(q,r,s) q##r##s
#define MAGIC(x,y,z,...) PASTE3(x##__VA_ARGS__,y,__VA_ARGS__##z)
MACRO(A,B,C,)

Note that the invocation "requires" another argument (see below for why); but:

MACRO(A,B,C) here is compliant for C++20
MACRO(A,B,C) will "work" in many C++11/C++17 preprocessors (e.g., gnu/clang), but that is an extension not a C++11/C++17 compliant behavior

I know that in expanding a function-like preprocessor macro, the # and ## tokens in the top-level substitution list essentially act "before" any macro expansions on the argument.
To be more precise, there are four steps to macro expansion:

argument identification
argument substitution
stringification and pasting (in an unspecified order)
rescan and further replacement

Argument identification associates parameters in the macro definition with arguments in an invocation.  In this case, x associates with A, y with B, z with C, and ... with a "placemarker" (abstract empty value associated with a parameter whose argument has no tokens).  For C++ preprocessors up to C++20, use of a ... requires at least one parameter; since C++20's addition of the __VA_OPT__ feature, use of the ... in an invocation is optional.
Argument substitution is the step where arguments are expanded.  Specifically, what happens here is that for each parameter in the macro's replacement list (here, PASTE3(x##__VA_ARGS__,y,__VA_ARGS__##z)), where said parameter does not participate in a paste or stringification, the associated argument is fully expanded as if it appeared outside of an invocation; then, all mentions of that parameter in the replacement list that do not participate in stringification and paste are replaced with the expanded result.  For example, at this step for the MAGIC(A,B,C,) invocation, y is the only mentioned qualifying parameter, so B is expanded producing Y; at that point we get PASTE3(x##__VA_ARGS__,Y,__VA_ARGS__##z).
The next step applies pastes and stringification operators in no particular order.  Placemarker's are needed here specifically because you want to expand the middle and not the end, and you don't want extra stuff; i.e., to get A to not expand to X, and to stay A (as opposed to changing to "A"), you need to avoid argument substitution specifically.  a.s. is avoided in only two ways; pasting or stringifying, so if stringification doesn't work we have to paste.  And since you want that token to stay the same as what you had, you need to paste to a placemarker (which means you need one to paste to, which is why there's another parameter).
Once this macro applies the pastes to the "placemarkers", you wind up with PASTE3(A,Y,C); then there is the rescan and further replacement step, during which PASTE3 is identified as a macro invocation.  Fast forwarding, since PASTE3 pastes its arguments, a.s. doesn't apply to any of them, we do the pastes in "some order" and we wind up with AYC.
As a final note, in this solution I'm using a varying argument to produce the placemarker token precisely because it allows invocations of the form MACRO(A,B,C) in at least C++20.  I'm left-pasting that to z because that makes the addition at least potentially useful for something else (MAGIC(A,B,C,_) would use _ as a "delimiter" to produce A_Y_C).
Comment: Thanks. After I posted the question I was starting to think along the lines of using an empty argument to paste a placeholder token, but of course we have to get that empty argument from somewhere. And your last sentence made me realize I did an X-Y: in the motivation for the question, I actually do want underscore delimiters in all cases. So that's doable, with just changing the usage from `BUILD_NAME(PREFIX_, base, _SUFFIX)` to `BUILD_NAME(PREFIX, base, SUFFIX)`.
Comment: If you really want to delimit in all cases, you _could_ just use `_` instead of the placemarker (`#define MAGIC(x,y,z) PASTE3(x##_,y,_##z)`).


How to write separate instructions for piano hands

Question: Apologies for the very newbie question (I've never had any real lessons): On a piano grand staff, how do you (as the composer) properly annotate that one hand should play differently than the other?
For instance, in one piece, both hands are playing at mp loudness, yet at a certain bar I want the left hand to start playing leggiero (but not the right hand). So far I have this marked as "l.h. leggiero" on the lower staff, but I'm guessing that's not how it's actually done (and it doesn't seem to alter playback in Sibelius 8).
Seems like this would be simple to find an answer to online, yet I've spent an hour Googling and rifling through piano scores without finding a clear answer. Any help would be very appreciated.
Comment: I've seen piano scores with "il basso marcato" marked under the lower staff, so I would say your original practice isn't so incorrect.
Answer: Position the dynamics so that it's clear what stave (or even what voice within a stave) they apply to.  There's no strict 'over or under' rule.
If Sibelius playback is an issue, there are various options.  For instance, dynamics may be assigned to a single one of the four available voices, or may be set as 'all voices'.
Answer: Put instructions that only apply only to one staff above the top staff, or below the bottom staff.
Put instructions that apply to both staves centered vertically between the staves.
The fact that "Sibelius doesn't play this properly" is irrelevant, so far as notating it for humans is concerned. The fix is simple - don't use Sibelius if you want to get serious about computer playback, use a Digital Audio Workstation (DAW) app instead!
Comment: Getting a DAW isn't really an option unless I find a few hundred bucks lying around. But thanks for the tip about positioning the instructions with regard to the staves.
Comment: @Walter I use Finale, so I don't know the specifics of how to do it in Sibelius, but all you need to do is put the two staves on different MIDI channels using the same piano patch and they'll be able to have different dynamics and such (I'm not sure how much either program will actually interpret "leggiero" however). The difficulty is that you will then want to put the staves back on the same channel whenever one dynamic should apply to both again. Personally, I think it's too much work to be worth it unless the differences between the hands are severe and almost constant.


Barcode reader program: barcode Identification methods

Question: I am new in the Image processing, and I want to identify the QRCode in the image.
Actually there are three finder patterns, and at first I need to find them.
So I tried some methods, first is related with binarization, but when image has shadows and strong difference in illumination, then it is difficult to make a good binary image.
Actually the adaptive thershold depends on the size of the sliding window, which may be not good for a big barcodes. So even if I make a good binary image, can you suggest me methods of finding the barcode's finder pattern and barcode itself. The easiest way, if we talk about QRCode, is to  find all contours of the image and select those which are square shaped and inlude two square shaped contours inside.
Also another method is to scan each horizontal line of the image to find the correct finder pattern, it depends on how well the binary image was made.
So I see the way of solving this problem, but I want to know are there any other different methods of finding the finder patterns of barcode? I think pattern matching is not good here. Can you also suggest a good binarization method, which do not depend on illumination. I tried many adaptive threshold binarization methods, but they have common problem, if the image contains a big black square, then binary image will have not a whole square, but a square with some parts of white color in the middle of the square, this is because the size of sliding window in the adaptive threshold method is not big enough.
Comment: kind of duplicate... but I'm not sure. http://stackoverflow.com/questions/1580251/image-to-barcode-recognition
Comment: not exactly, I've read that topic, they are discussing about software that recognize the barcode, but I want to make barcode reader program from zero, without using other libraries.
Comment: OK,may be someone can tell me any adaptive threshold binarization algorithm, such that its window size is selected dinamically?
For example:"The Bernsen algorithm works fine as long as the
pixel neighborhood window size is set properly. The window
should fit the size of objects existing in the image. As far as it is possible to predict the object dimensions, and all of the objects
are nearly equal, it is not a major drawback."
So, in QRCode there are three finder patterns, and the window size must be greater than the size of that patterns.
Can anybody tell something about this problem?
Answer: You can look at the method used by ZXing: http://code.google.com/p/zxing/source/browse/trunk under core/src/com/google/zxing/qrcode/Detector.java
Basically it looks across the image for black-white-black-white-black in approximately a 1:1:3:1:1 pattern. Unless the angle of rotation is near 45, 135, 225, or 315 degrees, and unless the code is severely perspective-distorted, this method will find a finder pattern. It then cross-checks a couple ways -- looks vertically at that point in the image to confirm it also finds such a pattern. It also has a few more checks to throw out false positives, and then determine which pattern is which.
Answer: You could also try a Threshold Hysteresis with a rate of change control. Here is the link to the normal Threshold Hysteresis. Set the first threshold to a typical white value. Set the second threshold to less than the lowest white value in the corners.
The difference is that you want to check the difference between pixels for all values in between the first and second threshold. Ideally if the difference is positive, then act normally. But if it is negative, you only want to threshold if the difference is small.
This will be able to compensate for lighting variations, but will ignore the large changes between the background and the barcode.  The final result is a binary object image, not an image of edges.  Also there is no adaptive window to try and size properly.


Confidence interval does not contains 0, should we consider the p value? How?

Question: Here is the summary of my linear model:
Call:
lm(formula = weight ~ height, data = height and weight)

Residuals:
    Min      1Q  Median      3Q     Max
-10.267  -4.267  -1.267   6.455  11.538

Coefficients:
                 Estimate Std. Error t value Pr(>|t|)
(Intercept)       20.4878     5.8335   3.512  0.00158 **
height             0.3195     0.1447   2.208  0.03596 *
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 6.703 on 27 degrees of freedom
Multiple R-squared:  0.1529,    Adjusted R-squared:  0.1215
F-statistic: 4.873 on 1 and 27 DF,  p-value: 0.03596

And here is my confidence interval for $\hat{\beta}_1$: 0.02260012 0.61639988 at $5\%$ level.
As you can see $0 \notin $CI at $5\%$ level. Also, the $p$-value for the test $H_0: \beta_1=0$ turns out to be $0.03596 $ which is in between $0.01 <0.03596 < 0.05$.

How do I interpret this?

The p-value < 0.05 should mean that there is moderate evidence against the null hypothesis $H_0: \beta_1=0$, also, $0$ is not in CI. So should I reject the fact that $\beta_1=0$ or should I say the evidence is not strong enough?
Furthermore, what would happen if in the same situation, I would get $0 \in CI$ but still $p-$value <0.05?
What about $p-$value >0.05 but $0\in CI$?
Comment: In this case the model does not appear to be useful and the R-square measures are low.  So I would reject the model.  The use of 0.05 as a measure of significance need not be universal.
Comment: Could you explain how you obtained that confidence interval for $\beta_1$ (presumably it corresponds to `height`)?  The values you quote are inconsistent with what's shown in the output you have reproduced.
Comment: I assume the p-value > 0.05 and 0 in the CI is hypothetical.
Comment: I believe your entire question might rest on a mistaken calculation (or transcription) of the confidence interval.  Please double-check that, because it's obviously not correct.
Comment: @whuber if you write `qt(0.975,27)` you get `2.051831`. The I simply calculated the CI as follows $$\hat{\beta}_1 \pm c\cdot se(\hat{\beta}_1)$$ where $c = t_{n-2, 1-\frac{\alpha}{2}}=t_{27, 0.975} = 2.051831$ and $se(\hat{\beta}_1) = 0.1447   $ (where the standard error you get it from the summary again). Hence if you do this calculation, you get $(0.3195-2.051831 \times 0.1447, 0.3195+2.051831 \times 0.1447) = (0.0226000, 0.6163999)$  which is the CI I gave above
Comment: Thank you for showing the details.  (I had misread the value of the LCL, incidentally, and seeing the calculation made that evident.)  Now that you have done so, you have clearly shown what your CI is.    What I still don't understand is why you perceive there to be any discrepancy.  Perhaps the discussion at http://stats.stackexchange.com/questions/31/what-is-the-meaning-of-p-values-and-t-values-in-statistical-tests will settle any questions you might have about interpretation.
Comment: @whuber I had the data, I used the `lm` function to create a linear model. Then I used `summary` to generate this summary, that's it. Why do you say it is inconsistent? I might have made some typos
Comment: @MichaelChernick wait I don't understand. Why are you assuming p-value >0.05 etc? I think from the summary it explicitely say that the p-value is 0.03596, doesn't it?
Comment: I assumed that you were talking about a hypothetical case that did not pertain to the explicitly summary table that you gave in your question.
Comment: I think your title is incorrect. Should it not read "does not include"?
Comment: @MichaelChernick  I know there is some confusion. Basically I start with my specific question, but then I ask: in general if I calculate the CI and the p-value (having set a level of $\alpha$), how do I base my decision on the hypothesis test with $H_0: \beta_1 = 0$ against $H_A: \beta_1 \neq 0$? We have of course 4 cases:
$0 \in CI$ and $p-$value $>0.05$  ; $0 \in CI$ and $p-$value $<0.05$ ; $0 \notin CI$ and $p-$value $>0.05 $ ;  $0 \notin CI$ and $p-$value $<0.05$. What should be my interpretation in these four cases? (notice my case is one of them!)
Comment: @mdewey oh yes, I missed that, thank you for spotting the typo!
Answer: Cases where a) the 95% confidence interval doesn't include zero, and cases where b) p <= 0.05, don't always coincide precisely.
For some discussion on cases with the two-sample t test, see perhaps Cumming and Finch, 2005, Inference by Eye.
But also there are different ways the p value may be determined.  For example, to assess effects in a model, Wald tests could be used, or likelihood ratio tests could be used, and their results may not be precisely equal.
Likewise, confidence intervals can be constructed in different ways. For example, determining confidence intervals by bootstrap is relatively common now, and there are actual several different bootstrap approaches that could be employed.  Again, the results of the different methods won't necessarily yield precisely identical results.
Usually different statistical approaches will yield similar results, but especially in borderline cases where you are using hard cutoff (e.g. p <= 0.05 and p > 0.05 yield drastically different conclusions), different approaches may yield different results.
So what is one to do?  A good practice is to decide ahead of time what statistical approach to use, and how you will interpret the results.  If you want to use confidence intervals, use confidence intervals.  If you want to use p values, use p values.
But in all cases, remember to look at the size of the effects you are observing (in this case, Beta1 or r-squared), and the practical implications of the results.  For this model, Is a Beta1 of 0.3 practically meaningful? Is an r-squared of 0.15 practically meaningful?
Answer: First of all, it's a 95% not 5% confidence interval, and for the confidence interval (of the slope - since you use the CI ̂ 1±⋅(̂ 1)) you would say: "I am 95% confident that the true slope is between 0.02260012 and 0.61639988, for the current sample." Performing a hypothesis test would yield rejecting the null, so, there is a difference. However, your r-squared indicates your model only accounts for 15% of the variation. You either need to throw out your model or look for the lurking variable that accounts for the remaining 85%. Additionally, the p-value for height indicates that it is statistically insignificant.
Comment: I was wondering about the downvote and found the reason in your last sentence: are you sure you typed it as you intended?  If so, could you elaborate on what it is about the height's p-value that causes you to conclude it is "statistically insignificant"?


Using a Rotor Cabinet plugin on the Stereo Out channel outputs no sound when panning the input track hard right

Question: I want to use a Logic Pro Rotor Cabinet plugin on an Aux or Master track but this breaks panning from the individual track channels. Channels that are panned hard right output nothing and channels that are panned hard left output 100%. Seems like a stereo / mono problem but I've tried everything I can think of. The same doesn't occur on any other plugins.
Logic Version: 10.7.5
MacOS Version: 12.4
Comment: Maybe the plugin only takes input from the left channel, mono in. Isn't that how rotator cabinets work anyway? It's like a guitar amp, 1 mono input. If you want stereo in, stereo out, use 2 instances of the rotator simulator plugin. One rotator for the left side and another for the right side of your stereo input. Both halves of the input going to the left input of the respective plugin.
Comment: idk Logic well enough [I'm mainly Cubase], but it does seem odd that it acts like an M/S plugin, or even a stereo plugin accidentally inserted on a mono track [especially as it only has a stereo version; if you switch a track to mono, it is not offered as an option] It would be good to know what version Logic, what OS & if anyone else can repro on a different version.
Comment: Thank you all for your suggestions. My goal was to have 1 Aux track with a Rotor plugin shared by multiple tracks all with post pan sends. This was to avoid having to copy the rotor plugin to each track individually and coordinate rotor configuration changes across the tracks. From what I understand of the suggestions here, that seems impossible.
Answer: I've confirmed this behavior in Logic Pro 10.7.2, build 5556, sound library 2422.
I searched through the Apple documentation and read the complete section on the Rotor Cabinet effect and did not find anything that confirms this is how it is supposed to work, but I strongly suspect it's by design.
A real Leslie cabinet would have a mono input, so it would make sense for the plugin to have a mono input. What makes less sense is that the plugin does not sum to mono and instead only uses one channel.
It seems it is not possible to use this plugin without destroying the stereo image that exists before the plugin and creating a new stereo image with the plugin. If you want to sum to mono first so that the sound from both the right and left channels are used for the plugin, you can put a Gain plugin (under the Utility section) prior to the Rotor Cabinet and turn on the mono switch in the gain plugin (leave everything else as is).
If you want to preserve the stereo image that exists before the Rotor Cabinet, then I think your only good option is to use two aux sends with Rotor Cabinet on both. One aux send gets the left channel information sent to it, and the other gets the right channel information sent to it. Then you could adjust the balance controls on the auxes to have some residual amount of right/left as they go to the main mix.
Comment: Thanks. The pan would still need to be controlled from the Aux channel in this configuration unless I am misunderstanding your suggestion? I need to control the pan from the individual tracks themselves using the Post Pan option, otherwise I'll just have to use the Rotor directly on the track itself and copy the plugin across the required tracks.
Comment: It does kind of make sense for it to be mono in/stereo out, as that's what a real Leslie is. The arbitrary 'right only' makes little sense, though. The unfortunate thing about setting up two rotors is that you won't be able to sync them, you'll in effect have two Leslie cabs. The other thing about Leslie cabs is they *always* used to be panned as mono, even if 2 mics were used. Your classic 60s/70s Leslie has no spread. idk Logic's Rotor specifically, but I used to always narrow any Hammond/Leslie effect to sound 'more authentic'.


Options +/- interaction with All, which is default in 2.2 but not default in 2.4

Question: I have a series of servers which I am upgrading from 2.0/2.2 to 2.4. The previous admins made rather a hash of various  Options. I am confused because the 2.0/2.2 documentation say that Options All (which is "all but MultiViews") is the default, whereas in 2.4 the default has changed to FollowSymLinks. I am also confused about what are the relationship of the options for the parent directory vs the options for the child directory -- what gets inherited? This is my problem child...
<Directory />
    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all
</Directory>
<Directory "/opt/apache/netegrity/webagent/pw/">
    Options -Indexes MultiViews ExecCGI
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>

Ok, this is 2.2, where the documentation definitely scolds you for mixing +/- with non+/- Options in the same line, but does start your server. So what are the options being set for /opt/apache/netegrity/webagent/pw/ in this code? Does the pw directory inherit FollowSymLinks and set MultiViews & ExecCGI, and the -Indexes is nonsense because Indexes isn't on anyway? If the second Options directive were only
    Options MultiViews ExecCGI

would Indexes be turned on or not for /opt/apache/netegrity/webagent/pw/? What about FollowSymLinks? I know how this evolved -- that second Options directive started out created by the webagent installer, and was
    Options Indexes MultiViews ExecCGI

but then the admins wanted to take Indexes away, so they stuck a minus sign in front of it. I think (if I'm reading the documentation correctly) that the way you turn indexes off is to just leave it out, not stick minus signs in.
So we come to the money question, which is how to port this from 2.2 to 2.4 syntax. Since the Options default is now FollowSymLinks rather than All, we can leave it out
<Directory />
    AllowOverride none
    Require all denied
</Directory>

right? And The CA people suggest this setting for /opt/apache/CA/webagent/pw/
<Directory "/opt/apache/CA/webagent/pw/">
    Options Indexes MultiViews ExecCGI
    AllowOverride None
    Require all granted
</Directory>

So if we wanted to remove Indexes, do we just leave it off entirely, with no minused option?
<Directory "/opt/apache/CA/webagent/pw/">
    Options MultiViews ExecCGI
    AllowOverride None
    Require all granted
</Directory>

And, the last question, is FollowSymLinks set for /opt/apache/CA/webagent/pw/ implicitly because it is set for  ? Or is it only set if it appears on the Options line for /opt/apache/CA/webagent/pw/?
Answer: There exists a configtest parameter in apache2ctl to check your configuration(s).
I like to use this when I'm unsure:
# apache2ctl configtest
Syntax OK

Comment: Is there some sort of argument that you can give to configtest to see what the configuration is setting, as opposed to using it to tell you if there are or are not syntax errors? I know how to construct several different permutations of Options directives that don't have any syntax errors, I just don't know which set is actually doing what I want because the documentation is ambiguous.
Comment: from the [Apache documentation](https://httpd.apache.org/docs/2.4/programs/apachectl.html):
`configtest`
Run a configuration file syntax test. It parses the configuration files and either reports Syntax Ok or detailed information about the particular syntax error. This is equivalent to apachectl -t.


Desired effect size vs. expected effect size

Question: When estimating the effect size for determining optimal sample size for a statistical test, the textbook approach seems to do this from pilot studies or the like. Is it also legal to define effect size as the smallest relevant effect, independent of real, systematic effects which are just too weak to be interesting?
For example, if I want to test an improvement to some existing product which will increase its production cost by some amount. I know that customers will pay this premium if the product is at least x% "better" (by some metric) than the existing solution. Can I use effect size and resulting sample size as tools to suppress significant results for smaller differences? If not, what would be the problem and how would a correct solution look like?
Answer: There are many ways to perform power calculations to determine the ideal sample size. One such way, as you mention, is to pick a threshold value of "Someone will care". This may be governed by prior knowledge, the belief that your field doesn't particular get interested until an effect is of a particular size, etc.
My suggestion is instead to look at a range of possible effect sizes. It is trivially easy, if you are performing one power calculation, to perform several to evaluate the sensitivity of your threshold. For example, will you really be alright with your study being underpowered if you set your threshold at 5% and it turns out to be 4.9%? Or 3%. Or a real effect at all?
The figure below for example is asking (for a fixed sample size in this case), what the power of the study is under a range of possible Exposed:Unexposed ratios and effect sizes. It would be just as easy to compose a similar plot varying study population to more fully understand your study's power.
You also seem to be asking if you can use a small sample size to "suppress" particular results. You can design a study and acknowledge that sample size constraints will result in it being underpowered for particular effect sizes, but I wouldn't deliberately do so. A null or small effect finding is still a finding, and deliberately underpowering a study seems...flawed. Also, the optimal sample size obtained from power analysis is often somewhat optimistic - it hardly ever includes missing data, an interesting sub-group analysis, or other problems that will necessitate a bigger sample. Drawing a hard line is a bad idea.
Answer: @EpiGrad makes some nice points here.  I thought I would throw in one extra bit of information.  He mentions that power analyses are often optimistic, and you mention that it is often suggested to estimate the effect size you want to capture from a pilot analysis.  I just want to make it explicit, that this procedure is known to be biased such that the estimated power will be higher than the true power.  There is considerable uncertainty in the estimated effect size based on a pilot study, or even a full study.  If the true effect size is larger than the estimate, you will have more power, and if it is smaller, you will have less power, than you believe.  However, the rate of change in power is not the same in both directions.  Specifically, power diminishes faster as the effect size shrinks than it increases as the effect size expands.  In this way, even though the distribution of effect sizes is symmetrical, the distribution of power is not.  To compute a more robust estimate of power, compute the full distribution for the effect size and integrate over it.  (A quick and dirty approach is to compute a 95% CI for the ES, and get a weighted average of the power at your estimate and at the CI endpoints.)