What are the different qualities of the intervals?

Question: I know that a 3rd decides the emotional quality of a chord, but what about the 5th? What does the 7th do? The 2nd, 6th, and 9th?
Comment: Comments are not for extended discussion; this conversation has been [moved to chat](https://chat.stackexchange.com/rooms/96753/discussion-on-question-by--what-are-the-different-qualities-of-the-interva).
Answer: You can ask the Greek or look up the theories of Boethius, Glarean, Caspar Printz, Ernst Kurth etc ... The answers will be more traditional than opinion based. But did you look up wikipedia under characteristics / qualities of intervals? I did and couldn't find much information.
The key words are psycological effects of harmonical intervals
The idea that the various musical intervals have widely disparate psychological effects has a long history in the literature of aesthetics, music theory and composition but not in experimental psychology
http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.577.9997&rep=rep1&type=pdf

I used to present to my classes test sheets with a bi-polarity profile like below to get an statistical intersubjective information like they did here:

But I'm doubting that these effects and impressions are intercultural representatives and objectives!
Comment: Thank you, this is exactly what I was looking for! It's weird that in the 2nd photo, they include both the aug. 4 and dim. 5.
Comment: Even in the second and third examples, the terms used are subjective - meaning different things to different people. Whilst the charts seem to have been produced in good faith, your closing comment has more than a ring of truth about it.
Comment: Is the Willems table supposed to apply to chords? minor triad: heavy emptiness, diminished triad: shadow instability. That doesn't make much sense. Surely the _emotion_ of music is more about the temporal aspects - the changing events - than the vertical stack of intervals.


Add additional IPs to lo interface in docker container

Question: I need to setup aliases on the loopback(lo) interface in my docker container. I can't figure out how to do this in the docker-compose file.
I need to add 127.0.0.2, 127.0.0.3, and 127.0.0.4 to the lo interface. How can this be done in the docker-compose file?
On my mac I could just do something like ifconfig lo0 alias 127.0.0.4 up but I can't figure out how to get this done in a docker container.
Answer: Firstly, linux will respond to 127.0.0.2-4 by default as 127.0.0.1/8 is assigned to the lo interface. You may not need to "add" the addresses to the interface, just use them.
If for some reason you need the specific address on the interface, then it requires getting into the internals of Docker networking. There is a utility called pipework that deals with this type of thing and these steps are lifted from it's code.
Get the PID of the container
NSPID=$(docker inspect -f '{{ .State.Pid }}' <container>)

Let ip netns work for this container
mkdir -p /var/run/netns
rm -f "/var/run/netns/$NSPID"
ln -s "/proc/$NSPID/ns/net" "/var/run/netns/$NSPID"

Add the IP address to the interface
ip netns exec $NSPID ip ad add 127.0.0.2/32 dev lo

Confirm the new config is there
ip netns exec $NSPID ip ad sh lo

This allows you to make any changes in the containers network namespace.


Expectation of the Inverse of the Sample Mean vs. Inverse of Expectation of the Sample Mean

Question: For an iid sample of $n$ realizations of random variable $X$ with $\mathbb{E}\left[X\right] = \mu > 0$, let $\bar{X}_n$ denote its sample mean. Is there a distribution for $X$ such that $\mathbb{E}\left[\frac{1}{\bar{X}_n}\right] < \frac{1}{\mathbb{E}\left[\bar{X}_n\right]}$?
Jensen's inequality shows that if the support of $X$ only contains positive numbers, this cannot be the case, but is there a good counterexample if we don't impose this restriction?
Thanks in advance!
Comment: Sorry, missed that bit.
Comment: My strategy would be to look at a family of positive r.v.s where the ratio of arithmetic to harmonic mean was monotonic in some parameter (there seems to be a couple of fairly accessible potential choices) and then choose a mix of two distinct family members (with the second negated) such that the expectation was just positive but the parameter in the second component was chosen so that the harmonic mean would pull that relationship the other way. That should at least accomplish it for some $n$ (like $n=1$) though not necessarily all $n$.
Comment: https://stats.stackexchange.com/questions/141766 and https://stats.stackexchange.com/questions/305713 are relevant.
Comment: Thank you for your input. The generated random variable will however have a negative expectation and thus not provide a counterexample.
Answer: At least when $n = 1$, the counterexample is easy to construct.  For example, let $X$ be a triple-point distribution:
\begin{align}
P[X = -2] = 0.2, P[X = -1] = 0.25, P[X = 2] = 0.55.
\end{align}
Then
\begin{align}
& E[X] = -0.4 - 0.25 + 1.1 = 0.45 > 0, \\
& E[1/X] = -0.1 - 0.25 + 0.275 = -0.075  < 0.
\end{align}
Clearly, $E[1/X] < 1/E[X]$.
For general $n$, the following fact (Asymptotic Statistics by A. W. van der Vaart, Exercise 5.8) is also interesting: although it is not an example of $E[\bar{X}_n^{-1}] < 1/E[\bar{X}_n]$, it can be used as to show that $E[\bar{X}_n^{-1}] \geq 1/E[\bar{X}_n]$ does not always hold (in fact, it shows that for a large family of distributions, the expectation of $\bar{X}_n^{-1}$ either does not exist or is infinite):

Let $X_1, X_2, \ldots, X_n$ be i.i.d with expectation $1$ and finite variance. If the random variables are sampled from a density $f$ that is bounded and strictly positive in a neighborhood of zero, then $E[|\bar{X}_n^{-1}|] = \infty$ for every $n$.

Proof of the fact. It can be shown by induction that the density of $\bar{X}_n$ is bounded away from zero in a neighborhood of zero for every $n$.
When $n = 1$, this is the condition.
Suppose the density of $\bar{X}_k$ is bounded away from zero in a neighborhood of zero, i.e., there exists $\delta > 0$ such that $f_{\bar{X}_k}(x) \geq \epsilon > 0$ for all $x \in (-\delta, \delta)$.  By condition, there exists $\delta' > 0$ such that $f_{X_{k + 1}}(x) = f(x)
\geq \epsilon' > 0$ for all $x \in (-\delta', \delta')$. Let $\delta_0 = \min(\delta, \delta')$, $\epsilon_0 = \min(\epsilon, \epsilon')$, then $\min(f_{\bar{X}_k}(x), f(x)) \geq \epsilon_0 > 0$ for all $x \in (-\delta_0, \delta_0)$.
Since $\bar{X}_{k + 1} = \frac{k}{k + 1}\bar{X}_k + \frac{1}{k + 1}X_{k + 1}$ and the two summands are independent, the density of $\bar{X}_{k + 1}$ can be obtained by the convolution formula (and densities of the scale family):
\begin{align}
 & f_{\bar{X}_{k + 1}}(y) = \int_{-\infty}^\infty f_{(k + 1)^{-1}X_{k + 1}}(y - x)f_{(k + 1)^{-1}k\bar{X}_k}(x)dx \\
=& \int_{-\infty}^\infty (k + 1)f((k + 1)(y - x))k^{-1}(k + 1)f_{\bar{X}_k}(k^{-1}(k + 1)x)dx \\
=& k^{-1}(k + 1)^2\int_{-\infty}^\infty f((k + 1)(y - x))f_{\bar{X}_k}(k^{-1}(k + 1)x)dx \\
\geq & k^{-1}(k + 1)^2\int_{y - (k + 1)^{-1}\delta_0}^{y + (k + 1)^{-1}\delta_0} f((k + 1)(y - x))f_{\bar{X}_k}(k^{-1}(k + 1)x)dx. \tag{1}
\end{align}
If $|y| < \frac{1}{2}\delta_0$, then when $x \in (y - (k + 1)^{-1}\delta_0, y + (k + 1)^{-1}\delta_0)$, we have $(k + 1)(y - x) \in (-\delta_0, \delta_0)$ and $k^{-1}(k + 1)x \in \left(-\frac{k + 3}{2k}\delta_0, \frac{k + 3}{2k}\delta_0\right) \subset (-\delta_0, \delta_0)$ (when $k \geq 3$), hence the last integral in $(1)$ is at least $2k^{-1}(k + 1)\delta_0\epsilon_0^2 > 0$. This completes the inductive step.  Therefore the density of $\bar{X}_n$ is bounded away from zero in a neighborhood of zero for every $n$.
For fixed $n$, suppose $f_{\bar{X}_n}(x) \geq \epsilon^*$ for all $x \in (-\delta^*, \delta^*)$ for some $\epsilon^* > 0$ and $\delta^* > 0$. For any $a \in (0, \delta^*)$:
\begin{align}
 & E[|\bar{X}_n^{-1}|] = \int_\mathbb{R} \frac{1}{|x|}f_{\bar{X}_n}(x)dx \\
\geq & \int_a^{\delta^*}\frac{1}{x}f_{\bar{X}_n}(x)dx \\
\geq & \epsilon^*\int_a^{\delta^*}\frac{1}{x} dx \\
=& \epsilon^*(\log\delta^* - \log a),
\end{align}
which diverges to $+\infty$ as $a \downarrow 0$. Therefore, $E[|\bar{X}_n^{-1}|] = \infty$. This completes the proof.
Comment: Thank you! That's really helpful additional reading.


Indexing e-mails in Azure Search

Question: I'm trying to best index contents of e-mail messages, subjects and email addresses. E-mails can contain both text and HTML representation. They can be in any language so I can't use language specific analysers unfortunately.
As I am new to this I have many questions:

First I used Standard Lucene analyser but after some testing and
checking what each analyser does I switched to using "simple"
analyser. Standard one didn't allow me to search by domain in
email@example.com (It sees user and domain.com as tokens). Is "simple" the best I can use in my case?
How can I handle HTML contents of e-mail? I thought this should be
possible to do it in Azure Search but right now I think I would need
to strip HTML tags myself.
My users aren't tech savvy and I assumed "simple" query type will be
enough for them. I expect them to type word or two and find messages
containing this word/containing words starting with this word. From my tests it looks I need to append * to their queries to get "starting with" to work?
Answer: It would help if you included an example of your data and how you index and query. What happened, and what did you expect?
The standard Lucene analyzer will work with your email@example.com example. It is correct that it produces the tokens user and domain.com. But the same happens when you query, and you will get records with the tokens user and domain.com.
CREATE INDEX
    "fields": [

    {"name": "Id", "type": "Edm.String", "searchable": false, "filterable": true, "retrievable": true, "sortable": true, "facetable": false, "key": true, "indexAnalyzer": null, "searchAnalyzer": null, "analyzer": null, "synonymMaps": [] },
    {"name": "Email", "type": "Edm.String", "filterable": true, "sortable": true, "facetable": false, "searchable": true, "analyzer": "standard"}
]

UPLOAD
{
    "value": [
        {
            "@search.action": "mergeOrUpload",
            "Id": "1",
            "Email": "firstname.lastname@example.com"
        },
        {
            "@search.action": "mergeOrUpload",
            "Id": "2",
            "Email": "email@example.com"
        },
        {
            "@search.action": "mergeOrUpload",
            "Id": "3",
            "Email": "email@example.com"
        }
    ]
}

QUERY
Query, using full and all.
https://{{firstname.lastname@example.com&$count=true&$select=Id,Email&searchMode=all&queryType=full&api-version={{API-VERSION}}
Which produces results as expected (all records containing user and domain.com):
{
"@odata.context": "https://<your-search-env>.search.windows.net/indexes('dg-test-65392234')/$metadata#docs(*)",
"@odata.count": 2,
"value": [
    {
        "@search.score": 0.51623213,
        "Id": "1",
        "Email": "email@example.com"
    },
    {
        "@search.score": 0.25316024,
        "Id": "2",
        "Email": "firstname.lastname@example.com"
    }
]

}
If your expected result is to only get the record above where the email matches completely, you could instead use a phrase search. I.e. replace the search parameter above with search="firstname.lastname@example.com" and you would get:
     {
        "@search.score": 0.51623213,
        "Id": "1",
        "Email": "email@example.com"
     }

Alternatively, you could use the keyword analyzer.
ANALYZE
You can compare the different analyzers directly via REST. Using the keyword analyzer on the Email property will produce a single token.
    {
  "text": "email@example.com",
  "analyzer": "keyword"
}

Results in the following tokens:
    "tokens": [
    {
        "token": "email@example.com",
        "startOffset": 0,
        "endOffset": 25,
        "position": 0
    }
]

Compared to the standard tokenizer, which does a decent job for most types of unstructured content.
    {
  "text": "email@example.com",
  "analyzer": "standard"
}

Which produces reasonable results for cases where the email address was part of some generic text.
    "tokens": [
    {
        "token": "some",
        "startOffset": 0,
        "endOffset": 4,
        "position": 0
    },
    {
        "token": "user",
        "startOffset": 5,
        "endOffset": 9,
        "position": 1
    },
    {
        "token": "some",
        "startOffset": 10,
        "endOffset": 14,
        "position": 2
    },
    {
        "token": "domain.com",
        "startOffset": 15,
        "endOffset": 25,
        "position": 3
    }
]

SUMMARY
This is a long answer already, so I won't cover your other two questions in detail. I would suggest splitting them to separate questions so it can benefit others.

HTML content: You can use a built-in HTML analyzer that strips HTML tags. Or you can strip the HTML yourself using custom code. I typically use Beautiful Soup for cases like these or simple regular expressions for simpler cases.

Wildcard search: Usually, users don't expect automatic wildcards appended. The only application that does this is the Outlook client, which destroys precision. When I search for "Jan" (a common name), I annoyingly get all emails sent in January(!). And a search for Dan (again, a name), I also get all emails from Danmark (Denmark).

Everything in search is a trade-off between precision and recall. In your first example with the email address, your expectation was heavily geared toward precision. But, in your last wildcard question, you seem to prefer extreme recall with wildcards on everything. It all comes down to your expectations.

Indexing e-mails in Azure Search


How to get id of the current user logged in grails?

Question: I want to display the info about the user logged in like his details etc given during sign up ...how to do it ?? As iam new to grails plz help! iam using Spring security plugin
Comment: What do you think about using the search field above? See [this question](http://stackoverflow.com/questions/775053) for further information.
Answer: Well you can use the springSecurityService to get some user information in a controller:
    class MyController {
      def springSecurityService

      def myAction() {
        def principal = springSecurityService.principal
        String username = principal.username
        ...
      }
     }

Or in a gsp
    <sec:loggedInUserInfo field="username" />

It is a pretty general question.
Comment: I know this is an old post but... I found it and it lead me to google and find this: http://grails-plugins.github.io/grails-spring-security-core/docs/manual/guide/helperClasses.html#securityTagLib
Answer: Define (in a controller, or service where you need user id):
SpringSecurityService springSecurityService

and try:
springSecurityService.currentUser.id //loads user from db, and returns its id

or:
springSecurityService.principal.id //if you need just id

Comment: Fully qualified class name is `grails.plugin.springsecurity.SpringSecurityService`
Answer: add this @the top of your service or controller class
def securityService

this returns the cuureent user id.
securityService.currentUser.id


$4 $ balls selected at random from $ 15$

Question: $15$ balls $ 4$ selected
$1$ blue, $2 $ green, $3$ red, $4$ white, $5$ yellow
What is the probability that $2$ are red and at least $1$ is white?

Now the way this question is worded makes it seem as though you should account for the possibility of the case being $2$ red balls + $1$ white + $1$ other AND the possibility of $2$ red balls + $2$ white
So the answer is:
$$\frac{C_{3,2} C_{4,1}C_{8,1}}{C_{15,4}} + \frac{C_{3,2} C_{4,2}}{C_{15,4}}\,?$$
Comment: Your calculation is right.
Answer: $\frac{\binom{3}{2}\binom{4}{1}\binom{8}{1}}{\binom{15}{4}}+\frac{\binom{3}{2}\binom{4}{2}}{\binom{15}{4}}$
So you are right


Hide columns in power bi

Question: Power bi report is developed based on single table which consists of 10 columns. All the columns is displaying in when clicking on 'See records' context menu option.
Is there any way to hide some columns.
Answer: there is a context menu item if you rightclick one of the columns. It hides the column but also for report generation. Not sure, if that does the trick for you but worth a check.
Hope this helps
Patrik

Hide columns in power bi


VAR-model with a contemporaneous variable

Question: I have two time series and I want to check the relationship between them. I would like to use vector autoregression (VAR) model to do this.
I'd like to specify the model so that both variables will be explained by the lagged values of both itself and the other variable.
Moreover, (and here I encountered the actual trouble,) one of the time series variables, x, will need to depend on the same period value of the other variable y.
In R, can I somehow use the package "vars" to do this?
I tried to look at the documentation but I could only figure out how to include lagged variables in the model.
Or is there some other (easy) way to do this? Preferably in R.
Answer: A multiple-equation VAR model where contemporaneous dependent variables enter as regressors in other equations is a structural VAR (SVAR) model. When it comes to estimation of such models, there is a problem of simultaneity bias; a SVAR model cannot be estimated as it is using standard techniques. What is normally done is obtaining a reduced-form counterpart VAR model of the original SVAR model, estimating the former, and backing the original SVAR model up from the reduced-form estimates. This is pretty standard and there is quite some literature that should be available online. Perhaps Pfaff "Analysis of Integrated and Cointegrated Time Series with R" (starting at p. 43) could be useful.
Comment: Looks like there's an example here: https://economistsview.typepad.com/economistsview/2011/10/the-nobel-prize-a-note-on-chris-sims-contributions.html
Comment: Just went through it. I swear the error terms get switched in the reduced form! Not going to comment on a 10 year old post though. Still a good article.


DDoS. Are we that helpless?

Question: With recent DDoS incidents related to wikileaks, I can't help but feel that pretty much all sites online are very vulnerable to such attacks. Visa, MasterCard (to name a few) have shut down because of this.
So my questions are:

Is DDoS such a powerful form of attack?
What can a company do to deal with this situation?

EDIT:
I think I might have phrased my question too "n00bishly". I know what a DDoS is (from wikipedia and other sites).
My real question is: Why are those Big companies NOT applying anti-DDOS techniques? Don't tell me that Paypal and MasterCard are not afraid of service down or attacks. I have looked over the cost of some of these solutions, but they don't seem that expensive at all compared to how much Paypal or VISA makes a year. The real question is why are they so unprepared? ( Or is the scale of the DDoS that much bigger than what has been expected?)
Comment: @kamil From that site it doesn't appear to be so expensive. But why isn't VISA or MasterCard or Post Finance employing them? I think that article greatly trivialize the impact of DDOS.
Comment: I think that ddos stress exposes inefficiencies in architecture and there are plenty of them hidden in larger systems. I think fourth or fifth ddos attack against visa would have much lower chance of succeeding than the first one. Some companies manage to withstand ddos attacks of various scales.
Comment: Please see my answer below and follow the link to a fuller answer on IT Security Stack Exchange - Many multinationals are using solutions which work well.
Comment: If you "know" what DDOS is by reading Wikipedia and the like you really have no knowledge on the subject at all. The entire "question" merely confirms that.
Answer: There is a similar question here:

The challenge with this question is
  that it asks for a solution to a
  fundamentally unsolveable problem.
  There's no tool or practice you can
  adopt that is going to protect you
  from a moderately competant attacker
  who is determined to take down your
  service.
mod_evasive is about as good a
  solution as you're going to get to
  this problem in the short term. It
  implements "best practices" throttling
  of requests, and will prevent your
  system from being taken down by a 5
  line Perl script.
In the longer term, when your
  application becomes successful, you'll
  inevitably wind up deploying a load
  balancer in front of it. The
  mainstream commercial load balancers
  (like F5's Big-IP) all implement "DOS
  protection" throttling, so you can
  turn that feature on when you upgrade.
  But don't upgrade just to get that
  feature.
The problem with solving modern DDOS
  attacks is that they are launched from
  numerous unrelated unpoints (often,
  from huge botnets). Web application
  firewalls like Citrix/NetScaler,
  Imperva, and F5 will do a decent job
  with the canned attacks, but skilled
  analysts (preferably from your own
  team) are going to be needed to stop
  "real" attackers who know your name;
  you do that job by analyzing the
  attack traffic, finding
  characteristics in it particular to
  the attacker, and filtering it.
I think you're on the right track with
  free "plug-and-play" defenses for
  this, especially with a new
  application.
@tqbf
Comment: Not correct - mitigation vendors exist and do a grand job. I have tested a response from a vendor and an ISP for a global bank and it was remarkably effective. Please see my answer below.
Answer: They are. The thing about DDoS is its power is inversely proportional to the defender's  availability and redundancy strategies. The main problem isn't that DDoS can't be mitigated; it's that much of the web relies on centralized architecture, poor redundancy, and cascading single points of failure.
The original internet protocols were designed with availability and redundancy in mind, providing much more fault tolerance at the expense of trust or synchronization. Look at how DNS, BGP, SMTP, and NNTP were originally designed for perfect illustrations.
Moving back to the web, the primary problems with DDoS attacks are ensuring DNS remains available under heavy load, ensuring server redundancy is sufficient to handle stress at peak capacity, and ensuring individual connections can't take a disproportionately high amount of system resources relative to others.
Mitigation thus becomes a matter of rerouting or blackholing the traffic, spreading the impact over as much hardware as possible, providing non-programmatic mirrors, and other service assurance mechanisms relative to your user community. Much of this is rolled into the concept of highly available services and threat modeling, for anyone interested in the field.
I'll close by pointing out that even more answers exist on Server Fault, for anyone interested in the IT perspective of this problem.
Answer: Please go over to IT Security Stack Exchange for a good discussion about this and valid ways to do it. There are DDoS mitigation partners who are very good at this - I ran tests to validate one for a global bank and the DDoS mitigation cut in within seconds of the attack commencing and it allowed Business as Usual throughout the entire attack, which we ran at a high load. The answer David gives is exactly how it worked in that instance.
Answer: Yes, DDoS is probably the most powerful brute-force attack. You can't really do anything about it, as any server will break at some point. You can try and circumvent it, provide different services from different servers, thus only getting partially hit. One of the main problems with DDoS is the first "D": Distributed. In nearly all cases a huge botnet is used, so you can't just go around and ban IPs, as this will result in legitimate costumers getting locked out of the service, as a botnet uses overtaken computers to achieve its damage.
You can deal with it by employing measures, like load balancers, firewalls and others, but you'll never be able to completely prevent it.
Answer: Answer of the question depends how many botnets  attackers have. Maybe we are  part of that botnet chain who knows. Do you think that people pay for software all over the world ? you should kidding me.. just search for any software in torrents, whatever you downloaded comes with rootkits that hide itself, even though most powerful antivirus systems are used. If rootkits are used, the attackers may control the victims computer as a bot. Sometimes you do not need any rootkits, any preinstalled software may do the same job. The attackers make profit by selling these botnet for different purposes (e.g., sending spams).
Research community invents some techniques in order to stop the malicious activity or prevent hosts to be a part of botnet (before infection phase), however this is never-ending arms race between hackers and defenders. Keep in mind, internet is an open system, so there is not a final solution yet. Probably there will be never, this is the answer of research never stops.
Cisco has some mitigation techniques, check here
Answer: I would say it is a very powerful attack if you have enough bots that request the site. You can counter it partially with load balancing, firewall, and other defenses. However, enough bots will also cripple the best defenses.
The main issue i would say is that a 'DOS' is always run against a dns name, not an IP address. Thus if the hoster is going to switch servers or such, the dns name will be under attack even under the new server, no escape ...

DDoS. Are we that helpless?


What is the difference between Multitask and Multiclass learning

Question: Consider a image labeling problem, where I need to assign one or more labels to an image. The possible labels are human, moving , indoor. Human means there is a human in the picture, moving could mean whether the human is runing/walking etc, and indoor classifies whether the image is indoor or outdoor.
Now I can train a DNN with 3 nodes in the output layer using labeled training data. (say node 1, is for +/- human, node 2 +/- moving and so on)
I always thought that this is just another way of doing multi-class classification using DNNs. (Another alternative for multi-class training would have been to train many DNNs with one output node in a pairwise or 1-vs-all fashion.)
But it seems like what I described (training a DNN with 3 output nodes) is Multi-task learning. ( I read wiki on MTL and looked at these papers)
My question is: is the scenario I described MTL? If not what am I missing? If yes, is there anything more to MTL? (clearly there is)
Also I notice in MTL a image can have multiple labels, but usually in multiclass an image is assigned only one - is this the difference?
Answer: Just to give a more clear understanding, I have explained each terminology with examples

Multiclass classification/(One-Vs-One and One-Vs-ALL):

Classification task with >2 classes!
Assumption is that each sample is assigned to one and only one label
E.g. MNIST
E.g. a set of images of fruits which may be oranges, apples, or
  pears.
Last layer activation function would be softmax-softmax activation function generalizes the logistic activation function to C classes rather than just two classes.(single label to single example)

Eg saying each image is either pedestrians or car or detect stop signs!
Eg.saying each image is either of the numbers between 0-9(MNIST)!

Or you can use 4 different logistic regression classifers- each neuron in the last layer has sigmoid activation function (extension of one-vs-all method!)!

Multilabel classification:

This Classification task assigns a set of target labels to each sample.
E.g. Building a classifier for a self-driving car that would need to detect several different things such as pedestrians, detect other cars, detect stop signs in an image!.
E.g. A document could have multiple topics!
Loss function used would be "logLoss"

Multioutput regression/ Multitarget regression/multidimensional linear regression:

This task assigns a sample to a set of target values!
E.g.predicting several properties for each data-point, such as wind direction and magnitude at a certain location
Last layer activation should be linear
Loss function used would be "MSE"

Now let's comes to the difference between multi-task learning(one subset is a multilabel classification or multioutput regression) and multiclass classification problem! :

Multi-class classification: You are assigning a single label (could be multiple labels such as MNIST problem) to the input image as explained above.
Multi-task learning (one subset of it is multi-label classification) You're asking for each picture, does it have a pedestrian, or a car a stop-sign or traffic-light, and multiple objects could appear in the same image (one image can have multiple labels!).

In other words, If you train a neural network to minimize this cost function (Log loss) you are carrying out multi-task learning because what you're doing is building a single neural network that is looking at each image and basically solving four different classification problems. It's trying to tell you does each image have each of these four objects in it?.

Or you could achieve it by just training four separate neural networks instead of train one network to do four things!
Note: But if some of the earlier features in the neural network can be shared between these different types of objects, then you find that training one NN to do four things, results in better performance than training four completely separate neural networks to do the four tasks separately. That's the power of Multi-task learning!

To put everything into perspective, Multi-task learning will make more sense when you have the below requirements:

Training on a set of tasks that could benefit from having shared lower-level features!
If the amount of data you have for each task is quite similar!

@RockTheStar, I think your transfer learning suggestion isn't correct! What you are trying to say & have similar(but weak) meaning for transfer learning, I will try to explain with the help of an example. Suppose you have 100 different tasks and you have 1000 train examples for each! If you build you separate NN for classifying each class you won't do much good! due to a limited number of training example (1000) but if you build a single network for solving 100 different, let's say classification problem then, you have (1000*1000)(Million instead of just 1000 for each separate task) training examples that can provide some knowledge that helps every other task among these 100 tasks. This is a big boost!

Can train a big enough NN to do well on all the tasks!
Comment: @NaveenKumar, `logloss`, imgs will always have many objects eg. cars, pedestrians, road signs, etc! Your annotations of such objects within the train & val datasets guide N/W to learn about them! If you don't provide proper annotations, the N/w will never be known what it's looking for in an image! By showing the same object annotated at multiple images(train-set) at a diff location, color & lighting conditions you let the n/w learn the representation of that particular object & then give the n/w an image to make predictions to say from n/w learned to understand (repr.) what this object is!
Comment: Very nice analogy. What activation do I use at output layer for a problem where I have to detect the presence of pedestrian or traffic sign or traffic light? My images can have only one or all or multiple things?
Answer: Slight correction on @RockTheStar answer. Multi-task learning is not when you learn for one task and then transfer to another as was suggested, instead the tasks are learned in parallel similar to the usual multi-class classification setup.
I suppose the simple distinction that can be made is that the outputs are not necessarily classes of the same of a single task, but two or more loosely related tasks that are sharing information.
Answer: Multi-class learning: have multiple class labels that you want to classify. For example, I have labels cat, dog, and pig. These are animals. I want to make a DNN to classify them. That's a multi-class learning.
Multi-task learning: is somewhat like transfer learning. Basically, you create one model for one classification task and them use it in another classification task (after modification).
In you case, you can create a two-label DNN to classify if the image is human or not. Then use that model parameters parameters to start to build another classifier that classify moving or not. I will consider your case more like multi-task learning because the subjects of interests are different.
Comment: So in my case I am doing MTL in parallel?  Is there any reason to do it step-by-step like you describe? If I understand correctly i first train a DNN for +/-human (single output node) then take that network and train over it with output label changed to say +/-moving.
Comment: Human and moving are two different subjects. The features detectors you obtain from human DNN is very likely to differently to moving. So, in order to, let say, classify whether an input is moving, what you need to do is first pass identify whether the input is human first, and then if yes, put the input to the moving network and classify if the input is moving or not. In this progressing step, you need to build two network. One with network trained with data that is human and non-human. Another network trained with data this (already human) moving or non-moving.
Comment: "what you need to do is first pass identify whether the input is human first, and then if yes" this seems the opposite of what MTL is - i'm still unclear. What you are saying sounds like cascading of classifiers. Consider an alternate task, +/-human, +/-animal, +/-indoor.
Comment: "Multi-task modeling basically means you use one constructed model from one task to another task. "
In your case, multi-task may not work. Because the network designed to classify human or not I don't think is too related to classify moving or not. So a cascading of classifiers may be better.
Give an example on multi-task modeling. Let's say you train a model to classify panda or not. Since panda look like human (4 limbs, can sit, etc), you can then retrain the model (initialized with the parameters obtained from panda) to classify human or not.
Comment: Multi-task learning must not necessarily use transfer learning. You can train the network on all tasks simultaneously. The idea is that features necessary for one task can also be useful for the other tasks.
Answer:
I notice in MTL a image can have multiple labels, but usually in
  multiclass an image is assigned only one - is this the difference?`

Yes.
In multi-task learning, you can detect multiple objects (i.e. 'car', 'human', 'cat', 'tree') in one given image.
If there exist both a human and a car in your model,
Your labels are [1,1,0,0] (from ['car', 'human', 'cat', 'tree']).
In multiclass classification, you will have only one gold (1) in your labels, [1,0,0,0].
Answer: There is quite some information in all of the answers provided thus far, but maybe a summary answer might be useful for people with the same / a similar question:

Multi-class learning is the terminology used when you predict a single label for each input, but each label is a single element from a set of possible labels. Taking the example from this answer: you have an image of an animal and the goal is to label whether it is a cat OR a dog OR a pig. It can only be one of these animals, but there are multiple options. To train a network on this kind of problems, you would generally use the Cross-entropy loss function.
Multi-task learning is when you have different problems that need to be solved simultaneously (as stated in this answer. Each problem could be a binary classification problem (as the OP example) or another multi-class problem. Taking the example of the animal images again: a second task could be to predict whether the environment on the picture is sunny OR cloudy OR indoor. So now the goal is to find the animal label AND the environment label. The key idea is that solving one task could help solving the second task (in this example: cats are more likely to appear indoors than pigs). For training a network in this case, each output can have its own loss function. The loss functions can be combined by summing them up, using weights to balance the importance of each task.
Multi-label learning (as mentioned in this answer) can be considered a special case of multi-task learning. In this case, there could be one or more animals in the image and you want a label for every animal in the image. In practice this is solved by breaking down this task in multiple binary problems. If the possible labels would be dog, cat and pig, the binary problems would be (1) Is there a dog in the image, (2) Is there a cat in the image, (3) is there a pig in the image. These sub-problems can then be tackled by multi-task methods.

Note that I ignored regression as a whole, but multi-task learning could also combine classification and regression problems.


Drupal add google analytics event tracking query strings to url

Question: I have Drupal 7 site for sending the newsletter. I am using simplenews module for sending newsletter. I want to add google analytics tracking query strings to all links in the newsletter so that it is tracked in my google analytics account. How can I achieve this?.
Answer: Create your links here and add them in your newsletter node content and/or mail template.
Comment: Where can I find this url or campaign in google analytics


How to setup the Panjer's recursion correctly?

Question: I have a table of $k=(0,1,2,3,4,5,6)$ and $number=(40544,8082,1205,145,20,3,1)$
I need to fit data by a Compound Poisson-Gamma distribution and then make a discretization and compare results with observations.
My attemp is:
The compound Poisson-Gamma distribution can be realized as Negative Binomial distibution:
library(actuar)
library(fitdistrplus)

number <- c(rep(0, 40544), rep(1, 8082), rep(2, 1205), rep(3, 145), rep(4, 20), rep(5, 3), rep(6, 1))

fitnb <- fitdist(number, "nbinom")
shape = fitnb$estimate[1] # size = 2.080522
lambda = fitnb$estimate[2] # mu = 0.2205776

As the result I know the lambda and shape parameters for the discretisation:
n = 6 # we have values from 0 to 6
fx <- discretize(pgamma(x, shape = shape, 1),
                 method = "unbiased", from = 0, to = n, step = 1.0,
                 lev = levgamma(x, shape = shape, 1))
sum(fx) # 0.9804088 < 1

Following the documentation and answer I appied the aggregateDist() function with changed parameters lambda and convolve:

The recursion will fail to start if the expected number of claims is
too large. One may divide the appropriate parameter of the frequency
distribution by $2^n$ and convolve the resulting distribution $n$ =
convolve times.

Fsc <- aggregateDist("recursive",
                     model.freq = "poisson",
                     model.sev = fx,
                     lambda = lambda/(2^n),
                     convolve = n, x.scale = 1)

But I seen again the
Warning message:
In panjer(fx = model.sev, dist = dist, p0 = p0, x.scale = x.scale,  :
  maximum number of recursions reached before the probability distribution was complete

I was surprised on the output:
summary(Fsc)
#    Aggregate Claim Amount Empirical CDF:
#            Min.      1st Qu.       Median         Mean      3rd Qu.         Max.
#    0.000000e+00 0.000000e+00 0.000000e+00 4.261483e-01 0.000000e+00 3.200000e+04

Finally, I have tried to compare obtained results (black) with original data (red):
plot(Fsc, do.points = FALSE, verticals = TRUE, xlim = c(0, n))
femp <- c(40544, 8082, 1205, 145, 20, 3, 1)/50000
sum(femp) # 1
plot(stepfun(0:6, diffinv(femp)), pch = 19, col = "red", add = TRUE)

Edit. After the jbowman's comment I have tried to use the "negative binomial":
# https://rdrr.io/cran/actuar/src/R/panjer.R
# r <- size     # size
# p <- 1/(1+mu) # prob

Fsc_ng <- aggregateDist("recursive",
                         model.freq = "negative binomial",
                         model.sev = fx,
                         size = shape, prob = 1/(1+lambda), echo = TRUE, maxit = 10)

# x Pr[S = x]   Cumulative probability
# 0 0.68415174  0.68415174
# 1 0.083957895 0.76810964
# 2 0.079291596 0.84740123
# 3 0.055756862 0.9031581
# 4 0.036292288 0.93945038
# 5 0.022994652 0.96244504
# 6 0.01271653  0.97516157
# 7 0.0066424692    0.98180404
# 8 0.0040147675    0.9858188
# 9 0.0023141156    0.98813292
# 10    0.0013060718    0.98943899

Question. How to setup the parameters of aggregateDist() function?
Comment: Try using the negative binomial instead of the Poisson in your call to `aggregateDist`, with the size parameter being the one rescaled (I haven't tried it so don't know if it will work).
Comment: `prob = shape / (shape + lambda)` will do, since apparently it won't accept `mu` as a parameter.  The CDF is much closer (0.8261 vs. 0.8109 at zero) closer, but `panjer` still doesn't converge, quite.
Comment: I suspect that the error message means `panjer` hasn't gotten to a number for which the CDF is approximately equal to one.   Given that your distribution is already discrete, I think the issue is really with the `discretize` function.
Comment: The negative binomial distribution is discrete; why are you discretizing the Gamma distribution instead of simply using the negative binomial distribution that you've already got parameter estimates for?
Comment: I want to test the recursion function. In general case one can have, for instance, a Poisson-InverseNormal distribution and we can't use a negative binomial distribution.
Comment: I have tried to code your idea with rescaled parameters size = shape, prob = 1/(1+lambda) for NB, but the Pr[S = 0]=0.68415174 while the empirical probability is 0.81088.
Comment: If `lambda = 0.2205776` (i.e., the mu in your comment), then prob does not equal `1/(1+lambda)`.  Instead, try the call with `mu = 0.2205776`, `size = shape`.
Answer: There is no need to discretize a gamma distribution; the negative binomial distribution is already discrete.  Once you have the parameter estimates for the negative binomial, you are done, except for the plotting:
size <- 2.080522
mu <- 0.2205776

est_cdf <- pnbinom(0:6, mu=mu, size=size)
emp_cdf <- cumsum(c(40544, 8082, 1205, 145, 20, 3, 1)) / 50000

plot(emp_cdf ~ c(0:6), type = 'b', pch=17, xlab="X values", ylab="CDF")
lines(est_cdf ~ c(0:6), type = 'b', lty=2, pch=16, col=2)
legend("topleft", col=c(1,2), pch=c(17,16),
       legend = c("Empirical CDF",
                  "NB Estimated CDF")
)

which generates:

showing an almost perfect fit, with the red lines and points on top of the black ones.  For a numerical comparison of the negative binomial fit (est_cdf) with the data (emp_cdf), we get:
est_cdf
[1] 0.8108675 0.9725817 0.9964581 0.9995712 0.9999502 0.9999944 0.9999994
emp_cdf
[1] 0.81088 0.97252 0.99662 0.99952 0.99992 0.99998 1.00000


Load Data Infile Error with date

Question: I am trying to load a .csv file that has 5 columns into a table that has the same corresponding columns plus a PK. Dates are data type DATE and all others are Varchar(), except PK.
Here is my load data Import:
LOAD DATA INFILE 'C:\Events_Upload.csv'
INTO TABLE db.events
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
Ignore 1 lines
(
Event_Name,
Event_Handle,
Create_Date,
Retire_Date,
Event_Desc
)

The error is :
Error Code: 1292. Incorrect date value: '' for column 'Retire_Date' at row 1

Row one  in CSV looks like:
Time to Send Survey,SurvESend,2013-04-10,,Time for the system to send out the Esurveys
How can I make this field NULL and not blank for uploading from CSV?
Answer: There is nothing as null in CSV file. What you can do is may be provide some default value for the missing column and replace it with null by the query after insertion into the table.
Or you can have a look at skipping-empty-csv-objects
check this Export null to .csv and https://superuser.com/questions/390031/how-to-write-null-into-csv-from-excel-for-blank-fields

Load Data Infile Error with date


have a reverse but still getting problems with reverse DNS pointing to unknown hostname

Question: I am having problems sending email from a domain I host myself.
I have omitted the actual ip address in question, I am not sure how secure it is that I post it. However the problem is as follows:
According to my ISP the reverse was done for the my IP to point to the FQDN taht follows.
(XXX.XXX.XXX.XXX) -> mymachine.domain.com
However I still get email undelivered:
host inc.wanadoo.es[xxx.xxx.xxx.xxx] refused to talk to me: 550 Reverse DNS lookup failed for host xxx.xxx.xxx.xxx.
and upon testing I get the following error:
Reverse for xxx.xxx.xxx.xxx points to an unknown host name (mymachine.mydomain.com).
The weirdest, perhaps, is that using some tools (i.e mxtoolbox)  to check that the rDNS agrees to my SMTP banner, all checks fine, however, it fails when I use other tools.
What can be the error?
Do I need a reverse for every single domain I host or is it enough with the one for the mail server?
Bluetxxth

Ubuntu Server 10.04. LTS
Bind9
Postfix version 2.x.x

Edit:
In trying what you suggested I received the following:
first test
host -t a neo001.neoclash.com 22.214.171.124

mymachine.mydomain.com 18.104.22.168 Using domain server: Name: 188.8.131.52 Address: 18.104.22.168#53 Aliases:

Host mymachine.mydomain.com not found: 3(NXDOMAIN)

second test
host -t ptr 126.96.36.199.in-addr.arpa 18.104.22.168

host -t ptr 188.8.131.52.in-addr.arpa 220.127.116.11 Using domain server: Name: 18.104.22.168 Address: 18.104.22.168#53 Aliases:

Host 184.108.40.206.in-addr.arpa not found: 3(NXDOMAIN)

zone configuration
$TTL 12H
$ORIGIN mydomain.com.

enter@  IN  SOA ns1.mydomain.com. postmaster.mydomain.com. (
        2011030805
        8H
        2H
        7D
        1D )
            IN              NS              ns1.mydomain.com.
            IN              NS              ns2.mydomain.com.
            IN              MX      10      mail.mydomain.com.
            IN              MX      20      mail.anotherdomain.net.

mydomain.com. IN A 22.214.171.124

www IN A 184.108.40.206

mydomain.com. IN TXT "v=spf1 a mx ip4:184.108.40.206 ip4:184.108.40.206 ~all"

localhost IN A 127.0.0.1

mail IN A 220.127.116.11
mail IN A 220.127.116.11
ns1 IN A 188.8.131.52
ns2 IN A 184.108.40.206

Comment: In the configuration file that you posted there is no A record for neo001
Answer: Try this:
host -t a mymachine.domain.com 184.108.40.206

This queries Google's public DNS servers and asks them what the IP address for mymachine.domain.com is.  Now assuming the IP address is 220.127.116.11 try this:
host -t ptr 184.108.40.206.in-addr.arpa 126.96.36.199

Is the response mymachine.domain.com ? If yes, then you have to wait a while for DNS caches to expire and read the new information. If not, then depending where the unexpected result appears, there exists a problem to be solved.
Comment: it did not seem to work
Comment: Assuming the host in question is [I removed the server name], the first query failure means that the name does not exist, meaning that ns1 and ns2.[domain here].com are not configured to serve the A record for this name. Fix this first.
Comment: the A record seems fine where how can I post the sample file with the record?
Comment: You posted the configuration file and there is no A record for neo001
Comment: Either that, or similar to the www line.
Comment: would the corresponding configuration file for neo include the FQDN for the domain, that is, including the machine name as in neo.mydomain.com throughout the file substituting mydomain.com by neo.mydomain.com? or just one single A record for neo would  suffice?


Sextuplets in 6/8 time

Question: I have a saxophone piece I have to learn that is in 6/8 time. It has 2 groups of sextuplets in each measure but they don't have the 6 over them. How do I count this and how fast is it supposed to be.
Comment: They're not sextuples, they're just groups of six. A tuplet "involves dividing the beat into a different number of equal subdivisions from that usually permitted by the time-signature" (Wikipedia). 6/8 time easily allows 12 subdivisions.
Answer: Are we talking about what's in my picture below?  (Yes, now you've added the picture, I see we are.) Two groups of six notes in a bar of 6/8 isn't any sort of tuplet, it's just normal notation.   Six 8th notes, each split into two.
Answer: They don't need the '6' above them! They're already correct. I guess you're counting 123 456 for other bars in the piece.These notes are just twice as quick, so the 1st, 3rd, 5th, 7th 9th and 11th of them will correlate to 123 456. Just need to fit the even numbered notes in between!
You don't need that '6', just like you don't need '3' for the basic quavers - in 6/8 time.They're not technically sextuplets.
Comment: Thank you! If I were using a metronome that was counting the six beats in the measure, do I just play them as eighth notes?
Comment: Twice as quickly as you play the quavers. Eighth notes are quavers, so twice the speed of them.
Comment: But to really know how fast to play them, we'd need to see the tempo marking.
Answer: A 6/8 time signature usually indicates a compound duple metre. This means that each beat contains a triple pulse (compound) and there are two of these (duple) in a bar.
The bar you showed, conforms to this pattern and is perfectly normal notation for 6/8.
Had the bar contained tuplets, you would have seen a different number of notes with the same note value. Now there are 12 sixteenth notes in the bar.
Had there e.q. been one quadruplet somewhere in this bar, you would have seen 10 sixteenth notes and a 4 over that grouping of notes that forms the tuplet.
Comment: There are lots of terms in the answer that will likely be unfamiliar to the OP. I'd suggest that if the OP found concepts like "compound duple metre" helpful then they probably wouldn't have posted this question. Could you refine this answer, expressing it without using terms like compound, duple, triple, pulse or tuplet, to make the answer more useful to the person who raised the original question?

Sextuplets in 6/8 time


Change php modules directory

Question: I am compiling php, and its setting my modules directory to /usr/lib64/20090626-zts
I would like to change this to /usr/lib64/php/modules, but I cannot find a configuration option to do so.
I can change it in my php.ini and move the directory, but when I run phpize and make a new module it still puts it in /usr/lib64/20090626-zts
Comment: Haven't have time to test this: `EXTENSION_DIR=/usr/lib64/php/modules phpize`.
Answer: Check the current extension directory with:
php-config --extension-dir

and you can change it by setting extension_dir in php.ini:
extension_dir="/usr/lib64/php/modules"

Don't forget to restart Apache.
Answer: I would suggest making /usr/lib64/php/modules a symlink to the folder with the ID. This prevents mixing extensions from different versions of PHP in the long run.
Besides that: You should be able to set it by setting EXTENSION_DIR as environment variable before running PHP's configure. something like
 $ EXTENSION_DIR=/my/location ./configure --with-some-extension

Comment: Yeah that makes sense, I don't want my modules to conflict in the future.  I think I will just leave the folder name alone.
Answer: My issue was not identical, but since this question was the first to pop up with answers that were ultimately very helpful, I will add my comments.
I was having trouble getting PHP (under Centos7 running in a docker container) to use MySQL due to directory configuration - although I was using pre-built binaries and not compiling anything. Although the various pdo and mysqlnd.so modules and .ini files were installed in my container (just using standard yum install php72 and all the other stuff specified in the PHP install wizard), they were not in the default places that PHP was looking for them. I have no idea why. Maybe it's some kind of docker thing?
Anyway, to solve the issue I had to echo an extension_dir directive to my PHP.ini and ALSO set the PHP_INI_SCAN_DIR env variable. These are the relevant commands from my Dockerfile
ENV PHP_INI_SCAN_DIR=/etc/php.d/
RUN echo 'extension_dir = "/usr/lib64/php/modules"' >> /etc/opt/remi/php72/php.ini

I hope this doesn't result in getting module conflicts later down the track as @johanes warns.
Comment: I say that php-* packages (single version) use standard paths, and php72-php-* (SCL, multiple versions) use /opt/remi. See https://blog.remirepo.net/pages/English-FAQ#scl
Comment: > "they were not in the default places. "

You didn't follow the wizard instructions properly, choosing "single version", everything in installed in default places. SCL use different paths to allow multiple versions.
Comment: @RemiCollet thanks for the response. I chose single version from the wizard - which is what I think I want since I only want one version of PHP on my container. The only part of the wizard instructions that I didn't add in my dockerfile was ` yum --enablerepo=remi-php72-test install php-xxx` and `yum update`. Am I missing something here?
Comment: These latest commands are for test packages, and for additional extension (replace xxx by the name of the extension you want)
Comment: @RemiCollet Sorry, I must be a bit dumb. Are you saying that if use the test packages this will fix my problem of the mysql modules not going into the  `.../remi/...` folders?
Comment: OK, thanks for that. Changing my install from
`yum install php72 php-mysqlnd php-pdo php72-mod_php`
to
`yum install php php-mysqlnd php-pdo php-mod_php
`
Did the trick. I was mixing my install up. Thanks for your patience.

Change php modules directory


How to interpret a non significant independent variable?

Question: I conducted a regression analysis using R's lm() function. One of the independent variables shows no significance (p = 0.89), which contradicts the hypothesis that is should have a significantly positive effect on the dependent variable.
How do you interpret that? Can you say that it has no positive effect on the dependent variable, just because it is not significant - even though it is not significantly negative?
Answer: You can't say that. You can only say you've not been able to confirm with a reasonable degree of confidence that it has a positive effect. Looking at a confidence interval of the regression coefficient will be more informative - you may be able to say you're confident it has a negligible effect.
Comment: What an odd question! It depends entirely on your purpose in carrying out the regression, as common sense should tell you. But in general I tend to write/talk *more* about why expected effects weren't found than why expected ones were.
Comment: Scorthi, thanks for your reply. I understand your point. I have a question regarding the word count devoted to insignificant regressors: Say I have two regressors: one that is significant and goes against the hypothesis and another that is non significant. How much would you write for interpreting each regressor: 50/50? I was going to do 80/20, writing mostly about the significant regressor and just a little about the non significant one... What do you think?


drupal q=vectorize-files means which php file?

Question: I started learning drupal today but I am unable to understand where https://www.artworkgeeks.com/vectorize-files is going. In htaccess file any url is getting pointed to index.php?q=$l but I dont understand which php file in which folder is getting executed. I know this is really basic but I m unable to find out answer online.
How to detect which template file and which php file is getting executed for particular url. Some other developer have removed all of the site theme control and module control options from admin panel. Now how to locate files.
Answer: There is no specific "file" to find as paths don't need to map to files in Drupal. One registers a path in the system by implementing hook_menu.
hook_menu() {
  return array(
    'vectorize-files' => array(
      'page callback' => 'some_function',
    ),
  );
}

I would start by grepping or otherwise searching all the custom modules of the site for the string "vectorize-files", which is the path you are looking for. You should be able to find a .module file that defines this path.
Failing that, the path is registered, together with it's module name , in the menu_router table, where you can track down it's origin.
Comment: @AyazAlavi Drupal has a menu registry system, it's not a one-path-per-file type of deal. You'll have to dig to find what you're looking for, no-one without access to the full code will be able to give you the answer. The best place to start would be in all files with the `.module` extension under "sites/all/modules".
Comment: To add to what said by Letharion, in some cases the page callback is `drupal_get_form()`; in such cases, the function that builds the form is reported in "page arguments."
Comment: where this hook_menu function is written? Can you please tell me the filepath and folder?
Comment: I updated the answer to make more explicit some points, and incorporate @Clive's suggestion.


Detect terminal type with tput

Question: I would like to configure the terminal type by detecting it. For example when I am connecting to a Solaris box with PuTTY, the $TERM variable is set to vt100. I would like to negotiate this so, when the terminal emulator is PuTTY, to set $TERM to xterm.
I've noticed that at ^E PuTTY answers back with PuTTY. But I think that the best method is to use tput to try to detect the terminal emulator type. The problem is that I could not find any reference in the terminfo or tput manual how to do this.
Otherwise I will try with something based on:
unset remote_term;echo $'\cE';read -rt 1 -n5 remote_term ;echo remote_term=$remote_term

Answer: Any reason why you can't just set the connection options in PuTTY to negotiate the desired terminal type?
Under PuTTY configuration, Click Connection -> Data, and then set the "Terminal-type string" in the Terminal Details section to whatever terminal type you want. Mine is set to ansi but you can easily change that to xterm.
This is more elegant than intercepting the Ctrl-E answerback as it respects the user's intent for the terminal type.
Comment: The environment is a shared between multiple teams and they are using different terminal emulators. Sometimes serial console. PuTTY is just an example.
Comment: thanks,now by default is XTerm for Putty (12)
Answer: Perhaps this is too simple, but if you're concerned about your user-environment (and assuming everyone has their own account, and there's no crazy account-sharing going on where a bunch of people use the same username+password combo)...
Why not just add something into your own shell's environment file?
Korn (/bin/ksh) Shell (~/.kshrc)
##############################################################################
## TERM control - if we're on the console, fix it up.
TTY=` /usr/bin/tty ` # Really should call /bin/tty in HP-UX in case of S.U.M.
TTY_DEV=${TTY##*/dev/}
if [[ ${TTY_DEV} = "console" ]]; then
## Most serial-line consoles report "/dev/console" when you use 'tty'
## Since most consoles don't set their columns and rows, resulting in weird
##   stuff when we open things like 'vi', we call 'resize' (if it's present)
   if [[ -x /usr/openwin/bin/resize   ]]; then
      printf "Console...\c"
      export PATH=${PATH}:/usr/openwin/bin && \
      /usr/openwin/bin/resize >/dev/null 2>&1 && \
      printf "fixed. \n" || \
      printf "something's broke.\n"
   elif [[ -x /usr/bin/X11/resize     ]]; then
      printf "Console..."
      export PATH=${PATH}:/usr/bin/X11 && \
      /usr/bin/X11/resize >/dev/null 2>&1 && \
      printf "fixed. \n" || \
      printf "something's broke.\n"
   else
      printf "No resize binary found, check console settings.\n"
   fi
else
   TERM=xterm
fi

Bourne Again (/bin/bash) Shell (~/.bashrc ~/.bash_profile)
(The above code should work without a problem)
Regular Bourne (/bin/sh) Shell (~/.profile)
(The above code, but /bin/sh doesn't do variable-splitting, so TTY_DEV will have to get more creative.)
Comment: It is useful, but not what I was looking for. Thank you!

Detect terminal type with tput


Erro de Redirecionamento de Página -URL

Question: Sou super iniciante com Python e Django e infelizmente estou sofrendo bastante com urls. O problema que dá é de "Página não encontrada (404)". Segue abaixo trechos do código:
urls.py
from django.conf.urls import patterns, include, url
import web.views
urlpatterns = [

    #url(r'^$/', 'web.views.home', name='home'),
    url(r'^web/', 'views.index'),

]

views.py
from django.shortcuts import render_to_response, render
from django.http import HttpResponseRedirect # Funcao para redirecionar o usuario
#Criar as Views aqui

# pagina inicial do projeto dweb
def index(request):
    return render_to_response("index.html")

Comment: Você está usando `DEBUG = True` no `settings.py`? Qual URL está dando esse erro? Se seu servidor está executando por exemplo em `localhost:8000` (o padrão do `runserver`) então a única página que deverá estar disponível - pelas regras do seu `urls.py` - é a `http://localhost:8000/web/`. É essa URL que está dando 404? Ou é outra?
Comment: Olá Earendul, Bom Dia!!... Sim, estou usando o DEBUG = True. Esta é a url q está dando erro:  url(r'^web/', 'views.index'), mesmo eu adicionando essa url. Ele me redireciona para essa: http://127.0.0.1:8000/. Aí dá o erro!!
Comment: Esse `views.index` não deveria ser `web.views.index`?
Comment: Olá  mgibsonbr, boa tarde!!... Consegui resolver mais de outra forma, veja o que postei agora! Mas essa pergunta que vc me fez está corretíssima, seria isso mesmo no caso anterior!!... Obrigada :)!!
Answer: fazendo algumas pesquisas consegui resolver esse problema de outra forma. Mas desde já agradeço pela ajuda de todos! Vejam abaixo como ficou:
urls.py
from django.conf.urls import patterns,include, url
from django.contrib import admin

urlpatterns = [

    url(r'^admin/',include(admin.site.urls)),
    url(r'^$', 'web.views.homepage', name="index"),

]

views.py
__author__ = 'Sara Fernandes'

from django.shortcuts import render_to_response, render
from django.template import RequestContext, loader

#from django.http import HttpResponseRedirect # Funcao para redirecionar o usuario
#Criar as Views aqui

# pagina inicial do projeto dweb

def homepage(request):
    return render_to_response('index.html',
        context_instance= RequestContext(request))

Erro de Redirecionamento de Página -URL


How to pull data from field with multiple values in SQL

Question: I know this is going to be so simple but for the life of me I cannot figure it out. I am trying to pull denial codes in my query that are either 35 or 48. The thing that is holding me up is a lot of these products have multiple denial codes and can contain my denial code but the results are only bringing back the products with the exact 35 or 48 code. For example product one might have denial 10,35,93. My query is not returning this line, instead its only returning those with 35 only. Thank you in advance.
<code>SELECT *
FROM PRODUCT_DENIAL_DETAILS
WHERE SOLD_DATE > SYSDATE -90
AND DENIALCD IN ('35','48')
</code>
Comment: Please show your table schema, and sample rows.
Answer: Then you have to use a wildcard in your condition.
<code> AND (DENIALCD LIKE '%35%' OR DENIAL CODE LIKE '%48%')
</code>
This will bring back any rows with the 35 or 48 in the field.
Comment: Although, I would suggest that you rethink the design of the relations in your database and maybe just keep a single code per row which makes your querying etc a little better.
Comment: Ahh I just knew it was going to be something simple! Thank you so much :)


Rename Active Directory domain following Windows 2000 -> 2008 migration

Question: I'm working with a site that needs an internal DNS domain rename. It currently has a DNS name of domain.abc.com and NT name of ABC. I'm trying to get to a DNS name of abctrading.com and NT name of ABCTRADING. Split DNS would be used.
The site originally ran from a single Windows 2000 domain controller hosting AD, file, print, DHCP and DNS services. There was no Exchange system in the environment. The 50 client PCs are all Windows XP with a handful of users using roaming profiles. All users are in a single OU and there are no group policy/GPOs.
I'm a Linux engineer, but have been trying to guide another group of consultants to reach a more suitable setup. With the help of this group, we were able to move the single Windows 2000 system to a set of Windows 2008 R2 servers separated into domain controller and file/print systems (virtualized). We are also trying to add an Exchange 2010 system to this mix. The Windows 2000 server was demoted and is no longer in the picture.
This is the tricky part, as client wants the domain renamed and the consultants aren't quite sure how to get through it without another 32-40 hours of testing/implementation. THey say that there's considerable risk to do the rename without a completely isolated test environment. However, this rename has to be done before installing Exchange. So we're stuck at this point.
I'd like to know what's involved in renaming the domain at this point. We're on Windows Server 2008. The AD is healthy now. Coming from a Linux background, it seems as though there should be a reasonable path to this. Also, since the original domain appears to be a child/subdomain, would that be a problem here.
I'd appreciate any guidance.
Comment: (Now that I've calmed down...)  I'd urge you to STRONGLY consider not using the same domain name for your public DNS presence and your Active Directory domain. Split DNS provides no advantages and only creates work. Worse, there are some situations (see http://serverfault.com/questions/241649/active-directory-dns-change-entry-only-on-one-site for an example) where your split DNS and the default behavior of AD DNS will cause actual "impossible" situations. There is no loss of functionality by having your AD domain name and public DNS using different names.
Comment: Suppose I went to `abctrading.local` and eliminated the split dns portion. The rest of the question remains valid. Is a domain name change still reasonable at that point? Is 32-40 billable hours still a reasonable number?
Answer: In my opionion 32 - 40 billable hours to perform the testing necessary for a domain rename in such a small infrastructure is insanely high.
The configuration you describe could be tested in an afternoon with a couple of physical "scratch" client computers, a virtual domain controller, and a virtual member server on an isolated LAN.
I'd start by obtaining a test domain controller by installing a VM connected to the LAN, joining it to the domain, and promoting it to a domain controller. I'd install a DNS server, mark it as a Global Catalog server, and set it to refer to itself for DNS. Once all AD replication completed I'd take a snapshot of the VM, and then demote it back to being a member server before removing it from the domain. This leaves the production AD domain in a state consistent with how it started.
I'd detach the VM host from the LAN (or otherwise isolate it), reboot the domain controller VM from the snapshot taken when it was still a DC and seize the FSMO roles to it. This gives you a DC "under glass" to work from. I'd join a couple of "scratch" client computers to the domain hosted by the DC in the  isolated network, and bring up a test file server VM as a member server. Once I verified that the "domain under glass" functioned properly I'd proceed with taking snapshots (to give me a fall-back position to re-start testing) and start the domain rename resting.
Domain rename without an Exchange 2003 infrastructure to worry about isn't something you should be too scared of. It's reasonably well documented (others provide links in their answers that are reasonable) and is "supported" by Microsoft. As you've already noted, doing it before you deploy Exchange is important because this is your last chance to rename the domain.
Comment: Thank you. We are going with this approach, modified slightly to take a clean snapshot of the sole domain controller. The consultants are still citing two days to replicate and test, but it seems to be the best way to accomplish the domain rename.
Answer: Can't emphasize enough that you should listen to your consultants.  It's hard coming from the *nix world to understand just how... ahem "non-deterministic"... Microsoft products are.
Add that to the absolutely vital nature of your domain services, especially authentication/authorization and the risk analysis is clear on this one:  let them take the time to test it if you're going to do a domain rename.
Comment: I don't want to get into an OS flame war, but I strongly disagree w/ your statement re: Microsoft products acting in a "non-deterministic" manner. Any product that isn't fully understood is going to appear to act non-deterministically, proprietary or otherwise.
Answer: You should be able to find the information and guidance you need here:
http://technet.microsoft.com/en-us/library/cc794907(WS.10).aspx
Comment: I'm being told by the Windows consultants that there's considerable risk to doing this and that an isolated test environment is necessary to prevent destroying Active Directory.
Comment: There is a certain amount of risk involved and the consultants are being prudently cautious. The information at the link is what you need to know in order to undertake the domain rename and it's up to you to determine how much risk you're willing to expose yourself to and how best to go about achieving the objective. I wouldn't fault the consultants for wanting to proceed carefully.
Answer: It sounds like you have got everything in place to rename the domain. I think that each client of the domain will have to reboot twice to pick up the new domain name.
Also be careful when running DCs in a virtual environment, they are supported but there are certain things you need to consider. Please see the following sites.
http://support.microsoft.com/kb/888794
http://www.microsoft.com/downloads/details.aspx?FamilyId=64DB845D-F7A3-4209-8ED2-E261A117FC6B&displaylang=en


Puiseux series over a non algebraically closed field.

Question: Suppose that $K$ is a field of characteristic $0$ and $L/K$ is an extension so that every degree $\leq n$ polynomial over $K$ splits in $L$. We do not assume that $L$ is algebraically closed.
It is a classical fact that the algebraic closure of $K[[t]]$ is $K[[t^{1/n} : n \geq 1]]$ when $K$ is algebraically closed. In our set up, is it true that every degree $n$ polynomial over $K[[t]]$ splits completely over $L[[t^{1/n!}]]$?
I think the classical proof of Newton-Puiseux expansions can be modified to prove this but I would be very happy if there were a reference.
Comment: Thanks for the correction!
Comment: "The algebraic closure of $K[[t]]$ is $K[[t^{1/n} : n \ge 1]]$" doesn't need $K$ to be algebraically closed?
Comment: Sorry, that statement does.
Answer: Thanks to this question, I found a proof that can be pretty easily modified to show what I want.
We will use a form of Hensel's lemma which says that if we have a polynomial $f$ over $K[[t]]$ that splits into $f = gh$ over $t = 0$ with $\gcd(g,h) = 1$, then we can find a lifting of the splitting to $K[[t]]$.
Now suppose we have a polynomial $f(x)$ of degree $d \leq n$ over $K[[t]]$. We show that it has a non trivial factorization over $L[[t]]$. First, we make a linear change of variables so that:
$$f(x) = x^d + a_2(t)x^{d-1} + \dots + a_0$$
and then define:
$$g(x) = t^{-d\delta}f(xt^{\delta}) = x^d + b_2(t)x^{d-1} + \dots + b_0$$
where we choose $\delta = \mathrm{val}_t(a_i(t)/i)$ so that the $b_i(t)$ have a positive $t$-valuation and are not all zero modulo $t^{1/n!}$. (This step is why we need to adjoin $t^{1/n!}$).
Then, we see that $g(x) \pmod{t^{1/n!}}$ is of the form $x^d + c_2x^{d-2} + \dots + c_0$
over $L$ with the $c_i \in K$ and not all of them $0$. Since the $x^{d-2}$ term is $0$ and one of the other terms is not, we see that $g(x) \pmod{t^{1/n!}}$ is not of the form $(x-\gamma)^d$ so it factors into two non trivial, co prime factors over $L$. (This is where we use the fact that every degree $\leq n$ polynomial over $K$ splits over $L$).
By Hensel's lemma, we can now lift our factorization to $L[[t]]$.


Let $B_0=\{(2,2),(-4,4)\}$. Let $A={\rm span}_\Bbb Z(B_0)$. Prove that $A$ is a free abelian group of rank $2$.

Question: Let $B_0=\{(2,2),(-4,4)\}$. Let $A={\rm span}_\Bbb Z(B_0)$. Prove that $A$ is a free abelian group of rank $2$.
I know that A will cover all of the even numbers. However, I am not sure how to prove it is a free abelian group.
Is it enough to show that $B_0$ is a basis of A? Or would it be better to show that it is isomorphic to $\Bbb Z^2$?
For the rank I believe that it is just the cardinality of the basis (which would be B right? and since it has 2 elements it will have rank 2?
Answer: You need to show, first, that $B_0$ is linearly independent over $\Bbb Z$ before claiming that its cardinality is enough to show that $A$ has rank two.
It suffices, then, to show that, if $a=(2,2), b=(-4,4)$, then
$$A\cong\langle a,b\mid ab=ba\rangle;$$
that is, indeed, that $A\cong \Bbb Z^2.$


How can I call the method of the great grandfather in Javascript?

Question: I would like to call a method from the great grandfather to the Athlete class,
How can I do that?
I tried using super.printSentence but that did not work,
Is this the correct way to invoke the method, super.printPositon() in the Athlete class?
Any suggestion on how to invoke this printSentence method?

class Person {
  constructor(name) {
    this.name = name;
  }

  printName() {
    console.log(this.name);
  }
}

class TeamMate extends Person {
  constructor(name) {
    super(name);
  }

  printSentence() {
    console.log(super.printName(), "is an excellent teammate!" );
  }

}

class SoccerPlayer extends TeamMate {
  constructor(name, teamMateName, position) {
    super(name, teamMateName);
     this.teamMateName = teamMateName;
    this.position = position;
  }

  printPositon() {
    console.log("Positon: ", position);
  }
}

class Athlete extends SoccerPlayer{
  constructor(name, teamMateName, position, sport) {
    super(name, teamMateName, position);
    this.sport = sport;
  }

  printSport() {
    console.log("Favorite sport: ", this.sport);
  }

  //If Athlete class extends from SoccerPlayer and SoccerPlayer extends from
    // the TeamMate class, how can I invoke the printSentence method
    // from the TeamMate class in this current Athlete class?

  printGreatGrandFatherMethod() {
    return this.printSentence()
  }
}

const soccerPlayer = new Athlete('PLAYER1', 'Frederick', 'Defender', 'Soccer');
console.log(soccerPlayer.printGreatGrandFatherMethod());

Why am I getting undefined for the name field?
Comment: `console.log(super.printName() "is an excellent teammate!" );` that should be a nice error message in your console.
Comment: Unless you've overridden the method in the current class and need to call the inherited method, you don't need to specify the class explicitly.
Comment: `this.printSentence()`?
Comment: You've misspelled *Position* as `Positon` in a few places.  Also `printSentence()` doesn't return a value.
Answer: Just to this.printSentence()
In inheritance (prototype or not) the this has access to all the methods.
Unless you are using private method like this:
class ClassWithPrivateMethod {
  #privateMethod() {
    return 'hello world';
  }
}

If you think about it, if a Person has a name any class that inherited from Person will also have a member name. This is also true to any instance of a class that inherits from Person. for example:
const soccerPlayer = new SoccerPlayer('PLAYER1', 'MATE NAME', '1');
console.log(soccerPlayer.name); // Prints `PLAYER1`

Answer: printSentence() doesn't return a value, so return this.printSentence() will return undefined.  And since that's what printGreatGrandFatherMethod returns, therefore console.log(soccerPlayer.printGreatGrandFatherMethod()); will log undefined.
Same goes for printName() which doesn't return a value either and therefore console.log(super.printName()) will log undefined
Comment: You can't concatenate the log of one function with the log of another function.  But you could just return strings from all those functions (instead of calling console.log) and then have the _caller_ of those functions do the logging.  i.e.:  `printName` becomes `getName` which returns `this.name` and you `console.log(soccerPlayer.getName())`   `printSentence` becomes `getSentence` and returns `this.getName() + " is an excellent teammate!"` and you call `console.log(soccerPlayer.getSentence())`
Comment: How can I get a value in this case?


VAR check after match end?

Question: Man Utd were awarded a match-winning penalty at Brighton following a VAR check from referee Chris Kavanagh - after he had already blown the full-time whistle.
A question:
According to the literature, what happens if the VAR identifies a clear mistake in a match-changing incident after the referee has blown the whistle for half-time or full-time?
Answer: Law 5 answers this directly.
Section 2, Decisions of the Referee provides that

The referee may not change a restart decision on realising that it is incorrect or on the advice of another match official if play has restarted or the referee has signalled the end of the first or second half (including extra time) and left the field of play or abandoned the match. However, if at the end of the half, the referee leaves the field of play to go to the referee review area (RRA) or to instruct the players to return to the field of play, this does not prevent a decision being changed for an incident which occurred before the end of the half.

In effect, the referee can change a decision regarding something that happened before the game ended, even though they have already indicated full time, as long as they're still on the field of play (or have left it to conduct a review or to recall the players).
Answer: "There is no time limit for the review process as accuracy is more important than speed" -IFAB
Any match changing decisions/incidents reviewable by VAR can be reviewed even after the restart.
So because the handball happened prior to the referee blowing for full-time it's allowed for VAR to check the incident.
https://www.theifab.com/laws/chapter/38/section/113/

VAR check after match end?


Evaluate $\int_0^{\infty}\frac{e^x-1}{xe^x(e^x+1)}dx.$

Question:
Evaluate the integral
  $$
\int_{0}^{\infty}{\mathrm{e}^{x} - 1 \over x\,\mathrm{e}^{x}\left(\mathrm{e}^x+1\right)}\,\mathrm{d}x\,.
$$

I have no idea how to approach integrals like this and I can't get any valuable result. Any hints will be appreciated.
Comment: Would a more experienced user be willing to explain to me what exactly is off-topic about this very difficult mathematical question? I genuinely don't get it.
Answer: Note that $$I=\int_{0}^{\infty}\frac{e^{x}-1}{xe^{x}\left(1+e^{x}\right)}dx=\int_{0}^{\infty}\frac{e^{-x}-e^{-2x}}{x\left(1+e^{-x}\right)}dx
 $$ $$=\sum_{k\geq0}\left(-1\right)^{k}\int_{0}^{\infty}\frac{e^{-x\left(k+1\right)}-e^{-x\left(k+2\right)}}{x}dx
 $$ and now we can use the Frullani's theorem and get $$I=\sum_{k\geq1}\left(-1\right)^{k+1}\log\left(\frac{k}{k+1}\right)=\log\left(\prod_{k\geq1}\left(\frac{k}{k+1}\right)^{\left(-1\right)^{k+1}}\right)
 $$ and now note that $$\prod_{k \leq 2N}\left(\frac{k}{k+1}\right)^{\left(-1\right)^{k+1}}=\prod_{k=1}^{N}\frac{2k}{2k+1}\prod_{k=1}^{N}\frac{2k}{2k-1}=\frac{\pi N!^{2}}{2\Gamma\left(N+\frac{3}{2}\right)\Gamma\left(N+\frac{1}{2}\right)}\rightarrow\frac{\pi}{2}
 $$ where the last limit can be calculated using the Stirling's approximation. This product is also known as the Wallis product. So $$\int_{0}^{\infty}\frac{e^{x}-1}{xe^{x}\left(1+e^{x}\right)}dx=\color{red}{\log\left(\frac{\pi}{2}\right)}.$$
Answer: Notice that
\begin{align*}
\int_{0}^{\infty} \frac{e^x - 1}{x e^x(e^x + 1)} \, dx
&= \int_{0}^{\infty} \left( \int_{0}^{1} e^{xt} \, dt \right) \frac{dx}{e^x(e^x+1)} \\
&= \int_{0}^{1} \int_{0}^{\infty} \frac{e^{tx}}{e^x(e^x+1)} \, dxdt.
\end{align*}
In order to compute the inner integral, we utilize the geometric series as follows:
\begin{align*}
\int_{0}^{\infty} \frac{e^{tx}}{e^x(e^x+1)} \, dx
&= \int_{0}^{\infty} \frac{e^{-(2-t)x}}{1+e^{-x}} \, dx \\
&= \sum_{n=0}^{\infty} (-1)^n \int_{0}^{\infty} e^{-(n+2-t)x} \, dx \\
&= \sum_{n=0}^{\infty}\frac{(-1)^n}{n+2-t}. \tag{1}
\end{align*}
Plugging this back, we have
\begin{align*}
\int_{0}^{\infty} \frac{e^x - 1}{x e^x(e^x + 1)} \, dx
&= \sum_{n=0}^{\infty} (-1)^n\int_{0}^{1} \frac{dt}{n+2-t} \\
&= \sum_{n=0}^{\infty} (-1)^n ( \log(n+2) - \log(n+1) ) \\
&= \log \left( \frac{2}{1} \cdot \frac{2}{3} \cdot \frac{4}{3} \cdot \frac{4}{5} \cdot \frac{6}{5} \cdot \frac{6}{7} \cdots \right) \\
&= \log \left(\frac{\pi}{2}\right),
\end{align*}
where in the last line we utilized the Wallis product. Alternatively, we can identify $\text{(1)}$ as
$$ \int_{0}^{\infty} \frac{e^{tx}}{e^x(e^x+1)} \, dx = \frac{1}{2}\left( \psi_0\left(\frac{3-t}{2}\right) - \psi_0\left(\frac{2-t}{2}\right) \right), $$
where $\psi_0$ is the digamma function. Plugging this back gives
$$ \int_{0}^{\infty} \frac{e^x - 1}{x e^x(e^x + 1)} \, dx = \log\left( \frac{\Gamma\left(\frac{3}{2}\right)\Gamma\left(\frac{1}{2}\right)}{\Gamma(1)^2} \right) = \log\left(\frac{\pi}{2}\right). $$
Answer: $\newcommand{\bbx}[1]{\,\bbox[15px,border:1px groove navy]{\displaystyle{#1}}\,}
 \newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack}
 \newcommand{\dd}{\mathrm{d}}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,}
 \newcommand{\ic}{\mathrm{i}}
 \newcommand{\mc}[1]{\mathcal{#1}}
 \newcommand{\mrm}[1]{\mathrm{#1}}
 \newcommand{\pars}[1]{\left(\,{#1}\,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,}
 \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}}
 \newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$
\begin{align}
\int_{0}^{\infty}{\expo{x} - 1 \over x\expo{x}\pars{\expo{x} + 1}}\,\dd x & =
\int_{0}^{\infty}{\expo{-x} - \expo{-2x} \over x\pars{1 + \expo{-x}}}\,\dd x
\,\,\,\stackrel{\expo{-x}\ =\ t}{=}\,\,\,
\int_{1}^{0}{t - t^{2} \over \bracks{-\ln\pars{t}}\pars{1 + t}}
\,\pars{-\,{\dd t \over t}}
\\[5mm] & =
\int_{0}^{1}{1 \over 1 + t}\,\
\overbrace{{t - 1 \over \ln\pars{t}}}^{\ds{\int_{0}^{1}t^{x}\,\dd x}}\
\,\dd t =
\int_{0}^{1}\int_{0}^{1}{t^{x} - t^{x + 1} \over 1 - t^{2}}\,\dd t\,\dd x
\\[5mm] & \stackrel{t^{2}\ \mapsto\ t}{=}\,\,\,
{1 \over 2}\int_{0}^{1}
\int_{0}^{1}{t^{\pars{x - 1}/2}\,\,\, -\,\,\, t^{x/2} \over 1 - t}\,\dd t\,\dd x \\[5mm] & =
{1 \over 2}\int_{0}^{1}\bracks{%
\int_{0}^{1}{1 - t^{x/2} \over 1 - t}\,\dd t -
\int_{0}^{1}{1 - t^{\pars{x - 1}/2} \over 1 - t}\,\dd t}\,\dd x
\\[5mm] & =
{1 \over 2}\int_{0}^{1}
\bracks{\Psi\pars{{x \over 2} + 1} - \Psi\pars{x + 1 \over 2}}\,\dd x
\end{align}
where
$\ds{\Psi}$ is the Digamma Function and we used the well known identity
$$
\left.\vphantom{\LARGE A}\Psi\pars{z}\right\vert_{\,\Re\pars{z}\ >\ 0} = -\gamma + \int_{0}^{1}{1 - t^{z - 1} \over 1 - t}\,\dd t
$$
$\ds{\gamma}$ is the Euler-Mascheroni Constant. Then,
\begin{align}
\int_{0}^{\infty}{\expo{x} - 1 \over x\expo{x}\pars{\expo{x} + 1}}\,\dd x & =
\left.\ln\pars{\Gamma\pars{x/2 + 1} \over
\Gamma\pars{\bracks{x + 1}/2}}\right\vert_{\ 0}^{\ 1} =
\ln\pars{{\Gamma\pars{3/2} \over \Gamma\pars{1}}\,
{\Gamma\pars{1/2} \over \Gamma\pars{1}}} =
\ln\pars{{1 \over 2}\,\Gamma^{2}\pars{1 \over 2}}
\\[5mm] & =
\bbox[15px,#ffe,border:2px dotted navy]{\ds{\ln\pars{\pi \over 2}}}
\end{align}


How come drawing this line at (0,0) doesn't really draw it at (0,0)?

Question: Update: Once and for all, how can I draw a line that goes from (0,0) to the opposite corner of the stage?
Here is what I have:
<code>package
{
    import flash.display.Sprite;

    import flash.display.LineScaleMode;
    import flash.display.CapsStyle;
    import flash.display.JointStyle;

    import flash.display.Shape;
    import flash.events.Event;

    public class Main extends Sprite
    {

        private var lines:Shape;

        public function Main():void
        {
            if (stage) init();
            else addEventListener(Event.ADDED_TO_STAGE, init);
        }

        private function init(e:Event = null):void
        {
            removeEventListener(Event.ADDED_TO_STAGE, init);
            // entry point

            lines = new Shape();
            addChild(lines);

            lines.graphics.clear();
            lines.graphics.lineStyle(10, 0x000000);

            lines.graphics.moveTo(0, 0);

            lines.graphics.lineTo(stage.stageWidth, stage.stageHeight);
        }

    }

}
</code>
See here for an example of what happens with the file. It's embedded in an HTML page.
Answer: The code works. It's just that the SWF is not the same size as the browser window. If you run the swf directly or if you embed the swf onto a dark colored background you will be able to see that it works.
Comment: On Chrome, the left is offset a bit.


Show NetBIOS name before Username on Windows 7 Logon

Question: I am setting up a new DC using Windows Server 2008 R2, and my FQDN is MFC.com. When I logon to a client computer (E5530.MFC.com) using that domain, instead of showing "MFC\user.name", it shows "E5530\user.name".
How can I get the logon screen to show "MFC\user.name", instead of the computers' name at logon?
To make myself clear, I want my client logon screen to show "MFC\user.name".
Answer: After you log in as "MFC\user.name" and then log out, does it still show "E5530\user.name"?
Also, is there a local user with the same username as the domain user?
If so, would you consider changing one of those? so that you may be able to login directly as user.name and it won't change need "MFC\" before it.
Comment: It always shows "E5530\user.name". There is no local user. I just want it to show "MFC\username"


Drupal cannot find user login page

Question: i was having some problems with my settings.php file.  I fixed this but now my user page isn't found and I cannot login.  Anyone know how to fix this?  Thanks!
Authorize.php loads but obviously i cannot get in
nevermind i think it's an issue with hostgator
Comment: It is helpful to let us know what you have tried; basics: `website.dev/user/login` and `website.dev/?q=user/login` not working?
Comment: okay when i found a login screen and when I try to login i get a 404 error
Answer: Maybe this help others.
If you are using drupal with a temporary URL on a hostgator server, follow this link
http://support.hostgator.com/articles/specialized-help/technical/drupal/using-drupal-with-a-temporary-url
Answer: What kind of problems exactly?
If you changed something in settings.php:

make a backup of settings.php
put back a default one with your DB details
try to login again

If you can't, post here the errors you are getting.
Comment: i am not sure.  hostgator actually fixed my settings.php file.  and i do not want to touch it.  my index page loads now but no other pages load.
Comment: i get a 404 page
Comment: sorry, okay, authorize.php loads but obviously i cannot get in
Comment: Post the settings.php file here. Cut out the database access and the URL but leave everything else.

Drupal cannot find user login page